]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/user-annotations/method-ufcs-inherent-3.rs
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / ui / nll / user-annotations / method-ufcs-inherent-3.rs
1 // Check that inherent methods invoked with `<T>::new` style
2 // carry their annotations through to NLL.
3
4 struct A<'a> { x: &'a u32 }
5
6 impl<'a> A<'a> {
7     fn new<'b, T>(x: &'a u32, y: T) -> Self {
8         Self { x }
9     }
10 }
11
12 fn foo<'a>() {
13     let v = 22;
14     let x = <A<'a>>::new(&v, 22);
15     //~^ ERROR
16 }
17
18 fn main() {}