Skip to content

Commit

Permalink
Move compile-fail/unsized-locals under ui as per #44844.
Browse files Browse the repository at this point in the history
  • Loading branch information
qnighy committed Oct 24, 2018
1 parent e568e98 commit b3dce87
Show file tree
Hide file tree
Showing 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

File renamed without changes.
25 changes: 25 additions & 0 deletions src/test/ui/unsized-locals/unsized-exprs.stderr
@@ -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 changes: 19 additions & 0 deletions src/test/ui/unsized-locals/unsized-exprs2.nll.stderr
@@ -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 changes: 9 additions & 0 deletions src/test/ui/unsized-locals/unsized-exprs2.stderr
@@ -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`.

0 comments on commit b3dce87

Please sign in to comment.