]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-17758.nll.stderr
Merge commit '97e504549371d7640cf011d266e3c17394fdddac' into sync_cg_clif-2021-12-20
[rust.git] / src / test / ui / issues / issue-17758.nll.stderr
1 error[E0521]: borrowed data escapes outside of associated function
2   --> $DIR/issue-17758.rs:7:9
3    |
4 LL | trait Foo<'a> {
5    |           -- lifetime `'a` defined here
6 LL |     fn foo(&'a self);
7 LL |     fn bar(&self) {
8    |            -----
9    |            |
10    |            `self` is a reference that is only valid in the associated function body
11    |            let's call the lifetime of this reference `'1`
12 LL |         self.foo();
13    |         ^^^^^^^^^^
14    |         |
15    |         `self` escapes the associated function body here
16    |         argument requires that `'1` must outlive `'a`
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0521`.