]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issue-16922.nll.stderr
Rollup merge of #53110 - Xanewok:save-analysis-remap-path, r=nrc
[rust.git] / src / test / ui / issue-16922.nll.stderr
1 warning: not reporting region error due to nll
2   --> $DIR/issue-16922.rs:14:14
3    |
4 LL |     Box::new(value) as Box<Any>
5    |              ^^^^^
6
7 error[E0621]: explicit lifetime required in the type of `value`
8   --> $DIR/issue-16922.rs:14:5
9    |
10 LL | fn foo<T: Any>(value: &T) -> Box<Any> {
11    |                       -- help: add explicit lifetime `'static` to the type of `value`: `&'static T`
12 LL |     Box::new(value) as Box<Any>
13    |     ^^^^^^^^^^^^^^^ lifetime `'static` required
14
15 error: aborting due to previous error
16
17 For more information about this error, try `rustc --explain E0621`.