]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-32122-1.rs
Auto merge of #96605 - Urgau:string-retain-codegen, r=thomcc
[rust.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 }