fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
308 B17 linesraw
1// run-rustfix
2use std::ops::Deref;
3
4struct Foo(u8);
5
6impl Deref for Foo {
7    type Target = u8;
8    fn deref(&self) -> &Self::Target {
9        &self.0
10    }
11}
12
13fn main() {
14    let a = Foo(0);
15    // Should suggest `&*` when coercing &ty to *const ty
16    let _: *const u8 = &*a; //~ ERROR mismatched types
17}