diff --git a/src/test/ui/dst/dst-index.nll.stderr b/src/test/ui/dst/dst-index.nll.stderr index 767d8a84c041d..0aa85d3ed7a3d 100644 --- a/src/test/ui/dst/dst-index.nll.stderr +++ b/src/test/ui/dst/dst-index.nll.stderr @@ -4,18 +4,18 @@ error[E0161]: cannot move a value of type str: the size of str cannot be statica LL | S[0]; | ^^^^ -error[E0507]: cannot move out of borrowed content - --> $DIR/dst-index.rs:41:5 - | -LL | S[0]; - | ^^^^ cannot move out of borrowed content - error[E0161]: cannot move a value of type dyn std::fmt::Debug: the size of dyn std::fmt::Debug cannot be statically determined --> $DIR/dst-index.rs:44:5 | LL | T[0]; | ^^^^ +error[E0507]: cannot move out of borrowed content + --> $DIR/dst-index.rs:41:5 + | +LL | S[0]; + | ^^^^ cannot move out of borrowed content + error[E0507]: cannot move out of borrowed content --> $DIR/dst-index.rs:44:5 | diff --git a/src/test/ui/dst/dst-rvalue.nll.stderr b/src/test/ui/dst/dst-rvalue.nll.stderr index 5eadcc3def5ff..b120da773a24a 100644 --- a/src/test/ui/dst/dst-rvalue.nll.stderr +++ b/src/test/ui/dst/dst-rvalue.nll.stderr @@ -4,18 +4,18 @@ error[E0161]: cannot move a value of type str: the size of str cannot be statica LL | let _x: Box = box *"hello world"; | ^^^^^^^^^^^^^^ -error[E0507]: cannot move out of borrowed content - --> $DIR/dst-rvalue.rs:16:28 - | -LL | let _x: Box = box *"hello world"; - | ^^^^^^^^^^^^^^ cannot move out of borrowed content - error[E0161]: cannot move a value of type [isize]: the size of [isize] cannot be statically determined --> $DIR/dst-rvalue.rs:21:32 | LL | let _x: Box<[isize]> = box *array; | ^^^^^^ +error[E0507]: cannot move out of borrowed content + --> $DIR/dst-rvalue.rs:16:28 + | +LL | let _x: Box = box *"hello world"; + | ^^^^^^^^^^^^^^ cannot move out of borrowed content + error[E0508]: cannot move out of type `[isize]`, a non-copy slice --> $DIR/dst-rvalue.rs:21:32 | diff --git a/src/test/ui/error-codes/E0161.ast.stderr b/src/test/ui/error-codes/E0161.ast.stderr new file mode 100644 index 0000000000000..62e8676e63198 --- /dev/null +++ b/src/test/ui/error-codes/E0161.ast.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined + --> $DIR/E0161.rs:32:9 + | +LL | box *x; //~ ERROR E0161 + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0161.astul.stderr b/src/test/ui/error-codes/E0161.astul.stderr new file mode 100644 index 0000000000000..79080fb4eae15 --- /dev/null +++ b/src/test/ui/error-codes/E0161.astul.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined + --> $DIR/E0161.rs:32:5 + | +LL | box *x; //~ ERROR E0161 + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0161.edition.stderr b/src/test/ui/error-codes/E0161.edition.stderr new file mode 100644 index 0000000000000..62e8676e63198 --- /dev/null +++ b/src/test/ui/error-codes/E0161.edition.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined + --> $DIR/E0161.rs:32:9 + | +LL | box *x; //~ ERROR E0161 + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0161.editionul.stderr b/src/test/ui/error-codes/E0161.editionul.stderr new file mode 100644 index 0000000000000..79080fb4eae15 --- /dev/null +++ b/src/test/ui/error-codes/E0161.editionul.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined + --> $DIR/E0161.rs:32:5 + | +LL | box *x; //~ ERROR E0161 + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0161.nll.stderr b/src/test/ui/error-codes/E0161.nll.stderr new file mode 100644 index 0000000000000..62e8676e63198 --- /dev/null +++ b/src/test/ui/error-codes/E0161.nll.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined + --> $DIR/E0161.rs:32:9 + | +LL | box *x; //~ ERROR E0161 + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0161.nllul.stderr b/src/test/ui/error-codes/E0161.nllul.stderr new file mode 100644 index 0000000000000..79080fb4eae15 --- /dev/null +++ b/src/test/ui/error-codes/E0161.nllul.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined + --> $DIR/E0161.rs:32:5 + | +LL | box *x; //~ ERROR E0161 + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0161.rs b/src/test/ui/error-codes/E0161.rs index 81adf9083024d..edc5a84a84367 100644 --- a/src/test/ui/error-codes/E0161.rs +++ b/src/test/ui/error-codes/E0161.rs @@ -8,9 +8,28 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + +// Check that E0161 is a hard error in all possible configurations that might +// affect it. + +// revisions: ast nll zflags edition astul nllul zflagsul editionul +//[zflags]compile-flags: -Z borrowck=migrate -Z two-phase-borrows +//[edition]edition:2018 +//[zflagsul]compile-flags: -Z borrowck=migrate -Z two-phase-borrows +//[editionul]edition:2018 + +#![cfg_attr(nll, feature(nll))] +#![cfg_attr(nllul, feature(nll))] +#![cfg_attr(astul, 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 main() { - let _x: Box = box *"hello"; //~ ERROR E0161 - //~^ ERROR E0507 +fn foo(x: Box<[i32]>) { + box *x; //~ ERROR E0161 } + +fn main() {} diff --git a/src/test/ui/error-codes/E0161.zflags.stderr b/src/test/ui/error-codes/E0161.zflags.stderr new file mode 100644 index 0000000000000..62e8676e63198 --- /dev/null +++ b/src/test/ui/error-codes/E0161.zflags.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined + --> $DIR/E0161.rs:32:9 + | +LL | box *x; //~ ERROR E0161 + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/ui/error-codes/E0161.zflagsul.stderr b/src/test/ui/error-codes/E0161.zflagsul.stderr new file mode 100644 index 0000000000000..79080fb4eae15 --- /dev/null +++ b/src/test/ui/error-codes/E0161.zflagsul.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type [i32]: the size of [i32] cannot be statically determined + --> $DIR/E0161.rs:32:5 + | +LL | box *x; //~ ERROR E0161 + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`.