Skip to content

Add unsized_locals to INCOMPLETE_FEATURES list #71435

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/librustc_feature/active.rs
Original file line number Diff line number Diff line change
@@ -575,4 +575,5 @@ pub const INCOMPLETE_FEATURES: &[Symbol] = &[
sym::raw_dylib,
sym::const_trait_impl,
sym::const_trait_bound_opt_out,
sym::unsized_locals,
];
2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0161.rs
Original file line number Diff line number Diff line change
@@ -9,13 +9,13 @@
//[zflagsul]compile-flags: -Z borrowck=migrate
//[editionul]edition:2018

#![allow(incomplete_features)]
#![cfg_attr(nll, feature(nll))]
#![cfg_attr(nllul, feature(nll))]
#![cfg_attr(migrateul, feature(unsized_locals))]
#![cfg_attr(zflagsul, feature(unsized_locals))]
#![cfg_attr(nllul, feature(unsized_locals))]
#![cfg_attr(editionul, feature(unsized_locals))]

#![feature(box_syntax)]

fn foo(x: Box<[i32]>) {
1 change: 1 addition & 0 deletions src/test/ui/fn/dyn-fn-alignment.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(incomplete_features)]
#![feature(unsized_locals)]
#![allow(dead_code)]
#[repr(align(256))]
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(arbitrary_self_types, coerce_unsized, dispatch_from_dyn, unsize, unsized_locals)]
//~^ WARN the feature `unsized_locals` is incomplete and may cause the compiler to crash

// This tests a few edge-cases around `arbitrary_self_types`. Most specifically,
// it checks that the `ObjectCandidate` you get from method matching can't
Original file line number Diff line number Diff line change
@@ -1,37 +1,45 @@
warning: the feature `unsized_locals` is incomplete and may cause the compiler to crash
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:1:77
|
LL | #![feature(arbitrary_self_types, coerce_unsized, dispatch_from_dyn, unsize, unsized_locals)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:85:24
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:86:24
|
LL | let _seetype: () = z;
| -- ^ expected `()`, found `u32`
| |
| expected due to this

error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:102:24
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:103:24
|
LL | let _seetype: () = z;
| -- ^ expected `()`, found `u64`
| |
| expected due to this

error[E0034]: multiple applicable items in scope
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:120:15
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:121:15
|
LL | let z = x.foo();
| ^^^ multiple `foo` found
|
note: candidate #1 is defined in an impl of the trait `internal::X` for the type `T`
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:43:9
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:44:9
|
LL | fn foo(self: Smaht<Self, u64>) -> u64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in an impl of the trait `nuisance_foo::NuisanceFoo` for the type `T`
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:70:9
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:71:9
|
LL | fn foo(self) {}
| ^^^^^^^^^^^^
note: candidate #3 is defined in the trait `FinalFoo`
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:57:5
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:58:5
|
LL | fn foo(&self) -> u8;
| ^^^^^^^^^^^^^^^^^^^^
@@ -49,30 +57,30 @@ LL | let z = FinalFoo::foo(x);
| ^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:137:24
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:138:24
|
LL | let _seetype: () = z;
| -- ^ expected `()`, found `u8`
| |
| expected due to this

error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:155:24
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:156:24
|
LL | let _seetype: () = z;
| -- ^ expected `()`, found `u32`
| |
| expected due to this

error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:172:24
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:173:24
|
LL | let _seetype: () = z;
| -- ^ expected `()`, found `u32`
| |
| expected due to this

error: aborting due to 6 previous errors
error: aborting due to 6 previous errors; 1 warning emitted

Some errors have detailed explanations: E0034, E0308.
For more information about an error, try `rustc --explain E0034`.
9 changes: 5 additions & 4 deletions src/test/ui/moves/move-out-of-slice-2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(unsized_locals)]
//~^ WARN the feature `unsized_locals` is incomplete and may cause the compiler to crash

