]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/normalization.rs
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / ui / nll / user-annotations / normalization.rs
1 // Test that we enforce a `&'static` requirement that is only visible
2 // after normalization.
3
4 trait Foo { type Out; }
5 impl Foo for () { type Out = &'static u32; }
6 impl<'a> Foo for &'a () { type Out = &'a u32; }
7
8 fn main() {
9     let a = 22;
10     let _: <() as Foo>::Out = &a; //~ ERROR
11
12     let a = 22;
13     let _: <&'static () as Foo>::Out = &a; //~ ERROR
14
15     let a = 22;
16     let _: <&'_ () as Foo>::Out = &a;
17 }