]> git.lizzy.rs Git - rust.git/blob - src/test/ui/in-band-lifetimes/no_introducing_in_band_in_locals.stderr
Rollup merge of #87916 - nbdd0121:black_box, r=nagisa
[rust.git] / src / test / ui / in-band-lifetimes / no_introducing_in_band_in_locals.stderr
1 error[E0261]: use of undeclared lifetime name `'test`
2   --> $DIR/no_introducing_in_band_in_locals.rs:5:13
3    |
4 LL | fn foo(x: &u32) {
5    |       - help: consider introducing lifetime `'test` here: `<'test>`
6 LL |     let y: &'test u32 = x;
7    |             ^^^^^ undeclared lifetime
8
9 error[E0261]: use of undeclared lifetime name `'test`
10   --> $DIR/no_introducing_in_band_in_locals.rs:10:16
11    |
12 LL |     let y: fn(&'test u32) = foo2;
13    |                ^^^^^ undeclared lifetime
14    |
15    = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
16 help: consider introducing lifetime `'test` here
17    |
18 LL | fn bar<'test>() {
19    |       +++++++
20 help: consider making the type lifetime-generic with a new `'test` lifetime
21    |
22 LL |     let y: for<'test> fn(&'test u32) = foo2;
23    |            ++++++++++
24
25 error: aborting due to 2 previous errors
26
27 For more information about this error, try `rustc --explain E0261`.