struct A;
#[derive(Clone, Copy)]
@@ -8,27 +9,27 @@ fn main() {
let a: Box<[A]> = Box::new([A]);
match *a {
//~^ ERROR cannot move out of type `[A]`, a non-copy slice
[a @ ..] => {},
[a @ ..] => {}
_ => {}
}
let b: Box<[A]> = Box::new([A, A, A]);
match *b {
//~^ ERROR cannot move out of type `[A]`, a non-copy slice
[_, _, b @ .., _] => {},
[_, _, b @ .., _] => {}
_ => {}
}

// `[C]` isn't `Copy`, even if `C` is.
let c: Box<[C]> = Box::new([C]);
match *c {
//~^ ERROR cannot move out of type `[C]`, a non-copy slice
[c @ ..] => {},
[c @ ..] => {}
_ => {}
}
let d: Box<[C]> = Box::new([C, C, C]);
match *d {
//~^ ERROR cannot move out of type `[C]`, a non-copy slice
[_, _, d @ .., _] => {},
[_, _, d @ .., _] => {}
_ => {}
}
}
26 changes: 17 additions & 9 deletions src/test/ui/moves/move-out-of-slice-2.stderr
Original file line number Diff line number Diff line change
@@ -1,51 +1,59 @@
warning: the feature `unsized_locals` is incomplete and may cause the compiler to crash
--> $DIR/move-out-of-slice-2.rs:1:12
|
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0508]: cannot move out of type `[A]`, a non-copy slice
--> $DIR/move-out-of-slice-2.rs:9:11
--> $DIR/move-out-of-slice-2.rs:10:11
|
LL | match *a {
| ^^ cannot move out of here
LL |
LL | [a @ ..] => {},
LL | [a @ ..] => {}
| ------
| |
| data moved here
| move occurs because `a` has type `[A]`, which does not implement the `Copy` trait

error[E0508]: cannot move out of type `[A]`, a non-copy slice
--> $DIR/move-out-of-slice-2.rs:15:11
--> $DIR/move-out-of-slice-2.rs:16:11
|
LL | match *b {
| ^^ cannot move out of here
LL |
LL | [_, _, b @ .., _] => {},
LL | [_, _, b @ .., _] => {}
| ------
| |
| data moved here
| move occurs because `b` has type `[A]`, which does not implement the `Copy` trait

error[E0508]: cannot move out of type `[C]`, a non-copy slice
--> $DIR/move-out-of-slice-2.rs:23:11
--> $DIR/move-out-of-slice-2.rs:24:11
|
LL | match *c {
| ^^ cannot move out of here
LL |
LL | [c @ ..] => {},
LL | [c @ ..] => {}
| ------
| |
| data moved here
| move occurs because `c` has type `[C]`, which does not implement the `Copy` trait

error[E0508]: cannot move out of type `[C]`, a non-copy slice
--> $DIR/move-out-of-slice-2.rs:29:11
--> $DIR/move-out-of-slice-2.rs:30:11
|
LL | match *d {
| ^^ cannot move out of here
LL |
LL | [_, _, d @ .., _] => {},
LL | [_, _, d @ .., _] => {}
| ------
| |
| data moved here
| move occurs because `d` has type `[C]`, which does not implement the `Copy` trait

error: aborting due to 4 previous errors
error: aborting due to 4 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0508`.
2 changes: 1 addition & 1 deletion src/test/ui/unsized-locals/autoderef.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(incomplete_features)]
#![feature(unsized_locals)]

pub trait Foo {
@@ -24,7 +25,6 @@ impl Foo for dyn FnMut() -> String {
}
}


fn main() {
let x = *(Box::new(['h', 'e', 'l', 'l', 'o']) as Box<[char]>);
assert_eq!(&x.foo() as &str, "hello");
1 change: 1 addition & 0 deletions src/test/ui/unsized-locals/borrow-after-move.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(unsized_locals)]
//~^ WARN the feature `unsized_locals` is incomplete and may cause the compiler to crash

pub trait Foo {
fn foo(self) -> String;
20 changes: 14 additions & 6 deletions src/test/ui/unsized-locals/borrow-after-move.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
warning: the feature `unsized_locals` is incomplete and may cause the compiler to crash
--> $DIR/borrow-after-move.rs:1:12
|
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0382]: borrow of moved value: `x`
--> $DIR/borrow-after-move.rs:20:24
--> $DIR/borrow-after-move.rs:21:24
|
LL | let y = *x;
| -- value moved here
@@ -10,7 +18,7 @@ LL | println!("{}", &x);
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait

error[E0382]: borrow of moved value: `y`
--> $DIR/borrow-after-move.rs:22:24
--> $DIR/borrow-after-move.rs:23:24
|
LL | let y = *x;
| - move occurs because `y` has type `str`, which does not implement the `Copy` trait
@@ -21,7 +29,7 @@ LL | println!("{}", &y);
| ^^ value borrowed here after move

error[E0382]: borrow of moved value: `x`
--> $DIR/borrow-after-move.rs:30:24
--> $DIR/borrow-after-move.rs:31:24
|
LL | let y = *x;
| -- value moved here
@@ -32,7 +40,7 @@ LL | println!("{}", &x);
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait

error[E0382]: borrow of moved value: `y`
--> $DIR/borrow-after-move.rs:32:24
--> $DIR/borrow-after-move.rs:33:24
|
LL | let y = *x;
| - move occurs because `y` has type `str`, which does not implement the `Copy` trait
@@ -43,7 +51,7 @@ LL | println!("{}", &y);
| ^^ value borrowed here after move

error[E0382]: borrow of moved value: `x`
--> $DIR/borrow-after-move.rs:39:24
--> $DIR/borrow-after-move.rs:40:24
|
LL | let x = "hello".to_owned().into_boxed_str();
| - move occurs because `x` has type `std::boxed::Box<str>`, which does not implement the `Copy` trait
@@ -52,6 +60,6 @@ LL | x.foo();
LL | println!("{}", &x);
| ^^ value borrowed here after move

error: aborting due to 5 previous errors
error: aborting due to 5 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0382`.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(incomplete_features)]
#![feature(unsized_locals)]

pub trait Foo {
@@ -14,7 +15,6 @@ impl Foo for A {
}
}


fn main() {
let x = *(Box::new(A) as Box<dyn Foo>);
assert_eq!(x.foo(), format!("hello"));
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(incomplete_features)]
#![feature(unsized_locals)]

pub trait Foo {
@@ -12,7 +13,6 @@ struct A;

impl Foo for A {}


fn main() {
let x = *(Box::new(A) as Box<dyn Foo>);
assert_eq!(x.foo(), format!("hello"));
6 changes: 4 additions & 2 deletions src/test/ui/unsized-locals/by-value-trait-object-safety.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#![feature(unsized_locals)]
//~^ WARN the feature `unsized_locals` is incomplete and may cause the compiler to crash

pub trait Foo {
fn foo(self) -> String where Self: Sized;
fn foo(self) -> String
where
Self: Sized;
}

struct A;
@@ -12,7 +15,6 @@ impl Foo for A {
}
}


fn main() {
let x = *(Box::new(A) as Box<dyn Foo>);
x.foo();
16 changes: 12 additions & 4 deletions src/test/ui/unsized-locals/by-value-trait-object-safety.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
warning: the feature `unsized_locals` is incomplete and may cause the compiler to crash
--> $DIR/by-value-trait-object-safety.rs:1:12
|
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error: the `foo` method cannot be invoked on a trait object
--> $DIR/by-value-trait-object-safety.rs:18:7
--> $DIR/by-value-trait-object-safety.rs:20:7
|
LL | fn foo(self) -> String where Self: Sized;
| ----- this has a `Sized` requirement
LL | Self: Sized;
| ----- this has a `Sized` requirement
...
LL | x.foo();
| ^^^

error: aborting due to previous error
error: aborting due to previous error; 1 warning emitted

1 change: 1 addition & 0 deletions src/test/ui/unsized-locals/double-move.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(unsized_locals)]
//~^ WARN the feature `unsized_locals` is incomplete and may cause the compiler to crash

pub trait Foo {
fn foo(self) -> String;
22 changes: 15 additions & 7 deletions src/test/ui/unsized-locals/double-move.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
warning: the feature `unsized_locals` is incomplete and may cause the compiler to crash
--> $DIR/double-move.rs:1:12
|
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0382]: use of moved value: `y`
--> $DIR/double-move.rs:20:22
--> $DIR/double-move.rs:21:22
|
LL | let y = *x;
| - move occurs because `y` has type `str`, which does not implement the `Copy` trait
@@ -9,7 +17,7 @@ LL | drop_unsized(y);
| ^ value used here after move

error[E0382]: use of moved value: `x`
--> $DIR/double-move.rs:26:22
--> $DIR/double-move.rs:27:22
|
LL | let _y = *x;
| -- value moved here
@@ -19,7 +27,7 @@ LL | drop_unsized(x);
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `*x`
--> $DIR/double-move.rs:32:18
--> $DIR/double-move.rs:33:18
|
LL | let x = "hello".to_owned().into_boxed_str();
| - move occurs because `x` has type `std::boxed::Box<str>`, which does not implement the `Copy` trait
@@ -29,7 +37,7 @@ LL | let _y = *x;
| ^^ value used here after move

error[E0382]: use of moved value: `y`
--> $DIR/double-move.rs:39:9
--> $DIR/double-move.rs:40:9
|
LL | let y = *x;
| - move occurs because `y` has type `str`, which does not implement the `Copy` trait
@@ -39,7 +47,7 @@ LL | y.foo();
| ^ value used here after move

error[E0382]: use of moved value: `x`
--> $DIR/double-move.rs:45:9
--> $DIR/double-move.rs:46:9
|
LL | let _y = *x;
| -- value moved here
@@ -49,7 +57,7 @@ LL | x.foo();
= note: move occurs because `*x` has type `str`, which does not implement the `Copy` trait

error[E0382]: use of moved value: `*x`
--> $DIR/double-move.rs:51:18
--> $DIR/double-move.rs:52:18
|
LL | let x = "hello".to_owned().into_boxed_str();
| - move occurs because `x` has type `std::boxed::Box<str>`, which does not implement the `Copy` trait
@@ -58,6 +66,6 @@ LL | x.foo();
LL | let _y = *x;
| ^^ value used here after move

error: aborting due to 6 previous errors
error: aborting due to 6 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0382`.
1 change: 1 addition & 0 deletions src/test/ui/unsized-locals/issue-50940-with-feature.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(unsized_locals)]
//~^ WARN the feature `unsized_locals` is incomplete and may cause the compiler to crash

fn main() {
struct A<X: ?Sized>(X);
12 changes: 10 additions & 2 deletions src/test/ui/unsized-locals/issue-50940-with-feature.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
warning: the feature `unsized_locals` is incomplete and may cause the compiler to crash
--> $DIR/issue-50940-with-feature.rs:1:12
|
LL | #![feature(unsized_locals)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/issue-50940-with-feature.rs:5:5
--> $DIR/issue-50940-with-feature.rs:6:5
|
LL | A as fn(str) -> A<str>;
| ^ doesn't have a size known at compile-time
@@ -9,6 +17,6 @@ LL | A as fn(str) -> A<str>;
= note: required because it appears within the type `main::A<str>`
= note: the return type of a function must have a statically known size

error: aborting due to previous error
error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
1 change: 1 addition & 0 deletions src/test/ui/unsized-locals/reference-unsized-locals.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(incomplete_features)]
#![feature(unsized_locals)]

fn main() {
1 change: 1 addition & 0 deletions src/test/ui/unsized-locals/simple-unsized-locals.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(incomplete_features)]
#![feature(unsized_locals)]

fn main() {
11 changes: 4 additions & 7 deletions src/test/ui/unsized-locals/unsized-exprs-rpass.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass
#![allow(unused_braces, unused_parens)]

#![allow(incomplete_features, unused_braces, unused_parens)]
#![feature(unsized_tuple_coercion, unsized_locals)]

struct A<X: ?Sized>(X);
@@ -24,12 +25,8 @@ fn main() {
udrop::<[u8]>(loop {
break *foo();
});
udrop::<[u8]>(if true {
*foo()
} else {
*foo()
});
udrop::<[u8]>({*foo()});
udrop::<[u8]>(if true { *foo() } else { *foo() });
udrop::<[u8]>({ *foo() });
udrop::<[u8]>((*foo()));
udrop::<[u8]>((*tfoo()).1);
*afoo() + 42;
1 change: 1 addition & 0 deletions src/test/ui/unsized-locals/unsized-exprs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(unsized_tuple_coercion, unsized_locals)]
//~^ WARN the feature `unsized_locals` is incomplete and may cause the compiler to crash

struct A<X: ?Sized>(X);

16 changes: 12 additions & 4 deletions src/test/ui/unsized-locals/unsized-exprs.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
warning: the feature `unsized_locals` is incomplete and may cause the compiler to crash
--> $DIR/unsized-exprs.rs:1:36
|
LL | #![feature(unsized_tuple_coercion, unsized_locals)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/unsized-exprs.rs:22:26
--> $DIR/unsized-exprs.rs:23:26
|
LL | udrop::<(i32, [u8])>((42, *foo()));
| ^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -10,7 +18,7 @@ LL | udrop::<(i32, [u8])>((42, *foo()));
= 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:24:22
--> $DIR/unsized-exprs.rs:25:22
|
LL | udrop::<A<[u8]>>(A { 0: *foo() });
| ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -21,7 +29,7 @@ LL | udrop::<A<[u8]>>(A { 0: *foo() });
= note: structs 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:26:22
--> $DIR/unsized-exprs.rs:27:22
|
LL | udrop::<A<[u8]>>(A(*foo()));
| ^ doesn't have a size known at compile-time
@@ -31,6 +39,6 @@ LL | udrop::<A<[u8]>>(A(*foo()));
= note: required because it appears within the type `A<[u8]>`
= note: the return type of a function must have a statically known size

error: aborting due to 3 previous errors
error: aborting due to 3 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0277`.
1 change: 1 addition & 0 deletions src/test/ui/unsized-locals/unsized-exprs2.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(unsized_tuple_coercion, unsized_locals)]
//~^ WARN the feature `unsized_locals` is incomplete and may cause the compiler to crash

struct A<X: ?Sized>(X);

12 changes: 10 additions & 2 deletions src/test/ui/unsized-locals/unsized-exprs2.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
warning: the feature `unsized_locals` is incomplete and may cause the compiler to crash
--> $DIR/unsized-exprs2.rs:1:36
|
LL | #![feature(unsized_tuple_coercion, unsized_locals)]
| ^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default

error[E0508]: cannot move out of type `[u8]`, a non-copy slice
--> $DIR/unsized-exprs2.rs:22:5
--> $DIR/unsized-exprs2.rs:23:5
|
LL | udrop::<[u8]>(foo()[..]);
| ^^^^^^^^^^^^^^^^^^^^^^^^
| |
| cannot move out of here
| move occurs because value has type `[u8]`, which does not implement the `Copy` trait

error: aborting due to previous error
error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0508`.
9 changes: 7 additions & 2 deletions src/test/ui/unsized-locals/unsized-index.rs
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
// Tightening the bound now could be a breaking change. Although no crater
// regression were observed (https://github.com/rust-lang/rust/pull/59527),
// let's be conservative and just add a test for this.
#![allow(incomplete_features)]
#![feature(unsized_locals)]

use std::ops;
@@ -13,11 +14,15 @@ pub struct A;

impl ops::Index<str> for A {
type Output = ();
fn index(&self, _: str) -> &Self::Output { panic!() }
fn index(&self, _: str) -> &Self::Output {
panic!()
}
}

impl ops::IndexMut<str> for A {
fn index_mut(&mut self, _: str) -> &mut Self::Output { panic!() }
fn index_mut(&mut self, _: str) -> &mut Self::Output {
panic!()
}
}

fn main() {}
1 change: 1 addition & 0 deletions src/test/ui/unsized-locals/unsized-parameters.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// run-pass

#![allow(incomplete_features)]
#![feature(unsized_locals)]

pub fn f0(_f: dyn FnOnce()) {}