]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-32122-1.rs
New upstream version 1.45.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-32122-1.rs
1 // run-rustfix
2 use std::ops::Deref;
3
4 struct Foo(u8);
5
6 impl Deref for Foo {
7 type Target = u8;
8 fn deref(&self) -> &Self::Target {
9 &self.0
10 }
11 }
12
13 fn main() {
14 let a = Foo(0);
15 // Should suggest `&*` when coercing &ty to *const ty
16 let _: *const u8 = &a; //~ ERROR mismatched types
17 }