]> git.lizzy.rs Git - rust.git/blob - src/test/ui/inline-const/const-expr-lifetime-err.stderr
Rollup merge of #85766 - workingjubilee:file-options, r=yaahc
[rust.git] / src / test / ui / inline-const / const-expr-lifetime-err.stderr
1 error[E0597]: `y` does not live long enough
2   --> $DIR/const-expr-lifetime-err.rs:24:30
3    |
4 LL | fn foo<'a>() {
5    |        -- lifetime `'a` defined here
6 LL |     let y = ();
7 LL |     equate(InvariantRef::new(&y), const { InvariantRef::<'a>::NEW });
8    |            ------------------^^-
9    |            |                 |
10    |            |                 borrowed value does not live long enough
11    |            argument requires that `y` is borrowed for `'a`
12 LL |
13 LL | }
14    | - `y` dropped here while still borrowed
15
16 error: aborting due to previous error
17
18 For more information about this error, try `rustc --explain E0597`.