rust/tests/ui/nll/user-annotations/method-ufcs-inherent-3.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
321 B
Rust
Raw Normal View History

2018-10-15 05:14:08 -05:00
// Check that inherent methods invoked with `<T>::new` style
// carry their annotations through to NLL.
struct A<'a> { x: &'a u32 }
impl<'a> A<'a> {
fn new<'b, T>(x: &'a u32, y: T) -> Self {
Self { x }
}
}
fn foo<'a>() {
let v = 22;
let x = <A<'a>>::new(&v, 22);
2018-10-16 17:11:55 -05:00
//~^ ERROR
2018-10-15 05:14:08 -05:00
}
fn main() {}