Skip to content

Commit b3dce87

Browse files
committed
Move compile-fail/unsized-locals under ui as per #44844.
1 parent e568e98 commit b3dce87

7 files changed

+61
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: the `foo` method cannot be invoked on a trait object
2+
--> $DIR/by-value-trait-object-safety.rs:28:7
3+
|
4+
LL | x.foo();
5+
| ^^^
6+
7+
error: aborting due to previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
2+
--> $DIR/unsized-exprs.rs:32:26
3+
|
4+
LL | udrop::<(i32, [u8])>((42, *foo()));
5+
| ^^^^^^^^^^^^ doesn't have a size known at compile-time
6+
|
7+
= help: within `({integer}, [u8])`, the trait `std::marker::Sized` is not implemented for `[u8]`
8+
= 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>
9+
= note: required because it appears within the type `({integer}, [u8])`
10+
= note: tuples must have a statically known size to be initialized
11+
12+
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
13+
--> $DIR/unsized-exprs.rs:34:22
14+
|
15+
LL | udrop::<A<[u8]>>(A { 0: *foo() });
16+
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
17+
|
18+
= help: within `A<[u8]>`, the trait `std::marker::Sized` is not implemented for `[u8]`
19+
= 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>
20+
= note: required because it appears within the type `A<[u8]>`
21+
= note: structs must have a statically known size to be initialized
22+
23+
error: aborting due to 2 previous errors
24+
25+
For more information about this error, try `rustc --explain E0277`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
error[E0508]: cannot move out of type `[u8]`, a non-copy slice
2+
--> $DIR/unsized-exprs2.rs:32:19
3+
|
4+
LL | udrop::<[u8]>(foo()[..]);
5+
| ^^^^^^^^^ cannot move out of here
6+
7+
error[E0507]: cannot move out of data in a `&` reference
8+
--> $DIR/unsized-exprs2.rs:32:19
9+
|
10+
LL | udrop::<[u8]>(foo()[..]);
11+
| ^^^^^^^^^
12+
| |
13+
| cannot move out of data in a `&` reference
14+
| cannot move
15+
16+
error: aborting due to 2 previous errors
17+
18+
Some errors occurred: E0507, E0508.
19+
For more information about an error, try `rustc --explain E0507`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0507]: cannot move out of indexed content
2+
--> $DIR/unsized-exprs2.rs:32:19
3+
|
4+
LL | udrop::<[u8]>(foo()[..]);
5+
| ^^^^^^^^^ cannot move out of indexed content
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0507`.

0 commit comments

Comments
 (0)