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