summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-32122-1.rs
blob: 3c4859f07a2e7cc92e96b80732d4534b6901d760 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-rustfix
use std::ops::Deref;

struct Foo(u8);

impl Deref for Foo {
    type Target = u8;
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

fn main() {
    let a = Foo(0);
    // Should suggest `&*` when coercing &ty to *const ty
    let _: *const u8 = &a; //~ ERROR mismatched types
}