blob: 046c58bd23b3446bb6f41c5678789f44a25dcd96 [file] [edit]
error: cannot capture late-bound lifetime in constant
--> $DIR/escaping-bound-var.rs:6:13
|
LL | fn test<'a>(
| -- lifetime defined here
...
LL | let x: &'a ();
| ^^
error[E0308]: mismatched types
--> $DIR/escaping-bound-var.rs:5:6
|
LL | fn test<'a>(
| ---- implicitly returns `()` as its body has no tail or `return` expression
LL | _: &'a (),
LL | ) -> [(); {
| ______^
LL | | let x: &'a ();
LL | |
LL | | 1
LL | | }] {
| |__^ expected `[(); {
let x: &'a ();
1
}]`, found `()`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0308`.