Move compile-fail/unsized-locals under ui as per #44844.
This commit is contained in:
parent
e568e98063
commit
b3dce87a86
7 changed files with 61 additions and 0 deletions
|
|
@ -0,0 +1,8 @@
|
|||
error: the `foo` method cannot be invoked on a trait object
|
||||
--> $DIR/by-value-trait-object-safety.rs:28:7
|
||||
|
|
||||
LL | x.foo();
|
||||
| ^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
25
src/test/ui/unsized-locals/unsized-exprs.stderr
Normal file
25
src/test/ui/unsized-locals/unsized-exprs.stderr
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
|
||||
--> $DIR/unsized-exprs.rs:32:26
|
||||
|
|
||||
LL | udrop::<(i32, [u8])>((42, *foo()));
|
||||
| ^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: within `({integer}, [u8])`, the trait `std::marker::Sized` is not implemented for `[u8]`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= note: required because it appears within the type `({integer}, [u8])`
|
||||
= note: tuples must have a statically known size to be initialized
|
||||
|
||||
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
|
||||
--> $DIR/unsized-exprs.rs:34:22
|
||||
|
|
||||
LL | udrop::<A<[u8]>>(A { 0: *foo() });
|
||||
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
||||
|
|
||||
= help: within `A<[u8]>`, the trait `std::marker::Sized` is not implemented for `[u8]`
|
||||
= note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
|
||||
= note: required because it appears within the type `A<[u8]>`
|
||||
= note: structs must have a statically known size to be initialized
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
19
src/test/ui/unsized-locals/unsized-exprs2.nll.stderr
Normal file
19
src/test/ui/unsized-locals/unsized-exprs2.nll.stderr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
error[E0508]: cannot move out of type `[u8]`, a non-copy slice
|
||||
--> $DIR/unsized-exprs2.rs:32:19
|
||||
|
|
||||
LL | udrop::<[u8]>(foo()[..]);
|
||||
| ^^^^^^^^^ cannot move out of here
|
||||
|
||||
error[E0507]: cannot move out of data in a `&` reference
|
||||
--> $DIR/unsized-exprs2.rs:32:19
|
||||
|
|
||||
LL | udrop::<[u8]>(foo()[..]);
|
||||
| ^^^^^^^^^
|
||||
| |
|
||||
| cannot move out of data in a `&` reference
|
||||
| cannot move
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
Some errors occurred: E0507, E0508.
|
||||
For more information about an error, try `rustc --explain E0507`.
|
||||
9
src/test/ui/unsized-locals/unsized-exprs2.stderr
Normal file
9
src/test/ui/unsized-locals/unsized-exprs2.stderr
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
error[E0507]: cannot move out of indexed content
|
||||
--> $DIR/unsized-exprs2.rs:32:19
|
||||
|
|
||||
LL | udrop::<[u8]>(foo()[..]);
|
||||
| ^^^^^^^^^ cannot move out of indexed content
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0507`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue