mirror of
https://github.com/rust-lang/rust
synced 2024-10-14 12:33:57 +00:00
Update nll tests
This commit is contained in:
parent
731ea85f21
commit
1d9472b470
10
src/test/ui/issues/issue-16922.nll.stderr
Normal file
10
src/test/ui/issues/issue-16922.nll.stderr
Normal file
|
@ -0,0 +1,10 @@
|
|||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-16922.rs:4:5
|
||||
|
|
||||
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any> {
|
||||
| - let's call the lifetime of this reference `'1`
|
||||
LL | Box::new(value) as Box<dyn Any>
|
||||
| ^^^^^^^^^^^^^^^ cast requires that `'1` must outlive `'static`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
error[E0621]: explicit lifetime required in the type of `ss`
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/object-lifetime-default-from-box-error.rs:18:5
|
||||
|
|
||||
LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait> {
|
||||
| --------------- help: add explicit lifetime `'static` to the type of `ss`: `&mut SomeStruct<'static>`
|
||||
| -- has type `&mut SomeStruct<'1>`
|
||||
...
|
||||
LL | ss.r
|
||||
| ^^^^ lifetime `'static` required
|
||||
| ^^^^ returning this value requires that `'1` must outlive `'static`
|
||||
|
||||
error[E0507]: cannot move out of `ss.r` which is behind a mutable reference
|
||||
--> $DIR/object-lifetime-default-from-box-error.rs:18:5
|
||||
|
|
|
@ -14,17 +14,17 @@ LL | fn b(v: &[u8]) -> Box<dyn Foo + 'static> {
|
|||
LL | Box::new(v)
|
||||
| ^^^^^^^^^^^ lifetime `'static` required
|
||||
|
||||
error[E0621]: explicit lifetime required in the type of `v`
|
||||
--> $DIR/region-object-lifetime-in-coercion.rs:21:5
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/region-object-lifetime-in-coercion.rs:20:5
|
||||
|
|
||||
LL | fn c(v: &[u8]) -> Box<dyn Foo> {
|
||||
| ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]`
|
||||
| - let's call the lifetime of this reference `'1`
|
||||
...
|
||||
LL | Box::new(v)
|
||||
| ^^^^^^^^^^^ lifetime `'static` required
|
||||
| ^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/region-object-lifetime-in-coercion.rs:26:5
|
||||
--> $DIR/region-object-lifetime-in-coercion.rs:24:5
|
||||
|
|
||||
LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
|
||||
| -- -- lifetime `'b` defined here
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
error: lifetime may not live long enough
|
||||
--> $DIR/dyn-trait-underscore.rs:8:5
|
||||
|
|
||||
LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {
|
||||
| - let's call the lifetime of this reference `'1`
|
||||
LL | // ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`
|
||||
LL | Box::new(items.iter())
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'static`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in a new issue