]> git.proxmox.com Git - rustc.git/blob - src/test/ui/regions/regions-bounded-method-type-parameters.rs
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / regions / regions-bounded-method-type-parameters.rs
1 // Check that explicit region bounds are allowed on the various
2 // nominal types (but not on other types) and that they are type
3 // checked.
4
5 // revisions: base nll
6 // ignore-compare-mode-nll
7 //[nll] compile-flags: -Z borrowck=mir
8
9 struct Foo;
10
11 impl Foo {
12 fn some_method<A:'static>(self) { }
13 }
14
15 fn caller<'a>(x: &isize) {
16 Foo.some_method::<&'a isize>();
17 //[base]~^ ERROR does not fulfill the required lifetime
18 //[nll]~^^ ERROR lifetime may not live long enough
19 }
20
21 fn main() { }