]> git.lizzy.rs Git - rust.git/blob - src/test/ui/methods/method-early-bound-lifetimes-on-self.rs
move an `assert!` to the right place
[rust.git] / src / test / ui / methods / method-early-bound-lifetimes-on-self.rs
1 // run-pass
2 // Check that we successfully handle methods where the `self` type has
3 // an early-bound lifetime. Issue #18208.
4
5 // pretty-expanded FIXME #23616
6
7 #![allow(dead_code)]
8
9 use std::marker;
10
11 struct Cursor<'a> {
12     m: marker::PhantomData<&'a ()>
13 }
14
15 trait CursorNavigator {
16     fn init_cursor<'a, 'b:'a>(&'a self, cursor: &mut Cursor<'b>) -> bool;
17 }
18
19 struct SimpleNavigator;
20
21 impl CursorNavigator for SimpleNavigator {
22     fn init_cursor<'a, 'b: 'a>(&'a self, _cursor: &mut Cursor<'b>) -> bool {
23         false
24     }
25 }
26
27 fn main() {
28     let mut c = Cursor { m: marker::PhantomData };
29     let n = SimpleNavigator;
30     n.init_cursor(&mut c);
31 }