diff options
| author | David Wood <david@davidtw.co> | 2018-08-08 14:28:26 +0200 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2018-08-14 10:38:00 +0200 |
| commit | b16a30677f4e641329e768272cf9d3ecc2fa31c4 (patch) | |
| tree | d3e652eb74da6147d2ae1514977c93c785c733a2 /src | |
| parent | fe28bcf1db02afe184e3677ee034b2a5804f2466 (diff) | |
| download | rust-b16a30677f4e641329e768272cf9d3ecc2fa31c4.tar.gz rust-b16a30677f4e641329e768272cf9d3ecc2fa31c4.zip | |
Moved compile-fail tests to ui tests.
Diffstat (limited to 'src')
4052 files changed, 59249 insertions, 0 deletions
diff --git a/src/test/compile-fail/.gitattributes b/src/test/ui/compile-fail-migration/.gitattributes index 825f664bf9f..825f664bf9f 100644 --- a/src/test/compile-fail/.gitattributes +++ b/src/test/ui/compile-fail-migration/.gitattributes diff --git a/src/test/ui/compile-fail-migration/E0501.ast.nll.stderr b/src/test/ui/compile-fail-migration/E0501.ast.nll.stderr new file mode 100644 index 00000000000..a9abc79400e --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0501.ast.nll.stderr @@ -0,0 +1,31 @@ +error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access + --> $DIR/E0501.rs:28:23 + | +LL | let bar = || { + | -- closure construction occurs here +LL | inside_closure(a) + | - first borrow occurs due to use of `a` in closure +LL | }; +LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access + | ^ borrow occurs here +... +LL | drop(bar); + | --- borrow later used here + +error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access + --> $DIR/E0501.rs:31:23 + | +LL | let bar = || { + | -- closure construction occurs here +LL | inside_closure(a) + | - first borrow occurs due to use of `a` in closure +... +LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access + | ^ borrow occurs here +... +LL | drop(bar); + | --- borrow later used here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0501`. diff --git a/src/test/ui/compile-fail-migration/E0501.ast.stderr b/src/test/ui/compile-fail-migration/E0501.ast.stderr new file mode 100644 index 00000000000..229b1665017 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0501.ast.stderr @@ -0,0 +1,31 @@ +error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access + --> $DIR/E0501.rs:28:23 + | +LL | let bar = || { + | -- closure construction occurs here +LL | inside_closure(a) + | - previous borrow occurs due to use of `a` in closure +LL | }; +LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access + | ^ borrow occurs here +... +LL | } + | - borrow from closure ends here + +error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access + --> $DIR/E0501.rs:31:23 + | +LL | let bar = || { + | -- closure construction occurs here +LL | inside_closure(a) + | - previous borrow occurs due to use of `a` in closure +... +LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access + | ^ borrow occurs here +... +LL | } + | - borrow from closure ends here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0501`. diff --git a/src/test/ui/compile-fail-migration/E0501.mir.stderr b/src/test/ui/compile-fail-migration/E0501.mir.stderr new file mode 100644 index 00000000000..a9abc79400e --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0501.mir.stderr @@ -0,0 +1,31 @@ +error[E0501]: cannot borrow `*a` as mutable because previous closure requires unique access + --> $DIR/E0501.rs:28:23 + | +LL | let bar = || { + | -- closure construction occurs here +LL | inside_closure(a) + | - first borrow occurs due to use of `a` in closure +LL | }; +LL | outside_closure_1(a); //[ast]~ ERROR cannot borrow `*a` as mutable because previous closure requires unique access + | ^ borrow occurs here +... +LL | drop(bar); + | --- borrow later used here + +error[E0501]: cannot borrow `*a` as immutable because previous closure requires unique access + --> $DIR/E0501.rs:31:23 + | +LL | let bar = || { + | -- closure construction occurs here +LL | inside_closure(a) + | - first borrow occurs due to use of `a` in closure +... +LL | outside_closure_2(a); //[ast]~ ERROR cannot borrow `*a` as immutable because previous closure requires unique access + | ^ borrow occurs here +... +LL | drop(bar); + | --- borrow later used here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0501`. diff --git a/src/test/compile-fail/E0501.rs b/src/test/ui/compile-fail-migration/E0501.rs index 5643e1ef091..5643e1ef091 100644 --- a/src/test/compile-fail/E0501.rs +++ b/src/test/ui/compile-fail-migration/E0501.rs diff --git a/src/test/ui/compile-fail-migration/E0506.ast.nll.stderr b/src/test/ui/compile-fail-migration/E0506.ast.nll.stderr new file mode 100644 index 00000000000..cf6b8d9c8d1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0506.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0506]: cannot assign to `fancy_num` because it is borrowed + --> $DIR/E0506.rs:21:5 + | +LL | let fancy_ref = &fancy_num; + | ---------- borrow of `fancy_num` occurs here +LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here +... +LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num); + | ------------- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/E0506.ast.stderr b/src/test/ui/compile-fail-migration/E0506.ast.stderr new file mode 100644 index 00000000000..54b4e163681 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0506.ast.stderr @@ -0,0 +1,11 @@ +error[E0506]: cannot assign to `fancy_num` because it is borrowed + --> $DIR/E0506.rs:21:5 + | +LL | let fancy_ref = &fancy_num; + | --------- borrow of `fancy_num` occurs here +LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/E0506.mir.stderr b/src/test/ui/compile-fail-migration/E0506.mir.stderr new file mode 100644 index 00000000000..cf6b8d9c8d1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0506.mir.stderr @@ -0,0 +1,14 @@ +error[E0506]: cannot assign to `fancy_num` because it is borrowed + --> $DIR/E0506.rs:21:5 + | +LL | let fancy_ref = &fancy_num; + | ---------- borrow of `fancy_num` occurs here +LL | fancy_num = FancyNum { num: 6 }; //[ast]~ ERROR E0506 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `fancy_num` occurs here +... +LL | println!("Num: {}, Ref: {}", fancy_num.num, fancy_ref.num); + | ------------- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/E0506.rs b/src/test/ui/compile-fail-migration/E0506.rs index c4a7f257394..c4a7f257394 100644 --- a/src/test/compile-fail/E0506.rs +++ b/src/test/ui/compile-fail-migration/E0506.rs diff --git a/src/test/ui/compile-fail-migration/E0508.ast.stderr b/src/test/ui/compile-fail-migration/E0508.ast.stderr new file mode 100644 index 00000000000..5878b795b77 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0508.ast.stderr @@ -0,0 +1,12 @@ +error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array + --> $DIR/E0508.rs:18:18 + | +LL | let _value = array[0]; //[ast]~ ERROR [E0508] + | ^^^^^^^^ + | | + | cannot move out of here + | help: consider using a reference instead: `&array[0]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/ui/compile-fail-migration/E0508.mir.stderr b/src/test/ui/compile-fail-migration/E0508.mir.stderr new file mode 100644 index 00000000000..5878b795b77 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0508.mir.stderr @@ -0,0 +1,12 @@ +error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array + --> $DIR/E0508.rs:18:18 + | +LL | let _value = array[0]; //[ast]~ ERROR [E0508] + | ^^^^^^^^ + | | + | cannot move out of here + | help: consider using a reference instead: `&array[0]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/compile-fail/E0508.rs b/src/test/ui/compile-fail-migration/E0508.rs index 0c3dce6b034..0c3dce6b034 100644 --- a/src/test/compile-fail/E0508.rs +++ b/src/test/ui/compile-fail-migration/E0508.rs diff --git a/src/test/compile-fail/E0583.rs b/src/test/ui/compile-fail-migration/E0583.rs index 3a5255d0f5f..3a5255d0f5f 100644 --- a/src/test/compile-fail/E0583.rs +++ b/src/test/ui/compile-fail-migration/E0583.rs diff --git a/src/test/ui/compile-fail-migration/E0583.stderr b/src/test/ui/compile-fail-migration/E0583.stderr new file mode 100644 index 00000000000..82e1cccbb68 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0583.stderr @@ -0,0 +1,11 @@ +error[E0583]: file not found for module `module_that_doesnt_exist` + --> $DIR/E0583.rs:11:5 + | +LL | mod module_that_doesnt_exist; //~ ERROR E0583 + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: name the file either module_that_doesnt_exist.rs or module_that_doesnt_exist/mod.rs inside the directory "$DIR" + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0583`. diff --git a/src/test/ui/compile-fail-migration/E0594.ast.nll.stderr b/src/test/ui/compile-fail-migration/E0594.ast.nll.stderr new file mode 100644 index 00000000000..f96eb01abe4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0594.ast.nll.stderr @@ -0,0 +1,9 @@ +error[E0594]: cannot assign to immutable static item `NUM` + --> $DIR/E0594.rs:17:5 + | +LL | NUM = 20; //[ast]~ ERROR E0594 + | ^^^^^^^^ cannot assign + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/E0594.ast.stderr b/src/test/ui/compile-fail-migration/E0594.ast.stderr new file mode 100644 index 00000000000..f84c1f56ad0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0594.ast.stderr @@ -0,0 +1,9 @@ +error[E0594]: cannot assign to immutable static item + --> $DIR/E0594.rs:17:5 + | +LL | NUM = 20; //[ast]~ ERROR E0594 + | ^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/E0594.mir.stderr b/src/test/ui/compile-fail-migration/E0594.mir.stderr new file mode 100644 index 00000000000..f96eb01abe4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0594.mir.stderr @@ -0,0 +1,9 @@ +error[E0594]: cannot assign to immutable static item `NUM` + --> $DIR/E0594.rs:17:5 + | +LL | NUM = 20; //[ast]~ ERROR E0594 + | ^^^^^^^^ cannot assign + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/E0594.rs b/src/test/ui/compile-fail-migration/E0594.rs index e5e96451d13..e5e96451d13 100644 --- a/src/test/compile-fail/E0594.rs +++ b/src/test/ui/compile-fail-migration/E0594.rs diff --git a/src/test/ui/compile-fail-migration/E0596.ast.nll.stderr b/src/test/ui/compile-fail-migration/E0596.ast.nll.stderr new file mode 100644 index 00000000000..589db4a032d --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0596.ast.nll.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/E0596.rs:16:13 + | +LL | let x = 1; + | - help: consider changing this to be mutable: `mut x` +LL | let y = &mut x; //[ast]~ ERROR [E0596] + | ^^^^^^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/E0596.ast.stderr b/src/test/ui/compile-fail-migration/E0596.ast.stderr new file mode 100644 index 00000000000..d88530b2164 --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0596.ast.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow immutable local variable `x` as mutable + --> $DIR/E0596.rs:16:18 + | +LL | let x = 1; + | - consider changing this to `mut x` +LL | let y = &mut x; //[ast]~ ERROR [E0596] + | ^ cannot borrow mutably + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/E0596.mir.stderr b/src/test/ui/compile-fail-migration/E0596.mir.stderr new file mode 100644 index 00000000000..589db4a032d --- /dev/null +++ b/src/test/ui/compile-fail-migration/E0596.mir.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/E0596.rs:16:13 + | +LL | let x = 1; + | - help: consider changing this to be mutable: `mut x` +LL | let y = &mut x; //[ast]~ ERROR [E0596] + | ^^^^^^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/E0596.rs b/src/test/ui/compile-fail-migration/E0596.rs index 52bdff55d86..52bdff55d86 100644 --- a/src/test/compile-fail/E0596.rs +++ b/src/test/ui/compile-fail-migration/E0596.rs diff --git a/src/test/compile-fail/absolute-paths-in-nested-use-groups.rs b/src/test/ui/compile-fail-migration/absolute-paths-in-nested-use-groups.rs index fe052f2f47f..fe052f2f47f 100644 --- a/src/test/compile-fail/absolute-paths-in-nested-use-groups.rs +++ b/src/test/ui/compile-fail-migration/absolute-paths-in-nested-use-groups.rs diff --git a/src/test/ui/compile-fail-migration/absolute-paths-in-nested-use-groups.stderr b/src/test/ui/compile-fail-migration/absolute-paths-in-nested-use-groups.stderr new file mode 100644 index 00000000000..e88d26718a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/absolute-paths-in-nested-use-groups.stderr @@ -0,0 +1,21 @@ +error[E0433]: failed to resolve. crate root in paths can only be used in start position + --> $DIR/absolute-paths-in-nested-use-groups.rs:16:5 + | +LL | ::bar, //~ ERROR crate root in paths can only be used in start position + | ^ crate root in paths can only be used in start position + +error[E0433]: failed to resolve. `super` in paths can only be used in start position + --> $DIR/absolute-paths-in-nested-use-groups.rs:17:5 + | +LL | super::bar, //~ ERROR `super` in paths can only be used in start position + | ^^^^^ `super` in paths can only be used in start position + +error[E0433]: failed to resolve. `self` in paths can only be used in start position + --> $DIR/absolute-paths-in-nested-use-groups.rs:18:5 + | +LL | self::bar, //~ ERROR `self` in paths can only be used in start position + | ^^^^ `self` in paths can only be used in start position + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/compile-fail-migration/access-mode-in-closures.nll.stderr b/src/test/ui/compile-fail-migration/access-mode-in-closures.nll.stderr new file mode 100644 index 00000000000..2aa8f1c3813 --- /dev/null +++ b/src/test/ui/compile-fail-migration/access-mode-in-closures.nll.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/access-mode-in-closures.rs:19:15 + | +LL | match *s { sty(v) => v } //~ ERROR cannot move out + | ^^ - move occurs because v has type `std::vec::Vec<isize>`, which does not implement the `Copy` trait + | | + | cannot move out of borrowed content + | help: consider removing this dereference operator: `s` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/access-mode-in-closures.rs b/src/test/ui/compile-fail-migration/access-mode-in-closures.rs index bad192fc2cf..bad192fc2cf 100644 --- a/src/test/compile-fail/access-mode-in-closures.rs +++ b/src/test/ui/compile-fail-migration/access-mode-in-closures.rs diff --git a/src/test/ui/compile-fail-migration/access-mode-in-closures.stderr b/src/test/ui/compile-fail-migration/access-mode-in-closures.stderr new file mode 100644 index 00000000000..daecbb6ed29 --- /dev/null +++ b/src/test/ui/compile-fail-migration/access-mode-in-closures.stderr @@ -0,0 +1,11 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/access-mode-in-closures.rs:19:15 + | +LL | match *s { sty(v) => v } //~ ERROR cannot move out + | ^^ - hint: to prevent move, use `ref v` or `ref mut v` + | | + | cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/alloc-error-handler-bad-signature-1.rs b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-1.rs index e398f16a065..e398f16a065 100644 --- a/src/test/compile-fail/alloc-error-handler-bad-signature-1.rs +++ b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-1.rs diff --git a/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-1.stderr b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-1.stderr new file mode 100644 index 00000000000..6dd905ceab4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-1.stderr @@ -0,0 +1,14 @@ +error: return type should be `!` + --> $DIR/alloc-error-handler-bad-signature-1.rs:22:6 + | +LL | ) -> () //~ ERROR return type should be `!` + | ^^ + +error: argument should be `Layout` + --> $DIR/alloc-error-handler-bad-signature-1.rs:21:11 + | +LL | info: &Layout, //~ ERROR argument should be `Layout` + | ^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/alloc-error-handler-bad-signature-2.rs b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-2.rs index 4fee9d27e51..4fee9d27e51 100644 --- a/src/test/compile-fail/alloc-error-handler-bad-signature-2.rs +++ b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-2.rs diff --git a/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-2.stderr b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-2.stderr new file mode 100644 index 00000000000..c1fcdc75833 --- /dev/null +++ b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-2.stderr @@ -0,0 +1,14 @@ +error: return type should be `!` + --> $DIR/alloc-error-handler-bad-signature-2.rs:22:3 + | +LL | ) { //~ ERROR return type should be `!` + | ^ + +error: argument should be `Layout` + --> $DIR/alloc-error-handler-bad-signature-2.rs:21:11 + | +LL | info: Layout, //~ ERROR argument should be `Layout` + | ^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/alloc-error-handler-bad-signature-3.rs b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-3.rs index 828a78055d5..828a78055d5 100644 --- a/src/test/compile-fail/alloc-error-handler-bad-signature-3.rs +++ b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-3.rs diff --git a/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-3.stderr b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-3.stderr new file mode 100644 index 00000000000..9b792c46c24 --- /dev/null +++ b/src/test/ui/compile-fail-migration/alloc-error-handler-bad-signature-3.stderr @@ -0,0 +1,10 @@ +error: function should have one argument + --> $DIR/alloc-error-handler-bad-signature-3.rs:20:1 + | +LL | / fn oom() -> ! { //~ ERROR function should have one argument +LL | | loop {} +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/allocator/auxiliary/system-allocator.rs b/src/test/ui/compile-fail-migration/allocator/auxiliary/system-allocator.rs index e5650d5b7b0..e5650d5b7b0 100644 --- a/src/test/compile-fail/allocator/auxiliary/system-allocator.rs +++ b/src/test/ui/compile-fail-migration/allocator/auxiliary/system-allocator.rs diff --git a/src/test/compile-fail/allocator/auxiliary/system-allocator2.rs b/src/test/ui/compile-fail-migration/allocator/auxiliary/system-allocator2.rs index e5650d5b7b0..e5650d5b7b0 100644 --- a/src/test/compile-fail/allocator/auxiliary/system-allocator2.rs +++ b/src/test/ui/compile-fail-migration/allocator/auxiliary/system-allocator2.rs diff --git a/src/test/compile-fail/allocator/function-allocator.rs b/src/test/ui/compile-fail-migration/allocator/function-allocator.rs index 989c102b86e..989c102b86e 100644 --- a/src/test/compile-fail/allocator/function-allocator.rs +++ b/src/test/ui/compile-fail-migration/allocator/function-allocator.rs diff --git a/src/test/ui/compile-fail-migration/allocator/function-allocator.stderr b/src/test/ui/compile-fail-migration/allocator/function-allocator.stderr new file mode 100644 index 00000000000..8649b6b1244 --- /dev/null +++ b/src/test/ui/compile-fail-migration/allocator/function-allocator.stderr @@ -0,0 +1,8 @@ +error: allocators must be statics + --> $DIR/function-allocator.rs:13:1 + | +LL | fn foo() {} //~ ERROR: allocators must be statics + | ^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/allocator/not-an-allocator.rs b/src/test/ui/compile-fail-migration/allocator/not-an-allocator.rs index 6559335960a..6559335960a 100644 --- a/src/test/compile-fail/allocator/not-an-allocator.rs +++ b/src/test/ui/compile-fail-migration/allocator/not-an-allocator.rs diff --git a/src/test/ui/compile-fail-migration/allocator/not-an-allocator.stderr b/src/test/ui/compile-fail-migration/allocator/not-an-allocator.stderr new file mode 100644 index 00000000000..757c5066a66 --- /dev/null +++ b/src/test/ui/compile-fail-migration/allocator/not-an-allocator.stderr @@ -0,0 +1,35 @@ +error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied + --> $DIR/not-an-allocator.rs:12:1 + | +LL | static A: usize = 0; + | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` + | + = note: required by `std::alloc::GlobalAlloc::alloc` + +error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied + --> $DIR/not-an-allocator.rs:12:1 + | +LL | static A: usize = 0; + | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` + | + = note: required by `std::alloc::GlobalAlloc::dealloc` + +error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied + --> $DIR/not-an-allocator.rs:12:1 + | +LL | static A: usize = 0; + | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` + | + = note: required by `std::alloc::GlobalAlloc::realloc` + +error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied + --> $DIR/not-an-allocator.rs:12:1 + | +LL | static A: usize = 0; + | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize` + | + = note: required by `std::alloc::GlobalAlloc::alloc_zeroed` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/allocator/two-allocators.rs b/src/test/ui/compile-fail-migration/allocator/two-allocators.rs index 7a97a11df20..7a97a11df20 100644 --- a/src/test/compile-fail/allocator/two-allocators.rs +++ b/src/test/ui/compile-fail-migration/allocator/two-allocators.rs diff --git a/src/test/ui/compile-fail-migration/allocator/two-allocators.stderr b/src/test/ui/compile-fail-migration/allocator/two-allocators.stderr new file mode 100644 index 00000000000..5285ee93f2d --- /dev/null +++ b/src/test/ui/compile-fail-migration/allocator/two-allocators.stderr @@ -0,0 +1,8 @@ +error: cannot define more than one #[global_allocator] + --> $DIR/two-allocators.rs:16:1 + | +LL | static B: System = System; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/allocator/two-allocators2.rs b/src/test/ui/compile-fail-migration/allocator/two-allocators2.rs index e747140dfe5..e747140dfe5 100644 --- a/src/test/compile-fail/allocator/two-allocators2.rs +++ b/src/test/ui/compile-fail-migration/allocator/two-allocators2.rs diff --git a/src/test/ui/compile-fail-migration/allocator/two-allocators2.stderr b/src/test/ui/compile-fail-migration/allocator/two-allocators2.stderr new file mode 100644 index 00000000000..2b23ce38ede --- /dev/null +++ b/src/test/ui/compile-fail-migration/allocator/two-allocators2.stderr @@ -0,0 +1,4 @@ +error: the #[global_allocator] in this crate conflicts with global allocator in: system_allocator + +error: aborting due to previous error + diff --git a/src/test/compile-fail/allocator/two-allocators3.rs b/src/test/ui/compile-fail-migration/allocator/two-allocators3.rs index dd86b02bd20..dd86b02bd20 100644 --- a/src/test/compile-fail/allocator/two-allocators3.rs +++ b/src/test/ui/compile-fail-migration/allocator/two-allocators3.rs diff --git a/src/test/ui/compile-fail-migration/allocator/two-allocators3.stderr b/src/test/ui/compile-fail-migration/allocator/two-allocators3.stderr new file mode 100644 index 00000000000..86e385a96a1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/allocator/two-allocators3.stderr @@ -0,0 +1,4 @@ +error: the #[global_allocator] in system_allocator conflicts with this global allocator in: system_allocator2 + +error: aborting due to previous error + diff --git a/src/test/compile-fail/anon-params-deprecated.rs b/src/test/ui/compile-fail-migration/anon-params-deprecated.rs index 4d37ba920f3..4d37ba920f3 100644 --- a/src/test/compile-fail/anon-params-deprecated.rs +++ b/src/test/ui/compile-fail-migration/anon-params-deprecated.rs diff --git a/src/test/ui/compile-fail-migration/anon-params-deprecated.stderr b/src/test/ui/compile-fail-migration/anon-params-deprecated.stderr new file mode 100644 index 00000000000..fa13b8d97e5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/anon-params-deprecated.stderr @@ -0,0 +1,34 @@ +error: anonymous parameters are deprecated and will be removed in the next edition. + --> $DIR/anon-params-deprecated.rs:15:12 + | +LL | fn foo(i32); //~ ERROR anonymous parameters are deprecated + | ^^^ help: Try naming the parameter or explicitly ignoring it: `_: i32` + | +note: lint level defined here + --> $DIR/anon-params-deprecated.rs:11:11 + | +LL | #![forbid(anonymous_parameters)] + | ^^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686> + +error: anonymous parameters are deprecated and will be removed in the next edition. + --> $DIR/anon-params-deprecated.rs:18:30 + | +LL | fn bar_with_default_impl(String, String) {} + | ^^^^^^ help: Try naming the parameter or explicitly ignoring it: `_: String` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686> + +error: anonymous parameters are deprecated and will be removed in the next edition. + --> $DIR/anon-params-deprecated.rs:18:38 + | +LL | fn bar_with_default_impl(String, String) {} + | ^^^^^^ help: Try naming the parameter or explicitly ignoring it: `_: String` + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686> + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/arg-count-mismatch.rs b/src/test/ui/compile-fail-migration/arg-count-mismatch.rs index 673314ec4c9..673314ec4c9 100644 --- a/src/test/compile-fail/arg-count-mismatch.rs +++ b/src/test/ui/compile-fail-migration/arg-count-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/arg-count-mismatch.stderr b/src/test/ui/compile-fail-migration/arg-count-mismatch.stderr new file mode 100644 index 00000000000..699e36f3472 --- /dev/null +++ b/src/test/ui/compile-fail-migration/arg-count-mismatch.stderr @@ -0,0 +1,12 @@ +error[E0061]: this function takes 1 parameter but 0 parameters were supplied + --> $DIR/arg-count-mismatch.rs:15:28 + | +LL | fn f(x: isize) { } + | -------------- defined here +LL | +LL | fn main() { let i: (); i = f(); } + | ^^^ expected 1 parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0061`. diff --git a/src/test/compile-fail/arg-type-mismatch.rs b/src/test/ui/compile-fail-migration/arg-type-mismatch.rs index 1f657ca5832..1f657ca5832 100644 --- a/src/test/compile-fail/arg-type-mismatch.rs +++ b/src/test/ui/compile-fail-migration/arg-type-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/arg-type-mismatch.stderr b/src/test/ui/compile-fail-migration/arg-type-mismatch.stderr new file mode 100644 index 00000000000..2b24d9db3f5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/arg-type-mismatch.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/arg-type-mismatch.rs:16:30 + | +LL | fn main() { let i: (); i = f(()); } + | ^^ expected isize, found () + | + = note: expected type `isize` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/array-not-vector.rs b/src/test/ui/compile-fail-migration/array-not-vector.rs index 47e1c09f380..47e1c09f380 100644 --- a/src/test/compile-fail/array-not-vector.rs +++ b/src/test/ui/compile-fail-migration/array-not-vector.rs diff --git a/src/test/ui/compile-fail-migration/array-not-vector.stderr b/src/test/ui/compile-fail-migration/array-not-vector.stderr new file mode 100644 index 00000000000..83bf058c449 --- /dev/null +++ b/src/test/ui/compile-fail-migration/array-not-vector.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/array-not-vector.rs:12:19 + | +LL | let _x: i32 = [1, 2, 3]; + | ^^^^^^^^^ expected i32, found array of 3 elements + | + = note: expected type `i32` + found type `[{integer}; 3]` + +error[E0308]: mismatched types + --> $DIR/array-not-vector.rs:19:20 + | +LL | let _y: &i32 = x; + | ^ expected i32, found slice + | + = note: expected type `&i32` + found type `&[i32]` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/array_const_index-0.rs b/src/test/ui/compile-fail-migration/array_const_index-0.rs index 91007fcd63a..91007fcd63a 100644 --- a/src/test/compile-fail/array_const_index-0.rs +++ b/src/test/ui/compile-fail-migration/array_const_index-0.rs diff --git a/src/test/ui/compile-fail-migration/array_const_index-0.stderr b/src/test/ui/compile-fail-migration/array_const_index-0.stderr new file mode 100644 index 00000000000..b71d224f4f0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/array_const_index-0.stderr @@ -0,0 +1,12 @@ +error: this constant cannot be used + --> $DIR/array_const_index-0.rs:12:1 + | +LL | const B: i32 = (&A)[1]; + | ^^^^^^^^^^^^^^^-------^ + | | + | index out of bounds: the len is 0 but the index is 1 + | + = note: #[deny(const_err)] on by default + +error: aborting due to previous error + diff --git a/src/test/compile-fail/array_const_index-1.rs b/src/test/ui/compile-fail-migration/array_const_index-1.rs index 66739d308a7..66739d308a7 100644 --- a/src/test/compile-fail/array_const_index-1.rs +++ b/src/test/ui/compile-fail-migration/array_const_index-1.rs diff --git a/src/test/ui/compile-fail-migration/array_const_index-1.stderr b/src/test/ui/compile-fail-migration/array_const_index-1.stderr new file mode 100644 index 00000000000..02f86a693af --- /dev/null +++ b/src/test/ui/compile-fail-migration/array_const_index-1.stderr @@ -0,0 +1,12 @@ +error: this constant cannot be used + --> $DIR/array_const_index-1.rs:12:1 + | +LL | const B: i32 = A[1]; + | ^^^^^^^^^^^^^^^----^ + | | + | index out of bounds: the len is 0 but the index is 1 + | + = note: #[deny(const_err)] on by default + +error: aborting due to previous error + diff --git a/src/test/compile-fail/asm-bad-clobber.rs b/src/test/ui/compile-fail-migration/asm-bad-clobber.rs index c2b54e37e39..c2b54e37e39 100644 --- a/src/test/compile-fail/asm-bad-clobber.rs +++ b/src/test/ui/compile-fail-migration/asm-bad-clobber.rs diff --git a/src/test/ui/compile-fail-migration/asm-bad-clobber.stderr b/src/test/ui/compile-fail-migration/asm-bad-clobber.stderr new file mode 100644 index 00000000000..81ab006a18a --- /dev/null +++ b/src/test/ui/compile-fail-migration/asm-bad-clobber.stderr @@ -0,0 +1,9 @@ +error[E0664]: clobber should not be surrounded by braces + --> $DIR/asm-bad-clobber.rs:32:37 + | +LL | asm!("xor %eax, %eax" : : : "{eax}"); + | ^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0664`. diff --git a/src/test/compile-fail/asm-in-bad-modifier.rs b/src/test/ui/compile-fail-migration/asm-in-bad-modifier.rs index 2eefd4235bc..2eefd4235bc 100644 --- a/src/test/compile-fail/asm-in-bad-modifier.rs +++ b/src/test/ui/compile-fail-migration/asm-in-bad-modifier.rs diff --git a/src/test/ui/compile-fail-migration/asm-in-bad-modifier.stderr b/src/test/ui/compile-fail-migration/asm-in-bad-modifier.stderr new file mode 100644 index 00000000000..dcb11bd1e76 --- /dev/null +++ b/src/test/ui/compile-fail-migration/asm-in-bad-modifier.stderr @@ -0,0 +1,16 @@ +error[E0662]: input operand constraint contains '=' + --> $DIR/asm-in-bad-modifier.rs:33:39 + | +LL | asm!("mov $1, $0" : "=r"(x) : "=r"(5)); //~ ERROR operand constraint contains '=' + | ^^^^ + +error[E0663]: input operand constraint contains '+' + --> $DIR/asm-in-bad-modifier.rs:34:39 + | +LL | asm!("mov $1, $0" : "=r"(y) : "+r"(5)); //~ ERROR operand constraint contains '+' + | ^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0662, E0663. +For more information about an error, try `rustc --explain E0662`. diff --git a/src/test/compile-fail/asm-misplaced-option.rs b/src/test/ui/compile-fail-migration/asm-misplaced-option.rs index bfc1fd68fe0..bfc1fd68fe0 100644 --- a/src/test/compile-fail/asm-misplaced-option.rs +++ b/src/test/ui/compile-fail-migration/asm-misplaced-option.rs diff --git a/src/test/ui/compile-fail-migration/asm-misplaced-option.stderr b/src/test/ui/compile-fail-migration/asm-misplaced-option.stderr new file mode 100644 index 00000000000..46723918a3a --- /dev/null +++ b/src/test/ui/compile-fail-migration/asm-misplaced-option.stderr @@ -0,0 +1,26 @@ +warning: unrecognized option + --> $DIR/asm-misplaced-option.rs:36:64 + | +LL | asm!("mov $1, $0" : "=r"(x) : "r"(5_usize), "0"(x) : : "cc"); + | ^^^^ + +warning: expected a clobber, found an option + --> $DIR/asm-misplaced-option.rs:43:80 + | +LL | asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile"); + | ^^^^^^^^^^ + +error: compilation successful + --> $DIR/asm-misplaced-option.rs:31:1 + | +LL | / pub fn main() { //~ ERROR compilation successful +LL | | // assignment not dead +LL | | let mut x: isize = 0; +LL | | unsafe { +... | +LL | | assert_eq!(x, 13); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/asm-out-no-modifier.rs b/src/test/ui/compile-fail-migration/asm-out-no-modifier.rs index 40d2ded8a88..40d2ded8a88 100644 --- a/src/test/compile-fail/asm-out-no-modifier.rs +++ b/src/test/ui/compile-fail-migration/asm-out-no-modifier.rs diff --git a/src/test/ui/compile-fail-migration/asm-out-no-modifier.stderr b/src/test/ui/compile-fail-migration/asm-out-no-modifier.stderr new file mode 100644 index 00000000000..4e9d7b884b3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/asm-out-no-modifier.stderr @@ -0,0 +1,9 @@ +error[E0661]: output operand constraint lacks '=' or '+' + --> $DIR/asm-out-no-modifier.rs:32:29 + | +LL | asm!("mov $1, $0" : "r"(x) : "r"(5)); //~ ERROR output operand constraint lacks '=' + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0661`. diff --git a/src/test/ui/compile-fail-migration/asm-out-read-uninit.ast.stderr b/src/test/ui/compile-fail-migration/asm-out-read-uninit.ast.stderr new file mode 100644 index 00000000000..5f6685e5c1c --- /dev/null +++ b/src/test/ui/compile-fail-migration/asm-out-read-uninit.ast.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/asm-out-read-uninit.rs:35:43 + | +LL | asm!("mov $1, $0" : "=r"(x) : "r"(x)); + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/asm-out-read-uninit.mir.stderr b/src/test/ui/compile-fail-migration/asm-out-read-uninit.mir.stderr new file mode 100644 index 00000000000..5f6685e5c1c --- /dev/null +++ b/src/test/ui/compile-fail-migration/asm-out-read-uninit.mir.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/asm-out-read-uninit.rs:35:43 + | +LL | asm!("mov $1, $0" : "=r"(x) : "r"(x)); + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/asm-out-read-uninit.rs b/src/test/ui/compile-fail-migration/asm-out-read-uninit.rs index c308a9f0850..c308a9f0850 100644 --- a/src/test/compile-fail/asm-out-read-uninit.rs +++ b/src/test/ui/compile-fail-migration/asm-out-read-uninit.rs diff --git a/src/test/compile-fail/asm-src-loc-codegen-units.rs b/src/test/ui/compile-fail-migration/asm-src-loc-codegen-units.rs index 6c5c5b00776..6c5c5b00776 100644 --- a/src/test/compile-fail/asm-src-loc-codegen-units.rs +++ b/src/test/ui/compile-fail-migration/asm-src-loc-codegen-units.rs diff --git a/src/test/ui/compile-fail-migration/asm-src-loc-codegen-units.stderr b/src/test/ui/compile-fail-migration/asm-src-loc-codegen-units.stderr new file mode 100644 index 00000000000..5bd42690156 --- /dev/null +++ b/src/test/ui/compile-fail-migration/asm-src-loc-codegen-units.stderr @@ -0,0 +1,11 @@ +error: <inline asm>:1:2: error: invalid instruction mnemonic 'nowayisthisavalidinstruction' + nowayisthisavalidinstruction + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + --> $DIR/asm-src-loc-codegen-units.rs:20:9 + | +LL | asm!("nowayisthisavalidinstruction"); //~ ERROR instruction + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/asm-src-loc.rs b/src/test/ui/compile-fail-migration/asm-src-loc.rs index 59b47c2408d..59b47c2408d 100644 --- a/src/test/compile-fail/asm-src-loc.rs +++ b/src/test/ui/compile-fail-migration/asm-src-loc.rs diff --git a/src/test/ui/compile-fail-migration/asm-src-loc.stderr b/src/test/ui/compile-fail-migration/asm-src-loc.stderr new file mode 100644 index 00000000000..4f79ec6ad64 --- /dev/null +++ b/src/test/ui/compile-fail-migration/asm-src-loc.stderr @@ -0,0 +1,11 @@ +error: <inline asm>:1:2: error: invalid instruction mnemonic 'nowayisthisavalidinstruction' + nowayisthisavalidinstruction + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + --> $DIR/asm-src-loc.rs:17:9 + | +LL | asm!("nowayisthisavalidinstruction"); //~ ERROR instruction + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/assign-imm-local-twice.ast.nll.stderr b/src/test/ui/compile-fail-migration/assign-imm-local-twice.ast.nll.stderr new file mode 100644 index 00000000000..6d415eb7333 --- /dev/null +++ b/src/test/ui/compile-fail-migration/assign-imm-local-twice.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/assign-imm-local-twice.rs:20:5 + | +LL | let v: isize; + | - consider changing this to `mut v` +LL | //[mir]~^ NOTE consider changing this to `mut v` +LL | v = 1; //[ast]~ NOTE first assignment + | ----- first assignment to `v` +... +LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/assign-imm-local-twice.ast.stderr b/src/test/ui/compile-fail-migration/assign-imm-local-twice.ast.stderr new file mode 100644 index 00000000000..32752621e14 --- /dev/null +++ b/src/test/ui/compile-fail-migration/assign-imm-local-twice.ast.stderr @@ -0,0 +1,12 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/assign-imm-local-twice.rs:20:5 + | +LL | v = 1; //[ast]~ NOTE first assignment + | ----- first assignment to `v` +... +LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/assign-imm-local-twice.mir.stderr b/src/test/ui/compile-fail-migration/assign-imm-local-twice.mir.stderr new file mode 100644 index 00000000000..6d415eb7333 --- /dev/null +++ b/src/test/ui/compile-fail-migration/assign-imm-local-twice.mir.stderr @@ -0,0 +1,15 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/assign-imm-local-twice.rs:20:5 + | +LL | let v: isize; + | - consider changing this to `mut v` +LL | //[mir]~^ NOTE consider changing this to `mut v` +LL | v = 1; //[ast]~ NOTE first assignment + | ----- first assignment to `v` +... +LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/compile-fail/assign-imm-local-twice.rs b/src/test/ui/compile-fail-migration/assign-imm-local-twice.rs index ee9dafdd49e..ee9dafdd49e 100644 --- a/src/test/compile-fail/assign-imm-local-twice.rs +++ b/src/test/ui/compile-fail-migration/assign-imm-local-twice.rs diff --git a/src/test/compile-fail/assign-to-method.rs b/src/test/ui/compile-fail-migration/assign-to-method.rs index 4518ce36b6d..4518ce36b6d 100644 --- a/src/test/compile-fail/assign-to-method.rs +++ b/src/test/ui/compile-fail-migration/assign-to-method.rs diff --git a/src/test/ui/compile-fail-migration/assign-to-method.stderr b/src/test/ui/compile-fail-migration/assign-to-method.stderr new file mode 100644 index 00000000000..930b4512572 --- /dev/null +++ b/src/test/ui/compile-fail-migration/assign-to-method.stderr @@ -0,0 +1,11 @@ +error[E0615]: attempted to take value of method `speak` on type `cat` + --> $DIR/assign-to-method.rs:30:8 + | +LL | nyan.speak = || println!("meow"); //~ ERROR attempted to take value of method + | ^^^^^ + | + = help: maybe a `()` to call it is missing? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0615`. diff --git a/src/test/compile-fail/assignment-operator-unimplemented.rs b/src/test/ui/compile-fail-migration/assignment-operator-unimplemented.rs index 5b24c6bd79f..5b24c6bd79f 100644 --- a/src/test/compile-fail/assignment-operator-unimplemented.rs +++ b/src/test/ui/compile-fail-migration/assignment-operator-unimplemented.rs diff --git a/src/test/ui/compile-fail-migration/assignment-operator-unimplemented.stderr b/src/test/ui/compile-fail-migration/assignment-operator-unimplemented.stderr new file mode 100644 index 00000000000..983d698c63e --- /dev/null +++ b/src/test/ui/compile-fail-migration/assignment-operator-unimplemented.stderr @@ -0,0 +1,13 @@ +error[E0368]: binary assignment operation `+=` cannot be applied to type `Foo` + --> $DIR/assignment-operator-unimplemented.rs:16:3 + | +LL | a += *b; //~ Error: binary assignment operation `+=` cannot be applied to type `Foo` + | -^^^^^^ + | | + | cannot use `+=` on type `Foo` + | + = note: an implementation of `std::ops::AddAssign` might be missing for `Foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0368`. diff --git a/src/test/compile-fail/assoc-inherent.rs b/src/test/ui/compile-fail-migration/assoc-inherent.rs index 7eab831258f..7eab831258f 100644 --- a/src/test/compile-fail/assoc-inherent.rs +++ b/src/test/ui/compile-fail-migration/assoc-inherent.rs diff --git a/src/test/ui/compile-fail-migration/assoc-inherent.stderr b/src/test/ui/compile-fail-migration/assoc-inherent.stderr new file mode 100644 index 00000000000..11497cba0ff --- /dev/null +++ b/src/test/ui/compile-fail-migration/assoc-inherent.stderr @@ -0,0 +1,9 @@ +error[E0202]: associated types are not allowed in inherent impls + --> $DIR/assoc-inherent.rs:16:5 + | +LL | type Bar = isize; //~ERROR associated types are not allowed in inherent impls + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0202`. diff --git a/src/test/compile-fail/associated-const-ambiguity-report.rs b/src/test/ui/compile-fail-migration/associated-const-ambiguity-report.rs index 5051e78d1ba..5051e78d1ba 100644 --- a/src/test/compile-fail/associated-const-ambiguity-report.rs +++ b/src/test/ui/compile-fail-migration/associated-const-ambiguity-report.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-ambiguity-report.stderr b/src/test/ui/compile-fail-migration/associated-const-ambiguity-report.stderr new file mode 100644 index 00000000000..0832b1a2605 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-ambiguity-report.stderr @@ -0,0 +1,20 @@ +error[E0034]: multiple applicable items in scope + --> $DIR/associated-const-ambiguity-report.rs:28:16 + | +LL | const X: i32 = <i32>::ID; //~ ERROR E0034 + | ^^^^^^^^^ multiple `ID` found + | +note: candidate #1 is defined in an impl of the trait `Foo` for the type `i32` + --> $DIR/associated-const-ambiguity-report.rs:21:5 + | +LL | const ID: i32 = 1; + | ^^^^^^^^^^^^^^^^^^ +note: candidate #2 is defined in an impl of the trait `Bar` for the type `i32` + --> $DIR/associated-const-ambiguity-report.rs:25:5 + | +LL | const ID: i32 = 3; + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0034`. diff --git a/src/test/compile-fail/associated-const-array-len.rs b/src/test/ui/compile-fail-migration/associated-const-array-len.rs index 2cc10f0f956..2cc10f0f956 100644 --- a/src/test/compile-fail/associated-const-array-len.rs +++ b/src/test/ui/compile-fail-migration/associated-const-array-len.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-array-len.stderr b/src/test/ui/compile-fail-migration/associated-const-array-len.stderr new file mode 100644 index 00000000000..5504af8fecd --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-array-len.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `i32: Foo` is not satisfied + --> $DIR/associated-const-array-len.rs:16:16 + | +LL | const X: [i32; <i32 as Foo>::ID] = [0, 1, 2]; + | ^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i32` + | +note: required by `Foo::ID` + --> $DIR/associated-const-array-len.rs:13:5 + | +LL | const ID: usize; + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-const-dead-code.rs b/src/test/ui/compile-fail-migration/associated-const-dead-code.rs index 42db13f4f3b..42db13f4f3b 100644 --- a/src/test/compile-fail/associated-const-dead-code.rs +++ b/src/test/ui/compile-fail-migration/associated-const-dead-code.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-dead-code.stderr b/src/test/ui/compile-fail-migration/associated-const-dead-code.stderr new file mode 100644 index 00000000000..ee065812183 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-dead-code.stderr @@ -0,0 +1,14 @@ +error: associated const is never used: `BAR` + --> $DIR/associated-const-dead-code.rs:16:5 + | +LL | const BAR: u32 = 1; + | ^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/associated-const-dead-code.rs:11:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-const-generic-obligations.rs b/src/test/ui/compile-fail-migration/associated-const-generic-obligations.rs index 45f53418dca..45f53418dca 100644 --- a/src/test/compile-fail/associated-const-generic-obligations.rs +++ b/src/test/ui/compile-fail-migration/associated-const-generic-obligations.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-generic-obligations.stderr b/src/test/ui/compile-fail-migration/associated-const-generic-obligations.stderr new file mode 100644 index 00000000000..97986a27c64 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-generic-obligations.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `T: Foo` is not satisfied + --> $DIR/associated-const-generic-obligations.rs:25:5 + | +LL | const FROM: &'static str = "foo"; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `T` + | + = help: consider adding a `where T: Foo` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-const-in-trait.rs b/src/test/ui/compile-fail-migration/associated-const-in-trait.rs index f837d9ab8e5..f837d9ab8e5 100644 --- a/src/test/compile-fail/associated-const-in-trait.rs +++ b/src/test/ui/compile-fail-migration/associated-const-in-trait.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-in-trait.stderr b/src/test/ui/compile-fail-migration/associated-const-in-trait.stderr new file mode 100644 index 00000000000..7804e44f2d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-in-trait.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait `Trait` cannot be made into an object + --> $DIR/associated-const-in-trait.rs:19:6 + | +LL | impl Trait { + | ^^^^^ the trait `Trait` cannot be made into an object + | + = note: the trait cannot contain associated consts like `N` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/associated-const-no-item.rs b/src/test/ui/compile-fail-migration/associated-const-no-item.rs index f9a57cd6d75..f9a57cd6d75 100644 --- a/src/test/compile-fail/associated-const-no-item.rs +++ b/src/test/ui/compile-fail-migration/associated-const-no-item.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-no-item.stderr b/src/test/ui/compile-fail-migration/associated-const-no-item.stderr new file mode 100644 index 00000000000..a09c04ea0b2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-no-item.stderr @@ -0,0 +1,13 @@ +error[E0599]: no associated item named `ID` found for type `i32` in the current scope + --> $DIR/associated-const-no-item.rs:16:16 + | +LL | const X: i32 = <i32>::ID; + | ^^^^^^^^^ associated item not found in `i32` + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `ID`, perhaps you need to implement it: + candidate #1: `Foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/associated-const-private-impl.rs b/src/test/ui/compile-fail-migration/associated-const-private-impl.rs index b5accfff5bb..b5accfff5bb 100644 --- a/src/test/compile-fail/associated-const-private-impl.rs +++ b/src/test/ui/compile-fail-migration/associated-const-private-impl.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-private-impl.stderr b/src/test/ui/compile-fail-migration/associated-const-private-impl.stderr new file mode 100644 index 00000000000..65be3753bac --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-private-impl.stderr @@ -0,0 +1,9 @@ +error[E0624]: associated constant `ID` is private + --> $DIR/associated-const-private-impl.rs:24:19 + | +LL | assert_eq!(1, bar1::Foo::ID); + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0624`. diff --git a/src/test/compile-fail/associated-const-type-parameter-arms.rs b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arms.rs index 630a234fa66..630a234fa66 100644 --- a/src/test/compile-fail/associated-const-type-parameter-arms.rs +++ b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arms.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-type-parameter-arms.stderr b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arms.stderr new file mode 100644 index 00000000000..a88dd4d9955 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arms.stderr @@ -0,0 +1,15 @@ +error[E0158]: associated consts cannot be referenced in patterns + --> $DIR/associated-const-type-parameter-arms.rs:31:9 + | +LL | A::X => println!("A::X"), + | ^^^^ + +error[E0158]: associated consts cannot be referenced in patterns + --> $DIR/associated-const-type-parameter-arms.rs:33:9 + | +LL | B::X => println!("B::X"), + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0158`. diff --git a/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays-2.rs index d196cf22156..d196cf22156 100644 --- a/src/test/compile-fail/associated-const-type-parameter-arrays-2.rs +++ b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays-2.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays-2.stderr b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays-2.stderr new file mode 100644 index 00000000000..a440f1f82f1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays-2.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `A: Foo` is not satisfied + --> $DIR/associated-const-type-parameter-arrays-2.rs:27:22 + | +LL | let _array = [4; <A as Foo>::Y]; + | ^^^^^^^^^^^^^ the trait `Foo` is not implemented for `A` + | + = help: consider adding a `where A: Foo` bound +note: required by `Foo::Y` + --> $DIR/associated-const-type-parameter-arrays-2.rs:13:5 + | +LL | const Y: usize; + | ^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-const-type-parameter-arrays.rs b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays.rs index 0b24cab2a68..0b24cab2a68 100644 --- a/src/test/compile-fail/associated-const-type-parameter-arrays.rs +++ b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays.stderr b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays.stderr new file mode 100644 index 00000000000..48891546360 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-type-parameter-arrays.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `A: Foo` is not satisfied + --> $DIR/associated-const-type-parameter-arrays.rs:27:23 + | +LL | let _array: [u32; <A as Foo>::Y]; + | ^^^^^^^^^^^^^ the trait `Foo` is not implemented for `A` + | + = help: consider adding a `where A: Foo` bound +note: required by `Foo::Y` + --> $DIR/associated-const-type-parameter-arrays.rs:13:5 + | +LL | const Y: usize; + | ^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-const-upper-case-lint.rs b/src/test/ui/compile-fail-migration/associated-const-upper-case-lint.rs index 497ff426b2f..497ff426b2f 100644 --- a/src/test/compile-fail/associated-const-upper-case-lint.rs +++ b/src/test/ui/compile-fail-migration/associated-const-upper-case-lint.rs diff --git a/src/test/ui/compile-fail-migration/associated-const-upper-case-lint.stderr b/src/test/ui/compile-fail-migration/associated-const-upper-case-lint.stderr new file mode 100644 index 00000000000..7a5cad69094 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-const-upper-case-lint.stderr @@ -0,0 +1,14 @@ +error: associated constant `not_upper` should have an upper case name such as `NOT_UPPER` + --> $DIR/associated-const-upper-case-lint.rs:17:5 + | +LL | const not_upper: bool = true; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/associated-const-upper-case-lint.rs:11:9 + | +LL | #![deny(non_upper_case_globals)] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-item-duplicate-names-2.rs b/src/test/ui/compile-fail-migration/associated-item-duplicate-names-2.rs index 85ea949b9c8..85ea949b9c8 100644 --- a/src/test/compile-fail/associated-item-duplicate-names-2.rs +++ b/src/test/ui/compile-fail-migration/associated-item-duplicate-names-2.rs diff --git a/src/test/ui/compile-fail-migration/associated-item-duplicate-names-2.stderr b/src/test/ui/compile-fail-migration/associated-item-duplicate-names-2.stderr new file mode 100644 index 00000000000..3b9be8976b4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-item-duplicate-names-2.stderr @@ -0,0 +1,11 @@ +error[E0201]: duplicate definitions with name `bar`: + --> $DIR/associated-item-duplicate-names-2.rs:16:5 + | +LL | const bar: bool = true; + | ----------------------- previous definition of `bar` here +LL | fn bar() {} //~ ERROR duplicate definitions + | ^^^^^^^^^^^ duplicate definition + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0201`. diff --git a/src/test/compile-fail/associated-item-duplicate-names-3.rs b/src/test/ui/compile-fail-migration/associated-item-duplicate-names-3.rs index 12cab13d0b9..12cab13d0b9 100644 --- a/src/test/compile-fail/associated-item-duplicate-names-3.rs +++ b/src/test/ui/compile-fail-migration/associated-item-duplicate-names-3.rs diff --git a/src/test/ui/compile-fail-migration/associated-item-duplicate-names-3.stderr b/src/test/ui/compile-fail-migration/associated-item-duplicate-names-3.stderr new file mode 100644 index 00000000000..3edf59f2010 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-item-duplicate-names-3.stderr @@ -0,0 +1,11 @@ +error[E0201]: duplicate definitions with name `Bar`: + --> $DIR/associated-item-duplicate-names-3.rs:23:5 + | +LL | type Bar = i16; + | --------------- previous definition of `Bar` here +LL | type Bar = u16; //~ ERROR duplicate definitions + | ^^^^^^^^^^^^^^^ duplicate definition + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0201`. diff --git a/src/test/compile-fail/associated-item-duplicate-names.rs b/src/test/ui/compile-fail-migration/associated-item-duplicate-names.rs index a2fc1bc0177..a2fc1bc0177 100644 --- a/src/test/compile-fail/associated-item-duplicate-names.rs +++ b/src/test/ui/compile-fail-migration/associated-item-duplicate-names.rs diff --git a/src/test/ui/compile-fail-migration/associated-item-duplicate-names.stderr b/src/test/ui/compile-fail-migration/associated-item-duplicate-names.stderr new file mode 100644 index 00000000000..4b060a991f9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-item-duplicate-names.stderr @@ -0,0 +1,19 @@ +error[E0201]: duplicate definitions with name `Ty`: + --> $DIR/associated-item-duplicate-names.rs:21:5 + | +LL | type Ty = (); + | ------------- previous definition of `Ty` here +LL | type Ty = usize; //~ ERROR duplicate definitions + | ^^^^^^^^^^^^^^^^ duplicate definition + +error[E0201]: duplicate definitions with name `BAR`: + --> $DIR/associated-item-duplicate-names.rs:23:5 + | +LL | const BAR: u32 = 7; + | ------------------- previous definition of `BAR` here +LL | const BAR: u32 = 8; //~ ERROR duplicate definitions + | ^^^^^^^^^^^^^^^^^^^ duplicate definition + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0201`. diff --git a/src/test/compile-fail/associated-path-shl.rs b/src/test/ui/compile-fail-migration/associated-path-shl.rs index 7daf0d3c4e2..7daf0d3c4e2 100644 --- a/src/test/compile-fail/associated-path-shl.rs +++ b/src/test/ui/compile-fail-migration/associated-path-shl.rs diff --git a/src/test/ui/compile-fail-migration/associated-path-shl.stderr b/src/test/ui/compile-fail-migration/associated-path-shl.stderr new file mode 100644 index 00000000000..fa41d4abff4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-path-shl.stderr @@ -0,0 +1,43 @@ +error[E0412]: cannot find type `A` in this scope + --> $DIR/associated-path-shl.rs:14:14 + | +LL | let _: <<A>::B>::C; //~ ERROR cannot find type `A` in this scope + | ^ not found in this scope + +error[E0412]: cannot find type `A` in this scope + --> $DIR/associated-path-shl.rs:15:15 + | +LL | let _ = <<A>::B>::C; //~ ERROR cannot find type `A` in this scope + | ^ not found in this scope + +error[E0412]: cannot find type `A` in this scope + --> $DIR/associated-path-shl.rs:16:11 + | +LL | let <<A>::B>::C; //~ ERROR cannot find type `A` in this scope + | ^ not found in this scope + +error[E0412]: cannot find type `A` in this scope + --> $DIR/associated-path-shl.rs:17:17 + | +LL | let 0 ..= <<A>::B>::C; //~ ERROR cannot find type `A` in this scope + | ^ not found in this scope + +error[E0412]: cannot find type `A` in this scope + --> $DIR/associated-path-shl.rs:19:7 + | +LL | <<A>::B>::C; //~ ERROR cannot find type `A` in this scope + | ^ not found in this scope + +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/associated-path-shl.rs:17:15 + | +LL | let 0 ..= <<A>::B>::C; //~ ERROR cannot find type `A` in this scope + | ^^^^^^^^^^^ ranges require char or numeric types + | + = note: start type: {integer} + = note: end type: [type error] + +error: aborting due to 6 previous errors + +Some errors occurred: E0029, E0412. +For more information about an error, try `rustc --explain E0029`. diff --git a/src/test/compile-fail/associated-type-projection-ambig-between-bound-and-where-clause.rs b/src/test/ui/compile-fail-migration/associated-type-projection-ambig-between-bound-and-where-clause.rs index ce97019a2b2..ce97019a2b2 100644 --- a/src/test/compile-fail/associated-type-projection-ambig-between-bound-and-where-clause.rs +++ b/src/test/ui/compile-fail-migration/associated-type-projection-ambig-between-bound-and-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/associated-type-projection-ambig-between-bound-and-where-clause.stderr b/src/test/ui/compile-fail-migration/associated-type-projection-ambig-between-bound-and-where-clause.stderr new file mode 100644 index 00000000000..2706dda1c52 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-type-projection-ambig-between-bound-and-where-clause.stderr @@ -0,0 +1,75 @@ +error[E0221]: ambiguous associated type `Color` in bounds of `C` + --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:26:24 + | +LL | type Color; + | ----------- ambiguous `Color` from `Vehicle` +... +LL | type Color; + | ----------- ambiguous `Color` from `Box` +... +LL | fn a<C:Vehicle+Box>(_: C::Color) { + | ^^^^^^^^ ambiguous associated type `Color` + +error[E0221]: ambiguous associated type `Color` in bounds of `C` + --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:30:12 + | +LL | type Color; + | ----------- ambiguous `Color` from `Vehicle` +... +LL | type Color; + | ----------- ambiguous `Color` from `Box` +... +LL | fn b<C>(_: C::Color) where C : Vehicle+Box { + | ^^^^^^^^ ambiguous associated type `Color` + +error[E0221]: ambiguous associated type `Color` in bounds of `C` + --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:34:12 + | +LL | type Color; + | ----------- ambiguous `Color` from `Vehicle` +... +LL | type Color; + | ----------- ambiguous `Color` from `Box` +... +LL | fn c<C>(_: C::Color) where C : Vehicle, C : Box { + | ^^^^^^^^ ambiguous associated type `Color` + +error[E0221]: ambiguous associated type `Color` in bounds of `X` + --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:45:20 + | +LL | type Color; + | ----------- ambiguous `Color` from `Vehicle` +... +LL | type Color; + | ----------- ambiguous `Color` from `Box` +... +LL | fn e(&self, _: X::Color) where X : Box; + | ^^^^^^^^ ambiguous associated type `Color` + +error[E0221]: ambiguous associated type `Color` in bounds of `X` + --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:48:20 + | +LL | type Color; + | ----------- ambiguous `Color` from `Vehicle` +... +LL | type Color; + | ----------- ambiguous `Color` from `Box` +... +LL | fn f(&self, _: X::Color) where X : Box { } + | ^^^^^^^^ ambiguous associated type `Color` + +error[E0221]: ambiguous associated type `Color` in bounds of `X` + --> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:40:20 + | +LL | type Color; + | ----------- ambiguous `Color` from `Vehicle` +... +LL | type Color; + | ----------- ambiguous `Color` from `Box` +... +LL | fn d(&self, _: X::Color) where X : Box { } + | ^^^^^^^^ ambiguous associated type `Color` + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0221`. diff --git a/src/test/compile-fail/associated-type-projection-from-supertrait.rs b/src/test/ui/compile-fail-migration/associated-type-projection-from-supertrait.rs index b388b6a28e3..b388b6a28e3 100644 --- a/src/test/compile-fail/associated-type-projection-from-supertrait.rs +++ b/src/test/ui/compile-fail-migration/associated-type-projection-from-supertrait.rs diff --git a/src/test/ui/compile-fail-migration/associated-type-projection-from-supertrait.stderr b/src/test/ui/compile-fail-migration/associated-type-projection-from-supertrait.stderr new file mode 100644 index 00000000000..4bc09b624c8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-type-projection-from-supertrait.stderr @@ -0,0 +1,39 @@ +error[E0308]: mismatched types + --> $DIR/associated-type-projection-from-supertrait.rs:43:23 + | +LL | fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types + | ^^^^ expected struct `Black`, found struct `Blue` + | + = note: expected type `Black` + found type `Blue` + +error[E0308]: mismatched types + --> $DIR/associated-type-projection-from-supertrait.rs:44:23 + | +LL | fn c() { dent(ModelU, Black); } //~ ERROR mismatched types + | ^^^^^ expected struct `Blue`, found struct `Black` + | + = note: expected type `Blue` + found type `Black` + +error[E0308]: mismatched types + --> $DIR/associated-type-projection-from-supertrait.rs:50:28 + | +LL | fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types + | ^^^^ expected struct `Black`, found struct `Blue` + | + = note: expected type `Black` + found type `Blue` + +error[E0308]: mismatched types + --> $DIR/associated-type-projection-from-supertrait.rs:51:28 + | +LL | fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types + | ^^^^^ expected struct `Blue`, found struct `Black` + | + = note: expected type `Blue` + found type `Black` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/associated-types-binding-to-type-defined-in-supertrait.rs b/src/test/ui/compile-fail-migration/associated-types-binding-to-type-defined-in-supertrait.rs index b1194154911..b1194154911 100644 --- a/src/test/compile-fail/associated-types-binding-to-type-defined-in-supertrait.rs +++ b/src/test/ui/compile-fail-migration/associated-types-binding-to-type-defined-in-supertrait.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/compile-fail-migration/associated-types-binding-to-type-defined-in-supertrait.stderr new file mode 100644 index 00000000000..c43ff1ae4cb --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-binding-to-type-defined-in-supertrait.stderr @@ -0,0 +1,31 @@ +error[E0271]: type mismatch resolving `<ModelT as Vehicle>::Color == Blue` + --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:47:10 + | +LL | fn b() { blue_car(ModelT); } //~ ERROR type mismatch + | ^^^^^^^^ expected struct `Black`, found struct `Blue` + | + = note: expected type `Black` + found type `Blue` +note: required by `blue_car` + --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:43:1 + | +LL | fn blue_car<C:Car<Color=Blue>>(c: C) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0271]: type mismatch resolving `<ModelU as Vehicle>::Color == Black` + --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:48:10 + | +LL | fn c() { black_car(ModelU); } //~ ERROR type mismatch + | ^^^^^^^^^ expected struct `Blue`, found struct `Black` + | + = note: expected type `Blue` + found type `Black` +note: required by `black_car` + --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:40:1 + | +LL | fn black_car<C:Car<Color=Black>>(c: C) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/compile-fail/associated-types-bound-failure.rs b/src/test/ui/compile-fail-migration/associated-types-bound-failure.rs index cd21fb949cb..cd21fb949cb 100644 --- a/src/test/compile-fail/associated-types-bound-failure.rs +++ b/src/test/ui/compile-fail-migration/associated-types-bound-failure.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-bound-failure.stderr b/src/test/ui/compile-fail-migration/associated-types-bound-failure.stderr new file mode 100644 index 00000000000..067dfeb454c --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-bound-failure.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `<G as GetToInt>::R: ToInt` is not satisfied + --> $DIR/associated-types-bound-failure.rs:27:5 + | +LL | ToInt::to_int(&g.get()) //~ ERROR E0277 + | ^^^^^^^^^^^^^ the trait `ToInt` is not implemented for `<G as GetToInt>::R` + | + = help: consider adding a `where <G as GetToInt>::R: ToInt` bound +note: required by `ToInt::to_int` + --> $DIR/associated-types-bound-failure.rs:14:5 + | +LL | fn to_int(&self) -> isize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-types-coherence-failure.rs b/src/test/ui/compile-fail-migration/associated-types-coherence-failure.rs index 786a25500a8..786a25500a8 100644 --- a/src/test/compile-fail/associated-types-coherence-failure.rs +++ b/src/test/ui/compile-fail-migration/associated-types-coherence-failure.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-coherence-failure.stderr b/src/test/ui/compile-fail-migration/associated-types-coherence-failure.stderr new file mode 100644 index 00000000000..85d4bf78458 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-coherence-failure.stderr @@ -0,0 +1,21 @@ +error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `Cow<'_, _>`: + --> $DIR/associated-types-coherence-failure.rs:31:1 + | +LL | impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned { + | ----------------------------------------------------------------------------- first implementation here +... +LL | impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Cow<'_, _>` + +error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `&_`: + --> $DIR/associated-types-coherence-failure.rs:38:1 + | +LL | impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned { + | ----------------------------------------------------------------------------- first implementation here +... +LL | impl<'a, B: ?Sized> IntoCow<'a, B> for &'a B where B: ToOwned { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/associated-types-eq-1.rs b/src/test/ui/compile-fail-migration/associated-types-eq-1.rs index 6f2ee854543..6f2ee854543 100644 --- a/src/test/compile-fail/associated-types-eq-1.rs +++ b/src/test/ui/compile-fail-migration/associated-types-eq-1.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-eq-1.stderr b/src/test/ui/compile-fail-migration/associated-types-eq-1.stderr new file mode 100644 index 00000000000..81bb2ae4ce2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-eq-1.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `A` in this scope + --> $DIR/associated-types-eq-1.rs:20:12 + | +LL | let _: A = x.boo(); //~ ERROR cannot find type `A` in this scope + | ^ did you mean `I`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/compile-fail/associated-types-eq-2.rs b/src/test/ui/compile-fail-migration/associated-types-eq-2.rs index 755a9f2d73f..755a9f2d73f 100644 --- a/src/test/compile-fail/associated-types-eq-2.rs +++ b/src/test/ui/compile-fail-migration/associated-types-eq-2.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-eq-2.stderr b/src/test/ui/compile-fail-migration/associated-types-eq-2.stderr new file mode 100644 index 00000000000..0b80f3472dc --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-eq-2.stderr @@ -0,0 +1,9 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/associated-types-eq-2.rs:26:30 + | +LL | fn baz<I: Foo>(x: &<I as Foo<A=Bar>>::A) {} + | ^^^^^ associated type not allowed here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0229`. diff --git a/src/test/compile-fail/associated-types-eq-3.rs b/src/test/ui/compile-fail-migration/associated-types-eq-3.rs index cb952f6534f..cb952f6534f 100644 --- a/src/test/compile-fail/associated-types-eq-3.rs +++ b/src/test/ui/compile-fail-migration/associated-types-eq-3.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-eq-3.stderr b/src/test/ui/compile-fail-migration/associated-types-eq-3.stderr new file mode 100644 index 00000000000..d8b2be0e1b0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-eq-3.stderr @@ -0,0 +1,37 @@ +error[E0308]: mismatched types + --> $DIR/associated-types-eq-3.rs:33:18 + | +LL | let _: Bar = x.boo(); + | ^^^^^^^ expected struct `Bar`, found associated type + | + = note: expected type `Bar` + found type `<I as Foo>::A` + +error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar` + --> $DIR/associated-types-eq-3.rs:48:5 + | +LL | foo1(a); + | ^^^^ expected usize, found struct `Bar` + | + = note: expected type `usize` + found type `Bar` +note: required by `foo1` + --> $DIR/associated-types-eq-3.rs:28:1 + | +LL | fn foo1<I: Foo<A=Bar>>(x: I) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar` + --> $DIR/associated-types-eq-3.rs:51:9 + | +LL | baz(&a); + | ^^ expected usize, found struct `Bar` + | + = note: expected type `usize` + found type `Bar` + = note: required for the cast to the object type `dyn Foo<A=Bar>` + +error: aborting due to 3 previous errors + +Some errors occurred: E0271, E0308. +For more information about an error, try `rustc --explain E0271`. diff --git a/src/test/compile-fail/associated-types-eq-expr-path.rs b/src/test/ui/compile-fail-migration/associated-types-eq-expr-path.rs index 847393ba2b8..847393ba2b8 100644 --- a/src/test/compile-fail/associated-types-eq-expr-path.rs +++ b/src/test/ui/compile-fail-migration/associated-types-eq-expr-path.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-eq-expr-path.stderr b/src/test/ui/compile-fail-migration/associated-types-eq-expr-path.stderr new file mode 100644 index 00000000000..36c31cd3f05 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-eq-expr-path.stderr @@ -0,0 +1,9 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/associated-types-eq-expr-path.rs:24:26 + | +LL | let x: isize = Foo::<A=usize>::bar(); + | ^^^^^^^ associated type not allowed here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0229`. diff --git a/src/test/compile-fail/associated-types-eq-hr.rs b/src/test/ui/compile-fail-migration/associated-types-eq-hr.rs index 52a2ca9082d..52a2ca9082d 100644 --- a/src/test/compile-fail/associated-types-eq-hr.rs +++ b/src/test/ui/compile-fail-migration/associated-types-eq-hr.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-eq-hr.stderr b/src/test/ui/compile-fail-migration/associated-types-eq-hr.stderr new file mode 100644 index 00000000000..5081a2649d1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-eq-hr.stderr @@ -0,0 +1,126 @@ +error[E0271]: type mismatch resolving `for<'x> <UintStruct as TheTrait<&'x isize>>::A == &'x isize` + --> $DIR/associated-types-eq-hr.rs:92:5 + | +LL | foo::<UintStruct>(); //~ ERROR type mismatch + | ^^^^^^^^^^^^^^^^^ expected usize, found isize + | + = note: expected type `&usize` + found type `&isize` +note: required by `foo` + --> $DIR/associated-types-eq-hr.rs:54:1 + | +LL | / fn foo<T>() +LL | | where T : for<'x> TheTrait<&'x isize, A = &'x isize> +LL | | { +LL | | // ok for IntStruct, but not UintStruct +LL | | } + | |_^ + +error[E0271]: type mismatch resolving `for<'x> <IntStruct as TheTrait<&'x isize>>::A == &'x usize` + --> $DIR/associated-types-eq-hr.rs:94:5 + | +LL | bar::<IntStruct>(); //~ ERROR type mismatch + | ^^^^^^^^^^^^^^^^ expected isize, found usize + | + = note: expected type `&isize` + found type `&usize` +note: required by `bar` + --> $DIR/associated-types-eq-hr.rs:60:1 + | +LL | / fn bar<T>() +LL | | where T : for<'x> TheTrait<&'x isize, A = &'x usize> +LL | | { +LL | | // ok for UintStruct, but not IntStruct +LL | | } + | |_^ + +error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied + --> $DIR/associated-types-eq-hr.rs:97:5 + | +LL | tuple_one::<Tuple>(); + | ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` + | + = help: the following implementations were found: + <Tuple as TheTrait<(&'a isize, &'a isize)>> +note: required by `tuple_one` + --> $DIR/associated-types-eq-hr.rs:66:1 + | +LL | / fn tuple_one<T>() +LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize> +LL | | { +LL | | // not ok for tuple, two lifetimes and we pick first +LL | | } + | |_^ + +error[E0271]: type mismatch resolving `for<'x, 'y> <Tuple as TheTrait<(&'x isize, &'y isize)>>::A == &'x isize` + --> $DIR/associated-types-eq-hr.rs:97:5 + | +LL | tuple_one::<Tuple>(); + | ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime + | +note: required by `tuple_one` + --> $DIR/associated-types-eq-hr.rs:66:1 + | +LL | / fn tuple_one<T>() +LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize> +LL | | { +LL | | // not ok for tuple, two lifetimes and we pick first +LL | | } + | |_^ + +error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied + --> $DIR/associated-types-eq-hr.rs:101:5 + | +LL | tuple_two::<Tuple>(); + | ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` + | + = help: the following implementations were found: + <Tuple as TheTrait<(&'a isize, &'a isize)>> +note: required by `tuple_two` + --> $DIR/associated-types-eq-hr.rs:72:1 + | +LL | / fn tuple_two<T>() +LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize> +LL | | { +LL | | // not ok for tuple, two lifetimes and we pick second +LL | | } + | |_^ + +error[E0271]: type mismatch resolving `for<'x, 'y> <Tuple as TheTrait<(&'x isize, &'y isize)>>::A == &'y isize` + --> $DIR/associated-types-eq-hr.rs:101:5 + | +LL | tuple_two::<Tuple>(); + | ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime + | +note: required by `tuple_two` + --> $DIR/associated-types-eq-hr.rs:72:1 + | +LL | / fn tuple_two<T>() +LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize> +LL | | { +LL | | // not ok for tuple, two lifetimes and we pick second +LL | | } + | |_^ + +error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied + --> $DIR/associated-types-eq-hr.rs:107:5 + | +LL | tuple_four::<Tuple>(); + | ^^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` + | + = help: the following implementations were found: + <Tuple as TheTrait<(&'a isize, &'a isize)>> +note: required by `tuple_four` + --> $DIR/associated-types-eq-hr.rs:84:1 + | +LL | / fn tuple_four<T>() +LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize)> +LL | | { +LL | | // not ok for tuple, two lifetimes, and lifetime matching is invariant +LL | | } + | |_^ + +error: aborting due to 7 previous errors + +Some errors occurred: E0271, E0277. +For more information about an error, try `rustc --explain E0271`. diff --git a/src/test/compile-fail/associated-types-for-unimpl-trait.rs b/src/test/ui/compile-fail-migration/associated-types-for-unimpl-trait.rs index a6fcb9cff13..a6fcb9cff13 100644 --- a/src/test/compile-fail/associated-types-for-unimpl-trait.rs +++ b/src/test/ui/compile-fail-migration/associated-types-for-unimpl-trait.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-for-unimpl-trait.stderr b/src/test/ui/compile-fail-migration/associated-types-for-unimpl-trait.stderr new file mode 100644 index 00000000000..e6c15e465b6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-for-unimpl-trait.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Self: Get` is not satisfied + --> $DIR/associated-types-for-unimpl-trait.rs:17:5 + | +LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self` + | + = help: consider adding a `where Self: Get` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-types-incomplete-object.rs b/src/test/ui/compile-fail-migration/associated-types-incomplete-object.rs index c1feb8ac459..c1feb8ac459 100644 --- a/src/test/compile-fail/associated-types-incomplete-object.rs +++ b/src/test/ui/compile-fail-migration/associated-types-incomplete-object.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-incomplete-object.stderr b/src/test/ui/compile-fail-migration/associated-types-incomplete-object.stderr new file mode 100644 index 00000000000..95b1c631250 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-incomplete-object.stderr @@ -0,0 +1,27 @@ +error[E0191]: the value of the associated type `B` (from the trait `Foo`) must be specified + --> $DIR/associated-types-incomplete-object.rs:33:26 + | +LL | let b = &42isize as &Foo<A=usize>; + | ^^^^^^^^^^^^ missing associated type `B` value + +error[E0191]: the value of the associated type `A` (from the trait `Foo`) must be specified + --> $DIR/associated-types-incomplete-object.rs:36:26 + | +LL | let c = &42isize as &Foo<B=char>; + | ^^^^^^^^^^^ missing associated type `A` value + +error[E0191]: the value of the associated type `A` (from the trait `Foo`) must be specified + --> $DIR/associated-types-incomplete-object.rs:39:26 + | +LL | let d = &42isize as &Foo; + | ^^^ missing associated type `A` value + +error[E0191]: the value of the associated type `B` (from the trait `Foo`) must be specified + --> $DIR/associated-types-incomplete-object.rs:39:26 + | +LL | let d = &42isize as &Foo; + | ^^^ missing associated type `B` value + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0191`. diff --git a/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs b/src/test/ui/compile-fail-migration/associated-types-invalid-trait-ref-issue-18865.rs index 83726a1676d..83726a1676d 100644 --- a/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs +++ b/src/test/ui/compile-fail-migration/associated-types-invalid-trait-ref-issue-18865.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-invalid-trait-ref-issue-18865.stderr b/src/test/ui/compile-fail-migration/associated-types-invalid-trait-ref-issue-18865.stderr new file mode 100644 index 00000000000..40cba5e6834 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-invalid-trait-ref-issue-18865.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `T: Foo<usize>` is not satisfied + --> $DIR/associated-types-invalid-trait-ref-issue-18865.rs:20:12 + | +LL | let u: <T as Foo<usize>>::Bar = t.get_bar(); + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo<usize>` is not implemented for `T` + | + = help: consider adding a `where T: Foo<usize>` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-types-issue-17359.rs b/src/test/ui/compile-fail-migration/associated-types-issue-17359.rs index 82258f124d3..82258f124d3 100644 --- a/src/test/compile-fail/associated-types-issue-17359.rs +++ b/src/test/ui/compile-fail-migration/associated-types-issue-17359.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-issue-17359.stderr b/src/test/ui/compile-fail-migration/associated-types-issue-17359.stderr new file mode 100644 index 00000000000..8ba8194bded --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-issue-17359.stderr @@ -0,0 +1,12 @@ +error[E0046]: not all trait items implemented, missing: `Type` + --> $DIR/associated-types-issue-17359.rs:18:1 + | +LL | type Type; + | ---------- `Type` from trait +... +LL | impl Trait for isize {} //~ ERROR missing: `Type` + | ^^^^^^^^^^^^^^^^^^^^ missing `Type` in implementation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0046`. diff --git a/src/test/compile-fail/associated-types-issue-20346.rs b/src/test/ui/compile-fail-migration/associated-types-issue-20346.rs index a00aa8364bd..a00aa8364bd 100644 --- a/src/test/compile-fail/associated-types-issue-20346.rs +++ b/src/test/ui/compile-fail-migration/associated-types-issue-20346.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-issue-20346.stderr b/src/test/ui/compile-fail-migration/associated-types-issue-20346.stderr new file mode 100644 index 00000000000..6f3dfbe0898 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-issue-20346.stderr @@ -0,0 +1,17 @@ +error[E0271]: type mismatch resolving `<Adapter<I> as Iterator>::Item == std::option::Option<T>` + --> $DIR/associated-types-issue-20346.rs:44:5 + | +LL | is_iterator_of::<Option<T>, _>(&adapter); //~ ERROR type mismatch + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter, found enum `std::option::Option` + | + = note: expected type `T` + found type `std::option::Option<T>` +note: required by `is_iterator_of` + --> $DIR/associated-types-issue-20346.rs:25:1 + | +LL | fn is_iterator_of<A, I: Iterator<Item=A>>(_: &I) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/compile-fail/associated-types-multiple-types-one-trait.rs b/src/test/ui/compile-fail-migration/associated-types-multiple-types-one-trait.rs index 9436f825de8..9436f825de8 100644 --- a/src/test/compile-fail/associated-types-multiple-types-one-trait.rs +++ b/src/test/ui/compile-fail-migration/associated-types-multiple-types-one-trait.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-multiple-types-one-trait.stderr b/src/test/ui/compile-fail-migration/associated-types-multiple-types-one-trait.stderr new file mode 100644 index 00000000000..c38a5f6e7f4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-multiple-types-one-trait.stderr @@ -0,0 +1,31 @@ +error[E0271]: type mismatch resolving `<T as Foo>::Y == i32` + --> $DIR/associated-types-multiple-types-one-trait.rs:23:5 + | +LL | want_y(t); //~ ERROR type mismatch + | ^^^^^^ expected associated type, found i32 + | + = note: expected type `<T as Foo>::Y` + found type `i32` +note: required by `want_y` + --> $DIR/associated-types-multiple-types-one-trait.rs:54:1 + | +LL | fn want_y<T:Foo<Y=i32>>(t: &T) { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0271]: type mismatch resolving `<T as Foo>::X == u32` + --> $DIR/associated-types-multiple-types-one-trait.rs:28:5 + | +LL | want_x(t); //~ ERROR type mismatch + | ^^^^^^ expected associated type, found u32 + | + = note: expected type `<T as Foo>::X` + found type `u32` +note: required by `want_x` + --> $DIR/associated-types-multiple-types-one-trait.rs:52:1 + | +LL | fn want_x<T:Foo<X=u32>>(t: &T) { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/compile-fail/associated-types-no-suitable-bound.rs b/src/test/ui/compile-fail-migration/associated-types-no-suitable-bound.rs index baf56ffec86..baf56ffec86 100644 --- a/src/test/compile-fail/associated-types-no-suitable-bound.rs +++ b/src/test/ui/compile-fail-migration/associated-types-no-suitable-bound.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-no-suitable-bound.stderr b/src/test/ui/compile-fail-migration/associated-types-no-suitable-bound.stderr new file mode 100644 index 00000000000..84802d49caa --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-no-suitable-bound.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `T: Get` is not satisfied + --> $DIR/associated-types-no-suitable-bound.rs:21:5 + | +LL | fn uhoh<T>(foo: <T as Get>::Value) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `T` + | + = help: consider adding a `where T: Get` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs b/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait-2.rs index e0f0f3c47ae..e0f0f3c47ae 100644 --- a/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs +++ b/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait-2.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait-2.stderr b/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait-2.stderr new file mode 100644 index 00000000000..712b95f8e54 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait-2.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Self: Get` is not satisfied + --> $DIR/associated-types-no-suitable-supertrait-2.rs:27:5 + | +LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self` + | + = help: consider adding a `where Self: Get` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-types-no-suitable-supertrait.rs b/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait.rs index ec38595e8fe..ec38595e8fe 100644 --- a/src/test/compile-fail/associated-types-no-suitable-supertrait.rs +++ b/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait.stderr b/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait.stderr new file mode 100644 index 00000000000..6927146ffbc --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-no-suitable-supertrait.stderr @@ -0,0 +1,17 @@ +error[E0277]: the trait bound `Self: Get` is not satisfied + --> $DIR/associated-types-no-suitable-supertrait.rs:27:5 + | +LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self` + | + = help: consider adding a `where Self: Get` bound + +error[E0277]: the trait bound `(T, U): Get` is not satisfied + --> $DIR/associated-types-no-suitable-supertrait.rs:32:5 + | +LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/associated-types-outlives.nll.stderr b/src/test/ui/compile-fail-migration/associated-types-outlives.nll.stderr new file mode 100644 index 00000000000..384ed8f3284 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-outlives.nll.stderr @@ -0,0 +1,13 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/associated-types-outlives.rs:32:14 + | +LL | 's: loop { y = denormalise(&x); break } + | -- borrow of `x` occurs here +LL | drop(x); //~ ERROR cannot move out of `x` because it is borrowed + | ^ move out of `x` occurs here +LL | return f(y); + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/associated-types-outlives.rs b/src/test/ui/compile-fail-migration/associated-types-outlives.rs index f070ab6799c..f070ab6799c 100644 --- a/src/test/compile-fail/associated-types-outlives.rs +++ b/src/test/ui/compile-fail-migration/associated-types-outlives.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-outlives.stderr b/src/test/ui/compile-fail-migration/associated-types-outlives.stderr new file mode 100644 index 00000000000..6d46392d94b --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-outlives.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/associated-types-outlives.rs:32:14 + | +LL | 's: loop { y = denormalise(&x); break } + | - borrow of `x` occurs here +LL | drop(x); //~ ERROR cannot move out of `x` because it is borrowed + | ^ move out of `x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/associated-types-overridden-default.rs b/src/test/ui/compile-fail-migration/associated-types-overridden-default.rs index 946a4b2f73a..946a4b2f73a 100644 --- a/src/test/compile-fail/associated-types-overridden-default.rs +++ b/src/test/ui/compile-fail-migration/associated-types-overridden-default.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-overridden-default.stderr b/src/test/ui/compile-fail-migration/associated-types-overridden-default.stderr new file mode 100644 index 00000000000..e9a480be067 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-overridden-default.stderr @@ -0,0 +1,9 @@ +error[E0399]: the following trait items need to be reimplemented as `Assoc` was overridden: `Assoc2`, `C`, `foo` + --> $DIR/associated-types-overridden-default.rs:21:5 + | +LL | type Assoc = (); + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0399`. diff --git a/src/test/compile-fail/associated-types-path-1.rs b/src/test/ui/compile-fail-migration/associated-types-path-1.rs index ab061ca4d8d..ab061ca4d8d 100644 --- a/src/test/compile-fail/associated-types-path-1.rs +++ b/src/test/ui/compile-fail-migration/associated-types-path-1.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-path-1.stderr b/src/test/ui/compile-fail-migration/associated-types-path-1.stderr new file mode 100644 index 00000000000..04147922d9c --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-path-1.stderr @@ -0,0 +1,22 @@ +error[E0220]: associated type `A` not found for `T` + --> $DIR/associated-types-path-1.rs:20:23 + | +LL | pub fn f1<T>(a: T, x: T::A) {} //~ERROR associated type `A` not found + | ^^^^ associated type `A` not found + +error[E0221]: ambiguous associated type `A` in bounds of `T` + --> $DIR/associated-types-path-1.rs:21:34 + | +LL | type A; + | ------- ambiguous `A` from `Foo` +... +LL | type A; + | ------- ambiguous `A` from `Bar` +... +LL | pub fn f2<T: Foo + Bar>(a: T, x: T::A) {} //~ERROR ambiguous associated type `A` + | ^^^^ ambiguous associated type `A` + +error: aborting due to 2 previous errors + +Some errors occurred: E0220, E0221. +For more information about an error, try `rustc --explain E0220`. diff --git a/src/test/compile-fail/associated-types-path-2.rs b/src/test/ui/compile-fail-migration/associated-types-path-2.rs index d62f6b0f1a3..d62f6b0f1a3 100644 --- a/src/test/compile-fail/associated-types-path-2.rs +++ b/src/test/ui/compile-fail-migration/associated-types-path-2.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-path-2.stderr b/src/test/ui/compile-fail-migration/associated-types-path-2.stderr new file mode 100644 index 00000000000..403b4fd4d8e --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-path-2.stderr @@ -0,0 +1,52 @@ +error[E0308]: mismatched types + --> $DIR/associated-types-path-2.rs:29:14 + | +LL | f1(2i32, 4i32); + | ^^^^ expected u32, found i32 + +error[E0277]: the trait bound `u32: Foo` is not satisfied + --> $DIR/associated-types-path-2.rs:39:5 + | +LL | f1(2u32, 4u32); + | ^^ the trait `Foo` is not implemented for `u32` + | +note: required by `f1` + --> $DIR/associated-types-path-2.rs:23:1 + | +LL | pub fn f1<T: Foo>(a: T, x: T::A) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `u32: Foo` is not satisfied + --> $DIR/associated-types-path-2.rs:39:5 + | +LL | f1(2u32, 4u32); + | ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32` + +error[E0277]: the trait bound `u32: Foo` is not satisfied + --> $DIR/associated-types-path-2.rs:45:5 + | +LL | f1(2u32, 4i32); + | ^^ the trait `Foo` is not implemented for `u32` + | +note: required by `f1` + --> $DIR/associated-types-path-2.rs:23:1 + | +LL | pub fn f1<T: Foo>(a: T, x: T::A) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `u32: Foo` is not satisfied + --> $DIR/associated-types-path-2.rs:45:5 + | +LL | f1(2u32, 4i32); + | ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32` + +error[E0308]: mismatched types + --> $DIR/associated-types-path-2.rs:51:18 + | +LL | let _: i32 = f2(2i32); + | ^^^^^^^^ expected i32, found u32 + +error: aborting due to 6 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn-body.nll.stderr b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn-body.nll.stderr new file mode 100644 index 00000000000..5b8223ff292 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn-body.nll.stderr @@ -0,0 +1,30 @@ +warning: not reporting region error due to nll + --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:32:12 + | +LL | let z: I::A = if cond { x } else { y }; + | ^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:32:29 + | +LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>( + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +... +LL | let z: I::A = if cond { x } else { y }; + | ^ assignment requires that `'a` must outlive `'b` + +error: unsatisfied lifetime constraints + --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:32:40 + | +LL | fn bar<'a, 'b, I : for<'x> Foo<&'x isize>>( + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +... +LL | let z: I::A = if cond { x } else { y }; + | ^ assignment requires that `'b` must outlive `'a` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/associated-types-project-from-hrtb-in-fn-body.rs b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn-body.rs index 5451a20d816..5451a20d816 100644 --- a/src/test/compile-fail/associated-types-project-from-hrtb-in-fn-body.rs +++ b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn-body.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn-body.stderr b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn-body.stderr new file mode 100644 index 00000000000..12bbfb24910 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn-body.stderr @@ -0,0 +1,14 @@ +error[E0623]: lifetime mismatch + --> $DIR/associated-types-project-from-hrtb-in-fn-body.rs:32:40 + | +LL | x: <I as Foo<&'a isize>>::A, + | --------- these two types are declared with different lifetimes... +LL | y: <I as Foo<&'b isize>>::A, + | --------- +... +LL | let z: I::A = if cond { x } else { y }; + | ^ ...but data from `x` flows into `y` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/associated-types-project-from-hrtb-in-fn.rs b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn.rs index a79d5c4649a..a79d5c4649a 100644 --- a/src/test/compile-fail/associated-types-project-from-hrtb-in-fn.rs +++ b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn.stderr b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn.stderr new file mode 100644 index 00000000000..399f4d9409a --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-fn.stderr @@ -0,0 +1,9 @@ +error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context + --> $DIR/associated-types-project-from-hrtb-in-fn.rs:21:8 + | +LL | x: I::A) + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0212`. diff --git a/src/test/compile-fail/associated-types-project-from-hrtb-in-struct.rs b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-struct.rs index e6251a0d318..e6251a0d318 100644 --- a/src/test/compile-fail/associated-types-project-from-hrtb-in-struct.rs +++ b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-struct.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-struct.stderr b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-struct.stderr new file mode 100644 index 00000000000..05c0c38c79f --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-struct.stderr @@ -0,0 +1,9 @@ +error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context + --> $DIR/associated-types-project-from-hrtb-in-struct.rs:21:12 + | +LL | field: I::A + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0212`. diff --git a/src/test/compile-fail/associated-types-project-from-hrtb-in-trait-method.rs b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-trait-method.rs index af46a1b42d0..af46a1b42d0 100644 --- a/src/test/compile-fail/associated-types-project-from-hrtb-in-trait-method.rs +++ b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-trait-method.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-trait-method.stderr b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-trait-method.stderr new file mode 100644 index 00000000000..ccd568b6253 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-project-from-hrtb-in-trait-method.stderr @@ -0,0 +1,9 @@ +error[E0212]: cannot extract an associated type from a higher-ranked trait bound in this context + --> $DIR/associated-types-project-from-hrtb-in-trait-method.rs:21:32 + | +LL | fn some_method(&self, arg: I::A); + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0212`. diff --git a/src/test/compile-fail/associated-types-projection-to-unrelated-trait-in-method-without-default.rs b/src/test/ui/compile-fail-migration/associated-types-projection-to-unrelated-trait-in-method-without-default.rs index 3f72391ff90..3f72391ff90 100644 --- a/src/test/compile-fail/associated-types-projection-to-unrelated-trait-in-method-without-default.rs +++ b/src/test/ui/compile-fail-migration/associated-types-projection-to-unrelated-trait-in-method-without-default.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr b/src/test/ui/compile-fail-migration/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr new file mode 100644 index 00000000000..e7e68dcf852 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Self: Get` is not satisfied + --> $DIR/associated-types-projection-to-unrelated-trait-in-method-without-default.rs:19:5 + | +LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `Self` + | + = help: consider adding a `where Self: Get` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/associated-types-subtyping-1.rs b/src/test/ui/compile-fail-migration/associated-types-subtyping-1.rs index 64dcdd39e7c..64dcdd39e7c 100644 --- a/src/test/compile-fail/associated-types-subtyping-1.rs +++ b/src/test/ui/compile-fail-migration/associated-types-subtyping-1.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-subtyping-1.stderr b/src/test/ui/compile-fail-migration/associated-types-subtyping-1.stderr new file mode 100644 index 00000000000..d9e8d66e6a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-subtyping-1.stderr @@ -0,0 +1,21 @@ +error[E0623]: lifetime mismatch + --> $DIR/associated-types-subtyping-1.rs:34:37 + | +LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T) + | ----- ----- these two types are declared with different lifetimes... +... +LL | let _: <T as Trait<'b>>::Type = a; //~ ERROR E0623 + | ^ ...but data from `y` flows into `x` here + +error[E0623]: lifetime mismatch + --> $DIR/associated-types-subtyping-1.rs:43:37 + | +LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T) + | ----- ----- these two types are declared with different lifetimes... +... +LL | let _: <T as Trait<'a>>::Type = b; //~ ERROR E0623 + | ^ ...but data from `y` flows into `x` here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/associated-types-unconstrained.rs b/src/test/ui/compile-fail-migration/associated-types-unconstrained.rs index aecbf217a5b..aecbf217a5b 100644 --- a/src/test/compile-fail/associated-types-unconstrained.rs +++ b/src/test/ui/compile-fail-migration/associated-types-unconstrained.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-unconstrained.stderr b/src/test/ui/compile-fail-migration/associated-types-unconstrained.stderr new file mode 100644 index 00000000000..abb220c96c6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-unconstrained.stderr @@ -0,0 +1,9 @@ +error[E0284]: type annotations required: cannot resolve `<_ as Foo>::A == _` + --> $DIR/associated-types-unconstrained.rs:24:20 + | +LL | let x: isize = Foo::bar(); + | ^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0284`. diff --git a/src/test/compile-fail/associated-types-unsized.rs b/src/test/ui/compile-fail-migration/associated-types-unsized.rs index c561ae861ed..c561ae861ed 100644 --- a/src/test/compile-fail/associated-types-unsized.rs +++ b/src/test/ui/compile-fail-migration/associated-types-unsized.rs diff --git a/src/test/ui/compile-fail-migration/associated-types-unsized.stderr b/src/test/ui/compile-fail-migration/associated-types-unsized.stderr new file mode 100644 index 00000000000..4b9d1ea8fac --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types-unsized.stderr @@ -0,0 +1,14 @@ +error[E0277]: the size for values of type `<T as Get>::Value` cannot be known at compilation time + --> $DIR/associated-types-unsized.rs:17:9 + | +LL | let x = t.get(); //~ ERROR the size for values of type + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `<T as Get>::Value` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where <T as Get>::Value: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.clause.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.clause.stderr new file mode 100644 index 00000000000..23a67b5b064 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.clause.stderr @@ -0,0 +1,15 @@ +error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-constrained.rs:48:63 + | +LL | fn clause1<T>() where T: for<'a> Fn(<() as Foo<'a>>::Item) -> &'a i32 { + | ^^^^^^^ + +error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-constrained.rs:53:42 + | +LL | fn clause2<T>() where T: for<'a> Fn() -> <() as Foo<'a>>::Item { + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0582`. diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.func.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.func.stderr new file mode 100644 index 00000000000..c969baeaefe --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.func.stderr @@ -0,0 +1,15 @@ +error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types + --> $DIR/bound-lifetime-constrained.rs:26:50 + | +LL | fn func1(_: for<'a> fn(<() as Foo<'a>>::Item) -> &'a i32) { + | ^^^^^^^ + +error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types + --> $DIR/bound-lifetime-constrained.rs:33:29 + | +LL | fn func2(_: for<'a> fn() -> <() as Foo<'a>>::Item) { + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0581`. diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.object.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.object.stderr new file mode 100644 index 00000000000..f24fed0f02e --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.object.stderr @@ -0,0 +1,15 @@ +error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-constrained.rs:38:56 + | +LL | fn object1(_: Box<for<'a> Fn(<() as Foo<'a>>::Item) -> &'a i32>) { + | ^^^^^^^ + +error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-constrained.rs:43:35 + | +LL | fn object2(_: Box<for<'a> Fn() -> <() as Foo<'a>>::Item>) { + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0582`. diff --git a/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.rs index 9ba5045f2a0..9ba5045f2a0 100644 --- a/src/test/compile-fail/associated-types/bound-lifetime-constrained.rs +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-constrained.rs diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.angle.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.angle.stderr new file mode 100644 index 00000000000..5df8a828012 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.angle.stderr @@ -0,0 +1,27 @@ +error[E0582]: binding for associated type `Item` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-in-binding-only.rs:22:25 + | +LL | fn angle<T: for<'a> Foo<Item=&'a i32>>() { + | ^^^^^^^^^^^^ + +error[E0582]: binding for associated type `Item` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-in-binding-only.rs:27:37 + | +LL | fn angle1<T>() where T: for<'a> Foo<Item=&'a i32> { + | ^^^^^^^^^^^^ + +error[E0582]: binding for associated type `Item` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-in-binding-only.rs:32:37 + | +LL | fn angle2<T>() where for<'a> T: Foo<Item=&'a i32> { + | ^^^^^^^^^^^^ + +error[E0582]: binding for associated type `Item` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-in-binding-only.rs:37:27 + | +LL | fn angle3(_: &for<'a> Foo<Item=&'a i32>) { + | ^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0582`. diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.elision.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.elision.stderr new file mode 100644 index 00000000000..0a12aa76a78 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.elision.stderr @@ -0,0 +1,12 @@ +error[E0106]: missing lifetime specifier + --> $DIR/bound-lifetime-in-binding-only.rs:62:23 + | +LL | fn elision<T: Fn() -> &i32>() { + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from + = help: consider giving it a 'static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.ok.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.ok.stderr new file mode 100644 index 00000000000..53594cb83fc --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.ok.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/bound-lifetime-in-binding-only.rs:81:1 + | +LL | fn main() { } //[ok]~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.paren.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.paren.stderr new file mode 100644 index 00000000000..39a5366080b --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.paren.stderr @@ -0,0 +1,27 @@ +error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-in-binding-only.rs:42:29 + | +LL | fn paren<T: for<'a> Fn() -> &'a i32>() { + | ^^^^^^^ + +error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-in-binding-only.rs:47:41 + | +LL | fn paren1<T>() where T: for<'a> Fn() -> &'a i32 { + | ^^^^^^^ + +error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-in-binding-only.rs:52:41 + | +LL | fn paren2<T>() where for<'a> T: Fn() -> &'a i32 { + | ^^^^^^^ + +error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types + --> $DIR/bound-lifetime-in-binding-only.rs:57:31 + | +LL | fn paren3(_: &for<'a> Fn() -> &'a i32) { + | ^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0582`. diff --git a/src/test/compile-fail/associated-types/bound-lifetime-in-binding-only.rs b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.rs index 7cb0623315e..7cb0623315e 100644 --- a/src/test/compile-fail/associated-types/bound-lifetime-in-binding-only.rs +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-binding-only.rs diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.elision.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.elision.stderr new file mode 100644 index 00000000000..8fefdfd4d19 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.elision.stderr @@ -0,0 +1,12 @@ +error[E0106]: missing lifetime specifier + --> $DIR/bound-lifetime-in-return-only.rs:44:23 + | +LL | fn elision(_: fn() -> &i32) { + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from + = help: consider giving it a 'static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.local.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.local.stderr new file mode 100644 index 00000000000..ce2cfa6765d --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.local.stderr @@ -0,0 +1,9 @@ +error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types + --> $DIR/bound-lifetime-in-return-only.rs:33:28 + | +LL | let _: for<'a> fn() -> &'a i32 = loop { }; + | ^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0581`. diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.ok.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.ok.stderr new file mode 100644 index 00000000000..21bef7e5e52 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.ok.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/bound-lifetime-in-return-only.rs:59:1 + | +LL | fn main() { } //[ok]~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-types/bound-lifetime-in-return-only.rs b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.rs index b9b1317cef5..b9b1317cef5 100644 --- a/src/test/compile-fail/associated-types/bound-lifetime-in-return-only.rs +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.rs diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.sig.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.sig.stderr new file mode 100644 index 00000000000..26a1585463a --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.sig.stderr @@ -0,0 +1,15 @@ +error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types + --> $DIR/bound-lifetime-in-return-only.rs:22:28 + | +LL | fn sig1(_: for<'a> fn() -> &'a i32) { + | ^^^^^^^ + +error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types + --> $DIR/bound-lifetime-in-return-only.rs:27:39 + | +LL | fn sig2(_: for<'a, 'b> fn(&'b i32) -> &'a i32) { + | ^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0581`. diff --git a/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.structure.stderr b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.structure.stderr new file mode 100644 index 00000000000..db52e4de69b --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/bound-lifetime-in-return-only.structure.stderr @@ -0,0 +1,9 @@ +error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types + --> $DIR/bound-lifetime-in-return-only.rs:39:24 + | +LL | x: for<'a> fn() -> &'a i32 + | ^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0581`. diff --git a/src/test/compile-fail/associated-types/cache/chrono-scan.rs b/src/test/ui/compile-fail-migration/associated-types/cache/chrono-scan.rs index a753527ea53..a753527ea53 100644 --- a/src/test/compile-fail/associated-types/cache/chrono-scan.rs +++ b/src/test/ui/compile-fail-migration/associated-types/cache/chrono-scan.rs diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/chrono-scan.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/chrono-scan.stderr new file mode 100644 index 00000000000..99281e74565 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/chrono-scan.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/chrono-scan.rs:39:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-types/cache/elision.rs b/src/test/ui/compile-fail-migration/associated-types/cache/elision.rs index d1117328c86..d1117328c86 100644 --- a/src/test/compile-fail/associated-types/cache/elision.rs +++ b/src/test/ui/compile-fail-migration/associated-types/cache/elision.rs diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/elision.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/elision.stderr new file mode 100644 index 00000000000..c5314b58002 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/elision.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/elision.rs:34:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr new file mode 100644 index 00000000000..89a7bb00f74 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr @@ -0,0 +1,35 @@ +warning: not reporting region error due to nll + --> $DIR/project-fn-ret-contravariant.rs:53:16 + | +LL | let a = bar(foo, y); + | ^^^ + +warning: not reporting region error due to nll + --> $DIR/project-fn-ret-contravariant.rs:54:16 + | +LL | let b = bar(foo, x); + | ^^^ + +error: unsatisfied lifetime constraints + --> $DIR/project-fn-ret-contravariant.rs:53:12 + | +LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | let a = bar(foo, y); + | ^^^^^^^^^^^ argument requires that `'b` must outlive `'a` + +error: unsatisfied lifetime constraints + --> $DIR/project-fn-ret-contravariant.rs:54:12 + | +LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | let a = bar(foo, y); +LL | let b = bar(foo, x); + | ^^^^^^^^^^^ argument requires that `'a` must outlive `'b` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr new file mode 100644 index 00000000000..6cecf68ffff --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr @@ -0,0 +1,25 @@ +error[E0623]: lifetime mismatch + --> $DIR/project-fn-ret-contravariant.rs:55:5 + | +LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { + | ------- ------------------ + | | + | this parameter and the return type are declared with different lifetimes... +... +LL | (a, b) //[krisskross]~ ERROR 55:5: 55:6: lifetime mismatch [E0623] + | ^ ...but data from `y` is returned here + +error[E0623]: lifetime mismatch + --> $DIR/project-fn-ret-contravariant.rs:55:8 + | +LL | fn transmute<'a,'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { + | ------- ------------------ + | | + | this parameter and the return type are declared with different lifetimes... +... +LL | (a, b) //[krisskross]~ ERROR 55:5: 55:6: lifetime mismatch [E0623] + | ^ ...but data from `x` is returned here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.ok.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.ok.stderr new file mode 100644 index 00000000000..c92aa37a60f --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.ok.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/project-fn-ret-contravariant.rs:60:1 + | +LL | fn main() { } + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.oneuse.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.oneuse.stderr new file mode 100644 index 00000000000..c92aa37a60f --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.oneuse.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/project-fn-ret-contravariant.rs:60:1 + | +LL | fn main() { } + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-types/cache/project-fn-ret-contravariant.rs b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.rs index a5e8f4068e6..a5e8f4068e6 100644 --- a/src/test/compile-fail/associated-types/cache/project-fn-ret-contravariant.rs +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.rs diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr new file mode 100644 index 00000000000..793209b7cbc --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr @@ -0,0 +1,16 @@ +warning: not reporting region error due to nll + --> $DIR/project-fn-ret-contravariant.rs:48:8 + | +LL | bar(foo, x) //[transmute]~ ERROR E0495 + | ^^^ + +error: borrowed data escapes outside of function + --> $DIR/project-fn-ret-contravariant.rs:48:4 + | +LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 { + | - `x` is a reference that is only valid in the function body +LL | bar(foo, x) //[transmute]~ ERROR E0495 + | ^^^^^^^^^^^ `x` escapes the function body here + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.transmute.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.transmute.stderr new file mode 100644 index 00000000000..9d42c8e3c63 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-contravariant.transmute.stderr @@ -0,0 +1,26 @@ +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/project-fn-ret-contravariant.rs:48:8 + | +LL | bar(foo, x) //[transmute]~ ERROR E0495 + | ^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 47:8... + --> $DIR/project-fn-ret-contravariant.rs:47:8 + | +LL | fn baz<'a,'b>(x: &'a u32) -> &'static u32 { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/project-fn-ret-contravariant.rs:48:13 + | +LL | bar(foo, x) //[transmute]~ ERROR E0495 + | ^ + = note: but, the lifetime must be valid for the static lifetime... +note: ...so that reference does not outlive borrowed content + --> $DIR/project-fn-ret-contravariant.rs:48:4 + | +LL | bar(foo, x) //[transmute]~ ERROR E0495 + | ^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr new file mode 100644 index 00000000000..dedce312156 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr @@ -0,0 +1,35 @@ +warning: not reporting region error due to nll + --> $DIR/project-fn-ret-invariant.rs:63:16 + | +LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623 + | ^^^ + +warning: not reporting region error due to nll + --> $DIR/project-fn-ret-invariant.rs:64:16 + | +LL | let b = bar(foo, x); + | ^^^ + +error: unsatisfied lifetime constraints + --> $DIR/project-fn-ret-invariant.rs:63:12 + | +LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623 + | ^^^^^^^^^^^ argument requires that `'b` must outlive `'a` + +error: unsatisfied lifetime constraints + --> $DIR/project-fn-ret-invariant.rs:64:12 + | +LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623 +LL | let b = bar(foo, x); + | ^^^^^^^^^^^ argument requires that `'a` must outlive `'b` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.krisskross.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.krisskross.stderr new file mode 100644 index 00000000000..e867ac4baac --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.krisskross.stderr @@ -0,0 +1,24 @@ +error[E0623]: lifetime mismatch + --> $DIR/project-fn-ret-invariant.rs:63:21 + | +LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { + | -------- -------------------- + | | + | this parameter and the return type are declared with different lifetimes... +LL | let a = bar(foo, y); //[krisskross]~ ERROR E0623 + | ^ ...but data from `x` is returned here + +error[E0623]: lifetime mismatch + --> $DIR/project-fn-ret-invariant.rs:65:8 + | +LL | fn transmute<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { + | -------- -------------------- + | | + | this parameter and the return type are declared with different lifetimes... +... +LL | (a, b) //[krisskross]~ ERROR E0623 + | ^ ...but data from `x` is returned here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.ok.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.ok.stderr new file mode 100644 index 00000000000..e3e620ea3a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.ok.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/project-fn-ret-invariant.rs:69:1 + | +LL | fn main() { } + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr new file mode 100644 index 00000000000..a669c7ac73b --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr @@ -0,0 +1,30 @@ +warning: not reporting region error due to nll + --> $DIR/project-fn-ret-invariant.rs:47:12 + | +LL | let f = foo; // <-- No consistent type can be inferred for `f` here. + | ^^^ + +error: unsatisfied lifetime constraints + --> $DIR/project-fn-ret-invariant.rs:48:12 + | +LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | let f = foo; // <-- No consistent type can be inferred for `f` here. +LL | let a = bar(f, x); + | ^^^^^^^^^ argument requires that `'a` must outlive `'b` + +error: unsatisfied lifetime constraints + --> $DIR/project-fn-ret-invariant.rs:49:12 + | +LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +... +LL | let b = bar(f, y); //[oneuse]~ ERROR 49:19: 49:20: lifetime mismatch [E0623] + | ^^^^^^^^^ argument requires that `'b` must outlive `'a` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.oneuse.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.oneuse.stderr new file mode 100644 index 00000000000..7c86e20fe64 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.oneuse.stderr @@ -0,0 +1,14 @@ +error[E0623]: lifetime mismatch + --> $DIR/project-fn-ret-invariant.rs:49:19 + | +LL | fn baz<'a,'b>(x: Type<'a>, y: Type<'b>) -> (Type<'a>, Type<'b>) { + | -------- -------------------- + | | + | this parameter and the return type are declared with different lifetimes... +... +LL | let b = bar(f, y); //[oneuse]~ ERROR 49:19: 49:20: lifetime mismatch [E0623] + | ^ ...but data from `x` is returned here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/associated-types/cache/project-fn-ret-invariant.rs b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.rs index 6e4bdd4b21c..6e4bdd4b21c 100644 --- a/src/test/compile-fail/associated-types/cache/project-fn-ret-invariant.rs +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.rs diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr new file mode 100644 index 00000000000..ed3f2a07aa2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr @@ -0,0 +1,17 @@ +warning: not reporting region error due to nll + --> $DIR/project-fn-ret-invariant.rs:58:8 + | +LL | bar(foo, x) //[transmute]~ ERROR E0495 + | ^^^ + +error: borrowed data escapes outside of function + --> $DIR/project-fn-ret-invariant.rs:58:4 + | +LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> { + | - `x` is a reference that is only valid in the function body +... +LL | bar(foo, x) //[transmute]~ ERROR E0495 + | ^^^^^^^^^^^ `x` escapes the function body here + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.transmute.stderr b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.transmute.stderr new file mode 100644 index 00000000000..6432ab9e57d --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/cache/project-fn-ret-invariant.transmute.stderr @@ -0,0 +1,22 @@ +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/project-fn-ret-invariant.rs:58:8 + | +LL | bar(foo, x) //[transmute]~ ERROR E0495 + | ^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 54:8... + --> $DIR/project-fn-ret-invariant.rs:54:8 + | +LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> { + | ^^ + = note: ...so that the expression is assignable: + expected Type<'_> + found Type<'a> + = note: but, the lifetime must be valid for the static lifetime... + = note: ...so that the expression is assignable: + expected Type<'static> + found Type<'_> + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/associated-types/higher-ranked-projection.bad.stderr b/src/test/ui/compile-fail-migration/associated-types/higher-ranked-projection.bad.stderr new file mode 100644 index 00000000000..1351d14fe00 --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/higher-ranked-projection.bad.stderr @@ -0,0 +1,17 @@ +error[E0271]: type mismatch resolving `for<'a> <&'a _ as Mirror>::Image == _` + --> $DIR/higher-ranked-projection.rs:35:5 + | +LL | foo(()); + | ^^^ expected bound lifetime parameter 'a, found concrete lifetime + | +note: required by `foo` + --> $DIR/higher-ranked-projection.rs:24:1 + | +LL | / fn foo<U, T>(_t: T) +LL | | where for<'a> &'a T: Mirror<Image=U> +LL | | {} + | |__^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/compile-fail-migration/associated-types/higher-ranked-projection.good.stderr b/src/test/ui/compile-fail-migration/associated-types/higher-ranked-projection.good.stderr new file mode 100644 index 00000000000..861827f329b --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/higher-ranked-projection.good.stderr @@ -0,0 +1,12 @@ +error: compilation successful + --> $DIR/higher-ranked-projection.rs:34:1 + | +LL | / fn main() { //[good]~ ERROR compilation successful +LL | | foo(()); +LL | | //[bad]~^ ERROR type mismatch resolving `for<'a> <&'a _ as Mirror>::Image == _` +LL | | //[bad]~| expected bound lifetime parameter 'a, found concrete lifetime +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/associated-types/higher-ranked-projection.rs b/src/test/ui/compile-fail-migration/associated-types/higher-ranked-projection.rs index 12341fa8db3..12341fa8db3 100644 --- a/src/test/compile-fail/associated-types/higher-ranked-projection.rs +++ b/src/test/ui/compile-fail-migration/associated-types/higher-ranked-projection.rs diff --git a/src/test/compile-fail/associated-types/issue-36499.rs b/src/test/ui/compile-fail-migration/associated-types/issue-36499.rs index b5b3ecbb580..b5b3ecbb580 100644 --- a/src/test/compile-fail/associated-types/issue-36499.rs +++ b/src/test/ui/compile-fail-migration/associated-types/issue-36499.rs diff --git a/src/test/ui/compile-fail-migration/associated-types/issue-36499.stderr b/src/test/ui/compile-fail-migration/associated-types/issue-36499.stderr new file mode 100644 index 00000000000..5167c47a6cf --- /dev/null +++ b/src/test/ui/compile-fail-migration/associated-types/issue-36499.stderr @@ -0,0 +1,8 @@ +error: expected expression, found `+` + --> $DIR/issue-36499.rs:14:9 + | +LL | 2 + +2; + | ^ expected expression + +error: aborting due to previous error + diff --git a/src/test/compile-fail/attempted-access-non-fatal.rs b/src/test/ui/compile-fail-migration/attempted-access-non-fatal.rs index 3d6c46f5ce3..3d6c46f5ce3 100644 --- a/src/test/compile-fail/attempted-access-non-fatal.rs +++ b/src/test/ui/compile-fail-migration/attempted-access-non-fatal.rs diff --git a/src/test/ui/compile-fail-migration/attempted-access-non-fatal.stderr b/src/test/ui/compile-fail-migration/attempted-access-non-fatal.stderr new file mode 100644 index 00000000000..d056a3eff6f --- /dev/null +++ b/src/test/ui/compile-fail-migration/attempted-access-non-fatal.stderr @@ -0,0 +1,15 @@ +error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields + --> $DIR/attempted-access-non-fatal.rs:14:15 + | +LL | let _ = x.foo; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610] + | ^^^ + +error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields + --> $DIR/attempted-access-non-fatal.rs:15:15 + | +LL | let _ = x.bar; //~ `{integer}` is a primitive type and therefore doesn't have fields [E0610] + | ^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0610`. diff --git a/src/test/compile-fail/attr-bad-crate-attr.rc b/src/test/ui/compile-fail-migration/attr-bad-crate-attr.rc index 4ab07f4fa99..4ab07f4fa99 100644 --- a/src/test/compile-fail/attr-bad-crate-attr.rc +++ b/src/test/ui/compile-fail-migration/attr-bad-crate-attr.rc diff --git a/src/test/compile-fail/attr-usage-inline.rs b/src/test/ui/compile-fail-migration/attr-usage-inline.rs index 250905dbdcd..250905dbdcd 100644 --- a/src/test/compile-fail/attr-usage-inline.rs +++ b/src/test/ui/compile-fail-migration/attr-usage-inline.rs diff --git a/src/test/ui/compile-fail-migration/attr-usage-inline.stderr b/src/test/ui/compile-fail-migration/attr-usage-inline.stderr new file mode 100644 index 00000000000..171bd949e10 --- /dev/null +++ b/src/test/ui/compile-fail-migration/attr-usage-inline.stderr @@ -0,0 +1,11 @@ +error[E0518]: attribute should be applied to function or closure + --> $DIR/attr-usage-inline.rs:16:1 + | +LL | #[inline] //~ ERROR: attribute should be applied to function or closure + | ^^^^^^^^^ +LL | struct S; + | --------- not a function or closure + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0518`. diff --git a/src/test/compile-fail/attrs-with-no-formal-in-generics-1.rs b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-1.rs index ec7885f1f44..ec7885f1f44 100644 --- a/src/test/compile-fail/attrs-with-no-formal-in-generics-1.rs +++ b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-1.rs diff --git a/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-1.stderr b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-1.stderr new file mode 100644 index 00000000000..afab999b02e --- /dev/null +++ b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-1.stderr @@ -0,0 +1,8 @@ +error: trailing attribute after lifetime parameters + --> $DIR/attrs-with-no-formal-in-generics-1.rs:19:25 + | +LL | impl<#[rustc_1] 'a, 'b, #[oops]> RefIntPair<'a, 'b> { + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/attrs-with-no-formal-in-generics-2.rs b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-2.rs index efe2d5561a8..efe2d5561a8 100644 --- a/src/test/compile-fail/attrs-with-no-formal-in-generics-2.rs +++ b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-2.rs diff --git a/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-2.stderr b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-2.stderr new file mode 100644 index 00000000000..8bff45ea989 --- /dev/null +++ b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-2.stderr @@ -0,0 +1,8 @@ +error: trailing attribute after type parameters + --> $DIR/attrs-with-no-formal-in-generics-2.rs:19:35 + | +LL | impl<#[rustc_1] 'a, #[rustc_2] T, #[oops]> RefAny<'a, T> {} + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/attrs-with-no-formal-in-generics-3.rs b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-3.rs index e7d5b94d242..e7d5b94d242 100644 --- a/src/test/compile-fail/attrs-with-no-formal-in-generics-3.rs +++ b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-3.rs diff --git a/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-3.stderr b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-3.stderr new file mode 100644 index 00000000000..351c788f84f --- /dev/null +++ b/src/test/ui/compile-fail-migration/attrs-with-no-formal-in-generics-3.stderr @@ -0,0 +1,8 @@ +error: trailing attribute after lifetime parameters + --> $DIR/attrs-with-no-formal-in-generics-3.rs:18:38 + | +LL | where Q: for <#[rustc_1] 'a, 'b, #[oops]> Fn(RefIntPair<'a,'b>) -> &'b u32 + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/auto-ref-slice-plus-ref.rs b/src/test/ui/compile-fail-migration/auto-ref-slice-plus-ref.rs index 324e9259647..324e9259647 100644 --- a/src/test/compile-fail/auto-ref-slice-plus-ref.rs +++ b/src/test/ui/compile-fail-migration/auto-ref-slice-plus-ref.rs diff --git a/src/test/ui/compile-fail-migration/auto-ref-slice-plus-ref.stderr b/src/test/ui/compile-fail-migration/auto-ref-slice-plus-ref.stderr new file mode 100644 index 00000000000..f62ac84a185 --- /dev/null +++ b/src/test/ui/compile-fail-migration/auto-ref-slice-plus-ref.stderr @@ -0,0 +1,44 @@ +error[E0599]: no method named `test_mut` found for type `std::vec::Vec<{integer}>` in the current scope + --> $DIR/auto-ref-slice-plus-ref.rs:18:7 + | +LL | a.test_mut(); //~ ERROR no method named `test_mut` found + | ^^^^^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `test_mut`, perhaps you need to implement it: + candidate #1: `MyIter` + = help: did you mean `get_mut`? + +error[E0599]: no method named `test` found for type `std::vec::Vec<{integer}>` in the current scope + --> $DIR/auto-ref-slice-plus-ref.rs:19:7 + | +LL | a.test(); //~ ERROR no method named `test` found + | ^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `test`, perhaps you need to implement it: + candidate #1: `MyIter` + +error[E0599]: no method named `test` found for type `[{integer}; 1]` in the current scope + --> $DIR/auto-ref-slice-plus-ref.rs:21:11 + | +LL | ([1]).test(); //~ ERROR no method named `test` found + | ^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `test`, perhaps you need to implement it: + candidate #1: `MyIter` + +error[E0599]: no method named `test` found for type `&[{integer}; 1]` in the current scope + --> $DIR/auto-ref-slice-plus-ref.rs:22:12 + | +LL | (&[1]).test(); //~ ERROR no method named `test` found + | ^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `test`, perhaps you need to implement it: + candidate #1: `MyIter` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/auto-trait-validation.rs b/src/test/ui/compile-fail-migration/auto-trait-validation.rs index 92b222e1322..92b222e1322 100644 --- a/src/test/compile-fail/auto-trait-validation.rs +++ b/src/test/ui/compile-fail-migration/auto-trait-validation.rs diff --git a/src/test/ui/compile-fail-migration/auto-trait-validation.stderr b/src/test/ui/compile-fail-migration/auto-trait-validation.stderr new file mode 100644 index 00000000000..a6bd887021e --- /dev/null +++ b/src/test/ui/compile-fail-migration/auto-trait-validation.stderr @@ -0,0 +1,22 @@ +error[E0567]: auto traits cannot have generic parameters + --> $DIR/auto-trait-validation.rs:13:1 + | +LL | auto trait Generic<T> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0568]: auto traits cannot have super traits + --> $DIR/auto-trait-validation.rs:15:1 + | +LL | auto trait Bound : Copy {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0380]: auto traits cannot have methods or associated items + --> $DIR/auto-trait-validation.rs:17:1 + | +LL | auto trait MyTrait { fn foo() {} } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0380, E0567, E0568. +For more information about an error, try `rustc --explain E0380`. diff --git a/src/test/compile-fail/autoderef-full-lval.rs b/src/test/ui/compile-fail-migration/autoderef-full-lval.rs index c152fdd9296..c152fdd9296 100644 --- a/src/test/compile-fail/autoderef-full-lval.rs +++ b/src/test/ui/compile-fail-migration/autoderef-full-lval.rs diff --git a/src/test/ui/compile-fail-migration/autoderef-full-lval.stderr b/src/test/ui/compile-fail-migration/autoderef-full-lval.stderr new file mode 100644 index 00000000000..df8eeb5d171 --- /dev/null +++ b/src/test/ui/compile-fail-migration/autoderef-full-lval.stderr @@ -0,0 +1,19 @@ +error[E0369]: binary operation `+` cannot be applied to type `std::boxed::Box<isize>` + --> $DIR/autoderef-full-lval.rs:25:20 + | +LL | let z: isize = a.x + b.y; + | ^^^^^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `std::boxed::Box<isize>` + +error[E0369]: binary operation `+` cannot be applied to type `std::boxed::Box<isize>` + --> $DIR/autoderef-full-lval.rs:31:25 + | +LL | let answer: isize = forty.a + two.a; + | ^^^^^^^^^^^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `std::boxed::Box<isize>` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/auxiliary/ambig_impl_2_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/ambig_impl_2_lib.rs index 4ba0ccdba9b..4ba0ccdba9b 100644 --- a/src/test/compile-fail/auxiliary/ambig_impl_2_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/ambig_impl_2_lib.rs diff --git a/src/test/compile-fail/auxiliary/cci_class.rs b/src/test/ui/compile-fail-migration/auxiliary/cci_class.rs index 08a13fd8bcc..08a13fd8bcc 100644 --- a/src/test/compile-fail/auxiliary/cci_class.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/cci_class.rs diff --git a/src/test/compile-fail/auxiliary/cci_class_5.rs b/src/test/ui/compile-fail-migration/auxiliary/cci_class_5.rs index 7fe608f1634..7fe608f1634 100644 --- a/src/test/compile-fail/auxiliary/cci_class_5.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/cci_class_5.rs diff --git a/src/test/compile-fail/auxiliary/cdylib-dep.rs b/src/test/ui/compile-fail-migration/auxiliary/cdylib-dep.rs index a3d0222a14c..a3d0222a14c 100644 --- a/src/test/compile-fail/auxiliary/cdylib-dep.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/cdylib-dep.rs diff --git a/src/test/compile-fail/auxiliary/coherence_copy_like_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/coherence_copy_like_lib.rs index d3d389c6a8b..d3d389c6a8b 100644 --- a/src/test/compile-fail/auxiliary/coherence_copy_like_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/coherence_copy_like_lib.rs diff --git a/src/test/compile-fail/auxiliary/coherence_inherent_cc_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/coherence_inherent_cc_lib.rs index 0458636a401..0458636a401 100644 --- a/src/test/compile-fail/auxiliary/coherence_inherent_cc_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/coherence_inherent_cc_lib.rs diff --git a/src/test/compile-fail/auxiliary/coherence_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/coherence_lib.rs index daa123849e4..daa123849e4 100644 --- a/src/test/compile-fail/auxiliary/coherence_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/coherence_lib.rs diff --git a/src/test/compile-fail/auxiliary/coherence_orphan_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/coherence_orphan_lib.rs index b22d12300c7..b22d12300c7 100644 --- a/src/test/compile-fail/auxiliary/coherence_orphan_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/coherence_orphan_lib.rs diff --git a/src/test/compile-fail/auxiliary/const_fn_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/const_fn_lib.rs index b0d5a6b1272..b0d5a6b1272 100644 --- a/src/test/compile-fail/auxiliary/const_fn_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/const_fn_lib.rs diff --git a/src/test/compile-fail/auxiliary/crate_a1.rs b/src/test/ui/compile-fail-migration/auxiliary/crate_a1.rs index 70f7cac94de..70f7cac94de 100644 --- a/src/test/compile-fail/auxiliary/crate_a1.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/crate_a1.rs diff --git a/src/test/compile-fail/auxiliary/crate_a2.rs b/src/test/ui/compile-fail-migration/auxiliary/crate_a2.rs index d801f25ba2e..d801f25ba2e 100644 --- a/src/test/compile-fail/auxiliary/crate_a2.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/crate_a2.rs diff --git a/src/test/compile-fail/auxiliary/crateresolve1-1.rs b/src/test/ui/compile-fail-migration/auxiliary/crateresolve1-1.rs index 050f2fe7329..050f2fe7329 100644 --- a/src/test/compile-fail/auxiliary/crateresolve1-1.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/crateresolve1-1.rs diff --git a/src/test/compile-fail/auxiliary/crateresolve1-2.rs b/src/test/ui/compile-fail-migration/auxiliary/crateresolve1-2.rs index d19b3bafba5..d19b3bafba5 100644 --- a/src/test/compile-fail/auxiliary/crateresolve1-2.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/crateresolve1-2.rs diff --git a/src/test/compile-fail/auxiliary/crateresolve1-3.rs b/src/test/ui/compile-fail-migration/auxiliary/crateresolve1-3.rs index c5096ac49a8..c5096ac49a8 100644 --- a/src/test/compile-fail/auxiliary/crateresolve1-3.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/crateresolve1-3.rs diff --git a/src/test/compile-fail/auxiliary/default_ty_param_cross_crate_crate.rs b/src/test/ui/compile-fail-migration/auxiliary/default_ty_param_cross_crate_crate.rs index 4bd8ecacb96..4bd8ecacb96 100644 --- a/src/test/compile-fail/auxiliary/default_ty_param_cross_crate_crate.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/default_ty_param_cross_crate_crate.rs diff --git a/src/test/compile-fail/auxiliary/define_macro.rs b/src/test/ui/compile-fail-migration/auxiliary/define_macro.rs index 6b6b14a896b..6b6b14a896b 100644 --- a/src/test/compile-fail/auxiliary/define_macro.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/define_macro.rs diff --git a/src/test/compile-fail/auxiliary/deprecation-lint.rs b/src/test/ui/compile-fail-migration/auxiliary/deprecation-lint.rs index 17510289875..17510289875 100644 --- a/src/test/compile-fail/auxiliary/deprecation-lint.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/deprecation-lint.rs diff --git a/src/test/compile-fail/auxiliary/edition-extern-crate-allowed.rs b/src/test/ui/compile-fail-migration/auxiliary/edition-extern-crate-allowed.rs index d26ab6d3518..d26ab6d3518 100644 --- a/src/test/compile-fail/auxiliary/edition-extern-crate-allowed.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/edition-extern-crate-allowed.rs diff --git a/src/test/compile-fail/auxiliary/empty-struct.rs b/src/test/ui/compile-fail-migration/auxiliary/empty-struct.rs index 4a302865634..4a302865634 100644 --- a/src/test/compile-fail/auxiliary/empty-struct.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/empty-struct.rs diff --git a/src/test/compile-fail/auxiliary/extern-statics.rs b/src/test/ui/compile-fail-migration/auxiliary/extern-statics.rs index 07f70b177b3..07f70b177b3 100644 --- a/src/test/compile-fail/auxiliary/extern-statics.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/extern-statics.rs diff --git a/src/test/compile-fail/auxiliary/go_trait.rs b/src/test/ui/compile-fail-migration/auxiliary/go_trait.rs index 044bb606b40..044bb606b40 100644 --- a/src/test/compile-fail/auxiliary/go_trait.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/go_trait.rs diff --git a/src/test/compile-fail/auxiliary/import_crate_var.rs b/src/test/ui/compile-fail-migration/auxiliary/import_crate_var.rs index a8a55afa41a..a8a55afa41a 100644 --- a/src/test/compile-fail/auxiliary/import_crate_var.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/import_crate_var.rs diff --git a/src/test/compile-fail/auxiliary/inherited_stability.rs b/src/test/ui/compile-fail-migration/auxiliary/inherited_stability.rs index f690cbd029d..f690cbd029d 100644 --- a/src/test/compile-fail/auxiliary/inherited_stability.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/inherited_stability.rs diff --git a/src/test/compile-fail/auxiliary/internal_unstable.rs b/src/test/ui/compile-fail-migration/auxiliary/internal_unstable.rs index a4cd487eb65..a4cd487eb65 100644 --- a/src/test/compile-fail/auxiliary/internal_unstable.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/internal_unstable.rs diff --git a/src/test/compile-fail/auxiliary/issue-19163.rs b/src/test/ui/compile-fail-migration/auxiliary/issue-19163.rs index 76c5cdafd7c..76c5cdafd7c 100644 --- a/src/test/compile-fail/auxiliary/issue-19163.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue-19163.rs diff --git a/src/test/compile-fail/auxiliary/issue-21146-inc.rs b/src/test/ui/compile-fail-migration/auxiliary/issue-21146-inc.rs index 1b740d112e9..1b740d112e9 100644 --- a/src/test/compile-fail/auxiliary/issue-21146-inc.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue-21146-inc.rs diff --git a/src/test/compile-fail/auxiliary/issue-29181.rs b/src/test/ui/compile-fail-migration/auxiliary/issue-29181.rs index 361f1ea5509..361f1ea5509 100644 --- a/src/test/compile-fail/auxiliary/issue-29181.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue-29181.rs diff --git a/src/test/compile-fail/auxiliary/issue-30535.rs b/src/test/ui/compile-fail-migration/auxiliary/issue-30535.rs index 8d44e8d1016..8d44e8d1016 100644 --- a/src/test/compile-fail/auxiliary/issue-30535.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue-30535.rs diff --git a/src/test/compile-fail/auxiliary/issue-36881-aux.rs b/src/test/ui/compile-fail-migration/auxiliary/issue-36881-aux.rs index 33ac11feb2d..33ac11feb2d 100644 --- a/src/test/compile-fail/auxiliary/issue-36881-aux.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue-36881-aux.rs diff --git a/src/test/compile-fail/auxiliary/issue-52489.rs b/src/test/ui/compile-fail-migration/auxiliary/issue-52489.rs index 68d1ef8d776..68d1ef8d776 100644 --- a/src/test/compile-fail/auxiliary/issue-52489.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue-52489.rs diff --git a/src/test/compile-fail/auxiliary/issue_11680.rs b/src/test/ui/compile-fail-migration/auxiliary/issue_11680.rs index 18f78750b15..18f78750b15 100644 --- a/src/test/compile-fail/auxiliary/issue_11680.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue_11680.rs diff --git a/src/test/compile-fail/auxiliary/issue_16725.rs b/src/test/ui/compile-fail-migration/auxiliary/issue_16725.rs index b3b04b4a5ac..b3b04b4a5ac 100644 --- a/src/test/compile-fail/auxiliary/issue_16725.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue_16725.rs diff --git a/src/test/compile-fail/auxiliary/issue_17718_const_privacy.rs b/src/test/ui/compile-fail-migration/auxiliary/issue_17718_const_privacy.rs index 3901d73382f..3901d73382f 100644 --- a/src/test/compile-fail/auxiliary/issue_17718_const_privacy.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue_17718_const_privacy.rs diff --git a/src/test/compile-fail/auxiliary/issue_1920.rs b/src/test/ui/compile-fail-migration/auxiliary/issue_1920.rs index 55065174ca7..55065174ca7 100644 --- a/src/test/compile-fail/auxiliary/issue_1920.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue_1920.rs diff --git a/src/test/compile-fail/auxiliary/issue_21202.rs b/src/test/ui/compile-fail-migration/auxiliary/issue_21202.rs index afdbf78aa82..afdbf78aa82 100644 --- a/src/test/compile-fail/auxiliary/issue_21202.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue_21202.rs diff --git a/src/test/compile-fail/auxiliary/issue_30123_aux.rs b/src/test/ui/compile-fail-migration/auxiliary/issue_30123_aux.rs index f60311a9400..f60311a9400 100644 --- a/src/test/compile-fail/auxiliary/issue_30123_aux.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue_30123_aux.rs diff --git a/src/test/compile-fail/auxiliary/issue_41549.rs b/src/test/ui/compile-fail-migration/auxiliary/issue_41549.rs index 5a6db789282..5a6db789282 100644 --- a/src/test/compile-fail/auxiliary/issue_41549.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue_41549.rs diff --git a/src/test/compile-fail/auxiliary/issue_5844_aux.rs b/src/test/ui/compile-fail-migration/auxiliary/issue_5844_aux.rs index 7fa937e93b3..7fa937e93b3 100644 --- a/src/test/compile-fail/auxiliary/issue_5844_aux.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/issue_5844_aux.rs diff --git a/src/test/compile-fail/auxiliary/lifetime_bound_will_change_warning_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/lifetime_bound_will_change_warning_lib.rs index 95f8b39c487..95f8b39c487 100644 --- a/src/test/compile-fail/auxiliary/lifetime_bound_will_change_warning_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lifetime_bound_will_change_warning_lib.rs diff --git a/src/test/compile-fail/auxiliary/lint_output_format.rs b/src/test/ui/compile-fail-migration/auxiliary/lint_output_format.rs index 6ba66f3e45f..6ba66f3e45f 100644 --- a/src/test/compile-fail/auxiliary/lint_output_format.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lint_output_format.rs diff --git a/src/test/compile-fail/auxiliary/lint_stability.rs b/src/test/ui/compile-fail-migration/auxiliary/lint_stability.rs index 5547458abbe..5547458abbe 100644 --- a/src/test/compile-fail/auxiliary/lint_stability.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lint_stability.rs diff --git a/src/test/compile-fail/auxiliary/lint_stability_fields.rs b/src/test/ui/compile-fail-migration/auxiliary/lint_stability_fields.rs index 6b79c36fc05..6b79c36fc05 100644 --- a/src/test/compile-fail/auxiliary/lint_stability_fields.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lint_stability_fields.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate.rs b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate.rs index 2661b1f4eb4..2661b1f4eb4 100644 --- a/src/test/compile-fail/auxiliary/lint_unused_extern_crate.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate2.rs b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate2.rs index b61667cfd88..b61667cfd88 100644 --- a/src/test/compile-fail/auxiliary/lint_unused_extern_crate2.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate2.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate3.rs b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate3.rs index b61667cfd88..b61667cfd88 100644 --- a/src/test/compile-fail/auxiliary/lint_unused_extern_crate3.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate3.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate4.rs b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate4.rs index fc4bca865c9..fc4bca865c9 100644 --- a/src/test/compile-fail/auxiliary/lint_unused_extern_crate4.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate4.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate5.rs b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate5.rs index fc4bca865c9..fc4bca865c9 100644 --- a/src/test/compile-fail/auxiliary/lint_unused_extern_crate5.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lint_unused_extern_crate5.rs diff --git a/src/test/compile-fail/auxiliary/lto-duplicate-symbols1.rs b/src/test/ui/compile-fail-migration/auxiliary/lto-duplicate-symbols1.rs index ea09327bd19..ea09327bd19 100644 --- a/src/test/compile-fail/auxiliary/lto-duplicate-symbols1.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lto-duplicate-symbols1.rs diff --git a/src/test/compile-fail/auxiliary/lto-duplicate-symbols2.rs b/src/test/ui/compile-fail-migration/auxiliary/lto-duplicate-symbols2.rs index ea09327bd19..ea09327bd19 100644 --- a/src/test/compile-fail/auxiliary/lto-duplicate-symbols2.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/lto-duplicate-symbols2.rs diff --git a/src/test/compile-fail/auxiliary/macro_crate_nonterminal.rs b/src/test/ui/compile-fail-migration/auxiliary/macro_crate_nonterminal.rs index 4f75e2b5d75..4f75e2b5d75 100644 --- a/src/test/compile-fail/auxiliary/macro_crate_nonterminal.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/macro_crate_nonterminal.rs diff --git a/src/test/compile-fail/auxiliary/namespace-mix.rs b/src/test/ui/compile-fail-migration/auxiliary/namespace-mix.rs index d82e9bb7022..d82e9bb7022 100644 --- a/src/test/compile-fail/auxiliary/namespace-mix.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/namespace-mix.rs diff --git a/src/test/compile-fail/auxiliary/namespaced_enums.rs b/src/test/ui/compile-fail-migration/auxiliary/namespaced_enums.rs index 3bf39b788db..3bf39b788db 100644 --- a/src/test/compile-fail/auxiliary/namespaced_enums.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/namespaced_enums.rs diff --git a/src/test/compile-fail/auxiliary/noexporttypelib.rs b/src/test/ui/compile-fail-migration/auxiliary/noexporttypelib.rs index 5ae8e0d298e..5ae8e0d298e 100644 --- a/src/test/compile-fail/auxiliary/noexporttypelib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/noexporttypelib.rs diff --git a/src/test/compile-fail/auxiliary/orphan_check_diagnostics.rs b/src/test/ui/compile-fail-migration/auxiliary/orphan_check_diagnostics.rs index cf3e9903b5a..cf3e9903b5a 100644 --- a/src/test/compile-fail/auxiliary/orphan_check_diagnostics.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/orphan_check_diagnostics.rs diff --git a/src/test/compile-fail/auxiliary/privacy_tuple_struct.rs b/src/test/ui/compile-fail-migration/auxiliary/privacy_tuple_struct.rs index 141b6bdd604..141b6bdd604 100644 --- a/src/test/compile-fail/auxiliary/privacy_tuple_struct.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/privacy_tuple_struct.rs diff --git a/src/test/compile-fail/auxiliary/private-inferred-type.rs b/src/test/ui/compile-fail-migration/auxiliary/private-inferred-type.rs index fc43765f63c..fc43765f63c 100644 --- a/src/test/compile-fail/auxiliary/private-inferred-type.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/private-inferred-type.rs diff --git a/src/test/compile-fail/auxiliary/private_trait_xc.rs b/src/test/ui/compile-fail-migration/auxiliary/private_trait_xc.rs index 37ee10c8d37..37ee10c8d37 100644 --- a/src/test/compile-fail/auxiliary/private_trait_xc.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/private_trait_xc.rs diff --git a/src/test/compile-fail/auxiliary/rbmtp_cross_crate_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/rbmtp_cross_crate_lib.rs index f49ac4fc8e4..f49ac4fc8e4 100644 --- a/src/test/compile-fail/auxiliary/rbmtp_cross_crate_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/rbmtp_cross_crate_lib.rs diff --git a/src/test/compile-fail/auxiliary/recursive_reexports.rs b/src/test/ui/compile-fail-migration/auxiliary/recursive_reexports.rs index 1186e3d62f7..1186e3d62f7 100644 --- a/src/test/compile-fail/auxiliary/recursive_reexports.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/recursive_reexports.rs diff --git a/src/test/compile-fail/auxiliary/rmeta_meta.rs b/src/test/ui/compile-fail-migration/auxiliary/rmeta_meta.rs index 4207fc2373b..4207fc2373b 100644 --- a/src/test/compile-fail/auxiliary/rmeta_meta.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/rmeta_meta.rs diff --git a/src/test/compile-fail/auxiliary/rmeta_rlib.rs b/src/test/ui/compile-fail-migration/auxiliary/rmeta_rlib.rs index 6096c4df05b..6096c4df05b 100644 --- a/src/test/compile-fail/auxiliary/rmeta_rlib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/rmeta_rlib.rs diff --git a/src/test/compile-fail/auxiliary/some-panic-impl.rs b/src/test/ui/compile-fail-migration/auxiliary/some-panic-impl.rs index db16ac325ac..db16ac325ac 100644 --- a/src/test/compile-fail/auxiliary/some-panic-impl.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/some-panic-impl.rs diff --git a/src/test/compile-fail/auxiliary/stability_attribute_issue.rs b/src/test/ui/compile-fail-migration/auxiliary/stability_attribute_issue.rs index 1ee623c34fb..1ee623c34fb 100644 --- a/src/test/compile-fail/auxiliary/stability_attribute_issue.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/stability_attribute_issue.rs diff --git a/src/test/compile-fail/auxiliary/stability_cfg1.rs b/src/test/ui/compile-fail-migration/auxiliary/stability_cfg1.rs index c839993b047..c839993b047 100644 --- a/src/test/compile-fail/auxiliary/stability_cfg1.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/stability_cfg1.rs diff --git a/src/test/compile-fail/auxiliary/stability_cfg2.rs b/src/test/ui/compile-fail-migration/auxiliary/stability_cfg2.rs index a59f4b4e8f4..a59f4b4e8f4 100644 --- a/src/test/compile-fail/auxiliary/stability_cfg2.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/stability_cfg2.rs diff --git a/src/test/compile-fail/auxiliary/static_priv_by_default.rs b/src/test/ui/compile-fail-migration/auxiliary/static_priv_by_default.rs index 73597e51f08..73597e51f08 100644 --- a/src/test/compile-fail/auxiliary/static_priv_by_default.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/static_priv_by_default.rs diff --git a/src/test/compile-fail/auxiliary/struct_field_privacy.rs b/src/test/ui/compile-fail-migration/auxiliary/struct_field_privacy.rs index 5fea97da03e..5fea97da03e 100644 --- a/src/test/compile-fail/auxiliary/struct_field_privacy.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/struct_field_privacy.rs diff --git a/src/test/compile-fail/auxiliary/struct_variant_privacy.rs b/src/test/ui/compile-fail-migration/auxiliary/struct_variant_privacy.rs index 40868fa3f70..40868fa3f70 100644 --- a/src/test/compile-fail/auxiliary/struct_variant_privacy.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/struct_variant_privacy.rs diff --git a/src/test/compile-fail/auxiliary/tdticc_coherence_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/tdticc_coherence_lib.rs index f6f7a250174..f6f7a250174 100644 --- a/src/test/compile-fail/auxiliary/tdticc_coherence_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/tdticc_coherence_lib.rs diff --git a/src/test/compile-fail/auxiliary/trait_bounds_on_structs_and_enums_xc.rs b/src/test/ui/compile-fail-migration/auxiliary/trait_bounds_on_structs_and_enums_xc.rs index 29cb0bc176a..29cb0bc176a 100644 --- a/src/test/compile-fail/auxiliary/trait_bounds_on_structs_and_enums_xc.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/trait_bounds_on_structs_and_enums_xc.rs diff --git a/src/test/compile-fail/auxiliary/trait_impl_conflict.rs b/src/test/ui/compile-fail-migration/auxiliary/trait_impl_conflict.rs index 3190ce430ad..3190ce430ad 100644 --- a/src/test/compile-fail/auxiliary/trait_impl_conflict.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/trait_impl_conflict.rs diff --git a/src/test/compile-fail/auxiliary/trait_safety_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/trait_safety_lib.rs index 585a756fd07..585a756fd07 100644 --- a/src/test/compile-fail/auxiliary/trait_safety_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/trait_safety_lib.rs diff --git a/src/test/compile-fail/auxiliary/trait_superkinds_in_metadata.rs b/src/test/ui/compile-fail-migration/auxiliary/trait_superkinds_in_metadata.rs index 0fa2d3459f4..0fa2d3459f4 100644 --- a/src/test/compile-fail/auxiliary/trait_superkinds_in_metadata.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/trait_superkinds_in_metadata.rs diff --git a/src/test/compile-fail/auxiliary/two_macros.rs b/src/test/ui/compile-fail-migration/auxiliary/two_macros.rs index 060960f0dbc..060960f0dbc 100644 --- a/src/test/compile-fail/auxiliary/two_macros.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/two_macros.rs diff --git a/src/test/compile-fail/auxiliary/unreachable_variant.rs b/src/test/ui/compile-fail-migration/auxiliary/unreachable_variant.rs index 8ca85f20ab2..8ca85f20ab2 100644 --- a/src/test/compile-fail/auxiliary/unreachable_variant.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/unreachable_variant.rs diff --git a/src/test/compile-fail/auxiliary/unstable-macros.rs b/src/test/ui/compile-fail-migration/auxiliary/unstable-macros.rs index 836164a721a..836164a721a 100644 --- a/src/test/compile-fail/auxiliary/unstable-macros.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/unstable-macros.rs diff --git a/src/test/compile-fail/auxiliary/use_from_trait_xc.rs b/src/test/ui/compile-fail-migration/auxiliary/use_from_trait_xc.rs index 9a6d176d088..9a6d176d088 100644 --- a/src/test/compile-fail/auxiliary/use_from_trait_xc.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/use_from_trait_xc.rs diff --git a/src/test/compile-fail/auxiliary/variant-namespacing.rs b/src/test/ui/compile-fail-migration/auxiliary/variant-namespacing.rs index d7fd2968495..d7fd2968495 100644 --- a/src/test/compile-fail/auxiliary/variant-namespacing.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/variant-namespacing.rs diff --git a/src/test/compile-fail/auxiliary/weak-lang-items.rs b/src/test/ui/compile-fail-migration/auxiliary/weak-lang-items.rs index 6434e62b6f7..6434e62b6f7 100644 --- a/src/test/compile-fail/auxiliary/weak-lang-items.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/weak-lang-items.rs diff --git a/src/test/compile-fail/auxiliary/xc_private_method_lib.rs b/src/test/ui/compile-fail-migration/auxiliary/xc_private_method_lib.rs index 5e7bc61943b..5e7bc61943b 100644 --- a/src/test/compile-fail/auxiliary/xc_private_method_lib.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/xc_private_method_lib.rs diff --git a/src/test/compile-fail/auxiliary/xcrate_unit_struct.rs b/src/test/ui/compile-fail-migration/auxiliary/xcrate_unit_struct.rs index 7a69be2b06c..7a69be2b06c 100644 --- a/src/test/compile-fail/auxiliary/xcrate_unit_struct.rs +++ b/src/test/ui/compile-fail-migration/auxiliary/xcrate_unit_struct.rs diff --git a/src/test/compile-fail/bad-const-type.rs b/src/test/ui/compile-fail-migration/bad-const-type.rs index 5547d19868d..5547d19868d 100644 --- a/src/test/compile-fail/bad-const-type.rs +++ b/src/test/ui/compile-fail-migration/bad-const-type.rs diff --git a/src/test/ui/compile-fail-migration/bad-const-type.stderr b/src/test/ui/compile-fail-migration/bad-const-type.stderr new file mode 100644 index 00000000000..fbde1573200 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-const-type.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/bad-const-type.rs:11:20 + | +LL | static i: String = 10; + | ^^ + | | + | expected struct `std::string::String`, found integral variable + | help: try using a conversion method: `10.to_string()` + | + = note: expected type `std::string::String` + found type `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/bad-env-capture.rs b/src/test/ui/compile-fail-migration/bad-env-capture.rs index 6a5e4cfef89..6a5e4cfef89 100644 --- a/src/test/compile-fail/bad-env-capture.rs +++ b/src/test/ui/compile-fail-migration/bad-env-capture.rs diff --git a/src/test/ui/compile-fail-migration/bad-env-capture.stderr b/src/test/ui/compile-fail-migration/bad-env-capture.stderr new file mode 100644 index 00000000000..bf460d2a81e --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-env-capture.stderr @@ -0,0 +1,24 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/bad-env-capture.rs:14:27 + | +LL | fn bar() { log(debug, x); } + | ^ + | + = help: use the `|| { ... }` closure form instead + +error[E0425]: cannot find function `log` in this scope + --> $DIR/bad-env-capture.rs:14:16 + | +LL | fn bar() { log(debug, x); } + | ^^^ not found in this scope + +error[E0425]: cannot find value `debug` in this scope + --> $DIR/bad-env-capture.rs:14:20 + | +LL | fn bar() { log(debug, x); } + | ^^^^^ not found in this scope + +error: aborting due to 3 previous errors + +Some errors occurred: E0425, E0434. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/bad-env-capture2.rs b/src/test/ui/compile-fail-migration/bad-env-capture2.rs index cf67c73c539..cf67c73c539 100644 --- a/src/test/compile-fail/bad-env-capture2.rs +++ b/src/test/ui/compile-fail-migration/bad-env-capture2.rs diff --git a/src/test/ui/compile-fail-migration/bad-env-capture2.stderr b/src/test/ui/compile-fail-migration/bad-env-capture2.stderr new file mode 100644 index 00000000000..8d5703d29f5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-env-capture2.stderr @@ -0,0 +1,24 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/bad-env-capture2.rs:13:27 + | +LL | fn bar() { log(debug, x); } + | ^ + | + = help: use the `|| { ... }` closure form instead + +error[E0425]: cannot find function `log` in this scope + --> $DIR/bad-env-capture2.rs:13:16 + | +LL | fn bar() { log(debug, x); } + | ^^^ not found in this scope + +error[E0425]: cannot find value `debug` in this scope + --> $DIR/bad-env-capture2.rs:13:20 + | +LL | fn bar() { log(debug, x); } + | ^^^^^ not found in this scope + +error: aborting due to 3 previous errors + +Some errors occurred: E0425, E0434. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/bad-env-capture3.rs b/src/test/ui/compile-fail-migration/bad-env-capture3.rs index a30c6770b87..a30c6770b87 100644 --- a/src/test/compile-fail/bad-env-capture3.rs +++ b/src/test/ui/compile-fail-migration/bad-env-capture3.rs diff --git a/src/test/ui/compile-fail-migration/bad-env-capture3.stderr b/src/test/ui/compile-fail-migration/bad-env-capture3.stderr new file mode 100644 index 00000000000..258f7d43b56 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-env-capture3.stderr @@ -0,0 +1,24 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/bad-env-capture3.rs:14:31 + | +LL | fn bar() { log(debug, x); } + | ^ + | + = help: use the `|| { ... }` closure form instead + +error[E0425]: cannot find function `log` in this scope + --> $DIR/bad-env-capture3.rs:14:20 + | +LL | fn bar() { log(debug, x); } + | ^^^ not found in this scope + +error[E0425]: cannot find value `debug` in this scope + --> $DIR/bad-env-capture3.rs:14:24 + | +LL | fn bar() { log(debug, x); } + | ^^^^^ not found in this scope + +error: aborting due to 3 previous errors + +Some errors occurred: E0425, E0434. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/bad-expr-lhs.rs b/src/test/ui/compile-fail-migration/bad-expr-lhs.rs index c7d2f2c472f..c7d2f2c472f 100644 --- a/src/test/compile-fail/bad-expr-lhs.rs +++ b/src/test/ui/compile-fail-migration/bad-expr-lhs.rs diff --git a/src/test/ui/compile-fail-migration/bad-expr-lhs.stderr b/src/test/ui/compile-fail-migration/bad-expr-lhs.stderr new file mode 100644 index 00000000000..5937beef9c7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-expr-lhs.stderr @@ -0,0 +1,34 @@ +error[E0070]: invalid left-hand side expression + --> $DIR/bad-expr-lhs.rs:12:5 + | +LL | 1 = 2; //~ ERROR invalid left-hand side expression + | ^^^^^ left-hand of expression not valid + +error[E0067]: invalid left-hand side expression + --> $DIR/bad-expr-lhs.rs:13:5 + | +LL | 1 += 2; //~ ERROR invalid left-hand side expression + | ^ invalid expression for left-hand side + +error[E0070]: invalid left-hand side expression + --> $DIR/bad-expr-lhs.rs:14:5 + | +LL | (1, 2) = (3, 4); //~ ERROR invalid left-hand side expression + | ^^^^^^^^^^^^^^^ left-hand of expression not valid + +error[E0070]: invalid left-hand side expression + --> $DIR/bad-expr-lhs.rs:17:5 + | +LL | (a, b) = (3, 4); //~ ERROR invalid left-hand side expression + | ^^^^^^^^^^^^^^^ left-hand of expression not valid + +error[E0070]: invalid left-hand side expression + --> $DIR/bad-expr-lhs.rs:19:5 + | +LL | None = Some(3); //~ ERROR invalid left-hand side expression + | ^^^^^^^^^^^^^^ left-hand of expression not valid + +error: aborting due to 5 previous errors + +Some errors occurred: E0067, E0070. +For more information about an error, try `rustc --explain E0067`. diff --git a/src/test/compile-fail/bad-expr-path.rs b/src/test/ui/compile-fail-migration/bad-expr-path.rs index bd62dc66377..bd62dc66377 100644 --- a/src/test/compile-fail/bad-expr-path.rs +++ b/src/test/ui/compile-fail-migration/bad-expr-path.rs diff --git a/src/test/ui/compile-fail-migration/bad-expr-path.stderr b/src/test/ui/compile-fail-migration/bad-expr-path.stderr new file mode 100644 index 00000000000..a1ac17c78d6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-expr-path.stderr @@ -0,0 +1,31 @@ +error[E0425]: cannot find function `log` in this scope + --> $DIR/bad-expr-path.rs:14:5 + | +LL | log(debug, m1::arguments); + | ^^^ not found in this scope + +error[E0425]: cannot find value `debug` in this scope + --> $DIR/bad-expr-path.rs:14:9 + | +LL | log(debug, m1::arguments); + | ^^^^^ not found in this scope + +error[E0425]: cannot find value `arguments` in module `m1` + --> $DIR/bad-expr-path.rs:14:20 + | +LL | log(debug, m1::arguments); + | ^^^^^^^^^ not found in `m1` + +error[E0580]: main function has wrong type + --> $DIR/bad-expr-path.rs:13:1 + | +LL | fn main(arguments: Vec<String>) { //~ ERROR main function has wrong type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters + | + = note: expected type `fn()` + found type `fn(std::vec::Vec<std::string::String>)` + +error: aborting due to 4 previous errors + +Some errors occurred: E0425, E0580. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/bad-expr-path2.rs b/src/test/ui/compile-fail-migration/bad-expr-path2.rs index 06b72d1ed47..06b72d1ed47 100644 --- a/src/test/compile-fail/bad-expr-path2.rs +++ b/src/test/ui/compile-fail-migration/bad-expr-path2.rs diff --git a/src/test/ui/compile-fail-migration/bad-expr-path2.stderr b/src/test/ui/compile-fail-migration/bad-expr-path2.stderr new file mode 100644 index 00000000000..bb7d01c72fe --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-expr-path2.stderr @@ -0,0 +1,31 @@ +error[E0425]: cannot find function `log` in this scope + --> $DIR/bad-expr-path2.rs:16:5 + | +LL | log(debug, m1::arguments); + | ^^^ not found in this scope + +error[E0425]: cannot find value `debug` in this scope + --> $DIR/bad-expr-path2.rs:16:9 + | +LL | log(debug, m1::arguments); + | ^^^^^ not found in this scope + +error[E0423]: expected value, found module `m1::arguments` + --> $DIR/bad-expr-path2.rs:16:16 + | +LL | log(debug, m1::arguments); + | ^^^^^^^^^^^^^ not a value + +error[E0580]: main function has wrong type + --> $DIR/bad-expr-path2.rs:15:1 + | +LL | fn main(arguments: Vec<String>) { //~ ERROR main function has wrong type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters + | + = note: expected type `fn()` + found type `fn(std::vec::Vec<std::string::String>)` + +error: aborting due to 4 previous errors + +Some errors occurred: E0423, E0425, E0580. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/compile-fail/bad-extern-link-attrs.rs b/src/test/ui/compile-fail-migration/bad-extern-link-attrs.rs index ff63d4b739a..ff63d4b739a 100644 --- a/src/test/compile-fail/bad-extern-link-attrs.rs +++ b/src/test/ui/compile-fail-migration/bad-extern-link-attrs.rs diff --git a/src/test/ui/compile-fail-migration/bad-extern-link-attrs.stderr b/src/test/ui/compile-fail-migration/bad-extern-link-attrs.stderr new file mode 100644 index 00000000000..5e58bcd0094 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-extern-link-attrs.stderr @@ -0,0 +1,24 @@ +error[E0459]: #[link(...)] specified without `name = "foo"` + --> $DIR/bad-extern-link-attrs.rs:11:1 + | +LL | #[link()] //~ ERROR: specified without `name = + | ^^^^^^^^^ missing `name` argument + +error[E0454]: #[link(name = "")] given with empty name + --> $DIR/bad-extern-link-attrs.rs:12:1 + | +LL | #[link(name = "")] //~ ERROR: with empty name + | ^^^^^^^^^^^^^^^^^^ empty name given + +error[E0458]: unknown kind: `bar` + --> $DIR/bad-extern-link-attrs.rs:14:1 + | +LL | #[link(name = "foo", kind = "bar")] //~ ERROR: unknown kind + | ^^^^^^^^^^^^^^^^^^^^^------------^^ + | | + | unknown kind + +error: aborting due to 3 previous errors + +Some errors occurred: E0454, E0458, E0459. +For more information about an error, try `rustc --explain E0454`. diff --git a/src/test/compile-fail/bad-intrinsic-monomorphization.rs b/src/test/ui/compile-fail-migration/bad-intrinsic-monomorphization.rs index 2fe94d43acd..2fe94d43acd 100644 --- a/src/test/compile-fail/bad-intrinsic-monomorphization.rs +++ b/src/test/ui/compile-fail-migration/bad-intrinsic-monomorphization.rs diff --git a/src/test/ui/compile-fail-migration/bad-intrinsic-monomorphization.stderr b/src/test/ui/compile-fail-migration/bad-intrinsic-monomorphization.stderr new file mode 100644 index 00000000000..a088dd0aa43 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-intrinsic-monomorphization.stderr @@ -0,0 +1,21 @@ +error[E0511]: invalid monomorphization of `cttz` intrinsic: expected basic integer type, found `Foo` + --> $DIR/bad-intrinsic-monomorphization.rs:28:5 + | +LL | intrinsics::cttz(v) + | ^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `fadd_fast` intrinsic: expected basic float type, found `Foo` + --> $DIR/bad-intrinsic-monomorphization.rs:33:5 + | +LL | intrinsics::fadd_fast(a, b) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `Foo` + --> $DIR/bad-intrinsic-monomorphization.rs:38:5 + | +LL | simd_add(a, b) + | ^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0511`. diff --git a/src/test/compile-fail/bad-lint-cap.rs b/src/test/ui/compile-fail-migration/bad-lint-cap.rs index cb9c347af60..cb9c347af60 100644 --- a/src/test/compile-fail/bad-lint-cap.rs +++ b/src/test/ui/compile-fail-migration/bad-lint-cap.rs diff --git a/src/test/ui/compile-fail-migration/bad-lint-cap.stderr b/src/test/ui/compile-fail-migration/bad-lint-cap.stderr new file mode 100644 index 00000000000..f284dbf8479 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-lint-cap.stderr @@ -0,0 +1,2 @@ +error: unknown lint level: `test` + diff --git a/src/test/compile-fail/bad-lint-cap2.rs b/src/test/ui/compile-fail-migration/bad-lint-cap2.rs index cb9fb973a01..cb9fb973a01 100644 --- a/src/test/compile-fail/bad-lint-cap2.rs +++ b/src/test/ui/compile-fail-migration/bad-lint-cap2.rs diff --git a/src/test/ui/compile-fail-migration/bad-lint-cap2.stderr b/src/test/ui/compile-fail-migration/bad-lint-cap2.stderr new file mode 100644 index 00000000000..7471aa21e58 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-lint-cap2.stderr @@ -0,0 +1,15 @@ +error: unused import: `std::option` + --> $DIR/bad-lint-cap2.rs:16:5 + | +LL | use std::option; //~ ERROR + | ^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/bad-lint-cap2.rs:14:9 + | +LL | #![deny(warnings)] + | ^^^^^^^^ + = note: #[deny(unused_imports)] implied by #[deny(warnings)] + +error: aborting due to previous error + diff --git a/src/test/compile-fail/bad-lint-cap3.rs b/src/test/ui/compile-fail-migration/bad-lint-cap3.rs index c9394954c5f..c9394954c5f 100644 --- a/src/test/compile-fail/bad-lint-cap3.rs +++ b/src/test/ui/compile-fail-migration/bad-lint-cap3.rs diff --git a/src/test/ui/compile-fail-migration/bad-lint-cap3.stderr b/src/test/ui/compile-fail-migration/bad-lint-cap3.stderr new file mode 100644 index 00000000000..d3224607314 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-lint-cap3.stderr @@ -0,0 +1,21 @@ +warning: unused import: `std::option` + --> $DIR/bad-lint-cap3.rs:17:5 + | +LL | use std::option; //~ WARN + | ^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/bad-lint-cap3.rs:14:9 + | +LL | #![deny(warnings)] + | ^^^^^^^^ + = note: #[warn(unused_imports)] implied by #[warn(warnings)] + +error: compilation successful + --> $DIR/bad-lint-cap3.rs:20:1 + | +LL | fn main() {} //~ ERROR: compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/bad-main.rs b/src/test/ui/compile-fail-migration/bad-main.rs index b73b4a6af6e..b73b4a6af6e 100644 --- a/src/test/compile-fail/bad-main.rs +++ b/src/test/ui/compile-fail-migration/bad-main.rs diff --git a/src/test/ui/compile-fail-migration/bad-main.stderr b/src/test/ui/compile-fail-migration/bad-main.stderr new file mode 100644 index 00000000000..3388e0866e5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-main.stderr @@ -0,0 +1,12 @@ +error[E0580]: main function has wrong type + --> $DIR/bad-main.rs:11:1 + | +LL | fn main(x: isize) { } //~ ERROR: main function has wrong type [E0580] + | ^^^^^^^^^^^^^^^^^ incorrect number of function parameters + | + = note: expected type `fn()` + found type `fn(isize)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0580`. diff --git a/src/test/compile-fail/bad-method-typaram-kind.rs b/src/test/ui/compile-fail-migration/bad-method-typaram-kind.rs index 7cef3f13dfc..7cef3f13dfc 100644 --- a/src/test/compile-fail/bad-method-typaram-kind.rs +++ b/src/test/ui/compile-fail-migration/bad-method-typaram-kind.rs diff --git a/src/test/ui/compile-fail-migration/bad-method-typaram-kind.stderr b/src/test/ui/compile-fail-migration/bad-method-typaram-kind.stderr new file mode 100644 index 00000000000..ed0c49a4f66 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-method-typaram-kind.stderr @@ -0,0 +1,12 @@ +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/bad-method-typaram-kind.rs:12:7 + | +LL | 1.bar::<T>(); //~ ERROR `T` cannot be sent between threads safely + | ^^^ `T` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `T` + = help: consider adding a `where T: std::marker::Send` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/bad-mid-path-type-params.rs b/src/test/ui/compile-fail-migration/bad-mid-path-type-params.rs index 20ac757354f..20ac757354f 100644 --- a/src/test/compile-fail/bad-mid-path-type-params.rs +++ b/src/test/ui/compile-fail-migration/bad-mid-path-type-params.rs diff --git a/src/test/ui/compile-fail-migration/bad-mid-path-type-params.stderr b/src/test/ui/compile-fail-migration/bad-mid-path-type-params.stderr new file mode 100644 index 00000000000..d2b002ebee9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-mid-path-type-params.stderr @@ -0,0 +1,28 @@ +error[E0087]: too many type parameters provided: expected at most 1 type parameter, found 2 type parameters + --> $DIR/bad-mid-path-type-params.rs:40:28 + | +LL | let _ = S::new::<isize,f64>(1, 1.0); + | ^^^ expected 1 type parameter + +error[E0107]: wrong number of lifetime parameters: expected 0, found 1 + --> $DIR/bad-mid-path-type-params.rs:43:13 + | +LL | let _ = S::<'a,isize>::new::<f64>(1, 1.0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ unexpected lifetime parameter + +error[E0087]: too many type parameters provided: expected at most 1 type parameter, found 2 type parameters + --> $DIR/bad-mid-path-type-params.rs:46:36 + | +LL | let _: S2 = Trait::new::<isize,f64>(1, 1.0); + | ^^^ expected 1 type parameter + +error[E0088]: too many lifetime parameters provided: expected at most 0 lifetime parameters, found 1 lifetime parameter + --> $DIR/bad-mid-path-type-params.rs:49:25 + | +LL | let _: S2 = Trait::<'a,isize>::new::<f64>(1, 1.0); + | ^^ expected 0 lifetime parameters + +error: aborting due to 4 previous errors + +Some errors occurred: E0087, E0088, E0107. +For more information about an error, try `rustc --explain E0087`. diff --git a/src/test/compile-fail/bad-module.rs b/src/test/ui/compile-fail-migration/bad-module.rs index 6987d06ef12..6987d06ef12 100644 --- a/src/test/compile-fail/bad-module.rs +++ b/src/test/ui/compile-fail-migration/bad-module.rs diff --git a/src/test/ui/compile-fail-migration/bad-module.stderr b/src/test/ui/compile-fail-migration/bad-module.stderr new file mode 100644 index 00000000000..8c19922dcab --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-module.stderr @@ -0,0 +1,15 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `thing` + --> $DIR/bad-module.rs:12:15 + | +LL | let foo = thing::len(Vec::new()); + | ^^^^^ Use of undeclared type or module `thing` + +error[E0433]: failed to resolve. Use of undeclared type or module `foo` + --> $DIR/bad-module.rs:15:15 + | +LL | let foo = foo::bar::baz(); + | ^^^ Use of undeclared type or module `foo` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/bad-sized.rs b/src/test/ui/compile-fail-migration/bad-sized.rs index a58aebee77b..a58aebee77b 100644 --- a/src/test/compile-fail/bad-sized.rs +++ b/src/test/ui/compile-fail-migration/bad-sized.rs diff --git a/src/test/ui/compile-fail-migration/bad-sized.stderr b/src/test/ui/compile-fail-migration/bad-sized.stderr new file mode 100644 index 00000000000..12873d40b57 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-sized.stderr @@ -0,0 +1,30 @@ +error[E0225]: only auto traits can be used as additional traits in a trait object + --> $DIR/bad-sized.rs:14:24 + | +LL | let x: Vec<Trait + Sized> = Vec::new(); + | ^^^^^ non-auto additional trait + +error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time + --> $DIR/bad-sized.rs:14:12 + | +LL | let x: Vec<Trait + Sized> = Vec::new(); + | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `dyn Trait` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required by `std::vec::Vec` + +error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time + --> $DIR/bad-sized.rs:14:33 + | +LL | let x: Vec<Trait + Sized> = Vec::new(); + | ^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `dyn Trait` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required by `<std::vec::Vec<T>>::new` + +error: aborting due to 3 previous errors + +Some errors occurred: E0225, E0277. +For more information about an error, try `rustc --explain E0225`. diff --git a/src/test/compile-fail/bad-type-env-capture.rs b/src/test/ui/compile-fail-migration/bad-type-env-capture.rs index c1547dd82b3..c1547dd82b3 100644 --- a/src/test/compile-fail/bad-type-env-capture.rs +++ b/src/test/ui/compile-fail-migration/bad-type-env-capture.rs diff --git a/src/test/ui/compile-fail-migration/bad-type-env-capture.stderr b/src/test/ui/compile-fail-migration/bad-type-env-capture.stderr new file mode 100644 index 00000000000..3cb087ab09a --- /dev/null +++ b/src/test/ui/compile-fail-migration/bad-type-env-capture.stderr @@ -0,0 +1,13 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/bad-type-env-capture.rs:12:15 + | +LL | fn foo<T>() { + | - type variable from outer function +LL | fn bar(b: T) { } //~ ERROR can't use type parameters from outer + | --- ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `bar<T>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-2.rs index 2a5c7136dc3..2a5c7136dc3 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs +++ b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-2.rs diff --git a/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-2.stderr b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-2.stderr new file mode 100644 index 00000000000..2f05755eabd --- /dev/null +++ b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-2.stderr @@ -0,0 +1,11 @@ +error[E0009]: cannot bind by-move and by-ref in the same pattern + --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-2.rs:22:23 + | +LL | Some((ref _y, _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern + | ------ ^^ by-move pattern here + | | + | both by-ref and by-move used + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0009`. diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-3.rs index 3d3ccb606bf..3d3ccb606bf 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs +++ b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-3.rs diff --git a/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-3.stderr b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-3.stderr new file mode 100644 index 00000000000..a573b9a04ba --- /dev/null +++ b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-3.stderr @@ -0,0 +1,11 @@ +error[E0009]: cannot bind by-move and by-ref in the same pattern + --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-3.rs:24:38 + | +LL | double_option::some2(ref _y, _z) => { }, + | ------ ^^ by-move pattern here + | | + | both by-ref and by-move used + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0009`. diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-4.rs index 8c7542fbe6b..8c7542fbe6b 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs +++ b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-4.rs diff --git a/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-4.stderr b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-4.stderr new file mode 100644 index 00000000000..e38916b8b27 --- /dev/null +++ b/src/test/ui/compile-fail-migration/bind-by-move-neither-can-live-while-the-other-survives-4.stderr @@ -0,0 +1,11 @@ +error[E0009]: cannot bind by-move and by-ref in the same pattern + --> $DIR/bind-by-move-neither-can-live-while-the-other-survives-4.rs:22:15 + | +LL | Some((_y, ref _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern + | ^^ ------ both by-ref and by-move used + | | + | by-move pattern here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0009`. diff --git a/src/test/compile-fail/bind-by-move-no-guards.rs b/src/test/ui/compile-fail-migration/bind-by-move-no-guards.rs index bb6060f2543..bb6060f2543 100644 --- a/src/test/compile-fail/bind-by-move-no-guards.rs +++ b/src/test/ui/compile-fail-migration/bind-by-move-no-guards.rs diff --git a/src/test/ui/compile-fail-migration/bind-by-move-no-guards.stderr b/src/test/ui/compile-fail-migration/bind-by-move-no-guards.stderr new file mode 100644 index 00000000000..ed516cd559e --- /dev/null +++ b/src/test/ui/compile-fail-migration/bind-by-move-no-guards.stderr @@ -0,0 +1,9 @@ +error[E0008]: cannot bind by-move into a pattern guard + --> $DIR/bind-by-move-no-guards.rs:18:14 + | +LL | Some(z) if z.recv().unwrap() => { panic!() }, + | ^ moves value into pattern guard + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0008`. diff --git a/src/test/compile-fail/binop-bitxor-str.rs b/src/test/ui/compile-fail-migration/binop-bitxor-str.rs index 3f26e3ce904..3f26e3ce904 100644 --- a/src/test/compile-fail/binop-bitxor-str.rs +++ b/src/test/ui/compile-fail-migration/binop-bitxor-str.rs diff --git a/src/test/ui/compile-fail-migration/binop-bitxor-str.stderr b/src/test/ui/compile-fail-migration/binop-bitxor-str.stderr new file mode 100644 index 00000000000..a6804a6d42c --- /dev/null +++ b/src/test/ui/compile-fail-migration/binop-bitxor-str.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `^` cannot be applied to type `std::string::String` + --> $DIR/binop-bitxor-str.rs:13:21 + | +LL | fn main() { let x = "a".to_string() ^ "b".to_string(); } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: an implementation of `std::ops::BitXor` might be missing for `std::string::String` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/binop-consume-args.rs b/src/test/ui/compile-fail-migration/binop-consume-args.rs index c525a67c7e9..c525a67c7e9 100644 --- a/src/test/compile-fail/binop-consume-args.rs +++ b/src/test/ui/compile-fail-migration/binop-consume-args.rs diff --git a/src/test/ui/compile-fail-migration/binop-consume-args.stderr b/src/test/ui/compile-fail-migration/binop-consume-args.stderr new file mode 100644 index 00000000000..07627d3711b --- /dev/null +++ b/src/test/ui/compile-fail-migration/binop-consume-args.stderr @@ -0,0 +1,213 @@ +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:17:10 + | +LL | lhs + rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:18:10 + | +LL | lhs + rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:23:10 + | +LL | lhs - rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:24:10 + | +LL | lhs - rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:29:10 + | +LL | lhs * rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:30:10 + | +LL | lhs * rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:35:10 + | +LL | lhs / rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:36:10 + | +LL | lhs / rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:41:10 + | +LL | lhs % rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:42:10 + | +LL | lhs % rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:47:10 + | +LL | lhs & rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:48:10 + | +LL | lhs & rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:53:10 + | +LL | lhs | rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:54:10 + | +LL | lhs | rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:59:10 + | +LL | lhs ^ rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:60:10 + | +LL | lhs ^ rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:65:10 + | +LL | lhs << rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:66:10 + | +LL | lhs << rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `lhs` + --> $DIR/binop-consume-args.rs:71:10 + | +LL | lhs >> rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` + | ^^^ value used here after move + | + = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `rhs` + --> $DIR/binop-consume-args.rs:72:10 + | +LL | lhs >> rhs; + | --- value moved here +LL | drop(lhs); //~ ERROR use of moved value: `lhs` +LL | drop(rhs); //~ ERROR use of moved value: `rhs` + | ^^^ value used here after move + | + = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait + +error: aborting due to 20 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/binop-logic-float.rs b/src/test/ui/compile-fail-migration/binop-logic-float.rs index f3fb5a08c85..f3fb5a08c85 100644 --- a/src/test/compile-fail/binop-logic-float.rs +++ b/src/test/ui/compile-fail-migration/binop-logic-float.rs diff --git a/src/test/ui/compile-fail-migration/binop-logic-float.stderr b/src/test/ui/compile-fail-migration/binop-logic-float.stderr new file mode 100644 index 00000000000..947ee4e2427 --- /dev/null +++ b/src/test/ui/compile-fail-migration/binop-logic-float.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/binop-logic-float.rs:11:21 + | +LL | fn main() { let x = 1.0_f32 || 2.0_f32; } + | ^^^^^^^ expected bool, found f32 + +error[E0308]: mismatched types + --> $DIR/binop-logic-float.rs:11:32 + | +LL | fn main() { let x = 1.0_f32 || 2.0_f32; } + | ^^^^^^^ expected bool, found f32 + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/binop-logic-int.rs b/src/test/ui/compile-fail-migration/binop-logic-int.rs index f5e53f84c16..f5e53f84c16 100644 --- a/src/test/compile-fail/binop-logic-int.rs +++ b/src/test/ui/compile-fail-migration/binop-logic-int.rs diff --git a/src/test/ui/compile-fail-migration/binop-logic-int.stderr b/src/test/ui/compile-fail-migration/binop-logic-int.stderr new file mode 100644 index 00000000000..56f7601ace2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/binop-logic-int.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/binop-logic-int.rs:11:21 + | +LL | fn main() { let x = 1 && 2; } + | ^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/binop-logic-int.rs:11:26 + | +LL | fn main() { let x = 1 && 2; } + | ^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/binop-move-semantics.nll.stderr b/src/test/ui/compile-fail-migration/binop-move-semantics.nll.stderr new file mode 100644 index 00000000000..98762a0f6cf --- /dev/null +++ b/src/test/ui/compile-fail-migration/binop-move-semantics.nll.stderr @@ -0,0 +1,68 @@ +error[E0382]: use of moved value: `x` + --> $DIR/binop-move-semantics.rs:18:5 + | +LL | x + | - value moved here +LL | + +LL | x; //~ ERROR: use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/binop-move-semantics.rs:24:5 + | +LL | x + | - value moved here +LL | + +LL | x.clone(); //~ ERROR: use of moved value + | ^ value borrowed here after move + | + = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait + +error[E0507]: cannot move out of borrowed content + --> $DIR/binop-move-semantics.rs:40:5 + | +LL | *m //~ ERROR: cannot move out of borrowed content + | ^^ cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/binop-move-semantics.rs:42:5 + | +LL | *n; //~ ERROR: cannot move out of borrowed content + | ^^ cannot move out of borrowed content + +error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable + --> $DIR/binop-move-semantics.rs:64:5 + | +LL | &mut f + | ------ + | | + | _____mutable borrow occurs here + | | +LL | | + +LL | | &f; //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable + | | ^- + | |_____|| + | |borrow later used here + | immutable borrow occurs here + +error[E0502]: cannot borrow `f` as mutable because it is also borrowed as immutable + --> $DIR/binop-move-semantics.rs:72:5 + | +LL | &f + | -- + | | + | _____immutable borrow occurs here + | | +LL | | + +LL | | &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable + | | ^^^^^- + | |_____|____| + | | borrow later used here + | mutable borrow occurs here + +error: aborting due to 6 previous errors + +Some errors occurred: E0382, E0502, E0507. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/binop-move-semantics.rs b/src/test/ui/compile-fail-migration/binop-move-semantics.rs index cff0064497a..cff0064497a 100644 --- a/src/test/compile-fail/binop-move-semantics.rs +++ b/src/test/ui/compile-fail-migration/binop-move-semantics.rs diff --git a/src/test/ui/compile-fail-migration/binop-move-semantics.stderr b/src/test/ui/compile-fail-migration/binop-move-semantics.stderr new file mode 100644 index 00000000000..81b8a336a20 --- /dev/null +++ b/src/test/ui/compile-fail-migration/binop-move-semantics.stderr @@ -0,0 +1,80 @@ +error[E0382]: use of moved value: `x` + --> $DIR/binop-move-semantics.rs:18:5 + | +LL | x + | - value moved here +LL | + +LL | x; //~ ERROR: use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/binop-move-semantics.rs:24:5 + | +LL | x + | - value moved here +LL | + +LL | x.clone(); //~ ERROR: use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait + +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/binop-move-semantics.rs:31:5 + | +LL | let m = &x; + | - borrow of `x` occurs here +... +LL | x //~ ERROR: cannot move out of `x` because it is borrowed + | ^ move out of `x` occurs here + +error[E0505]: cannot move out of `y` because it is borrowed + --> $DIR/binop-move-semantics.rs:33:5 + | +LL | let n = &mut y; + | - borrow of `y` occurs here +... +LL | y; //~ ERROR: cannot move out of `y` because it is borrowed + | ^ move out of `y` occurs here + +error[E0507]: cannot move out of borrowed content + --> $DIR/binop-move-semantics.rs:40:5 + | +LL | *m //~ ERROR: cannot move out of borrowed content + | ^^ cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/binop-move-semantics.rs:42:5 + | +LL | *n; //~ ERROR: cannot move out of borrowed content + | ^^ cannot move out of borrowed content + +error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable + --> $DIR/binop-move-semantics.rs:64:6 + | +LL | &mut f + | - mutable borrow occurs here +LL | + +LL | &f; //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable + | ^ + | | + | immutable borrow occurs here + | mutable borrow ends here + +error[E0502]: cannot borrow `f` as mutable because it is also borrowed as immutable + --> $DIR/binop-move-semantics.rs:72:10 + | +LL | &f + | - immutable borrow occurs here +LL | + +LL | &mut f; //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable + | ^ + | | + | mutable borrow occurs here + | immutable borrow ends here + +error: aborting due to 8 previous errors + +Some errors occurred: E0382, E0502, E0505, E0507. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/binop-mul-bool.rs b/src/test/ui/compile-fail-migration/binop-mul-bool.rs index a36477fc183..a36477fc183 100644 --- a/src/test/compile-fail/binop-mul-bool.rs +++ b/src/test/ui/compile-fail-migration/binop-mul-bool.rs diff --git a/src/test/ui/compile-fail-migration/binop-mul-bool.stderr b/src/test/ui/compile-fail-migration/binop-mul-bool.stderr new file mode 100644 index 00000000000..1df50876c26 --- /dev/null +++ b/src/test/ui/compile-fail-migration/binop-mul-bool.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `*` cannot be applied to type `bool` + --> $DIR/binop-mul-bool.rs:13:21 + | +LL | fn main() { let x = true * false; } + | ^^^^^^^^^^^^ + | + = note: an implementation of `std::ops::Mul` might be missing for `bool` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/binop-typeck.rs b/src/test/ui/compile-fail-migration/binop-typeck.rs index 8f17288e991..8f17288e991 100644 --- a/src/test/compile-fail/binop-typeck.rs +++ b/src/test/ui/compile-fail-migration/binop-typeck.rs diff --git a/src/test/ui/compile-fail-migration/binop-typeck.stderr b/src/test/ui/compile-fail-migration/binop-typeck.stderr new file mode 100644 index 00000000000..1ff81779f3d --- /dev/null +++ b/src/test/ui/compile-fail-migration/binop-typeck.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `+` cannot be applied to type `bool` + --> $DIR/binop-typeck.rs:16:13 + | +LL | let z = x + y; + | ^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `bool` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/blind-item-block-item-shadow.rs b/src/test/ui/compile-fail-migration/blind-item-block-item-shadow.rs index eeadecf627d..eeadecf627d 100644 --- a/src/test/compile-fail/blind-item-block-item-shadow.rs +++ b/src/test/ui/compile-fail-migration/blind-item-block-item-shadow.rs diff --git a/src/test/ui/compile-fail-migration/blind-item-block-item-shadow.stderr b/src/test/ui/compile-fail-migration/blind-item-block-item-shadow.stderr new file mode 100644 index 00000000000..5adc953e405 --- /dev/null +++ b/src/test/ui/compile-fail-migration/blind-item-block-item-shadow.stderr @@ -0,0 +1,17 @@ +error[E0255]: the name `Bar` is defined multiple times + --> $DIR/blind-item-block-item-shadow.rs:16:13 + | +LL | struct Bar; + | ----------- previous definition of the type `Bar` here +LL | use foo::Bar; + | ^^^^^^^^ `Bar` reimported here + | + = note: `Bar` must be defined only once in the type namespace of this block +help: You can use `as` to change the binding name of the import + | +LL | use foo::Bar as OtherBar; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0255`. diff --git a/src/test/compile-fail/blind-item-block-middle.rs b/src/test/ui/compile-fail-migration/blind-item-block-middle.rs index a501a5cd3ec..a501a5cd3ec 100644 --- a/src/test/compile-fail/blind-item-block-middle.rs +++ b/src/test/ui/compile-fail-migration/blind-item-block-middle.rs diff --git a/src/test/ui/compile-fail-migration/blind-item-block-middle.stderr b/src/test/ui/compile-fail-migration/blind-item-block-middle.stderr new file mode 100644 index 00000000000..0123fd01173 --- /dev/null +++ b/src/test/ui/compile-fail-migration/blind-item-block-middle.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/blind-item-block-middle.rs:14:9 + | +LL | let bar = 5; + | ^^^ expected integral variable, found struct `foo::bar` + | + = note: expected type `{integer}` + found type `foo::bar` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/borrow-immutable-upvar-mutation.nll.stderr b/src/test/ui/compile-fail-migration/borrow-immutable-upvar-mutation.nll.stderr new file mode 100644 index 00000000000..631add3e62d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrow-immutable-upvar-mutation.nll.stderr @@ -0,0 +1,76 @@ +error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:25:27 + | +LL | let _f = to_fn(|| x = 42); //~ ERROR cannot assign + | ^^^^^^ cannot assign + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/borrow-immutable-upvar-mutation.rs:25:24 + | +LL | let _f = to_fn(|| x = 42); //~ ERROR cannot assign + | ^^^^^^^^^ + +error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:28:31 + | +LL | let _g = to_fn(|| set(&mut y)); //~ ERROR cannot borrow + | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/borrow-immutable-upvar-mutation.rs:28:24 + | +LL | let _g = to_fn(|| set(&mut y)); //~ ERROR cannot borrow + | ^^^^^^^^^^^^^^ + +error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:31:55 + | +LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign + | ^^^^^^ cannot assign + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/borrow-immutable-upvar-mutation.rs:31:52 + | +LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign + | ^^^^^^^^^ + +error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:37:32 + | +LL | let _f = to_fn(move || x = 42); //~ ERROR cannot assign + | ^^^^^^ cannot assign + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/borrow-immutable-upvar-mutation.rs:37:24 + | +LL | let _f = to_fn(move || x = 42); //~ ERROR cannot assign + | ^^^^^^^^^^^^^^ + +error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:40:36 + | +LL | let _g = to_fn(move || set(&mut y)); //~ ERROR cannot borrow + | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/borrow-immutable-upvar-mutation.rs:40:24 + | +LL | let _g = to_fn(move || set(&mut y)); //~ ERROR cannot borrow + | ^^^^^^^^^^^^^^^^^^^ + +error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:43:65 + | +LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign + | ^^^^^^ cannot assign + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/borrow-immutable-upvar-mutation.rs:43:57 + | +LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign + | ^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + +Some errors occurred: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/borrow-immutable-upvar-mutation.rs b/src/test/ui/compile-fail-migration/borrow-immutable-upvar-mutation.rs index 00f51973a41..00f51973a41 100644 --- a/src/test/compile-fail/borrow-immutable-upvar-mutation.rs +++ b/src/test/ui/compile-fail-migration/borrow-immutable-upvar-mutation.rs diff --git a/src/test/ui/compile-fail-migration/borrow-immutable-upvar-mutation.stderr b/src/test/ui/compile-fail-migration/borrow-immutable-upvar-mutation.stderr new file mode 100644 index 00000000000..740e1820f4f --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrow-immutable-upvar-mutation.stderr @@ -0,0 +1,78 @@ +error[E0387]: cannot assign to data in a captured outer variable in an `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:25:27 + | +LL | let _f = to_fn(|| x = 42); //~ ERROR cannot assign + | ^^^^^^ + | +help: consider changing this closure to take self by mutable reference + --> $DIR/borrow-immutable-upvar-mutation.rs:25:24 + | +LL | let _f = to_fn(|| x = 42); //~ ERROR cannot assign + | ^^^^^^^^^ + +error[E0387]: cannot borrow data mutably in a captured outer variable in an `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:28:36 + | +LL | let _g = to_fn(|| set(&mut y)); //~ ERROR cannot borrow + | ^ + | +help: consider changing this closure to take self by mutable reference + --> $DIR/borrow-immutable-upvar-mutation.rs:28:24 + | +LL | let _g = to_fn(|| set(&mut y)); //~ ERROR cannot borrow + | ^^^^^^^^^^^^^^ + +error[E0387]: cannot assign to data in a captured outer variable in an `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:31:55 + | +LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign + | ^^^^^^ + | +help: consider changing this closure to take self by mutable reference + --> $DIR/borrow-immutable-upvar-mutation.rs:31:52 + | +LL | let _h = to_fn_mut(|| { set(&mut z); to_fn(|| z = 42); }); //~ ERROR cannot assign + | ^^^^^^^^^ + +error[E0594]: cannot assign to captured outer variable in an `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:37:32 + | +LL | let _f = to_fn(move || x = 42); //~ ERROR cannot assign + | ^^^^^^ + | + = note: `Fn` closures cannot capture their enclosing environment for modifications +help: consider changing this closure to take self by mutable reference + --> $DIR/borrow-immutable-upvar-mutation.rs:37:24 + | +LL | let _f = to_fn(move || x = 42); //~ ERROR cannot assign + | ^^^^^^^^^^^^^^ + +error[E0596]: cannot borrow captured outer variable in an `Fn` closure as mutable + --> $DIR/borrow-immutable-upvar-mutation.rs:40:41 + | +LL | let _g = to_fn(move || set(&mut y)); //~ ERROR cannot borrow + | ^ + | +help: consider changing this closure to take self by mutable reference + --> $DIR/borrow-immutable-upvar-mutation.rs:40:24 + | +LL | let _g = to_fn(move || set(&mut y)); //~ ERROR cannot borrow + | ^^^^^^^^^^^^^^^^^^^ + +error[E0594]: cannot assign to captured outer variable in an `Fn` closure + --> $DIR/borrow-immutable-upvar-mutation.rs:43:65 + | +LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign + | ^^^^^^ + | + = note: `Fn` closures cannot capture their enclosing environment for modifications +help: consider changing this closure to take self by mutable reference + --> $DIR/borrow-immutable-upvar-mutation.rs:43:57 + | +LL | let _h = to_fn_mut(move || { set(&mut z); to_fn(move || z = 42); }); //~ ERROR cannot assign + | ^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + +Some errors occurred: E0387, E0594, E0596. +For more information about an error, try `rustc --explain E0387`. diff --git a/src/test/compile-fail/borrow-tuple-fields.rs b/src/test/ui/compile-fail-migration/borrow-tuple-fields.rs index f3417fafe90..f3417fafe90 100644 --- a/src/test/compile-fail/borrow-tuple-fields.rs +++ b/src/test/ui/compile-fail-migration/borrow-tuple-fields.rs diff --git a/src/test/ui/compile-fail-migration/borrow-tuple-fields.stderr b/src/test/ui/compile-fail-migration/borrow-tuple-fields.stderr new file mode 100644 index 00000000000..71dc21123e9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrow-tuple-fields.stderr @@ -0,0 +1,63 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrow-tuple-fields.rs:20:9 + | +LL | let r = &x.0; + | --- borrow of `x.0` occurs here +LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed + | ^ move out of `x` occurs here + +error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable + --> $DIR/borrow-tuple-fields.rs:24:18 + | +LL | let a = &x.0; + | --- immutable borrow occurs here +LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as + | ^^^ mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error[E0499]: cannot borrow `x.0` as mutable more than once at a time + --> $DIR/borrow-tuple-fields.rs:28:18 + | +LL | let a = &mut x.0; + | --- first mutable borrow occurs here +LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time + | ^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrow-tuple-fields.rs:33:9 + | +LL | let r = &x.0; + | --- borrow of `x.0` occurs here +LL | let y = x; //~ ERROR cannot move out of `x` because it is borrowed + | ^ move out of `x` occurs here + +error[E0502]: cannot borrow `x.0` as mutable because it is also borrowed as immutable + --> $DIR/borrow-tuple-fields.rs:37:18 + | +LL | let a = &x.0; + | --- immutable borrow occurs here +LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable because it is also borrowed as + | ^^^ mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error[E0499]: cannot borrow `x.0` as mutable more than once at a time + --> $DIR/borrow-tuple-fields.rs:41:18 + | +LL | let a = &mut x.0; + | --- first mutable borrow occurs here +LL | let b = &mut x.0; //~ ERROR cannot borrow `x.0` as mutable more than once at a time + | ^^^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error: aborting due to 6 previous errors + +Some errors occurred: E0499, E0502, E0505. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.ast.nll.stderr new file mode 100644 index 00000000000..0df5e0c6e66 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.ast.nll.stderr @@ -0,0 +1,53 @@ +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/borrowck-access-permissions.rs:22:19 + | +LL | let x = 1; + | - help: consider changing this to be mutable: `mut x` +... +LL | let _y1 = &mut x; //[ast]~ ERROR [E0596] + | ^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable static item `static_x` as mutable + --> $DIR/borrowck-access-permissions.rs:28:19 + | +LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596] + | ^^^^^^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable + --> $DIR/borrowck-access-permissions.rs:37:19 + | +LL | let box_x = Box::new(1); + | ----- help: consider changing this to be mutable: `mut box_x` +... +LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596] + | ^^^^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference + --> $DIR/borrowck-access-permissions.rs:46:19 + | +LL | let ref_x = &x; + | -- help: consider changing this to be a mutable reference: `&mut x` +... +LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596] + | ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer + --> $DIR/borrowck-access-permissions.rs:56:23 + | +LL | let ptr_x : *const _ = &x; + | -- help: consider changing this to be a mutable pointer: `&mut x` +... +LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596] + | ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference + --> $DIR/borrowck-access-permissions.rs:66:18 + | +LL | let foo_ref = &foo; + | ---- help: consider changing this to be a mutable reference: `&mut foo` +LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389] + | ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.ast.stderr new file mode 100644 index 00000000000..b17245673e0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.ast.stderr @@ -0,0 +1,46 @@ +error[E0596]: cannot borrow immutable local variable `x` as mutable + --> $DIR/borrowck-access-permissions.rs:22:24 + | +LL | let x = 1; + | - consider changing this to `mut x` +... +LL | let _y1 = &mut x; //[ast]~ ERROR [E0596] + | ^ cannot borrow mutably + +error[E0596]: cannot borrow immutable static item as mutable + --> $DIR/borrowck-access-permissions.rs:28:24 + | +LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596] + | ^^^^^^^^ + +error[E0596]: cannot borrow immutable `Box` content `*box_x` as mutable + --> $DIR/borrowck-access-permissions.rs:37:24 + | +LL | let box_x = Box::new(1); + | ----- consider changing this to `mut box_x` +... +LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596] + | ^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content `*ref_x` as mutable + --> $DIR/borrowck-access-permissions.rs:46:24 + | +LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596] + | ^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable dereference of raw pointer `*ptr_x` as mutable + --> $DIR/borrowck-access-permissions.rs:56:28 + | +LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596] + | ^^^^^^ cannot borrow as mutable + +error[E0389]: cannot borrow data mutably in a `&` reference + --> $DIR/borrowck-access-permissions.rs:66:23 + | +LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389] + | ^^^^^^^^^^ assignment into an immutable reference + +error: aborting due to 6 previous errors + +Some errors occurred: E0389, E0596. +For more information about an error, try `rustc --explain E0389`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.mir.stderr new file mode 100644 index 00000000000..0df5e0c6e66 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.mir.stderr @@ -0,0 +1,53 @@ +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/borrowck-access-permissions.rs:22:19 + | +LL | let x = 1; + | - help: consider changing this to be mutable: `mut x` +... +LL | let _y1 = &mut x; //[ast]~ ERROR [E0596] + | ^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable static item `static_x` as mutable + --> $DIR/borrowck-access-permissions.rs:28:19 + | +LL | let _y1 = &mut static_x; //[ast]~ ERROR [E0596] + | ^^^^^^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `*box_x` as mutable, as `box_x` is not declared as mutable + --> $DIR/borrowck-access-permissions.rs:37:19 + | +LL | let box_x = Box::new(1); + | ----- help: consider changing this to be mutable: `mut box_x` +... +LL | let _y1 = &mut *box_x; //[ast]~ ERROR [E0596] + | ^^^^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `*ref_x` as mutable, as it is behind a `&` reference + --> $DIR/borrowck-access-permissions.rs:46:19 + | +LL | let ref_x = &x; + | -- help: consider changing this to be a mutable reference: `&mut x` +... +LL | let _y1 = &mut *ref_x; //[ast]~ ERROR [E0596] + | ^^^^^^^^^^^ `ref_x` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `*ptr_x` as mutable, as it is behind a `*const` pointer + --> $DIR/borrowck-access-permissions.rs:56:23 + | +LL | let ptr_x : *const _ = &x; + | -- help: consider changing this to be a mutable pointer: `&mut x` +... +LL | let _y1 = &mut *ptr_x; //[ast]~ ERROR [E0596] + | ^^^^^^^^^^^ `ptr_x` is a `*const` pointer, so the data it refers to cannot be borrowed as mutable + +error[E0596]: cannot borrow `*foo_ref.f` as mutable, as it is behind a `&` reference + --> $DIR/borrowck-access-permissions.rs:66:18 + | +LL | let foo_ref = &foo; + | ---- help: consider changing this to be a mutable reference: `&mut foo` +LL | let _y = &mut *foo_ref.f; //[ast]~ ERROR [E0389] + | ^^^^^^^^^^^^^^^ `foo_ref` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-access-permissions.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.rs index 00a3da86074..00a3da86074 100644 --- a/src/test/compile-fail/borrowck/borrowck-access-permissions.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-access-permissions.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-and-init.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-and-init.nll.stderr new file mode 100644 index 00000000000..0b1b157f3e0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-and-init.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `i` + --> $DIR/borrowck-and-init.rs:15:20 + | +LL | println!("{}", i); //~ ERROR use of possibly uninitialized variable: `i` + | ^ use of possibly uninitialized `i` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-and-init.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-and-init.rs index 92f16d8ffce..92f16d8ffce 100644 --- a/src/test/compile-fail/borrowck/borrowck-and-init.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-and-init.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-and-init.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-and-init.stderr new file mode 100644 index 00000000000..2cbc57d66e9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-and-init.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `i` + --> $DIR/borrowck-and-init.rs:15:20 + | +LL | println!("{}", i); //~ ERROR use of possibly uninitialized variable: `i` + | ^ use of possibly uninitialized `i` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-struct.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-struct.nll.stderr new file mode 100644 index 00000000000..0fe9106249b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-struct.nll.stderr @@ -0,0 +1,40 @@ +error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-anon-fields-struct.rs:23:19 + | +LL | Y(ref mut a, _) => a + | --------- mutable borrow occurs here +... +LL | let b = match y { + | ^ immutable borrow occurs here +... +LL | *a += 1; + | ------- borrow later used here + +error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-anon-fields-struct.rs:38:19 + | +LL | Y(ref mut a, _) => a + | --------- mutable borrow occurs here +... +LL | let b = match y { + | ^ immutable borrow occurs here +... +LL | *a += 1; + | ------- borrow later used here + +error[E0499]: cannot borrow `y.0` as mutable more than once at a time + --> $DIR/borrowck-anon-fields-struct.rs:39:11 + | +LL | Y(ref mut a, _) => a + | --------- first mutable borrow occurs here +... +LL | Y(ref mut b, _) => b //~ ERROR cannot borrow + | ^^^^^^^^^ second mutable borrow occurs here +... +LL | *a += 1; + | ------- borrow later used here + +error: aborting due to 3 previous errors + +Some errors occurred: E0499, E0502. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-anon-fields-struct.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-struct.rs index 5ee2b89dd98..5ee2b89dd98 100644 --- a/src/test/compile-fail/borrowck/borrowck-anon-fields-struct.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-struct.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-struct.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-struct.stderr new file mode 100644 index 00000000000..e635a2392e1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-struct.stderr @@ -0,0 +1,15 @@ +error[E0499]: cannot borrow `y.0` as mutable more than once at a time + --> $DIR/borrowck-anon-fields-struct.rs:39:11 + | +LL | Y(ref mut a, _) => a + | --------- first mutable borrow occurs here +... +LL | Y(ref mut b, _) => b //~ ERROR cannot borrow + | ^^^^^^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-tuple.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-tuple.nll.stderr new file mode 100644 index 00000000000..015174a9e45 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-tuple.nll.stderr @@ -0,0 +1,40 @@ +error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-anon-fields-tuple.rs:21:19 + | +LL | (ref mut a, _) => a + | --------- mutable borrow occurs here +... +LL | let b = match y { + | ^ immutable borrow occurs here +... +LL | *a += 1; + | ------- borrow later used here + +error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-anon-fields-tuple.rs:36:19 + | +LL | (ref mut a, _) => a + | --------- mutable borrow occurs here +... +LL | let b = match y { + | ^ immutable borrow occurs here +... +LL | *a += 1; + | ------- borrow later used here + +error[E0499]: cannot borrow `y.0` as mutable more than once at a time + --> $DIR/borrowck-anon-fields-tuple.rs:37:10 + | +LL | (ref mut a, _) => a + | --------- first mutable borrow occurs here +... +LL | (ref mut b, _) => b //~ ERROR cannot borrow + | ^^^^^^^^^ second mutable borrow occurs here +... +LL | *a += 1; + | ------- borrow later used here + +error: aborting due to 3 previous errors + +Some errors occurred: E0499, E0502. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-anon-fields-tuple.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-tuple.rs index ebaed01756f..ebaed01756f 100644 --- a/src/test/compile-fail/borrowck/borrowck-anon-fields-tuple.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-tuple.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-tuple.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-tuple.stderr new file mode 100644 index 00000000000..d05d1c31f9d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-tuple.stderr @@ -0,0 +1,15 @@ +error[E0499]: cannot borrow `y.0` as mutable more than once at a time + --> $DIR/borrowck-anon-fields-tuple.rs:37:10 + | +LL | (ref mut a, _) => a + | --------- first mutable borrow occurs here +... +LL | (ref mut b, _) => b //~ ERROR cannot borrow + | ^^^^^^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-variant.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-variant.nll.stderr new file mode 100644 index 00000000000..e4b9f2f2329 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-variant.nll.stderr @@ -0,0 +1,40 @@ +error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-anon-fields-variant.rs:26:19 + | +LL | Foo::Y(ref mut a, _) => a, + | --------- mutable borrow occurs here +... +LL | let b = match y { + | ^ immutable borrow occurs here +... +LL | *a += 1; + | ------- borrow later used here + +error[E0502]: cannot borrow `y` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-anon-fields-variant.rs:43:19 + | +LL | Foo::Y(ref mut a, _) => a, + | --------- mutable borrow occurs here +... +LL | let b = match y { + | ^ immutable borrow occurs here +... +LL | *a += 1; + | ------- borrow later used here + +error[E0499]: cannot borrow `y.0` as mutable more than once at a time + --> $DIR/borrowck-anon-fields-variant.rs:44:14 + | +LL | Foo::Y(ref mut a, _) => a, + | --------- first mutable borrow occurs here +... +LL | Foo::Y(ref mut b, _) => b, //~ ERROR cannot borrow + | ^^^^^^^^^ second mutable borrow occurs here +... +LL | *a += 1; + | ------- borrow later used here + +error: aborting due to 3 previous errors + +Some errors occurred: E0499, E0502. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-anon-fields-variant.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-variant.rs index 4e1b85283a6..4e1b85283a6 100644 --- a/src/test/compile-fail/borrowck/borrowck-anon-fields-variant.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-variant.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-variant.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-variant.stderr new file mode 100644 index 00000000000..817d0154a63 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-anon-fields-variant.stderr @@ -0,0 +1,15 @@ +error[E0499]: cannot borrow `y.0` as mutable more than once at a time + --> $DIR/borrowck-anon-fields-variant.rs:44:14 + | +LL | Foo::Y(ref mut a, _) => a, + | --------- first mutable borrow occurs here +... +LL | Foo::Y(ref mut b, _) => b, //~ ERROR cannot borrow + | ^^^^^^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-argument.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-argument.nll.stderr new file mode 100644 index 00000000000..4470566eabb --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-argument.nll.stderr @@ -0,0 +1,35 @@ +error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable + --> $DIR/borrowck-argument.rs:20:5 + | +LL | fn func(arg: S) { + | --- help: consider changing this to be mutable: `mut arg` +LL | arg.mutate(); //~ ERROR: cannot borrow immutable argument + | ^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable + --> $DIR/borrowck-argument.rs:25:9 + | +LL | fn method(&self, arg: S) { + | --- help: consider changing this to be mutable: `mut arg` +LL | arg.mutate(); //~ ERROR: cannot borrow immutable argument + | ^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable + --> $DIR/borrowck-argument.rs:31:9 + | +LL | fn default(&self, arg: S) { + | --- help: consider changing this to be mutable: `mut arg` +LL | arg.mutate(); //~ ERROR: cannot borrow immutable argument + | ^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable + --> $DIR/borrowck-argument.rs:42:17 + | +LL | (|arg: S| { arg.mutate() })(s); //~ ERROR: cannot borrow immutable argument + | --- ^^^ cannot borrow as mutable + | | + | help: consider changing this to be mutable: `mut arg` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-argument.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-argument.rs index 3230689e53c..3230689e53c 100644 --- a/src/test/compile-fail/borrowck/borrowck-argument.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-argument.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-argument.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-argument.stderr new file mode 100644 index 00000000000..2a7a7b3ffee --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-argument.stderr @@ -0,0 +1,35 @@ +error[E0596]: cannot borrow immutable argument `arg` as mutable + --> $DIR/borrowck-argument.rs:20:5 + | +LL | fn func(arg: S) { + | --- consider changing this to `mut arg` +LL | arg.mutate(); //~ ERROR: cannot borrow immutable argument + | ^^^ cannot borrow mutably + +error[E0596]: cannot borrow immutable argument `arg` as mutable + --> $DIR/borrowck-argument.rs:25:9 + | +LL | fn method(&self, arg: S) { + | --- consider changing this to `mut arg` +LL | arg.mutate(); //~ ERROR: cannot borrow immutable argument + | ^^^ cannot borrow mutably + +error[E0596]: cannot borrow immutable argument `arg` as mutable + --> $DIR/borrowck-argument.rs:31:9 + | +LL | fn default(&self, arg: S) { + | --- consider changing this to `mut arg` +LL | arg.mutate(); //~ ERROR: cannot borrow immutable argument + | ^^^ cannot borrow mutably + +error[E0596]: cannot borrow immutable argument `arg` as mutable + --> $DIR/borrowck-argument.rs:42:17 + | +LL | (|arg: S| { arg.mutate() })(s); //~ ERROR: cannot borrow immutable argument + | --- ^^^ cannot borrow mutably + | | + | consider changing this to `mut arg` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.ast.nll.stderr new file mode 100644 index 00000000000..6936d32a789 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.ast.nll.stderr @@ -0,0 +1,79 @@ +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-asm.rs:37:17 + | +LL | asm!("nop" : : "r"(x)); + | - value moved here +LL | } +LL | let z = x; //[ast]~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-asm.rs:45:32 + | +LL | let y = &mut x; + | ------ borrow of `x` occurs here +LL | unsafe { +LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use + | ^ use of borrowed `x` +... +LL | let z = y; + | - borrow later used here + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-asm.rs:54:13 + | +LL | let x = 3; + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | unsafe { +LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice + | ^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-asm.rs:70:13 + | +LL | let x = 3; + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | unsafe { +LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice + | ^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-asm.rs:78:13 + | +LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable + | ^^^^^^^^^^^^^^^^^^^^^^^ use of possibly uninitialized `x` + +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-asm.rs:87:13 + | +LL | let y = &*x; + | --- borrow of `x` occurs here +LL | unsafe { +LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed + | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here +... +LL | let z = y; + | - borrow later used here + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-asm.rs:96:40 + | +LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value + | - ^ value used here after move + | | + | value moved here + | + = note: move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait + +error: aborting due to 7 previous errors + +Some errors occurred: E0381, E0382, E0384, E0503, E0506. +For more information about an error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.ast.stderr new file mode 100644 index 00000000000..e2e54aa9b8a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.ast.stderr @@ -0,0 +1,76 @@ +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-asm.rs:37:13 + | +LL | asm!("nop" : : "r"(x)); + | - value moved here +LL | } +LL | let z = x; //[ast]~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-asm.rs:45:32 + | +LL | let y = &mut x; + | - borrow of `x` occurs here +LL | unsafe { +LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use + | ^ use of borrowed `x` + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-asm.rs:54:13 + | +LL | let x = 3; + | - first assignment to `x` +LL | unsafe { +LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice + | ^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error[E0506]: cannot assign to `a` because it is borrowed + --> $DIR/borrowck-asm.rs:60:13 + | +LL | let b = &*a; + | -- borrow of `a` occurs here +LL | unsafe { +LL | asm!("nop" : "=r"(a)); //[ast]~ ERROR cannot assign to `a` because it is borrowed + | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `a` occurs here + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-asm.rs:70:13 + | +LL | let x = 3; + | - first assignment to `x` +LL | unsafe { +LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice + | ^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-asm.rs:78:32 + | +LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable + | ^ use of possibly uninitialized `x` + +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-asm.rs:87:13 + | +LL | let y = &*x; + | -- borrow of `x` occurs here +LL | unsafe { +LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed + | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-asm.rs:96:40 + | +LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value + | - ^ value used here after move + | | + | value moved here + | + = note: move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait + +error: aborting due to 8 previous errors + +Some errors occurred: E0381, E0382, E0384, E0503, E0506. +For more information about an error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.mir.stderr new file mode 100644 index 00000000000..6936d32a789 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.mir.stderr @@ -0,0 +1,79 @@ +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-asm.rs:37:17 + | +LL | asm!("nop" : : "r"(x)); + | - value moved here +LL | } +LL | let z = x; //[ast]~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `&mut isize`, which does not implement the `Copy` trait + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-asm.rs:45:32 + | +LL | let y = &mut x; + | ------ borrow of `x` occurs here +LL | unsafe { +LL | asm!("nop" : : "r"(x)); //[ast]~ ERROR cannot use + | ^ use of borrowed `x` +... +LL | let z = y; + | - borrow later used here + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-asm.rs:54:13 + | +LL | let x = 3; + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | unsafe { +LL | asm!("nop" : "=r"(x)); //[ast]~ ERROR cannot assign twice + | ^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-asm.rs:70:13 + | +LL | let x = 3; + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | unsafe { +LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign twice + | ^^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-asm.rs:78:13 + | +LL | asm!("nop" : "=*r"(x)); //[ast]~ ERROR use of possibly uninitialized variable + | ^^^^^^^^^^^^^^^^^^^^^^^ use of possibly uninitialized `x` + +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-asm.rs:87:13 + | +LL | let y = &*x; + | --- borrow of `x` occurs here +LL | unsafe { +LL | asm!("nop" : "+r"(x)); //[ast]~ ERROR cannot assign to `x` because it is borrowed + | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here +... +LL | let z = y; + | - borrow later used here + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-asm.rs:96:40 + | +LL | asm!("nop" : : "r"(x), "r"(x) ); //[ast]~ ERROR use of moved value + | - ^ value used here after move + | | + | value moved here + | + = note: move occurs because `x` has type `&mut i32`, which does not implement the `Copy` trait + +error: aborting due to 7 previous errors + +Some errors occurred: E0381, E0382, E0384, E0503, E0506. +For more information about an error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-asm.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.rs index d9816401b33..d9816401b33 100644 --- a/src/test/compile-fail/borrowck/borrowck-asm.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-asm.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp-idx.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp-idx.nll.stderr new file mode 100644 index 00000000000..f4568d7c9eb --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp-idx.nll.stderr @@ -0,0 +1,27 @@ +error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-assign-comp-idx.rs:22:5 + | +LL | let q: &isize = &p[0]; + | - immutable borrow occurs here +LL | +LL | p[0] = 5; //~ ERROR cannot borrow + | ^ mutable borrow occurs here +LL | +LL | println!("{}", *q); + | -- borrow later used here + +error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-assign-comp-idx.rs:37:9 + | +LL | / borrow( +LL | | &p, + | | -- immutable borrow occurs here +LL | | || p[0] = 5); //~ ERROR cannot borrow `p` as mutable + | |_________^^_-_______- borrow later used here + | | | + | | second borrow occurs due to use of `p` in closure + | mutable borrow occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-assign-comp-idx.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp-idx.rs index 1e665a12a19..1e665a12a19 100644 --- a/src/test/compile-fail/borrowck/borrowck-assign-comp-idx.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp-idx.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp-idx.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp-idx.stderr new file mode 100644 index 00000000000..69a69b36fc7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp-idx.stderr @@ -0,0 +1,26 @@ +error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-assign-comp-idx.rs:22:5 + | +LL | let q: &isize = &p[0]; + | - immutable borrow occurs here +LL | +LL | p[0] = 5; //~ ERROR cannot borrow + | ^ mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-assign-comp-idx.rs:37:9 + | +LL | &p, + | - immutable borrow occurs here +LL | || p[0] = 5); //~ ERROR cannot borrow `p` as mutable + | ^^ - - immutable borrow ends here + | | | + | | borrow occurs due to use of `p` in closure + | mutable borrow occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.ast.nll.stderr new file mode 100644 index 00000000000..2a1fbfd43bf --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.ast.nll.stderr @@ -0,0 +1,37 @@ +error[E0506]: cannot assign to `p.x` because it is borrowed + --> $DIR/borrowck-assign-comp.rs:23:5 + | +LL | let q = &p; + | -- borrow of `p.x` occurs here +... +LL | p.x = 5; //[ast]~ ERROR cannot assign to `p.x` + | ^^^^^^^ assignment to borrowed `p.x` occurs here +LL | //[mir]~^ ERROR cannot assign to `p.x` because it is borrowed +LL | q.x; + | --- borrow later used here + +error[E0506]: cannot assign to `p` because it is borrowed + --> $DIR/borrowck-assign-comp.rs:34:5 + | +LL | let q = &p.y; + | ---- borrow of `p` occurs here +LL | p = point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p` + | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here +... +LL | *q; // stretch loan + | -- borrow later used here + +error[E0506]: cannot assign to `p.y` because it is borrowed + --> $DIR/borrowck-assign-comp.rs:46:5 + | +LL | let q = &p.y; + | ---- borrow of `p.y` occurs here +LL | p.y = 5; //[ast]~ ERROR cannot assign to `p.y` + | ^^^^^^^ assignment to borrowed `p.y` occurs here +LL | //[mir]~^ ERROR cannot assign to `p.y` because it is borrowed +LL | *q; + | -- borrow later used here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.ast.stderr new file mode 100644 index 00000000000..9e5e0e197a9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.ast.stderr @@ -0,0 +1,28 @@ +error[E0506]: cannot assign to `p.x` because it is borrowed + --> $DIR/borrowck-assign-comp.rs:23:5 + | +LL | let q = &p; + | - borrow of `p.x` occurs here +... +LL | p.x = 5; //[ast]~ ERROR cannot assign to `p.x` + | ^^^^^^^ assignment to borrowed `p.x` occurs here + +error[E0506]: cannot assign to `p` because it is borrowed + --> $DIR/borrowck-assign-comp.rs:34:5 + | +LL | let q = &p.y; + | --- borrow of `p` occurs here +LL | p = point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p` + | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here + +error[E0506]: cannot assign to `p.y` because it is borrowed + --> $DIR/borrowck-assign-comp.rs:46:5 + | +LL | let q = &p.y; + | --- borrow of `p.y` occurs here +LL | p.y = 5; //[ast]~ ERROR cannot assign to `p.y` + | ^^^^^^^ assignment to borrowed `p.y` occurs here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.mir.stderr new file mode 100644 index 00000000000..2a1fbfd43bf --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.mir.stderr @@ -0,0 +1,37 @@ +error[E0506]: cannot assign to `p.x` because it is borrowed + --> $DIR/borrowck-assign-comp.rs:23:5 + | +LL | let q = &p; + | -- borrow of `p.x` occurs here +... +LL | p.x = 5; //[ast]~ ERROR cannot assign to `p.x` + | ^^^^^^^ assignment to borrowed `p.x` occurs here +LL | //[mir]~^ ERROR cannot assign to `p.x` because it is borrowed +LL | q.x; + | --- borrow later used here + +error[E0506]: cannot assign to `p` because it is borrowed + --> $DIR/borrowck-assign-comp.rs:34:5 + | +LL | let q = &p.y; + | ---- borrow of `p` occurs here +LL | p = point {x: 5, y: 7};//[ast]~ ERROR cannot assign to `p` + | ^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `p` occurs here +... +LL | *q; // stretch loan + | -- borrow later used here + +error[E0506]: cannot assign to `p.y` because it is borrowed + --> $DIR/borrowck-assign-comp.rs:46:5 + | +LL | let q = &p.y; + | ---- borrow of `p.y` occurs here +LL | p.y = 5; //[ast]~ ERROR cannot assign to `p.y` + | ^^^^^^^ assignment to borrowed `p.y` occurs here +LL | //[mir]~^ ERROR cannot assign to `p.y` because it is borrowed +LL | *q; + | -- borrow later used here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/borrowck/borrowck-assign-comp.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.rs index d68420eb205..d68420eb205 100644 --- a/src/test/compile-fail/borrowck/borrowck-assign-comp.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-comp.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.nll.stderr new file mode 100644 index 00000000000..eb4c1ff025b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.nll.stderr @@ -0,0 +1,19 @@ +error[E0594]: cannot assign to `*s.pointer` which is behind a `&` reference + --> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:19:5 + | +LL | fn a(s: &S) { + | -- help: consider changing this to be a mutable reference: `&mut S<'_>` +LL | *s.pointer += 1; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^ `s` is a `&` reference, so the data it refers to cannot be written + +error[E0594]: cannot assign to `*s.pointer` which is behind a `&` reference + --> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:27:5 + | +LL | fn c(s: & &mut S) { + | -------- help: consider changing this to be a mutable reference: `&mut &mut S<'_>` +LL | *s.pointer += 1; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^ `s` is a `&` reference, so the data it refers to cannot be written + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.rs index d66cdb99a74..d66cdb99a74 100644 --- a/src/test/compile-fail/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr new file mode 100644 index 00000000000..4fb65988eee --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr @@ -0,0 +1,19 @@ +error[E0389]: cannot assign to data in a `&` reference + --> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:19:5 + | +LL | fn a(s: &S) { + | -- use `&mut S` here to make mutable +LL | *s.pointer += 1; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^ assignment into an immutable reference + +error[E0389]: cannot assign to data in a `&` reference + --> $DIR/borrowck-assign-to-andmut-in-aliasable-loc.rs:27:5 + | +LL | fn c(s: & &mut S) { + | -------- use `&mut &mut S` here to make mutable +LL | *s.pointer += 1; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^ assignment into an immutable reference + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0389`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.nll.stderr new file mode 100644 index 00000000000..8ca7229b42a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.nll.stderr @@ -0,0 +1,24 @@ +error[E0503]: cannot use `*y.pointer` because it was mutably borrowed + --> $DIR/borrowck-assign-to-andmut-in-borrowed-loc.rs:28:9 + | +LL | let z = copy_borrowed_ptr(&mut y); + | ------ borrow of `y` occurs here +LL | *y.pointer += 1; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^ use of borrowed `y` +LL | *z.pointer += 1; + | --------------- borrow later used here + +error[E0506]: cannot assign to `*y.pointer` because it is borrowed + --> $DIR/borrowck-assign-to-andmut-in-borrowed-loc.rs:28:9 + | +LL | let z = copy_borrowed_ptr(&mut y); + | ------ borrow of `*y.pointer` occurs here +LL | *y.pointer += 1; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here +LL | *z.pointer += 1; + | --------------- borrow later used here + +error: aborting due to 2 previous errors + +Some errors occurred: E0503, E0506. +For more information about an error, try `rustc --explain E0503`. diff --git a/src/test/compile-fail/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.rs index 77aa57ef1b5..77aa57ef1b5 100644 --- a/src/test/compile-fail/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.stderr new file mode 100644 index 00000000000..9a7c8330505 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.stderr @@ -0,0 +1,11 @@ +error[E0506]: cannot assign to `*y.pointer` because it is borrowed + --> $DIR/borrowck-assign-to-andmut-in-borrowed-loc.rs:28:9 + | +LL | let z = copy_borrowed_ptr(&mut y); + | - borrow of `*y.pointer` occurs here +LL | *y.pointer += 1; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.ast.nll.stderr new file mode 100644 index 00000000000..861fe2f2c50 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.ast.nll.stderr @@ -0,0 +1,9 @@ +error[E0594]: cannot assign to immutable static item `foo` + --> $DIR/borrowck-assign-to-constants.rs:18:5 + | +LL | foo = 6; //[ast]~ ERROR cannot assign to immutable static item + | ^^^^^^^ cannot assign + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.ast.stderr new file mode 100644 index 00000000000..09ddf8387ce --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.ast.stderr @@ -0,0 +1,9 @@ +error[E0594]: cannot assign to immutable static item + --> $DIR/borrowck-assign-to-constants.rs:18:5 + | +LL | foo = 6; //[ast]~ ERROR cannot assign to immutable static item + | ^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.mir.stderr new file mode 100644 index 00000000000..861fe2f2c50 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.mir.stderr @@ -0,0 +1,9 @@ +error[E0594]: cannot assign to immutable static item `foo` + --> $DIR/borrowck-assign-to-constants.rs:18:5 + | +LL | foo = 6; //[ast]~ ERROR cannot assign to immutable static item + | ^^^^^^^ cannot assign + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/borrowck/borrowck-assign-to-constants.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.rs index 57002dd40fc..57002dd40fc 100644 --- a/src/test/compile-fail/borrowck/borrowck-assign-to-constants.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-assign-to-constants.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-auto-mut-ref-to-immut-var.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-auto-mut-ref-to-immut-var.nll.stderr new file mode 100644 index 00000000000..b41d5cd3623 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-auto-mut-ref-to-immut-var.nll.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/borrowck-auto-mut-ref-to-immut-var.rs:25:5 + | +LL | let x = Foo { x: 3 }; + | - help: consider changing this to be mutable: `mut x` +LL | x.printme(); //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-auto-mut-ref-to-immut-var.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-auto-mut-ref-to-immut-var.rs index ea020dc0685..ea020dc0685 100644 --- a/src/test/compile-fail/borrowck/borrowck-auto-mut-ref-to-immut-var.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-auto-mut-ref-to-immut-var.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr new file mode 100644 index 00000000000..ca6b86e5ca6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow immutable local variable `x` as mutable + --> $DIR/borrowck-auto-mut-ref-to-immut-var.rs:25:5 + | +LL | let x = Foo { x: 3 }; + | - consider changing this to `mut x` +LL | x.printme(); //~ ERROR cannot borrow + | ^ cannot borrow mutably + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-autoref-3261.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-autoref-3261.nll.stderr new file mode 100644 index 00000000000..eb26676cde2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-autoref-3261.nll.stderr @@ -0,0 +1,22 @@ +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-autoref-3261.rs:25:9 + | +LL | (&mut x).with( + | -------- + | | + | _____first mutable borrow occurs here + | | +LL | | |opt| { //~ ERROR cannot borrow `x` as mutable more than once at a time + | | ^^^^^ second mutable borrow occurs here +LL | | match opt { +LL | | &Either::Right(ref f) => { +LL | | x = X(Either::Left((0, 0))); + | | - second borrow occurs due to use of `x` in closure +... | +LL | | } +LL | | }) + | |__________- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-autoref-3261.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-autoref-3261.rs index d5f09305808..d5f09305808 100644 --- a/src/test/compile-fail/borrowck/borrowck-autoref-3261.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-autoref-3261.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-autoref-3261.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-autoref-3261.stderr new file mode 100644 index 00000000000..c9e649dee0c --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-autoref-3261.stderr @@ -0,0 +1,17 @@ +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-autoref-3261.rs:25:9 + | +LL | (&mut x).with( + | - first mutable borrow occurs here +LL | |opt| { //~ ERROR cannot borrow `x` as mutable more than once at a time + | ^^^^^ second mutable borrow occurs here +... +LL | x = X(Either::Left((0, 0))); + | - borrow occurs due to use of `x` in closure +... +LL | }) + | - first borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-free.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-free.nll.stderr new file mode 100644 index 00000000000..73f533a6b96 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-free.nll.stderr @@ -0,0 +1,25 @@ +error[E0502]: cannot borrow `a` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-bad-nested-calls-free.rs:35:17 + | +LL | / add( +LL | | &*a, + | | --- immutable borrow occurs here +LL | | rewrite(&mut a)); //~ ERROR cannot borrow + | |_________________^^^^^^_- borrow later used here + | | + | mutable borrow occurs here + +error[E0502]: cannot borrow `a` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-bad-nested-calls-free.rs:42:17 + | +LL | / add( +LL | | &*a, + | | --- immutable borrow occurs here +LL | | rewrite(&mut a)); //~ ERROR cannot borrow + | |_________________^^^^^^_- borrow later used here + | | + | mutable borrow occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-bad-nested-calls-free.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-free.rs index 7913f9ac903..7913f9ac903 100644 --- a/src/test/compile-fail/borrowck/borrowck-bad-nested-calls-free.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-free.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-free.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-free.stderr new file mode 100644 index 00000000000..461d2fec589 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-free.stderr @@ -0,0 +1,23 @@ +error[E0502]: cannot borrow `a` as mutable because `*a` is also borrowed as immutable + --> $DIR/borrowck-bad-nested-calls-free.rs:35:22 + | +LL | &*a, + | -- immutable borrow occurs here +LL | rewrite(&mut a)); //~ ERROR cannot borrow + | ^ - immutable borrow ends here + | | + | mutable borrow occurs here + +error[E0502]: cannot borrow `a` as mutable because `*a` is also borrowed as immutable + --> $DIR/borrowck-bad-nested-calls-free.rs:42:22 + | +LL | &*a, + | -- immutable borrow occurs here +LL | rewrite(&mut a)); //~ ERROR cannot borrow + | ^ - immutable borrow ends here + | | + | mutable borrow occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-move.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-move.nll.stderr new file mode 100644 index 00000000000..ecb70068fed --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-move.nll.stderr @@ -0,0 +1,25 @@ +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/borrowck-bad-nested-calls-move.rs:35:9 + | +LL | / add( +LL | | &*a, + | | --- borrow of `*a` occurs here +LL | | a); //~ ERROR cannot move + | |_________^- borrow later used here + | | + | move out of `a` occurs here + +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/borrowck-bad-nested-calls-move.rs:42:9 + | +LL | / add( +LL | | &*a, + | | --- borrow of `*a` occurs here +LL | | a); //~ ERROR cannot move + | |_________^- borrow later used here + | | + | move out of `a` occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/borrowck/borrowck-bad-nested-calls-move.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-move.rs index e24d4e87add..e24d4e87add 100644 --- a/src/test/compile-fail/borrowck/borrowck-bad-nested-calls-move.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-move.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-move.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-move.stderr new file mode 100644 index 00000000000..7ed1f2c6583 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-bad-nested-calls-move.stderr @@ -0,0 +1,19 @@ +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/borrowck-bad-nested-calls-move.rs:35:9 + | +LL | &*a, + | -- borrow of `*a` occurs here +LL | a); //~ ERROR cannot move + | ^ move out of `a` occurs here + +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/borrowck-bad-nested-calls-move.rs:42:9 + | +LL | &*a, + | -- borrow of `*a` occurs here +LL | a); //~ ERROR cannot move + | ^ move out of `a` occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-block-unint.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-block-unint.nll.stderr new file mode 100644 index 00000000000..f3246c12bd9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-block-unint.nll.stderr @@ -0,0 +1,11 @@ +error[E0381]: borrow of possibly uninitialized variable: `x` + --> $DIR/borrowck-block-unint.rs:14:11 + | +LL | force(|| { //~ ERROR capture of possibly uninitialized variable: `x` + | ^^ use of possibly uninitialized `x` +LL | println!("{}", x); + | - borrow occurs due to use in closure + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-block-unint.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-block-unint.rs index a09ee439245..a09ee439245 100644 --- a/src/test/compile-fail/borrowck/borrowck-block-unint.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-block-unint.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-block-unint.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-block-unint.stderr new file mode 100644 index 00000000000..53aa8919fd8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-block-unint.stderr @@ -0,0 +1,9 @@ +error[E0381]: capture of possibly uninitialized variable: `x` + --> $DIR/borrowck-block-unint.rs:14:11 + | +LL | force(|| { //~ ERROR capture of possibly uninitialized variable: `x` + | ^^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-owned-ptr.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-owned-ptr.nll.stderr new file mode 100644 index 00000000000..08d66eb0344 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-owned-ptr.nll.stderr @@ -0,0 +1,127 @@ +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:29:17 + | +LL | let bar1 = &mut foo.bar1; + | ------------- first mutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ second mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo.bar1` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:36:17 + | +LL | let bar1 = &mut foo.bar1; + | ------------- mutable borrow occurs here +LL | let _bar2 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^ immutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo.bar1` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:43:17 + | +LL | let bar1 = &foo.bar1; + | --------- immutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `*foo` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:72:11 + | +LL | let bar1 = &mut foo.bar1; + | ------------- mutable borrow occurs here +LL | match *foo { + | ^^^^ immutable borrow occurs here +... +LL | *bar1; + | ----- borrow later used here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:73:21 + | +LL | let bar1 = &mut foo.bar1; + | ------------- first mutable borrow occurs here +LL | match *foo { +LL | Foo { bar1: ref mut _bar1, bar2: _ } => {} + | ^^^^^^^^^^^^^ second mutable borrow occurs here +... +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo.bar1` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:82:17 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------------ mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^ immutable borrow occurs here +LL | let _foo2 = &*foo; //~ ERROR cannot borrow +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `*foo` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:83:17 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------------ mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow +LL | let _foo2 = &*foo; //~ ERROR cannot borrow + | ^^^^^ immutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:90:17 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------------ first mutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ second mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0499]: cannot borrow `*foo` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:97:17 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------------ first mutable borrow occurs here +LL | let _foo2 = &mut *foo; //~ ERROR cannot borrow + | ^^^^^^^^^ second mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo.bar1` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:104:17 + | +LL | let bar1 = &foo.bar1.int1; + | -------------- immutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `*foo` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:111:17 + | +LL | let bar1 = &foo.bar1.int1; + | -------------- immutable borrow occurs here +LL | let _foo2 = &mut *foo; //~ ERROR cannot borrow + | ^^^^^^^^^ mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0596]: cannot borrow `foo.bar1` as mutable, as `foo` is not declared as mutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:132:16 + | +LL | let foo = make_foo(); + | --- help: consider changing this to be mutable: `mut foo` +LL | let bar1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ cannot borrow as mutable + +error: aborting due to 12 previous errors + +Some errors occurred: E0499, E0502, E0596. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrow-from-owned-ptr.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-owned-ptr.rs index e5091a92581..e5091a92581 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrow-from-owned-ptr.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-owned-ptr.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-owned-ptr.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-owned-ptr.stderr new file mode 100644 index 00000000000..9fc030f604c --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-owned-ptr.stderr @@ -0,0 +1,168 @@ +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:29:22 + | +LL | let bar1 = &mut foo.bar1; + | -------- first mutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ second mutable borrow occurs here +LL | *bar1; +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:36:18 + | +LL | let bar1 = &mut foo.bar1; + | -------- mutable borrow occurs here +LL | let _bar2 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ immutable borrow occurs here +LL | *bar1; +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:43:22 + | +LL | let bar1 = &foo.bar1; + | -------- immutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ mutable borrow occurs here +LL | *bar1; +LL | } + | - immutable borrow ends here + +error[E0499]: cannot borrow `foo` (via `foo.bar2`) as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:57:22 + | +LL | let bar1 = &mut foo.bar1; + | -------- first mutable borrow occurs here (via `foo.bar1`) +LL | let _bar2 = &mut foo.bar2; //~ ERROR cannot borrow + | ^^^^^^^^ second mutable borrow occurs here (via `foo.bar2`) +LL | *bar1; +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `foo` (via `foo.bar2`) as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:64:42 + | +LL | Foo { bar1: ref mut _bar1, bar2: ref mut _bar2 } => {} + | ------------- ^^^^^^^^^^^^^ second mutable borrow occurs here (via `foo.bar2`) + | | + | first mutable borrow occurs here (via `foo.bar1`) +LL | //~^ ERROR cannot borrow +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:73:21 + | +LL | let bar1 = &mut foo.bar1; + | -------- first mutable borrow occurs here +LL | match *foo { +LL | Foo { bar1: ref mut _bar1, bar2: _ } => {} + | ^^^^^^^^^^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as immutable because `foo.bar1.int1` is also borrowed as mutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:82:18 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------- mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `*foo` as immutable because `foo.bar1.int1` is also borrowed as mutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:83:18 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------- mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow +LL | let _foo2 = &*foo; //~ ERROR cannot borrow + | ^^^^ immutable borrow occurs here +LL | *bar1; +LL | } + | - mutable borrow ends here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:90:22 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------- first mutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ second mutable borrow occurs here +LL | *bar1; +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `*foo` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:97:22 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------- first mutable borrow occurs here +LL | let _foo2 = &mut *foo; //~ ERROR cannot borrow + | ^^^^ second mutable borrow occurs here +LL | *bar1; +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as mutable because `foo.bar1.int1` is also borrowed as immutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:104:22 + | +LL | let bar1 = &foo.bar1.int1; + | ------------- immutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ mutable borrow occurs here +LL | *bar1; +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `*foo` as mutable because `foo.bar1.int1` is also borrowed as immutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:111:22 + | +LL | let bar1 = &foo.bar1.int1; + | ------------- immutable borrow occurs here +LL | let _foo2 = &mut *foo; //~ ERROR cannot borrow + | ^^^^ mutable borrow occurs here +LL | *bar1; +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `foo` (via `foo.bar2`) as immutable because `foo` is also borrowed as mutable (via `foo.bar1`) + --> $DIR/borrowck-borrow-from-owned-ptr.rs:126:18 + | +LL | let bar1 = &mut foo.bar1; + | -------- mutable borrow occurs here (via `foo.bar1`) +LL | let _foo1 = &foo.bar2; //~ ERROR cannot borrow + | ^^^^^^^^ immutable borrow occurs here (via `foo.bar2`) +LL | *bar1; +LL | } + | - mutable borrow ends here + +error[E0596]: cannot borrow field `foo.bar1` of immutable binding as mutable + --> $DIR/borrowck-borrow-from-owned-ptr.rs:132:21 + | +LL | let foo = make_foo(); + | --- consider changing this to `mut foo` +LL | let bar1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ cannot mutably borrow field of immutable binding + +error[E0499]: cannot borrow `foo` (via `foo.bar2.int2`) as mutable more than once at a time + --> $DIR/borrowck-borrow-from-owned-ptr.rs:139:21 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------- first mutable borrow occurs here (via `foo.bar1.int1`) +LL | let foo1 = &mut foo.bar2.int2; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ second mutable borrow occurs here (via `foo.bar2.int2`) +... +LL | } + | - first borrow ends here + +error: aborting due to 15 previous errors + +Some errors occurred: E0499, E0502, E0596. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-stack-variable.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-stack-variable.nll.stderr new file mode 100644 index 00000000000..8d1b9ca672a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-stack-variable.nll.stderr @@ -0,0 +1,127 @@ +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-stack-variable.rs:28:17 + | +LL | let bar1 = &mut foo.bar1; + | ------------- first mutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ second mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo.bar1` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:35:17 + | +LL | let bar1 = &mut foo.bar1; + | ------------- mutable borrow occurs here +LL | let _bar2 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^ immutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo.bar1` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:42:17 + | +LL | let bar1 = &foo.bar1; + | --------- immutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:70:11 + | +LL | let bar1 = &mut foo.bar1; + | ------------- mutable borrow occurs here +LL | match foo { + | ^^^ immutable borrow occurs here +... +LL | *bar1; + | ----- borrow later used here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-stack-variable.rs:71:21 + | +LL | let bar1 = &mut foo.bar1; + | ------------- first mutable borrow occurs here +LL | match foo { +LL | Foo { bar1: ref mut _bar1, bar2: _ } => {} // + | ^^^^^^^^^^^^^ second mutable borrow occurs here +... +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo.bar1` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:80:17 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------------ mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^ immutable borrow occurs here +LL | let _foo2 = &foo; //~ ERROR cannot borrow +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:81:17 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------------ mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow +LL | let _foo2 = &foo; //~ ERROR cannot borrow + | ^^^^ immutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-stack-variable.rs:88:17 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------------ first mutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ second mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0499]: cannot borrow `foo` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-stack-variable.rs:95:17 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------------ first mutable borrow occurs here +LL | let _foo2 = &mut foo; //~ ERROR cannot borrow + | ^^^^^^^^ second mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo.bar1` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:102:17 + | +LL | let bar1 = &foo.bar1.int1; + | -------------- immutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0502]: cannot borrow `foo` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:109:17 + | +LL | let bar1 = &foo.bar1.int1; + | -------------- immutable borrow occurs here +LL | let _foo2 = &mut foo; //~ ERROR cannot borrow + | ^^^^^^^^ mutable borrow occurs here +LL | *bar1; + | ----- borrow later used here + +error[E0596]: cannot borrow `foo.bar1` as mutable, as `foo` is not declared as mutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:130:16 + | +LL | let foo = make_foo(); + | --- help: consider changing this to be mutable: `mut foo` +LL | let bar1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ cannot borrow as mutable + +error: aborting due to 12 previous errors + +Some errors occurred: E0499, E0502, E0596. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrow-from-stack-variable.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-stack-variable.rs index 440be93dfdc..440be93dfdc 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrow-from-stack-variable.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-stack-variable.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-stack-variable.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-stack-variable.stderr new file mode 100644 index 00000000000..cd0d6aa4ca3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-stack-variable.stderr @@ -0,0 +1,124 @@ +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-stack-variable.rs:28:22 + | +LL | let bar1 = &mut foo.bar1; + | -------- first mutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ second mutable borrow occurs here +LL | *bar1; +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:35:18 + | +LL | let bar1 = &mut foo.bar1; + | -------- mutable borrow occurs here +LL | let _bar2 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ immutable borrow occurs here +LL | *bar1; +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:42:22 + | +LL | let bar1 = &foo.bar1; + | -------- immutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ mutable borrow occurs here +LL | *bar1; +LL | } + | - immutable borrow ends here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-stack-variable.rs:71:21 + | +LL | let bar1 = &mut foo.bar1; + | -------- first mutable borrow occurs here +LL | match foo { +LL | Foo { bar1: ref mut _bar1, bar2: _ } => {} // + | ^^^^^^^^^^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as immutable because `foo.bar1.int1` is also borrowed as mutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:80:18 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------- mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `foo` as immutable because `foo.bar1.int1` is also borrowed as mutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:81:18 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------- mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow +LL | let _foo2 = &foo; //~ ERROR cannot borrow + | ^^^ immutable borrow occurs here +LL | *bar1; +LL | } + | - mutable borrow ends here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-stack-variable.rs:88:22 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------- first mutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ second mutable borrow occurs here +LL | *bar1; +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `foo` as mutable more than once at a time + --> $DIR/borrowck-borrow-from-stack-variable.rs:95:22 + | +LL | let bar1 = &mut foo.bar1.int1; + | ------------- first mutable borrow occurs here +LL | let _foo2 = &mut foo; //~ ERROR cannot borrow + | ^^^ second mutable borrow occurs here +LL | *bar1; +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as mutable because `foo.bar1.int1` is also borrowed as immutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:102:22 + | +LL | let bar1 = &foo.bar1.int1; + | ------------- immutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ mutable borrow occurs here +LL | *bar1; +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `foo` as mutable because `foo.bar1.int1` is also borrowed as immutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:109:22 + | +LL | let bar1 = &foo.bar1.int1; + | ------------- immutable borrow occurs here +LL | let _foo2 = &mut foo; //~ ERROR cannot borrow + | ^^^ mutable borrow occurs here +LL | *bar1; +LL | } + | - immutable borrow ends here + +error[E0596]: cannot borrow field `foo.bar1` of immutable binding as mutable + --> $DIR/borrowck-borrow-from-stack-variable.rs:130:21 + | +LL | let foo = make_foo(); + | --- consider changing this to `mut foo` +LL | let bar1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ cannot mutably borrow field of immutable binding + +error: aborting due to 11 previous errors + +Some errors occurred: E0499, E0502, E0596. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrow-from-temporary.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-temporary.rs index f7514df800d..f7514df800d 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrow-from-temporary.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-temporary.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-temporary.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-temporary.stderr new file mode 100644 index 00000000000..7dcfb3e3c87 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-from-temporary.stderr @@ -0,0 +1,18 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/borrowck-borrow-from-temporary.rs:19:24 + | +LL | let &Foo(ref x) = &id(Foo(3)); //~ ERROR borrowed value does not live long enough + | ^^^^^^^^^^ temporary value does not live long enough +LL | x +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 18:8... + --> $DIR/borrowck-borrow-from-temporary.rs:18:8 + | +LL | fn foo<'a>() -> &'a isize { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.nll.stderr new file mode 100644 index 00000000000..c2b7d790eea --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.nll.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `*a` as mutable, as `a` is not declared as mutable + --> $DIR/borrowck-borrow-immut-deref-of-box-as-mut.rs:22:5 + | +LL | let a: Box<_> = box A; + | - help: consider changing this to be mutable: `mut a` +LL | a.foo(); + | ^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs index 3662e23a412..3662e23a412 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr new file mode 100644 index 00000000000..d852125a775 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow immutable `Box` content `*a` as mutable + --> $DIR/borrowck-borrow-immut-deref-of-box-as-mut.rs:22:5 + | +LL | let a: Box<_> = box A; + | - consider changing this to `mut a` +LL | a.foo(); + | ^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.nll.stderr new file mode 100644 index 00000000000..8c30e6ac002 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.nll.stderr @@ -0,0 +1,31 @@ +error[E0594]: cannot assign to `**t1` which is behind a `&` reference + --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:19:5 + | +LL | let t1 = t0; + | -- help: consider changing this to be a mutable reference: `&mut &mut isize` +LL | let p: &isize = &**t0; +LL | **t1 = 22; //~ ERROR cannot assign + | ^^^^^^^^^ `t1` is a `&` reference, so the data it refers to cannot be written + +error[E0502]: cannot borrow `**t0` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:24:21 + | +LL | let t1 = &mut *t0; + | -------- mutable borrow occurs here +LL | let p: &isize = &**t0; //~ ERROR cannot borrow + | ^^^^^ immutable borrow occurs here +LL | **t1 = 22; + | --------- borrow later used here + +error[E0596]: cannot borrow `**t0` as mutable, as it is behind a `&` reference + --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:29:26 + | +LL | fn foo4(t0: & &mut isize) { + | ------------ help: consider changing this to be a mutable reference: `&mut &mut isize` +LL | let x: &mut isize = &mut **t0; //~ ERROR cannot borrow + | ^^^^^^^^^ `t0` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error: aborting due to 3 previous errors + +Some errors occurred: E0502, E0594, E0596. +For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs index d60751eddc7..d60751eddc7 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr new file mode 100644 index 00000000000..f90ffa8c35a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr @@ -0,0 +1,29 @@ +error[E0389]: cannot assign to data in a `&` reference + --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:19:5 + | +LL | **t1 = 22; //~ ERROR cannot assign + | ^^^^^^^^^ assignment into an immutable reference + +error[E0502]: cannot borrow `**t0` as immutable because `*t0` is also borrowed as mutable + --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:24:22 + | +LL | let t1 = &mut *t0; + | --- mutable borrow occurs here +LL | let p: &isize = &**t0; //~ ERROR cannot borrow + | ^^^^ immutable borrow occurs here +LL | **t1 = 22; +LL | } + | - mutable borrow ends here + +error[E0389]: cannot borrow data mutably in a `&` reference + --> $DIR/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs:29:31 + | +LL | fn foo4(t0: & &mut isize) { + | ------------ use `&mut &mut isize` here to make mutable +LL | let x: &mut isize = &mut **t0; //~ ERROR cannot borrow + | ^^^^ assignment into an immutable reference + +error: aborting due to 3 previous errors + +Some errors occurred: E0389, E0502. +For more information about an error, try `rustc --explain E0389`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrow-mut-object-twice.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-object-twice.rs index 7175194355b..7175194355b 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrow-mut-object-twice.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-object-twice.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-object-twice.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-object-twice.stderr new file mode 100644 index 00000000000..1812420e444 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-mut-object-twice.stderr @@ -0,0 +1,13 @@ +error[E0499]: cannot borrow `*x` as mutable more than once at a time + --> $DIR/borrowck-borrow-mut-object-twice.rs:21:5 + | +LL | let _y = x.f1(); + | - first mutable borrow occurs here +LL | x.f2(); //~ ERROR cannot borrow `*x` as mutable + | ^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-auto-deref.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-auto-deref.nll.stderr new file mode 100644 index 00000000000..522cdfd94d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-auto-deref.nll.stderr @@ -0,0 +1,88 @@ +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:57:19 + | +LL | let __isize = &mut x.y; //~ ERROR cannot borrow + | ^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:61:19 + | +LL | let __isize = &mut x.y; //~ ERROR cannot borrow + | ^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:69:5 + | +LL | &mut x.y //~ ERROR cannot borrow + | ^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:73:5 + | +LL | &mut x.y //~ ERROR cannot borrow + | ^^^^^^^^ cannot borrow as mutable + +error[E0594]: cannot assign to data in a `&` reference + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:77:5 + | +LL | x.y = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot assign + +error[E0594]: cannot assign to data in a `&` reference + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:81:5 + | +LL | x.y = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot assign + +error[E0594]: cannot assign to data in a `&` reference + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:85:5 + | +LL | x.y = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot assign + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:93:5 + | +LL | x.set(0, 0); //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:97:5 + | +LL | x.set(0, 0); //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:105:5 + | +LL | x.y_mut() //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:109:5 + | +LL | x.y_mut() //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:113:6 + | +LL | *x.y_mut() = 3; //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:117:6 + | +LL | *x.y_mut() = 3; //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:121:6 + | +LL | *x.y_mut() = 3; //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error: aborting due to 14 previous errors + +Some errors occurred: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrow-overloaded-auto-deref.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-auto-deref.rs index 693ed29bd05..693ed29bd05 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrow-overloaded-auto-deref.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-auto-deref.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-auto-deref.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-auto-deref.stderr new file mode 100644 index 00000000000..31563fbaa1c --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-auto-deref.stderr @@ -0,0 +1,88 @@ +error[E0596]: cannot borrow field of immutable binding as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:57:24 + | +LL | let __isize = &mut x.y; //~ ERROR cannot borrow + | ^^^ cannot mutably borrow field of immutable binding + +error[E0596]: cannot borrow field of immutable binding as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:61:24 + | +LL | let __isize = &mut x.y; //~ ERROR cannot borrow + | ^^^ cannot mutably borrow field of immutable binding + +error[E0596]: cannot borrow field of immutable binding as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:69:10 + | +LL | &mut x.y //~ ERROR cannot borrow + | ^^^ cannot mutably borrow field of immutable binding + +error[E0596]: cannot borrow field of immutable binding as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:73:10 + | +LL | &mut x.y //~ ERROR cannot borrow + | ^^^ cannot mutably borrow field of immutable binding + +error[E0594]: cannot assign to field of immutable binding + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:77:5 + | +LL | x.y = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot mutably borrow field of immutable binding + +error[E0594]: cannot assign to field of immutable binding + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:81:5 + | +LL | x.y = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot mutably borrow field of immutable binding + +error[E0594]: cannot assign to field of immutable binding + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:85:5 + | +LL | x.y = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot mutably borrow field of immutable binding + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:93:5 + | +LL | x.set(0, 0); //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:97:5 + | +LL | x.set(0, 0); //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:105:5 + | +LL | x.y_mut() //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:109:5 + | +LL | x.y_mut() //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:113:6 + | +LL | *x.y_mut() = 3; //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:117:6 + | +LL | *x.y_mut() = 3; //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-auto-deref.rs:121:6 + | +LL | *x.y_mut() = 3; //~ ERROR cannot borrow + | ^ cannot borrow as mutable + +error: aborting due to 14 previous errors + +Some errors occurred: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-deref.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-deref.nll.stderr new file mode 100644 index 00000000000..1e8d81fe76e --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-deref.nll.stderr @@ -0,0 +1,46 @@ +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-deref.rs:33:19 + | +LL | let __isize = &mut *x; //~ ERROR cannot borrow + | ^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-deref.rs:37:19 + | +LL | let __isize = &mut *x; //~ ERROR cannot borrow + | ^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-deref.rs:45:5 + | +LL | &mut **x //~ ERROR cannot borrow + | ^^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/borrowck-borrow-overloaded-deref.rs:49:5 + | +LL | &mut **x //~ ERROR cannot borrow + | ^^^^^^^^ cannot borrow as mutable + +error[E0594]: cannot assign to data in a `&` reference + --> $DIR/borrowck-borrow-overloaded-deref.rs:53:5 + | +LL | *x = 3; //~ ERROR cannot assign + | ^^^^^^ cannot assign + +error[E0594]: cannot assign to data in a `&` reference + --> $DIR/borrowck-borrow-overloaded-deref.rs:57:5 + | +LL | **x = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot assign + +error[E0594]: cannot assign to data in a `&` reference + --> $DIR/borrowck-borrow-overloaded-deref.rs:61:5 + | +LL | **x = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot assign + +error: aborting due to 7 previous errors + +Some errors occurred: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrow-overloaded-deref.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-deref.rs index 5b916243b9e..5b916243b9e 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrow-overloaded-deref.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-deref.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-deref.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-deref.stderr new file mode 100644 index 00000000000..641f943b6ce --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrow-overloaded-deref.stderr @@ -0,0 +1,46 @@ +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-deref.rs:33:24 + | +LL | let __isize = &mut *x; //~ ERROR cannot borrow + | ^^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-deref.rs:37:24 + | +LL | let __isize = &mut *x; //~ ERROR cannot borrow + | ^^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-deref.rs:45:10 + | +LL | &mut **x //~ ERROR cannot borrow + | ^^^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/borrowck-borrow-overloaded-deref.rs:49:10 + | +LL | &mut **x //~ ERROR cannot borrow + | ^^^ cannot borrow as mutable + +error[E0594]: cannot assign to immutable borrowed content + --> $DIR/borrowck-borrow-overloaded-deref.rs:53:5 + | +LL | *x = 3; //~ ERROR cannot assign + | ^^^^^^ cannot borrow as mutable + +error[E0594]: cannot assign to immutable borrowed content + --> $DIR/borrowck-borrow-overloaded-deref.rs:57:5 + | +LL | **x = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot borrow as mutable + +error[E0594]: cannot assign to immutable borrowed content + --> $DIR/borrowck-borrow-overloaded-deref.rs:61:5 + | +LL | **x = 3; //~ ERROR cannot assign + | ^^^^^^^ cannot borrow as mutable + +error: aborting due to 7 previous errors + +Some errors occurred: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr new file mode 100644 index 00000000000..8f42fb45627 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr @@ -0,0 +1,15 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/borrowck-borrowed-uniq-rvalue-2.rs:32:20 + | +LL | let x = defer(&vec!["Goodbye", "world!"]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ - temporary value only lives until here + | | + | temporary value does not live long enough +LL | x.x[0]; + | ------ borrow later used here + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrowed-uniq-rvalue-2.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue-2.rs index 9178aadeeeb..9178aadeeeb 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrowed-uniq-rvalue-2.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue-2.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr new file mode 100644 index 00000000000..890b2894943 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr @@ -0,0 +1,17 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/borrowck-borrowed-uniq-rvalue-2.rs:32:20 + | +LL | let x = defer(&vec!["Goodbye", "world!"]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +LL | x.x[0]; +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr new file mode 100644 index 00000000000..04f74af4114 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr @@ -0,0 +1,14 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/borrowck-borrowed-uniq-rvalue.rs:20:28 + | +LL | buggy_map.insert(42, &*Box::new(1)); //~ ERROR borrowed value does not live long enough + | ^^^^^^^^^^^ - temporary value only lives until here + | | + | temporary value does not live long enough +... +LL | buggy_map.insert(43, &*tmp); + | --------- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-borrowed-uniq-rvalue.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue.rs index f58eca7c8ae..f58eca7c8ae 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrowed-uniq-rvalue.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue.stderr new file mode 100644 index 00000000000..7defd1ee936 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-borrowed-uniq-rvalue.stderr @@ -0,0 +1,16 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/borrowck-borrowed-uniq-rvalue.rs:20:27 + | +LL | buggy_map.insert(42, &*Box::new(1)); //~ ERROR borrowed value does not live long enough + | ^^^^^^^^^^^^ - borrowed value dropped here while still borrowed + | | + | borrowed value does not live long enough +... +LL | } + | - borrowed value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit-2.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit-2.nll.stderr new file mode 100644 index 00000000000..8c961838ca4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit-2.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `x` + --> $DIR/borrowck-break-uninit-2.rs:19:20 + | +LL | println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-break-uninit-2.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit-2.rs index 82a6c92abaf..82a6c92abaf 100644 --- a/src/test/compile-fail/borrowck/borrowck-break-uninit-2.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit-2.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit-2.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit-2.stderr new file mode 100644 index 00000000000..4d7d1a0ed22 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit-2.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-break-uninit-2.rs:19:20 + | +LL | println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit.nll.stderr new file mode 100644 index 00000000000..4441c727539 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `x` + --> $DIR/borrowck-break-uninit.rs:19:20 + | +LL | println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-break-uninit.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit.rs index 8a6a036945b..8a6a036945b 100644 --- a/src/test/compile-fail/borrowck/borrowck-break-uninit.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit.stderr new file mode 100644 index 00000000000..9d5a21319ab --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-break-uninit.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-break-uninit.rs:19:20 + | +LL | println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.ast.nll.stderr new file mode 100644 index 00000000000..f24d0ed046a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.ast.nll.stderr @@ -0,0 +1,116 @@ +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-mut-and-imm.rs:31:14 + | +LL | let c1 = || x = 4; + | -- - first borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` + | ^^ - second borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | drop(c1); + | -- borrow later used here + +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-mut-and-imm.rs:39:14 + | +LL | let c1 = || set(&mut x); + | -- - first borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | let c2 = || get(&x); //[ast]~ ERROR cannot borrow `x` + | ^^ - second borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | drop(c1); + | -- borrow later used here + +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-mut-and-imm.rs:47:14 + | +LL | let c1 = || set(&mut x); + | -- - first borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` + | ^^ - second borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | drop(c1); + | -- borrow later used here + +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:55:5 + | +LL | let c2 = || x * 5; + | -- - borrow occurs due to use in closure + | | + | borrow of `x` occurs here +LL | x = 5; //[ast]~ ERROR cannot assign + | ^^^^^ assignment to borrowed `x` occurs here +LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | drop(c2); + | -- borrow later used here + +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:63:5 + | +LL | let c1 = || get(&x); + | -- - borrow occurs due to use in closure + | | + | borrow of `x` occurs here +LL | x = 5; //[ast]~ ERROR cannot assign + | ^^^^^ assignment to borrowed `x` occurs here +LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | drop(c1); + | -- borrow later used here + +error[E0506]: cannot assign to `*x` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:71:5 + | +LL | let c1 = || get(&*x); + | -- - borrow occurs due to use in closure + | | + | borrow of `*x` occurs here +LL | *x = 5; //[ast]~ ERROR cannot assign to `*x` + | ^^^^^^ assignment to borrowed `*x` occurs here +LL | //[mir]~^ ERROR cannot assign to `*x` because it is borrowed +LL | drop(c1); + | -- borrow later used here + +error[E0506]: cannot assign to `*x.f` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:83:5 + | +LL | let c1 = || get(&*x.f); + | -- - borrow occurs due to use in closure + | | + | borrow of `*x.f` occurs here +LL | *x.f = 5; //[ast]~ ERROR cannot assign to `*x.f` + | ^^^^^^^^ assignment to borrowed `*x.f` occurs here +LL | //[mir]~^ ERROR cannot assign to `*x.f` because it is borrowed +LL | drop(c1); + | -- borrow later used here + +error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-closures-mut-and-imm.rs:95:14 + | +LL | let c1 = || get(&*x.f); + | -- - first borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +LL | let c2 = || *x.f = 5; //[ast]~ ERROR cannot borrow `x` as mutable + | ^^ - second borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable +LL | drop(c1); + | -- borrow later used here + +error: aborting due to 8 previous errors + +Some errors occurred: E0502, E0506. +For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.ast.stderr new file mode 100644 index 00000000000..628fbbd1901 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.ast.stderr @@ -0,0 +1,96 @@ +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-mut-and-imm.rs:31:14 + | +LL | let c1 = || x = 4; + | -- - previous borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` + | ^^ - borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-mut-and-imm.rs:39:14 + | +LL | let c1 = || set(&mut x); + | -- - previous borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | let c2 = || get(&x); //[ast]~ ERROR cannot borrow `x` + | ^^ - borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-mut-and-imm.rs:47:14 + | +LL | let c1 = || set(&mut x); + | -- - previous borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` + | ^^ - borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:55:5 + | +LL | let c2 = || x * 5; + | -- borrow of `x` occurs here +LL | x = 5; //[ast]~ ERROR cannot assign + | ^^^^^ assignment to borrowed `x` occurs here + +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:63:5 + | +LL | let c1 = || get(&x); + | -- borrow of `x` occurs here +LL | x = 5; //[ast]~ ERROR cannot assign + | ^^^^^ assignment to borrowed `x` occurs here + +error[E0506]: cannot assign to `*x` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:71:5 + | +LL | let c1 = || get(&*x); + | -- borrow of `*x` occurs here +LL | *x = 5; //[ast]~ ERROR cannot assign to `*x` + | ^^^^^^ assignment to borrowed `*x` occurs here + +error[E0506]: cannot assign to `*x.f` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:83:5 + | +LL | let c1 = || get(&*x.f); + | -- borrow of `*x.f` occurs here +LL | *x.f = 5; //[ast]~ ERROR cannot assign to `*x.f` + | ^^^^^^^^ assignment to borrowed `*x.f` occurs here + +error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-closures-mut-and-imm.rs:95:14 + | +LL | let c1 = || get(&*x.f); + | -- - previous borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +LL | let c2 = || *x.f = 5; //[ast]~ ERROR cannot borrow `x` as mutable + | ^^ - borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error: aborting due to 8 previous errors + +Some errors occurred: E0502, E0506. +For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.mir.stderr new file mode 100644 index 00000000000..f24d0ed046a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.mir.stderr @@ -0,0 +1,116 @@ +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-mut-and-imm.rs:31:14 + | +LL | let c1 = || x = 4; + | -- - first borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` + | ^^ - second borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | drop(c1); + | -- borrow later used here + +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-mut-and-imm.rs:39:14 + | +LL | let c1 = || set(&mut x); + | -- - first borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | let c2 = || get(&x); //[ast]~ ERROR cannot borrow `x` + | ^^ - second borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | drop(c1); + | -- borrow later used here + +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-mut-and-imm.rs:47:14 + | +LL | let c1 = || set(&mut x); + | -- - first borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | let c2 = || x * 5; //[ast]~ ERROR cannot borrow `x` + | ^^ - second borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | drop(c1); + | -- borrow later used here + +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:55:5 + | +LL | let c2 = || x * 5; + | -- - borrow occurs due to use in closure + | | + | borrow of `x` occurs here +LL | x = 5; //[ast]~ ERROR cannot assign + | ^^^^^ assignment to borrowed `x` occurs here +LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | drop(c2); + | -- borrow later used here + +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:63:5 + | +LL | let c1 = || get(&x); + | -- - borrow occurs due to use in closure + | | + | borrow of `x` occurs here +LL | x = 5; //[ast]~ ERROR cannot assign + | ^^^^^ assignment to borrowed `x` occurs here +LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | drop(c1); + | -- borrow later used here + +error[E0506]: cannot assign to `*x` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:71:5 + | +LL | let c1 = || get(&*x); + | -- - borrow occurs due to use in closure + | | + | borrow of `*x` occurs here +LL | *x = 5; //[ast]~ ERROR cannot assign to `*x` + | ^^^^^^ assignment to borrowed `*x` occurs here +LL | //[mir]~^ ERROR cannot assign to `*x` because it is borrowed +LL | drop(c1); + | -- borrow later used here + +error[E0506]: cannot assign to `*x.f` because it is borrowed + --> $DIR/borrowck-closures-mut-and-imm.rs:83:5 + | +LL | let c1 = || get(&*x.f); + | -- - borrow occurs due to use in closure + | | + | borrow of `*x.f` occurs here +LL | *x.f = 5; //[ast]~ ERROR cannot assign to `*x.f` + | ^^^^^^^^ assignment to borrowed `*x.f` occurs here +LL | //[mir]~^ ERROR cannot assign to `*x.f` because it is borrowed +LL | drop(c1); + | -- borrow later used here + +error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-closures-mut-and-imm.rs:95:14 + | +LL | let c1 = || get(&*x.f); + | -- - first borrow occurs due to use of `x` in closure + | | + | immutable borrow occurs here +LL | let c2 = || *x.f = 5; //[ast]~ ERROR cannot borrow `x` as mutable + | ^^ - second borrow occurs due to use of `x` in closure + | | + | mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as mutable because it is also borrowed as immutable +LL | drop(c1); + | -- borrow later used here + +error: aborting due to 8 previous errors + +Some errors occurred: E0502, E0506. +For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-closures-mut-and-imm.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.rs index 9057ba07907..9057ba07907 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-mut-and-imm.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-and-imm.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-of-imm.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-of-imm.nll.stderr new file mode 100644 index 00000000000..e8fae63a5d6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-of-imm.nll.stderr @@ -0,0 +1,15 @@ +error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference + --> $DIR/borrowck-closures-mut-of-imm.rs:23:21 + | +LL | let c1 = || set(&mut *x); + | ^^^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference + --> $DIR/borrowck-closures-mut-of-imm.rs:25:21 + | +LL | let c2 = || set(&mut *x); + | ^^^^^^^ cannot borrow as mutable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-closures-mut-of-imm.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-of-imm.rs index dc2f0e8395f..dc2f0e8395f 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-mut-of-imm.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-of-imm.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-of-imm.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-of-imm.stderr new file mode 100644 index 00000000000..87eb52b6aa6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-mut-of-imm.stderr @@ -0,0 +1,32 @@ +error[E0524]: two closures require unique access to `x` at the same time + --> $DIR/borrowck-closures-mut-of-imm.rs:25:14 + | +LL | let c1 = || set(&mut *x); + | -- - previous borrow occurs due to use of `x` in closure + | | + | first closure is constructed here +LL | //~^ ERROR cannot borrow +LL | let c2 = || set(&mut *x); + | ^^ - borrow occurs due to use of `x` in closure + | | + | second closure is constructed here +... +LL | } + | - borrow from first closure ends here + +error[E0596]: cannot borrow immutable borrowed content `***x` as mutable + --> $DIR/borrowck-closures-mut-of-imm.rs:23:26 + | +LL | let c1 = || set(&mut *x); + | ^^ cannot borrow as mutable + +error[E0596]: cannot borrow immutable borrowed content `***x` as mutable + --> $DIR/borrowck-closures-mut-of-imm.rs:25:26 + | +LL | let c2 = || set(&mut *x); + | ^^ cannot borrow as mutable + +error: aborting due to 3 previous errors + +Some errors occurred: E0524, E0596. +For more information about an error, try `rustc --explain E0524`. diff --git a/src/test/compile-fail/borrowck/borrowck-closures-two-mut.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-two-mut.rs index 29546abe0bb..29546abe0bb 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-two-mut.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-two-mut.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-two-mut.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-two-mut.stderr new file mode 100644 index 00000000000..3b4e050ee25 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-two-mut.stderr @@ -0,0 +1,75 @@ +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:22:24 + | +LL | let c1 = to_fn_mut(|| x = 4); + | -- - previous borrow occurs due to use of `x` in closure + | | + | first mutable borrow occurs here +LL | let c2 = to_fn_mut(|| x = 5); //~ ERROR cannot borrow `x` as mutable more than once + | ^^ - borrow occurs due to use of `x` in closure + | | + | second mutable borrow occurs here +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:32:24 + | +LL | let c1 = to_fn_mut(|| set(&mut x)); + | -- - previous borrow occurs due to use of `x` in closure + | | + | first mutable borrow occurs here +LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once + | ^^ - borrow occurs due to use of `x` in closure + | | + | second mutable borrow occurs here +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:38:24 + | +LL | let c1 = to_fn_mut(|| x = 5); + | -- - previous borrow occurs due to use of `x` in closure + | | + | first mutable borrow occurs here +LL | let c2 = to_fn_mut(|| set(&mut x)); //~ ERROR cannot borrow `x` as mutable more than once + | ^^ - borrow occurs due to use of `x` in closure + | | + | second mutable borrow occurs here +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:44:24 + | +LL | let c1 = to_fn_mut(|| x = 5); + | -- - previous borrow occurs due to use of `x` in closure + | | + | first mutable borrow occurs here +LL | let c2 = to_fn_mut(|| { let _y = to_fn_mut(|| set(&mut x)); }); // (nested closure) + | ^^ - borrow occurs due to use of `x` in closure + | | + | second mutable borrow occurs here +LL | //~^ ERROR cannot borrow `x` as mutable more than once +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut.rs:55:24 + | +LL | let c1 = to_fn_mut(|| set(&mut *x.f)); + | -- - previous borrow occurs due to use of `x` in closure + | | + | first mutable borrow occurs here +LL | let c2 = to_fn_mut(|| set(&mut *x.f)); + | ^^ - borrow occurs due to use of `x` in closure + | | + | second mutable borrow occurs here +LL | //~^ ERROR cannot borrow `x` as mutable more than once +LL | } + | - first borrow ends here + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-closures-unique-imm.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique-imm.rs index 247a4fe89a5..247a4fe89a5 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-unique-imm.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique-imm.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique-imm.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique-imm.stderr new file mode 100644 index 00000000000..31b1a1bb0e8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique-imm.stderr @@ -0,0 +1,13 @@ +error[E0502]: cannot borrow `this.x` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-closures-unique-imm.rs:21:14 + | +LL | let p = &this.x; + | ------ immutable borrow occurs here +LL | &mut this.x; //~ ERROR cannot borrow + | ^^^^^^ mutable borrow occurs here +LL | }; + | - immutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-closures-unique.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique.rs index 1b22dc4d2c6..1b22dc4d2c6 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-unique.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique.stderr new file mode 100644 index 00000000000..8f213c16cff --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-unique.stderr @@ -0,0 +1,56 @@ +error[E0500]: closure requires unique access to `x` but it is already borrowed + --> $DIR/borrowck-closures-unique.rs:32:14 + | +LL | let c1 = || get(x); + | -- - previous borrow occurs due to use of `x` in closure + | | + | borrow occurs here +LL | let c2 = || set(x); //~ ERROR closure requires unique access to `x` + | ^^ - borrow occurs due to use of `x` in closure + | | + | closure construction occurs here +LL | } + | - borrow ends here + +error[E0500]: closure requires unique access to `x` but it is already borrowed + --> $DIR/borrowck-closures-unique.rs:37:14 + | +LL | let c1 = || get(x); + | -- - previous borrow occurs due to use of `x` in closure + | | + | borrow occurs here +LL | let c2 = || { get(x); set(x); }; //~ ERROR closure requires unique access to `x` + | ^^ - borrow occurs due to use of `x` in closure + | | + | closure construction occurs here +LL | } + | - borrow ends here + +error[E0524]: two closures require unique access to `x` at the same time + --> $DIR/borrowck-closures-unique.rs:42:14 + | +LL | let c1 = || set(x); + | -- - previous borrow occurs due to use of `x` in closure + | | + | first closure is constructed here +LL | let c2 = || set(x); //~ ERROR two closures require unique access to `x` at the same time + | ^^ - borrow occurs due to use of `x` in closure + | | + | second closure is constructed here +LL | } + | - borrow from first closure ends here + +error[E0595]: closure cannot assign to immutable argument `x` + --> $DIR/borrowck-closures-unique.rs:46:14 + | +LL | let c1 = || x = panic!(); //~ ERROR closure cannot assign to immutable argument + | ^^ cannot borrow mutably +help: consider removing the `&mut`, as it is an immutable binding to a mutable reference + | +LL | x //~ ERROR closure cannot assign to immutable argument + | ^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0500, E0524, E0595. +For more information about an error, try `rustc --explain E0500`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-use-after-free.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-use-after-free.nll.stderr new file mode 100644 index 00000000000..dc73929989c --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-use-after-free.nll.stderr @@ -0,0 +1,17 @@ +error[E0502]: cannot borrow `*ptr` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-closures-use-after-free.rs:32:8 + | +LL | let mut test = |foo: &Foo| { + | ----------- mutable borrow occurs here +LL | ptr = box Foo { x: ptr.x + 1 }; + | --- first borrow occurs due to use of `ptr` in closure +LL | }; +LL | test(&*ptr); //~ ERROR cannot borrow `*ptr` + | -----^^^^^- + | | | + | | immutable borrow occurs here + | borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-closures-use-after-free.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-use-after-free.rs index bb474342a7c..bb474342a7c 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-use-after-free.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-use-after-free.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-use-after-free.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-use-after-free.stderr new file mode 100644 index 00000000000..7beb31f3944 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-closures-use-after-free.stderr @@ -0,0 +1,16 @@ +error[E0502]: cannot borrow `*ptr` as immutable because `ptr` is also borrowed as mutable + --> $DIR/borrowck-closures-use-after-free.rs:32:9 + | +LL | let mut test = |foo: &Foo| { + | ----------- mutable borrow occurs here +LL | ptr = box Foo { x: ptr.x + 1 }; + | --- previous borrow occurs due to use of `ptr` in closure +LL | }; +LL | test(&*ptr); //~ ERROR cannot borrow `*ptr` + | ^^^^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-consume-unsize-vec.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-unsize-vec.rs index 32490e0dc7d..32490e0dc7d 100644 --- a/src/test/compile-fail/borrowck/borrowck-consume-unsize-vec.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-unsize-vec.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-unsize-vec.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-unsize-vec.stderr new file mode 100644 index 00000000000..8199ce70e2a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-unsize-vec.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `b` + --> $DIR/borrowck-consume-unsize-vec.rs:18:13 + | +LL | consume(b); + | - value moved here +LL | consume(b); //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `b` has type `std::boxed::Box<[i32; 5]>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-upcast-box.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-upcast-box.nll.stderr new file mode 100644 index 00000000000..b999e092847 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-upcast-box.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `b` + --> $DIR/borrowck-consume-upcast-box.rs:20:13 + | +LL | consume(b); + | - value moved here +LL | consume(b); //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `b` has type `std::boxed::Box<dyn Foo + std::marker::Send>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-consume-upcast-box.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-upcast-box.rs index 5bcafa675c7..5bcafa675c7 100644 --- a/src/test/compile-fail/borrowck/borrowck-consume-upcast-box.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-upcast-box.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-upcast-box.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-upcast-box.stderr new file mode 100644 index 00000000000..159933a6155 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-consume-upcast-box.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `b` + --> $DIR/borrowck-consume-upcast-box.rs:20:13 + | +LL | consume(b); + | - value moved here +LL | consume(b); //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `b` has type `std::boxed::Box<(dyn Foo + std::marker::Send + 'static)>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.ast.nll.stderr new file mode 100644 index 00000000000..34715e307fe --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.ast.nll.stderr @@ -0,0 +1,543 @@ +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-describe-lvalue.rs:295:13 + | +LL | let y = &mut x; + | ------ first mutable borrow occurs here +LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time + | ^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | *y = 1; + | ------ borrow later used here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-describe-lvalue.rs:307:20 + | +LL | let y = &mut x; + | ------ first mutable borrow occurs here +LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time + | ^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | *y = 1; + | ------ borrow later used here + +error: unsatisfied lifetime constraints + --> $DIR/borrowck-describe-lvalue.rs:305:16 + | +LL | || { + | ____________- + | |____________| + | || +LL | || || { //[mir]~ ERROR unsatisfied lifetime constraints + | ||________________^ +LL | ||| let y = &mut x; +LL | ||| &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time +LL | ||| //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | ||| *y = 1; +LL | ||| drop(y); +LL | ||| } + | |||_________________^ requires that `'1` must outlive `'2` +LL | || }; + | || - + | ||____________| + | |_____________lifetime `'1` represents the closure body + | lifetime `'2` appears in return type + +error[E0503]: cannot use `f.x` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:53:9 + | +LL | let x = f.x(); + | - borrow of `f` occurs here +LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed + | ^^^ use of borrowed `f` +LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `g.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:61:9 + | +LL | let x = g.x(); + | - borrow of `g` occurs here +LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed + | ^^^ use of borrowed `g` +LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `h.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:69:9 + | +LL | let x = &mut h.0; + | -------- borrow of `h.0` occurs here +LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed + | ^^^ use of borrowed `h.0` +LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:77:15 + | +LL | let x = e.x(); + | - borrow of `e` occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed + | ^ use of borrowed `e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:78:20 + | +LL | let x = e.x(); + | - borrow of `e` occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed +LL | Baz::X(value) => value + | ^^^^^ use of borrowed `e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `u.a` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:88:9 + | +LL | let x = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed + | ^^^ use of borrowed `u.a` +LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `f.x` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:96:9 + | +LL | let x = f.x(); + | - borrow of `*f` occurs here +LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed + | ^^^ use of borrowed `*f` +LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `g.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:104:9 + | +LL | let x = g.x(); + | - borrow of `*g` occurs here +LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed + | ^^^ use of borrowed `*g` +LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `h.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:112:9 + | +LL | let x = &mut h.0; + | -------- borrow of `h.0` occurs here +LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed + | ^^^ use of borrowed `h.0` +LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `*e` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:120:15 + | +LL | let x = e.x(); + | - borrow of `*e` occurs here +LL | match *e { //[mir]~ ERROR cannot use `*e` because it was mutably borrowed + | ^^ use of borrowed `*e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:121:20 + | +LL | let x = e.x(); + | - borrow of `*e` occurs here +LL | match *e { //[mir]~ ERROR cannot use `*e` because it was mutably borrowed +LL | Baz::X(value) => value + | ^^^^^ use of borrowed `*e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `u.a` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:131:9 + | +LL | let x = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed + | ^^^ use of borrowed `u.a` +LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:139:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:140:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed +LL | &[x, _, .., _, _] => println!("{}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:145:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:146:18 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, x, .., _, _] => println!("{}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:151:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:152:25 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, _, .., x, _] => println!("{}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:157:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:158:28 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, _, .., _, x] => println!("{}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:169:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:170:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed +LL | &[x..] => println!("{:?}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:175:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:176:18 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, x..] => println!("{:?}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:181:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:182:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[x.., _] => println!("{:?}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:187:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:188:18 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, x.., _] => println!("{:?}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:201:15 + | +LL | let x = &mut e; + | ------ borrow of `e` occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed + | ^ use of borrowed `e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:202:13 + | +LL | let x = &mut e; + | ------ borrow of `e` occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed +LL | E::A(ref ax) => + | ^^^^^^^^^^^^ use of borrowed `e` +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `e.0` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:202:18 + | +LL | let x = &mut e; + | ------ mutable borrow occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed +LL | E::A(ref ax) => + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `e.x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:207:23 + | +LL | let x = &mut e; + | ------ mutable borrow occurs here +... +LL | E::B { x: ref bx } => + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `s` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:220:15 + | +LL | let x = &mut s; + | ------ borrow of `s` occurs here +LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed + | ^ use of borrowed `s` +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `s.y.0` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:221:22 + | +LL | let x = &mut s; + | ------ mutable borrow occurs here +LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed +LL | S { y: (ref y0, _), .. } => + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `s` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:227:15 + | +LL | let x = &mut s; + | ------ borrow of `s` occurs here +... +LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed + | ^ use of borrowed `s` +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `s.x.y` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:228:28 + | +LL | let x = &mut s; + | ------ mutable borrow occurs here +... +LL | S { x: F { y: ref x0, .. }, .. } => + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `*v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:271:9 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | v[0].y; + | ^^^^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..].y` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:271:9 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | v[0].y; + | ^^^^^^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:282:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `v[..].x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:283:24 + | +LL | let x = &mut v; + | ------ mutable borrow occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed +LL | &[_, F {x: ref xf, ..}] => println!("{}", xf), + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:245:29 + | +LL | let x = &mut block; + | ---------- mutable borrow occurs here +LL | let p: &'a u8 = &*block.current; + | ^^^^^^^^^^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:260:33 + | +LL | let x = &mut block; + | ---------- mutable borrow occurs here +LL | let p : *const u8 = &*(*block).current; + | ^^^^^^^^^^^^^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-describe-lvalue.rs:318:22 + | +LL | drop(x); + | - value moved here +LL | drop(x); //[ast]~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait + +error: aborting due to 46 previous errors + +Some errors occurred: E0382, E0499, E0502, E0503. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.ast.stderr new file mode 100644 index 00000000000..ca9b2dda8bc --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.ast.stderr @@ -0,0 +1,246 @@ +error[E0503]: cannot use `f.x` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:53:9 + | +LL | let x = f.x(); + | - borrow of `f` occurs here +LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed + | ^^^ use of borrowed `f` + +error[E0503]: cannot use `g.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:61:9 + | +LL | let x = g.x(); + | - borrow of `g` occurs here +LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed + | ^^^ use of borrowed `g` + +error[E0503]: cannot use `h.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:69:9 + | +LL | let x = &mut h.0; + | --- borrow of `h.0` occurs here +LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed + | ^^^ use of borrowed `h.0` + +error[E0503]: cannot use `e.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:78:20 + | +LL | let x = e.x(); + | - borrow of `e` occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed +LL | Baz::X(value) => value + | ^^^^^ use of borrowed `e` + +error[E0503]: cannot use `u.a` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:88:9 + | +LL | let x = &mut u.a; + | --- borrow of `u.a` occurs here +LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed + | ^^^ use of borrowed `u.a` + +error[E0503]: cannot use `f.x` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:96:9 + | +LL | let x = f.x(); + | - borrow of `*f` occurs here +LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed + | ^^^ use of borrowed `*f` + +error[E0503]: cannot use `g.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:104:9 + | +LL | let x = g.x(); + | - borrow of `*g` occurs here +LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed + | ^^^ use of borrowed `*g` + +error[E0503]: cannot use `h.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:112:9 + | +LL | let x = &mut h.0; + | --- borrow of `h.0` occurs here +LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed + | ^^^ use of borrowed `h.0` + +error[E0503]: cannot use `e.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:121:20 + | +LL | let x = e.x(); + | - borrow of `*e` occurs here +LL | match *e { //[mir]~ ERROR cannot use `*e` because it was mutably borrowed +LL | Baz::X(value) => value + | ^^^^^ use of borrowed `*e` + +error[E0503]: cannot use `u.a` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:131:9 + | +LL | let x = &mut u.a; + | --- borrow of `u.a` occurs here +LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed + | ^^^ use of borrowed `u.a` + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:140:15 + | +LL | let x = &mut v; + | - borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed +LL | &[x, _, .., _, _] => println!("{}", x), + | ^ use of borrowed `v` + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:146:18 + | +LL | let x = &mut v; + | - borrow of `v` occurs here +... +LL | &[_, x, .., _, _] => println!("{}", x), + | ^ use of borrowed `v` + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:152:25 + | +LL | let x = &mut v; + | - borrow of `v` occurs here +... +LL | &[_, _, .., x, _] => println!("{}", x), + | ^ use of borrowed `v` + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:158:28 + | +LL | let x = &mut v; + | - borrow of `v` occurs here +... +LL | &[_, _, .., _, x] => println!("{}", x), + | ^ use of borrowed `v` + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:170:15 + | +LL | let x = &mut v; + | - borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed +LL | &[x..] => println!("{:?}", x), + | ^ use of borrowed `v` + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:176:18 + | +LL | let x = &mut v; + | - borrow of `v` occurs here +... +LL | &[_, x..] => println!("{:?}", x), + | ^ use of borrowed `v` + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:182:15 + | +LL | let x = &mut v; + | - borrow of `v` occurs here +... +LL | &[x.., _] => println!("{:?}", x), + | ^ use of borrowed `v` + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:188:18 + | +LL | let x = &mut v; + | - borrow of `v` occurs here +... +LL | &[_, x.., _] => println!("{:?}", x), + | ^ use of borrowed `v` + +error[E0502]: cannot borrow `e.0` as immutable because `e` is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:202:18 + | +LL | let x = &mut e; + | - mutable borrow occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed +LL | E::A(ref ax) => + | ^^^^^^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `e.x` as immutable because `e` is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:207:23 + | +LL | let x = &mut e; + | - mutable borrow occurs here +... +LL | E::B { x: ref bx } => + | ^^^^^^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `s.y.0` as immutable because `s` is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:221:22 + | +LL | let x = &mut s; + | - mutable borrow occurs here +LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed +LL | S { y: (ref y0, _), .. } => + | ^^^^^^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `s.x.y` as immutable because `s` is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:228:28 + | +LL | let x = &mut s; + | - mutable borrow occurs here +... +LL | S { x: F { y: ref x0, .. }, .. } => + | ^^^^^^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0503]: cannot use `v[..].y` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:271:9 + | +LL | let x = &mut v; + | - borrow of `v` occurs here +LL | v[0].y; + | ^^^^^^ use of borrowed `v` + +error[E0499]: cannot borrow `**x` as mutable more than once at a time + --> $DIR/borrowck-describe-lvalue.rs:295:18 + | +LL | let y = &mut x; + | - first mutable borrow occurs here +LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time + | ^ second mutable borrow occurs here +... +LL | }; + | - first borrow ends here + +error[E0499]: cannot borrow `**x` as mutable more than once at a time + --> $DIR/borrowck-describe-lvalue.rs:307:25 + | +LL | let y = &mut x; + | - first mutable borrow occurs here +LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time + | ^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-describe-lvalue.rs:318:22 + | +LL | drop(x); + | - value moved here +LL | drop(x); //[ast]~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait + +error: aborting due to 26 previous errors + +Some errors occurred: E0382, E0499, E0502, E0503. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.mir.stderr new file mode 100644 index 00000000000..34715e307fe --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.mir.stderr @@ -0,0 +1,543 @@ +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-describe-lvalue.rs:295:13 + | +LL | let y = &mut x; + | ------ first mutable borrow occurs here +LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time + | ^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | *y = 1; + | ------ borrow later used here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-describe-lvalue.rs:307:20 + | +LL | let y = &mut x; + | ------ first mutable borrow occurs here +LL | &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time + | ^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | *y = 1; + | ------ borrow later used here + +error: unsatisfied lifetime constraints + --> $DIR/borrowck-describe-lvalue.rs:305:16 + | +LL | || { + | ____________- + | |____________| + | || +LL | || || { //[mir]~ ERROR unsatisfied lifetime constraints + | ||________________^ +LL | ||| let y = &mut x; +LL | ||| &mut x; //[ast]~ ERROR cannot borrow `**x` as mutable more than once at a time +LL | ||| //[mir]~^ ERROR cannot borrow `x` as mutable more than once at a time +LL | ||| *y = 1; +LL | ||| drop(y); +LL | ||| } + | |||_________________^ requires that `'1` must outlive `'2` +LL | || }; + | || - + | ||____________| + | |_____________lifetime `'1` represents the closure body + | lifetime `'2` appears in return type + +error[E0503]: cannot use `f.x` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:53:9 + | +LL | let x = f.x(); + | - borrow of `f` occurs here +LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed + | ^^^ use of borrowed `f` +LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `g.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:61:9 + | +LL | let x = g.x(); + | - borrow of `g` occurs here +LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed + | ^^^ use of borrowed `g` +LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `h.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:69:9 + | +LL | let x = &mut h.0; + | -------- borrow of `h.0` occurs here +LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed + | ^^^ use of borrowed `h.0` +LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:77:15 + | +LL | let x = e.x(); + | - borrow of `e` occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed + | ^ use of borrowed `e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:78:20 + | +LL | let x = e.x(); + | - borrow of `e` occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed +LL | Baz::X(value) => value + | ^^^^^ use of borrowed `e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `u.a` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:88:9 + | +LL | let x = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed + | ^^^ use of borrowed `u.a` +LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `f.x` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:96:9 + | +LL | let x = f.x(); + | - borrow of `*f` occurs here +LL | f.x; //[ast]~ ERROR cannot use `f.x` because it was mutably borrowed + | ^^^ use of borrowed `*f` +LL | //[mir]~^ ERROR cannot use `f.x` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `g.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:104:9 + | +LL | let x = g.x(); + | - borrow of `*g` occurs here +LL | g.0; //[ast]~ ERROR cannot use `g.0` because it was mutably borrowed + | ^^^ use of borrowed `*g` +LL | //[mir]~^ ERROR cannot use `g.0` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `h.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:112:9 + | +LL | let x = &mut h.0; + | -------- borrow of `h.0` occurs here +LL | h.0; //[ast]~ ERROR cannot use `h.0` because it was mutably borrowed + | ^^^ use of borrowed `h.0` +LL | //[mir]~^ ERROR cannot use `h.0` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `*e` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:120:15 + | +LL | let x = e.x(); + | - borrow of `*e` occurs here +LL | match *e { //[mir]~ ERROR cannot use `*e` because it was mutably borrowed + | ^^ use of borrowed `*e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e.0` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:121:20 + | +LL | let x = e.x(); + | - borrow of `*e` occurs here +LL | match *e { //[mir]~ ERROR cannot use `*e` because it was mutably borrowed +LL | Baz::X(value) => value + | ^^^^^ use of borrowed `*e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `u.a` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:131:9 + | +LL | let x = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed + | ^^^ use of borrowed `u.a` +LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:139:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:140:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed +LL | &[x, _, .., _, _] => println!("{}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:145:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:146:18 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, x, .., _, _] => println!("{}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:151:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:152:25 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, _, .., x, _] => println!("{}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:157:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:158:28 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, _, .., _, x] => println!("{}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:169:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:170:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed +LL | &[x..] => println!("{:?}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:175:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:176:18 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, x..] => println!("{:?}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:181:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:182:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[x.., _] => println!("{:?}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:187:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..]` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:188:18 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +... +LL | &[_, x.., _] => println!("{:?}", x), + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:201:15 + | +LL | let x = &mut e; + | ------ borrow of `e` occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed + | ^ use of borrowed `e` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `e` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:202:13 + | +LL | let x = &mut e; + | ------ borrow of `e` occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed +LL | E::A(ref ax) => + | ^^^^^^^^^^^^ use of borrowed `e` +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `e.0` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:202:18 + | +LL | let x = &mut e; + | ------ mutable borrow occurs here +LL | match e { //[mir]~ ERROR cannot use `e` because it was mutably borrowed +LL | E::A(ref ax) => + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `e.x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:207:23 + | +LL | let x = &mut e; + | ------ mutable borrow occurs here +... +LL | E::B { x: ref bx } => + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `s` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:220:15 + | +LL | let x = &mut s; + | ------ borrow of `s` occurs here +LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed + | ^ use of borrowed `s` +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `s.y.0` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:221:22 + | +LL | let x = &mut s; + | ------ mutable borrow occurs here +LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed +LL | S { y: (ref y0, _), .. } => + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `s` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:227:15 + | +LL | let x = &mut s; + | ------ borrow of `s` occurs here +... +LL | match s { //[mir]~ ERROR cannot use `s` because it was mutably borrowed + | ^ use of borrowed `s` +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `s.x.y` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:228:28 + | +LL | let x = &mut s; + | ------ mutable borrow occurs here +... +LL | S { x: F { y: ref x0, .. }, .. } => + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `*v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:271:9 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | v[0].y; + | ^^^^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v[..].y` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:271:9 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | v[0].y; + | ^^^^^^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0503]: cannot use `v` because it was mutably borrowed + --> $DIR/borrowck-describe-lvalue.rs:282:15 + | +LL | let x = &mut v; + | ------ borrow of `v` occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed + | ^ use of borrowed `v` +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `v[..].x` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:283:24 + | +LL | let x = &mut v; + | ------ mutable borrow occurs here +LL | match v { //[mir]~ ERROR cannot use `v` because it was mutably borrowed +LL | &[_, F {x: ref xf, ..}] => println!("{}", xf), + | ^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:245:29 + | +LL | let x = &mut block; + | ---------- mutable borrow occurs here +LL | let p: &'a u8 = &*block.current; + | ^^^^^^^^^^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-describe-lvalue.rs:260:33 + | +LL | let x = &mut block; + | ---------- mutable borrow occurs here +LL | let p : *const u8 = &*(*block).current; + | ^^^^^^^^^^^^^^^^^^ immutable borrow occurs here +... +LL | drop(x); + | - borrow later used here + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-describe-lvalue.rs:318:22 + | +LL | drop(x); + | - value moved here +LL | drop(x); //[ast]~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait + +error: aborting due to 46 previous errors + +Some errors occurred: E0382, E0499, E0502, E0503. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-describe-lvalue.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.rs index b821c7cfa34..b821c7cfa34 100644 --- a/src/test/compile-fail/borrowck/borrowck-describe-lvalue.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-describe-lvalue.rs diff --git a/src/test/compile-fail/borrowck/borrowck-drop-from-guard.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-drop-from-guard.rs index 496aa84b593..496aa84b593 100644 --- a/src/test/compile-fail/borrowck/borrowck-drop-from-guard.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-drop-from-guard.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-drop-from-guard.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-drop-from-guard.stderr new file mode 100644 index 00000000000..e28b500ce63 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-drop-from-guard.stderr @@ -0,0 +1,14 @@ +error[E0382]: use of moved value: `my_str` + --> $DIR/borrowck-drop-from-guard.rs:22:23 + | +LL | Some(_) if { drop(my_str); false } => {} + | ------ value moved here +LL | Some(_) => {} +LL | None => { foo(my_str); } //~ ERROR [E0382] + | ^^^^^^ value used here after move + | + = note: move occurs because `my_str` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-field-sensitivity.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-field-sensitivity.nll.stderr new file mode 100644 index 00000000000..fb300d32b05 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-field-sensitivity.nll.stderr @@ -0,0 +1,110 @@ +error[E0382]: use of moved value: `*x.b` + --> $DIR/borrowck-field-sensitivity.rs:18:10 + | +LL | drop(x.b); + | --- value moved here +LL | drop(*x.b); //~ ERROR use of moved value: `*x.b` + | ^^^^ value used here after move + +error[E0382]: use of moved value: `*x.b` + --> $DIR/borrowck-field-sensitivity.rs:24:10 + | +LL | let y = A { a: 3, .. x }; + | ---------------- value moved here +LL | drop(*x.b); //~ ERROR use of moved value: `*x.b` + | ^^^^ value used here after move + +error[E0382]: borrow of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:30:13 + | +LL | drop(x.b); + | --- value moved here +LL | let p = &x.b; //~ ERROR use of moved value: `x.b` + | ^^^^ value borrowed here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:37:13 + | +LL | let _y = A { a: 3, .. x }; + | ---------------- value moved here +LL | let p = &x.b; //~ ERROR use of moved value: `x.b` + | ^^^^ value borrowed here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0505]: cannot move out of `x.b` because it is borrowed + --> $DIR/borrowck-field-sensitivity.rs:44:10 + | +LL | let p = &x.b; + | ---- borrow of `x.b` occurs here +LL | drop(x.b); //~ ERROR cannot move out of `x.b` because it is borrowed + | ^^^ move out of `x.b` occurs here +LL | drop(**p); + | --- borrow later used here + +error[E0505]: cannot move out of `x.b` because it is borrowed + --> $DIR/borrowck-field-sensitivity.rs:51:14 + | +LL | let p = &x.b; + | ---- borrow of `x.b` occurs here +LL | let _y = A { a: 3, .. x }; //~ ERROR cannot move out of `x.b` because it is borrowed + | ^^^^^^^^^^^^^^^^ move out of `x.b` occurs here +LL | drop(**p); + | --- borrow later used here + +error[E0499]: cannot borrow `x.a` as mutable more than once at a time + --> $DIR/borrowck-field-sensitivity.rs:58:13 + | +LL | let p = &mut x.a; + | -------- first mutable borrow occurs here +LL | let q = &mut x.a; //~ ERROR cannot borrow `x.a` as mutable more than once at a time + | ^^^^^^^^ second mutable borrow occurs here +LL | drop(*p); + | -- borrow later used here + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:66:10 + | +LL | drop(x.b); + | --- value moved here +LL | drop(x.b); //~ ERROR use of moved value: `x.b` + | ^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:72:10 + | +LL | let _y = A { a: 3, .. x }; + | ---------------- value moved here +LL | drop(x.b); //~ ERROR use of moved value: `x.b` + | ^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:78:14 + | +LL | drop(x.b); + | --- value moved here +LL | let _z = A { a: 3, .. x }; //~ ERROR use of moved value: `x.b` + | ^^^^^^^^^^^^^^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:84:14 + | +LL | let _y = A { a: 3, .. x }; + | ---------------- value moved here +LL | let _z = A { a: 4, .. x }; //~ ERROR use of moved value: `x.b` + | ^^^^^^^^^^^^^^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to 11 previous errors + +Some errors occurred: E0382, E0499, E0505. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-field-sensitivity.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-field-sensitivity.rs index 13fd5fce955..13fd5fce955 100644 --- a/src/test/compile-fail/borrowck/borrowck-field-sensitivity.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-field-sensitivity.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-field-sensitivity.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-field-sensitivity.stderr new file mode 100644 index 00000000000..e5eba3790a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-field-sensitivity.stderr @@ -0,0 +1,129 @@ +error[E0382]: use of moved value: `*x.b` + --> $DIR/borrowck-field-sensitivity.rs:18:10 + | +LL | drop(x.b); + | --- value moved here +LL | drop(*x.b); //~ ERROR use of moved value: `*x.b` + | ^^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `*x.b` + --> $DIR/borrowck-field-sensitivity.rs:24:10 + | +LL | let y = A { a: 3, .. x }; + | - value moved here +LL | drop(*x.b); //~ ERROR use of moved value: `*x.b` + | ^^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:30:14 + | +LL | drop(x.b); + | --- value moved here +LL | let p = &x.b; //~ ERROR use of moved value: `x.b` + | ^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:37:14 + | +LL | let _y = A { a: 3, .. x }; + | - value moved here +LL | let p = &x.b; //~ ERROR use of moved value: `x.b` + | ^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0505]: cannot move out of `x.b` because it is borrowed + --> $DIR/borrowck-field-sensitivity.rs:44:10 + | +LL | let p = &x.b; + | --- borrow of `x.b` occurs here +LL | drop(x.b); //~ ERROR cannot move out of `x.b` because it is borrowed + | ^^^ move out of `x.b` occurs here + +error[E0505]: cannot move out of `x.b` because it is borrowed + --> $DIR/borrowck-field-sensitivity.rs:51:27 + | +LL | let p = &x.b; + | --- borrow of `x.b` occurs here +LL | let _y = A { a: 3, .. x }; //~ ERROR cannot move out of `x.b` because it is borrowed + | ^ move out of `x.b` occurs here + +error[E0499]: cannot borrow `x.a` as mutable more than once at a time + --> $DIR/borrowck-field-sensitivity.rs:58:18 + | +LL | let p = &mut x.a; + | --- first mutable borrow occurs here +LL | let q = &mut x.a; //~ ERROR cannot borrow `x.a` as mutable more than once at a time + | ^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:66:10 + | +LL | drop(x.b); + | --- value moved here +LL | drop(x.b); //~ ERROR use of moved value: `x.b` + | ^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:72:10 + | +LL | let _y = A { a: 3, .. x }; + | - value moved here +LL | drop(x.b); //~ ERROR use of moved value: `x.b` + | ^^^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:78:27 + | +LL | drop(x.b); + | --- value moved here +LL | let _z = A { a: 3, .. x }; //~ ERROR use of moved value: `x.b` + | ^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:84:27 + | +LL | let _y = A { a: 3, .. x }; + | - value moved here +LL | let _z = A { a: 4, .. x }; //~ ERROR use of moved value: `x.b` + | ^ value used here after move + | + = note: move occurs because `x.b` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0381]: use of possibly uninitialized variable: `x.a` + --> $DIR/borrowck-field-sensitivity.rs:92:10 + | +LL | drop(x.a); //~ ERROR use of possibly uninitialized variable: `x.a` + | ^^^ use of possibly uninitialized `x.a` + +error[E0381]: use of possibly uninitialized variable: `x.a` + --> $DIR/borrowck-field-sensitivity.rs:98:14 + | +LL | let p = &x.a; //~ ERROR use of possibly uninitialized variable: `x.a` + | ^^^ use of possibly uninitialized `x.a` + +error[E0381]: use of possibly uninitialized variable: `x.b` + --> $DIR/borrowck-field-sensitivity.rs:105:10 + | +LL | drop(x.b); //~ ERROR use of possibly uninitialized variable: `x.b` + | ^^^ use of possibly uninitialized `x.b` + +error: aborting due to 14 previous errors + +Some errors occurred: E0381, E0382, E0499, E0505. +For more information about an error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-a.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-a.ast.stderr new file mode 100644 index 00000000000..4d0c762ca77 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-a.ast.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-fn-in-const-a.rs:19:16 + | +LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507] + | ^^ cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-a.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-a.mir.stderr new file mode 100644 index 00000000000..4d0c762ca77 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-a.mir.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-fn-in-const-a.rs:19:16 + | +LL | return *x //[ast]~ ERROR cannot move out of borrowed content [E0507] + | ^^ cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-fn-in-const-a.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-a.rs index 33b78cb26d8..33b78cb26d8 100644 --- a/src/test/compile-fail/borrowck/borrowck-fn-in-const-a.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-a.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-c.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-c.nll.stderr new file mode 100644 index 00000000000..827b66cf068 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-c.nll.stderr @@ -0,0 +1,13 @@ +error[E0597]: `local.inner` does not live long enough + --> $DIR/borrowck-fn-in-const-c.rs:27:16 + | +LL | return &local.inner; //~ ERROR does not live long enough + | ^^^^^^^^^^^^ borrowed value does not live long enough +LL | } + | - `local.inner` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-fn-in-const-c.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-c.rs index e607397e920..e607397e920 100644 --- a/src/test/compile-fail/borrowck/borrowck-fn-in-const-c.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-c.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-c.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-c.stderr new file mode 100644 index 00000000000..1dda8d41860 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-fn-in-const-c.stderr @@ -0,0 +1,13 @@ +error[E0597]: `local.inner` does not live long enough + --> $DIR/borrowck-fn-in-const-c.rs:27:17 + | +LL | return &local.inner; //~ ERROR does not live long enough + | ^^^^^^^^^^^ borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-correct-cmt-for-pattern.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-correct-cmt-for-pattern.nll.stderr new file mode 100644 index 00000000000..f9e517def14 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-correct-cmt-for-pattern.nll.stderr @@ -0,0 +1,30 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:15 + | +LL | for &a in x.iter() { //~ ERROR cannot move out + | - ^^^^^^^^ cannot move out of borrowed content + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref a` + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:15 + | +LL | for &a in &f.a { //~ ERROR cannot move out + | - ^^^^ cannot move out of borrowed content + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref a` + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:15 + | +LL | for &a in x.iter() { //~ ERROR cannot move out + | - ^^^^^^^^ cannot move out of borrowed content + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref a` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-for-loop-correct-cmt-for-pattern.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-correct-cmt-for-pattern.rs index 31ec5aea7f3..31ec5aea7f3 100644 --- a/src/test/compile-fail/borrowck/borrowck-for-loop-correct-cmt-for-pattern.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-correct-cmt-for-pattern.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-correct-cmt-for-pattern.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-correct-cmt-for-pattern.stderr new file mode 100644 index 00000000000..baa8a668cd9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-correct-cmt-for-pattern.stderr @@ -0,0 +1,30 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:22:9 + | +LL | for &a in x.iter() { //~ ERROR cannot move out + | ^- + | || + | |hint: to prevent move, use `ref a` or `ref mut a` + | cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:28:9 + | +LL | for &a in &f.a { //~ ERROR cannot move out + | ^- + | || + | |hint: to prevent move, use `ref a` or `ref mut a` + | cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-for-loop-correct-cmt-for-pattern.rs:32:9 + | +LL | for &a in x.iter() { //~ ERROR cannot move out + | ^- + | || + | |hint: to prevent move, use `ref a` or `ref mut a` + | cannot move out of borrowed content + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-head-linkage.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-head-linkage.nll.stderr new file mode 100644 index 00000000000..c3f71d60072 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-head-linkage.nll.stderr @@ -0,0 +1,27 @@ +error[E0502]: cannot borrow `vector` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-for-loop-head-linkage.rs:17:9 + | +LL | for &x in &vector { + | ------- + | | + | immutable borrow occurs here + | borrow used here in later iteration of loop +LL | let cap = vector.capacity(); +LL | vector.extend(repeat(0)); //~ ERROR cannot borrow + | ^^^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here + +error[E0502]: cannot borrow `vector` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-for-loop-head-linkage.rs:18:9 + | +LL | for &x in &vector { + | ------- + | | + | immutable borrow occurs here + | borrow used here in later iteration of loop +... +LL | vector[1] = 5; //~ ERROR cannot borrow + | ^^^^^^ mutable borrow occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-for-loop-head-linkage.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-head-linkage.rs index b79fc5b2bf6..b79fc5b2bf6 100644 --- a/src/test/compile-fail/borrowck/borrowck-for-loop-head-linkage.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-head-linkage.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-head-linkage.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-head-linkage.stderr new file mode 100644 index 00000000000..fd00138356d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-for-loop-head-linkage.stderr @@ -0,0 +1,27 @@ +error[E0502]: cannot borrow `vector` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-for-loop-head-linkage.rs:17:9 + | +LL | for &x in &vector { + | ------ + | | | + | | immutable borrow ends here + | immutable borrow occurs here +LL | let cap = vector.capacity(); +LL | vector.extend(repeat(0)); //~ ERROR cannot borrow + | ^^^^^^ mutable borrow occurs here + +error[E0502]: cannot borrow `vector` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-for-loop-head-linkage.rs:18:9 + | +LL | for &x in &vector { + | ------ + | | | + | | immutable borrow ends here + | immutable borrow occurs here +... +LL | vector[1] = 5; //~ ERROR cannot borrow + | ^^^^^^ mutable borrow occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-if-no-else.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-if-no-else.rs index 74b542800b9..74b542800b9 100644 --- a/src/test/compile-fail/borrowck/borrowck-if-no-else.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-if-no-else.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-if-no-else.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-if-no-else.stderr new file mode 100644 index 00000000000..6c4a53a37d9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-if-no-else.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-if-no-else.rs:15:9 + | +LL | foo(x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-if-with-else.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-if-with-else.rs index f3b02d12854..f3b02d12854 100644 --- a/src/test/compile-fail/borrowck/borrowck-if-with-else.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-if-with-else.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-if-with-else.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-if-with-else.stderr new file mode 100644 index 00000000000..097d11e387e --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-if-with-else.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-if-with-else.rs:20:9 + | +LL | foo(x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.nll.stderr new file mode 100644 index 00000000000..0a1bc2c1959 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0506]: cannot assign to `_a` because it is borrowed + --> $DIR/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs:19:9 + | +LL | let b = &mut _a; + | ------- borrow of `_a` occurs here +... +LL | _a = 4; //[ast]~ ERROR cannot assign to `_a` + | ^^^^^^ assignment to borrowed `_a` occurs here +... +LL | drop(b); + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.stderr new file mode 100644 index 00000000000..cb6d9875a92 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.stderr @@ -0,0 +1,12 @@ +error[E0506]: cannot assign to `_a` because it is borrowed + --> $DIR/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs:19:9 + | +LL | let b = &mut _a; + | -- borrow of `_a` occurs here +... +LL | _a = 4; //[ast]~ ERROR cannot assign to `_a` + | ^^^^^^ assignment to borrowed `_a` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.mir.stderr new file mode 100644 index 00000000000..0a1bc2c1959 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.mir.stderr @@ -0,0 +1,15 @@ +error[E0506]: cannot assign to `_a` because it is borrowed + --> $DIR/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs:19:9 + | +LL | let b = &mut _a; + | ------- borrow of `_a` occurs here +... +LL | _a = 4; //[ast]~ ERROR cannot assign to `_a` + | ^^^^^^ assignment to borrowed `_a` occurs here +... +LL | drop(b); + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs index 6f0e0f43f60..6f0e0f43f60 100644 --- a/src/test/compile-fail/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs diff --git a/src/test/compile-fail/borrowck/borrowck-init-in-called-fn-expr.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-called-fn-expr.rs index 5b32fd2d198..5b32fd2d198 100644 --- a/src/test/compile-fail/borrowck/borrowck-init-in-called-fn-expr.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-called-fn-expr.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-called-fn-expr.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-called-fn-expr.stderr new file mode 100644 index 00000000000..e55603c451f --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-called-fn-expr.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `i` + --> $DIR/borrowck-init-in-called-fn-expr.rs:14:9 + | +LL | i //~ ERROR use of possibly uninitialized variable: `i` + | ^ use of possibly uninitialized `i` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-init-in-fn-expr.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fn-expr.rs index 65f1a1fa098..65f1a1fa098 100644 --- a/src/test/compile-fail/borrowck/borrowck-init-in-fn-expr.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fn-expr.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fn-expr.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fn-expr.stderr new file mode 100644 index 00000000000..406fb5e6834 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fn-expr.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `i` + --> $DIR/borrowck-init-in-fn-expr.rs:14:9 + | +LL | i //~ ERROR use of possibly uninitialized variable: `i` + | ^ use of possibly uninitialized `i` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.ast.nll.stderr new file mode 100644 index 00000000000..cac9d890dae --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.ast.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `origin.y` + --> $DIR/borrowck-init-in-fru.rs:22:5 + | +LL | origin = point {x: 10,.. origin}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of possibly uninitialized `origin.y` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.ast.stderr new file mode 100644 index 00000000000..a5c1ef7f4f5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.ast.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `origin.y` + --> $DIR/borrowck-init-in-fru.rs:22:30 + | +LL | origin = point {x: 10,.. origin}; + | ^^^^^^ use of possibly uninitialized `origin.y` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.mir.stderr new file mode 100644 index 00000000000..cac9d890dae --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.mir.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `origin.y` + --> $DIR/borrowck-init-in-fru.rs:22:5 + | +LL | origin = point {x: 10,.. origin}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ use of possibly uninitialized `origin.y` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-init-in-fru.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.rs index 1ec0f980774..1ec0f980774 100644 --- a/src/test/compile-fail/borrowck/borrowck-init-in-fru.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-in-fru.rs diff --git a/src/test/compile-fail/borrowck/borrowck-init-op-equal.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-op-equal.rs index e0d93fd1d47..e0d93fd1d47 100644 --- a/src/test/compile-fail/borrowck/borrowck-init-op-equal.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-op-equal.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-init-op-equal.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-op-equal.stderr new file mode 100644 index 00000000000..b8e91e356c1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-op-equal.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `v` + --> $DIR/borrowck-init-op-equal.rs:14:5 + | +LL | v += 1; //~ ERROR use of possibly uninitialized variable: `v` + | ^^^^^^ use of possibly uninitialized `v` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-init-plus-equal.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-plus-equal.rs index a036286f363..a036286f363 100644 --- a/src/test/compile-fail/borrowck/borrowck-init-plus-equal.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-plus-equal.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-init-plus-equal.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-plus-equal.stderr new file mode 100644 index 00000000000..f49c06c0c86 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-init-plus-equal.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `v` + --> $DIR/borrowck-init-plus-equal.rs:13:9 + | +LL | v = v + 1; //~ ERROR use of possibly uninitialized variable: `v` + | ^ use of possibly uninitialized `v` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-insert-during-each.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-insert-during-each.nll.stderr new file mode 100644 index 00000000000..e403b076ab4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-insert-during-each.nll.stderr @@ -0,0 +1,36 @@ +error[E0501]: cannot borrow `*f` as mutable because previous closure requires unique access + --> $DIR/borrowck-insert-during-each.rs:26:3 + | +LL | f.foo( + | ___^ + | |___| + | || +LL | || |a| { //~ ERROR closure requires unique access to `f` + | || --- closure construction occurs here +LL | || f.n.insert(*a); + | || - first borrow occurs due to use of `f` in closure +LL | || }) + | || ^ + | ||__________| + | |___________borrow occurs here + | borrow later used here + +error[E0500]: closure requires unique access to `f` but it is already borrowed + --> $DIR/borrowck-insert-during-each.rs:27:9 + | +LL | f.foo( + | - + | | + | ___borrow occurs here + | | +LL | | |a| { //~ ERROR closure requires unique access to `f` + | | ^^^ closure construction occurs here +LL | | f.n.insert(*a); + | | - second borrow occurs due to use of `f` in closure +LL | | }) + | |__________- borrow later used here + +error: aborting due to 2 previous errors + +Some errors occurred: E0500, E0501. +For more information about an error, try `rustc --explain E0500`. diff --git a/src/test/compile-fail/borrowck/borrowck-insert-during-each.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-insert-during-each.rs index 8499ebb8ac3..8499ebb8ac3 100644 --- a/src/test/compile-fail/borrowck/borrowck-insert-during-each.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-insert-during-each.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-insert-during-each.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-insert-during-each.stderr new file mode 100644 index 00000000000..30648edffd8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-insert-during-each.stderr @@ -0,0 +1,15 @@ +error[E0500]: closure requires unique access to `f` but `*f` is already borrowed + --> $DIR/borrowck-insert-during-each.rs:27:9 + | +LL | f.foo( + | - borrow occurs here +LL | |a| { //~ ERROR closure requires unique access to `f` + | ^^^ closure construction occurs here +LL | f.n.insert(*a); + | - borrow occurs due to use of `f` in closure +LL | }) + | - borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0500`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.ast.nll.stderr new file mode 100644 index 00000000000..d90eda41164 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.ast.nll.stderr @@ -0,0 +1,108 @@ +error[E0594]: cannot assign to `***p` which is behind a `&` reference + --> $DIR/borrowck-issue-14498.rs:29:5 + | +LL | let p = &y; + | -- help: consider changing this to be a mutable reference: `&mut y` +LL | ***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference + | ^^^^^^^^ `p` is a `&` reference, so the data it refers to cannot be written + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:39:5 + | +LL | let p = &y; + | -- borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:50:5 + | +LL | let p = &y; + | -- borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:61:5 + | +LL | let p = &y; + | -- borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:72:5 + | +LL | let p = &y; + | -- borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:83:5 + | +LL | let p = &y.a; + | ---- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:94:5 + | +LL | let p = &y.a; + | ---- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:105:5 + | +LL | let p = &y.a; + | ---- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:116:5 + | +LL | let p = &y.a; + | ---- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | drop(p); + | - borrow later used here + +error: aborting due to 9 previous errors + +Some errors occurred: E0506, E0594. +For more information about an error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.ast.stderr new file mode 100644 index 00000000000..ffb793e48df --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.ast.stderr @@ -0,0 +1,82 @@ +error[E0389]: cannot assign to data in a `&` reference + --> $DIR/borrowck-issue-14498.rs:29:5 + | +LL | ***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference + | ^^^^^^^^ assignment into an immutable reference + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:39:5 + | +LL | let p = &y; + | - borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:50:5 + | +LL | let p = &y; + | - borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:61:5 + | +LL | let p = &y; + | - borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:72:5 + | +LL | let p = &y; + | - borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:83:5 + | +LL | let p = &y.a; + | --- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:94:5 + | +LL | let p = &y.a; + | --- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:105:5 + | +LL | let p = &y.a; + | --- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:116:5 + | +LL | let p = &y.a; + | --- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here + +error: aborting due to 9 previous errors + +Some errors occurred: E0389, E0506. +For more information about an error, try `rustc --explain E0389`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.mir.stderr new file mode 100644 index 00000000000..d90eda41164 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.mir.stderr @@ -0,0 +1,108 @@ +error[E0594]: cannot assign to `***p` which is behind a `&` reference + --> $DIR/borrowck-issue-14498.rs:29:5 + | +LL | let p = &y; + | -- help: consider changing this to be a mutable reference: `&mut y` +LL | ***p = 2; //[ast]~ ERROR cannot assign to data in a `&` reference + | ^^^^^^^^ `p` is a `&` reference, so the data it refers to cannot be written + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:39:5 + | +LL | let p = &y; + | -- borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:50:5 + | +LL | let p = &y; + | -- borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:61:5 + | +LL | let p = &y; + | -- borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:72:5 + | +LL | let p = &y; + | -- borrow of `**y` occurs here +LL | let q = &***p; +LL | **y = 2; //[ast]~ ERROR cannot assign to `**y` because it is borrowed + | ^^^^^^^ assignment to borrowed `**y` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:83:5 + | +LL | let p = &y.a; + | ---- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:94:5 + | +LL | let p = &y.a; + | ---- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:105:5 + | +LL | let p = &y.a; + | ---- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | drop(p); + | - borrow later used here + +error[E0506]: cannot assign to `**y.a` because it is borrowed + --> $DIR/borrowck-issue-14498.rs:116:5 + | +LL | let p = &y.a; + | ---- borrow of `**y.a` occurs here +LL | let q = &***p; +LL | **y.a = 2; //[ast]~ ERROR cannot assign to `**y.a` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `**y.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `**y.a` because it is borrowed +LL | drop(p); + | - borrow later used here + +error: aborting due to 9 previous errors + +Some errors occurred: E0506, E0594. +For more information about an error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/borrowck/borrowck-issue-14498.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.rs index 3c5f932af47..3c5f932af47 100644 --- a/src/test/compile-fail/borrowck/borrowck-issue-14498.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-14498.rs diff --git a/src/test/compile-fail/borrowck/borrowck-issue-2657-1.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-1.rs index 0e1712137d3..0e1712137d3 100644 --- a/src/test/compile-fail/borrowck/borrowck-issue-2657-1.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-1.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-1.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-1.stderr new file mode 100644 index 00000000000..3f184f5f964 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-1.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrowck-issue-2657-1.rs:17:13 + | +LL | Some(ref _y) => { + | ------ borrow of `x.0` occurs here +LL | let _a = x; //~ ERROR cannot move + | ^^ move out of `x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-2.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-2.nll.stderr new file mode 100644 index 00000000000..55c6a40d281 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-2.nll.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-issue-2657-2.rs:17:18 + | +LL | let _b = *y; //~ ERROR cannot move out + | ^^ + | | + | cannot move out of borrowed content + | help: consider removing this dereference operator: `y` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-issue-2657-2.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-2.rs index a389a4a5593..a389a4a5593 100644 --- a/src/test/compile-fail/borrowck/borrowck-issue-2657-2.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-2.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-2.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-2.stderr new file mode 100644 index 00000000000..42baecd7943 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-2657-2.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-issue-2657-2.rs:17:18 + | +LL | let _b = *y; //~ ERROR cannot move out + | ^^ + | | + | cannot move out of borrowed content + | help: consider using a reference instead: `&*y` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-issue-48962.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-48962.rs index e3bbfd9d5fe..e3bbfd9d5fe 100644 --- a/src/test/compile-fail/borrowck/borrowck-issue-48962.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-48962.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-48962.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-48962.stderr new file mode 100644 index 00000000000..4448cedda69 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-issue-48962.stderr @@ -0,0 +1,23 @@ +error[E0382]: use of moved value: `src` + --> $DIR/borrowck-issue-48962.rs:26:5 + | +LL | {src}; + | --- value moved here +LL | src.next = None; //~ ERROR use of moved value: `src` [E0382] + | ^^^^^^^^ value used here after move + | + = note: move occurs because `src` has type `&mut Node`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `src` + --> $DIR/borrowck-issue-48962.rs:32:5 + | +LL | {src}; + | --- value moved here +LL | src.0 = 66; //~ ERROR use of moved value: `src` [E0382] + | ^^^^^^^^^^ value used here after move + | + = note: move occurs because `src` has type `&mut (i32, i32)`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-lend-flow-if.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-if.rs index a6ce36a5507..a6ce36a5507 100644 --- a/src/test/compile-fail/borrowck/borrowck-lend-flow-if.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-if.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-if.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-if.stderr new file mode 100644 index 00000000000..91fe19ab769 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-if.stderr @@ -0,0 +1,14 @@ +error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable + --> $DIR/borrowck-lend-flow-if.rs:38:21 + | +LL | _w = &v; + | - immutable borrow occurs here +LL | } +LL | borrow_mut(&mut *v); //~ ERROR cannot borrow + | ^^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-loop.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-loop.nll.stderr new file mode 100644 index 00000000000..c46e94866ab --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-loop.nll.stderr @@ -0,0 +1,26 @@ +error[E0502]: cannot borrow `*v` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-lend-flow-loop.rs:45:16 + | +LL | let mut x = &mut v; + | ------ mutable borrow occurs here +LL | for _ in 0..3 { +LL | borrow(&*v); //~ ERROR cannot borrow + | ^^^ immutable borrow occurs here +LL | } +LL | *x = box 5; + | -- borrow used here in later iteration of loop + +error[E0502]: cannot borrow `*v` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-lend-flow-loop.rs:109:16 + | +LL | **x += 1; + | -------- borrow used here in later iteration of loop +LL | borrow(&*v); //~ ERROR cannot borrow + | ^^^ immutable borrow occurs here +LL | if cond2 { +LL | x = &mut v; //~ ERROR cannot borrow + | ------ mutable borrow occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-loop.rs index f09e7ffd7e4..f09e7ffd7e4 100644 --- a/src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-loop.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-loop.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-loop.stderr new file mode 100644 index 00000000000..534e30b564d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-loop.stderr @@ -0,0 +1,93 @@ +error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mutable + --> $DIR/borrowck-lend-flow-loop.rs:35:17 + | +LL | let mut x = &mut v; + | - mutable borrow occurs here +... +LL | borrow(&*v); //~ ERROR cannot borrow + | ^^ immutable borrow occurs here +LL | } +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mutable + --> $DIR/borrowck-lend-flow-loop.rs:45:17 + | +LL | let mut x = &mut v; + | - mutable borrow occurs here +LL | for _ in 0..3 { +LL | borrow(&*v); //~ ERROR cannot borrow + | ^^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable + --> $DIR/borrowck-lend-flow-loop.rs:57:25 + | +LL | borrow_mut(&mut *v); //~ ERROR cannot borrow + | ^^ mutable borrow occurs here +LL | _x = &v; + | - immutable borrow occurs here +LL | } +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable + --> $DIR/borrowck-lend-flow-loop.rs:69:25 + | +LL | borrow_mut(&mut *v); //~ ERROR cannot borrow + | ^^ mutable borrow occurs here +LL | _x = &v; + | - immutable borrow occurs here +LL | } +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable + --> $DIR/borrowck-lend-flow-loop.rs:86:21 + | +LL | _x = &v; + | - immutable borrow occurs here +... +LL | borrow_mut(&mut *v); //~ ERROR cannot borrow + | ^^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable + --> $DIR/borrowck-lend-flow-loop.rs:100:21 + | +LL | _x = &v; + | - immutable borrow occurs here +... +LL | borrow_mut(&mut *v); //~ ERROR cannot borrow + | ^^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mutable + --> $DIR/borrowck-lend-flow-loop.rs:109:17 + | +LL | borrow(&*v); //~ ERROR cannot borrow + | ^^ immutable borrow occurs here +LL | if cond2 { +LL | x = &mut v; //~ ERROR cannot borrow + | - mutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0499]: cannot borrow `v` as mutable more than once at a time + --> $DIR/borrowck-lend-flow-loop.rs:111:22 + | +LL | x = &mut v; //~ ERROR cannot borrow + | ^ mutable borrow starts here in previous iteration of loop +... +LL | } + | - mutable borrow ends here + +error: aborting due to 8 previous errors + +Some errors occurred: E0499, E0502. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.ast.nll.stderr new file mode 100644 index 00000000000..0b6eabfb7ed --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-lend-flow-match.rs:28:13 + | +LL | Some(ref r) => { + | ----- borrow of `x` occurs here +LL | x = Some(1); //[ast]~ ERROR cannot assign + | ^^^^^^^^^^^ assignment to borrowed `x` occurs here +LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | drop(r); + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.ast.stderr new file mode 100644 index 00000000000..0fcc6bbbc83 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.ast.stderr @@ -0,0 +1,11 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-lend-flow-match.rs:28:13 + | +LL | Some(ref r) => { + | ----- borrow of `x` occurs here +LL | x = Some(1); //[ast]~ ERROR cannot assign + | ^^^^^^^^^^^ assignment to borrowed `x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.mir.stderr new file mode 100644 index 00000000000..0b6eabfb7ed --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.mir.stderr @@ -0,0 +1,14 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-lend-flow-match.rs:28:13 + | +LL | Some(ref r) => { + | ----- borrow of `x` occurs here +LL | x = Some(1); //[ast]~ ERROR cannot assign + | ^^^^^^^^^^^ assignment to borrowed `x` occurs here +LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | drop(r); + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/borrowck/borrowck-lend-flow-match.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.rs index f2f3e791422..f2f3e791422 100644 --- a/src/test/compile-fail/borrowck/borrowck-lend-flow-match.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow-match.rs diff --git a/src/test/compile-fail/borrowck/borrowck-lend-flow.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow.rs index 1ed779cfaac..1ed779cfaac 100644 --- a/src/test/compile-fail/borrowck/borrowck-lend-flow.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow.stderr new file mode 100644 index 00000000000..1fedf0a0f62 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-lend-flow.stderr @@ -0,0 +1,13 @@ +error[E0502]: cannot borrow `*v` as mutable because `v` is also borrowed as immutable + --> $DIR/borrowck-lend-flow.rs:34:21 + | +LL | let _w = &v; + | - immutable borrow occurs here +LL | borrow_mut(&mut *v); //~ ERROR cannot borrow + | ^^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-loan-blocks-move-cc.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move-cc.rs index 57b584a8959..57b584a8959 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-blocks-move-cc.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move-cc.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move-cc.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move-cc.stderr new file mode 100644 index 00000000000..20ab864a53b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move-cc.stderr @@ -0,0 +1,21 @@ +error[E0504]: cannot move `v` into closure because it is borrowed + --> $DIR/borrowck-loan-blocks-move-cc.rs:23:27 + | +LL | let _w = &v; + | - borrow of `v` occurs here +LL | thread::spawn(move|| { +LL | println!("v={}", *v); + | ^ move into closure occurs here + +error[E0504]: cannot move `v` into closure because it is borrowed + --> $DIR/borrowck-loan-blocks-move-cc.rs:32:27 + | +LL | let _w = &v; + | - borrow of `v` occurs here +LL | thread::spawn(move|| { +LL | println!("v={}", *v); + | ^ move into closure occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0504`. diff --git a/src/test/compile-fail/borrowck/borrowck-loan-blocks-move.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move.rs index f3f18807314..f3f18807314 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-blocks-move.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move.stderr new file mode 100644 index 00000000000..6bd6bb268af --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-move.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `v` because it is borrowed + --> $DIR/borrowck-loan-blocks-move.rs:19:10 + | +LL | let _w = &v; + | - borrow of `v` occurs here +LL | take(v); //~ ERROR cannot move out of `v` because it is borrowed + | ^ move out of `v` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-mut-uniq.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-mut-uniq.nll.stderr new file mode 100644 index 00000000000..5c3cd46a87d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-mut-uniq.nll.stderr @@ -0,0 +1,19 @@ +error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-loan-blocks-mut-uniq.rs:20:12 + | +LL | borrow(&*v, + | - --- immutable borrow occurs here + | _____| + | | +LL | | |w| { //~ ERROR cannot borrow `v` as mutable + | | ^^^ mutable borrow occurs here +LL | | v = box 4; + | | - second borrow occurs due to use of `v` in closure +LL | | assert_eq!(*v, 3); +LL | | assert_eq!(*w, 4); +LL | | }) + | |__________- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-loan-blocks-mut-uniq.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-mut-uniq.rs index 32d8088549d..32d8088549d 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-blocks-mut-uniq.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-mut-uniq.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-mut-uniq.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-mut-uniq.stderr new file mode 100644 index 00000000000..752322dec87 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-blocks-mut-uniq.stderr @@ -0,0 +1,16 @@ +error[E0502]: cannot borrow `v` as mutable because `*v` is also borrowed as immutable + --> $DIR/borrowck-loan-blocks-mut-uniq.rs:20:12 + | +LL | borrow(&*v, + | -- immutable borrow occurs here +LL | |w| { //~ ERROR cannot borrow `v` as mutable + | ^^^ mutable borrow occurs here +LL | v = box 4; + | - borrow occurs due to use of `v` in closure +... +LL | }) + | - immutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-in-overloaded-op.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-in-overloaded-op.nll.stderr new file mode 100644 index 00000000000..03ddfb4c903 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-in-overloaded-op.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: borrow of moved value: `x` + --> $DIR/borrowck-loan-in-overloaded-op.rs:31:20 + | +LL | let _y = {x} + x.clone(); // the `{x}` forces a move to occur + | - ^ value borrowed here after move + | | + | value moved here + | + = note: move occurs because `x` has type `foo`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-loan-in-overloaded-op.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-in-overloaded-op.rs index a9079cfc27d..a9079cfc27d 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-in-overloaded-op.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-in-overloaded-op.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-in-overloaded-op.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-in-overloaded-op.stderr new file mode 100644 index 00000000000..7cd54e293b0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-in-overloaded-op.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-loan-in-overloaded-op.rs:31:20 + | +LL | let _y = {x} + x.clone(); // the `{x}` forces a move to occur + | - ^ value used here after move + | | + | value moved here + | + = note: move occurs because `x` has type `foo`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-of-static-data-issue-27616.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-of-static-data-issue-27616.nll.stderr new file mode 100644 index 00000000000..eb9e72a6c5c --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-of-static-data-issue-27616.nll.stderr @@ -0,0 +1,14 @@ +error[E0506]: cannot assign to `*s` because it is borrowed + --> $DIR/borrowck-loan-of-static-data-issue-27616.rs:26:5 + | +LL | let alias: &'static mut String = s; + | - borrow of `*s` occurs here +... +LL | *s = String::new(); //~ ERROR cannot assign + | ^^ assignment to borrowed `*s` occurs here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/borrowck/borrowck-loan-of-static-data-issue-27616.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-of-static-data-issue-27616.rs index 228e71025fd..228e71025fd 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-of-static-data-issue-27616.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-of-static-data-issue-27616.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-of-static-data-issue-27616.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-of-static-data-issue-27616.stderr new file mode 100644 index 00000000000..3f5e09b7443 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-of-static-data-issue-27616.stderr @@ -0,0 +1,12 @@ +error[E0506]: cannot assign to `*s` because it is borrowed + --> $DIR/borrowck-loan-of-static-data-issue-27616.rs:26:5 + | +LL | let alias: &'static mut String = s; + | - borrow of `*s` occurs here +... +LL | *s = String::new(); //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^^^^ assignment to borrowed `*s` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr-overloaded-op.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr-overloaded-op.nll.stderr new file mode 100644 index 00000000000..b7c87162587 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr-overloaded-op.nll.stderr @@ -0,0 +1,28 @@ +error[E0503]: cannot use `p` because it was mutably borrowed + --> $DIR/borrowck-loan-rcvr-overloaded-op.rs:48:5 + | +LL | let q = &mut p; + | ------ borrow of `p` occurs here +LL | +LL | p + 3; //~ ERROR cannot use `p` + | ^ use of borrowed `p` +... +LL | *q + 3; // OK to use the new alias `q` + | -- borrow later used here + +error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-loan-rcvr-overloaded-op.rs:49:5 + | +LL | let q = &mut p; + | ------ mutable borrow occurs here +... +LL | p.times(3); //~ ERROR cannot borrow `p` + | ^ immutable borrow occurs here +LL | +LL | *q + 3; // OK to use the new alias `q` + | -- borrow later used here + +error: aborting due to 2 previous errors + +Some errors occurred: E0502, E0503. +For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-loan-rcvr-overloaded-op.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr-overloaded-op.rs index cce55b6c941..cce55b6c941 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-rcvr-overloaded-op.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr-overloaded-op.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr-overloaded-op.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr-overloaded-op.stderr new file mode 100644 index 00000000000..4db1d1f298e --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr-overloaded-op.stderr @@ -0,0 +1,25 @@ +error[E0503]: cannot use `p` because it was mutably borrowed + --> $DIR/borrowck-loan-rcvr-overloaded-op.rs:48:5 + | +LL | let q = &mut p; + | - borrow of `p` occurs here +LL | +LL | p + 3; //~ ERROR cannot use `p` + | ^ use of borrowed `p` + +error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-loan-rcvr-overloaded-op.rs:49:5 + | +LL | let q = &mut p; + | - mutable borrow occurs here +... +LL | p.times(3); //~ ERROR cannot borrow `p` + | ^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error: aborting due to 2 previous errors + +Some errors occurred: E0502, E0503. +For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr.nll.stderr new file mode 100644 index 00000000000..a5b81027c2f --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr.nll.stderr @@ -0,0 +1,27 @@ +error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-loan-rcvr.rs:34:14 + | +LL | p.blockm(|| { //~ ERROR cannot borrow `p` as mutable + | - ^^ mutable borrow occurs here + | | + | _____immutable borrow occurs here + | | +LL | | p.x = 10; + | | - second borrow occurs due to use of `p` in closure +LL | | }) + | |______- borrow later used here + +error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-loan-rcvr.rs:45:5 + | +LL | let l = &mut p; + | ------ mutable borrow occurs here +LL | p.impurem(); //~ ERROR cannot borrow + | ^ immutable borrow occurs here +LL | +LL | l.x += 1; + | -------- borrow later used here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-loan-rcvr.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr.rs index 014b27f9659..014b27f9659 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-rcvr.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr.stderr new file mode 100644 index 00000000000..f5d3cfb3834 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-rcvr.stderr @@ -0,0 +1,26 @@ +error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-loan-rcvr.rs:34:14 + | +LL | p.blockm(|| { //~ ERROR cannot borrow `p` as mutable + | - ^^ mutable borrow occurs here + | | + | immutable borrow occurs here +LL | p.x = 10; + | - borrow occurs due to use of `p` in closure +LL | }) + | - immutable borrow ends here + +error[E0502]: cannot borrow `p` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-loan-rcvr.rs:45:5 + | +LL | let l = &mut p; + | - mutable borrow occurs here +LL | p.impurem(); //~ ERROR cannot borrow + | ^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-vec-content.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-vec-content.nll.stderr new file mode 100644 index 00000000000..492e90914ea --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-vec-content.nll.stderr @@ -0,0 +1,16 @@ +error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-loan-vec-content.rs:28:9 + | +LL | / takes_imm_elt( +LL | | &v[0], + | | - immutable borrow occurs here +LL | | || { //~ ERROR cannot borrow `v` as mutable + | | ^^ mutable borrow occurs here +LL | | v[1] = 4; + | | - second borrow occurs due to use of `v` in closure +LL | | }) + | |__________- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-loan-vec-content.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-vec-content.rs index c5de95f8fc0..c5de95f8fc0 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-vec-content.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-vec-content.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-vec-content.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-vec-content.stderr new file mode 100644 index 00000000000..2fcfd1fb08d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-loan-vec-content.stderr @@ -0,0 +1,15 @@ +error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-loan-vec-content.rs:28:9 + | +LL | &v[0], + | - immutable borrow occurs here +LL | || { //~ ERROR cannot borrow `v` as mutable + | ^^ mutable borrow occurs here +LL | v[1] = 4; + | - borrow occurs due to use of `v` in closure +LL | }) + | - immutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.ast.nll.stderr new file mode 100644 index 00000000000..97bf509a458 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0597]: `x` does not live long enough + --> $DIR/borrowck-local-borrow-outlives-fn.rs:15:5 + | +LL | &x + | ^^ borrowed value does not live long enough +... +LL | } + | - `x` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.ast.stderr new file mode 100644 index 00000000000..af1d294c387 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.ast.stderr @@ -0,0 +1,14 @@ +error[E0597]: `x` does not live long enough + --> $DIR/borrowck-local-borrow-outlives-fn.rs:15:6 + | +LL | &x + | ^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.mir.stderr new file mode 100644 index 00000000000..97bf509a458 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.mir.stderr @@ -0,0 +1,14 @@ +error[E0597]: `x` does not live long enough + --> $DIR/borrowck-local-borrow-outlives-fn.rs:15:5 + | +LL | &x + | ^^ borrowed value does not live long enough +... +LL | } + | - `x` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-local-borrow-outlives-fn.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.rs index 0d5feb6b9cc..0d5feb6b9cc 100644 --- a/src/test/compile-fail/borrowck/borrowck-local-borrow-outlives-fn.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-outlives-fn.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.nll.stderr new file mode 100644 index 00000000000..5e2b469e68f --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0597]: `z.1` does not live long enough + --> $DIR/borrowck-local-borrow-with-panic-outlives-fn.rs:16:15 + | +LL | *x = Some(&mut z.1); + | ^^^^^^^^ borrowed value does not live long enough +... +LL | } + | - `z.1` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.stderr new file mode 100644 index 00000000000..0c61c13345c --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.stderr @@ -0,0 +1,14 @@ +error[E0597]: `z.1` does not live long enough + --> $DIR/borrowck-local-borrow-with-panic-outlives-fn.rs:16:20 + | +LL | *x = Some(&mut z.1); + | ^^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.mir.stderr new file mode 100644 index 00000000000..5e2b469e68f --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.mir.stderr @@ -0,0 +1,14 @@ +error[E0597]: `z.1` does not live long enough + --> $DIR/borrowck-local-borrow-with-panic-outlives-fn.rs:16:15 + | +LL | *x = Some(&mut z.1); + | ^^^^^^^^ borrowed value does not live long enough +... +LL | } + | - `z.1` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-local-borrow-with-panic-outlives-fn.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.rs index 2c9ace4825d..2c9ace4825d 100644 --- a/src/test/compile-fail/borrowck/borrowck-local-borrow-with-panic-outlives-fn.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-local-borrow-with-panic-outlives-fn.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.ast.nll.stderr new file mode 100644 index 00000000000..8dec40520c4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.ast.nll.stderr @@ -0,0 +1,73 @@ +error[E0503]: cannot use `foo` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:22:19 + | +LL | let p = &mut foo; + | -------- borrow of `foo` occurs here +LL | let _ = match foo { //[mir]~ ERROR [E0503] + | ^^^ use of borrowed `foo` +... +LL | drop(p); + | - borrow later used here + +error[E0503]: cannot use `foo` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:23:9 + | +LL | let p = &mut foo; + | -------- borrow of `foo` occurs here +LL | let _ = match foo { //[mir]~ ERROR [E0503] +LL | Foo::B => 1, //[mir]~ ERROR [E0503] + | ^^^^^^ use of borrowed `foo` +... +LL | drop(p); + | - borrow later used here + +error[E0503]: cannot use `foo.0` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:25:16 + | +LL | let p = &mut foo; + | -------- borrow of `foo` occurs here +... +LL | Foo::A(x) => x //[ast]~ ERROR [E0503] + | ^ use of borrowed `foo` +... +LL | drop(p); + | - borrow later used here + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:35:19 + | +LL | let r = &mut x; + | ------ borrow of `x` occurs here +LL | let _ = match x { //[mir]~ ERROR [E0503] + | ^ use of borrowed `x` +... +LL | drop(r); + | - borrow later used here + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:36:9 + | +LL | let r = &mut x; + | ------ borrow of `x` occurs here +LL | let _ = match x { //[mir]~ ERROR [E0503] +LL | x => x + 1, //[ast]~ ERROR [E0503] + | ^ use of borrowed `x` +... +LL | drop(r); + | - borrow later used here + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:38:9 + | +LL | let r = &mut x; + | ------ borrow of `x` occurs here +... +LL | y => y + 2, //[ast]~ ERROR [E0503] + | ^ use of borrowed `x` +... +LL | drop(r); + | - borrow later used here + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.ast.stderr new file mode 100644 index 00000000000..2e49f90a169 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.ast.stderr @@ -0,0 +1,30 @@ +error[E0503]: cannot use `(foo as Foo::A).0` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:25:16 + | +LL | let p = &mut foo; + | --- borrow of `foo` occurs here +... +LL | Foo::A(x) => x //[ast]~ ERROR [E0503] + | ^ use of borrowed `foo` + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:36:9 + | +LL | let r = &mut x; + | - borrow of `x` occurs here +LL | let _ = match x { //[mir]~ ERROR [E0503] +LL | x => x + 1, //[ast]~ ERROR [E0503] + | ^ use of borrowed `x` + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:38:9 + | +LL | let r = &mut x; + | - borrow of `x` occurs here +... +LL | y => y + 2, //[ast]~ ERROR [E0503] + | ^ use of borrowed `x` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.mir.stderr new file mode 100644 index 00000000000..8dec40520c4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.mir.stderr @@ -0,0 +1,73 @@ +error[E0503]: cannot use `foo` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:22:19 + | +LL | let p = &mut foo; + | -------- borrow of `foo` occurs here +LL | let _ = match foo { //[mir]~ ERROR [E0503] + | ^^^ use of borrowed `foo` +... +LL | drop(p); + | - borrow later used here + +error[E0503]: cannot use `foo` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:23:9 + | +LL | let p = &mut foo; + | -------- borrow of `foo` occurs here +LL | let _ = match foo { //[mir]~ ERROR [E0503] +LL | Foo::B => 1, //[mir]~ ERROR [E0503] + | ^^^^^^ use of borrowed `foo` +... +LL | drop(p); + | - borrow later used here + +error[E0503]: cannot use `foo.0` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:25:16 + | +LL | let p = &mut foo; + | -------- borrow of `foo` occurs here +... +LL | Foo::A(x) => x //[ast]~ ERROR [E0503] + | ^ use of borrowed `foo` +... +LL | drop(p); + | - borrow later used here + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:35:19 + | +LL | let r = &mut x; + | ------ borrow of `x` occurs here +LL | let _ = match x { //[mir]~ ERROR [E0503] + | ^ use of borrowed `x` +... +LL | drop(r); + | - borrow later used here + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:36:9 + | +LL | let r = &mut x; + | ------ borrow of `x` occurs here +LL | let _ = match x { //[mir]~ ERROR [E0503] +LL | x => x + 1, //[ast]~ ERROR [E0503] + | ^ use of borrowed `x` +... +LL | drop(r); + | - borrow later used here + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-match-already-borrowed.rs:38:9 + | +LL | let r = &mut x; + | ------ borrow of `x` occurs here +... +LL | y => y + 2, //[ast]~ ERROR [E0503] + | ^ use of borrowed `x` +... +LL | drop(r); + | - borrow later used here + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/compile-fail/borrowck/borrowck-match-already-borrowed.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.rs index c2136e62a7b..c2136e62a7b 100644 --- a/src/test/compile-fail/borrowck/borrowck-match-already-borrowed.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-already-borrowed.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.ast.nll.stderr new file mode 100644 index 00000000000..0191e0765b3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.ast.nll.stderr @@ -0,0 +1,58 @@ +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:27:13 + | +LL | x => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:34:13 + | +LL | E::Foo(x) => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:41:13 + | +LL | S { bar: x } => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:48:13 + | +LL | (x,) => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:55:13 + | +LL | [x,_,_] => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.ast.stderr new file mode 100644 index 00000000000..0d776f44daa --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.ast.stderr @@ -0,0 +1,43 @@ +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:27:13 + | +LL | x => { + | - first assignment to `x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:34:13 + | +LL | E::Foo(x) => { + | - first assignment to `x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:41:13 + | +LL | S { bar: x } => { + | - first assignment to `x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:48:13 + | +LL | (x,) => { + | - first assignment to `x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:55:13 + | +LL | [x,_,_] => { + | - first assignment to `x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.mir.stderr new file mode 100644 index 00000000000..0191e0765b3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.mir.stderr @@ -0,0 +1,58 @@ +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:27:13 + | +LL | x => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:34:13 + | +LL | E::Foo(x) => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:41:13 + | +LL | S { bar: x } => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:48:13 + | +LL | (x,) => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/borrowck-match-binding-is-assignment.rs:55:13 + | +LL | [x,_,_] => { + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable `x` + | ^^^^^^ cannot assign twice to immutable variable + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/compile-fail/borrowck/borrowck-match-binding-is-assignment.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.rs index 30047f84041..30047f84041 100644 --- a/src/test/compile-fail/borrowck/borrowck-match-binding-is-assignment.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-match-binding-is-assignment.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-by-capture.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-by-capture.nll.stderr new file mode 100644 index 00000000000..f5b7ca22278 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-by-capture.nll.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of captured variable in an `FnMut` closure + --> $DIR/borrowck-move-by-capture.rs:19:29 + | +LL | let _h = to_fn_once(move || -> isize { *bar }); //~ ERROR cannot move out of + | ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of captured variable in an `FnMut` closure + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-by-capture.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-by-capture.rs index bad52121043..bad52121043 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-by-capture.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-by-capture.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-by-capture.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-by-capture.stderr new file mode 100644 index 00000000000..a88af1596ef --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-by-capture.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of captured outer variable in an `FnMut` closure + --> $DIR/borrowck-move-by-capture.rs:19:29 + | +LL | let bar: Box<_> = box 3; + | --- captured outer variable +LL | let _g = to_fn_mut(|| { +LL | let _h = to_fn_once(move || -> isize { *bar }); //~ ERROR cannot move out of + | ^^^^^^^^^^^^^^^^ cannot move out of captured outer variable in an `FnMut` closure + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs index c02c6a71514..c02c6a71514 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr new file mode 100644 index 00000000000..1bdc8a85232 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr @@ -0,0 +1,12 @@ +error[E0505]: cannot move out of `*a` because it is borrowed + --> $DIR/borrowck-move-from-subpath-of-borrowed-path.rs:20:9 + | +LL | let b = &a; + | - borrow of `a` occurs here +LL | +LL | let z = *a; //~ ERROR: cannot move out of `*a` because it is borrowed + | ^ move out of `*a` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-unsafe-ptr.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-unsafe-ptr.nll.stderr new file mode 100644 index 00000000000..4f692bfc55e --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-unsafe-ptr.nll.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-from-unsafe-ptr.rs:13:13 + | +LL | let y = *x; //~ ERROR cannot move out of dereference of raw pointer + | ^^ + | | + | cannot move out of borrowed content + | help: consider using a reference instead: `&*x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-from-unsafe-ptr.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-unsafe-ptr.rs index 9a39ff6206b..9a39ff6206b 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-from-unsafe-ptr.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-unsafe-ptr.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-unsafe-ptr.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-unsafe-ptr.stderr new file mode 100644 index 00000000000..cad155103f0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-from-unsafe-ptr.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of dereference of raw pointer + --> $DIR/borrowck-move-from-unsafe-ptr.rs:13:13 + | +LL | let y = *x; //~ ERROR cannot move out of dereference of raw pointer + | ^^ + | | + | cannot move out of dereference of raw pointer + | help: consider using a reference instead: `&*x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.ast.nll.stderr new file mode 100644 index 00000000000..f670936dbac --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.ast.nll.stderr @@ -0,0 +1,32 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-in-irrefut-pat.rs:16:13 + | +LL | fn arg_item(&_x: &String) {} + | ^-- + | || + | |data moved here + | |help: to prevent move, use ref or ref mut: `ref _x` + | cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-in-irrefut-pat.rs:21:11 + | +LL | with(|&_x| ()) + | ^-- + | || + | |data moved here + | |help: to prevent move, use ref or ref mut: `ref _x` + | cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-in-irrefut-pat.rs:27:15 + | +LL | let &_x = &"hi".to_string(); + | -- ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref _x` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.ast.stderr new file mode 100644 index 00000000000..fa7fb649c8d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.ast.stderr @@ -0,0 +1,30 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-in-irrefut-pat.rs:16:13 + | +LL | fn arg_item(&_x: &String) {} + | ^-- + | || + | |hint: to prevent move, use `ref _x` or `ref mut _x` + | cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-in-irrefut-pat.rs:21:11 + | +LL | with(|&_x| ()) + | ^-- + | || + | |hint: to prevent move, use `ref _x` or `ref mut _x` + | cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-in-irrefut-pat.rs:27:9 + | +LL | let &_x = &"hi".to_string(); + | ^-- + | || + | |hint: to prevent move, use `ref _x` or `ref mut _x` + | cannot move out of borrowed content + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.mir.stderr new file mode 100644 index 00000000000..f670936dbac --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.mir.stderr @@ -0,0 +1,32 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-in-irrefut-pat.rs:16:13 + | +LL | fn arg_item(&_x: &String) {} + | ^-- + | || + | |data moved here + | |help: to prevent move, use ref or ref mut: `ref _x` + | cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-in-irrefut-pat.rs:21:11 + | +LL | with(|&_x| ()) + | ^-- + | || + | |data moved here + | |help: to prevent move, use ref or ref mut: `ref _x` + | cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-in-irrefut-pat.rs:27:15 + | +LL | let &_x = &"hi".to_string(); + | -- ^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref _x` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-in-irrefut-pat.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.rs index 5fdde484f82..5fdde484f82 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-in-irrefut-pat.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-in-irrefut-pat.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.ast.nll.stderr new file mode 100644 index 00000000000..d896ff491c6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.ast.nll.stderr @@ -0,0 +1,17 @@ +error[E0382]: use of moved value: `t` + --> $DIR/borrowck-move-moved-value-into-closure.rs:24:12 + | +LL | call_f(move|| { *t + 1 }); + | ------ - variable moved due to use in closure + | | + | value moved into closure here +LL | call_f(move|| { *t + 1 }); //[ast]~ ERROR capture of moved value + | ^^^^^^ - use occurs due to use in closure + | | + | value used here after move + | + = note: move occurs because `t` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.ast.stderr new file mode 100644 index 00000000000..c7576b1b32d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.ast.stderr @@ -0,0 +1,13 @@ +error[E0382]: capture of moved value: `t` + --> $DIR/borrowck-move-moved-value-into-closure.rs:24:22 + | +LL | call_f(move|| { *t + 1 }); + | ------ value moved (into closure) here +LL | call_f(move|| { *t + 1 }); //[ast]~ ERROR capture of moved value + | ^ value captured here after move + | + = note: move occurs because `t` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.mir.stderr new file mode 100644 index 00000000000..d896ff491c6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.mir.stderr @@ -0,0 +1,17 @@ +error[E0382]: use of moved value: `t` + --> $DIR/borrowck-move-moved-value-into-closure.rs:24:12 + | +LL | call_f(move|| { *t + 1 }); + | ------ - variable moved due to use in closure + | | + | value moved into closure here +LL | call_f(move|| { *t + 1 }); //[ast]~ ERROR capture of moved value + | ^^^^^^ - use occurs due to use in closure + | | + | value used here after move + | + = note: move occurs because `t` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-moved-value-into-closure.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.rs index 2bd6f75df1b..2bd6f75df1b 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-moved-value-into-closure.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-moved-value-into-closure.rs diff --git a/src/test/compile-fail/borrowck/borrowck-move-mut-base-ptr.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-mut-base-ptr.rs index 2fb89e6364b..2fb89e6364b 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-mut-base-ptr.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-mut-base-ptr.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-mut-base-ptr.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-mut-base-ptr.stderr new file mode 100644 index 00000000000..0cbcda4d2cd --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-mut-base-ptr.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `t0` because it is borrowed + --> $DIR/borrowck-move-mut-base-ptr.rs:18:9 + | +LL | let p: &isize = &*t0; // Freezes `*t0` + | --- borrow of `*t0` occurs here +LL | let t1 = t0; //~ ERROR cannot move out of `t0` + | ^^ move out of `t0` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.ast.nll.stderr new file mode 100644 index 00000000000..d67b63b5aa7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.ast.nll.stderr @@ -0,0 +1,19 @@ +error[E0382]: use of moved value: `a[..]` + --> $DIR/borrowck-move-out-from-array.rs:20:14 + | +LL | let [_, _x] = a; + | -- value moved here +LL | let [.., _y] = a; //[ast]~ ERROR [E0382] + | ^^ value used here after move + +error[E0382]: use of moved value: `a[..]` + --> $DIR/borrowck-move-out-from-array.rs:27:10 + | +LL | let [_x, _] = a; + | -- value moved here +LL | let [_y..] = a; //[ast]~ ERROR [E0382] + | ^^ value used here after move + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.ast.stderr new file mode 100644 index 00000000000..d19c23dce5f --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.ast.stderr @@ -0,0 +1,23 @@ +error[E0382]: use of moved value: `a[..]` + --> $DIR/borrowck-move-out-from-array.rs:20:14 + | +LL | let [_, _x] = a; + | -- value moved here +LL | let [.., _y] = a; //[ast]~ ERROR [E0382] + | ^^ value used here after move + | + = note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `a[..]` + --> $DIR/borrowck-move-out-from-array.rs:27:10 + | +LL | let [_x, _] = a; + | -- value moved here +LL | let [_y..] = a; //[ast]~ ERROR [E0382] + | ^^ value used here after move + | + = note: move occurs because `a[..]` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.mir.stderr new file mode 100644 index 00000000000..d67b63b5aa7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.mir.stderr @@ -0,0 +1,19 @@ +error[E0382]: use of moved value: `a[..]` + --> $DIR/borrowck-move-out-from-array.rs:20:14 + | +LL | let [_, _x] = a; + | -- value moved here +LL | let [.., _y] = a; //[ast]~ ERROR [E0382] + | ^^ value used here after move + +error[E0382]: use of moved value: `a[..]` + --> $DIR/borrowck-move-out-from-array.rs:27:10 + | +LL | let [_x, _] = a; + | -- value moved here +LL | let [_y..] = a; //[ast]~ ERROR [E0382] + | ^^ value used here after move + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-from-array.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.rs index 0db31cef0ed..0db31cef0ed 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-out-from-array.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-from-array.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-auto-deref.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-auto-deref.ast.stderr new file mode 100644 index 00000000000..94f7eba63a1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-auto-deref.ast.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-out-of-overloaded-auto-deref.rs:17:14 + | +LL | let _x = Rc::new(vec![1, 2]).into_iter(); + | ^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-auto-deref.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-auto-deref.mir.stderr new file mode 100644 index 00000000000..94f7eba63a1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-auto-deref.mir.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-out-of-overloaded-auto-deref.rs:17:14 + | +LL | let _x = Rc::new(vec![1, 2]).into_iter(); + | ^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs index af9202d8d77..af9202d8d77 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-overloaded-deref.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-deref.rs index fffcf575ab0..fffcf575ab0 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-out-of-overloaded-deref.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-deref.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-deref.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-deref.stderr new file mode 100644 index 00000000000..df5d911f6a8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-overloaded-deref.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-move-out-of-overloaded-deref.rs:14:14 + | +LL | let _x = *Rc::new("hi".to_string()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | cannot move out of borrowed content + | help: consider using a reference instead: `&*Rc::new("hi".to_string())` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-static-item.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-static-item.ast.stderr new file mode 100644 index 00000000000..65f70a7984f --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-static-item.ast.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of static item + --> $DIR/borrowck-move-out-of-static-item.rs:28:10 + | +LL | test(BAR); //[ast]~ ERROR cannot move out of static item [E0507] + | ^^^ cannot move out of static item + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-static-item.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-static-item.mir.stderr new file mode 100644 index 00000000000..65f70a7984f --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-static-item.mir.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of static item + --> $DIR/borrowck-move-out-of-static-item.rs:28:10 + | +LL | test(BAR); //[ast]~ ERROR cannot move out of static item [E0507] + | ^^^ cannot move out of static item + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-static-item.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-static-item.rs index 79eb68c95a0..79eb68c95a0 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-out-of-static-item.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-static-item.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr new file mode 100644 index 00000000000..15c7011d716 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr @@ -0,0 +1,34 @@ +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:20:11 + | +LL | match (S {f:"foo".to_string()}) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here +LL | //[mir]~^ ERROR [E0509] +LL | S {f:_s} => {} + | -- + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref _s` + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:28:20 + | +LL | let S {f:_s} = S {f:"foo".to_string()}; + | -- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref _s` + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:19 + | +LL | fn move_in_fn_arg(S {f:_s}: S) { + | ^^^^^--^ + | | | + | | data moved here + | | help: to prevent move, use ref or ref mut: `ref _s` + | cannot move out of here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.ast.stderr new file mode 100644 index 00000000000..4384f046d16 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.ast.stderr @@ -0,0 +1,30 @@ +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:22:9 + | +LL | S {f:_s} => {} + | ^^^^^--^ + | | | + | | hint: to prevent move, use `ref _s` or `ref mut _s` + | cannot move out of here + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:28:9 + | +LL | let S {f:_s} = S {f:"foo".to_string()}; + | ^^^^^--^ + | | | + | | hint: to prevent move, use `ref _s` or `ref mut _s` + | cannot move out of here + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:19 + | +LL | fn move_in_fn_arg(S {f:_s}: S) { + | ^^^^^--^ + | | | + | | hint: to prevent move, use `ref _s` or `ref mut _s` + | cannot move out of here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr new file mode 100644 index 00000000000..15c7011d716 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr @@ -0,0 +1,34 @@ +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:20:11 + | +LL | match (S {f:"foo".to_string()}) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here +LL | //[mir]~^ ERROR [E0509] +LL | S {f:_s} => {} + | -- + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref _s` + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:28:20 + | +LL | let S {f:_s} = S {f:"foo".to_string()}; + | -- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref _s` + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-struct-with-dtor.rs:33:19 + | +LL | fn move_in_fn_arg(S {f:_s}: S) { + | ^^^^^--^ + | | | + | | data moved here + | | help: to prevent move, use ref or ref mut: `ref _s` + | cannot move out of here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.rs index 4bb66ace026..4bb66ace026 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-struct-with-dtor.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.nll.stderr new file mode 100644 index 00000000000..c69ae8755a9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.nll.stderr @@ -0,0 +1,33 @@ +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:17:11 + | +LL | match S("foo".to_string()) { + | ^^^^^^^^^^^^^^^^^^^^ cannot move out of here +LL | S(_s) => {} + | -- + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref _s` + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:24:17 + | +LL | let S(_s) = S("foo".to_string()); + | -- ^^^^^^^^^^^^^^^^^^^^ cannot move out of here + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref _s` + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:28:19 + | +LL | fn move_in_fn_arg(S(_s): S) { + | ^^--^ + | | | + | | data moved here + | | help: to prevent move, use ref or ref mut: `ref _s` + | cannot move out of here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs index f5fedb8d487..f5fedb8d487 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.stderr new file mode 100644 index 00000000000..78a065b60da --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.stderr @@ -0,0 +1,30 @@ +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:18:9 + | +LL | S(_s) => {} + | ^^--^ + | | | + | | hint: to prevent move, use `ref _s` or `ref mut _s` + | cannot move out of here + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:24:9 + | +LL | let S(_s) = S("foo".to_string()); + | ^^--^ + | | | + | | hint: to prevent move, use `ref _s` or `ref mut _s` + | cannot move out of here + +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-move-out-of-tuple-struct-with-dtor.rs:28:19 + | +LL | fn move_in_fn_arg(S(_s): S) { + | ^^--^ + | | | + | | hint: to prevent move, use `ref _s` or `ref mut _s` + | cannot move out of here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-subcomponent.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-subcomponent.nll.stderr new file mode 100644 index 00000000000..cd8d0cdfee2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-subcomponent.nll.stderr @@ -0,0 +1,13 @@ +error[E0505]: cannot move out of `a.x` because it is borrowed + --> $DIR/borrowck-move-subcomponent.rs:25:14 + | +LL | let pb = &a; + | -- borrow of `a` occurs here +LL | let S { x: ax } = a; //~ ERROR cannot move out + | ^^ move out of `a.x` occurs here +LL | f(pb); + | -- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/borrowck/borrowck-move-subcomponent.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-subcomponent.rs index 88871dda659..88871dda659 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-subcomponent.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-subcomponent.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-move-subcomponent.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-subcomponent.stderr new file mode 100644 index 00000000000..f249f0f22cd --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-move-subcomponent.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `a.x` because it is borrowed + --> $DIR/borrowck-move-subcomponent.rs:25:14 + | +LL | let pb = &a; + | - borrow of `a` occurs here +LL | let S { x: ax } = a; //~ ERROR cannot move out + | ^^ move out of `a.x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-multiple-captures.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-multiple-captures.nll.stderr new file mode 100644 index 00000000000..ce1880c584a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-multiple-captures.nll.stderr @@ -0,0 +1,103 @@ +error[E0505]: cannot move out of `x1` because it is borrowed + --> $DIR/borrowck-multiple-captures.rs:22:19 + | +LL | let p1 = &x1; + | --- borrow of `x1` occurs here +... +LL | thread::spawn(move|| { + | ^^^^^^ move out of `x1` occurs here +LL | drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed + | -- move occurs due to use in closure +... +LL | borrow(&*p1); + | ---- borrow later used here + +error[E0505]: cannot move out of `x2` because it is borrowed + --> $DIR/borrowck-multiple-captures.rs:22:19 + | +LL | let p2 = &x2; + | --- borrow of `x2` occurs here +LL | thread::spawn(move|| { + | ^^^^^^ move out of `x2` occurs here +LL | drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed +LL | drop(x2); //~ ERROR cannot move `x2` into closure because it is borrowed + | -- move occurs due to use in closure +... +LL | borrow(&*p2); + | ---- borrow later used here + +error[E0382]: use of moved value: `x1` + --> $DIR/borrowck-multiple-captures.rs:35:19 + | +LL | drop(x1); + | -- value moved here +... +LL | thread::spawn(move|| { + | ^^^^^^ value used here after move +LL | drop(x1); //~ ERROR capture of moved value: `x1` + | -- use occurs due to use in closure + | + = note: move occurs because `x1` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x2` + --> $DIR/borrowck-multiple-captures.rs:35:19 + | +LL | drop(x2); + | -- value moved here +LL | thread::spawn(move|| { + | ^^^^^^ value used here after move +LL | drop(x1); //~ ERROR capture of moved value: `x1` +LL | drop(x2); //~ ERROR capture of moved value: `x2` + | -- use occurs due to use in closure + | + = note: move occurs because `x2` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-multiple-captures.rs:46:14 + | +LL | drop(x); //~ ERROR cannot move `x` into closure because it is borrowed + | - value moved here +LL | drop(x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrowck-multiple-captures.rs:44:19 + | +LL | let p = &x; + | -- borrow of `x` occurs here +LL | thread::spawn(move|| { + | ^^^^^^ move out of `x` occurs here +LL | drop(x); //~ ERROR cannot move `x` into closure because it is borrowed + | - move occurs due to use in closure +... +LL | borrow(&*p); + | --- borrow later used here + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-multiple-captures.rs:56:14 + | +LL | drop(x); //~ ERROR capture of moved value: `x` + | - value moved here +LL | drop(x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-multiple-captures.rs:54:19 + | +LL | drop(x); + | - value moved here +LL | thread::spawn(move|| { + | ^^^^^^ value used here after move +LL | drop(x); //~ ERROR capture of moved value: `x` + | - use occurs due to use in closure + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error: aborting due to 8 previous errors + +Some errors occurred: E0382, E0505. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-multiple-captures.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-multiple-captures.rs index 042b914ce41..042b914ce41 100644 --- a/src/test/compile-fail/borrowck/borrowck-multiple-captures.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-multiple-captures.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-multiple-captures.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-multiple-captures.stderr new file mode 100644 index 00000000000..3163ca63452 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-multiple-captures.stderr @@ -0,0 +1,84 @@ +error[E0504]: cannot move `x1` into closure because it is borrowed + --> $DIR/borrowck-multiple-captures.rs:23:14 + | +LL | let p1 = &x1; + | -- borrow of `x1` occurs here +... +LL | drop(x1); //~ ERROR cannot move `x1` into closure because it is borrowed + | ^^ move into closure occurs here + +error[E0504]: cannot move `x2` into closure because it is borrowed + --> $DIR/borrowck-multiple-captures.rs:24:14 + | +LL | let p2 = &x2; + | -- borrow of `x2` occurs here +... +LL | drop(x2); //~ ERROR cannot move `x2` into closure because it is borrowed + | ^^ move into closure occurs here + +error[E0382]: capture of moved value: `x1` + --> $DIR/borrowck-multiple-captures.rs:36:14 + | +LL | drop(x1); + | -- value moved here +... +LL | drop(x1); //~ ERROR capture of moved value: `x1` + | ^^ value captured here after move + | + = note: move occurs because `x1` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0382]: capture of moved value: `x2` + --> $DIR/borrowck-multiple-captures.rs:37:14 + | +LL | drop(x2); + | -- value moved here +... +LL | drop(x2); //~ ERROR capture of moved value: `x2` + | ^^ value captured here after move + | + = note: move occurs because `x2` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0504]: cannot move `x` into closure because it is borrowed + --> $DIR/borrowck-multiple-captures.rs:45:14 + | +LL | let p = &x; + | - borrow of `x` occurs here +LL | thread::spawn(move|| { +LL | drop(x); //~ ERROR cannot move `x` into closure because it is borrowed + | ^ move into closure occurs here + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-multiple-captures.rs:46:14 + | +LL | drop(x); //~ ERROR cannot move `x` into closure because it is borrowed + | - value moved here +LL | drop(x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0382]: capture of moved value: `x` + --> $DIR/borrowck-multiple-captures.rs:55:14 + | +LL | drop(x); + | - value moved here +LL | thread::spawn(move|| { +LL | drop(x); //~ ERROR capture of moved value: `x` + | ^ value captured here after move + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/borrowck-multiple-captures.rs:56:14 + | +LL | drop(x); //~ ERROR capture of moved value: `x` + | - value moved here +LL | drop(x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error: aborting due to 8 previous errors + +Some errors occurred: E0382, E0504. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-addr-of-imm-var.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-addr-of-imm-var.nll.stderr new file mode 100644 index 00000000000..352ace41d93 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-addr-of-imm-var.nll.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/borrowck-mut-addr-of-imm-var.rs:13:25 + | +LL | let x: isize = 3; + | - help: consider changing this to be mutable: `mut x` +LL | let y: &mut isize = &mut x; //~ ERROR cannot borrow + | ^^^^^^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-mut-addr-of-imm-var.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-addr-of-imm-var.rs index b6626a835e4..b6626a835e4 100644 --- a/src/test/compile-fail/borrowck/borrowck-mut-addr-of-imm-var.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-addr-of-imm-var.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-addr-of-imm-var.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-addr-of-imm-var.stderr new file mode 100644 index 00000000000..0859a4e0f55 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-addr-of-imm-var.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow immutable local variable `x` as mutable + --> $DIR/borrowck-mut-addr-of-imm-var.rs:13:30 + | +LL | let x: isize = 3; + | - consider changing this to `mut x` +LL | let y: &mut isize = &mut x; //~ ERROR cannot borrow + | ^ cannot borrow mutably + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.ast.nll.stderr new file mode 100644 index 00000000000..b3c86a56091 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.ast.nll.stderr @@ -0,0 +1,32 @@ +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-linear-errors.rs:23:30 + | +LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ---- ^^^^^^ second mutable borrow occurs here + | | + | borrow used here in later iteration of loop +... +LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ------ first mutable borrow occurs here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-linear-errors.rs:25:30 + | +LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ---- borrow used here in later iteration of loop +LL | //[mir]~^ ERROR [E0499] +LL | 2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR [E0499] +LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ------ first mutable borrow occurs here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-linear-errors.rs:27:30 + | +LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ^^^^^^ mutable borrow starts here in previous iteration of loop + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.ast.stderr new file mode 100644 index 00000000000..7a43cf15422 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.ast.stderr @@ -0,0 +1,36 @@ +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-linear-errors.rs:23:35 + | +LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ^ mutable borrow starts here in previous iteration of loop +... +LL | } + | - mutable borrow ends here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-linear-errors.rs:25:35 + | +LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | - first mutable borrow occurs here +LL | //[mir]~^ ERROR [E0499] +LL | 2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-linear-errors.rs:27:35 + | +LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | - first mutable borrow occurs here +... +LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr new file mode 100644 index 00000000000..b3c86a56091 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr @@ -0,0 +1,32 @@ +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-linear-errors.rs:23:30 + | +LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ---- ^^^^^^ second mutable borrow occurs here + | | + | borrow used here in later iteration of loop +... +LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ------ first mutable borrow occurs here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-linear-errors.rs:25:30 + | +LL | 1 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ---- borrow used here in later iteration of loop +LL | //[mir]~^ ERROR [E0499] +LL | 2 => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR [E0499] +LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ------ first mutable borrow occurs here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-linear-errors.rs:27:30 + | +LL | _ => { addr.push(&mut x); } //[ast]~ ERROR [E0499] + | ^^^^^^ mutable borrow starts here in previous iteration of loop + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.rs index 7b0a71815a5..7b0a71815a5 100644 --- a/src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-linear-errors.rs diff --git a/src/test/compile-fail/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs index bdeb7ea69bd..bdeb7ea69bd 100644 --- a/src/test/compile-fail/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr new file mode 100644 index 00000000000..28b740b23f9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr @@ -0,0 +1,26 @@ +error[E0502]: cannot borrow `t0` as mutable because `*t0` is also borrowed as immutable + --> $DIR/borrowck-mut-borrow-of-mut-base-ptr.rs:19:23 + | +LL | let p: &isize = &*t0; // Freezes `*t0` + | --- immutable borrow occurs here +LL | let mut t2 = &mut t0; //~ ERROR cannot borrow `t0` + | ^^ mutable borrow occurs here +LL | **t2 += 1; // Mutates `*t0` +LL | } + | - immutable borrow ends here + +error[E0499]: cannot borrow `t0` as mutable more than once at a time + --> $DIR/borrowck-mut-borrow-of-mut-base-ptr.rs:26:23 + | +LL | let p: &mut isize = &mut *t0; // Claims `*t0` + | --- first mutable borrow occurs here +LL | let mut t2 = &mut t0; //~ ERROR cannot borrow `t0` + | ^^ second mutable borrow occurs here +LL | **t2 += 1; // Mutates `*t0` but not through `*p` +LL | } + | - first borrow ends here + +error: aborting due to 2 previous errors + +Some errors occurred: E0499, E0502. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-slice-of-imm-vec.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-slice-of-imm-vec.nll.stderr new file mode 100644 index 00000000000..7c151da3c36 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-slice-of-imm-vec.nll.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable + --> $DIR/borrowck-mut-slice-of-imm-vec.rs:17:11 + | +LL | let v = vec![1, 2, 3]; + | - help: consider changing this to be mutable: `mut v` +LL | write(&mut v); //~ ERROR cannot borrow + | ^^^^^^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-mut-slice-of-imm-vec.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-slice-of-imm-vec.rs index 4e0304e20c0..4e0304e20c0 100644 --- a/src/test/compile-fail/borrowck/borrowck-mut-slice-of-imm-vec.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-slice-of-imm-vec.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-slice-of-imm-vec.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-slice-of-imm-vec.stderr new file mode 100644 index 00000000000..e2fd9d771f1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mut-slice-of-imm-vec.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow immutable local variable `v` as mutable + --> $DIR/borrowck-mut-slice-of-imm-vec.rs:17:16 + | +LL | let v = vec![1, 2, 3]; + | - consider changing this to `mut v` +LL | write(&mut v); //~ ERROR cannot borrow + | ^ cannot borrow mutably + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-mutate-in-guard.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-mutate-in-guard.rs index e35edca639e..e35edca639e 100644 --- a/src/test/compile-fail/borrowck/borrowck-mutate-in-guard.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mutate-in-guard.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-mutate-in-guard.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-mutate-in-guard.stderr new file mode 100644 index 00000000000..7a111a1bbcc --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-mutate-in-guard.stderr @@ -0,0 +1,22 @@ +error[E0302]: cannot assign in a pattern guard + --> $DIR/borrowck-mutate-in-guard.rs:20:25 + | +LL | Enum::A(_) if { x = Enum::B(false); false } => 1, + | ^^^^^^^^^^^^^^^^^^ assignment in pattern guard + +error[E0301]: cannot mutably borrow in a pattern guard + --> $DIR/borrowck-mutate-in-guard.rs:22:38 + | +LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1, + | ^ borrowed mutably in pattern guard + +error[E0302]: cannot assign in a pattern guard + --> $DIR/borrowck-mutate-in-guard.rs:22:41 + | +LL | Enum::A(_) if { let y = &mut x; *y = Enum::B(false); false } => 1, + | ^^^^^^^^^^^^^^^^^^^ assignment in pattern guard + +error: aborting due to 3 previous errors + +Some errors occurred: E0301, E0302. +For more information about an error, try `rustc --explain E0301`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-no-cycle-in-exchange-heap.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-no-cycle-in-exchange-heap.nll.stderr new file mode 100644 index 00000000000..9bb1e825f25 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-no-cycle-in-exchange-heap.nll.stderr @@ -0,0 +1,13 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrowck-no-cycle-in-exchange-heap.rs:26:15 + | +LL | cycle::node(ref mut y) => { + | --------- borrow of `x.0` occurs here +LL | y.a = x; //~ ERROR cannot move out of + | --- ^ move out of `x` occurs here + | | + | borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/borrowck/borrowck-no-cycle-in-exchange-heap.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-no-cycle-in-exchange-heap.rs index 8cb7423f3cb..8cb7423f3cb 100644 --- a/src/test/compile-fail/borrowck/borrowck-no-cycle-in-exchange-heap.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-no-cycle-in-exchange-heap.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-no-cycle-in-exchange-heap.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-no-cycle-in-exchange-heap.stderr new file mode 100644 index 00000000000..693f25e243c --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-no-cycle-in-exchange-heap.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrowck-no-cycle-in-exchange-heap.rs:26:15 + | +LL | cycle::node(ref mut y) => { + | --------- borrow of `x.0` occurs here +LL | y.a = x; //~ ERROR cannot move out of + | ^ move out of `x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/borrowck/borrowck-object-lifetime.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-object-lifetime.rs index 021b3f38e00..021b3f38e00 100644 --- a/src/test/compile-fail/borrowck/borrowck-object-lifetime.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-object-lifetime.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-object-lifetime.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-object-lifetime.stderr new file mode 100644 index 00000000000..e7ae92d822e --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-object-lifetime.stderr @@ -0,0 +1,23 @@ +error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-object-lifetime.rs:26:14 + | +LL | let _y = x.borrowed(); + | - immutable borrow occurs here +LL | let _z = x.mut_borrowed(); //~ ERROR cannot borrow + | ^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `x` as mutable because `*x` is also borrowed as immutable + --> $DIR/borrowck-object-lifetime.rs:31:19 + | +LL | let _y = x.borrowed(); + | - immutable borrow occurs here +LL | let _z = &mut x; //~ ERROR cannot borrow + | ^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-or-init.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-or-init.nll.stderr new file mode 100644 index 00000000000..dd8bf879735 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-or-init.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `i` + --> $DIR/borrowck-or-init.rs:15:20 + | +LL | println!("{}", i); //~ ERROR use of possibly uninitialized variable: `i` + | ^ use of possibly uninitialized `i` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-or-init.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-or-init.rs index 27871a6ab16..27871a6ab16 100644 --- a/src/test/compile-fail/borrowck/borrowck-or-init.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-or-init.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-or-init.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-or-init.stderr new file mode 100644 index 00000000000..bc1c3a51667 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-or-init.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `i` + --> $DIR/borrowck-or-init.rs:15:20 + | +LL | println!("{}", i); //~ ERROR use of possibly uninitialized variable: `i` + | ^ use of possibly uninitialized `i` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-call.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-call.nll.stderr new file mode 100644 index 00000000000..dc8d731dede --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-call.nll.stderr @@ -0,0 +1,23 @@ +error[E0596]: cannot borrow `s` as mutable, as it is not declared as mutable + --> $DIR/borrowck-overloaded-call.rs:77:5 + | +LL | let s = SFnMut { + | - help: consider changing this to be mutable: `mut s` +... +LL | s(3); //~ ERROR cannot borrow immutable local variable `s` as mutable + | ^ cannot borrow as mutable + +error[E0382]: use of moved value: `s` + --> $DIR/borrowck-overloaded-call.rs:85:5 + | +LL | s(" world".to_string()); + | - value moved here +LL | s(" world".to_string()); //~ ERROR use of moved value: `s` + | ^ value used here after move + | + = note: move occurs because `s` has type `SFnOnce`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +Some errors occurred: E0382, E0596. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-overloaded-call.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-call.rs index 41f3e472cd1..41f3e472cd1 100644 --- a/src/test/compile-fail/borrowck/borrowck-overloaded-call.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-call.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-call.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-call.stderr new file mode 100644 index 00000000000..213d78339e2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-call.stderr @@ -0,0 +1,33 @@ +error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-overloaded-call.rs:69:5 + | +LL | let sp = &mut s; + | - mutable borrow occurs here +LL | s(3); //~ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable + | ^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error[E0596]: cannot borrow immutable local variable `s` as mutable + --> $DIR/borrowck-overloaded-call.rs:77:5 + | +LL | let s = SFnMut { + | - consider changing this to `mut s` +... +LL | s(3); //~ ERROR cannot borrow immutable local variable `s` as mutable + | ^ cannot borrow mutably + +error[E0382]: use of moved value: `s` + --> $DIR/borrowck-overloaded-call.rs:85:5 + | +LL | s(" world".to_string()); + | - value moved here +LL | s(" world".to_string()); //~ ERROR use of moved value: `s` + | ^ value used here after move + | + = note: move occurs because `s` has type `SFnOnce`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +Some errors occurred: E0382, E0502, E0596. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.nll.stderr new file mode 100644 index 00000000000..874e6d74b64 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0506]: cannot assign to `v` because it is borrowed + --> $DIR/borrowck-overloaded-index-and-overloaded-deref.rs:44:5 + | +LL | let i = &v[0].f; + | - borrow of `v` occurs here +LL | v = MyVec { x: MyPtr { x: Foo { f: 23 } } }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `v` occurs here +... +LL | read(*i); + | -- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.stderr new file mode 100644 index 00000000000..8343b60dfbf --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.stderr @@ -0,0 +1,11 @@ +error[E0506]: cannot assign to `v` because it is borrowed + --> $DIR/borrowck-overloaded-index-and-overloaded-deref.rs:44:5 + | +LL | let i = &v[0].f; + | - borrow of `v` occurs here +LL | v = MyVec { x: MyPtr { x: Foo { f: 23 } } }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `v` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.mir.stderr new file mode 100644 index 00000000000..874e6d74b64 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.mir.stderr @@ -0,0 +1,14 @@ +error[E0506]: cannot assign to `v` because it is borrowed + --> $DIR/borrowck-overloaded-index-and-overloaded-deref.rs:44:5 + | +LL | let i = &v[0].f; + | - borrow of `v` occurs here +LL | v = MyVec { x: MyPtr { x: Foo { f: 23 } } }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `v` occurs here +... +LL | read(*i); + | -- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/borrowck/borrowck-overloaded-index-and-overloaded-deref.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.rs index 931d053ae7b..931d053ae7b 100644 --- a/src/test/compile-fail/borrowck/borrowck-overloaded-index-and-overloaded-deref.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-and-overloaded-deref.rs diff --git a/src/test/compile-fail/borrowck/borrowck-overloaded-index-autoderef.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-autoderef.rs index b726c46d5d5..b726c46d5d5 100644 --- a/src/test/compile-fail/borrowck/borrowck-overloaded-index-autoderef.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-autoderef.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-autoderef.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-autoderef.stderr new file mode 100644 index 00000000000..c17eed1322b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-autoderef.stderr @@ -0,0 +1,76 @@ +error[E0502]: cannot borrow `*f` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-overloaded-index-autoderef.rs:45:15 + | +LL | let _p = &mut f[&s]; + | - mutable borrow occurs here +LL | let _q = &f[&s]; //~ ERROR cannot borrow + | ^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error[E0499]: cannot borrow `*f` as mutable more than once at a time + --> $DIR/borrowck-overloaded-index-autoderef.rs:50:19 + | +LL | let _p = &mut f[&s]; + | - first mutable borrow occurs here +LL | let _q = &mut f[&s]; //~ ERROR cannot borrow + | ^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `f.foo` as mutable more than once at a time + --> $DIR/borrowck-overloaded-index-autoderef.rs:59:19 + | +LL | let _p = &mut f.foo[&s]; + | ----- first mutable borrow occurs here +LL | let _q = &mut f.foo[&s]; //~ ERROR cannot borrow + | ^^^^^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `f.foo` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-overloaded-index-autoderef.rs:69:19 + | +LL | let _p = &f.foo[&s]; + | ----- immutable borrow occurs here +LL | let _q = &mut f.foo[&s]; //~ ERROR cannot borrow + | ^^^^^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error[E0506]: cannot assign to `f.foo` because it is borrowed + --> $DIR/borrowck-overloaded-index-autoderef.rs:74:5 + | +LL | let _p = &f.foo[&s]; + | ----- borrow of `f.foo` occurs here +LL | f.foo = g; //~ ERROR cannot assign + | ^^^^^^^^^ assignment to borrowed `f.foo` occurs here + +error[E0506]: cannot assign to `*f` because it is borrowed + --> $DIR/borrowck-overloaded-index-autoderef.rs:79:5 + | +LL | let _p = &f.foo[&s]; + | ----- borrow of `*f` occurs here +LL | *f = g; //~ ERROR cannot assign + | ^^^^^^ assignment to borrowed `*f` occurs here + +error[E0506]: cannot assign to `f.foo` because it is borrowed + --> $DIR/borrowck-overloaded-index-autoderef.rs:84:5 + | +LL | let _p = &mut f.foo[&s]; + | ----- borrow of `f.foo` occurs here +LL | f.foo = g; //~ ERROR cannot assign + | ^^^^^^^^^ assignment to borrowed `f.foo` occurs here + +error[E0506]: cannot assign to `*f` because it is borrowed + --> $DIR/borrowck-overloaded-index-autoderef.rs:89:5 + | +LL | let _p = &mut f.foo[&s]; + | ----- borrow of `*f` occurs here +LL | *f = g; //~ ERROR cannot assign + | ^^^^^^ assignment to borrowed `*f` occurs here + +error: aborting due to 8 previous errors + +Some errors occurred: E0499, E0502, E0506. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-from-vec.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-from-vec.nll.stderr new file mode 100644 index 00000000000..4a72d7f3302 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-from-vec.nll.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/borrowck-overloaded-index-move-from-vec.rs:30:15 + | +LL | let bad = v[0]; + | ^^^^ + | | + | cannot move out of borrowed content + | help: consider using a reference instead: `&v[0]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/borrowck-overloaded-index-move-from-vec.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-from-vec.rs index df72c2b0af7..df72c2b0af7 100644 --- a/src/test/compile-fail/borrowck/borrowck-overloaded-index-move-from-vec.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-from-vec.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-from-vec.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-from-vec.stderr new file mode 100644 index 00000000000..56246cbf770 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-from-vec.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of indexed content + --> $DIR/borrowck-overloaded-index-move-from-vec.rs:30:15 + | +LL | let bad = v[0]; + | ^^^^ + | | + | cannot move out of indexed content + | help: consider using a reference instead: `&v[0]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-index.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-index.nll.stderr new file mode 100644 index 00000000000..824d8298ecb --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-index.nll.stderr @@ -0,0 +1,14 @@ +error[E0382]: use of moved value: `s` + --> $DIR/borrowck-overloaded-index-move-index.rs:63:7 + | +LL | println!("{}", f[s]); + | - value moved here +... +LL | f[s] = 10; + | ^ value used here after move + | + = note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-overloaded-index-move-index.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-index.rs index d8615d19053..d8615d19053 100644 --- a/src/test/compile-fail/borrowck/borrowck-overloaded-index-move-index.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-index.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-index.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-index.stderr new file mode 100644 index 00000000000..cfa5a6e317d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-move-index.stderr @@ -0,0 +1,33 @@ +error[E0505]: cannot move out of `s` because it is borrowed + --> $DIR/borrowck-overloaded-index-move-index.rs:60:22 + | +LL | let rs = &mut s; + | - borrow of `s` occurs here +LL | +LL | println!("{}", f[s]); + | ^ move out of `s` occurs here + +error[E0505]: cannot move out of `s` because it is borrowed + --> $DIR/borrowck-overloaded-index-move-index.rs:63:7 + | +LL | let rs = &mut s; + | - borrow of `s` occurs here +... +LL | f[s] = 10; + | ^ move out of `s` occurs here + +error[E0382]: use of moved value: `s` + --> $DIR/borrowck-overloaded-index-move-index.rs:63:7 + | +LL | println!("{}", f[s]); + | - value moved here +... +LL | f[s] = 10; + | ^ value used here after move + | + = note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +Some errors occurred: E0382, E0505. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.ast.nll.stderr new file mode 100644 index 00000000000..3a2bfb18cb9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.ast.nll.stderr @@ -0,0 +1,33 @@ +error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-overloaded-index-ref-index.rs:62:22 + | +LL | let rs = &mut s; + | ------ mutable borrow occurs here +LL | println!("{}", f[&s]); + | ^^ immutable borrow occurs here +... +LL | drop(rs); + | -- borrow later used here + +error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-overloaded-index-ref-index.rs:65:7 + | +LL | let rs = &mut s; + | ------ mutable borrow occurs here +... +LL | f[&s] = 10; + | ^^ immutable borrow occurs here +... +LL | drop(rs); + | -- borrow later used here + +error[E0594]: cannot assign to data in a `&` reference + --> $DIR/borrowck-overloaded-index-ref-index.rs:71:5 + | +LL | s[2] = 20; + | ^^^^^^^^^ cannot assign + +error: aborting due to 3 previous errors + +Some errors occurred: E0502, E0594. +For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.ast.stderr new file mode 100644 index 00000000000..63024acc7df --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.ast.stderr @@ -0,0 +1,33 @@ +error[E0594]: cannot assign to immutable indexed content + --> $DIR/borrowck-overloaded-index-ref-index.rs:71:5 + | +LL | s[2] = 20; + | ^^^^^^^^^ cannot borrow as mutable + +error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-overloaded-index-ref-index.rs:62:23 + | +LL | let rs = &mut s; + | - mutable borrow occurs here +LL | println!("{}", f[&s]); + | ^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-overloaded-index-ref-index.rs:65:8 + | +LL | let rs = &mut s; + | - mutable borrow occurs here +... +LL | f[&s] = 10; + | ^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error: aborting due to 3 previous errors + +Some errors occurred: E0502, E0594. +For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.mir.stderr new file mode 100644 index 00000000000..3a2bfb18cb9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.mir.stderr @@ -0,0 +1,33 @@ +error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-overloaded-index-ref-index.rs:62:22 + | +LL | let rs = &mut s; + | ------ mutable borrow occurs here +LL | println!("{}", f[&s]); + | ^^ immutable borrow occurs here +... +LL | drop(rs); + | -- borrow later used here + +error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-overloaded-index-ref-index.rs:65:7 + | +LL | let rs = &mut s; + | ------ mutable borrow occurs here +... +LL | f[&s] = 10; + | ^^ immutable borrow occurs here +... +LL | drop(rs); + | -- borrow later used here + +error[E0594]: cannot assign to data in a `&` reference + --> $DIR/borrowck-overloaded-index-ref-index.rs:71:5 + | +LL | s[2] = 20; + | ^^^^^^^^^ cannot assign + +error: aborting due to 3 previous errors + +Some errors occurred: E0502, E0594. +For more information about an error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/borrowck-overloaded-index-ref-index.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.rs index f4f40e0407f..f4f40e0407f 100644 --- a/src/test/compile-fail/borrowck/borrowck-overloaded-index-ref-index.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-overloaded-index-ref-index.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-1.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-1.nll.stderr new file mode 100644 index 00000000000..0444bf97c65 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-1.nll.stderr @@ -0,0 +1,23 @@ +error[E0382]: assign of moved value: `t` + --> $DIR/borrowck-partial-reinit-1.rs:37:5 + | +LL | drop(t); + | - value moved here +LL | t.b = Some(u); + | ^^^ value assigned here after move + | + = note: move occurs because `t` has type `Test2`, which does not implement the `Copy` trait + +error[E0382]: assign of moved value: `t` + --> $DIR/borrowck-partial-reinit-1.rs:43:5 + | +LL | drop(t); + | - value moved here +LL | t.0 = Some(u); + | ^^^ value assigned here after move + | + = note: move occurs because `t` has type `Test3`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-partial-reinit-1.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-1.rs index 1ee040a0705..1ee040a0705 100644 --- a/src/test/compile-fail/borrowck/borrowck-partial-reinit-1.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-1.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-1.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-1.stderr new file mode 100644 index 00000000000..c03921cd3dd --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-1.stderr @@ -0,0 +1,15 @@ +error[E0383]: partial reinitialization of uninitialized structure `t` + --> $DIR/borrowck-partial-reinit-1.rs:37:5 + | +LL | t.b = Some(u); + | ^^^^^^^^^^^^^ + +error[E0383]: partial reinitialization of uninitialized structure `t` + --> $DIR/borrowck-partial-reinit-1.rs:43:5 + | +LL | t.0 = Some(u); + | ^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0383`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-2.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-2.nll.stderr new file mode 100644 index 00000000000..14272fa3ed5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-2.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: assign of moved value: `t` + --> $DIR/borrowck-partial-reinit-2.rs:25:5 + | +LL | let mut u = Test { a: 2, b: Some(Box::new(t))}; + | - value moved here +LL | t.b = Some(Box::new(u)); + | ^^^ value assigned here after move + | + = note: move occurs because `t` has type `Test`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-partial-reinit-2.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-2.rs index c9cdeff9c7a..c9cdeff9c7a 100644 --- a/src/test/compile-fail/borrowck/borrowck-partial-reinit-2.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-2.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-2.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-2.stderr new file mode 100644 index 00000000000..4ed87b95292 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-2.stderr @@ -0,0 +1,9 @@ +error[E0383]: partial reinitialization of uninitialized structure `t` + --> $DIR/borrowck-partial-reinit-2.rs:25:5 + | +LL | t.b = Some(Box::new(u)); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0383`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-3.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-3.nll.stderr new file mode 100644 index 00000000000..3979f1e6753 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-3.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: assign of moved value: `x.0` + --> $DIR/borrowck-partial-reinit-3.rs:20:5 + | +LL | mem::drop(x.0); + | --- value moved here +LL | x.0.f = 3; + | ^^^^^^^^^ value assigned here after move + | + = note: move occurs because `x.0` has type `Test`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-partial-reinit-3.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-3.rs index 0aa73892b82..0aa73892b82 100644 --- a/src/test/compile-fail/borrowck/borrowck-partial-reinit-3.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-3.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-3.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-3.stderr new file mode 100644 index 00000000000..66465c07374 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-3.stderr @@ -0,0 +1,9 @@ +error[E0383]: partial reinitialization of uninitialized structure `x.0` + --> $DIR/borrowck-partial-reinit-3.rs:20:5 + | +LL | x.0.f = 3; + | ^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0383`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-4.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-4.nll.stderr new file mode 100644 index 00000000000..e1ede72a7c9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-4.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: assign of possibly uninitialized variable: `x.0` + --> $DIR/borrowck-partial-reinit-4.rs:27:5 + | +LL | (x.0).0 = Some(Test); + | ^^^^^^^ use of possibly uninitialized `x.0` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-partial-reinit-4.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-4.rs index 774e04ecb29..774e04ecb29 100644 --- a/src/test/compile-fail/borrowck/borrowck-partial-reinit-4.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-4.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-4.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-4.stderr new file mode 100644 index 00000000000..229a53ad827 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-partial-reinit-4.stderr @@ -0,0 +1,9 @@ +error[E0383]: partial reinitialization of uninitialized structure `x.0` + --> $DIR/borrowck-partial-reinit-4.rs:27:5 + | +LL | (x.0).0 = Some(Test); + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0383`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.ast.nll.stderr new file mode 100644 index 00000000000..cfcf177efa3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-pat-reassign-binding.rs:23:11 + | +LL | Some(ref i) => { + | ----- borrow of `x` occurs here +LL | // But on this branch, `i` is an outstanding borrow +LL | x = Some(*i+1); //[ast]~ ERROR cannot assign to `x` + | ^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here +LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | drop(i); + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.ast.stderr new file mode 100644 index 00000000000..fdc04e226a5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.ast.stderr @@ -0,0 +1,12 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-pat-reassign-binding.rs:23:11 + | +LL | Some(ref i) => { + | ----- borrow of `x` occurs here +LL | // But on this branch, `i` is an outstanding borrow +LL | x = Some(*i+1); //[ast]~ ERROR cannot assign to `x` + | ^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.mir.stderr new file mode 100644 index 00000000000..cfcf177efa3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.mir.stderr @@ -0,0 +1,15 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/borrowck-pat-reassign-binding.rs:23:11 + | +LL | Some(ref i) => { + | ----- borrow of `x` occurs here +LL | // But on this branch, `i` is an outstanding borrow +LL | x = Some(*i+1); //[ast]~ ERROR cannot assign to `x` + | ^^^^^^^^^^^^^^ assignment to borrowed `x` occurs here +LL | //[mir]~^ ERROR cannot assign to `x` because it is borrowed +LL | drop(i); + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/borrowck/borrowck-pat-reassign-binding.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.rs index d917a0abb88..d917a0abb88 100644 --- a/src/test/compile-fail/borrowck/borrowck-pat-reassign-binding.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-pat-reassign-binding.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-mut.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-mut.nll.stderr new file mode 100644 index 00000000000..4c81bb8eb30 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-mut.nll.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `foo.bar1` as mutable, as it is behind a `&` reference + --> $DIR/borrowck-reborrow-from-mut.rs:98:17 + | +LL | fn borrow_mut_from_imm(foo: &Foo) { + | ---- help: consider changing this to be a mutable reference: `&mut Foo` +LL | let _bar1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-reborrow-from-mut.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-mut.rs index 6f5dfa67be5..6f5dfa67be5 100644 --- a/src/test/compile-fail/borrowck/borrowck-reborrow-from-mut.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-mut.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-mut.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-mut.stderr new file mode 100644 index 00000000000..00660ff8484 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-mut.stderr @@ -0,0 +1,116 @@ +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-reborrow-from-mut.rs:23:22 + | +LL | let _bar1 = &mut foo.bar1; + | -------- first mutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-reborrow-from-mut.rs:28:18 + | +LL | let _bar1 = &mut foo.bar1; + | -------- mutable borrow occurs here +LL | let _bar2 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-reborrow-from-mut.rs:33:22 + | +LL | let _bar1 = &foo.bar1; + | -------- immutable borrow occurs here +LL | let _bar2 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-reborrow-from-mut.rs:55:21 + | +LL | let _bar1 = &mut foo.bar1; + | -------- first mutable borrow occurs here +LL | match *foo { +LL | Foo { bar1: ref mut _bar1, bar2: _ } => {} + | ^^^^^^^^^^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as immutable because `foo.bar1.int1` is also borrowed as mutable + --> $DIR/borrowck-reborrow-from-mut.rs:62:18 + | +LL | let _bar1 = &mut foo.bar1.int1; + | ------------- mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ immutable borrow occurs here +LL | let _foo2 = &*foo; //~ ERROR cannot borrow +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `*foo` as immutable because `foo.bar1.int1` is also borrowed as mutable + --> $DIR/borrowck-reborrow-from-mut.rs:63:18 + | +LL | let _bar1 = &mut foo.bar1.int1; + | ------------- mutable borrow occurs here +LL | let _foo1 = &foo.bar1; //~ ERROR cannot borrow +LL | let _foo2 = &*foo; //~ ERROR cannot borrow + | ^^^^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error[E0499]: cannot borrow `foo.bar1` as mutable more than once at a time + --> $DIR/borrowck-reborrow-from-mut.rs:68:22 + | +LL | let _bar1 = &mut foo.bar1.int1; + | ------------- first mutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `*foo` as mutable more than once at a time + --> $DIR/borrowck-reborrow-from-mut.rs:73:22 + | +LL | let _bar1 = &mut foo.bar1.int1; + | ------------- first mutable borrow occurs here +LL | let _foo2 = &mut *foo; //~ ERROR cannot borrow + | ^^^^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error[E0502]: cannot borrow `foo.bar1` as mutable because `foo.bar1.int1` is also borrowed as immutable + --> $DIR/borrowck-reborrow-from-mut.rs:78:22 + | +LL | let _bar1 = &foo.bar1.int1; + | ------------- immutable borrow occurs here +LL | let _foo1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `*foo` as mutable because `foo.bar1.int1` is also borrowed as immutable + --> $DIR/borrowck-reborrow-from-mut.rs:83:22 + | +LL | let _bar1 = &foo.bar1.int1; + | ------------- immutable borrow occurs here +LL | let _foo2 = &mut *foo; //~ ERROR cannot borrow + | ^^^^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error[E0596]: cannot borrow field `foo.bar1` of immutable binding as mutable + --> $DIR/borrowck-reborrow-from-mut.rs:98:22 + | +LL | fn borrow_mut_from_imm(foo: &Foo) { + | ---- use `&mut Foo` here to make mutable +LL | let _bar1 = &mut foo.bar1; //~ ERROR cannot borrow + | ^^^^^^^^ cannot mutably borrow field of immutable binding + +error: aborting due to 11 previous errors + +Some errors occurred: E0499, E0502, E0596. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr new file mode 100644 index 00000000000..43c2a84c957 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:19:18 + | +LL | S { pointer: &mut *p.pointer } + | ^^^^^^^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:19:18 + | +LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | S { pointer: &mut *p.pointer } + | ^^^^^^^^^^^^^^^ requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs index af85e68f5de..af85e68f5de 100644 --- a/src/test/compile-fail/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr new file mode 100644 index 00000000000..52dabfaa1d4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr @@ -0,0 +1,13 @@ +error[E0623]: lifetime mismatch + --> $DIR/borrowck-reborrow-from-shorter-lived-andmut.rs:19:5 + | +LL | fn copy_borrowed_ptr<'a,'b>(p: &'a mut S<'b>) -> S<'b> { + | ------------- ----- + | | + | this parameter and the return type are declared with different lifetimes... +LL | S { pointer: &mut *p.pointer } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...but data from `p` is returned here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-ref-mut-of-imm.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-ref-mut-of-imm.nll.stderr new file mode 100644 index 00000000000..ccea5d9565b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-ref-mut-of-imm.nll.stderr @@ -0,0 +1,12 @@ +error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable + --> $DIR/borrowck-ref-mut-of-imm.rs:14:12 + | +LL | fn destructure(x: Option<isize>) -> isize { + | - help: consider changing this to be mutable: `mut x` +... +LL | Some(ref mut v) => *v //~ ERROR cannot borrow + | ^^^^^^^^^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/borrowck/borrowck-ref-mut-of-imm.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-ref-mut-of-imm.rs index 1784b72a699..1784b72a699 100644 --- a/src/test/compile-fail/borrowck/borrowck-ref-mut-of-imm.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-ref-mut-of-imm.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-ref-mut-of-imm.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-ref-mut-of-imm.stderr new file mode 100644 index 00000000000..2e2a1224306 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-ref-mut-of-imm.stderr @@ -0,0 +1,12 @@ +error[E0596]: cannot borrow field `(x as std::prelude::v1::Some).0` of immutable binding as mutable + --> $DIR/borrowck-ref-mut-of-imm.rs:14:12 + | +LL | fn destructure(x: Option<isize>) -> isize { + | - consider changing this to `mut x` +... +LL | Some(ref mut v) => *v //~ ERROR cannot borrow + | ^^^^^^^^^ cannot mutably borrow field of immutable binding + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-return-variable-on-stack-via-clone.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-return-variable-on-stack-via-clone.nll.stderr new file mode 100644 index 00000000000..93436d0ca97 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-return-variable-on-stack-via-clone.nll.stderr @@ -0,0 +1,17 @@ +error[E0597]: `x` does not live long enough + --> $DIR/borrowck-return-variable-on-stack-via-clone.rs:17:5 + | +LL | (&x).clone() //~ ERROR `x` does not live long enough + | ^^^^ borrowed value does not live long enough +LL | } + | - `x` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 16:9... + --> $DIR/borrowck-return-variable-on-stack-via-clone.rs:16:9 + | +LL | fn leak<'a, T>(x: T) -> &'a T { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-return-variable-on-stack-via-clone.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-return-variable-on-stack-via-clone.rs index 7529943f0bc..7529943f0bc 100644 --- a/src/test/compile-fail/borrowck/borrowck-return-variable-on-stack-via-clone.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-return-variable-on-stack-via-clone.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-return-variable-on-stack-via-clone.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-return-variable-on-stack-via-clone.stderr new file mode 100644 index 00000000000..69d5229244b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-return-variable-on-stack-via-clone.stderr @@ -0,0 +1,17 @@ +error[E0597]: `x` does not live long enough + --> $DIR/borrowck-return-variable-on-stack-via-clone.rs:17:7 + | +LL | (&x).clone() //~ ERROR `x` does not live long enough + | ^ borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 16:9... + --> $DIR/borrowck-return-variable-on-stack-via-clone.rs:16:9 + | +LL | fn leak<'a, T>(x: T) -> &'a T { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-return.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-return.rs index 74d435b35e7..74d435b35e7 100644 --- a/src/test/compile-fail/borrowck/borrowck-return.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-return.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-return.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-return.stderr new file mode 100644 index 00000000000..7223289b376 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-return.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-return.rs:13:12 + | +LL | return x; //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-storage-dead.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-storage-dead.rs index bc01088696d..bc01088696d 100644 --- a/src/test/compile-fail/borrowck/borrowck-storage-dead.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-storage-dead.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-storage-dead.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-storage-dead.stderr new file mode 100644 index 00000000000..edb7c13cf8b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-storage-dead.stderr @@ -0,0 +1,15 @@ +error[E0381]: use of possibly uninitialized variable: `x` (Ast) + --> $DIR/borrowck-storage-dead.rs:28:17 + | +LL | let _ = x + 1; //~ERROR (Ast) [E0381] + | ^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` (Mir) + --> $DIR/borrowck-storage-dead.rs:28:17 + | +LL | let _ = x + 1; //~ERROR (Ast) [E0381] + | ^ use of possibly uninitialized `x` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.ast.nll.stderr new file mode 100644 index 00000000000..a811f5d4def --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-struct-update-with-dtor.rs:25:15 + | +LL | let _s2 = S{a: 2, ..s0}; + | ^^^^^^^^^^^^^ cannot move out of here + +error[E0509]: cannot move out of type `T`, which implements the `Drop` trait + --> $DIR/borrowck-struct-update-with-dtor.rs:31:15 + | +LL | let _s2 = T{a: 2, ..s0}; + | ^^^^^^^^^^^^^ cannot move out of here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.ast.stderr new file mode 100644 index 00000000000..aebee2c3321 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.ast.stderr @@ -0,0 +1,15 @@ +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-struct-update-with-dtor.rs:25:25 + | +LL | let _s2 = S{a: 2, ..s0}; + | ^^ cannot move out of here + +error[E0509]: cannot move out of type `T`, which implements the `Drop` trait + --> $DIR/borrowck-struct-update-with-dtor.rs:31:25 + | +LL | let _s2 = T{a: 2, ..s0}; + | ^^ cannot move out of here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.mir.stderr new file mode 100644 index 00000000000..a811f5d4def --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.mir.stderr @@ -0,0 +1,15 @@ +error[E0509]: cannot move out of type `S`, which implements the `Drop` trait + --> $DIR/borrowck-struct-update-with-dtor.rs:25:15 + | +LL | let _s2 = S{a: 2, ..s0}; + | ^^^^^^^^^^^^^ cannot move out of here + +error[E0509]: cannot move out of type `T`, which implements the `Drop` trait + --> $DIR/borrowck-struct-update-with-dtor.rs:31:15 + | +LL | let _s2 = T{a: 2, ..s0}; + | ^^^^^^^^^^^^^ cannot move out of here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.rs index f90651687a5..f90651687a5 100644 --- a/src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-struct-update-with-dtor.rs diff --git a/src/test/compile-fail/borrowck/borrowck-swap-mut-base-ptr.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-swap-mut-base-ptr.rs index 552fcec8e28..552fcec8e28 100644 --- a/src/test/compile-fail/borrowck/borrowck-swap-mut-base-ptr.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-swap-mut-base-ptr.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-swap-mut-base-ptr.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-swap-mut-base-ptr.stderr new file mode 100644 index 00000000000..1e42f9b63d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-swap-mut-base-ptr.stderr @@ -0,0 +1,14 @@ +error[E0502]: cannot borrow `t0` as mutable because `*t0` is also borrowed as immutable + --> $DIR/borrowck-swap-mut-base-ptr.rs:21:15 + | +LL | let p: &isize = &*t0; // Freezes `*t0` + | --- immutable borrow occurs here +LL | swap(&mut t0, &mut t1); //~ ERROR cannot borrow `t0` + | ^^ mutable borrow occurs here +LL | *t1 = 22; +LL | } + | - immutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr new file mode 100644 index 00000000000..fa448209f2b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0597]: `FOO` does not live long enough + --> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:21:20 + | +LL | assert_static(&FOO); //[ast]~ ERROR [E0597] + | ^^^^ borrowed value does not live long enough +LL | //[mir]~^ ERROR [E0597] +LL | } + | - `FOO` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.stderr new file mode 100644 index 00000000000..27e0dba5095 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.stderr @@ -0,0 +1,13 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:21:21 + | +LL | assert_static(&FOO); //[ast]~ ERROR [E0597] + | ^^^ - temporary value only lives until here + | | + | temporary value does not live long enough + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr new file mode 100644 index 00000000000..fa448209f2b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr @@ -0,0 +1,14 @@ +error[E0597]: `FOO` does not live long enough + --> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:21:20 + | +LL | assert_static(&FOO); //[ast]~ ERROR [E0597] + | ^^^^ borrowed value does not live long enough +LL | //[mir]~^ ERROR [E0597] +LL | } + | - `FOO` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs index 7aa02558446..7aa02558446 100644 --- a/src/test/compile-fail/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.ast.nll.stderr new file mode 100644 index 00000000000..caeaa173bb8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrowck-unary-move.rs:17:10 + | +LL | let y = &*x; + | --- borrow of `*x` occurs here +LL | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed + | ^ move out of `x` occurs here +LL | //[mir]~^ ERROR cannot move out of `x` because it is borrowed +LL | *y + | -- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.ast.stderr new file mode 100644 index 00000000000..968fbb4526d --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.ast.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrowck-unary-move.rs:17:10 + | +LL | let y = &*x; + | -- borrow of `*x` occurs here +LL | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed + | ^ move out of `x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.mir.stderr new file mode 100644 index 00000000000..caeaa173bb8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.mir.stderr @@ -0,0 +1,14 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrowck-unary-move.rs:17:10 + | +LL | let y = &*x; + | --- borrow of `*x` occurs here +LL | free(x); //[ast]~ ERROR cannot move out of `x` because it is borrowed + | ^ move out of `x` occurs here +LL | //[mir]~^ ERROR cannot move out of `x` because it is borrowed +LL | *y + | -- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/borrowck/borrowck-unary-move.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.rs index 8163ce29939..8163ce29939 100644 --- a/src/test/compile-fail/borrowck/borrowck-unary-move.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-unary-move.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-unboxed-closures.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-unboxed-closures.nll.stderr new file mode 100644 index 00000000000..3fbb747db24 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-unboxed-closures.nll.stderr @@ -0,0 +1,22 @@ +error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable + --> $DIR/borrowck-unboxed-closures.rs:17:5 + | +LL | fn b<F:FnMut(isize, isize) -> isize>(f: F) { + | - help: consider changing this to be mutable: `mut f` +LL | f(1, 2); //~ ERROR cannot borrow immutable argument + | ^ cannot borrow as mutable + +error[E0382]: use of moved value: `f` + --> $DIR/borrowck-unboxed-closures.rs:22:5 + | +LL | f(1, 2); + | - value moved here +LL | f(1, 2); //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `f` has type `F`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +Some errors occurred: E0382, E0596. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-unboxed-closures.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-unboxed-closures.rs index 4813b4b6a72..4813b4b6a72 100644 --- a/src/test/compile-fail/borrowck/borrowck-unboxed-closures.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-unboxed-closures.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-unboxed-closures.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-unboxed-closures.stderr new file mode 100644 index 00000000000..03b835d3077 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-unboxed-closures.stderr @@ -0,0 +1,32 @@ +error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-unboxed-closures.rs:13:5 + | +LL | let g = &mut f; + | - mutable borrow occurs here +LL | f(1, 2); //~ ERROR cannot borrow `f` as immutable + | ^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error[E0596]: cannot borrow immutable argument `f` as mutable + --> $DIR/borrowck-unboxed-closures.rs:17:5 + | +LL | fn b<F:FnMut(isize, isize) -> isize>(f: F) { + | - consider changing this to `mut f` +LL | f(1, 2); //~ ERROR cannot borrow immutable argument + | ^ cannot borrow mutably + +error[E0382]: use of moved value: `f` + --> $DIR/borrowck-unboxed-closures.rs:22:5 + | +LL | f(1, 2); + | - value moved here +LL | f(1, 2); //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `f` has type `F`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +Some errors occurred: E0382, E0502, E0596. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-uninit-after-item.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-after-item.rs index acd827d6c62..acd827d6c62 100644 --- a/src/test/compile-fail/borrowck/borrowck-uninit-after-item.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-after-item.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-after-item.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-after-item.stderr new file mode 100644 index 00000000000..17f9c0197ab --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-after-item.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `bar` + --> $DIR/borrowck-uninit-after-item.rs:14:9 + | +LL | baz(bar); //~ ERROR use of possibly uninitialized variable: `bar` + | ^^^ use of possibly uninitialized `bar` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.ast.nll.stderr new file mode 100644 index 00000000000..9c7dbd7e778 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.ast.nll.stderr @@ -0,0 +1,30 @@ +error[E0381]: use of possibly uninitialized variable: `a.x` + --> $DIR/borrowck-uninit-field-access.rs:34:13 + | +LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` + | ^^^ use of possibly uninitialized `a.x` + +error[E0382]: use of moved value: `line1.origin.x` + --> $DIR/borrowck-uninit-field-access.rs:39:13 + | +LL | let _moved = line1.origin; + | ------------ value moved here +LL | let _ = line1.origin.x + 1; //[ast]~ ERROR use of moved value: `line1.origin.x` + | ^^^^^^^^^^^^^^ value used here after move + | + = note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `line2` + --> $DIR/borrowck-uninit-field-access.rs:44:5 + | +LL | let _moved = (line2.origin, line2.middle); + | ------------ value moved here +LL | line2.consume(); //[ast]~ ERROR use of partially moved value: `line2` [E0382] + | ^^^^^ value used here after move + | + = note: move occurs because `line2.middle` has type `Point`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +Some errors occurred: E0381, E0382. +For more information about an error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.ast.stderr new file mode 100644 index 00000000000..8536bf22de9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.ast.stderr @@ -0,0 +1,30 @@ +error[E0381]: use of possibly uninitialized variable: `a.x` + --> $DIR/borrowck-uninit-field-access.rs:34:13 + | +LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` + | ^^^ use of possibly uninitialized `a.x` + +error[E0382]: use of moved value: `line1.origin.x` + --> $DIR/borrowck-uninit-field-access.rs:39:13 + | +LL | let _moved = line1.origin; + | ------ value moved here +LL | let _ = line1.origin.x + 1; //[ast]~ ERROR use of moved value: `line1.origin.x` + | ^^^^^^^^^^^^^^ value used here after move + | + = note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait + +error[E0382]: use of partially moved value: `line2` + --> $DIR/borrowck-uninit-field-access.rs:44:5 + | +LL | let _moved = (line2.origin, line2.middle); + | ------------ value moved here +LL | line2.consume(); //[ast]~ ERROR use of partially moved value: `line2` [E0382] + | ^^^^^ value used here after move + | + = note: move occurs because `line2.origin` has type `Point`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +Some errors occurred: E0381, E0382. +For more information about an error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.mir.stderr new file mode 100644 index 00000000000..9c7dbd7e778 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.mir.stderr @@ -0,0 +1,30 @@ +error[E0381]: use of possibly uninitialized variable: `a.x` + --> $DIR/borrowck-uninit-field-access.rs:34:13 + | +LL | let _ = a.x + 1; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` + | ^^^ use of possibly uninitialized `a.x` + +error[E0382]: use of moved value: `line1.origin.x` + --> $DIR/borrowck-uninit-field-access.rs:39:13 + | +LL | let _moved = line1.origin; + | ------------ value moved here +LL | let _ = line1.origin.x + 1; //[ast]~ ERROR use of moved value: `line1.origin.x` + | ^^^^^^^^^^^^^^ value used here after move + | + = note: move occurs because `line1.origin` has type `Point`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `line2` + --> $DIR/borrowck-uninit-field-access.rs:44:5 + | +LL | let _moved = (line2.origin, line2.middle); + | ------------ value moved here +LL | line2.consume(); //[ast]~ ERROR use of partially moved value: `line2` [E0382] + | ^^^^^ value used here after move + | + = note: move occurs because `line2.middle` has type `Point`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +Some errors occurred: E0381, E0382. +For more information about an error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-uninit-field-access.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.rs index eec7df84c82..eec7df84c82 100644 --- a/src/test/compile-fail/borrowck/borrowck-uninit-field-access.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-field-access.rs diff --git a/src/test/compile-fail/borrowck/borrowck-uninit-in-assignop.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-in-assignop.rs index e253ecc74b9..e253ecc74b9 100644 --- a/src/test/compile-fail/borrowck/borrowck-uninit-in-assignop.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-in-assignop.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-in-assignop.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-in-assignop.stderr new file mode 100644 index 00000000000..7d905f64761 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-in-assignop.stderr @@ -0,0 +1,63 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:16:5 + | +LL | x += 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:19:5 + | +LL | x -= 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:22:5 + | +LL | x *= 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:25:5 + | +LL | x /= 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:28:5 + | +LL | x %= 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:31:5 + | +LL | x ^= 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:34:5 + | +LL | x &= 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:37:5 + | +LL | x |= 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:40:5 + | +LL | x <<= 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^^ use of possibly uninitialized `x` + +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit-in-assignop.rs:43:5 + | +LL | x >>= 1; //~ ERROR use of possibly uninitialized variable: `x` + | ^^^^^^^ use of possibly uninitialized `x` + +error: aborting due to 10 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr new file mode 100644 index 00000000000..bd9836e3174 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr @@ -0,0 +1,33 @@ +error[E0381]: borrow of possibly uninitialized variable: `**x` + --> $DIR/borrowck-uninit-ref-chain.rs:21:14 + | +LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] + | ^^^^ use of possibly uninitialized `**x` + +error[E0381]: borrow of possibly uninitialized variable: `**x` + --> $DIR/borrowck-uninit-ref-chain.rs:25:14 + | +LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] + | ^^^^ use of possibly uninitialized `**x` + +error[E0381]: borrow of possibly uninitialized variable: `**x` + --> $DIR/borrowck-uninit-ref-chain.rs:29:14 + | +LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] + | ^^^^ use of possibly uninitialized `**x` + +error[E0381]: borrow of possibly uninitialized variable: `a.y` + --> $DIR/borrowck-uninit-ref-chain.rs:46:14 + | +LL | let _b = &a.y; //[ast]~ ERROR use of possibly uninitialized variable: `a.y` [E0381] + | ^^^^ use of possibly uninitialized `a.y` + +error[E0381]: borrow of possibly uninitialized variable: `**a.y` + --> $DIR/borrowck-uninit-ref-chain.rs:51:14 + | +LL | let _b = &**a.y; //[ast]~ ERROR use of possibly uninitialized variable: `**a.y` [E0381] + | ^^^^^^ use of possibly uninitialized `**a.y` + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.ast.stderr new file mode 100644 index 00000000000..6b51414e5a2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.ast.stderr @@ -0,0 +1,45 @@ +error[E0381]: use of possibly uninitialized variable: `**x` + --> $DIR/borrowck-uninit-ref-chain.rs:21:15 + | +LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] + | ^^^ use of possibly uninitialized `**x` + +error[E0381]: use of possibly uninitialized variable: `**x` + --> $DIR/borrowck-uninit-ref-chain.rs:25:15 + | +LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] + | ^^^ use of possibly uninitialized `**x` + +error[E0381]: use of possibly uninitialized variable: `**x` + --> $DIR/borrowck-uninit-ref-chain.rs:29:15 + | +LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] + | ^^^ use of possibly uninitialized `**x` + +error[E0381]: use of possibly uninitialized variable: `a.x` + --> $DIR/borrowck-uninit-ref-chain.rs:35:15 + | +LL | let _b = &a.x; //[ast]~ ERROR use of possibly uninitialized variable: `a.x` [E0381] + | ^^^ use of possibly uninitialized `a.x` + +error[E0381]: use of possibly uninitialized variable: `**a.x` + --> $DIR/borrowck-uninit-ref-chain.rs:40:15 + | +LL | let _b = &**a.x; //[ast]~ ERROR use of possibly uninitialized variable: `**a.x` [E0381] + | ^^^^^ use of possibly uninitialized `**a.x` + +error[E0381]: use of possibly uninitialized variable: `a.y` + --> $DIR/borrowck-uninit-ref-chain.rs:46:15 + | +LL | let _b = &a.y; //[ast]~ ERROR use of possibly uninitialized variable: `a.y` [E0381] + | ^^^ use of possibly uninitialized `a.y` + +error[E0381]: use of possibly uninitialized variable: `**a.y` + --> $DIR/borrowck-uninit-ref-chain.rs:51:15 + | +LL | let _b = &**a.y; //[ast]~ ERROR use of possibly uninitialized variable: `**a.y` [E0381] + | ^^^^^ use of possibly uninitialized `**a.y` + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.mir.stderr new file mode 100644 index 00000000000..bd9836e3174 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.mir.stderr @@ -0,0 +1,33 @@ +error[E0381]: borrow of possibly uninitialized variable: `**x` + --> $DIR/borrowck-uninit-ref-chain.rs:21:14 + | +LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] + | ^^^^ use of possibly uninitialized `**x` + +error[E0381]: borrow of possibly uninitialized variable: `**x` + --> $DIR/borrowck-uninit-ref-chain.rs:25:14 + | +LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] + | ^^^^ use of possibly uninitialized `**x` + +error[E0381]: borrow of possibly uninitialized variable: `**x` + --> $DIR/borrowck-uninit-ref-chain.rs:29:14 + | +LL | let _y = &**x; //[ast]~ ERROR use of possibly uninitialized variable: `**x` [E0381] + | ^^^^ use of possibly uninitialized `**x` + +error[E0381]: borrow of possibly uninitialized variable: `a.y` + --> $DIR/borrowck-uninit-ref-chain.rs:46:14 + | +LL | let _b = &a.y; //[ast]~ ERROR use of possibly uninitialized variable: `a.y` [E0381] + | ^^^^ use of possibly uninitialized `a.y` + +error[E0381]: borrow of possibly uninitialized variable: `**a.y` + --> $DIR/borrowck-uninit-ref-chain.rs:51:14 + | +LL | let _b = &**a.y; //[ast]~ ERROR use of possibly uninitialized variable: `**a.y` [E0381] + | ^^^^^^ use of possibly uninitialized `**a.y` + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-uninit-ref-chain.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.rs index c52b1f0bf64..c52b1f0bf64 100644 --- a/src/test/compile-fail/borrowck/borrowck-uninit-ref-chain.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit-ref-chain.rs diff --git a/src/test/compile-fail/borrowck/borrowck-uninit.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit.rs index f4b73bc889f..f4b73bc889f 100644 --- a/src/test/compile-fail/borrowck/borrowck-uninit.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit.stderr new file mode 100644 index 00000000000..ce78001dc64 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uninit.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-uninit.rs:15:9 + | +LL | foo(x); //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-union-borrow-nested.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow-nested.rs index 6298c87453c..6298c87453c 100644 --- a/src/test/compile-fail/borrowck/borrowck-union-borrow-nested.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow-nested.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow-nested.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow-nested.stderr new file mode 100644 index 00000000000..4f25a0f742a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow-nested.stderr @@ -0,0 +1,11 @@ +error[E0503]: cannot use `u.c` because it was mutably borrowed + --> $DIR/borrowck-union-borrow-nested.rs:33:17 + | +LL | let ra = &mut u.s.a; + | ----- borrow of `u.s.a` occurs here +LL | let b = u.c; //~ ERROR cannot use `u.c` because it was mutably borrowed + | ^ use of borrowed `u.s.a` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.ast.nll.stderr new file mode 100644 index 00000000000..2f14826fa12 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.ast.nll.stderr @@ -0,0 +1,136 @@ +error[E0502]: cannot borrow `u.a` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-union-borrow.rs:37:23 + | +LL | let ra = &u.a; + | ---- immutable borrow occurs here +LL | let rma = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable + | ^^^^^^^^ mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable +LL | drop(ra); + | -- borrow later used here + +error[E0506]: cannot assign to `u.a` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:43:13 + | +LL | let ra = &u.a; + | ---- borrow of `u.a` occurs here +LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed +LL | drop(ra); + | -- borrow later used here + +error[E0502]: cannot borrow `u.b` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-union-borrow.rs:60:23 + | +LL | let ra = &u.a; + | ---- immutable borrow occurs here +LL | let rmb = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable because `u` is also borrowed as immutable (via `u.a`) + | ^^^^^^^^ mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable because it is also borrowed as immutable +LL | drop(ra); + | -- borrow later used here + +error[E0506]: cannot assign to `u.b` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:66:13 + | +LL | let ra = &u.a; + | ---- borrow of `u.b` occurs here +LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.b` occurs here +LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed +LL | drop(ra); + | -- borrow later used here + +error[E0502]: cannot borrow `u.a` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-union-borrow.rs:73:22 + | +LL | let rma = &mut u.a; + | -------- mutable borrow occurs here +LL | let ra = &u.a; //[ast]~ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable + | ^^^^ immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable +LL | drop(rma); + | --- borrow later used here + +error[E0503]: cannot use `u.a` because it was mutably borrowed + --> $DIR/borrowck-union-borrow.rs:79:21 + | +LL | let ra = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | let a = u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed + | ^^^ use of borrowed `u.a` +LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | drop(ra); + | -- borrow later used here + +error[E0499]: cannot borrow `u.a` as mutable more than once at a time + --> $DIR/borrowck-union-borrow.rs:85:24 + | +LL | let rma = &mut u.a; + | -------- first mutable borrow occurs here +LL | let rma2 = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable more than once at a time + | ^^^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable more than once at a time +LL | drop(rma); + | --- borrow later used here + +error[E0506]: cannot assign to `u.a` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:91:13 + | +LL | let rma = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed +LL | drop(rma); + | --- borrow later used here + +error[E0502]: cannot borrow `u.b` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-union-borrow.rs:98:22 + | +LL | let rma = &mut u.a; + | -------- mutable borrow occurs here +LL | let rb = &u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as immutable because `u` is also borrowed as mutable (via `u.a`) + | ^^^^ immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.b` as immutable because it is also borrowed as mutable +LL | drop(rma); + | --- borrow later used here + +error[E0503]: cannot use `u.b` because it was mutably borrowed + --> $DIR/borrowck-union-borrow.rs:104:21 + | +LL | let ra = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | let b = u.b; //[ast]~ ERROR cannot use `u.b` because it was mutably borrowed + | ^^^ use of borrowed `u.a` +... +LL | drop(ra); + | -- borrow later used here + +error[E0499]: cannot borrow `u.b` as mutable more than once at a time + --> $DIR/borrowck-union-borrow.rs:111:24 + | +LL | let rma = &mut u.a; + | -------- first mutable borrow occurs here +LL | let rmb2 = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable more than once at a time + | ^^^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable more than once at a time +LL | drop(rma); + | --- borrow later used here + +error[E0506]: cannot assign to `u.b` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:117:13 + | +LL | let rma = &mut u.a; + | -------- borrow of `u.b` occurs here +LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.b` occurs here +LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed +LL | drop(rma); + | --- borrow later used here + +error: aborting due to 12 previous errors + +Some errors occurred: E0499, E0502, E0503, E0506. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.ast.stderr new file mode 100644 index 00000000000..9a020705792 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.ast.stderr @@ -0,0 +1,118 @@ +error[E0502]: cannot borrow `u.a` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-union-borrow.rs:37:28 + | +LL | let ra = &u.a; + | --- immutable borrow occurs here +LL | let rma = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable + | ^^^ mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error[E0506]: cannot assign to `u.a` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:43:13 + | +LL | let ra = &u.a; + | --- borrow of `u.a` occurs here +LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.a` occurs here + +error[E0502]: cannot borrow `u` (via `u.b`) as mutable because `u` is also borrowed as immutable (via `u.a`) + --> $DIR/borrowck-union-borrow.rs:60:28 + | +LL | let ra = &u.a; + | --- immutable borrow occurs here (via `u.a`) +LL | let rmb = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable because `u` is also borrowed as immutable (via `u.a`) + | ^^^ mutable borrow occurs here (via `u.b`) +... +LL | } + | - immutable borrow ends here + +error[E0506]: cannot assign to `u.b` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:66:13 + | +LL | let ra = &u.a; + | --- borrow of `u.b` occurs here +LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.b` occurs here + +error[E0502]: cannot borrow `u.a` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-union-borrow.rs:73:23 + | +LL | let rma = &mut u.a; + | --- mutable borrow occurs here +LL | let ra = &u.a; //[ast]~ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable + | ^^^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0503]: cannot use `u.a` because it was mutably borrowed + --> $DIR/borrowck-union-borrow.rs:79:17 + | +LL | let ra = &mut u.a; + | --- borrow of `u.a` occurs here +LL | let a = u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed + | ^ use of borrowed `u.a` + +error[E0499]: cannot borrow `u.a` as mutable more than once at a time + --> $DIR/borrowck-union-borrow.rs:85:29 + | +LL | let rma = &mut u.a; + | --- first mutable borrow occurs here +LL | let rma2 = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable more than once at a time + | ^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0506]: cannot assign to `u.a` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:91:13 + | +LL | let rma = &mut u.a; + | --- borrow of `u.a` occurs here +LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.a` occurs here + +error[E0502]: cannot borrow `u` (via `u.b`) as immutable because `u` is also borrowed as mutable (via `u.a`) + --> $DIR/borrowck-union-borrow.rs:98:23 + | +LL | let rma = &mut u.a; + | --- mutable borrow occurs here (via `u.a`) +LL | let rb = &u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as immutable because `u` is also borrowed as mutable (via `u.a`) + | ^^^ immutable borrow occurs here (via `u.b`) +... +LL | } + | - mutable borrow ends here + +error[E0503]: cannot use `u.b` because it was mutably borrowed + --> $DIR/borrowck-union-borrow.rs:104:17 + | +LL | let ra = &mut u.a; + | --- borrow of `u.a` occurs here +LL | let b = u.b; //[ast]~ ERROR cannot use `u.b` because it was mutably borrowed + | ^ use of borrowed `u.a` + +error[E0499]: cannot borrow `u` (via `u.b`) as mutable more than once at a time + --> $DIR/borrowck-union-borrow.rs:111:29 + | +LL | let rma = &mut u.a; + | --- first mutable borrow occurs here (via `u.a`) +LL | let rmb2 = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable more than once at a time + | ^^^ second mutable borrow occurs here (via `u.b`) +... +LL | } + | - first borrow ends here + +error[E0506]: cannot assign to `u.b` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:117:13 + | +LL | let rma = &mut u.a; + | --- borrow of `u.b` occurs here +LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.b` occurs here + +error: aborting due to 12 previous errors + +Some errors occurred: E0499, E0502, E0503, E0506. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.mir.stderr new file mode 100644 index 00000000000..2f14826fa12 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.mir.stderr @@ -0,0 +1,136 @@ +error[E0502]: cannot borrow `u.a` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-union-borrow.rs:37:23 + | +LL | let ra = &u.a; + | ---- immutable borrow occurs here +LL | let rma = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable + | ^^^^^^^^ mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable because it is also borrowed as immutable +LL | drop(ra); + | -- borrow later used here + +error[E0506]: cannot assign to `u.a` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:43:13 + | +LL | let ra = &u.a; + | ---- borrow of `u.a` occurs here +LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed +LL | drop(ra); + | -- borrow later used here + +error[E0502]: cannot borrow `u.b` as mutable because it is also borrowed as immutable + --> $DIR/borrowck-union-borrow.rs:60:23 + | +LL | let ra = &u.a; + | ---- immutable borrow occurs here +LL | let rmb = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable because `u` is also borrowed as immutable (via `u.a`) + | ^^^^^^^^ mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable because it is also borrowed as immutable +LL | drop(ra); + | -- borrow later used here + +error[E0506]: cannot assign to `u.b` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:66:13 + | +LL | let ra = &u.a; + | ---- borrow of `u.b` occurs here +LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.b` occurs here +LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed +LL | drop(ra); + | -- borrow later used here + +error[E0502]: cannot borrow `u.a` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-union-borrow.rs:73:22 + | +LL | let rma = &mut u.a; + | -------- mutable borrow occurs here +LL | let ra = &u.a; //[ast]~ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable + | ^^^^ immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.a` as immutable because it is also borrowed as mutable +LL | drop(rma); + | --- borrow later used here + +error[E0503]: cannot use `u.a` because it was mutably borrowed + --> $DIR/borrowck-union-borrow.rs:79:21 + | +LL | let ra = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | let a = u.a; //[ast]~ ERROR cannot use `u.a` because it was mutably borrowed + | ^^^ use of borrowed `u.a` +LL | //[mir]~^ ERROR cannot use `u.a` because it was mutably borrowed +LL | drop(ra); + | -- borrow later used here + +error[E0499]: cannot borrow `u.a` as mutable more than once at a time + --> $DIR/borrowck-union-borrow.rs:85:24 + | +LL | let rma = &mut u.a; + | -------- first mutable borrow occurs here +LL | let rma2 = &mut u.a; //[ast]~ ERROR cannot borrow `u.a` as mutable more than once at a time + | ^^^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.a` as mutable more than once at a time +LL | drop(rma); + | --- borrow later used here + +error[E0506]: cannot assign to `u.a` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:91:13 + | +LL | let rma = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | u.a = 1; //[ast]~ ERROR cannot assign to `u.a` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.a` occurs here +LL | //[mir]~^ ERROR cannot assign to `u.a` because it is borrowed +LL | drop(rma); + | --- borrow later used here + +error[E0502]: cannot borrow `u.b` as immutable because it is also borrowed as mutable + --> $DIR/borrowck-union-borrow.rs:98:22 + | +LL | let rma = &mut u.a; + | -------- mutable borrow occurs here +LL | let rb = &u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as immutable because `u` is also borrowed as mutable (via `u.a`) + | ^^^^ immutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.b` as immutable because it is also borrowed as mutable +LL | drop(rma); + | --- borrow later used here + +error[E0503]: cannot use `u.b` because it was mutably borrowed + --> $DIR/borrowck-union-borrow.rs:104:21 + | +LL | let ra = &mut u.a; + | -------- borrow of `u.a` occurs here +LL | let b = u.b; //[ast]~ ERROR cannot use `u.b` because it was mutably borrowed + | ^^^ use of borrowed `u.a` +... +LL | drop(ra); + | -- borrow later used here + +error[E0499]: cannot borrow `u.b` as mutable more than once at a time + --> $DIR/borrowck-union-borrow.rs:111:24 + | +LL | let rma = &mut u.a; + | -------- first mutable borrow occurs here +LL | let rmb2 = &mut u.b; //[ast]~ ERROR cannot borrow `u` (via `u.b`) as mutable more than once at a time + | ^^^^^^^^ second mutable borrow occurs here +LL | //[mir]~^ ERROR cannot borrow `u.b` as mutable more than once at a time +LL | drop(rma); + | --- borrow later used here + +error[E0506]: cannot assign to `u.b` because it is borrowed + --> $DIR/borrowck-union-borrow.rs:117:13 + | +LL | let rma = &mut u.a; + | -------- borrow of `u.b` occurs here +LL | u.b = 1; //[ast]~ ERROR cannot assign to `u.b` because it is borrowed + | ^^^^^^^ assignment to borrowed `u.b` occurs here +LL | //[mir]~^ ERROR cannot assign to `u.b` because it is borrowed +LL | drop(rma); + | --- borrow later used here + +error: aborting due to 12 previous errors + +Some errors occurred: E0499, E0502, E0503, E0506. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-union-borrow.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.rs index 97193bd0191..97193bd0191 100644 --- a/src/test/compile-fail/borrowck/borrowck-union-borrow.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-borrow.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move-assign.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move-assign.nll.stderr new file mode 100644 index 00000000000..2a877050e4c --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move-assign.nll.stderr @@ -0,0 +1,35 @@ +error[E0382]: use of moved value: `u.a` + --> $DIR/borrowck-union-move-assign.rs:27:21 + | +LL | let a = u.a; + | --- value moved here +LL | let a = u.a; //~ ERROR use of moved value: `u.a` + | ^^^ value used here after move + | + = note: move occurs because `u` has type `U`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.a` + --> $DIR/borrowck-union-move-assign.rs:33:21 + | +LL | let a = u.a; + | --- value moved here +LL | u.a = A; +LL | let a = u.a; // OK + | ^^^ value used here after move + | + = note: move occurs because `u` has type `U`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.a` + --> $DIR/borrowck-union-move-assign.rs:39:21 + | +LL | let a = u.a; + | --- value moved here +LL | u.b = B; +LL | let a = u.a; // OK + | ^^^ value used here after move + | + = note: move occurs because `u` has type `U`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-union-move-assign.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move-assign.rs index d4d7bc6b0f7..d4d7bc6b0f7 100644 --- a/src/test/compile-fail/borrowck/borrowck-union-move-assign.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move-assign.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move-assign.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move-assign.stderr new file mode 100644 index 00000000000..b0924d28c9c --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move-assign.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `u.a` + --> $DIR/borrowck-union-move-assign.rs:27:17 + | +LL | let a = u.a; + | - value moved here +LL | let a = u.a; //~ ERROR use of moved value: `u.a` + | ^ value used here after move + | + = note: move occurs because `u.a` has type `A`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move.nll.stderr new file mode 100644 index 00000000000..6fd6a1c82a1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move.nll.stderr @@ -0,0 +1,63 @@ +error[E0382]: use of moved value: `u.n1` + --> $DIR/borrowck-union-move.rs:36:21 + | +LL | let a = u.n1; + | ---- value moved here +LL | let a = u.n1; //~ ERROR use of moved value: `u.n1` + | ^^^^ value used here after move + | + = note: move occurs because `u` has type `Unn`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u` + --> $DIR/borrowck-union-move.rs:41:21 + | +LL | let a = u.n1; + | ---- value moved here +LL | let a = u; //~ ERROR use of partially moved value: `u` + | ^ value used here after move + | + = note: move occurs because `u` has type `Unn`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.n2` + --> $DIR/borrowck-union-move.rs:46:21 + | +LL | let a = u.n1; + | ---- value moved here +LL | let a = u.n2; //~ ERROR use of moved value: `u.n2` + | ^^^^ value used here after move + | + = note: move occurs because `u` has type `Unn`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.n` + --> $DIR/borrowck-union-move.rs:73:21 + | +LL | let a = u.n; + | --- value moved here +LL | let a = u.n; //~ ERROR use of moved value: `u.n` + | ^^^ value used here after move + | + = note: move occurs because `u` has type `Ucn`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.c` + --> $DIR/borrowck-union-move.rs:78:21 + | +LL | let a = u.n; + | --- value moved here +LL | let a = u.c; //~ ERROR use of moved value: `u.c` + | ^^^ value used here after move + | + = note: move occurs because `u` has type `Ucn`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u` + --> $DIR/borrowck-union-move.rs:93:21 + | +LL | let a = u.n; + | --- value moved here +LL | let a = u; //~ ERROR use of partially moved value: `u` + | ^ value used here after move + | + = note: move occurs because `u` has type `Ucn`, which does not implement the `Copy` trait + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/borrowck/borrowck-union-move.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move.rs index 5320244cf43..5320244cf43 100644 --- a/src/test/compile-fail/borrowck/borrowck-union-move.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move.stderr new file mode 100644 index 00000000000..d3e441bbbf4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-move.stderr @@ -0,0 +1,63 @@ +error[E0382]: use of moved value: `u.n1` + --> $DIR/borrowck-union-move.rs:36:17 + | +LL | let a = u.n1; + | - value moved here +LL | let a = u.n1; //~ ERROR use of moved value: `u.n1` + | ^ value used here after move + | + = note: move occurs because `u.n1` has type `NonCopy`, which does not implement the `Copy` trait + +error[E0382]: use of partially moved value: `u` + --> $DIR/borrowck-union-move.rs:41:17 + | +LL | let a = u.n1; + | - value moved here +LL | let a = u; //~ ERROR use of partially moved value: `u` + | ^ value used here after move + | + = note: move occurs because `u.n2` has type `[type error]`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.n2` + --> $DIR/borrowck-union-move.rs:46:17 + | +LL | let a = u.n1; + | - value moved here +LL | let a = u.n2; //~ ERROR use of moved value: `u.n2` + | ^ value used here after move + | + = note: move occurs because `u.n2` has type `[type error]`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.n` + --> $DIR/borrowck-union-move.rs:73:17 + | +LL | let a = u.n; + | - value moved here +LL | let a = u.n; //~ ERROR use of moved value: `u.n` + | ^ value used here after move + | + = note: move occurs because `u.n` has type `NonCopy`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.c` + --> $DIR/borrowck-union-move.rs:78:17 + | +LL | let a = u.n; + | - value moved here +LL | let a = u.c; //~ ERROR use of moved value: `u.c` + | ^ value used here after move + | + = note: move occurs because `u.c` has type `[type error]`, which does not implement the `Copy` trait + +error[E0382]: use of partially moved value: `u` + --> $DIR/borrowck-union-move.rs:93:17 + | +LL | let a = u.n; + | - value moved here +LL | let a = u; //~ ERROR use of partially moved value: `u` + | ^ value used here after move + | + = note: move occurs because `u.c` has type `[type error]`, which does not implement the `Copy` trait + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-uninitialized.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-uninitialized.nll.stderr new file mode 100644 index 00000000000..49bc6d32636 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-uninitialized.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `u.a` + --> $DIR/borrowck-union-uninitialized.rs:26:18 + | +LL | let ua = u.a; //~ ERROR use of possibly uninitialized variable: `u.a` + | ^^^ use of possibly uninitialized `u.a` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-union-uninitialized.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-uninitialized.rs index 81376a1a169..81376a1a169 100644 --- a/src/test/compile-fail/borrowck/borrowck-union-uninitialized.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-uninitialized.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-union-uninitialized.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-uninitialized.stderr new file mode 100644 index 00000000000..901d1ecc506 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-union-uninitialized.stderr @@ -0,0 +1,15 @@ +error[E0381]: use of possibly uninitialized variable: `s.a` + --> $DIR/borrowck-union-uninitialized.rs:25:13 + | +LL | let sa = s.a; //~ ERROR use of possibly uninitialized variable: `s.a` + | ^^ use of possibly uninitialized `s.a` + +error[E0381]: use of possibly uninitialized variable: `u.a` + --> $DIR/borrowck-union-uninitialized.rs:26:13 + | +LL | let ua = u.a; //~ ERROR use of possibly uninitialized variable: `u.a` + | ^^ use of possibly uninitialized `u.a` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-uniq-via-lend.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-uniq-via-lend.rs index f36dc0ca43f..f36dc0ca43f 100644 --- a/src/test/compile-fail/borrowck/borrowck-uniq-via-lend.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uniq-via-lend.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-uniq-via-lend.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-uniq-via-lend.stderr new file mode 100644 index 00000000000..9131cad1275 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-uniq-via-lend.stderr @@ -0,0 +1,23 @@ +error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mutable + --> $DIR/borrowck-uniq-via-lend.rs:43:13 + | +LL | let _w = &mut v; + | - mutable borrow occurs here +LL | borrow(&*v); //~ ERROR cannot borrow `*v` + | ^^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error[E0502]: cannot borrow `*v` as immutable because `v` is also borrowed as mutable + --> $DIR/borrowck-uniq-via-lend.rs:58:13 + | +LL | _x = &mut v; + | - mutable borrow occurs here +LL | borrow(&*v); //~ ERROR cannot borrow `*v` + | ^^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr new file mode 100644 index 00000000000..d69693eb035 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0381]: use of possibly uninitialized variable: `*w` + --> $DIR/borrowck-use-in-index-lvalue.rs:16:5 + | +LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] + | ^^^^ use of possibly uninitialized `*w` + +error[E0381]: use of possibly uninitialized variable: `*w` + --> $DIR/borrowck-use-in-index-lvalue.rs:20:5 + | +LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] + | ^^^^ use of possibly uninitialized `*w` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.ast.stderr new file mode 100644 index 00000000000..3a33081dfcd --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.ast.stderr @@ -0,0 +1,15 @@ +error[E0381]: use of possibly uninitialized variable: `*w` + --> $DIR/borrowck-use-in-index-lvalue.rs:16:5 + | +LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] + | ^^^^^^^^ use of possibly uninitialized `*w` + +error[E0381]: use of possibly uninitialized variable: `*w` + --> $DIR/borrowck-use-in-index-lvalue.rs:20:5 + | +LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] + | ^^^^^^^^ use of possibly uninitialized `*w` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.mir.stderr new file mode 100644 index 00000000000..d69693eb035 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.mir.stderr @@ -0,0 +1,15 @@ +error[E0381]: use of possibly uninitialized variable: `*w` + --> $DIR/borrowck-use-in-index-lvalue.rs:16:5 + | +LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] + | ^^^^ use of possibly uninitialized `*w` + +error[E0381]: use of possibly uninitialized variable: `*w` + --> $DIR/borrowck-use-in-index-lvalue.rs:20:5 + | +LL | w[5] = 0; //[ast]~ ERROR use of possibly uninitialized variable: `*w` [E0381] + | ^^^^ use of possibly uninitialized `*w` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-use-in-index-lvalue.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.rs index eb99f78f461..eb99f78f461 100644 --- a/src/test/compile-fail/borrowck/borrowck-use-in-index-lvalue.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-in-index-lvalue.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-mut-borrow.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-mut-borrow.nll.stderr new file mode 100644 index 00000000000..2289dd688cf --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-mut-borrow.nll.stderr @@ -0,0 +1,95 @@ +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:21:10 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | drop(x); //~ ERROR cannot use `x` because it was mutably borrowed + | ^ use of borrowed `x` +LL | *p = 2; + | ------ borrow later used here + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:28:10 + | +LL | let p = &mut x.a; + | -------- borrow of `x.a` occurs here +LL | drop(x); //~ ERROR cannot use `x` because it was mutably borrowed + | ^ use of borrowed `x.a` +LL | *p = 3; + | ------ borrow later used here + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:35:10 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | drop(x.a); //~ ERROR cannot use `x.a` because it was mutably borrowed + | ^^^ use of borrowed `x` +LL | p.a = 3; + | ------- borrow later used here + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:42:10 + | +LL | let p = &mut x.a; + | -------- borrow of `x.a` occurs here +LL | drop(x.a); //~ ERROR cannot use `x.a` because it was mutably borrowed + | ^^^ use of borrowed `x.a` +LL | *p = 3; + | ------ borrow later used here + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:49:13 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | let y = A { b: 3, .. x }; //~ ERROR cannot use `x.a` because it was mutably borrowed + | ^^^^^^^^^^^^^^^^ use of borrowed `x` +LL | drop(y); +LL | p.a = 4; + | ------- borrow later used here + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:57:13 + | +LL | let p = &mut x.a; + | -------- borrow of `x.a` occurs here +LL | let y = A { b: 3, .. x }; //~ ERROR cannot use `x.a` because it was mutably borrowed + | ^^^^^^^^^^^^^^^^ use of borrowed `x.a` +LL | drop(y); +LL | *p = 4; + | ------ borrow later used here + +error[E0503]: cannot use `*x` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:65:10 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | drop(*x); //~ ERROR cannot use `*x` because it was mutably borrowed + | ^^ use of borrowed `x` +LL | **p = 2; + | ------- borrow later used here + +error[E0503]: cannot use `*x.b` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:72:10 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | drop(*x.b); //~ ERROR cannot use `*x.b` because it was mutably borrowed + | ^^^^ use of borrowed `x` +LL | p.a = 3; + | ------- borrow later used here + +error[E0503]: cannot use `*x.b` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:79:10 + | +LL | let p = &mut x.b; + | -------- borrow of `x.b` occurs here +LL | drop(*x.b); //~ ERROR cannot use `*x.b` because it was mutably borrowed + | ^^^^ use of borrowed `x.b` +LL | **p = 3; + | ------- borrow later used here + +error: aborting due to 9 previous errors + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/compile-fail/borrowck/borrowck-use-mut-borrow.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-mut-borrow.rs index c11e58651aa..c11e58651aa 100644 --- a/src/test/compile-fail/borrowck/borrowck-use-mut-borrow.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-mut-borrow.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-mut-borrow.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-mut-borrow.stderr new file mode 100644 index 00000000000..c5bfd813a79 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-mut-borrow.stderr @@ -0,0 +1,75 @@ +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:21:10 + | +LL | let p = &mut x; + | - borrow of `x` occurs here +LL | drop(x); //~ ERROR cannot use `x` because it was mutably borrowed + | ^ use of borrowed `x` + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:28:10 + | +LL | let p = &mut x.a; + | --- borrow of `x.a` occurs here +LL | drop(x); //~ ERROR cannot use `x` because it was mutably borrowed + | ^ use of borrowed `x.a` + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:35:10 + | +LL | let p = &mut x; + | - borrow of `x` occurs here +LL | drop(x.a); //~ ERROR cannot use `x.a` because it was mutably borrowed + | ^^^ use of borrowed `x` + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:42:10 + | +LL | let p = &mut x.a; + | --- borrow of `x.a` occurs here +LL | drop(x.a); //~ ERROR cannot use `x.a` because it was mutably borrowed + | ^^^ use of borrowed `x.a` + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:49:26 + | +LL | let p = &mut x; + | - borrow of `x` occurs here +LL | let y = A { b: 3, .. x }; //~ ERROR cannot use `x.a` because it was mutably borrowed + | ^ use of borrowed `x` + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:57:26 + | +LL | let p = &mut x.a; + | --- borrow of `x.a` occurs here +LL | let y = A { b: 3, .. x }; //~ ERROR cannot use `x.a` because it was mutably borrowed + | ^ use of borrowed `x.a` + +error[E0503]: cannot use `*x` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:65:10 + | +LL | let p = &mut x; + | - borrow of `x` occurs here +LL | drop(*x); //~ ERROR cannot use `*x` because it was mutably borrowed + | ^^ use of borrowed `x` + +error[E0503]: cannot use `*x.b` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:72:10 + | +LL | let p = &mut x; + | - borrow of `x` occurs here +LL | drop(*x.b); //~ ERROR cannot use `*x.b` because it was mutably borrowed + | ^^^^ use of borrowed `x` + +error[E0503]: cannot use `*x.b` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:79:10 + | +LL | let p = &mut x.b; + | --- borrow of `x.b` occurs here +LL | drop(*x.b); //~ ERROR cannot use `*x.b` because it was mutably borrowed + | ^^^^ use of borrowed `x.b` + +error: aborting due to 9 previous errors + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr new file mode 100644 index 00000000000..b96379db650 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `*x` + --> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:22:13 + | +LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x` + | ^ use of possibly uninitialized `*x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.stderr new file mode 100644 index 00000000000..47ea9f33b1e --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `*x` + --> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:22:13 + | +LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x` + | ^ use of possibly uninitialized `*x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr new file mode 100644 index 00000000000..b96379db650 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `*x` + --> $DIR/borrowck-use-uninitialized-in-cast-trait.rs:22:13 + | +LL | let y = x as *const Foo; //[ast]~ ERROR use of possibly uninitialized variable: `*x` + | ^ use of possibly uninitialized `*x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-use-uninitialized-in-cast-trait.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.rs index 57c2d508356..57c2d508356 100644 --- a/src/test/compile-fail/borrowck/borrowck-use-uninitialized-in-cast-trait.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast-trait.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr new file mode 100644 index 00000000000..6eddbd934d5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `*x` + --> $DIR/borrowck-use-uninitialized-in-cast.rs:20:13 + | +LL | let y = x as *const i32; //[ast]~ ERROR use of possibly uninitialized variable: `*x` [E0381] + | ^ use of possibly uninitialized `*x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.ast.stderr new file mode 100644 index 00000000000..75109abad51 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.ast.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `*x` + --> $DIR/borrowck-use-uninitialized-in-cast.rs:20:13 + | +LL | let y = x as *const i32; //[ast]~ ERROR use of possibly uninitialized variable: `*x` [E0381] + | ^ use of possibly uninitialized `*x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr new file mode 100644 index 00000000000..6eddbd934d5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `*x` + --> $DIR/borrowck-use-uninitialized-in-cast.rs:20:13 + | +LL | let y = x as *const i32; //[ast]~ ERROR use of possibly uninitialized variable: `*x` [E0381] + | ^ use of possibly uninitialized `*x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-use-uninitialized-in-cast.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.rs index dbc20d02057..dbc20d02057 100644 --- a/src/test/compile-fail/borrowck/borrowck-use-uninitialized-in-cast.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-use-uninitialized-in-cast.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-element-loan.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-element-loan.nll.stderr new file mode 100644 index 00000000000..374256c6bd6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-element-loan.nll.stderr @@ -0,0 +1,48 @@ +error[E0597]: `vec` does not live long enough + --> $DIR/borrowck-vec-pattern-element-loan.rs:15:25 + | +LL | let vec: &[isize] = &vec; //~ ERROR does not live long enough + | ^^^^ borrowed value does not live long enough +... +LL | } + | - `vec` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:6... + --> $DIR/borrowck-vec-pattern-element-loan.rs:13:6 + | +LL | fn a<'a>() -> &'a [isize] { + | ^^ + +error[E0597]: `vec` does not live long enough + --> $DIR/borrowck-vec-pattern-element-loan.rs:25:25 + | +LL | let vec: &[isize] = &vec; //~ ERROR does not live long enough + | ^^^^ borrowed value does not live long enough +... +LL | } + | - `vec` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:6... + --> $DIR/borrowck-vec-pattern-element-loan.rs:23:6 + | +LL | fn b<'a>() -> &'a [isize] { + | ^^ + +error[E0597]: `vec` does not live long enough + --> $DIR/borrowck-vec-pattern-element-loan.rs:35:25 + | +LL | let vec: &[isize] = &vec; //~ ERROR does not live long enough + | ^^^^ borrowed value does not live long enough +... +LL | } + | - `vec` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 33:6... + --> $DIR/borrowck-vec-pattern-element-loan.rs:33:6 + | +LL | fn c<'a>() -> &'a [isize] { + | ^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-vec-pattern-element-loan.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-element-loan.rs index 0fd6923326a..0fd6923326a 100644 --- a/src/test/compile-fail/borrowck/borrowck-vec-pattern-element-loan.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-element-loan.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-element-loan.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-element-loan.stderr new file mode 100644 index 00000000000..656a25d14fc --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-element-loan.stderr @@ -0,0 +1,48 @@ +error[E0597]: `vec` does not live long enough + --> $DIR/borrowck-vec-pattern-element-loan.rs:15:26 + | +LL | let vec: &[isize] = &vec; //~ ERROR does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:6... + --> $DIR/borrowck-vec-pattern-element-loan.rs:13:6 + | +LL | fn a<'a>() -> &'a [isize] { + | ^^ + +error[E0597]: `vec` does not live long enough + --> $DIR/borrowck-vec-pattern-element-loan.rs:25:26 + | +LL | let vec: &[isize] = &vec; //~ ERROR does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:6... + --> $DIR/borrowck-vec-pattern-element-loan.rs:23:6 + | +LL | fn b<'a>() -> &'a [isize] { + | ^^ + +error[E0597]: `vec` does not live long enough + --> $DIR/borrowck-vec-pattern-element-loan.rs:35:26 + | +LL | let vec: &[isize] = &vec; //~ ERROR does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 33:6... + --> $DIR/borrowck-vec-pattern-element-loan.rs:33:6 + | +LL | fn c<'a>() -> &'a [isize] { + | ^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-loan-from-mut.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-loan-from-mut.nll.stderr new file mode 100644 index 00000000000..9b73991ce30 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-loan-from-mut.nll.stderr @@ -0,0 +1,14 @@ +error[E0499]: cannot borrow `v` as mutable more than once at a time + --> $DIR/borrowck-vec-pattern-loan-from-mut.rs:18:13 + | +LL | let vb: &mut [isize] = &mut v; + | ------ first mutable borrow occurs here +... +LL | v.push(tail[0] + tail[1]); //~ ERROR cannot borrow + | ^ ------- borrow later used here + | | + | second mutable borrow occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/borrowck-vec-pattern-loan-from-mut.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-loan-from-mut.rs index 505c8c6d535..505c8c6d535 100644 --- a/src/test/compile-fail/borrowck/borrowck-vec-pattern-loan-from-mut.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-loan-from-mut.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-loan-from-mut.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-loan-from-mut.stderr new file mode 100644 index 00000000000..7015923af0a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-loan-from-mut.stderr @@ -0,0 +1,15 @@ +error[E0499]: cannot borrow `v` as mutable more than once at a time + --> $DIR/borrowck-vec-pattern-loan-from-mut.rs:18:13 + | +LL | let vb: &mut [isize] = &mut v; + | - first mutable borrow occurs here +... +LL | v.push(tail[0] + tail[1]); //~ ERROR cannot borrow + | ^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr new file mode 100644 index 00000000000..f99e2cec330 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0506]: cannot assign to `a[..]` because it is borrowed + --> $DIR/borrowck-vec-pattern-move-tail.rs:24:5 + | +LL | [1, 2, ref tail..] => tail, + | -------- borrow of `a[..]` occurs here +... +LL | a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed + | ^^^^^^^^ assignment to borrowed `a[..]` occurs here +... +LL | println!("t[0]: {}", t[0]); + | ---- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.ast.stderr new file mode 100644 index 00000000000..2b32de6944a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.ast.stderr @@ -0,0 +1,12 @@ +error[E0506]: cannot assign to `a[..]` because it is borrowed + --> $DIR/borrowck-vec-pattern-move-tail.rs:24:5 + | +LL | [1, 2, ref tail..] => tail, + | -------- borrow of `a[..]` occurs here +... +LL | a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed + | ^^^^^^^^ assignment to borrowed `a[..]` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.cmp.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.cmp.stderr new file mode 100644 index 00000000000..a6aa9cd6d2a --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.cmp.stderr @@ -0,0 +1,24 @@ +error[E0506]: cannot assign to `a[..]` because it is borrowed (Ast) + --> $DIR/borrowck-vec-pattern-move-tail.rs:24:5 + | +LL | [1, 2, ref tail..] => tail, + | -------- borrow of `a[..]` occurs here +... +LL | a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed + | ^^^^^^^^ assignment to borrowed `a[..]` occurs here + +error[E0506]: cannot assign to `a[..]` because it is borrowed (Mir) + --> $DIR/borrowck-vec-pattern-move-tail.rs:24:5 + | +LL | [1, 2, ref tail..] => tail, + | -------- borrow of `a[..]` occurs here +... +LL | a[2] = 0; //[ast]~ ERROR cannot assign to `a[..]` because it is borrowed + | ^^^^^^^^ assignment to borrowed `a[..]` occurs here +... +LL | println!("t[0]: {}", t[0]); + | ---- borrow later used here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/borrowck/borrowck-vec-pattern-move-tail.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.rs index 94877b27d58..94877b27d58 100644 --- a/src/test/compile-fail/borrowck/borrowck-vec-pattern-move-tail.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-move-tail.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-tail-element-loan.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-tail-element-loan.nll.stderr new file mode 100644 index 00000000000..6d45f1541a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-tail-element-loan.nll.stderr @@ -0,0 +1,18 @@ +error[E0597]: `vec` does not live long enough + --> $DIR/borrowck-vec-pattern-tail-element-loan.rs:15:25 + | +LL | let vec: &[isize] = &vec; //~ ERROR `vec` does not live long enough + | ^^^^ borrowed value does not live long enough +... +LL | } + | - `vec` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:6... + --> $DIR/borrowck-vec-pattern-tail-element-loan.rs:13:6 + | +LL | fn a<'a>() -> &'a isize { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/borrowck/borrowck-vec-pattern-tail-element-loan.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-tail-element-loan.rs index cd8f3ebefe6..cd8f3ebefe6 100644 --- a/src/test/compile-fail/borrowck/borrowck-vec-pattern-tail-element-loan.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-tail-element-loan.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-tail-element-loan.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-tail-element-loan.stderr new file mode 100644 index 00000000000..36343c1bde6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-vec-pattern-tail-element-loan.stderr @@ -0,0 +1,18 @@ +error[E0597]: `vec` does not live long enough + --> $DIR/borrowck-vec-pattern-tail-element-loan.rs:15:26 + | +LL | let vec: &[isize] = &vec; //~ ERROR `vec` does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 13:6... + --> $DIR/borrowck-vec-pattern-tail-element-loan.rs:13:6 + | +LL | fn a<'a>() -> &'a isize { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-while-break.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-break.nll.stderr new file mode 100644 index 00000000000..de2ba578962 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-break.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `v` + --> $DIR/borrowck-while-break.rs:17:20 + | +LL | println!("{}", v); //~ ERROR use of possibly uninitialized variable: `v` + | ^ use of possibly uninitialized `v` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-while-break.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-break.rs index 8cdf1da5c93..8cdf1da5c93 100644 --- a/src/test/compile-fail/borrowck/borrowck-while-break.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-break.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-while-break.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-break.stderr new file mode 100644 index 00000000000..eaaecdb5bbb --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-break.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `v` + --> $DIR/borrowck-while-break.rs:17:20 + | +LL | println!("{}", v); //~ ERROR use of possibly uninitialized variable: `v` + | ^ use of possibly uninitialized `v` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-while-cond.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-cond.rs index 27d42d666ea..27d42d666ea 100644 --- a/src/test/compile-fail/borrowck/borrowck-while-cond.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-cond.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-while-cond.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-cond.stderr new file mode 100644 index 00000000000..41ef9e800bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-while-cond.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-while-cond.rs:13:11 + | +LL | while x { } //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/borrowck/borrowck-while.rs b/src/test/ui/compile-fail-migration/borrowck/borrowck-while.rs index e3566e9bb92..e3566e9bb92 100644 --- a/src/test/compile-fail/borrowck/borrowck-while.rs +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-while.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/borrowck-while.stderr b/src/test/ui/compile-fail-migration/borrowck/borrowck-while.stderr new file mode 100644 index 00000000000..9fb2dcaa436 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/borrowck-while.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/borrowck-while.rs:14:12 + | +LL | return x; //~ ERROR use of possibly uninitialized variable: `x` + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/borrowck/move-in-static-initializer-issue-38520.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/move-in-static-initializer-issue-38520.ast.stderr new file mode 100644 index 00000000000..4c399ab6014 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/move-in-static-initializer-issue-38520.ast.stderr @@ -0,0 +1,15 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/move-in-static-initializer-issue-38520.rs:27:23 + | +LL | static Y: usize = get(*&X); //[ast]~ ERROR E0507 + | ^^^ cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/move-in-static-initializer-issue-38520.rs:29:22 + | +LL | const Z: usize = get(*&X); //[ast]~ ERROR E0507 + | ^^^ cannot move out of borrowed content + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/borrowck/move-in-static-initializer-issue-38520.mir.stderr b/src/test/ui/compile-fail-migration/borrowck/move-in-static-initializer-issue-38520.mir.stderr new file mode 100644 index 00000000000..4c399ab6014 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/move-in-static-initializer-issue-38520.mir.stderr @@ -0,0 +1,15 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/move-in-static-initializer-issue-38520.rs:27:23 + | +LL | static Y: usize = get(*&X); //[ast]~ ERROR E0507 + | ^^^ cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/move-in-static-initializer-issue-38520.rs:29:22 + | +LL | const Z: usize = get(*&X); //[ast]~ ERROR E0507 + | ^^^ cannot move out of borrowed content + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/borrowck/move-in-static-initializer-issue-38520.rs b/src/test/ui/compile-fail-migration/borrowck/move-in-static-initializer-issue-38520.rs index 508e09318ae..508e09318ae 100644 --- a/src/test/compile-fail/borrowck/move-in-static-initializer-issue-38520.rs +++ b/src/test/ui/compile-fail-migration/borrowck/move-in-static-initializer-issue-38520.rs diff --git a/src/test/compile-fail/borrowck/two-phase-across-loop.rs b/src/test/ui/compile-fail-migration/borrowck/two-phase-across-loop.rs index e03a0355b48..e03a0355b48 100644 --- a/src/test/compile-fail/borrowck/two-phase-across-loop.rs +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-across-loop.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-across-loop.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-across-loop.stderr new file mode 100644 index 00000000000..65c3d27923e --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-across-loop.stderr @@ -0,0 +1,9 @@ +error[E0499]: cannot borrow `foo` as mutable more than once at a time + --> $DIR/two-phase-across-loop.rs:29:22 + | +LL | strings.push(foo.get_string()); //~ ERROR cannot borrow `foo` as mutable + | ^^^ mutable borrow starts here in previous iteration of loop + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-activation-sharing-interference.nll_target.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-activation-sharing-interference.nll_target.stderr new file mode 100644 index 00000000000..5a7f33e5b56 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-activation-sharing-interference.nll_target.stderr @@ -0,0 +1,47 @@ +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-activation-sharing-interference.rs:42:15 + | +LL | let y = &mut x; + | ------ mutable borrow occurs here +LL | { let z = &x; read(z); } + | ^^ immutable borrow occurs here +LL | //[nll_target]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | *y += 1; + | ------- borrow later used here + +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-activation-sharing-interference.rs:50:13 + | +LL | let y = &mut x; + | ------ mutable borrow occurs here +LL | let z = &x; + | ^^ immutable borrow occurs here +LL | //[nll_target]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | *y += 1; + | ------- borrow later used here + +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-activation-sharing-interference.rs:61:13 + | +LL | let y = &mut x; + | ------ mutable borrow occurs here +LL | let z = &x; + | ^^ immutable borrow occurs here +... +LL | *y += 1; + | ------- borrow later used here + +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-activation-sharing-interference.rs:72:14 + | +LL | let y = &mut x; + | ------ mutable borrow occurs here +LL | let _z = &x; + | ^^ immutable borrow occurs here +LL | //[nll_target]~^ ERROR cannot borrow `x` as immutable because it is also borrowed as mutable +LL | *y += 1; + | ------- borrow later used here + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/two-phase-activation-sharing-interference.rs b/src/test/ui/compile-fail-migration/borrowck/two-phase-activation-sharing-interference.rs index 77b237e34f2..77b237e34f2 100644 --- a/src/test/compile-fail/borrowck/two-phase-activation-sharing-interference.rs +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-activation-sharing-interference.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr new file mode 100644 index 00000000000..45cfc836017 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr @@ -0,0 +1,27 @@ +error[E0503]: cannot use `i` because it was mutably borrowed + --> $DIR/two-phase-allow-access-during-reservation.rs:40:19 + | +LL | /*1*/ let p = &mut i; // (reservation of `i` starts here) + | ------ borrow of `i` occurs here +LL | +LL | /*2*/ let j = i; // OK: `i` is only reserved here + | ^ use of borrowed `i` +... +LL | /*3*/ *p += 1; // (mutable borrow of `i` starts here, since `p` is used) + | ------- borrow later used here + +error[E0503]: cannot use `i` because it was mutably borrowed + --> $DIR/two-phase-allow-access-during-reservation.rs:45:19 + | +LL | /*1*/ let p = &mut i; // (reservation of `i` starts here) + | ------ borrow of `i` occurs here +... +LL | /*4*/ let k = i; //[nll_beyond]~ ERROR cannot use `i` because it was mutably borrowed [E0503] + | ^ use of borrowed `i` +... +LL | /*5*/ *p += 1; + | ------- borrow later used here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/compile-fail/borrowck/two-phase-allow-access-during-reservation.rs b/src/test/ui/compile-fail-migration/borrowck/two-phase-allow-access-during-reservation.rs index 5deabf93764..5deabf93764 100644 --- a/src/test/compile-fail/borrowck/two-phase-allow-access-during-reservation.rs +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-allow-access-during-reservation.rs diff --git a/src/test/compile-fail/borrowck/two-phase-cannot-nest-mut-self-calls.rs b/src/test/ui/compile-fail-migration/borrowck/two-phase-cannot-nest-mut-self-calls.rs index 15700a1d61a..15700a1d61a 100644 --- a/src/test/compile-fail/borrowck/two-phase-cannot-nest-mut-self-calls.rs +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-cannot-nest-mut-self-calls.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-cannot-nest-mut-self-calls.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-cannot-nest-mut-self-calls.stderr new file mode 100644 index 00000000000..942a38febdd --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-cannot-nest-mut-self-calls.stderr @@ -0,0 +1,20 @@ +error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable + --> $DIR/two-phase-cannot-nest-mut-self-calls.rs:26:9 + | +LL | vec.get({ + | --- + | | + | _____immutable borrow occurs here + | | +LL | | +LL | | vec.push(2); + | | ^^^^^^^^^^^ mutable borrow occurs here +LL | | //~^ ERROR cannot borrow `vec` as mutable because it is also borrowed as immutable +LL | | +LL | | 0 +LL | | }); + | |______- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.ast.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.ast.nll.stderr new file mode 100644 index 00000000000..a8651c0e741 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.ast.nll.stderr @@ -0,0 +1,82 @@ +error[E0499]: cannot borrow `*f` as mutable more than once at a time + --> $DIR/two-phase-nonrecv-autoref.rs:70:11 + | +LL | f(f(10)); + | --^----- + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + | borrow later used here + +error[E0382]: use of moved value: `*f` + --> $DIR/two-phase-nonrecv-autoref.rs:79:11 + | +LL | f(f(10)); + | - ^ value used here after move + | | + | value moved here + +error[E0499]: cannot borrow `*f` as mutable more than once at a time + --> $DIR/two-phase-nonrecv-autoref.rs:86:11 + | +LL | f(f(10)); + | --^----- + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + | borrow later used here + +error[E0161]: cannot move a value of type dyn std::ops::FnOnce(i32) -> i32: the size of dyn std::ops::FnOnce(i32) -> i32 cannot be statically determined + --> $DIR/two-phase-nonrecv-autoref.rs:95:9 + | +LL | f(f(10)); + | ^ + +error[E0161]: cannot move a value of type dyn std::ops::FnOnce(i32) -> i32: the size of dyn std::ops::FnOnce(i32) -> i32 cannot be statically determined + --> $DIR/two-phase-nonrecv-autoref.rs:95:11 + | +LL | f(f(10)); + | ^ + +error[E0382]: use of moved value: `*f` + --> $DIR/two-phase-nonrecv-autoref.rs:95:11 + | +LL | f(f(10)); + | - ^ value used here after move + | | + | value moved here + +error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:139:27 + | +LL | double_access(&mut a, &a); + | ----------------------^^- + | | | | + | | | immutable borrow occurs here + | | mutable borrow occurs here + | borrow later used here + +error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:167:7 + | +LL | i[i[3]] = 4; + | --^---- + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + | borrow later used here + +error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:173:7 + | +LL | i[i[3]] = i[4]; + | --^---- + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + | borrow later used here + +error: aborting due to 9 previous errors + +Some errors occurred: E0161, E0382, E0499, E0502. +For more information about an error, try `rustc --explain E0161`. diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.ast.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.ast.stderr new file mode 100644 index 00000000000..b64323a5cc4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.ast.stderr @@ -0,0 +1,113 @@ +error[E0503]: cannot use `*x` because it was mutably borrowed + --> $DIR/two-phase-nonrecv-autoref.rs:41:12 + | +LL | foo(x, *x); + | - ^^ use of borrowed `*x` + | | + | borrow of `*x` occurs here + +error[E0499]: cannot borrow `*f` as mutable more than once at a time + --> $DIR/two-phase-nonrecv-autoref.rs:70:11 + | +LL | f(f(10)); + | - ^ - first borrow ends here + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + +error[E0382]: use of moved value: `*f` + --> $DIR/two-phase-nonrecv-autoref.rs:79:11 + | +LL | f(f(10)); + | - ^ value used here after move + | | + | value moved here + | + = note: move occurs because `*f` has type `F`, which does not implement the `Copy` trait + +error[E0499]: cannot borrow `*f` as mutable more than once at a time + --> $DIR/two-phase-nonrecv-autoref.rs:86:11 + | +LL | f(f(10)); + | - ^ - first borrow ends here + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + +error[E0382]: use of moved value: `*f` + --> $DIR/two-phase-nonrecv-autoref.rs:95:11 + | +LL | f(f(10)); + | - ^ value used here after move + | | + | value moved here + | + = note: move occurs because `*f` has type `(dyn std::ops::FnOnce(i32) -> i32 + 'static)`, which does not implement the `Copy` trait + +error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:139:28 + | +LL | double_access(&mut a, &a); + | - ^- mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:145:9 + | +LL | a.m(a.i(10)); + | - ^ - mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:167:7 + | +LL | i[i[3]] = 4; + | - ^ - mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:173:7 + | +LL | i[i[3]] = i[4]; + | - ^ - mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error[E0502]: cannot borrow `v` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:182:12 + | +LL | v.push(v.len()); + | - ^ - mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:193:9 + | +LL | s.m(s.i(10)); + | - ^ - mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error[E0502]: cannot borrow `t` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:198:9 + | +LL | t.m(t.i(10)); + | - ^ - mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error: aborting due to 12 previous errors + +Some errors occurred: E0382, E0499, E0502, E0503. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.nll.stderr new file mode 100644 index 00000000000..a8651c0e741 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.nll.stderr @@ -0,0 +1,82 @@ +error[E0499]: cannot borrow `*f` as mutable more than once at a time + --> $DIR/two-phase-nonrecv-autoref.rs:70:11 + | +LL | f(f(10)); + | --^----- + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + | borrow later used here + +error[E0382]: use of moved value: `*f` + --> $DIR/two-phase-nonrecv-autoref.rs:79:11 + | +LL | f(f(10)); + | - ^ value used here after move + | | + | value moved here + +error[E0499]: cannot borrow `*f` as mutable more than once at a time + --> $DIR/two-phase-nonrecv-autoref.rs:86:11 + | +LL | f(f(10)); + | --^----- + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + | borrow later used here + +error[E0161]: cannot move a value of type dyn std::ops::FnOnce(i32) -> i32: the size of dyn std::ops::FnOnce(i32) -> i32 cannot be statically determined + --> $DIR/two-phase-nonrecv-autoref.rs:95:9 + | +LL | f(f(10)); + | ^ + +error[E0161]: cannot move a value of type dyn std::ops::FnOnce(i32) -> i32: the size of dyn std::ops::FnOnce(i32) -> i32 cannot be statically determined + --> $DIR/two-phase-nonrecv-autoref.rs:95:11 + | +LL | f(f(10)); + | ^ + +error[E0382]: use of moved value: `*f` + --> $DIR/two-phase-nonrecv-autoref.rs:95:11 + | +LL | f(f(10)); + | - ^ value used here after move + | | + | value moved here + +error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:139:27 + | +LL | double_access(&mut a, &a); + | ----------------------^^- + | | | | + | | | immutable borrow occurs here + | | mutable borrow occurs here + | borrow later used here + +error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:167:7 + | +LL | i[i[3]] = 4; + | --^---- + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + | borrow later used here + +error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable + --> $DIR/two-phase-nonrecv-autoref.rs:173:7 + | +LL | i[i[3]] = i[4]; + | --^---- + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + | borrow later used here + +error: aborting due to 9 previous errors + +Some errors occurred: E0161, E0382, E0499, E0502. +For more information about an error, try `rustc --explain E0161`. diff --git a/src/test/compile-fail/borrowck/two-phase-nonrecv-autoref.rs b/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.rs index 30752e8ddb1..30752e8ddb1 100644 --- a/src/test/compile-fail/borrowck/two-phase-nonrecv-autoref.rs +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-nonrecv-autoref.rs diff --git a/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference-2.rs b/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference-2.rs index f9326d944b8..f9326d944b8 100644 --- a/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference-2.rs +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference-2.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference-2.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference-2.stderr new file mode 100644 index 00000000000..2ac10a82f7b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference-2.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/two-phase-reservation-sharing-interference-2.rs:27:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let mut v = vec![0, 1, 2]; +LL | | let shared = &v; +LL | | +... | +LL | | assert_eq!(v, [0, 1, 2, 3]); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr new file mode 100644 index 00000000000..62a548af62b --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr @@ -0,0 +1,15 @@ +error[E0502]: cannot borrow `vec` as mutable because it is also borrowed as immutable + --> $DIR/two-phase-reservation-sharing-interference.rs:46:17 + | +LL | let shared = &vec; + | ---- immutable borrow occurs here +... +LL | delay = &mut vec; + | ^^^^^^^^ mutable borrow occurs here +... +LL | shared[0]; + | ------ borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs b/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference.rs index 1e86603c19e..1e86603c19e 100644 --- a/src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-reservation-sharing-interference.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-sneaky.nll.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-sneaky.nll.stderr new file mode 100644 index 00000000000..26a6271bbde --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-sneaky.nll.stderr @@ -0,0 +1,20 @@ +error[E0499]: cannot borrow `v` as mutable more than once at a time + --> $DIR/two-phase-sneaky.rs:22:9 + | +LL | v[0].push_str({ + | - + | | + | _____first mutable borrow occurs here + | | +LL | | +LL | | v.push(format!("foo")); + | | ^ second mutable borrow occurs here +LL | | //~^ ERROR cannot borrow `v` as mutable more than once at a time [E0499] +LL | | +LL | | "World!" +LL | | }); + | |______- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/borrowck/two-phase-sneaky.rs b/src/test/ui/compile-fail-migration/borrowck/two-phase-sneaky.rs index eec4b470d75..eec4b470d75 100644 --- a/src/test/compile-fail/borrowck/two-phase-sneaky.rs +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-sneaky.rs diff --git a/src/test/ui/compile-fail-migration/borrowck/two-phase-sneaky.stderr b/src/test/ui/compile-fail-migration/borrowck/two-phase-sneaky.stderr new file mode 100644 index 00000000000..1ab9c188482 --- /dev/null +++ b/src/test/ui/compile-fail-migration/borrowck/two-phase-sneaky.stderr @@ -0,0 +1,15 @@ +error[E0499]: cannot borrow `v` as mutable more than once at a time + --> $DIR/two-phase-sneaky.rs:22:9 + | +LL | v[0].push_str({ + | - first mutable borrow occurs here +LL | +LL | v.push(format!("foo")); + | ^ second mutable borrow occurs here +... +LL | }); + | - first borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/bounds-lifetime.rs b/src/test/ui/compile-fail-migration/bounds-lifetime.rs index 5bfaa6c54fa..5bfaa6c54fa 100644 --- a/src/test/compile-fail/bounds-lifetime.rs +++ b/src/test/ui/compile-fail-migration/bounds-lifetime.rs diff --git a/src/test/ui/compile-fail-migration/bounds-lifetime.stderr b/src/test/ui/compile-fail-migration/bounds-lifetime.stderr new file mode 100644 index 00000000000..cbd140c13be --- /dev/null +++ b/src/test/ui/compile-fail-migration/bounds-lifetime.stderr @@ -0,0 +1,32 @@ +error: lifetime bounds cannot be used in this context + --> $DIR/bounds-lifetime.rs:11:22 + | +LL | type A = for<'b, 'a: 'b> fn(); //~ ERROR lifetime bounds cannot be used in this context + | ^^ + +error: lifetime bounds cannot be used in this context + --> $DIR/bounds-lifetime.rs:12:22 + | +LL | type B = for<'b, 'a: 'b,> fn(); //~ ERROR lifetime bounds cannot be used in this context + | ^^ + +error: lifetime bounds cannot be used in this context + --> $DIR/bounds-lifetime.rs:13:22 + | +LL | type C = for<'b, 'a: 'b +> fn(); //~ ERROR lifetime bounds cannot be used in this context + | ^^ + +error: only lifetime parameters can be used in this context + --> $DIR/bounds-lifetime.rs:14:18 + | +LL | type D = for<'a, T> fn(); //~ ERROR only lifetime parameters can be used in this context + | ^ + +error: only lifetime parameters can be used in this context + --> $DIR/bounds-lifetime.rs:15:14 + | +LL | type E = for<T> Fn(); //~ ERROR only lifetime parameters can be used in this context + | ^ + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/break-outside-loop.rs b/src/test/ui/compile-fail-migration/break-outside-loop.rs index 1f257b8a5cb..1f257b8a5cb 100644 --- a/src/test/compile-fail/break-outside-loop.rs +++ b/src/test/ui/compile-fail-migration/break-outside-loop.rs diff --git a/src/test/ui/compile-fail-migration/break-outside-loop.stderr b/src/test/ui/compile-fail-migration/break-outside-loop.stderr new file mode 100644 index 00000000000..820272d7e80 --- /dev/null +++ b/src/test/ui/compile-fail-migration/break-outside-loop.stderr @@ -0,0 +1,34 @@ +error[E0268]: `break` outside of loop + --> $DIR/break-outside-loop.rs:20:15 + | +LL | let pth = break; //~ ERROR: `break` outside of loop + | ^^^^^ cannot break outside of a loop + +error[E0268]: `continue` outside of loop + --> $DIR/break-outside-loop.rs:21:17 + | +LL | if cond() { continue } //~ ERROR: `continue` outside of loop + | ^^^^^^^^ cannot break outside of a loop + +error[E0267]: `break` inside of a closure + --> $DIR/break-outside-loop.rs:27:25 + | +LL | if cond() { break } //~ ERROR: `break` inside of a closure + | ^^^^^ cannot break inside of a closure + +error[E0267]: `continue` inside of a closure + --> $DIR/break-outside-loop.rs:28:25 + | +LL | if cond() { continue } //~ ERROR: `continue` inside of a closure + | ^^^^^^^^ cannot break inside of a closure + +error[E0268]: `break` outside of loop + --> $DIR/break-outside-loop.rs:34:25 + | +LL | let unconstrained = break; //~ ERROR: `break` outside of loop + | ^^^^^ cannot break outside of a loop + +error: aborting due to 5 previous errors + +Some errors occurred: E0267, E0268. +For more information about an error, try `rustc --explain E0267`. diff --git a/src/test/compile-fail/builtin-superkinds-double-superkind.rs b/src/test/ui/compile-fail-migration/builtin-superkinds-double-superkind.rs index 3f7f2adabdf..3f7f2adabdf 100644 --- a/src/test/compile-fail/builtin-superkinds-double-superkind.rs +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-double-superkind.rs diff --git a/src/test/ui/compile-fail-migration/builtin-superkinds-double-superkind.stderr b/src/test/ui/compile-fail-migration/builtin-superkinds-double-superkind.stderr new file mode 100644 index 00000000000..a462fcf4de4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-double-superkind.stderr @@ -0,0 +1,23 @@ +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/builtin-superkinds-double-superkind.rs:16:24 + | +LL | impl <T: Sync+'static> Foo for (T,) { } + | ^^^ `T` cannot be sent between threads safely + | + = help: within `(T,)`, the trait `std::marker::Send` is not implemented for `T` + = help: consider adding a `where T: std::marker::Send` bound + = note: required because it appears within the type `(T,)` + +error[E0277]: `T` cannot be shared between threads safely + --> $DIR/builtin-superkinds-double-superkind.rs:19:16 + | +LL | impl <T: Send> Foo for (T,T) { } + | ^^^ `T` cannot be shared between threads safely + | + = help: within `(T, T)`, the trait `std::marker::Sync` is not implemented for `T` + = help: consider adding a `where T: std::marker::Sync` bound + = note: required because it appears within the type `(T, T)` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/builtin-superkinds-in-metadata.rs b/src/test/ui/compile-fail-migration/builtin-superkinds-in-metadata.rs index 88b5a3fbb55..88b5a3fbb55 100644 --- a/src/test/compile-fail/builtin-superkinds-in-metadata.rs +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-in-metadata.rs diff --git a/src/test/ui/compile-fail-migration/builtin-superkinds-in-metadata.stderr b/src/test/ui/compile-fail-migration/builtin-superkinds-in-metadata.stderr new file mode 100644 index 00000000000..dcc7e3cd350 --- /dev/null +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-in-metadata.stderr @@ -0,0 +1,13 @@ +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/builtin-superkinds-in-metadata.rs:24:23 + | +LL | impl <T:Sync+'static> RequiresRequiresShareAndSend for X<T> { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `T` cannot be sent between threads safely + | + = help: within `X<T>`, the trait `std::marker::Send` is not implemented for `T` + = help: consider adding a `where T: std::marker::Send` bound + = note: required because it appears within the type `X<T>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/builtin-superkinds-self-type.rs b/src/test/ui/compile-fail-migration/builtin-superkinds-self-type.rs index 3065ecfaa30..3065ecfaa30 100644 --- a/src/test/compile-fail/builtin-superkinds-self-type.rs +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-self-type.rs diff --git a/src/test/ui/compile-fail-migration/builtin-superkinds-self-type.stderr b/src/test/ui/compile-fail-migration/builtin-superkinds-self-type.stderr new file mode 100644 index 00000000000..f96393d4b85 --- /dev/null +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-self-type.stderr @@ -0,0 +1,17 @@ +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/builtin-superkinds-self-type.rs:20:16 + | +LL | impl <T: Sync> Foo for T { } + | -- ^^^ + | | + | help: consider adding an explicit lifetime bound `T: 'static`... + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/builtin-superkinds-self-type.rs:20:16 + | +LL | impl <T: Sync> Foo for T { } + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/compile-fail/builtin-superkinds-simple.rs b/src/test/ui/compile-fail-migration/builtin-superkinds-simple.rs index 22dc9598d29..22dc9598d29 100644 --- a/src/test/compile-fail/builtin-superkinds-simple.rs +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-simple.rs diff --git a/src/test/ui/compile-fail-migration/builtin-superkinds-simple.stderr b/src/test/ui/compile-fail-migration/builtin-superkinds-simple.stderr new file mode 100644 index 00000000000..043953e7a2b --- /dev/null +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-simple.stderr @@ -0,0 +1,11 @@ +error[E0277]: `std::rc::Rc<i8>` cannot be sent between threads safely + --> $DIR/builtin-superkinds-simple.rs:16:6 + | +LL | impl Foo for std::rc::Rc<i8> { } + | ^^^ `std::rc::Rc<i8>` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `std::rc::Rc<i8>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs b/src/test/ui/compile-fail-migration/builtin-superkinds-typaram-not-send.rs index e0b2043c110..e0b2043c110 100644 --- a/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-typaram-not-send.rs diff --git a/src/test/ui/compile-fail-migration/builtin-superkinds-typaram-not-send.stderr b/src/test/ui/compile-fail-migration/builtin-superkinds-typaram-not-send.stderr new file mode 100644 index 00000000000..00bad2e80ef --- /dev/null +++ b/src/test/ui/compile-fail-migration/builtin-superkinds-typaram-not-send.stderr @@ -0,0 +1,12 @@ +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/builtin-superkinds-typaram-not-send.rs:15:24 + | +LL | impl <T: Sync+'static> Foo for T { } + | ^^^ `T` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `T` + = help: consider adding a `where T: std::marker::Send` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/by-move-pattern-binding.nll.stderr b/src/test/ui/compile-fail-migration/by-move-pattern-binding.nll.stderr new file mode 100644 index 00000000000..4ba9b3aeb5d --- /dev/null +++ b/src/test/ui/compile-fail-migration/by-move-pattern-binding.nll.stderr @@ -0,0 +1,15 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/by-move-pattern-binding.rs:24:11 + | +LL | match &s.x { + | ^^^^ cannot move out of borrowed content +LL | &E::Foo => {} +LL | &E::Bar(identifier) => f(identifier.clone()) //~ ERROR cannot move + | ---------- + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref identifier` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/by-move-pattern-binding.rs b/src/test/ui/compile-fail-migration/by-move-pattern-binding.rs index a49256d1bfc..a49256d1bfc 100644 --- a/src/test/compile-fail/by-move-pattern-binding.rs +++ b/src/test/ui/compile-fail-migration/by-move-pattern-binding.rs diff --git a/src/test/ui/compile-fail-migration/by-move-pattern-binding.stderr b/src/test/ui/compile-fail-migration/by-move-pattern-binding.stderr new file mode 100644 index 00000000000..a20de4ba42a --- /dev/null +++ b/src/test/ui/compile-fail-migration/by-move-pattern-binding.stderr @@ -0,0 +1,12 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/by-move-pattern-binding.rs:26:9 + | +LL | &E::Bar(identifier) => f(identifier.clone()) //~ ERROR cannot move + | ^^^^^^^^----------^ + | | | + | | hint: to prevent move, use `ref identifier` or `ref mut identifier` + | cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/call-fn-never-arg-wrong-type.rs b/src/test/ui/compile-fail-migration/call-fn-never-arg-wrong-type.rs index 583befed1e8..583befed1e8 100644 --- a/src/test/compile-fail/call-fn-never-arg-wrong-type.rs +++ b/src/test/ui/compile-fail-migration/call-fn-never-arg-wrong-type.rs diff --git a/src/test/ui/compile-fail-migration/call-fn-never-arg-wrong-type.stderr b/src/test/ui/compile-fail-migration/call-fn-never-arg-wrong-type.stderr new file mode 100644 index 00000000000..84ed8d15a42 --- /dev/null +++ b/src/test/ui/compile-fail-migration/call-fn-never-arg-wrong-type.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/call-fn-never-arg-wrong-type.rs:20:9 + | +LL | foo("wow"); //~ ERROR mismatched types + | ^^^^^ expected !, found reference + | + = note: expected type `!` + found type `&'static str` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/can-begin-expr-check.rs b/src/test/ui/compile-fail-migration/can-begin-expr-check.rs index 68f219c6ed9..68f219c6ed9 100644 --- a/src/test/compile-fail/can-begin-expr-check.rs +++ b/src/test/ui/compile-fail-migration/can-begin-expr-check.rs diff --git a/src/test/ui/compile-fail-migration/can-begin-expr-check.stderr b/src/test/ui/compile-fail-migration/can-begin-expr-check.stderr new file mode 100644 index 00000000000..ddcb69c5ee3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/can-begin-expr-check.stderr @@ -0,0 +1,8 @@ +error: expected one of `.`, `;`, `?`, `}`, or an operator, found `enum` + --> $DIR/can-begin-expr-check.rs:29:12 + | +LL | return enum; //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `enum` + | ^^^^ expected one of `.`, `;`, `?`, `}`, or an operator here + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.ast.nll.stderr b/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.ast.nll.stderr new file mode 100644 index 00000000000..a7ffc06872c --- /dev/null +++ b/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.ast.nll.stderr @@ -0,0 +1,20 @@ +error[E0594]: cannot assign to `x`, as it is not declared as mutable + --> $DIR/cannot-mutate-captured-non-mut-var.rs:23:25 + | +LL | let x = 1; + | - help: consider changing this to be mutable: `mut x` +LL | to_fn_once(move|| { x = 2; }); + | ^^^^^ cannot assign + +error[E0596]: cannot borrow `s` as mutable, as it is not declared as mutable + --> $DIR/cannot-mutate-captured-non-mut-var.rs:28:25 + | +LL | let s = std::io::stdin(); + | - help: consider changing this to be mutable: `mut s` +LL | to_fn_once(move|| { s.read_to_end(&mut Vec::new()); }); + | ^ cannot borrow as mutable + +error: aborting due to 2 previous errors + +Some errors occurred: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.ast.stderr b/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.ast.stderr new file mode 100644 index 00000000000..02d57ca48f2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.ast.stderr @@ -0,0 +1,16 @@ +error[E0594]: cannot assign to immutable captured outer variable in an `FnOnce` closure `x` + --> $DIR/cannot-mutate-captured-non-mut-var.rs:23:25 + | +LL | to_fn_once(move|| { x = 2; }); + | ^^^^^ + +error[E0596]: cannot borrow immutable captured outer variable in an `FnOnce` closure `s` as mutable + --> $DIR/cannot-mutate-captured-non-mut-var.rs:28:25 + | +LL | to_fn_once(move|| { s.read_to_end(&mut Vec::new()); }); + | ^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.mir.stderr b/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.mir.stderr new file mode 100644 index 00000000000..a7ffc06872c --- /dev/null +++ b/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.mir.stderr @@ -0,0 +1,20 @@ +error[E0594]: cannot assign to `x`, as it is not declared as mutable + --> $DIR/cannot-mutate-captured-non-mut-var.rs:23:25 + | +LL | let x = 1; + | - help: consider changing this to be mutable: `mut x` +LL | to_fn_once(move|| { x = 2; }); + | ^^^^^ cannot assign + +error[E0596]: cannot borrow `s` as mutable, as it is not declared as mutable + --> $DIR/cannot-mutate-captured-non-mut-var.rs:28:25 + | +LL | let s = std::io::stdin(); + | - help: consider changing this to be mutable: `mut s` +LL | to_fn_once(move|| { s.read_to_end(&mut Vec::new()); }); + | ^ cannot borrow as mutable + +error: aborting due to 2 previous errors + +Some errors occurred: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/cannot-mutate-captured-non-mut-var.rs b/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.rs index 6bd52f00788..6bd52f00788 100644 --- a/src/test/compile-fail/cannot-mutate-captured-non-mut-var.rs +++ b/src/test/ui/compile-fail-migration/cannot-mutate-captured-non-mut-var.rs diff --git a/src/test/compile-fail/capture1.rs b/src/test/ui/compile-fail-migration/capture1.rs index 984385f4cc0..984385f4cc0 100644 --- a/src/test/compile-fail/capture1.rs +++ b/src/test/ui/compile-fail-migration/capture1.rs diff --git a/src/test/ui/compile-fail-migration/capture1.stderr b/src/test/ui/compile-fail-migration/capture1.stderr new file mode 100644 index 00000000000..82eb1b64cfc --- /dev/null +++ b/src/test/ui/compile-fail-migration/capture1.stderr @@ -0,0 +1,11 @@ +error[E0434]: can't capture dynamic environment in a fn item + --> $DIR/capture1.rs:16:32 + | +LL | fn foo() -> isize { return bar; } + | ^^^ + | + = help: use the `|| { ... }` closure form instead + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0434`. diff --git a/src/test/compile-fail/cast-from-nil.rs b/src/test/ui/compile-fail-migration/cast-from-nil.rs index ab22d352480..ab22d352480 100644 --- a/src/test/compile-fail/cast-from-nil.rs +++ b/src/test/ui/compile-fail-migration/cast-from-nil.rs diff --git a/src/test/ui/compile-fail-migration/cast-from-nil.stderr b/src/test/ui/compile-fail-migration/cast-from-nil.stderr new file mode 100644 index 00000000000..4400007f93d --- /dev/null +++ b/src/test/ui/compile-fail-migration/cast-from-nil.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `()` as `u32` + --> $DIR/cast-from-nil.rs:12:21 + | +LL | fn main() { let u = (assert!(true) as u32); } + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/compile-fail/cast-ptr-to-int-const.rs b/src/test/ui/compile-fail-migration/cast-ptr-to-int-const.rs index 8764cb72b8c..8764cb72b8c 100644 --- a/src/test/compile-fail/cast-ptr-to-int-const.rs +++ b/src/test/ui/compile-fail-migration/cast-ptr-to-int-const.rs diff --git a/src/test/ui/compile-fail-migration/cast-ptr-to-int-const.stderr b/src/test/ui/compile-fail-migration/cast-ptr-to-int-const.stderr new file mode 100644 index 00000000000..7c3b4e42138 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cast-ptr-to-int-const.stderr @@ -0,0 +1,19 @@ +error[E0658]: casting pointers to integers in constants is unstable (see issue #51910) + --> $DIR/cast-ptr-to-int-const.rs:14:20 + | +LL | const X: u32 = main as u32; //~ ERROR casting pointers to integers in constants is unstable + | ^^^^^^^^^^^ + | + = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable + +error[E0658]: casting pointers to integers in constants is unstable (see issue #51910) + --> $DIR/cast-ptr-to-int-const.rs:16:20 + | +LL | const Z: u32 = &Y as *const u32 as u32; //~ ERROR is unstable + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_raw_ptr_to_usize_cast)] to the crate attributes to enable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/cast-to-bare-fn.rs b/src/test/ui/compile-fail-migration/cast-to-bare-fn.rs index d5a998c6e4b..d5a998c6e4b 100644 --- a/src/test/compile-fail/cast-to-bare-fn.rs +++ b/src/test/ui/compile-fail-migration/cast-to-bare-fn.rs diff --git a/src/test/ui/compile-fail-migration/cast-to-bare-fn.stderr b/src/test/ui/compile-fail-migration/cast-to-bare-fn.stderr new file mode 100644 index 00000000000..ed07f37f4f1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cast-to-bare-fn.stderr @@ -0,0 +1,19 @@ +error[E0605]: non-primitive cast: `fn(isize) {foo}` as `extern "C" fn() -> isize` + --> $DIR/cast-to-bare-fn.rs:15:13 + | +LL | let x = foo as extern "C" fn() -> isize; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error[E0605]: non-primitive cast: `u64` as `fn(isize) -> (isize, isize)` + --> $DIR/cast-to-bare-fn.rs:17:13 + | +LL | let y = v as extern "Rust" fn(isize) -> (isize, isize); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/compile-fail/cast-to-nil.rs b/src/test/ui/compile-fail-migration/cast-to-nil.rs index 27d9e8a42b1..27d9e8a42b1 100644 --- a/src/test/compile-fail/cast-to-nil.rs +++ b/src/test/ui/compile-fail-migration/cast-to-nil.rs diff --git a/src/test/ui/compile-fail-migration/cast-to-nil.stderr b/src/test/ui/compile-fail-migration/cast-to-nil.stderr new file mode 100644 index 00000000000..f7ee68e3d2b --- /dev/null +++ b/src/test/ui/compile-fail-migration/cast-to-nil.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `u32` as `()` + --> $DIR/cast-to-nil.rs:12:21 + | +LL | fn main() { let u = 0u32 as (); } + | ^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/ui/compile-fail-migration/catch-bad-lifetime.nll.stderr b/src/test/ui/compile-fail-migration/catch-bad-lifetime.nll.stderr new file mode 100644 index 00000000000..dd1595f9315 --- /dev/null +++ b/src/test/ui/compile-fail-migration/catch-bad-lifetime.nll.stderr @@ -0,0 +1,39 @@ +error[E0506]: cannot assign to `i` because it is borrowed + --> $DIR/catch-bad-lifetime.rs:33:13 + | +LL | let k = &mut i; + | ------ borrow of `i` occurs here +... +LL | i = 10; //~ ERROR cannot assign to `i` because it is borrowed + | ^^^^^^ assignment to borrowed `i` occurs here +LL | }; +LL | ::std::mem::drop(k); //~ ERROR use of moved value: `k` + | - borrow later used here + +error[E0382]: use of moved value: `k` + --> $DIR/catch-bad-lifetime.rs:35:26 + | +LL | Err(k) ?; + | - value moved here +... +LL | ::std::mem::drop(k); //~ ERROR use of moved value: `k` + | ^ value used here after move + | + = note: move occurs because `k` has type `&mut i32`, which does not implement the `Copy` trait + +error[E0506]: cannot assign to `i` because it is borrowed + --> $DIR/catch-bad-lifetime.rs:36:9 + | +LL | let k = &mut i; + | ------ borrow of `i` occurs here +... +LL | i = 40; //~ ERROR cannot assign to `i` because it is borrowed + | ^^^^^^ assignment to borrowed `i` occurs here +LL | +LL | let i_ptr = if let Err(i_ptr) = j { i_ptr } else { panic ! ("") }; + | - borrow later used here + +error: aborting due to 3 previous errors + +Some errors occurred: E0382, E0506. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/catch-bad-lifetime.rs b/src/test/ui/compile-fail-migration/catch-bad-lifetime.rs index f332ffd4494..f332ffd4494 100644 --- a/src/test/compile-fail/catch-bad-lifetime.rs +++ b/src/test/ui/compile-fail-migration/catch-bad-lifetime.rs diff --git a/src/test/ui/compile-fail-migration/catch-bad-lifetime.stderr b/src/test/ui/compile-fail-migration/catch-bad-lifetime.stderr new file mode 100644 index 00000000000..2ea54d1fb24 --- /dev/null +++ b/src/test/ui/compile-fail-migration/catch-bad-lifetime.stderr @@ -0,0 +1,44 @@ +error[E0597]: `my_string` does not live long enough + --> $DIR/catch-bad-lifetime.rs:20:35 + | +LL | let my_str: & str = & my_string; + | ^^^^^^^^^ borrowed value does not live long enough +... +LL | }; + | - `my_string` dropped here while still borrowed +LL | } + | - borrowed value needs to live until here + +error[E0506]: cannot assign to `i` because it is borrowed + --> $DIR/catch-bad-lifetime.rs:33:13 + | +LL | let k = &mut i; + | - borrow of `i` occurs here +... +LL | i = 10; //~ ERROR cannot assign to `i` because it is borrowed + | ^^^^^^ assignment to borrowed `i` occurs here + +error[E0382]: use of moved value: `k` + --> $DIR/catch-bad-lifetime.rs:35:26 + | +LL | Err(k) ?; + | - value moved here +... +LL | ::std::mem::drop(k); //~ ERROR use of moved value: `k` + | ^ value used here after move + | + = note: move occurs because `k` has type `&mut i32`, which does not implement the `Copy` trait + +error[E0506]: cannot assign to `i` because it is borrowed + --> $DIR/catch-bad-lifetime.rs:36:9 + | +LL | let k = &mut i; + | - borrow of `i` occurs here +... +LL | i = 40; //~ ERROR cannot assign to `i` because it is borrowed + | ^^^^^^ assignment to borrowed `i` occurs here + +error: aborting due to 4 previous errors + +Some errors occurred: E0382, E0506, E0597. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/catch-bad-type.rs b/src/test/ui/compile-fail-migration/catch-bad-type.rs index b369847699b..b369847699b 100644 --- a/src/test/compile-fail/catch-bad-type.rs +++ b/src/test/ui/compile-fail-migration/catch-bad-type.rs diff --git a/src/test/ui/compile-fail-migration/catch-bad-type.stderr b/src/test/ui/compile-fail-migration/catch-bad-type.stderr new file mode 100644 index 00000000000..f7405e5e5c8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/catch-bad-type.stderr @@ -0,0 +1,52 @@ +error[E0277]: the trait bound `i32: std::convert::From<&str>` is not satisfied + --> $DIR/catch-bad-type.rs:15:9 + | +LL | Err("")?; //~ ERROR the trait bound `i32: std::convert::From<&str>` is not satisfied + | ^^^^^^^^ the trait `std::convert::From<&str>` is not implemented for `i32` + | + = help: the following implementations were found: + <i32 as std::convert::From<u16>> + <i32 as std::convert::From<bool>> + <i32 as std::convert::From<i16>> + <i32 as std::convert::From<i8>> + <i32 as std::convert::From<u8>> + = note: required by `std::convert::From::from` + +error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == &str` + --> $DIR/catch-bad-type.rs:20:9 + | +LL | "" //~ ERROR type mismatch + | ^^ expected i32, found &str + | + = note: expected type `i32` + found type `&str` + +error[E0271]: type mismatch resolving `<std::result::Result<i32, i32> as std::ops::Try>::Ok == ()` + --> $DIR/catch-bad-type.rs:23:44 + | +LL | let res: Result<i32, i32> = do catch { }; //~ ERROR type mismatch + | ^ expected i32, found () + | + = note: expected type `i32` + found type `()` + +error[E0277]: the trait bound `(): std::ops::Try` is not satisfied + --> $DIR/catch-bad-type.rs:25:28 + | +LL | let res: () = do catch { }; //~ the trait bound `(): std::ops::Try` is not satisfied + | ^^^ the trait `std::ops::Try` is not implemented for `()` + | + = note: required by `std::ops::Try::from_ok` + +error[E0277]: the trait bound `i32: std::ops::Try` is not satisfied + --> $DIR/catch-bad-type.rs:27:29 + | +LL | let res: i32 = do catch { 5 }; //~ ERROR the trait bound `i32: std::ops::Try` is not satisfied + | ^^^^^ the trait `std::ops::Try` is not implemented for `i32` + | + = note: required by `std::ops::Try::from_ok` + +error: aborting due to 5 previous errors + +Some errors occurred: E0271, E0277. +For more information about an error, try `rustc --explain E0271`. diff --git a/src/test/compile-fail/catch-in-match.rs b/src/test/ui/compile-fail-migration/catch-in-match.rs index 9f9968e8124..9f9968e8124 100644 --- a/src/test/compile-fail/catch-in-match.rs +++ b/src/test/ui/compile-fail-migration/catch-in-match.rs diff --git a/src/test/ui/compile-fail-migration/catch-in-match.stderr b/src/test/ui/compile-fail-migration/catch-in-match.stderr new file mode 100644 index 00000000000..1542989cc35 --- /dev/null +++ b/src/test/ui/compile-fail-migration/catch-in-match.stderr @@ -0,0 +1,8 @@ +error: expected expression, found reserved keyword `do` + --> $DIR/catch-in-match.rs:14:11 + | +LL | match do catch { false } { _ => {} } //~ ERROR expected expression, found reserved keyword `do` + | ^^ expected expression + +error: aborting due to previous error + diff --git a/src/test/compile-fail/catch-in-while.rs b/src/test/ui/compile-fail-migration/catch-in-while.rs index cb8613ee60b..cb8613ee60b 100644 --- a/src/test/compile-fail/catch-in-while.rs +++ b/src/test/ui/compile-fail-migration/catch-in-while.rs diff --git a/src/test/ui/compile-fail-migration/catch-in-while.stderr b/src/test/ui/compile-fail-migration/catch-in-while.stderr new file mode 100644 index 00000000000..9316bbcd4bc --- /dev/null +++ b/src/test/ui/compile-fail-migration/catch-in-while.stderr @@ -0,0 +1,8 @@ +error: expected expression, found reserved keyword `do` + --> $DIR/catch-in-while.rs:14:11 + | +LL | while do catch { false } {} //~ ERROR expected expression, found reserved keyword `do` + | ^^ expected expression + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/catch-maybe-bad-lifetime.nll.stderr b/src/test/ui/compile-fail-migration/catch-maybe-bad-lifetime.nll.stderr new file mode 100644 index 00000000000..157793160ce --- /dev/null +++ b/src/test/ui/compile-fail-migration/catch-maybe-bad-lifetime.nll.stderr @@ -0,0 +1,14 @@ +error[E0382]: borrow of moved value: `x` + --> $DIR/catch-maybe-bad-lifetime.rs:33:24 + | +LL | ::std::mem::drop(x); + | - value moved here +LL | }; +LL | println!("{}", x); //~ ERROR use of moved value: `x` + | ^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/catch-maybe-bad-lifetime.rs b/src/test/ui/compile-fail-migration/catch-maybe-bad-lifetime.rs index faefb5ef18a..faefb5ef18a 100644 --- a/src/test/compile-fail/catch-maybe-bad-lifetime.rs +++ b/src/test/ui/compile-fail-migration/catch-maybe-bad-lifetime.rs diff --git a/src/test/ui/compile-fail-migration/catch-maybe-bad-lifetime.stderr b/src/test/ui/compile-fail-migration/catch-maybe-bad-lifetime.stderr new file mode 100644 index 00000000000..21fe1049f43 --- /dev/null +++ b/src/test/ui/compile-fail-migration/catch-maybe-bad-lifetime.stderr @@ -0,0 +1,33 @@ +error[E0506]: cannot assign to `i` because it is borrowed + --> $DIR/catch-maybe-bad-lifetime.rs:23:9 + | +LL | &i + | - borrow of `i` occurs here +... +LL | i = 0; //~ ERROR cannot assign to `i` because it is borrowed + | ^^^^^ assignment to borrowed `i` occurs here + +error[E0382]: use of moved value: `x` + --> $DIR/catch-maybe-bad-lifetime.rs:33:24 + | +LL | ::std::mem::drop(x); + | - value moved here +LL | }; +LL | println!("{}", x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0506]: cannot assign to `i` because it is borrowed + --> $DIR/catch-maybe-bad-lifetime.rs:45:9 + | +LL | j = &i; + | - borrow of `i` occurs here +LL | }; +LL | i = 0; //~ ERROR cannot assign to `i` because it is borrowed + | ^^^^^ assignment to borrowed `i` occurs here + +error: aborting due to 3 previous errors + +Some errors occurred: E0382, E0506. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/catch-opt-init.nll.stderr b/src/test/ui/compile-fail-migration/catch-opt-init.nll.stderr new file mode 100644 index 00000000000..ea8c8ebdcb7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/catch-opt-init.nll.stderr @@ -0,0 +1,11 @@ +error[E0381]: borrow of possibly uninitialized variable: `cfg_res` + --> $DIR/catch-opt-init.rs:23:5 + | +LL | assert_eq!(cfg_res, 5); //~ ERROR use of possibly uninitialized variable + | ^^^^^^^^^^^^^^^^^^^^^^^ use of possibly uninitialized `cfg_res` + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/catch-opt-init.rs b/src/test/ui/compile-fail-migration/catch-opt-init.rs index 0c41102e3be..0c41102e3be 100644 --- a/src/test/compile-fail/catch-opt-init.rs +++ b/src/test/ui/compile-fail-migration/catch-opt-init.rs diff --git a/src/test/ui/compile-fail-migration/catch-opt-init.stderr b/src/test/ui/compile-fail-migration/catch-opt-init.stderr new file mode 100644 index 00000000000..6a14ba17f9e --- /dev/null +++ b/src/test/ui/compile-fail-migration/catch-opt-init.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `cfg_res` + --> $DIR/catch-opt-init.rs:23:16 + | +LL | assert_eq!(cfg_res, 5); //~ ERROR use of possibly uninitialized variable + | ^^^^^^^ use of possibly uninitialized `cfg_res` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/cdylib-deps-must-be-static.rs b/src/test/ui/compile-fail-migration/cdylib-deps-must-be-static.rs index 0a06e01cab0..0a06e01cab0 100644 --- a/src/test/compile-fail/cdylib-deps-must-be-static.rs +++ b/src/test/ui/compile-fail-migration/cdylib-deps-must-be-static.rs diff --git a/src/test/ui/compile-fail-migration/cdylib-deps-must-be-static.stderr b/src/test/ui/compile-fail-migration/cdylib-deps-must-be-static.stderr new file mode 100644 index 00000000000..a1dc8e985da --- /dev/null +++ b/src/test/ui/compile-fail-migration/cdylib-deps-must-be-static.stderr @@ -0,0 +1,4 @@ +error: crate `cdylib_dep` required to be available in rlib format, but was not found in this form + +error: aborting due to previous error + diff --git a/src/test/compile-fail/cfg-arg-invalid.rs b/src/test/ui/compile-fail-migration/cfg-arg-invalid.rs index 404630399c6..404630399c6 100644 --- a/src/test/compile-fail/cfg-arg-invalid.rs +++ b/src/test/ui/compile-fail-migration/cfg-arg-invalid.rs diff --git a/src/test/compile-fail/cfg-attr-cfg-2.rs b/src/test/ui/compile-fail-migration/cfg-attr-cfg-2.rs index 58a62d45ea5..58a62d45ea5 100644 --- a/src/test/compile-fail/cfg-attr-cfg-2.rs +++ b/src/test/ui/compile-fail-migration/cfg-attr-cfg-2.rs diff --git a/src/test/ui/compile-fail-migration/cfg-attr-cfg-2.stderr b/src/test/ui/compile-fail-migration/cfg-attr-cfg-2.stderr new file mode 100644 index 00000000000..db3c7acff15 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cfg-attr-cfg-2.stderr @@ -0,0 +1,7 @@ +error[E0601]: `main` function not found in crate `cfg_attr_cfg_2` + | + = note: consider adding a `main` function to `$DIR/cfg-attr-cfg-2.rs` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/compile-fail/cfg-attr-crate-2.rs b/src/test/ui/compile-fail-migration/cfg-attr-crate-2.rs index a79c7663861..a79c7663861 100644 --- a/src/test/compile-fail/cfg-attr-crate-2.rs +++ b/src/test/ui/compile-fail-migration/cfg-attr-crate-2.rs diff --git a/src/test/ui/compile-fail-migration/cfg-attr-crate-2.stderr b/src/test/ui/compile-fail-migration/cfg-attr-crate-2.stderr new file mode 100644 index 00000000000..7b66c8f5e40 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cfg-attr-crate-2.stderr @@ -0,0 +1,11 @@ +error[E0658]: no_core is experimental (see issue #29639) + --> $DIR/cfg-attr-crate-2.rs:15:21 + | +LL | #![cfg_attr(broken, no_core)] //~ ERROR no_core is experimental + | ^^^^^^^^ + | + = help: add #![feature(no_core)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/cfg-attr-invalid-predicate.rs b/src/test/ui/compile-fail-migration/cfg-attr-invalid-predicate.rs index 09fe6cec49c..09fe6cec49c 100644 --- a/src/test/compile-fail/cfg-attr-invalid-predicate.rs +++ b/src/test/ui/compile-fail-migration/cfg-attr-invalid-predicate.rs diff --git a/src/test/ui/compile-fail-migration/cfg-attr-invalid-predicate.stderr b/src/test/ui/compile-fail-migration/cfg-attr-invalid-predicate.stderr new file mode 100644 index 00000000000..5a89f9766d1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cfg-attr-invalid-predicate.stderr @@ -0,0 +1,9 @@ +error[E0537]: invalid predicate `foo` + --> $DIR/cfg-attr-invalid-predicate.rs:11:7 + | +LL | #[cfg(foo(bar))] //~ ERROR invalid predicate `foo` + | ^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0537`. diff --git a/src/test/compile-fail/cfg-attr-unknown-attribute-macro-expansion.rs b/src/test/ui/compile-fail-migration/cfg-attr-unknown-attribute-macro-expansion.rs index afcb896b43c..afcb896b43c 100644 --- a/src/test/compile-fail/cfg-attr-unknown-attribute-macro-expansion.rs +++ b/src/test/ui/compile-fail-migration/cfg-attr-unknown-attribute-macro-expansion.rs diff --git a/src/test/ui/compile-fail-migration/cfg-attr-unknown-attribute-macro-expansion.stderr b/src/test/ui/compile-fail-migration/cfg-attr-unknown-attribute-macro-expansion.stderr new file mode 100644 index 00000000000..33fe52366db --- /dev/null +++ b/src/test/ui/compile-fail-migration/cfg-attr-unknown-attribute-macro-expansion.stderr @@ -0,0 +1,14 @@ +error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:13:27 + | +LL | #[cfg_attr(all(), unknown)] //~ ERROR `unknown` is currently unknown + | ^^^^^^^^ +... +LL | foo!(); + | ------- in this macro invocation + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/cfg-empty-codemap.rs b/src/test/ui/compile-fail-migration/cfg-empty-codemap.rs index 8868a5a9549..8868a5a9549 100644 --- a/src/test/compile-fail/cfg-empty-codemap.rs +++ b/src/test/ui/compile-fail-migration/cfg-empty-codemap.rs diff --git a/src/test/compile-fail/cfg-in-crate-1.rs b/src/test/ui/compile-fail-migration/cfg-in-crate-1.rs index bbccf2bcd0f..bbccf2bcd0f 100644 --- a/src/test/compile-fail/cfg-in-crate-1.rs +++ b/src/test/ui/compile-fail-migration/cfg-in-crate-1.rs diff --git a/src/test/ui/compile-fail-migration/cfg-in-crate-1.stderr b/src/test/ui/compile-fail-migration/cfg-in-crate-1.stderr new file mode 100644 index 00000000000..c6d42c732c9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cfg-in-crate-1.stderr @@ -0,0 +1,7 @@ +error[E0601]: `main` function not found in crate `cfg_in_crate_1` + | + = note: consider adding a `main` function to `$DIR/cfg-in-crate-1.rs` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/compile-fail/cfg-non-opt-expr.rs b/src/test/ui/compile-fail-migration/cfg-non-opt-expr.rs index a4b24fa8b4b..a4b24fa8b4b 100644 --- a/src/test/compile-fail/cfg-non-opt-expr.rs +++ b/src/test/ui/compile-fail-migration/cfg-non-opt-expr.rs diff --git a/src/test/ui/compile-fail-migration/cfg-non-opt-expr.stderr b/src/test/ui/compile-fail-migration/cfg-non-opt-expr.stderr new file mode 100644 index 00000000000..0511c575546 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cfg-non-opt-expr.stderr @@ -0,0 +1,26 @@ +error: removing an expression is not supported in this position + --> $DIR/cfg-non-opt-expr.rs:14:13 + | +LL | let _ = #[cfg(unset)] (); + | ^^^^^^^^^^^^^ + +error: removing an expression is not supported in this position + --> $DIR/cfg-non-opt-expr.rs:16:21 + | +LL | let _ = 1 + 2 + #[cfg(unset)] 3; + | ^^^^^^^^^^^^^ + +error: removing an expression is not supported in this position + --> $DIR/cfg-non-opt-expr.rs:18:23 + | +LL | let _ = [1, 2, 3][#[cfg(unset)] 1]; + | ^^^^^^^^^^^^^ + +error: removing an expression is not supported in this position + --> $DIR/cfg-non-opt-expr.rs:20:13 + | +LL | let _ = #[test] (); + | ^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/cfg_attr_path.rs b/src/test/ui/compile-fail-migration/cfg_attr_path.rs index 7d799850a65..7d799850a65 100644 --- a/src/test/compile-fail/cfg_attr_path.rs +++ b/src/test/ui/compile-fail-migration/cfg_attr_path.rs diff --git a/src/test/ui/compile-fail-migration/cfg_attr_path.stderr b/src/test/ui/compile-fail-migration/cfg_attr_path.stderr new file mode 100644 index 00000000000..67e59d054d5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cfg_attr_path.stderr @@ -0,0 +1,11 @@ +error: compilation successful + --> $DIR/cfg_attr_path.rs:21:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let _ = auxiliary::namespaced_enums::Foo::A; +LL | | let _ = auxiliary::nonexistent_file::Foo::A; +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/check-static-immutable-mut-slices.rs b/src/test/ui/compile-fail-migration/check-static-immutable-mut-slices.rs index 1804b9e04c2..1804b9e04c2 100644 --- a/src/test/compile-fail/check-static-immutable-mut-slices.rs +++ b/src/test/ui/compile-fail-migration/check-static-immutable-mut-slices.rs diff --git a/src/test/ui/compile-fail-migration/check-static-immutable-mut-slices.stderr b/src/test/ui/compile-fail-migration/check-static-immutable-mut-slices.stderr new file mode 100644 index 00000000000..b0a7cd1221b --- /dev/null +++ b/src/test/ui/compile-fail-migration/check-static-immutable-mut-slices.stderr @@ -0,0 +1,9 @@ +error[E0017]: references in statics may only refer to immutable values + --> $DIR/check-static-immutable-mut-slices.rs:13:37 + | +LL | static TEST: &'static mut [isize] = &mut []; + | ^^^^^^^ statics require immutable values + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0017`. diff --git a/src/test/ui/compile-fail-migration/check-static-values-constraints.nll.stderr b/src/test/ui/compile-fail-migration/check-static-values-constraints.nll.stderr new file mode 100644 index 00000000000..b265ec8bdda --- /dev/null +++ b/src/test/ui/compile-fail-migration/check-static-values-constraints.nll.stderr @@ -0,0 +1,70 @@ +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/check-static-values-constraints.rs:75:43 + | +LL | ..SafeStruct{field1: SafeEnum::Variant3(WithDtor), + | ___________________________________________^ +LL | | //~^ ERROR destructors cannot be evaluated at compile-time +LL | | field2: SafeEnum::Variant1}}; + | |________________________________________________________________________________^ statics cannot evaluate destructors + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:89:33 + | +LL | static STATIC11: Box<MyOwned> = box MyOwned; + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants + --> $DIR/check-static-values-constraints.rs:99:32 + | +LL | field2: SafeEnum::Variant4("str".to_string()) + | ^^^^^^^^^^^^^^^^^ + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:104:5 + | +LL | box MyOwned, //~ ERROR allocations are not allowed in statics + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:105:5 + | +LL | box MyOwned, //~ ERROR allocations are not allowed in statics + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:109:6 + | +LL | &box MyOwned, //~ ERROR allocations are not allowed in statics + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:110:6 + | +LL | &box MyOwned, //~ ERROR allocations are not allowed in statics + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:116:5 + | +LL | box 3; + | ^^^^^ allocation not allowed in statics + +error[E0507]: cannot move out of static item + --> $DIR/check-static-values-constraints.rs:120:45 + | +LL | let y = { static x: Box<isize> = box 3; x }; + | ^ + | | + | cannot move out of static item + | help: consider using a reference instead: `&x` + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:120:38 + | +LL | let y = { static x: Box<isize> = box 3; x }; + | ^^^^^ allocation not allowed in statics + +error: aborting due to 10 previous errors + +Some errors occurred: E0010, E0015, E0493, E0507. +For more information about an error, try `rustc --explain E0010`. diff --git a/src/test/compile-fail/check-static-values-constraints.rs b/src/test/ui/compile-fail-migration/check-static-values-constraints.rs index 37f665960c8..37f665960c8 100644 --- a/src/test/compile-fail/check-static-values-constraints.rs +++ b/src/test/ui/compile-fail-migration/check-static-values-constraints.rs diff --git a/src/test/ui/compile-fail-migration/check-static-values-constraints.stderr b/src/test/ui/compile-fail-migration/check-static-values-constraints.stderr new file mode 100644 index 00000000000..ac979a3fa7c --- /dev/null +++ b/src/test/ui/compile-fail-migration/check-static-values-constraints.stderr @@ -0,0 +1,67 @@ +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/check-static-values-constraints.rs:75:43 + | +LL | ..SafeStruct{field1: SafeEnum::Variant3(WithDtor), + | ___________________________________________^ +LL | | //~^ ERROR destructors cannot be evaluated at compile-time +LL | | field2: SafeEnum::Variant1}}; + | |________________________________________________________________________________^ statics cannot evaluate destructors + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:89:33 + | +LL | static STATIC11: Box<MyOwned> = box MyOwned; + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants + --> $DIR/check-static-values-constraints.rs:99:32 + | +LL | field2: SafeEnum::Variant4("str".to_string()) + | ^^^^^^^^^^^^^^^^^ + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:104:5 + | +LL | box MyOwned, //~ ERROR allocations are not allowed in statics + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:105:5 + | +LL | box MyOwned, //~ ERROR allocations are not allowed in statics + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:109:6 + | +LL | &box MyOwned, //~ ERROR allocations are not allowed in statics + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:110:6 + | +LL | &box MyOwned, //~ ERROR allocations are not allowed in statics + | ^^^^^^^^^^^ allocation not allowed in statics + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:116:5 + | +LL | box 3; + | ^^^^^ allocation not allowed in statics + +error[E0507]: cannot move out of static item + --> $DIR/check-static-values-constraints.rs:120:45 + | +LL | let y = { static x: Box<isize> = box 3; x }; + | ^ cannot move out of static item + +error[E0010]: allocations are not allowed in statics + --> $DIR/check-static-values-constraints.rs:120:38 + | +LL | let y = { static x: Box<isize> = box 3; x }; + | ^^^^^ allocation not allowed in statics + +error: aborting due to 10 previous errors + +Some errors occurred: E0010, E0015, E0493, E0507. +For more information about an error, try `rustc --explain E0010`. diff --git a/src/test/compile-fail/class-cast-to-trait.rs b/src/test/ui/compile-fail-migration/class-cast-to-trait.rs index af83b0ecbf2..af83b0ecbf2 100644 --- a/src/test/compile-fail/class-cast-to-trait.rs +++ b/src/test/ui/compile-fail-migration/class-cast-to-trait.rs diff --git a/src/test/ui/compile-fail-migration/class-cast-to-trait.stderr b/src/test/ui/compile-fail-migration/class-cast-to-trait.stderr new file mode 100644 index 00000000000..c1e08807f97 --- /dev/null +++ b/src/test/ui/compile-fail-migration/class-cast-to-trait.stderr @@ -0,0 +1,9 @@ +error[E0599]: no method named `eat` found for type `std::boxed::Box<dyn noisy>` in the current scope + --> $DIR/class-cast-to-trait.rs:63:8 + | +LL | nyan.eat(); //~ ERROR no method named `eat` found + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/class-method-missing.rs b/src/test/ui/compile-fail-migration/class-method-missing.rs index 46b100a4d39..46b100a4d39 100644 --- a/src/test/compile-fail/class-method-missing.rs +++ b/src/test/ui/compile-fail-migration/class-method-missing.rs diff --git a/src/test/ui/compile-fail-migration/class-method-missing.stderr b/src/test/ui/compile-fail-migration/class-method-missing.stderr new file mode 100644 index 00000000000..c1da06e3a3a --- /dev/null +++ b/src/test/ui/compile-fail-migration/class-method-missing.stderr @@ -0,0 +1,12 @@ +error[E0046]: not all trait items implemented, missing: `eat` + --> $DIR/class-method-missing.rs:19:1 + | +LL | fn eat(&self); + | -------------- `eat` from trait +... +LL | impl animal for cat { + | ^^^^^^^^^^^^^^^^^^^ missing `eat` in implementation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0046`. diff --git a/src/test/compile-fail/class-missing-self.rs b/src/test/ui/compile-fail-migration/class-missing-self.rs index 372bf4cac87..372bf4cac87 100644 --- a/src/test/compile-fail/class-missing-self.rs +++ b/src/test/ui/compile-fail-migration/class-missing-self.rs diff --git a/src/test/ui/compile-fail-migration/class-missing-self.stderr b/src/test/ui/compile-fail-migration/class-missing-self.stderr new file mode 100644 index 00000000000..33bf62e7087 --- /dev/null +++ b/src/test/ui/compile-fail-migration/class-missing-self.stderr @@ -0,0 +1,19 @@ +error[E0425]: cannot find value `meows` in this scope + --> $DIR/class-missing-self.rs:19:7 + | +LL | meows += 1; //~ ERROR cannot find value `meows` in this scope + | ^^^^^ help: try: `self.meows` + +error[E0425]: cannot find function `sleep` in this scope + --> $DIR/class-missing-self.rs:20:7 + | +LL | sleep(); //~ ERROR cannot find function `sleep` in this scope + | ^^^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use std::thread::sleep; + | + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/cleanup-rvalue-scopes-cf.rs b/src/test/ui/compile-fail-migration/cleanup-rvalue-scopes-cf.rs index dcbb25ba5a9..dcbb25ba5a9 100644 --- a/src/test/compile-fail/cleanup-rvalue-scopes-cf.rs +++ b/src/test/ui/compile-fail-migration/cleanup-rvalue-scopes-cf.rs diff --git a/src/test/ui/compile-fail-migration/cleanup-rvalue-scopes-cf.stderr b/src/test/ui/compile-fail-migration/cleanup-rvalue-scopes-cf.stderr new file mode 100644 index 00000000000..f30271db289 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cleanup-rvalue-scopes-cf.stderr @@ -0,0 +1,93 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/cleanup-rvalue-scopes-cf.rs:36:19 + | +LL | let _x = arg(&AddFlags(1)); //~ ERROR value does not live long enough + | ^^^^^^^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +... +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/cleanup-rvalue-scopes-cf.rs:37:14 + | +LL | let _x = AddFlags(1).get(); //~ ERROR value does not live long enough + | ^^^^^^^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +... +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/cleanup-rvalue-scopes-cf.rs:38:21 + | +LL | let _x = &*arg(&AddFlags(1)); //~ ERROR value does not live long enough + | ^^^^^^^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +... +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/cleanup-rvalue-scopes-cf.rs:39:24 + | +LL | let ref _x = *arg(&AddFlags(1)); //~ ERROR value does not live long enough + | ^^^^^^^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +... +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/cleanup-rvalue-scopes-cf.rs:40:24 + | +LL | let &ref _x = arg(&AddFlags(1)); //~ ERROR value does not live long enough + | ^^^^^^^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +... +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/cleanup-rvalue-scopes-cf.rs:41:14 + | +LL | let _x = AddFlags(1).get(); //~ ERROR value does not live long enough + | ^^^^^^^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +LL | let Box { f: _x } = Box { f: AddFlags(1).get() }; //~ ERROR value does not live long enough +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/cleanup-rvalue-scopes-cf.rs:42:34 + | +LL | let Box { f: _x } = Box { f: AddFlags(1).get() }; //~ ERROR value does not live long enough + | ^^^^^^^^^^^ - temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs b/src/test/ui/compile-fail-migration/closure-bounds-cant-promote-superkind-in-struct.rs index 12e9fb30902..12e9fb30902 100644 --- a/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs +++ b/src/test/ui/compile-fail-migration/closure-bounds-cant-promote-superkind-in-struct.rs diff --git a/src/test/ui/compile-fail-migration/closure-bounds-cant-promote-superkind-in-struct.stderr b/src/test/ui/compile-fail-migration/closure-bounds-cant-promote-superkind-in-struct.stderr new file mode 100644 index 00000000000..e1b18b1d49e --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-bounds-cant-promote-superkind-in-struct.stderr @@ -0,0 +1,20 @@ +error[E0277]: `F` cannot be sent between threads safely + --> $DIR/closure-bounds-cant-promote-superkind-in-struct.rs:15:1 + | +LL | / fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static { +LL | | //~^ ERROR `F` cannot be sent between threads safely +LL | | return X { field: blk }; +LL | | } + | |_^ `F` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `F` + = help: consider adding a `where F: std::marker::Send` bound +note: required by `X` + --> $DIR/closure-bounds-cant-promote-superkind-in-struct.rs:11:1 + | +LL | struct X<F> where F: FnOnce() + 'static + Send { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/closure-bounds-static-cant-capture-borrowed.nll.stderr b/src/test/ui/compile-fail-migration/closure-bounds-static-cant-capture-borrowed.nll.stderr new file mode 100644 index 00000000000..ca82020a2cc --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-bounds-static-cant-capture-borrowed.nll.stderr @@ -0,0 +1,39 @@ +warning: not reporting region error due to nll + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:15:9 + | +LL | bar(|| { + | _________^ +LL | | //~^ ERROR explicit lifetime required in the type of `x` [E0621] +LL | | let _ = x; +LL | | }) + | |_____^ + +error[E0621]: explicit lifetime required in the type of `x` + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:15:5 + | +LL | fn foo(x: &()) { + | --- help: add explicit lifetime `'static` to the type of `x`: `&'static ()` +LL | / bar(|| { +LL | | //~^ ERROR explicit lifetime required in the type of `x` [E0621] +LL | | let _ = x; +LL | | }) + | |______^ lifetime `'static` required + +error[E0597]: `x` does not live long enough + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:17:17 + | +LL | bar(|| { + | -- value captured here +LL | //~^ ERROR explicit lifetime required in the type of `x` [E0621] +LL | let _ = x; + | ^ borrowed value does not live long enough +LL | }) +LL | } + | - `x` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 2 previous errors + +Some errors occurred: E0597, E0621. +For more information about an error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs b/src/test/ui/compile-fail-migration/closure-bounds-static-cant-capture-borrowed.rs index 1ffba68263a..1ffba68263a 100644 --- a/src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs +++ b/src/test/ui/compile-fail-migration/closure-bounds-static-cant-capture-borrowed.rs diff --git a/src/test/ui/compile-fail-migration/closure-bounds-static-cant-capture-borrowed.stderr b/src/test/ui/compile-fail-migration/closure-bounds-static-cant-capture-borrowed.stderr new file mode 100644 index 00000000000..825f469c330 --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-bounds-static-cant-capture-borrowed.stderr @@ -0,0 +1,11 @@ +error[E0621]: explicit lifetime required in the type of `x` + --> $DIR/closure-bounds-static-cant-capture-borrowed.rs:15:5 + | +LL | fn foo(x: &()) { + | --- help: add explicit lifetime `'static` to the type of `x`: `&'static ()` +LL | bar(|| { + | ^^^ lifetime `'static` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/compile-fail/closure-bounds-subtype.rs b/src/test/ui/compile-fail-migration/closure-bounds-subtype.rs index db26535b004..db26535b004 100644 --- a/src/test/compile-fail/closure-bounds-subtype.rs +++ b/src/test/ui/compile-fail-migration/closure-bounds-subtype.rs diff --git a/src/test/ui/compile-fail-migration/closure-bounds-subtype.stderr b/src/test/ui/compile-fail-migration/closure-bounds-subtype.stderr new file mode 100644 index 00000000000..ffe486d4468 --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-bounds-subtype.stderr @@ -0,0 +1,17 @@ +error[E0277]: `F` cannot be shared between threads safely + --> $DIR/closure-bounds-subtype.rs:24:5 + | +LL | take_const_owned(f); //~ ERROR `F` cannot be shared between threads safely [E0277] + | ^^^^^^^^^^^^^^^^ `F` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `F` + = help: consider adding a `where F: std::marker::Sync` bound +note: required by `take_const_owned` + --> $DIR/closure-bounds-subtype.rs:15:1 + | +LL | fn take_const_owned<F>(_: F) where F: FnOnce() + Sync + Send { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/closure-expected-type/README.md b/src/test/ui/compile-fail-migration/closure-expected-type/README.md index 9995b00a9a7..9995b00a9a7 100644 --- a/src/test/compile-fail/closure-expected-type/README.md +++ b/src/test/ui/compile-fail-migration/closure-expected-type/README.md diff --git a/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn-multiple.rs b/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn-multiple.rs index 32efb01c0fe..32efb01c0fe 100644 --- a/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn-multiple.rs +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn-multiple.rs diff --git a/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn.nll.stderr b/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn.nll.stderr new file mode 100644 index 00000000000..fe857001bfa --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn.nll.stderr @@ -0,0 +1,60 @@ +warning: not reporting region error due to nll + --> $DIR/expect-fn-supply-fn.rs:24:52 + | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); + | ^^^^^^^^^^^ + +error[E0631]: type mismatch in closure arguments + --> $DIR/expect-fn-supply-fn.rs:40:5 + | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _` + | | + | expected signature of `for<'a, 'r> fn(fn(&'a u32), &'r i32) -> _` + | +note: required by `with_closure_expecting_fn_with_free_region` + --> $DIR/expect-fn-supply-fn.rs:11:1 + | +LL | / fn with_closure_expecting_fn_with_free_region<F>(_: F) +LL | | where F: for<'a> FnOnce(fn(&'a u32), &i32) +LL | | { +LL | | } + | |_^ + +error[E0631]: type mismatch in closure arguments + --> $DIR/expect-fn-supply-fn.rs:47:5 + | +LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _` + | | + | expected signature of `for<'r> fn(for<'s> fn(&'s u32), &'r i32) -> _` + | +note: required by `with_closure_expecting_fn_with_bound_region` + --> $DIR/expect-fn-supply-fn.rs:16:1 + | +LL | / fn with_closure_expecting_fn_with_bound_region<F>(_: F) +LL | | where F: FnOnce(fn(&u32), &i32) +LL | | { +LL | | } + | |_^ + +error[E0631]: type mismatch in closure arguments + --> $DIR/expect-fn-supply-fn.rs:56:5 + | +LL | with_closure_expecting_fn_with_bound_region(|_x: Foo<'_>, y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _` + | | + | expected signature of `for<'r> fn(for<'s> fn(&'s u32), &'r i32) -> _` + | +note: required by `with_closure_expecting_fn_with_bound_region` + --> $DIR/expect-fn-supply-fn.rs:16:1 + | +LL | / fn with_closure_expecting_fn_with_bound_region<F>(_: F) +LL | | where F: FnOnce(fn(&u32), &i32) +LL | | { +LL | | } + | |_^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0631`. diff --git a/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn.rs b/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn.rs index 63284c98020..63284c98020 100644 --- a/src/test/compile-fail/closure-expected-type/expect-fn-supply-fn.rs +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn.rs diff --git a/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn.stderr b/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn.stderr new file mode 100644 index 00000000000..4dca5922910 --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-fn-supply-fn.stderr @@ -0,0 +1,93 @@ +error[E0308]: mismatched types + --> $DIR/expect-fn-supply-fn.rs:24:52 + | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); + | ^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `fn(&u32)` + found type `fn(&'x u32)` +note: the anonymous lifetime #2 defined on the body at 24:48... + --> $DIR/expect-fn-supply-fn.rs:24:48 + | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^ +note: ...does not necessarily outlive the lifetime 'x as defined on the function body at 21:36 + --> $DIR/expect-fn-supply-fn.rs:21:36 + | +LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { + | ^^ + +error[E0308]: mismatched types + --> $DIR/expect-fn-supply-fn.rs:24:52 + | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); + | ^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `fn(&u32)` + found type `fn(&'x u32)` +note: the lifetime 'x as defined on the function body at 21:36... + --> $DIR/expect-fn-supply-fn.rs:21:36 + | +LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { + | ^^ +note: ...does not necessarily outlive the anonymous lifetime #2 defined on the body at 24:48 + --> $DIR/expect-fn-supply-fn.rs:24:48 + | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0631]: type mismatch in closure arguments + --> $DIR/expect-fn-supply-fn.rs:40:5 + | +LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _` + | | + | expected signature of `for<'a, 'r> fn(fn(&'a u32), &'r i32) -> _` + | +note: required by `with_closure_expecting_fn_with_free_region` + --> $DIR/expect-fn-supply-fn.rs:11:1 + | +LL | / fn with_closure_expecting_fn_with_free_region<F>(_: F) +LL | | where F: for<'a> FnOnce(fn(&'a u32), &i32) +LL | | { +LL | | } + | |_^ + +error[E0631]: type mismatch in closure arguments + --> $DIR/expect-fn-supply-fn.rs:47:5 + | +LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _` + | | + | expected signature of `for<'r> fn(for<'s> fn(&'s u32), &'r i32) -> _` + | +note: required by `with_closure_expecting_fn_with_bound_region` + --> $DIR/expect-fn-supply-fn.rs:16:1 + | +LL | / fn with_closure_expecting_fn_with_bound_region<F>(_: F) +LL | | where F: FnOnce(fn(&u32), &i32) +LL | | { +LL | | } + | |_^ + +error[E0631]: type mismatch in closure arguments + --> $DIR/expect-fn-supply-fn.rs:56:5 + | +LL | with_closure_expecting_fn_with_bound_region(|_x: Foo<'_>, y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _` + | | + | expected signature of `for<'r> fn(for<'s> fn(&'s u32), &'r i32) -> _` + | +note: required by `with_closure_expecting_fn_with_bound_region` + --> $DIR/expect-fn-supply-fn.rs:16:1 + | +LL | / fn with_closure_expecting_fn_with_bound_region<F>(_: F) +LL | | where F: FnOnce(fn(&u32), &i32) +LL | | { +LL | | } + | |_^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0308, E0631. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/closure-expected-type/expect-infer-var-appearing-twice.rs b/src/test/ui/compile-fail-migration/closure-expected-type/expect-infer-var-appearing-twice.rs index bef69a4b0b9..bef69a4b0b9 100644 --- a/src/test/compile-fail/closure-expected-type/expect-infer-var-appearing-twice.rs +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-infer-var-appearing-twice.rs diff --git a/src/test/ui/compile-fail-migration/closure-expected-type/expect-infer-var-appearing-twice.stderr b/src/test/ui/compile-fail-migration/closure-expected-type/expect-infer-var-appearing-twice.stderr new file mode 100644 index 00000000000..51dcf5eb3da --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-infer-var-appearing-twice.stderr @@ -0,0 +1,20 @@ +error[E0631]: type mismatch in closure arguments + --> $DIR/expect-infer-var-appearing-twice.rs:24:5 + | +LL | with_closure(|x: u32, y: i32| { + | ^^^^^^^^^^^^ ---------------- found signature of `fn(u32, i32) -> _` + | | + | expected signature of `fn(_, _) -> _` + | +note: required by `with_closure` + --> $DIR/expect-infer-var-appearing-twice.rs:11:1 + | +LL | / fn with_closure<F, A>(_: F) +LL | | where F: FnOnce(A, A) +LL | | { +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0631`. diff --git a/src/test/compile-fail/closure-expected-type/expect-infer-var-supply-ty-with-bound-region.rs b/src/test/ui/compile-fail-migration/closure-expected-type/expect-infer-var-supply-ty-with-bound-region.rs index 6767aa62f78..6767aa62f78 100644 --- a/src/test/compile-fail/closure-expected-type/expect-infer-var-supply-ty-with-bound-region.rs +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-infer-var-supply-ty-with-bound-region.rs diff --git a/src/test/compile-fail/closure-expected-type/expect-infer-var-supply-ty-with-free-region.rs b/src/test/ui/compile-fail-migration/closure-expected-type/expect-infer-var-supply-ty-with-free-region.rs index aea5cb21e63..aea5cb21e63 100644 --- a/src/test/compile-fail/closure-expected-type/expect-infer-var-supply-ty-with-free-region.rs +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-infer-var-supply-ty-with-free-region.rs diff --git a/src/test/compile-fail/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.rs b/src/test/ui/compile-fail-migration/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.rs index 377eaadbd6a..377eaadbd6a 100644 --- a/src/test/compile-fail/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.rs +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.rs diff --git a/src/test/ui/compile-fail-migration/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr b/src/test/ui/compile-fail-migration/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr new file mode 100644 index 00000000000..273fb2a2dd2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr @@ -0,0 +1,9 @@ +error[E0282]: type annotations needed + --> $DIR/expect-two-infer-vars-supply-ty-with-bound-region.rs:18:27 + | +LL | with_closure(|x: u32, y| {}); //~ ERROR E0282 + | ^ consider giving this closure parameter a type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/compile-fail/closure-no-fn-1.rs b/src/test/ui/compile-fail-migration/closure-no-fn-1.rs index 10c99703a97..10c99703a97 100644 --- a/src/test/compile-fail/closure-no-fn-1.rs +++ b/src/test/ui/compile-fail-migration/closure-no-fn-1.rs diff --git a/src/test/ui/compile-fail-migration/closure-no-fn-1.stderr b/src/test/ui/compile-fail-migration/closure-no-fn-1.stderr new file mode 100644 index 00000000000..4786a6836cd --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-no-fn-1.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/closure-no-fn-1.rs:16:29 + | +LL | let foo: fn(u8) -> u8 = |v: u8| { a += v; a }; + | ^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found closure + | + = note: expected type `fn(u8) -> u8` + found type `[closure@$DIR/closure-no-fn-1.rs:16:29: 16:50 a:_]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/closure-no-fn-2.rs b/src/test/ui/compile-fail-migration/closure-no-fn-2.rs index a6438bb5f24..a6438bb5f24 100644 --- a/src/test/compile-fail/closure-no-fn-2.rs +++ b/src/test/ui/compile-fail-migration/closure-no-fn-2.rs diff --git a/src/test/ui/compile-fail-migration/closure-no-fn-2.stderr b/src/test/ui/compile-fail-migration/closure-no-fn-2.stderr new file mode 100644 index 00000000000..1aad49777dc --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-no-fn-2.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/closure-no-fn-2.rs:16:27 + | +LL | let bar: fn() -> u8 = || { b }; + | ^^^^^^^^ expected fn pointer, found closure + | + = note: expected type `fn() -> u8` + found type `[closure@$DIR/closure-no-fn-2.rs:16:27: 16:35 b:_]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/closure-no-fn-3.rs b/src/test/ui/compile-fail-migration/closure-no-fn-3.rs index 6584c16c9de..6584c16c9de 100644 --- a/src/test/compile-fail/closure-no-fn-3.rs +++ b/src/test/ui/compile-fail-migration/closure-no-fn-3.rs diff --git a/src/test/ui/compile-fail-migration/closure-no-fn-3.stderr b/src/test/ui/compile-fail-migration/closure-no-fn-3.stderr new file mode 100644 index 00000000000..bd28045c1b9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-no-fn-3.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `[closure@$DIR/closure-no-fn-3.rs:16:27: 16:37 b:_]` as `fn() -> u8` + --> $DIR/closure-no-fn-3.rs:16:27 + | +LL | let baz: fn() -> u8 = (|| { b }) as fn() -> u8; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/compile-fail/closure-referencing-itself-issue-25954.rs b/src/test/ui/compile-fail-migration/closure-referencing-itself-issue-25954.rs index 9357d0e7615..9357d0e7615 100644 --- a/src/test/compile-fail/closure-referencing-itself-issue-25954.rs +++ b/src/test/ui/compile-fail-migration/closure-referencing-itself-issue-25954.rs diff --git a/src/test/ui/compile-fail-migration/closure-referencing-itself-issue-25954.stderr b/src/test/ui/compile-fail-migration/closure-referencing-itself-issue-25954.stderr new file mode 100644 index 00000000000..fa00d9fd9a4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-referencing-itself-issue-25954.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/closure-referencing-itself-issue-25954.rs:25:13 + | +LL | let q = || p.b.set(5i32); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^ cyclic type of infinite size + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/closure-reform-bad.rs b/src/test/ui/compile-fail-migration/closure-reform-bad.rs index 490734d463d..490734d463d 100644 --- a/src/test/compile-fail/closure-reform-bad.rs +++ b/src/test/ui/compile-fail-migration/closure-reform-bad.rs diff --git a/src/test/ui/compile-fail-migration/closure-reform-bad.stderr b/src/test/ui/compile-fail-migration/closure-reform-bad.stderr new file mode 100644 index 00000000000..a4e18175369 --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-reform-bad.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/closure-reform-bad.rs:21:15 + | +LL | call_bare(f) //~ ERROR mismatched types + | ^ expected fn pointer, found closure + | + = note: expected type `for<'r> fn(&'r str)` + found type `[closure@$DIR/closure-reform-bad.rs:20:13: 20:50 string:_]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/closure-wrong-kind.rs b/src/test/ui/compile-fail-migration/closure-wrong-kind.rs index a387e4c5ece..a387e4c5ece 100644 --- a/src/test/compile-fail/closure-wrong-kind.rs +++ b/src/test/ui/compile-fail-migration/closure-wrong-kind.rs diff --git a/src/test/ui/compile-fail-migration/closure-wrong-kind.stderr b/src/test/ui/compile-fail-migration/closure-wrong-kind.stderr new file mode 100644 index 00000000000..636f30770a9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure-wrong-kind.stderr @@ -0,0 +1,14 @@ +error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce` + --> $DIR/closure-wrong-kind.rs:20:19 + | +LL | let closure = |_| foo(x); //~ ERROR E0525 + | ^^^^^^^^-^ + | | | + | | closure is `FnOnce` because it moves the variable `x` out of its environment + | this closure implements `FnOnce`, not `Fn` +LL | bar(closure); + | --- the requirement to implement `Fn` derives from here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0525`. diff --git a/src/test/compile-fail/closure_promotion.rs b/src/test/ui/compile-fail-migration/closure_promotion.rs index ddc995a1a41..ddc995a1a41 100644 --- a/src/test/compile-fail/closure_promotion.rs +++ b/src/test/ui/compile-fail-migration/closure_promotion.rs diff --git a/src/test/ui/compile-fail-migration/closure_promotion.stderr b/src/test/ui/compile-fail-migration/closure_promotion.stderr new file mode 100644 index 00000000000..cfb5d141a29 --- /dev/null +++ b/src/test/ui/compile-fail-migration/closure_promotion.stderr @@ -0,0 +1,13 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/closure_promotion.rs:16:26 + | +LL | let x: &'static _ = &|| { let z = 3; z }; //~ ERROR does not live long enough + | ^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/coerce-expect-unsized-ascribed.rs b/src/test/ui/compile-fail-migration/coerce-expect-unsized-ascribed.rs index ef65927fc5d..ef65927fc5d 100644 --- a/src/test/compile-fail/coerce-expect-unsized-ascribed.rs +++ b/src/test/ui/compile-fail-migration/coerce-expect-unsized-ascribed.rs diff --git a/src/test/ui/compile-fail-migration/coerce-expect-unsized-ascribed.stderr b/src/test/ui/compile-fail-migration/coerce-expect-unsized-ascribed.stderr new file mode 100644 index 00000000000..894fbbf202a --- /dev/null +++ b/src/test/ui/compile-fail-migration/coerce-expect-unsized-ascribed.stderr @@ -0,0 +1,129 @@ +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:19:13 + | +LL | let _ = box { [1, 2, 3] }: Box<[i32]>; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | + = note: expected type `std::boxed::Box<[i32]>` + found type `std::boxed::Box<[i32; 3]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:20:13 + | +LL | let _ = box if true { [1, 2, 3] } else { [1, 3, 4] }: Box<[i32]>; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | + = note: expected type `std::boxed::Box<[i32]>` + found type `std::boxed::Box<[i32; 3]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:21:13 + | +LL | let _ = box match true { true => [1, 2, 3], false => [1, 3, 4] }: Box<[i32]>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | + = note: expected type `std::boxed::Box<[i32]>` + found type `std::boxed::Box<[i32; 3]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:23:13 + | +LL | let _ = box { |x| (x as u8) }: Box<Fn(i32) -> _>; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure + | + = note: expected type `std::boxed::Box<dyn std::ops::Fn(i32) -> u8>` + found type `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:23:19: 23:32]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:24:13 + | +LL | let _ = box if true { false } else { true }: Box<Debug>; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found bool + | + = note: expected type `std::boxed::Box<dyn std::fmt::Debug>` + found type `std::boxed::Box<bool>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:25:13 + | +LL | let _ = box match true { true => 'a', false => 'b' }: Box<Debug>; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found char + | + = note: expected type `std::boxed::Box<dyn std::fmt::Debug>` + found type `std::boxed::Box<char>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:27:13 + | +LL | let _ = &{ [1, 2, 3] }: &[i32]; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | + = note: expected type `&[i32]` + found type `&[i32; 3]` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:28:13 + | +LL | let _ = &if true { [1, 2, 3] } else { [1, 3, 4] }: &[i32]; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | + = note: expected type `&[i32]` + found type `&[i32; 3]` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:29:13 + | +LL | let _ = &match true { true => [1, 2, 3], false => [1, 3, 4] }: &[i32]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | + = note: expected type `&[i32]` + found type `&[i32; 3]` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:31:13 + | +LL | let _ = &{ |x| (x as u8) }: &Fn(i32) -> _; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure + | + = note: expected type `&dyn std::ops::Fn(i32) -> u8` + found type `&[closure@$DIR/coerce-expect-unsized-ascribed.rs:31:16: 31:29]` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:32:13 + | +LL | let _ = &if true { false } else { true }: &Debug; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found bool + | + = note: expected type `&dyn std::fmt::Debug` + found type `&bool` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:33:13 + | +LL | let _ = &match true { true => 'a', false => 'b' }: &Debug; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found char + | + = note: expected type `&dyn std::fmt::Debug` + found type `&char` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:35:13 + | +LL | let _ = Box::new([1, 2, 3]): Box<[i32]>; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | + = note: expected type `std::boxed::Box<[i32]>` + found type `std::boxed::Box<[i32; 3]>` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:36:13 + | +LL | let _ = Box::new(|x| (x as u8)): Box<Fn(i32) -> _>; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure + | + = note: expected type `std::boxed::Box<dyn std::ops::Fn(i32) -> _>` + found type `std::boxed::Box<[closure@$DIR/coerce-expect-unsized-ascribed.rs:36:22: 36:35]>` + +error: aborting due to 14 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/coerce-mut.rs b/src/test/ui/compile-fail-migration/coerce-mut.rs index bc3d58ef33d..bc3d58ef33d 100644 --- a/src/test/compile-fail/coerce-mut.rs +++ b/src/test/ui/compile-fail-migration/coerce-mut.rs diff --git a/src/test/ui/compile-fail-migration/coerce-mut.stderr b/src/test/ui/compile-fail-migration/coerce-mut.stderr new file mode 100644 index 00000000000..5e460b199a1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coerce-mut.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/coerce-mut.rs:15:7 + | +LL | f(&x); + | ^^ types differ in mutability + | + = note: expected type `&mut i32` + found type `&{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.ast.nll.stderr b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.ast.nll.stderr new file mode 100644 index 00000000000..29b6f057562 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.ast.nll.stderr @@ -0,0 +1,47 @@ +error[E0499]: cannot borrow `*x` as mutable more than once at a time + --> $DIR/coerce-overloaded-autoderef.rs:22:24 + | +LL | let y = borrow_mut(x); + | - first mutable borrow occurs here +LL | let z = borrow_mut(x); + | ^ second mutable borrow occurs here +... +LL | drop((y, z)); + | - borrow later used here + +error[E0506]: cannot assign to `**x` because it is borrowed + --> $DIR/coerce-overloaded-autoderef.rs:31:5 + | +LL | let y = borrow(x); + | - borrow of `**x` occurs here +LL | let z = borrow(x); +LL | **x += 1; + | ^^^^^^^^ assignment to borrowed `**x` occurs here +... +LL | drop((y, z)); + | - borrow later used here + +error[E0499]: cannot borrow `*x` as mutable more than once at a time + --> $DIR/coerce-overloaded-autoderef.rs:38:20 + | +LL | borrow_mut2(x, x); + | ---------------^- + | | | | + | | | second mutable borrow occurs here + | | first mutable borrow occurs here + | borrow later used here + +error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable + --> $DIR/coerce-overloaded-autoderef.rs:44:5 + | +LL | borrow2(x, x); + | ^^^^^^^^^^^-^ + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + | borrow later used here + +error: aborting due to 4 previous errors + +Some errors occurred: E0499, E0502, E0506. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.ast.stderr b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.ast.stderr new file mode 100644 index 00000000000..3bb5ec72002 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.ast.stderr @@ -0,0 +1,42 @@ +error[E0499]: cannot borrow `*x` as mutable more than once at a time + --> $DIR/coerce-overloaded-autoderef.rs:22:24 + | +LL | let y = borrow_mut(x); + | - first mutable borrow occurs here +LL | let z = borrow_mut(x); + | ^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0506]: cannot assign to `**x` because it is borrowed + --> $DIR/coerce-overloaded-autoderef.rs:31:5 + | +LL | let y = borrow(x); + | - borrow of `**x` occurs here +LL | let z = borrow(x); +LL | **x += 1; + | ^^^^^^^^ assignment to borrowed `**x` occurs here + +error[E0499]: cannot borrow `*x` as mutable more than once at a time + --> $DIR/coerce-overloaded-autoderef.rs:38:20 + | +LL | borrow_mut2(x, x); + | - ^- first borrow ends here + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + +error[E0502]: cannot borrow `*x` as immutable because it is also borrowed as mutable + --> $DIR/coerce-overloaded-autoderef.rs:44:16 + | +LL | borrow2(x, x); + | - ^- mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error: aborting due to 4 previous errors + +Some errors occurred: E0499, E0502, E0506. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.mir.nll.stderr b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.mir.nll.stderr new file mode 100644 index 00000000000..29b6f057562 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.mir.nll.stderr @@ -0,0 +1,47 @@ +error[E0499]: cannot borrow `*x` as mutable more than once at a time + --> $DIR/coerce-overloaded-autoderef.rs:22:24 + | +LL | let y = borrow_mut(x); + | - first mutable borrow occurs here +LL | let z = borrow_mut(x); + | ^ second mutable borrow occurs here +... +LL | drop((y, z)); + | - borrow later used here + +error[E0506]: cannot assign to `**x` because it is borrowed + --> $DIR/coerce-overloaded-autoderef.rs:31:5 + | +LL | let y = borrow(x); + | - borrow of `**x` occurs here +LL | let z = borrow(x); +LL | **x += 1; + | ^^^^^^^^ assignment to borrowed `**x` occurs here +... +LL | drop((y, z)); + | - borrow later used here + +error[E0499]: cannot borrow `*x` as mutable more than once at a time + --> $DIR/coerce-overloaded-autoderef.rs:38:20 + | +LL | borrow_mut2(x, x); + | ---------------^- + | | | | + | | | second mutable borrow occurs here + | | first mutable borrow occurs here + | borrow later used here + +error[E0502]: cannot borrow `*x` as mutable because it is also borrowed as immutable + --> $DIR/coerce-overloaded-autoderef.rs:44:5 + | +LL | borrow2(x, x); + | ^^^^^^^^^^^-^ + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + | borrow later used here + +error: aborting due to 4 previous errors + +Some errors occurred: E0499, E0502, E0506. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.mir.stderr b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.mir.stderr new file mode 100644 index 00000000000..fbc49a7e91f --- /dev/null +++ b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.mir.stderr @@ -0,0 +1,47 @@ +error[E0499]: cannot borrow `*x` as mutable more than once at a time + --> $DIR/coerce-overloaded-autoderef.rs:22:24 + | +LL | let y = borrow_mut(x); + | - first mutable borrow occurs here +LL | let z = borrow_mut(x); + | ^ second mutable borrow occurs here +... +LL | drop((y, z)); + | - borrow later used here + +error[E0506]: cannot assign to `**x` because it is borrowed + --> $DIR/coerce-overloaded-autoderef.rs:31:5 + | +LL | let y = borrow(x); + | - borrow of `**x` occurs here +LL | let z = borrow(x); +LL | **x += 1; + | ^^^^^^^^ assignment to borrowed `**x` occurs here +... +LL | drop((y, z)); + | - borrow later used here + +error[E0499]: cannot borrow `*x` as mutable more than once at a time + --> $DIR/coerce-overloaded-autoderef.rs:38:20 + | +LL | borrow_mut2(x, x); + | ---------------^- + | | | | + | | | second mutable borrow occurs here + | | first mutable borrow occurs here + | borrow later used here + +error[E0502]: cannot borrow `*x` as immutable because it is also borrowed as mutable + --> $DIR/coerce-overloaded-autoderef.rs:44:16 + | +LL | borrow2(x, x); + | -----------^- + | | | | + | | | immutable borrow occurs here + | | mutable borrow occurs here + | borrow later used here + +error: aborting due to 4 previous errors + +Some errors occurred: E0499, E0502, E0506. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/coerce-overloaded-autoderef.rs b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.rs index 5a05f59c6f4..5a05f59c6f4 100644 --- a/src/test/compile-fail/coerce-overloaded-autoderef.rs +++ b/src/test/ui/compile-fail-migration/coerce-overloaded-autoderef.rs diff --git a/src/test/compile-fail/coerce-to-bang-cast.rs b/src/test/ui/compile-fail-migration/coerce-to-bang-cast.rs index 14a06b306d8..14a06b306d8 100644 --- a/src/test/compile-fail/coerce-to-bang-cast.rs +++ b/src/test/ui/compile-fail-migration/coerce-to-bang-cast.rs diff --git a/src/test/ui/compile-fail-migration/coerce-to-bang-cast.stderr b/src/test/ui/compile-fail-migration/coerce-to-bang-cast.stderr new file mode 100644 index 00000000000..fde94144512 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coerce-to-bang-cast.stderr @@ -0,0 +1,19 @@ +error[E0605]: non-primitive cast: `i32` as `!` + --> $DIR/coerce-to-bang-cast.rs:16:13 + | +LL | let y = {return; 22} as !; + | ^^^^^^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error[E0605]: non-primitive cast: `i32` as `!` + --> $DIR/coerce-to-bang-cast.rs:21:13 + | +LL | let y = 22 as !; //~ ERROR non-primitive cast + | ^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/compile-fail/coerce-to-bang.rs b/src/test/ui/compile-fail-migration/coerce-to-bang.rs index 8b4e2c3c051..8b4e2c3c051 100644 --- a/src/test/compile-fail/coerce-to-bang.rs +++ b/src/test/ui/compile-fail-migration/coerce-to-bang.rs diff --git a/src/test/ui/compile-fail-migration/coerce-to-bang.stderr b/src/test/ui/compile-fail-migration/coerce-to-bang.stderr new file mode 100644 index 00000000000..bf490cd20aa --- /dev/null +++ b/src/test/ui/compile-fail-migration/coerce-to-bang.stderr @@ -0,0 +1,93 @@ +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:16:17 + | +LL | foo(return, 22, 44); + | ^^ expected !, found integral variable + | + = note: expected type `!` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:28:13 + | +LL | foo(22, 44, return); //~ ERROR mismatched types + | ^^ expected !, found integral variable + | + = note: expected type `!` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:36:12 + | +LL | foo(a, b, c); // ... and hence a reference to `a` is expected to diverge. + | ^ expected !, found integral variable + | + = note: expected type `!` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:46:12 + | +LL | foo(a, b, c); //~ ERROR mismatched types + | ^ expected !, found integral variable + | + = note: expected type `!` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:55:12 + | +LL | foo(a, b, c); //~ ERROR mismatched types + | ^ expected !, found integral variable + | + = note: expected type `!` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:60:21 + | +LL | let x: [!; 2] = [return, 22]; //~ ERROR mismatched types + | ^^^^^^^^^^^^ expected !, found integral variable + | + = note: expected type `[!; 2]` + found type `[{integer}; 2]` + +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:65:22 + | +LL | let x: [!; 2] = [22, return]; //~ ERROR mismatched types + | ^^ expected !, found integral variable + | + = note: expected type `!` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:70:37 + | +LL | let x: (usize, !, usize) = (22, 44, 66); //~ ERROR mismatched types + | ^^ expected !, found integral variable + | + = note: expected type `!` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:75:41 + | +LL | let x: (usize, !, usize) = (return, 44, 66); + | ^^ expected !, found integral variable + | + = note: expected type `!` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/coerce-to-bang.rs:86:37 + | +LL | let x: (usize, !, usize) = (22, 44, return); //~ ERROR mismatched types + | ^^ expected !, found integral variable + | + = note: expected type `!` + found type `{integer}` + +error: aborting due to 10 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/coerce-unsafe-to-closure.rs b/src/test/ui/compile-fail-migration/coerce-unsafe-to-closure.rs index 90cbbf242aa..90cbbf242aa 100644 --- a/src/test/compile-fail/coerce-unsafe-to-closure.rs +++ b/src/test/ui/compile-fail-migration/coerce-unsafe-to-closure.rs diff --git a/src/test/ui/compile-fail-migration/coerce-unsafe-to-closure.stderr b/src/test/ui/compile-fail-migration/coerce-unsafe-to-closure.stderr new file mode 100644 index 00000000000..ca402b25585 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coerce-unsafe-to-closure.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}: std::ops::FnOnce<(&str,)>` is not satisfied + --> $DIR/coerce-unsafe-to-closure.rs:12:40 + | +LL | let x: Option<&[u8]> = Some("foo").map(std::mem::transmute); + | ^^^ the trait `std::ops::FnOnce<(&str,)>` is not implemented for `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/coercion-slice.rs b/src/test/ui/compile-fail-migration/coercion-slice.rs index 7c5a4e0c3c6..7c5a4e0c3c6 100644 --- a/src/test/compile-fail/coercion-slice.rs +++ b/src/test/ui/compile-fail-migration/coercion-slice.rs diff --git a/src/test/ui/compile-fail-migration/coercion-slice.stderr b/src/test/ui/compile-fail-migration/coercion-slice.stderr new file mode 100644 index 00000000000..47a77d42773 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coercion-slice.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/coercion-slice.rs:14:21 + | +LL | let _: &[i32] = [0]; + | ^^^ + | | + | expected &[i32], found array of 1 elements + | help: consider borrowing here: `&[0]` + | + = note: expected type `&[i32]` + found type `[{integer}; 1]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/coherence-all-remote.rs b/src/test/ui/compile-fail-migration/coherence-all-remote.rs index 7a5340041c2..7a5340041c2 100644 --- a/src/test/compile-fail/coherence-all-remote.rs +++ b/src/test/ui/compile-fail-migration/coherence-all-remote.rs diff --git a/src/test/ui/compile-fail-migration/coherence-all-remote.stderr b/src/test/ui/compile-fail-migration/coherence-all-remote.stderr new file mode 100644 index 00000000000..1f71969989b --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-all-remote.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-all-remote.rs:16:1 + | +LL | impl<T> Remote1<T> for isize { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/compile-fail/coherence-bigint-param.rs b/src/test/ui/compile-fail-migration/coherence-bigint-param.rs index 32c5b669381..32c5b669381 100644 --- a/src/test/compile-fail/coherence-bigint-param.rs +++ b/src/test/ui/compile-fail-migration/coherence-bigint-param.rs diff --git a/src/test/ui/compile-fail-migration/coherence-bigint-param.stderr b/src/test/ui/compile-fail-migration/coherence-bigint-param.stderr new file mode 100644 index 00000000000..7d2796ee690 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-bigint-param.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-bigint-param.rs:18:1 + | +LL | impl<T> Remote1<BigInt> for T { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-implemented.rs index 434d77828b4..434d77828b4 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-implemented.rs diff --git a/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-implemented.stderr b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-implemented.stderr new file mode 100644 index 00000000000..7dbcda06511 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-implemented.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `MyTrait`: + --> $DIR/coherence-blanket-conflicts-with-blanket-implemented.rs:34:1 + | +LL | impl<T:Even> MyTrait for T { + | -------------------------- first implementation here +... +LL | impl<T:Odd> MyTrait for T { //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-unimplemented.rs index 7ad5cd71ca8..7ad5cd71ca8 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-unimplemented.rs diff --git a/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-unimplemented.stderr b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-unimplemented.stderr new file mode 100644 index 00000000000..faabfb6c7c0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-blanket-unimplemented.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `MyTrait`: + --> $DIR/coherence-blanket-conflicts-with-blanket-unimplemented.rs:30:1 + | +LL | impl<T:Even> MyTrait for T { + | -------------------------- first implementation here +... +LL | impl<T:Odd> MyTrait for T { //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-cross-crate.rs b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-cross-crate.rs index b3ef79c6cc0..b3ef79c6cc0 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-cross-crate.rs +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-cross-crate.rs diff --git a/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-cross-crate.stderr b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-cross-crate.stderr new file mode 100644 index 00000000000..38aff37bfcc --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-cross-crate.stderr @@ -0,0 +1,13 @@ +error[E0119]: conflicting implementations of trait `go_trait::GoMut` for type `MyThingy`: + --> $DIR/coherence-blanket-conflicts-with-specific-cross-crate.rs:25:1 + | +LL | impl GoMut for MyThingy { //~ ERROR conflicting implementations + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: conflicting implementation in crate `go_trait`: + - impl<G> go_trait::GoMut for G + where G: go_trait::Go; + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-multidispatch.rs index 1defe6c8b20..1defe6c8b20 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-multidispatch.rs diff --git a/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-multidispatch.stderr b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-multidispatch.stderr new file mode 100644 index 00000000000..a5992406262 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-multidispatch.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `MyTrait<MyType>` for type `MyType`: + --> $DIR/coherence-blanket-conflicts-with-specific-multidispatch.rs:32:1 + | +LL | impl<T> MyTrait<T> for T { + | ------------------------ first implementation here +... +LL | impl MyTrait<MyType> for MyType { //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-trait.rs b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-trait.rs index 5c5c4d32d67..5c5c4d32d67 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-specific-trait.rs +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-trait.rs diff --git a/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-trait.stderr b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-trait.stderr new file mode 100644 index 00000000000..9a6e0071eb7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific-trait.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`: + --> $DIR/coherence-blanket-conflicts-with-specific-trait.rs:30:1 + | +LL | impl<T:OtherTrait> MyTrait for T { + | -------------------------------- first implementation here +... +LL | impl MyTrait for MyType { //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-specific.rs b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific.rs index 57d71b44b0f..57d71b44b0f 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-specific.rs +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific.rs diff --git a/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific.stderr b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific.stderr new file mode 100644 index 00000000000..955cd3b125f --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-blanket-conflicts-with-specific.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`: + --> $DIR/coherence-blanket-conflicts-with-specific.rs:29:1 + | +LL | impl<T> MyTrait for T { + | --------------------- first implementation here +... +LL | impl MyTrait for MyType { //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `MyType` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-conflicting-negative-trait-impl.rs b/src/test/ui/compile-fail-migration/coherence-conflicting-negative-trait-impl.rs index 8e9d1eff345..8e9d1eff345 100644 --- a/src/test/compile-fail/coherence-conflicting-negative-trait-impl.rs +++ b/src/test/ui/compile-fail-migration/coherence-conflicting-negative-trait-impl.rs diff --git a/src/test/ui/compile-fail-migration/coherence-conflicting-negative-trait-impl.stderr b/src/test/ui/compile-fail-migration/coherence-conflicting-negative-trait-impl.stderr new file mode 100644 index 00000000000..a2a869daff0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-conflicting-negative-trait-impl.stderr @@ -0,0 +1,21 @@ +error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>`: + --> $DIR/coherence-conflicting-negative-trait-impl.rs:20:1 + | +LL | unsafe impl<T: MyTrait+'static> Send for TestType<T> {} + | ---------------------------------------------------- first implementation here +LL | +LL | impl<T: MyTrait> !Send for TestType<T> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>` + +error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<i32>`: + --> $DIR/coherence-conflicting-negative-trait-impl.rs:25:1 + | +LL | unsafe impl<T:'static> Send for TestType<T> {} + | ------------------------------------------- first implementation here +LL | +LL | impl !Send for TestType<i32> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<i32>` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/compile-fail-migration/coherence-cow.a.stderr b/src/test/ui/compile-fail-migration/coherence-cow.a.stderr new file mode 100644 index 00000000000..f05333348ec --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-cow.a.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-cow.rs:26:1 + | +LL | impl<T> Remote for Pair<T,Cover<T>> { } //[a]~ ERROR E0210 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/compile-fail-migration/coherence-cow.b.stderr b/src/test/ui/compile-fail-migration/coherence-cow.b.stderr new file mode 100644 index 00000000000..269bcd576af --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-cow.b.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-cow.rs:29:1 + | +LL | impl<T> Remote for Pair<Cover<T>,T> { } //[b]~ ERROR E0210 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/ui/compile-fail-migration/coherence-cow.c.stderr b/src/test/ui/compile-fail-migration/coherence-cow.c.stderr new file mode 100644 index 00000000000..e89308db054 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-cow.c.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-cow.rs:32:1 + | +LL | impl<T,U> Remote for Pair<Cover<T>,U> { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/compile-fail/coherence-cow.rs b/src/test/ui/compile-fail-migration/coherence-cow.rs index 86ae5b44d9d..86ae5b44d9d 100644 --- a/src/test/compile-fail/coherence-cow.rs +++ b/src/test/ui/compile-fail-migration/coherence-cow.rs diff --git a/src/test/compile-fail/coherence-cross-crate-conflict.rs b/src/test/ui/compile-fail-migration/coherence-cross-crate-conflict.rs index aac870293fd..aac870293fd 100644 --- a/src/test/compile-fail/coherence-cross-crate-conflict.rs +++ b/src/test/ui/compile-fail-migration/coherence-cross-crate-conflict.rs diff --git a/src/test/ui/compile-fail-migration/coherence-cross-crate-conflict.stderr b/src/test/ui/compile-fail-migration/coherence-cross-crate-conflict.stderr new file mode 100644 index 00000000000..ee11967cc0d --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-cross-crate-conflict.stderr @@ -0,0 +1,21 @@ +error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`: + --> $DIR/coherence-cross-crate-conflict.rs:18:1 + | +LL | impl<A> Foo for A { + | ^^^^^^^^^^^^^^^^^ + | + = note: conflicting implementation in crate `trait_impl_conflict`: + - impl trait_impl_conflict::Foo for isize; + +error[E0210]: type parameter `A` must be used as the type parameter for some local type (e.g. `MyStruct<A>`) + --> $DIR/coherence-cross-crate-conflict.rs:18:1 + | +LL | impl<A> Foo for A { + | ^^^^^^^^^^^^^^^^^ type parameter `A` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to 2 previous errors + +Some errors occurred: E0119, E0210. +For more information about an error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-default-trait-impl.rs b/src/test/ui/compile-fail-migration/coherence-default-trait-impl.rs index 751d0a14c57..751d0a14c57 100644 --- a/src/test/compile-fail/coherence-default-trait-impl.rs +++ b/src/test/ui/compile-fail-migration/coherence-default-trait-impl.rs diff --git a/src/test/ui/compile-fail-migration/coherence-default-trait-impl.stderr b/src/test/ui/compile-fail-migration/coherence-default-trait-impl.stderr new file mode 100644 index 00000000000..b7d9364f237 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-default-trait-impl.stderr @@ -0,0 +1,16 @@ +error[E0199]: implementing the trait `MySafeTrait` is not unsafe + --> $DIR/coherence-default-trait-impl.rs:17:1 + | +LL | unsafe impl MySafeTrait for Foo {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0200]: the trait `MyUnsafeTrait` requires an `unsafe impl` declaration + --> $DIR/coherence-default-trait-impl.rs:22:1 + | +LL | impl MyUnsafeTrait for Foo {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0199, E0200. +For more information about an error, try `rustc --explain E0199`. diff --git a/src/test/compile-fail/coherence-impl-trait-for-trait-object-safe.rs b/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait-object-safe.rs index 8bb9556fcc0..8bb9556fcc0 100644 --- a/src/test/compile-fail/coherence-impl-trait-for-trait-object-safe.rs +++ b/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait-object-safe.rs diff --git a/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait-object-safe.stderr b/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait-object-safe.stderr new file mode 100644 index 00000000000..5d62a86b96f --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait-object-safe.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait `NotObjectSafe` cannot be made into an object + --> $DIR/coherence-impl-trait-for-trait-object-safe.rs:17:6 + | +LL | impl NotObjectSafe for NotObjectSafe { } //~ ERROR E0038 + | ^^^^^^^^^^^^^ the trait `NotObjectSafe` cannot be made into an object + | + = note: method `eq` references the `Self` type in its arguments or return type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/coherence-impl-trait-for-trait.rs b/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait.rs index cd75b0e34f2..cd75b0e34f2 100644 --- a/src/test/compile-fail/coherence-impl-trait-for-trait.rs +++ b/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait.rs diff --git a/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait.stderr b/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait.stderr new file mode 100644 index 00000000000..26e702d1fde --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-impl-trait-for-trait.stderr @@ -0,0 +1,21 @@ +error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Foo` + --> $DIR/coherence-impl-trait-for-trait.rs:19:1 + | +LL | impl Foo for Baz { } //~ ERROR E0371 + | ^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Foo` + +error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Bar` + --> $DIR/coherence-impl-trait-for-trait.rs:20:1 + | +LL | impl Bar for Baz { } //~ ERROR E0371 + | ^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Bar` + +error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Baz` + --> $DIR/coherence-impl-trait-for-trait.rs:21:1 + | +LL | impl Baz for Baz { } //~ ERROR E0371 + | ^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Baz` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0371`. diff --git a/src/test/compile-fail/coherence-impls-send.rs b/src/test/ui/compile-fail-migration/coherence-impls-send.rs index 9caaee41aeb..9caaee41aeb 100644 --- a/src/test/compile-fail/coherence-impls-send.rs +++ b/src/test/ui/compile-fail-migration/coherence-impls-send.rs diff --git a/src/test/ui/compile-fail-migration/coherence-impls-send.stderr b/src/test/ui/compile-fail-migration/coherence-impls-send.stderr new file mode 100644 index 00000000000..4e7e228b23f --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-impls-send.stderr @@ -0,0 +1,37 @@ +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-impls-send.rs:27:1 + | +LL | unsafe impl Send for (MyType, MyType) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error[E0321]: cross-crate traits with a default impl, like `std::marker::Send`, can only be implemented for a struct/enum type, not `&'static NotSync` + --> $DIR/coherence-impls-send.rs:30:1 + | +LL | unsafe impl Send for &'static NotSync {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-impls-send.rs:33:1 + | +LL | unsafe impl Send for [MyType] {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-impls-send.rs:36:1 + | +LL | unsafe impl Send for &'static [NotSync] {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error: aborting due to 4 previous errors + +Some errors occurred: E0117, E0321. +For more information about an error, try `rustc --explain E0117`. diff --git a/src/test/compile-fail/coherence-impls-sized.rs b/src/test/ui/compile-fail-migration/coherence-impls-sized.rs index 60b5d14d158..60b5d14d158 100644 --- a/src/test/compile-fail/coherence-impls-sized.rs +++ b/src/test/ui/compile-fail-migration/coherence-impls-sized.rs diff --git a/src/test/ui/compile-fail-migration/coherence-impls-sized.stderr b/src/test/ui/compile-fail-migration/coherence-impls-sized.stderr new file mode 100644 index 00000000000..683fb0aaa68 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-impls-sized.stderr @@ -0,0 +1,67 @@ +error[E0322]: explicit impls for the `Sized` trait are not permitted + --> $DIR/coherence-impls-sized.rs:24:1 + | +LL | impl Sized for TestE {} //~ ERROR E0322 + | ^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed + +error[E0322]: explicit impls for the `Sized` trait are not permitted + --> $DIR/coherence-impls-sized.rs:27:1 + | +LL | impl Sized for MyType {} //~ ERROR E0322 + | ^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed + +error[E0322]: explicit impls for the `Sized` trait are not permitted + --> $DIR/coherence-impls-sized.rs:30:1 + | +LL | impl Sized for (MyType, MyType) {} //~ ERROR E0322 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed + +error[E0322]: explicit impls for the `Sized` trait are not permitted + --> $DIR/coherence-impls-sized.rs:34:1 + | +LL | impl Sized for &'static NotSync {} //~ ERROR E0322 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed + +error[E0322]: explicit impls for the `Sized` trait are not permitted + --> $DIR/coherence-impls-sized.rs:37:1 + | +LL | impl Sized for [MyType] {} //~ ERROR E0322 + | ^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed + +error[E0322]: explicit impls for the `Sized` trait are not permitted + --> $DIR/coherence-impls-sized.rs:41:1 + | +LL | impl Sized for &'static [NotSync] {} //~ ERROR E0322 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl of 'Sized' not allowed + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-impls-sized.rs:30:1 + | +LL | impl Sized for (MyType, MyType) {} //~ ERROR E0322 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-impls-sized.rs:37:1 + | +LL | impl Sized for [MyType] {} //~ ERROR E0322 + | ^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-impls-sized.rs:41:1 + | +LL | impl Sized for &'static [NotSync] {} //~ ERROR E0322 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error: aborting due to 9 previous errors + +Some errors occurred: E0117, E0322. +For more information about an error, try `rustc --explain E0117`. diff --git a/src/test/compile-fail/coherence-inherited-assoc-ty-cycle-err.rs b/src/test/ui/compile-fail-migration/coherence-inherited-assoc-ty-cycle-err.rs index 5db901b5ba1..5db901b5ba1 100644 --- a/src/test/compile-fail/coherence-inherited-assoc-ty-cycle-err.rs +++ b/src/test/ui/compile-fail-migration/coherence-inherited-assoc-ty-cycle-err.rs diff --git a/src/test/ui/compile-fail-migration/coherence-inherited-assoc-ty-cycle-err.stderr b/src/test/ui/compile-fail-migration/coherence-inherited-assoc-ty-cycle-err.stderr new file mode 100644 index 00000000000..5dba448a963 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-inherited-assoc-ty-cycle-err.stderr @@ -0,0 +1,16 @@ +error[E0391]: cycle detected when processing `Trait` + --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:19:1 + | +LL | trait Trait<T> { type Assoc; } + | ^^^^^^^^^^^^^^ + | + = note: ...which again requires processing `Trait`, completing the cycle +note: cycle used when coherence checking all impls of trait `Trait` + --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:19:1 + | +LL | trait Trait<T> { type Assoc; } + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/compile-fail/coherence-lone-type-parameter.rs b/src/test/ui/compile-fail-migration/coherence-lone-type-parameter.rs index e78f392b386..e78f392b386 100644 --- a/src/test/compile-fail/coherence-lone-type-parameter.rs +++ b/src/test/ui/compile-fail-migration/coherence-lone-type-parameter.rs diff --git a/src/test/ui/compile-fail-migration/coherence-lone-type-parameter.stderr b/src/test/ui/compile-fail-migration/coherence-lone-type-parameter.stderr new file mode 100644 index 00000000000..6389bc0e7ab --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-lone-type-parameter.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-lone-type-parameter.rs:16:1 + | +LL | impl<T> Remote for T { } + | ^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/compile-fail/coherence-negative-impls-safe.rs b/src/test/ui/compile-fail-migration/coherence-negative-impls-safe.rs index 1ae07b64685..1ae07b64685 100644 --- a/src/test/compile-fail/coherence-negative-impls-safe.rs +++ b/src/test/ui/compile-fail-migration/coherence-negative-impls-safe.rs diff --git a/src/test/ui/compile-fail-migration/coherence-negative-impls-safe.stderr b/src/test/ui/compile-fail-migration/coherence-negative-impls-safe.stderr new file mode 100644 index 00000000000..7373f79942f --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-negative-impls-safe.stderr @@ -0,0 +1,9 @@ +error[E0198]: negative impls cannot be unsafe + --> $DIR/coherence-negative-impls-safe.rs:17:1 + | +LL | unsafe impl !Send for TestType {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0198`. diff --git a/src/test/compile-fail/coherence-no-direct-lifetime-dispatch.rs b/src/test/ui/compile-fail-migration/coherence-no-direct-lifetime-dispatch.rs index 47026cd32d4..47026cd32d4 100644 --- a/src/test/compile-fail/coherence-no-direct-lifetime-dispatch.rs +++ b/src/test/ui/compile-fail-migration/coherence-no-direct-lifetime-dispatch.rs diff --git a/src/test/ui/compile-fail-migration/coherence-no-direct-lifetime-dispatch.stderr b/src/test/ui/compile-fail-migration/coherence-no-direct-lifetime-dispatch.stderr new file mode 100644 index 00000000000..669c5e3a4a6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-no-direct-lifetime-dispatch.stderr @@ -0,0 +1,11 @@ +error[E0119]: conflicting implementations of trait `MyTrait`: + --> $DIR/coherence-no-direct-lifetime-dispatch.rs:16:1 + | +LL | impl<T> MyTrait for T {} + | --------------------- first implementation here +LL | impl<T: 'static> MyTrait for T {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-orphan.rs b/src/test/ui/compile-fail-migration/coherence-orphan.rs index 80efc7b75e2..80efc7b75e2 100644 --- a/src/test/compile-fail/coherence-orphan.rs +++ b/src/test/ui/compile-fail-migration/coherence-orphan.rs diff --git a/src/test/ui/compile-fail-migration/coherence-orphan.stderr b/src/test/ui/compile-fail-migration/coherence-orphan.stderr new file mode 100644 index 00000000000..ee863533237 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-orphan.stderr @@ -0,0 +1,21 @@ +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-orphan.rs:21:1 + | +LL | impl TheTrait<usize> for isize { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-orphan.rs:28:1 + | +LL | impl !Send for Vec<isize> { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/compile-fail/coherence-overlap-all-t-and-tuple.rs b/src/test/ui/compile-fail-migration/coherence-overlap-all-t-and-tuple.rs index 1fad608db6c..1fad608db6c 100644 --- a/src/test/compile-fail/coherence-overlap-all-t-and-tuple.rs +++ b/src/test/ui/compile-fail-migration/coherence-overlap-all-t-and-tuple.rs diff --git a/src/test/ui/compile-fail-migration/coherence-overlap-all-t-and-tuple.stderr b/src/test/ui/compile-fail-migration/coherence-overlap-all-t-and-tuple.stderr new file mode 100644 index 00000000000..993de789ef5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-overlap-all-t-and-tuple.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `From<(_,)>` for type `(_,)`: + --> $DIR/coherence-overlap-all-t-and-tuple.rs:26:1 + | +LL | impl <T> From<T> for T { + | ---------------------- first implementation here +... +LL | impl <T11, U11> From<(U11,)> for (T11,) { //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_,)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-overlap-messages.rs b/src/test/ui/compile-fail-migration/coherence-overlap-messages.rs index a10deeafbe6..a10deeafbe6 100644 --- a/src/test/compile-fail/coherence-overlap-messages.rs +++ b/src/test/ui/compile-fail-migration/coherence-overlap-messages.rs diff --git a/src/test/ui/compile-fail-migration/coherence-overlap-messages.stderr b/src/test/ui/compile-fail-migration/coherence-overlap-messages.stderr new file mode 100644 index 00000000000..60023c6c249 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-overlap-messages.stderr @@ -0,0 +1,44 @@ +error[E0119]: conflicting implementations of trait `Foo`: + --> $DIR/coherence-overlap-messages.rs:14:1 + | +LL | impl<T> Foo for T {} + | ----------------- first implementation here +LL | impl<U> Foo for U {} //~ ERROR conflicting implementations of trait `Foo`: + | ^^^^^^^^^^^^^^^^^ conflicting implementation + +error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`: + --> $DIR/coherence-overlap-messages.rs:19:1 + | +LL | impl<T> Bar for (T, u8) {} + | ----------------------- first implementation here +LL | impl<T> Bar for (u8, T) {} //~ ERROR conflicting implementations of trait `Bar` for type `(u8, u8)`: + | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)` + +error[E0119]: conflicting implementations of trait `Baz<u8>` for type `u8`: + --> $DIR/coherence-overlap-messages.rs:24:1 + | +LL | impl<T> Baz<u8> for T {} + | --------------------- first implementation here +LL | impl<T> Baz<T> for u8 {} //~ ERROR conflicting implementations of trait `Baz<u8>` for type `u8`: + | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8` + +error[E0119]: conflicting implementations of trait `Quux<_, _>`: + --> $DIR/coherence-overlap-messages.rs:29:1 + | +LL | impl<T, U, V> Quux<U, V> for T {} + | ------------------------------ first implementation here +LL | impl<T, U> Quux<U, U> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`: + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation + +error[E0119]: conflicting implementations of trait `Quux<_, _>`: + --> $DIR/coherence-overlap-messages.rs:30:1 + | +LL | impl<T, U, V> Quux<U, V> for T {} + | ------------------------------ first implementation here +LL | impl<T, U> Quux<U, U> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`: +LL | impl<T, V> Quux<T, V> for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`: + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-overlapping-pairs.rs b/src/test/ui/compile-fail-migration/coherence-overlapping-pairs.rs index ba9dc53e868..ba9dc53e868 100644 --- a/src/test/compile-fail/coherence-overlapping-pairs.rs +++ b/src/test/ui/compile-fail-migration/coherence-overlapping-pairs.rs diff --git a/src/test/ui/compile-fail-migration/coherence-overlapping-pairs.stderr b/src/test/ui/compile-fail-migration/coherence-overlapping-pairs.stderr new file mode 100644 index 00000000000..41d47888554 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-overlapping-pairs.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-overlapping-pairs.rs:18:1 + | +LL | impl<T> Remote for lib::Pair<T,Foo> { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/compile-fail/coherence-pair-covered-uncovered-1.rs b/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered-1.rs index f55efef14fa..f55efef14fa 100644 --- a/src/test/compile-fail/coherence-pair-covered-uncovered-1.rs +++ b/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered-1.rs diff --git a/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered-1.stderr b/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered-1.stderr new file mode 100644 index 00000000000..3545593fb6d --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered-1.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-pair-covered-uncovered-1.rs:21:1 + | +LL | impl<T, U> Remote1<Pair<T, Local<U>>> for i32 { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/compile-fail/coherence-pair-covered-uncovered.rs b/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered.rs index 0642dff4b28..0642dff4b28 100644 --- a/src/test/compile-fail/coherence-pair-covered-uncovered.rs +++ b/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered.rs diff --git a/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered.stderr b/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered.stderr new file mode 100644 index 00000000000..f58cb4648cb --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-pair-covered-uncovered.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-pair-covered-uncovered.rs:18:1 + | +LL | impl<T,U> Remote for Pair<T,Local<U>> { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/compile-fail/coherence-projection-conflict-orphan.rs b/src/test/ui/compile-fail-migration/coherence-projection-conflict-orphan.rs index 784ff0cd5e0..784ff0cd5e0 100644 --- a/src/test/compile-fail/coherence-projection-conflict-orphan.rs +++ b/src/test/ui/compile-fail-migration/coherence-projection-conflict-orphan.rs diff --git a/src/test/ui/compile-fail-migration/coherence-projection-conflict-orphan.stderr b/src/test/ui/compile-fail-migration/coherence-projection-conflict-orphan.stderr new file mode 100644 index 00000000000..a0fcf072fa8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-projection-conflict-orphan.stderr @@ -0,0 +1,14 @@ +error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`: + --> $DIR/coherence-projection-conflict-orphan.rs:26:1 + | +LL | impl Foo<i32> for i32 { } + | --------------------- first implementation here +LL | +LL | impl<A:Iterator> Foo<A::Item> for A { } //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32` + | + = note: upstream crates may add new impl of trait `std::iter::Iterator` for type `i32` in future versions + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-projection-conflict-ty-param.rs b/src/test/ui/compile-fail-migration/coherence-projection-conflict-ty-param.rs index 120d9046389..120d9046389 100644 --- a/src/test/compile-fail/coherence-projection-conflict-ty-param.rs +++ b/src/test/ui/compile-fail-migration/coherence-projection-conflict-ty-param.rs diff --git a/src/test/ui/compile-fail-migration/coherence-projection-conflict-ty-param.stderr b/src/test/ui/compile-fail-migration/coherence-projection-conflict-ty-param.stderr new file mode 100644 index 00000000000..cfbf96bc1c8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-projection-conflict-ty-param.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>`: + --> $DIR/coherence-projection-conflict-ty-param.rs:20:1 + | +LL | impl <P, T: Foo<P>> Foo<P> for Option<T> {} + | ---------------------------------------- first implementation here +LL | +LL | impl<T, U> Foo<T> for Option<U> { } //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::option::Option<_>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-projection-conflict.rs b/src/test/ui/compile-fail-migration/coherence-projection-conflict.rs index 3c32ab38b93..3c32ab38b93 100644 --- a/src/test/compile-fail/coherence-projection-conflict.rs +++ b/src/test/ui/compile-fail-migration/coherence-projection-conflict.rs diff --git a/src/test/ui/compile-fail-migration/coherence-projection-conflict.stderr b/src/test/ui/compile-fail-migration/coherence-projection-conflict.stderr new file mode 100644 index 00000000000..3832faf28d8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-projection-conflict.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`: + --> $DIR/coherence-projection-conflict.rs:21:1 + | +LL | impl Foo<i32> for i32 { } + | --------------------- first implementation here +LL | +LL | impl<A:Bar> Foo<A::Output> for A { } //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `i32` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-projection-ok-orphan.rs b/src/test/ui/compile-fail-migration/coherence-projection-ok-orphan.rs index a52af0873a8..a52af0873a8 100644 --- a/src/test/compile-fail/coherence-projection-ok-orphan.rs +++ b/src/test/ui/compile-fail-migration/coherence-projection-ok-orphan.rs diff --git a/src/test/ui/compile-fail-migration/coherence-projection-ok-orphan.stderr b/src/test/ui/compile-fail-migration/coherence-projection-ok-orphan.stderr new file mode 100644 index 00000000000..1b9a32525bf --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-projection-ok-orphan.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/coherence-projection-ok-orphan.rs:29:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence-projection-ok.rs b/src/test/ui/compile-fail-migration/coherence-projection-ok.rs index af88f3744ea..af88f3744ea 100644 --- a/src/test/compile-fail/coherence-projection-ok.rs +++ b/src/test/ui/compile-fail-migration/coherence-projection-ok.rs diff --git a/src/test/ui/compile-fail-migration/coherence-projection-ok.stderr b/src/test/ui/compile-fail-migration/coherence-projection-ok.stderr new file mode 100644 index 00000000000..945f3b396b7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-projection-ok.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/coherence-projection-ok.rs:28:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence-tuple-conflict.rs b/src/test/ui/compile-fail-migration/coherence-tuple-conflict.rs index 7807f93df1a..7807f93df1a 100644 --- a/src/test/compile-fail/coherence-tuple-conflict.rs +++ b/src/test/ui/compile-fail-migration/coherence-tuple-conflict.rs diff --git a/src/test/ui/compile-fail-migration/coherence-tuple-conflict.stderr b/src/test/ui/compile-fail-migration/coherence-tuple-conflict.stderr new file mode 100644 index 00000000000..4ceafea0a70 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-tuple-conflict.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `MyTrait` for type `(_, _)`: + --> $DIR/coherence-tuple-conflict.rs:25:1 + | +LL | impl<T> MyTrait for (T,T) { + | ------------------------- first implementation here +... +LL | impl<A,B> MyTrait for (A,B) { //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(_, _)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence-vec-local-2.rs b/src/test/ui/compile-fail-migration/coherence-vec-local-2.rs index 196c2f4ee3c..196c2f4ee3c 100644 --- a/src/test/compile-fail/coherence-vec-local-2.rs +++ b/src/test/ui/compile-fail-migration/coherence-vec-local-2.rs diff --git a/src/test/ui/compile-fail-migration/coherence-vec-local-2.stderr b/src/test/ui/compile-fail-migration/coherence-vec-local-2.stderr new file mode 100644 index 00000000000..2980d4a3392 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-vec-local-2.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/coherence-vec-local-2.rs:21:1 + | +LL | impl<T> Remote for Vec<Local<T>> { } //~ ERROR E0210 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/compile-fail/coherence-vec-local.rs b/src/test/ui/compile-fail-migration/coherence-vec-local.rs index 49822dcfcb3..49822dcfcb3 100644 --- a/src/test/compile-fail/coherence-vec-local.rs +++ b/src/test/ui/compile-fail-migration/coherence-vec-local.rs diff --git a/src/test/ui/compile-fail-migration/coherence-vec-local.stderr b/src/test/ui/compile-fail-migration/coherence-vec-local.stderr new file mode 100644 index 00000000000..b3c26160fe5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence-vec-local.stderr @@ -0,0 +1,12 @@ +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence-vec-local.rs:21:1 + | +LL | impl Remote for Vec<Local> { } //~ ERROR E0117 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/compile-fail/coherence_copy_like_err_fundamental_struct.rs b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct.rs index 9fbb7aa4cb1..9fbb7aa4cb1 100644 --- a/src/test/compile-fail/coherence_copy_like_err_fundamental_struct.rs +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct.rs diff --git a/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct.stderr b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct.stderr new file mode 100644 index 00000000000..675dc1b7004 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/coherence_copy_like_err_fundamental_struct.rs:34:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence_copy_like_err_fundamental_struct_ref.rs b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_ref.rs index 2f6dca4f3c2..2f6dca4f3c2 100644 --- a/src/test/compile-fail/coherence_copy_like_err_fundamental_struct_ref.rs +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_ref.rs diff --git a/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_ref.stderr b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_ref.stderr new file mode 100644 index 00000000000..5143d4e874b --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_ref.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/coherence_copy_like_err_fundamental_struct_ref.rs:34:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence_copy_like_err_fundamental_struct_tuple.rs b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_tuple.rs index f424e887201..f424e887201 100644 --- a/src/test/compile-fail/coherence_copy_like_err_fundamental_struct_tuple.rs +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_tuple.rs diff --git a/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_tuple.stderr b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_tuple.stderr new file mode 100644 index 00000000000..c7c49fe1462 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_fundamental_struct_tuple.stderr @@ -0,0 +1,14 @@ +error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>`: + --> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:27:1 + | +LL | impl<T: lib::MyCopy> MyTrait for T { } + | ---------------------------------- first implementation here +... +LL | impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { } //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyFundamentalStruct<(MyType,)>` + | + = note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyFundamentalStruct<(MyType,)>` in future versions + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence_copy_like_err_struct.rs b/src/test/ui/compile-fail-migration/coherence_copy_like_err_struct.rs index 04262e65c5a..04262e65c5a 100644 --- a/src/test/compile-fail/coherence_copy_like_err_struct.rs +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_struct.rs diff --git a/src/test/ui/compile-fail-migration/coherence_copy_like_err_struct.stderr b/src/test/ui/compile-fail-migration/coherence_copy_like_err_struct.stderr new file mode 100644 index 00000000000..786a3df0503 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_struct.stderr @@ -0,0 +1,14 @@ +error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct<MyType>`: + --> $DIR/coherence_copy_like_err_struct.rs:29:1 + | +LL | impl<T: lib::MyCopy> MyTrait for T { } + | ---------------------------------- first implementation here +... +LL | impl MyTrait for lib::MyStruct<MyType> { } //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyStruct<MyType>` + | + = note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyStruct<MyType>` in future versions + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence_copy_like_err_tuple.rs b/src/test/ui/compile-fail-migration/coherence_copy_like_err_tuple.rs index 378a70864f0..378a70864f0 100644 --- a/src/test/compile-fail/coherence_copy_like_err_tuple.rs +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_tuple.rs diff --git a/src/test/ui/compile-fail-migration/coherence_copy_like_err_tuple.stderr b/src/test/ui/compile-fail-migration/coherence_copy_like_err_tuple.stderr new file mode 100644 index 00000000000..3708a38443c --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_copy_like_err_tuple.stderr @@ -0,0 +1,14 @@ +error[E0119]: conflicting implementations of trait `MyTrait` for type `(MyType,)`: + --> $DIR/coherence_copy_like_err_tuple.rs:28:1 + | +LL | impl<T: lib::MyCopy> MyTrait for T { } + | ---------------------------------- first implementation here +... +LL | impl MyTrait for (MyType,) { } //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(MyType,)` + | + = note: upstream crates may add new impl of trait `lib::MyCopy` for type `(MyType,)` in future versions + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/coherence_inherent.rs b/src/test/ui/compile-fail-migration/coherence_inherent.rs index 087b8c14e35..087b8c14e35 100644 --- a/src/test/compile-fail/coherence_inherent.rs +++ b/src/test/ui/compile-fail-migration/coherence_inherent.rs diff --git a/src/test/ui/compile-fail-migration/coherence_inherent.stderr b/src/test/ui/compile-fail-migration/coherence_inherent.stderr new file mode 100644 index 00000000000..1708979ab11 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_inherent.stderr @@ -0,0 +1,13 @@ +error[E0599]: no method named `the_fn` found for type `&Lib::TheStruct` in the current scope + --> $DIR/coherence_inherent.rs:41:11 + | +LL | s.the_fn(); //~ ERROR no method named `the_fn` found + | ^^^^^^ + | + = help: items from traits can only be used if the trait is in scope + = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + `use Lib::TheTrait;` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/coherence_inherent_cc.rs b/src/test/ui/compile-fail-migration/coherence_inherent_cc.rs index 442c4c89de4..442c4c89de4 100644 --- a/src/test/compile-fail/coherence_inherent_cc.rs +++ b/src/test/ui/compile-fail-migration/coherence_inherent_cc.rs diff --git a/src/test/ui/compile-fail-migration/coherence_inherent_cc.stderr b/src/test/ui/compile-fail-migration/coherence_inherent_cc.stderr new file mode 100644 index 00000000000..a3c1b60d09a --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_inherent_cc.stderr @@ -0,0 +1,13 @@ +error[E0599]: no method named `the_fn` found for type `&coherence_inherent_cc_lib::TheStruct` in the current scope + --> $DIR/coherence_inherent_cc.rs:33:11 + | +LL | s.the_fn(); //~ ERROR no method named `the_fn` found + | ^^^^^^ + | + = help: items from traits can only be used if the trait is in scope + = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + `use coherence_inherent_cc_lib::TheTrait;` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/coherence_local.rs b/src/test/ui/compile-fail-migration/coherence_local.rs index 551577b6b4e..551577b6b4e 100644 --- a/src/test/compile-fail/coherence_local.rs +++ b/src/test/ui/compile-fail-migration/coherence_local.rs diff --git a/src/test/ui/compile-fail-migration/coherence_local.stderr b/src/test/ui/compile-fail-migration/coherence_local.stderr new file mode 100644 index 00000000000..c4340e8d876 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_local.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/coherence_local.rs:33:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/coherence_local_err_struct.rs b/src/test/ui/compile-fail-migration/coherence_local_err_struct.rs index 01f4c1cd8a5..01f4c1cd8a5 100644 --- a/src/test/compile-fail/coherence_local_err_struct.rs +++ b/src/test/ui/compile-fail-migration/coherence_local_err_struct.rs diff --git a/src/test/ui/compile-fail-migration/coherence_local_err_struct.stderr b/src/test/ui/compile-fail-migration/coherence_local_err_struct.stderr new file mode 100644 index 00000000000..c35e95040de --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_local_err_struct.stderr @@ -0,0 +1,12 @@ +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence_local_err_struct.rs:26:1 + | +LL | impl lib::MyCopy for lib::MyStruct<MyType> { } //~ ERROR E0117 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/compile-fail/coherence_local_err_tuple.rs b/src/test/ui/compile-fail-migration/coherence_local_err_tuple.rs index 590f68cee59..590f68cee59 100644 --- a/src/test/compile-fail/coherence_local_err_tuple.rs +++ b/src/test/ui/compile-fail-migration/coherence_local_err_tuple.rs diff --git a/src/test/ui/compile-fail-migration/coherence_local_err_tuple.stderr b/src/test/ui/compile-fail-migration/coherence_local_err_tuple.stderr new file mode 100644 index 00000000000..a3f9f2d32b8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_local_err_tuple.stderr @@ -0,0 +1,12 @@ +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/coherence_local_err_tuple.rs:26:1 + | +LL | impl lib::MyCopy for (MyType,) { } //~ ERROR E0117 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0117`. diff --git a/src/test/compile-fail/coherence_local_ref.rs b/src/test/ui/compile-fail-migration/coherence_local_ref.rs index f6e1aab5976..f6e1aab5976 100644 --- a/src/test/compile-fail/coherence_local_ref.rs +++ b/src/test/ui/compile-fail-migration/coherence_local_ref.rs diff --git a/src/test/ui/compile-fail-migration/coherence_local_ref.stderr b/src/test/ui/compile-fail-migration/coherence_local_ref.stderr new file mode 100644 index 00000000000..13d6fdd80f8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/coherence_local_ref.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/coherence_local_ref.rs:27:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/compile_error_macro.rs b/src/test/ui/compile-fail-migration/compile_error_macro.rs index e9c5993098c..e9c5993098c 100644 --- a/src/test/compile-fail/compile_error_macro.rs +++ b/src/test/ui/compile-fail-migration/compile_error_macro.rs diff --git a/src/test/ui/compile-fail-migration/compile_error_macro.stderr b/src/test/ui/compile-fail-migration/compile_error_macro.stderr new file mode 100644 index 00000000000..1abf5accc17 --- /dev/null +++ b/src/test/ui/compile-fail-migration/compile_error_macro.stderr @@ -0,0 +1,8 @@ +error: a very descriptive error message + --> $DIR/compile_error_macro.rs:12:5 + | +LL | compile_error!("a very descriptive error message"); //~ ERROR: a very descriptive error message + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/concat.rs b/src/test/ui/compile-fail-migration/concat.rs index e29c6ac5d5e..e29c6ac5d5e 100644 --- a/src/test/compile-fail/concat.rs +++ b/src/test/ui/compile-fail-migration/concat.rs diff --git a/src/test/ui/compile-fail-migration/concat.stderr b/src/test/ui/compile-fail-migration/concat.stderr new file mode 100644 index 00000000000..0128811353f --- /dev/null +++ b/src/test/ui/compile-fail-migration/concat.stderr @@ -0,0 +1,30 @@ +error: cannot concatenate a byte string literal + --> $DIR/concat.rs:12:13 + | +LL | concat!(b'f'); //~ ERROR: cannot concatenate a byte string literal + | ^^^^ + +error: cannot concatenate a byte string literal + --> $DIR/concat.rs:13:13 + | +LL | concat!(b"foo"); //~ ERROR: cannot concatenate a byte string literal + | ^^^^^^ + +error: expected a literal + --> $DIR/concat.rs:14:13 + | +LL | concat!(foo); //~ ERROR: expected a literal + | ^^^ + | + = note: only literals (like `"foo"`, `42` and `3.14`) can be passed to `concat!()` + +error: expected a literal + --> $DIR/concat.rs:15:13 + | +LL | concat!(foo()); //~ ERROR: expected a literal + | ^^^^^ + | + = note: only literals (like `"foo"`, `42` and `3.14`) can be passed to `concat!()` + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/conflicting-repr-hints.rs b/src/test/ui/compile-fail-migration/conflicting-repr-hints.rs index 426f60c6b09..426f60c6b09 100644 --- a/src/test/compile-fail/conflicting-repr-hints.rs +++ b/src/test/ui/compile-fail-migration/conflicting-repr-hints.rs diff --git a/src/test/ui/compile-fail-migration/conflicting-repr-hints.stderr b/src/test/ui/compile-fail-migration/conflicting-repr-hints.stderr new file mode 100644 index 00000000000..7a4e5a5488a --- /dev/null +++ b/src/test/ui/compile-fail-migration/conflicting-repr-hints.stderr @@ -0,0 +1,70 @@ +warning[E0566]: conflicting representation hints + --> $DIR/conflicting-repr-hints.rs:20:8 + | +LL | #[repr(C, u64)] //~ WARNING conflicting representation hints + | ^ ^^^ + +warning[E0566]: conflicting representation hints + --> $DIR/conflicting-repr-hints.rs:23:8 + | +LL | #[repr(u32, u64)] //~ WARNING conflicting representation hints + | ^^^ ^^^ + +error[E0587]: type has conflicting packed and align representation hints + --> $DIR/conflicting-repr-hints.rs:30:1 + | +LL | struct F(i32); //~ ERROR type has conflicting packed and align representation hints + | ^^^^^^^^^^^^^^ + +error[E0587]: type has conflicting packed and align representation hints + --> $DIR/conflicting-repr-hints.rs:34:1 + | +LL | struct G(i32); //~ ERROR type has conflicting packed and align representation hints + | ^^^^^^^^^^^^^^ + +error[E0587]: type has conflicting packed and align representation hints + --> $DIR/conflicting-repr-hints.rs:38:1 + | +LL | struct H(i32); //~ ERROR type has conflicting packed and align representation hints + | ^^^^^^^^^^^^^^ + +error[E0634]: type has conflicting packed representation hints + --> $DIR/conflicting-repr-hints.rs:41:1 + | +LL | struct I(i32); //~ ERROR type has conflicting packed representation hints + | ^^^^^^^^^^^^^^ + +error[E0634]: type has conflicting packed representation hints + --> $DIR/conflicting-repr-hints.rs:45:1 + | +LL | struct J(i32); //~ ERROR type has conflicting packed representation hints + | ^^^^^^^^^^^^^^ + +error[E0587]: type has conflicting packed and align representation hints + --> $DIR/conflicting-repr-hints.rs:51:1 + | +LL | / union X { //~ ERROR type has conflicting packed and align representation hints +LL | | i: i32 +LL | | } + | |_^ + +error[E0587]: type has conflicting packed and align representation hints + --> $DIR/conflicting-repr-hints.rs:57:1 + | +LL | / union Y { //~ ERROR type has conflicting packed and align representation hints +LL | | i: i32 +LL | | } + | |_^ + +error[E0587]: type has conflicting packed and align representation hints + --> $DIR/conflicting-repr-hints.rs:63:1 + | +LL | / union Z { //~ ERROR type has conflicting packed and align representation hints +LL | | i: i32 +LL | | } + | |_^ + +error: aborting due to 8 previous errors + +Some errors occurred: E0566, E0587, E0634. +For more information about an error, try `rustc --explain E0566`. diff --git a/src/test/compile-fail/conservative_impl_trait.rs b/src/test/ui/compile-fail-migration/conservative_impl_trait.rs index 30895bce357..30895bce357 100644 --- a/src/test/compile-fail/conservative_impl_trait.rs +++ b/src/test/ui/compile-fail-migration/conservative_impl_trait.rs diff --git a/src/test/ui/compile-fail-migration/conservative_impl_trait.stderr b/src/test/ui/compile-fail-migration/conservative_impl_trait.stderr new file mode 100644 index 00000000000..6fcd384566c --- /dev/null +++ b/src/test/ui/compile-fail-migration/conservative_impl_trait.stderr @@ -0,0 +1,12 @@ +error[E0277]: the trait bound `(): std::iter::Iterator` is not satisfied + --> $DIR/conservative_impl_trait.rs:13:33 + | +LL | fn will_ice(something: &u32) -> impl Iterator<Item = &u32> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not an iterator; maybe try calling `.iter()` or a similar method + | + = help: the trait `std::iter::Iterator` is not implemented for `()` + = note: the return type of a function must have a statically known size + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/const-array-oob-arith.rs b/src/test/ui/compile-fail-migration/const-array-oob-arith.rs index 9c07abdc36d..9c07abdc36d 100644 --- a/src/test/compile-fail/const-array-oob-arith.rs +++ b/src/test/ui/compile-fail-migration/const-array-oob-arith.rs diff --git a/src/test/ui/compile-fail-migration/const-array-oob-arith.stderr b/src/test/ui/compile-fail-migration/const-array-oob-arith.stderr new file mode 100644 index 00000000000..5b5f9425e73 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-array-oob-arith.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/const-array-oob-arith.rs:17:45 + | +LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5]; //~ ERROR: mismatched types + | ^^^ expected an array with a fixed size of 2 elements, found one with 1 elements + | + = note: expected type `[i32; 2]` + found type `[i32; 1]` + +error[E0308]: mismatched types + --> $DIR/const-array-oob-arith.rs:18:44 + | +LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99]; //~ ERROR: mismatched types + | ^^^^^^^ expected an array with a fixed size of 1 elements, found one with 2 elements + | + = note: expected type `[i32; 1]` + found type `[i32; 2]` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/const-array-oob.rs b/src/test/ui/compile-fail-migration/const-array-oob.rs index 22a3c5ceeb7..22a3c5ceeb7 100644 --- a/src/test/compile-fail/const-array-oob.rs +++ b/src/test/ui/compile-fail-migration/const-array-oob.rs diff --git a/src/test/ui/compile-fail-migration/const-array-oob.stderr b/src/test/ui/compile-fail-migration/const-array-oob.stderr new file mode 100644 index 00000000000..09e4918bf6e --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-array-oob.stderr @@ -0,0 +1,19 @@ +error: index out of bounds: the len is 3 but the index is 4 + --> $DIR/const-array-oob.rs:18:19 + | +LL | const BLUB: [u32; FOO[4]] = [5, 6]; + | ^^^^^^ + | + = note: #[deny(const_err)] on by default + +error[E0080]: could not evaluate constant expression + --> $DIR/const-array-oob.rs:18:1 + | +LL | const BLUB: [u32; FOO[4]] = [5, 6]; + | ^^^^^^^^^^^^^^^^^^------^^^^^^^^^^^ + | | + | index out of bounds: the len is 3 but the index is 4 + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/compile-fail/const-block-non-item-statement-2.rs b/src/test/ui/compile-fail-migration/const-block-non-item-statement-2.rs index f80d55cb342..f80d55cb342 100644 --- a/src/test/compile-fail/const-block-non-item-statement-2.rs +++ b/src/test/ui/compile-fail-migration/const-block-non-item-statement-2.rs diff --git a/src/test/ui/compile-fail-migration/const-block-non-item-statement-2.stderr b/src/test/ui/compile-fail-migration/const-block-non-item-statement-2.stderr new file mode 100644 index 00000000000..580f7e039d1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-block-non-item-statement-2.stderr @@ -0,0 +1,62 @@ +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-2.rs:11:20 + | +LL | const A: usize = { 1; 2 }; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-2.rs:14:20 + | +LL | const B: usize = { { } 2 }; + | ^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-2.rs:18:12 + | +LL | () => (()) //~ ERROR statements in constants are unstable + | ^^ +LL | } +LL | const C: usize = { foo!(); 2 }; + | ------- in this macro invocation + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-2.rs:22:28 + | +LL | const D: usize = { let x = 4; 2 }; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-2.rs:22:28 + | +LL | const D: usize = { let x = 4; 2 }; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-2.rs:22:1 + | +LL | const D: usize = { let x = 4; 2 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-2.rs:22:1 + | +LL | const D: usize = { let x = 4; 2 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/const-block-non-item-statement-3.rs b/src/test/ui/compile-fail-migration/const-block-non-item-statement-3.rs index cfa4b778dde..cfa4b778dde 100644 --- a/src/test/compile-fail/const-block-non-item-statement-3.rs +++ b/src/test/ui/compile-fail-migration/const-block-non-item-statement-3.rs diff --git a/src/test/ui/compile-fail-migration/const-block-non-item-statement-3.stderr b/src/test/ui/compile-fail-migration/const-block-non-item-statement-3.stderr new file mode 100644 index 00000000000..0124288d43d --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-block-non-item-statement-3.stderr @@ -0,0 +1,35 @@ +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-3.rs:11:31 + | +LL | type Array = [u32; { let x = 2; 5 }]; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-3.rs:11:31 + | +LL | type Array = [u32; { let x = 2; 5 }]; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-3.rs:11:20 + | +LL | type Array = [u32; { let x = 2; 5 }]; + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement-3.rs:11:20 + | +LL | type Array = [u32; { let x = 2; 5 }]; + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/const-block-non-item-statement.rs b/src/test/ui/compile-fail-migration/const-block-non-item-statement.rs index f974a24c26f..f974a24c26f 100644 --- a/src/test/compile-fail/const-block-non-item-statement.rs +++ b/src/test/ui/compile-fail-migration/const-block-non-item-statement.rs diff --git a/src/test/ui/compile-fail-migration/const-block-non-item-statement.stderr b/src/test/ui/compile-fail-migration/const-block-non-item-statement.stderr new file mode 100644 index 00000000000..b367a9d9937 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-block-non-item-statement.stderr @@ -0,0 +1,35 @@ +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement.rs:12:21 + | +LL | Bar = { let x = 1; 3 } + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement.rs:12:21 + | +LL | Bar = { let x = 1; 3 } + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement.rs:12:11 + | +LL | Bar = { let x = 1; 3 } + | ^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/const-block-non-item-statement.rs:12:11 + | +LL | Bar = { let x = 1; 3 } + | ^^^^^^^^^^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/const-call.rs b/src/test/ui/compile-fail-migration/const-call.rs index 02264228a6b..02264228a6b 100644 --- a/src/test/compile-fail/const-call.rs +++ b/src/test/ui/compile-fail-migration/const-call.rs diff --git a/src/test/ui/compile-fail-migration/const-call.stderr b/src/test/ui/compile-fail-migration/const-call.stderr new file mode 100644 index 00000000000..efc3c58c681 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-call.stderr @@ -0,0 +1,16 @@ +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants + --> $DIR/const-call.rs:16:17 + | +LL | let _ = [0; f(2)]; + | ^^^^ + +error[E0080]: could not evaluate repeat length + --> $DIR/const-call.rs:16:17 + | +LL | let _ = [0; f(2)]; + | ^^^^ calling non-const fn `f` + +error: aborting due to 2 previous errors + +Some errors occurred: E0015, E0080. +For more information about an error, try `rustc --explain E0015`. diff --git a/src/test/compile-fail/const-cast-different-types.rs b/src/test/ui/compile-fail-migration/const-cast-different-types.rs index 397804566b4..397804566b4 100644 --- a/src/test/compile-fail/const-cast-different-types.rs +++ b/src/test/ui/compile-fail-migration/const-cast-different-types.rs diff --git a/src/test/ui/compile-fail-migration/const-cast-different-types.stderr b/src/test/ui/compile-fail-migration/const-cast-different-types.stderr new file mode 100644 index 00000000000..bc4d1358697 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-cast-different-types.stderr @@ -0,0 +1,15 @@ +error[E0606]: casting `&'static str` as `*const u8` is invalid + --> $DIR/const-cast-different-types.rs:12:23 + | +LL | static b: *const u8 = a as *const u8; //~ ERROR casting + | ^^^^^^^^^^^^^^ + +error[E0606]: casting `&&'static str` as `*const u8` is invalid + --> $DIR/const-cast-different-types.rs:13:23 + | +LL | static c: *const u8 = &a as *const u8; //~ ERROR casting + | ^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0606`. diff --git a/src/test/compile-fail/const-cast-wrong-type.rs b/src/test/ui/compile-fail-migration/const-cast-wrong-type.rs index b3597441834..b3597441834 100644 --- a/src/test/compile-fail/const-cast-wrong-type.rs +++ b/src/test/ui/compile-fail-migration/const-cast-wrong-type.rs diff --git a/src/test/ui/compile-fail-migration/const-cast-wrong-type.stderr b/src/test/ui/compile-fail-migration/const-cast-wrong-type.stderr new file mode 100644 index 00000000000..d7ac89cc6a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-cast-wrong-type.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/const-cast-wrong-type.rs:12:23 + | +LL | static b: *const i8 = &a as *const i8; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^ expected u8, found i8 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/const-err-early.rs b/src/test/ui/compile-fail-migration/const-err-early.rs index 39b1b342eac..39b1b342eac 100644 --- a/src/test/compile-fail/const-err-early.rs +++ b/src/test/ui/compile-fail-migration/const-err-early.rs diff --git a/src/test/ui/compile-fail-migration/const-err-early.stderr b/src/test/ui/compile-fail-migration/const-err-early.stderr new file mode 100644 index 00000000000..36f3ac1a9bc --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-err-early.stderr @@ -0,0 +1,48 @@ +error: this constant cannot be used + --> $DIR/const-err-early.rs:13:1 + | +LL | pub const A: i8 = -std::i8::MIN; //~ ERROR const_err + | ^^^^^^^^^^^^^^^^^^-------------^ + | | + | attempt to negate with overflow + | +note: lint level defined here + --> $DIR/const-err-early.rs:11:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + +error: this constant cannot be used + --> $DIR/const-err-early.rs:14:1 + | +LL | pub const B: u8 = 200u8 + 200u8; //~ ERROR const_err + | ^^^^^^^^^^^^^^^^^^-------------^ + | | + | attempt to add with overflow + +error: this constant cannot be used + --> $DIR/const-err-early.rs:15:1 + | +LL | pub const C: u8 = 200u8 * 4; //~ ERROR const_err + | ^^^^^^^^^^^^^^^^^^---------^ + | | + | attempt to multiply with overflow + +error: this constant cannot be used + --> $DIR/const-err-early.rs:16:1 + | +LL | pub const D: u8 = 42u8 - (42u8 + 1); //~ ERROR const_err + | ^^^^^^^^^^^^^^^^^^-----------------^ + | | + | attempt to subtract with overflow + +error: this constant cannot be used + --> $DIR/const-err-early.rs:17:1 + | +LL | pub const E: u8 = [5u8][1]; //~ ERROR const_err + | ^^^^^^^^^^^^^^^^^^--------^ + | | + | index out of bounds: the len is 1 but the index is 1 + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/const-err-multi.rs b/src/test/ui/compile-fail-migration/const-err-multi.rs index f2ee8a7078c..f2ee8a7078c 100644 --- a/src/test/compile-fail/const-err-multi.rs +++ b/src/test/ui/compile-fail-migration/const-err-multi.rs diff --git a/src/test/ui/compile-fail-migration/const-err-multi.stderr b/src/test/ui/compile-fail-migration/const-err-multi.stderr new file mode 100644 index 00000000000..dd3eaa4c47b --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-err-multi.stderr @@ -0,0 +1,67 @@ +error: this constant cannot be used + --> $DIR/const-err-multi.rs:13:1 + | +LL | pub const A: i8 = -std::i8::MIN; + | ^^^^^^^^^^^^^^^^^^-------------^ + | | + | attempt to negate with overflow + | +note: lint level defined here + --> $DIR/const-err-multi.rs:11:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + +error: referenced constant has errors + --> $DIR/const-err-multi.rs:15:1 + | +LL | pub const A: i8 = -std::i8::MIN; + | ------------- attempt to negate with overflow +LL | //~^ ERROR this constant cannot be used +LL | pub const B: i8 = A; + | ^^^^^^^^^^^^^^^^^^^^ + +error: this constant cannot be used + --> $DIR/const-err-multi.rs:15:1 + | +LL | pub const B: i8 = A; + | ^^^^^^^^^^^^^^^^^^-^ + | | + | referenced constant has errors + +error: referenced constant has errors + --> $DIR/const-err-multi.rs:18:1 + | +LL | pub const A: i8 = -std::i8::MIN; + | ------------- attempt to negate with overflow +... +LL | pub const C: u8 = A as u8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: this constant cannot be used + --> $DIR/const-err-multi.rs:18:1 + | +LL | pub const C: u8 = A as u8; + | ^^^^^^^^^^^^^^^^^^-------^ + | | + | referenced constant has errors + +error: referenced constant has errors + --> $DIR/const-err-multi.rs:21:1 + | +LL | pub const A: i8 = -std::i8::MIN; + | ------------- attempt to negate with overflow +... +LL | pub const D: i8 = 50 - A; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: this constant cannot be used + --> $DIR/const-err-multi.rs:21:1 + | +LL | pub const D: i8 = 50 - A; + | ^^^^^^^^^^^^^^^^^^------^ + | | + | referenced constant has errors + +error: aborting due to 7 previous errors + diff --git a/src/test/compile-fail/const-err.rs b/src/test/ui/compile-fail-migration/const-err.rs index 8683f6a0231..8683f6a0231 100644 --- a/src/test/compile-fail/const-err.rs +++ b/src/test/ui/compile-fail-migration/const-err.rs diff --git a/src/test/ui/compile-fail-migration/const-err.stderr b/src/test/ui/compile-fail-migration/const-err.stderr new file mode 100644 index 00000000000..1674f99b682 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-err.stderr @@ -0,0 +1,26 @@ +error[E0080]: referenced constant has errors + --> $DIR/const-err.rs:29:15 + | +LL | const FOO: u8 = [5u8][1]; + | -------- index out of bounds: the len is 1 but the index is 1 +... +LL | black_box((FOO, FOO)); + | ^^^^^^^^^^ + +error[E0080]: could not evaluate constant + --> $DIR/const-err.rs:29:15 + | +LL | black_box((FOO, FOO)); + | ^^^^^^^^^^ referenced constant has errors + +error[E0080]: constant evaluation error + --> $DIR/const-err.rs:24:1 + | +LL | const FOO: u8 = [5u8][1]; + | ^^^^^^^^^^^^^^^^--------^ + | | + | index out of bounds: the len is 1 but the index is 1 + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/compile-fail/const-err2.rs b/src/test/ui/compile-fail-migration/const-err2.rs index 9a5cb5a4a83..9a5cb5a4a83 100644 --- a/src/test/compile-fail/const-err2.rs +++ b/src/test/ui/compile-fail-migration/const-err2.rs diff --git a/src/test/ui/compile-fail-migration/const-err2.stderr b/src/test/ui/compile-fail-migration/const-err2.stderr new file mode 100644 index 00000000000..7201ecbc55d --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-err2.stderr @@ -0,0 +1,38 @@ +error: this expression will panic at runtime + --> $DIR/const-err2.rs:25:13 + | +LL | let a = -std::i8::MIN; + | ^^^^^^^^^^^^^ attempt to negate with overflow + | +note: lint level defined here + --> $DIR/const-err2.rs:18:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/const-err2.rs:27:13 + | +LL | let b = 200u8 + 200u8 + 200u8; + | ^^^^^^^^^^^^^ attempt to add with overflow + +error: this expression will panic at runtime + --> $DIR/const-err2.rs:29:13 + | +LL | let c = 200u8 * 4; + | ^^^^^^^^^ attempt to multiply with overflow + +error: this expression will panic at runtime + --> $DIR/const-err2.rs:31:13 + | +LL | let d = 42u8 - (42u8 + 1); + | ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow + +error: index out of bounds: the len is 1 but the index is 1 + --> $DIR/const-err2.rs:33:14 + | +LL | let _e = [5u8][1]; + | ^^^^^^^^ + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/const-err3.rs b/src/test/ui/compile-fail-migration/const-err3.rs index f5e43b57e77..f5e43b57e77 100644 --- a/src/test/compile-fail/const-err3.rs +++ b/src/test/ui/compile-fail-migration/const-err3.rs diff --git a/src/test/ui/compile-fail-migration/const-err3.stderr b/src/test/ui/compile-fail-migration/const-err3.stderr new file mode 100644 index 00000000000..5be46248fa7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-err3.stderr @@ -0,0 +1,32 @@ +error: this expression will panic at runtime + --> $DIR/const-err3.rs:19:13 + | +LL | let b = 200u8 + 200u8 + 200u8; + | ^^^^^^^^^^^^^ attempt to add with overflow + | +note: lint level defined here + --> $DIR/const-err3.rs:12:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + +error: this expression will panic at runtime + --> $DIR/const-err3.rs:21:13 + | +LL | let c = 200u8 * 4; + | ^^^^^^^^^ attempt to multiply with overflow + +error: this expression will panic at runtime + --> $DIR/const-err3.rs:23:13 + | +LL | let d = 42u8 - (42u8 + 1); + | ^^^^^^^^^^^^^^^^^ attempt to subtract with overflow + +error: index out of bounds: the len is 1 but the index is 1 + --> $DIR/const-err3.rs:25:14 + | +LL | let _e = [5u8][1]; + | ^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/const-err4.rs b/src/test/ui/compile-fail-migration/const-err4.rs index 10376d57809..10376d57809 100644 --- a/src/test/compile-fail/const-err4.rs +++ b/src/test/ui/compile-fail-migration/const-err4.rs diff --git a/src/test/ui/compile-fail-migration/const-err4.stderr b/src/test/ui/compile-fail-migration/const-err4.stderr new file mode 100644 index 00000000000..dc64737b22f --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-err4.stderr @@ -0,0 +1,9 @@ +error[E0080]: could not evaluate enum discriminant + --> $DIR/const-err4.rs:18:11 + | +LL | Boo = [unsafe { Foo { b: () }.a }; 4][3], + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempted to read undefined bytes + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/compile-fail/const-eval-overflow-3.rs b/src/test/ui/compile-fail-migration/const-eval-overflow-3.rs index d930cb77047..d930cb77047 100644 --- a/src/test/compile-fail/const-eval-overflow-3.rs +++ b/src/test/ui/compile-fail-migration/const-eval-overflow-3.rs diff --git a/src/test/ui/compile-fail-migration/const-eval-overflow-3.stderr b/src/test/ui/compile-fail-migration/const-eval-overflow-3.stderr new file mode 100644 index 00000000000..f2b4e6b3b56 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-eval-overflow-3.stderr @@ -0,0 +1,19 @@ +error: attempt to add with overflow + --> $DIR/const-eval-overflow-3.rs:30:11 + | +LL | = [0; (i8::MAX + 1) as usize]; + | ^^^^^^^^^^^^^ + | + = note: #[deny(const_err)] on by default + +error[E0080]: could not evaluate repeat length + --> $DIR/const-eval-overflow-3.rs:30:11 + | +LL | = [0; (i8::MAX + 1) as usize]; + | -------------^^^^^^^^^ + | | + | attempt to add with overflow + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/compile-fail/const-eval-overflow-3b.rs b/src/test/ui/compile-fail-migration/const-eval-overflow-3b.rs index 719b21000f7..719b21000f7 100644 --- a/src/test/compile-fail/const-eval-overflow-3b.rs +++ b/src/test/ui/compile-fail-migration/const-eval-overflow-3b.rs diff --git a/src/test/ui/compile-fail-migration/const-eval-overflow-3b.stderr b/src/test/ui/compile-fail-migration/const-eval-overflow-3b.stderr new file mode 100644 index 00000000000..4f1163bf9a1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-eval-overflow-3b.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/const-eval-overflow-3b.rs:34:22 + | +LL | = [0; (i8::MAX + 1u8) as usize]; + | ^^^ expected i8, found u8 + +error[E0277]: cannot add `u8` to `i8` + --> $DIR/const-eval-overflow-3b.rs:34:20 + | +LL | = [0; (i8::MAX + 1u8) as usize]; + | ^ no implementation for `i8 + u8` + | + = help: the trait `std::ops::Add<u8>` is not implemented for `i8` + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/const-eval-overflow-4b.rs b/src/test/ui/compile-fail-migration/const-eval-overflow-4b.rs index 6028df18839..6028df18839 100644 --- a/src/test/compile-fail/const-eval-overflow-4b.rs +++ b/src/test/ui/compile-fail-migration/const-eval-overflow-4b.rs diff --git a/src/test/ui/compile-fail-migration/const-eval-overflow-4b.stderr b/src/test/ui/compile-fail-migration/const-eval-overflow-4b.stderr new file mode 100644 index 00000000000..d171e7f09d1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-eval-overflow-4b.stderr @@ -0,0 +1,24 @@ +error[E0308]: mismatched types + --> $DIR/const-eval-overflow-4b.rs:22:30 + | +LL | : [u32; (i8::MAX as i8 + 1u8) as usize] + | ^^^ expected i8, found u8 + +error[E0277]: cannot add `u8` to `i8` + --> $DIR/const-eval-overflow-4b.rs:22:28 + | +LL | : [u32; (i8::MAX as i8 + 1u8) as usize] + | ^ no implementation for `i8 + u8` + | + = help: the trait `std::ops::Add<u8>` is not implemented for `i8` + +error[E0604]: only `u8` can be cast as `char`, not `i8` + --> $DIR/const-eval-overflow-4b.rs:35:13 + | +LL | : [u32; 5i8 as char as usize] + | ^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0277, E0308, E0604. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/const-eval-overflow2.rs b/src/test/ui/compile-fail-migration/const-eval-overflow2.rs index 88fc5182775..88fc5182775 100644 --- a/src/test/compile-fail/const-eval-overflow2.rs +++ b/src/test/ui/compile-fail-migration/const-eval-overflow2.rs diff --git a/src/test/ui/compile-fail-migration/const-eval-overflow2.stderr b/src/test/ui/compile-fail-migration/const-eval-overflow2.stderr new file mode 100644 index 00000000000..5cf5ce367e2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-eval-overflow2.stderr @@ -0,0 +1,94 @@ +error: this constant cannot be used + --> $DIR/const-eval-overflow2.rs:24:1 + | +LL | / const VALS_I8: (i8,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i8::MIN - 1, + | | ----------- attempt to subtract with overflow +LL | | ); + | |_______^ + | +note: lint level defined here + --> $DIR/const-eval-overflow2.rs:18:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2.rs:30:1 + | +LL | / const VALS_I16: (i16,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i16::MIN - 1, + | | ------------ attempt to subtract with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2.rs:36:1 + | +LL | / const VALS_I32: (i32,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i32::MIN - 1, + | | ------------ attempt to subtract with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2.rs:42:1 + | +LL | / const VALS_I64: (i64,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i64::MIN - 1, + | | ------------ attempt to subtract with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2.rs:48:1 + | +LL | / const VALS_U8: (u8,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | u8::MIN - 1, + | | ----------- attempt to subtract with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2.rs:54:1 + | +LL | / const VALS_U16: (u16,) = ( +LL | | //~^ ERROR this constant cannot be used +LL | | u16::MIN - 1, + | | ------------ attempt to subtract with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2.rs:59:1 + | +LL | / const VALS_U32: (u32,) = ( +LL | | //~^ ERROR this constant cannot be used +LL | | u32::MIN - 1, + | | ------------ attempt to subtract with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2.rs:64:1 + | +LL | / const VALS_U64: (u64,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | u64::MIN - 1, + | | ------------ attempt to subtract with overflow +LL | | ); + | |_______^ + +error: aborting due to 8 previous errors + diff --git a/src/test/compile-fail/const-eval-overflow2b.rs b/src/test/ui/compile-fail-migration/const-eval-overflow2b.rs index 1878daea931..1878daea931 100644 --- a/src/test/compile-fail/const-eval-overflow2b.rs +++ b/src/test/ui/compile-fail-migration/const-eval-overflow2b.rs diff --git a/src/test/ui/compile-fail-migration/const-eval-overflow2b.stderr b/src/test/ui/compile-fail-migration/const-eval-overflow2b.stderr new file mode 100644 index 00000000000..458a9e11e75 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-eval-overflow2b.stderr @@ -0,0 +1,94 @@ +error: this constant cannot be used + --> $DIR/const-eval-overflow2b.rs:24:1 + | +LL | / const VALS_I8: (i8,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i8::MAX + 1, + | | ----------- attempt to add with overflow +LL | | ); + | |_______^ + | +note: lint level defined here + --> $DIR/const-eval-overflow2b.rs:18:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2b.rs:30:1 + | +LL | / const VALS_I16: (i16,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i16::MAX + 1, + | | ------------ attempt to add with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2b.rs:36:1 + | +LL | / const VALS_I32: (i32,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i32::MAX + 1, + | | ------------ attempt to add with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2b.rs:42:1 + | +LL | / const VALS_I64: (i64,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i64::MAX + 1, + | | ------------ attempt to add with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2b.rs:48:1 + | +LL | / const VALS_U8: (u8,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | u8::MAX + 1, + | | ----------- attempt to add with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2b.rs:54:1 + | +LL | / const VALS_U16: (u16,) = ( +LL | | //~^ ERROR this constant cannot be used +LL | | u16::MAX + 1, + | | ------------ attempt to add with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2b.rs:59:1 + | +LL | / const VALS_U32: (u32,) = ( +LL | | //~^ ERROR this constant cannot be used +LL | | u32::MAX + 1, + | | ------------ attempt to add with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2b.rs:64:1 + | +LL | / const VALS_U64: (u64,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | u64::MAX + 1, + | | ------------ attempt to add with overflow +LL | | ); + | |_______^ + +error: aborting due to 8 previous errors + diff --git a/src/test/compile-fail/const-eval-overflow2c.rs b/src/test/ui/compile-fail-migration/const-eval-overflow2c.rs index f3d28295bf8..f3d28295bf8 100644 --- a/src/test/compile-fail/const-eval-overflow2c.rs +++ b/src/test/ui/compile-fail-migration/const-eval-overflow2c.rs diff --git a/src/test/ui/compile-fail-migration/const-eval-overflow2c.stderr b/src/test/ui/compile-fail-migration/const-eval-overflow2c.stderr new file mode 100644 index 00000000000..866860281cf --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-eval-overflow2c.stderr @@ -0,0 +1,94 @@ +error: this constant cannot be used + --> $DIR/const-eval-overflow2c.rs:24:1 + | +LL | / const VALS_I8: (i8,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i8::MIN * 2, + | | ----------- attempt to multiply with overflow +LL | | ); + | |_______^ + | +note: lint level defined here + --> $DIR/const-eval-overflow2c.rs:18:9 + | +LL | #![deny(const_err)] + | ^^^^^^^^^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2c.rs:30:1 + | +LL | / const VALS_I16: (i16,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i16::MIN * 2, + | | ------------ attempt to multiply with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2c.rs:36:1 + | +LL | / const VALS_I32: (i32,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i32::MIN * 2, + | | ------------ attempt to multiply with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2c.rs:42:1 + | +LL | / const VALS_I64: (i64,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | i64::MIN * 2, + | | ------------ attempt to multiply with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2c.rs:48:1 + | +LL | / const VALS_U8: (u8,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | u8::MAX * 2, + | | ----------- attempt to multiply with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2c.rs:54:1 + | +LL | / const VALS_U16: (u16,) = ( +LL | | //~^ ERROR this constant cannot be used +LL | | u16::MAX * 2, + | | ------------ attempt to multiply with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2c.rs:59:1 + | +LL | / const VALS_U32: (u32,) = ( +LL | | //~^ ERROR this constant cannot be used +LL | | u32::MAX * 2, + | | ------------ attempt to multiply with overflow +LL | | ); + | |_______^ + +error: this constant cannot be used + --> $DIR/const-eval-overflow2c.rs:64:1 + | +LL | / const VALS_U64: (u64,) = +LL | | //~^ ERROR this constant cannot be used +LL | | ( +LL | | u64::MAX * 2, + | | ------------ attempt to multiply with overflow +LL | | ); + | |_______^ + +error: aborting due to 8 previous errors + diff --git a/src/test/compile-fail/const-fn-destructuring-arg.rs b/src/test/ui/compile-fail-migration/const-fn-destructuring-arg.rs index fce1688716d..fce1688716d 100644 --- a/src/test/compile-fail/const-fn-destructuring-arg.rs +++ b/src/test/ui/compile-fail-migration/const-fn-destructuring-arg.rs diff --git a/src/test/ui/compile-fail-migration/const-fn-destructuring-arg.stderr b/src/test/ui/compile-fail-migration/const-fn-destructuring-arg.stderr new file mode 100644 index 00000000000..029d63a7720 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-fn-destructuring-arg.stderr @@ -0,0 +1,35 @@ +error[E0658]: arguments of constant functions can only be immutable by-value bindings (see issue #48821) + --> $DIR/const-fn-destructuring-arg.rs:17:13 + | +LL | a, + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: arguments of constant functions can only be immutable by-value bindings (see issue #48821) + --> $DIR/const-fn-destructuring-arg.rs:19:13 + | +LL | b + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constant functions are unstable (see issue #48821) + --> $DIR/const-fn-destructuring-arg.rs:22:5 + | +LL | a + b + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constant functions are unstable (see issue #48821) + --> $DIR/const-fn-destructuring-arg.rs:22:9 + | +LL | a + b + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/const-fn-not-safe-for-const.rs b/src/test/ui/compile-fail-migration/const-fn-not-safe-for-const.rs index 341cc7bb491..341cc7bb491 100644 --- a/src/test/compile-fail/const-fn-not-safe-for-const.rs +++ b/src/test/ui/compile-fail-migration/const-fn-not-safe-for-const.rs diff --git a/src/test/ui/compile-fail-migration/const-fn-not-safe-for-const.stderr b/src/test/ui/compile-fail-migration/const-fn-not-safe-for-const.stderr new file mode 100644 index 00000000000..1e99a4378fa --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-fn-not-safe-for-const.stderr @@ -0,0 +1,76 @@ +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants + --> $DIR/const-fn-not-safe-for-const.rs:20:14 + | +LL | unsafe { transmute(x) } //~ ERROR E0015 + | ^^^^^^^^^^^^ + +error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants + --> $DIR/const-fn-not-safe-for-const.rs:24:5 + | +LL | random() //~ ERROR E0015 + | ^^^^^^^^ + +error[E0013]: constant functions cannot refer to statics, use a constant instead + --> $DIR/const-fn-not-safe-for-const.rs:30:5 + | +LL | Y + | ^ + +error[E0013]: constant functions cannot refer to statics, use a constant instead + --> $DIR/const-fn-not-safe-for-const.rs:35:5 + | +LL | &Y + | ^^ + +error[E0658]: let bindings in constant functions are unstable (see issue #48821) + --> $DIR/const-fn-not-safe-for-const.rs:40:13 + | +LL | let x = 22; + | ^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constant functions are unstable (see issue #48821) + --> $DIR/const-fn-not-safe-for-const.rs:40:13 + | +LL | let x = 22; + | ^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constant functions are unstable (see issue #48821) + --> $DIR/const-fn-not-safe-for-const.rs:43:13 + | +LL | let y = 44; + | ^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constant functions are unstable (see issue #48821) + --> $DIR/const-fn-not-safe-for-const.rs:43:13 + | +LL | let y = 44; + | ^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constant functions are unstable (see issue #48821) + --> $DIR/const-fn-not-safe-for-const.rs:46:5 + | +LL | x + y + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: let bindings in constant functions are unstable (see issue #48821) + --> $DIR/const-fn-not-safe-for-const.rs:46:9 + | +LL | x + y + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error: aborting due to 10 previous errors + +Some errors occurred: E0013, E0015, E0658. +For more information about an error, try `rustc --explain E0013`. diff --git a/src/test/compile-fail/const-fn-stability-calls-3.rs b/src/test/ui/compile-fail-migration/const-fn-stability-calls-3.rs index 0f413b0bbc1..0f413b0bbc1 100644 --- a/src/test/compile-fail/const-fn-stability-calls-3.rs +++ b/src/test/ui/compile-fail-migration/const-fn-stability-calls-3.rs diff --git a/src/test/ui/compile-fail-migration/const-fn-stability-calls-3.stderr b/src/test/ui/compile-fail-migration/const-fn-stability-calls-3.stderr new file mode 100644 index 00000000000..50c959d6805 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-fn-stability-calls-3.stderr @@ -0,0 +1,10 @@ +error: compilation successful + --> $DIR/const-fn-stability-calls-3.rs:23:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let x = foo(); // use outside a constant is ok +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-integer-bool-ops.rs b/src/test/ui/compile-fail-migration/const-integer-bool-ops.rs index 29bc665a22e..29bc665a22e 100644 --- a/src/test/compile-fail/const-integer-bool-ops.rs +++ b/src/test/ui/compile-fail-migration/const-integer-bool-ops.rs diff --git a/src/test/ui/compile-fail-migration/const-integer-bool-ops.stderr b/src/test/ui/compile-fail-migration/const-integer-bool-ops.stderr new file mode 100644 index 00000000000..8075a3f0863 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-integer-bool-ops.stderr @@ -0,0 +1,135 @@ +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:11:18 + | +LL | const X: usize = 42 && 39; + | ^^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:11:24 + | +LL | const X: usize = 42 && 39; + | ^^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:11:18 + | +LL | const X: usize = 42 && 39; + | ^^^^^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:20:19 + | +LL | const X1: usize = 42 || 39; + | ^^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:20:25 + | +LL | const X1: usize = 42 || 39; + | ^^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:20:19 + | +LL | const X1: usize = 42 || 39; + | ^^^^^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:29:19 + | +LL | const X2: usize = -42 || -39; + | ^^^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:29:26 + | +LL | const X2: usize = -42 || -39; + | ^^^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:29:19 + | +LL | const X2: usize = -42 || -39; + | ^^^^^^^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:38:19 + | +LL | const X3: usize = -42 && -39; + | ^^^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:38:26 + | +LL | const X3: usize = -42 && -39; + | ^^^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:38:19 + | +LL | const X3: usize = -42 && -39; + | ^^^^^^^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:47:18 + | +LL | const Y: usize = 42.0 == 42.0; + | ^^^^^^^^^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:52:19 + | +LL | const Y1: usize = 42.0 >= 42.0; + | ^^^^^^^^^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:57:19 + | +LL | const Y2: usize = 42.0 <= 42.0; + | ^^^^^^^^^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:62:19 + | +LL | const Y3: usize = 42.0 > 42.0; + | ^^^^^^^^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:67:19 + | +LL | const Y4: usize = 42.0 < 42.0; + | ^^^^^^^^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/const-integer-bool-ops.rs:72:19 + | +LL | const Y5: usize = 42.0 != 42.0; + | ^^^^^^^^^^^^ expected usize, found bool + +error: aborting due to 18 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/const-len-underflow-subspans.rs b/src/test/ui/compile-fail-migration/const-len-underflow-subspans.rs index 054c272a3d3..054c272a3d3 100644 --- a/src/test/compile-fail/const-len-underflow-subspans.rs +++ b/src/test/ui/compile-fail-migration/const-len-underflow-subspans.rs diff --git a/src/test/ui/compile-fail-migration/const-len-underflow-subspans.stderr b/src/test/ui/compile-fail-migration/const-len-underflow-subspans.stderr new file mode 100644 index 00000000000..860716c1f38 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-len-underflow-subspans.stderr @@ -0,0 +1,19 @@ +error: attempt to subtract with overflow + --> $DIR/const-len-underflow-subspans.rs:18:17 + | +LL | let a: [i8; ONE - TWO] = unimplemented!(); + | ^^^^^^^^^ + | + = note: #[deny(const_err)] on by default + +error[E0080]: could not evaluate constant expression + --> $DIR/const-len-underflow-subspans.rs:18:12 + | +LL | let a: [i8; ONE - TWO] = unimplemented!(); + | ^^^^^---------^ + | | + | attempt to subtract with overflow + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/compile-fail-migration/const-match-check.eval1.stderr b/src/test/ui/compile-fail-migration/const-match-check.eval1.stderr new file mode 100644 index 00000000000..3caf1491aba --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-match-check.eval1.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in local binding: `_` not covered + --> $DIR/const-match-check.rs:35:15 + | +LL | A = { let 0 = 0; 0 }, + | ^ pattern `_` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/ui/compile-fail-migration/const-match-check.eval2.stderr b/src/test/ui/compile-fail-migration/const-match-check.eval2.stderr new file mode 100644 index 00000000000..de85d4d73db --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-match-check.eval2.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in local binding: `_` not covered + --> $DIR/const-match-check.rs:41:24 + | +LL | let x: [i32; { let 0 = 0; 0 }] = []; + | ^ pattern `_` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/ui/compile-fail-migration/const-match-check.matchck.stderr b/src/test/ui/compile-fail-migration/const-match-check.matchck.stderr new file mode 100644 index 00000000000..bbf1169c577 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-match-check.matchck.stderr @@ -0,0 +1,27 @@ +error[E0005]: refutable pattern in local binding: `_` not covered + --> $DIR/const-match-check.rs:14:22 + | +LL | const X: i32 = { let 0 = 0; 0 }; + | ^ pattern `_` not covered + +error[E0005]: refutable pattern in local binding: `_` not covered + --> $DIR/const-match-check.rs:18:23 + | +LL | static Y: i32 = { let 0 = 0; 0 }; + | ^ pattern `_` not covered + +error[E0005]: refutable pattern in local binding: `_` not covered + --> $DIR/const-match-check.rs:23:26 + | +LL | const X: i32 = { let 0 = 0; 0 }; + | ^ pattern `_` not covered + +error[E0005]: refutable pattern in local binding: `_` not covered + --> $DIR/const-match-check.rs:29:26 + | +LL | const X: i32 = { let 0 = 0; 0 }; + | ^ pattern `_` not covered + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/compile-fail/const-match-check.rs b/src/test/ui/compile-fail-migration/const-match-check.rs index 304eef7847c..304eef7847c 100644 --- a/src/test/compile-fail/const-match-check.rs +++ b/src/test/ui/compile-fail-migration/const-match-check.rs diff --git a/src/test/compile-fail/const-match-pattern-arm.rs b/src/test/ui/compile-fail-migration/const-match-pattern-arm.rs index bc944948f3d..bc944948f3d 100644 --- a/src/test/compile-fail/const-match-pattern-arm.rs +++ b/src/test/ui/compile-fail-migration/const-match-pattern-arm.rs diff --git a/src/test/ui/compile-fail-migration/const-match-pattern-arm.stderr b/src/test/ui/compile-fail-migration/const-match-pattern-arm.stderr new file mode 100644 index 00000000000..201aa7cd5b7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-match-pattern-arm.stderr @@ -0,0 +1,15 @@ +error[E0019]: constant contains unimplemented expression type + --> $DIR/const-match-pattern-arm.rs:14:5 + | +LL | Some(value) => true, + | ^^^^^^^^^^^ + +error[E0019]: constant contains unimplemented expression type + --> $DIR/const-match-pattern-arm.rs:21:9 + | +LL | Some(value) => true, + | ^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0019`. diff --git a/src/test/compile-fail/const-size_of-cycle.rs b/src/test/ui/compile-fail-migration/const-size_of-cycle.rs index fed8e1885de..fed8e1885de 100644 --- a/src/test/compile-fail/const-size_of-cycle.rs +++ b/src/test/ui/compile-fail-migration/const-size_of-cycle.rs diff --git a/src/test/ui/compile-fail-migration/const-size_of-cycle.stderr b/src/test/ui/compile-fail-migration/const-size_of-cycle.stderr new file mode 100644 index 00000000000..b10dd509e0b --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-size_of-cycle.stderr @@ -0,0 +1,18 @@ +error[E0391]: cycle detected when computing layout of `Foo` + | +note: ...which requires normalizing `ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: All }, value: [u8; _] }`... +note: ...which requires const-evaluating `Foo::bytes::{{constant}}`... + --> $SRC_DIR/libcore/mem.rs:323:14 + | +LL | unsafe { intrinsics::size_of::<T>() } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: ...which again requires computing layout of `Foo`, completing the cycle +note: cycle used when const-evaluating `Foo::bytes::{{constant}}` + --> $SRC_DIR/libcore/mem.rs:323:14 + | +LL | unsafe { intrinsics::size_of::<T>() } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/compile-fail/const-slice-oob.rs b/src/test/ui/compile-fail-migration/const-slice-oob.rs index 6d51ff30998..6d51ff30998 100644 --- a/src/test/compile-fail/const-slice-oob.rs +++ b/src/test/ui/compile-fail-migration/const-slice-oob.rs diff --git a/src/test/ui/compile-fail-migration/const-slice-oob.stderr b/src/test/ui/compile-fail-migration/const-slice-oob.stderr new file mode 100644 index 00000000000..30260c36ffd --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-slice-oob.stderr @@ -0,0 +1,12 @@ +error: this constant cannot be used + --> $DIR/const-slice-oob.rs:14:1 + | +LL | const BAR: u32 = FOO[5]; + | ^^^^^^^^^^^^^^^^^------^ + | | + | index out of bounds: the len is 3 but the index is 5 + | + = note: #[deny(const_err)] on by default + +error: aborting due to previous error + diff --git a/src/test/compile-fail/const-tup-index-span.rs b/src/test/ui/compile-fail-migration/const-tup-index-span.rs index b42c440f87d..b42c440f87d 100644 --- a/src/test/compile-fail/const-tup-index-span.rs +++ b/src/test/ui/compile-fail-migration/const-tup-index-span.rs diff --git a/src/test/ui/compile-fail-migration/const-tup-index-span.stderr b/src/test/ui/compile-fail-migration/const-tup-index-span.stderr new file mode 100644 index 00000000000..e9248629656 --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-tup-index-span.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/const-tup-index-span.rs:13:23 + | +LL | const TUP: (usize,) = 5usize << 64; + | ^^^^^^^^^^^^ expected tuple, found usize + | + = note: expected type `(usize,)` + found type `usize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/const-typeid-of.rs b/src/test/ui/compile-fail-migration/const-typeid-of.rs index 401125cef09..401125cef09 100644 --- a/src/test/compile-fail/const-typeid-of.rs +++ b/src/test/ui/compile-fail-migration/const-typeid-of.rs diff --git a/src/test/ui/compile-fail-migration/const-typeid-of.stderr b/src/test/ui/compile-fail-migration/const-typeid-of.stderr new file mode 100644 index 00000000000..d13ced9a10a --- /dev/null +++ b/src/test/ui/compile-fail-migration/const-typeid-of.stderr @@ -0,0 +1,10 @@ +error: `std::any::TypeId::of` is not yet stable as a const fn + --> $DIR/const-typeid-of.rs:16:26 + | +LL | const A_ID: TypeId = TypeId::of::<A>(); + | ^^^^^^^^^^^^^^^^^ + | + = help: in Nightly builds, add `#![feature(const_type_id)]` to the crate attributes to enable + +error: aborting due to previous error + diff --git a/src/test/compile-fail/constructor-lifetime-args.rs b/src/test/ui/compile-fail-migration/constructor-lifetime-args.rs index 50db9707355..50db9707355 100644 --- a/src/test/compile-fail/constructor-lifetime-args.rs +++ b/src/test/ui/compile-fail-migration/constructor-lifetime-args.rs diff --git a/src/test/ui/compile-fail-migration/constructor-lifetime-args.stderr b/src/test/ui/compile-fail-migration/constructor-lifetime-args.stderr new file mode 100644 index 00000000000..1710594d255 --- /dev/null +++ b/src/test/ui/compile-fail-migration/constructor-lifetime-args.stderr @@ -0,0 +1,28 @@ +error[E0090]: too few lifetime parameters provided: expected 2 lifetime parameters, found 1 lifetime parameter + --> $DIR/constructor-lifetime-args.rs:27:5 + | +LL | S::<'static>(&0, &0); + | ^^^^^^^^^^^^ expected 2 lifetime parameters + +error[E0088]: too many lifetime parameters provided: expected at most 2 lifetime parameters, found 3 lifetime parameters + --> $DIR/constructor-lifetime-args.rs:29:27 + | +LL | S::<'static, 'static, 'static>(&0, &0); + | ^^^^^^^ expected 2 lifetime parameters + +error[E0090]: too few lifetime parameters provided: expected 2 lifetime parameters, found 1 lifetime parameter + --> $DIR/constructor-lifetime-args.rs:32:5 + | +LL | E::V::<'static>(&0); + | ^^^^^^^^^^^^^^^ expected 2 lifetime parameters + +error[E0088]: too many lifetime parameters provided: expected at most 2 lifetime parameters, found 3 lifetime parameters + --> $DIR/constructor-lifetime-args.rs:34:30 + | +LL | E::V::<'static, 'static, 'static>(&0); + | ^^^^^^^ expected 2 lifetime parameters + +error: aborting due to 4 previous errors + +Some errors occurred: E0088, E0090. +For more information about an error, try `rustc --explain E0088`. diff --git a/src/test/compile-fail/copy-a-resource.rs b/src/test/ui/compile-fail-migration/copy-a-resource.rs index 70633c92e64..70633c92e64 100644 --- a/src/test/compile-fail/copy-a-resource.rs +++ b/src/test/ui/compile-fail-migration/copy-a-resource.rs diff --git a/src/test/ui/compile-fail-migration/copy-a-resource.stderr b/src/test/ui/compile-fail-migration/copy-a-resource.stderr new file mode 100644 index 00000000000..6d8d4884d73 --- /dev/null +++ b/src/test/ui/compile-fail-migration/copy-a-resource.stderr @@ -0,0 +1,16 @@ +error[E0599]: no method named `clone` found for type `foo` in the current scope + --> $DIR/copy-a-resource.rs:28:16 + | +LL | struct foo { + | ---------- method `clone` not found for this +... +LL | let _y = x.clone(); + | ^^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `clone`, perhaps you need to implement it: + candidate #1: `std::clone::Clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/crate-name-mismatch.rs b/src/test/ui/compile-fail-migration/crate-name-mismatch.rs index 589c0beb760..589c0beb760 100644 --- a/src/test/compile-fail/crate-name-mismatch.rs +++ b/src/test/ui/compile-fail-migration/crate-name-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/crate-name-mismatch.stderr b/src/test/ui/compile-fail-migration/crate-name-mismatch.stderr new file mode 100644 index 00000000000..26ef91ba8e7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/crate-name-mismatch.stderr @@ -0,0 +1,8 @@ +error: --crate-name and #[crate_name] are required to match, but `foo` != `bar` + --> $DIR/crate-name-mismatch.rs:13:1 + | +LL | #![crate_name = "bar"] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/crateresolve1.nll.stderr b/src/test/ui/compile-fail-migration/crateresolve1.nll.stderr new file mode 100644 index 00000000000..536293e0a5d --- /dev/null +++ b/src/test/ui/compile-fail-migration/crateresolve1.nll.stderr @@ -0,0 +1,21 @@ +error[E0464]: multiple matching crates for `crateresolve1` + --> $DIR/crateresolve1.rs:16:1 + | +LL | extern crate crateresolve1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: candidates: + crate `crateresolve1`: /home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/crateresolve1.nll/auxiliary/libcrateresolve1-1.so + crate `crateresolve1`: /home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/crateresolve1.nll/auxiliary/libcrateresolve1-3.so + crate `crateresolve1`: /home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/crateresolve1.nll/auxiliary/libcrateresolve1-2.so + +error[E0463]: can't find crate for `crateresolve1` + --> $DIR/crateresolve1.rs:16:1 + | +LL | extern crate crateresolve1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate + +error: aborting due to 2 previous errors + +Some errors occurred: E0463, E0464. +For more information about an error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/crateresolve1.rs b/src/test/ui/compile-fail-migration/crateresolve1.rs index 8c3dbda6802..8c3dbda6802 100644 --- a/src/test/compile-fail/crateresolve1.rs +++ b/src/test/ui/compile-fail-migration/crateresolve1.rs diff --git a/src/test/ui/compile-fail-migration/crateresolve1.stderr b/src/test/ui/compile-fail-migration/crateresolve1.stderr new file mode 100644 index 00000000000..7dadcfe52ee --- /dev/null +++ b/src/test/ui/compile-fail-migration/crateresolve1.stderr @@ -0,0 +1,21 @@ +error[E0464]: multiple matching crates for `crateresolve1` + --> $DIR/crateresolve1.rs:16:1 + | +LL | extern crate crateresolve1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: candidates: + crate `crateresolve1`: /home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/crateresolve1/auxiliary/libcrateresolve1-1.so + crate `crateresolve1`: /home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/crateresolve1/auxiliary/libcrateresolve1-3.so + crate `crateresolve1`: /home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/crateresolve1/auxiliary/libcrateresolve1-2.so + +error[E0463]: can't find crate for `crateresolve1` + --> $DIR/crateresolve1.rs:16:1 + | +LL | extern crate crateresolve1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate + +error: aborting due to 2 previous errors + +Some errors occurred: E0463, E0464. +For more information about an error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/cross-borrow-trait.rs b/src/test/ui/compile-fail-migration/cross-borrow-trait.rs index 7c76cf475d2..7c76cf475d2 100644 --- a/src/test/compile-fail/cross-borrow-trait.rs +++ b/src/test/ui/compile-fail-migration/cross-borrow-trait.rs diff --git a/src/test/ui/compile-fail-migration/cross-borrow-trait.stderr b/src/test/ui/compile-fail-migration/cross-borrow-trait.stderr new file mode 100644 index 00000000000..d25316d542a --- /dev/null +++ b/src/test/ui/compile-fail-migration/cross-borrow-trait.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/cross-borrow-trait.rs:20:22 + | +LL | let _y: &Trait = x; //~ ERROR E0308 + | ^ + | | + | expected &dyn Trait, found struct `std::boxed::Box` + | help: consider borrowing here: `&x` + | + = note: expected type `&dyn Trait` + found type `std::boxed::Box<dyn Trait>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/cross-fn-cache-hole.rs b/src/test/ui/compile-fail-migration/cross-fn-cache-hole.rs index d437fc019fd..d437fc019fd 100644 --- a/src/test/compile-fail/cross-fn-cache-hole.rs +++ b/src/test/ui/compile-fail-migration/cross-fn-cache-hole.rs diff --git a/src/test/ui/compile-fail-migration/cross-fn-cache-hole.stderr b/src/test/ui/compile-fail-migration/cross-fn-cache-hole.stderr new file mode 100644 index 00000000000..bfcb83204bb --- /dev/null +++ b/src/test/ui/compile-fail-migration/cross-fn-cache-hole.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `i32: Bar<u32>` is not satisfied + --> $DIR/cross-fn-cache-hole.rs:25:1 + | +LL | / fn vacuous<A>() //~ ERROR the trait bound `i32: Bar<u32>` is not satisfied +LL | | where i32: Foo<u32, A> +LL | | { +LL | | // ... the original intention was to check that we don't use that +... | +LL | | require::<i32, u32>(); +LL | | } + | |_^ the trait `Bar<u32>` is not implemented for `i32` + | + = help: see issue #48214 + = help: add #![feature(trivial_bounds)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/custom_attribute.rs b/src/test/ui/compile-fail-migration/custom_attribute.rs index eff734230ee..eff734230ee 100644 --- a/src/test/compile-fail/custom_attribute.rs +++ b/src/test/ui/compile-fail-migration/custom_attribute.rs diff --git a/src/test/ui/compile-fail-migration/custom_attribute.stderr b/src/test/ui/compile-fail-migration/custom_attribute.stderr new file mode 100644 index 00000000000..7d2a23b7054 --- /dev/null +++ b/src/test/ui/compile-fail-migration/custom_attribute.stderr @@ -0,0 +1,27 @@ +error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/custom_attribute.rs:15:5 + | +LL | #[foo] //~ ERROR The attribute `foo` + | ^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/custom_attribute.rs:17:5 + | +LL | #[foo] //~ ERROR The attribute `foo` + | ^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/custom_attribute.rs:13:1 + | +LL | #[foo] //~ ERROR The attribute `foo` + | ^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/cycle-projection-based-on-where-clause.rs b/src/test/ui/compile-fail-migration/cycle-projection-based-on-where-clause.rs index 56ad1771e00..56ad1771e00 100644 --- a/src/test/compile-fail/cycle-projection-based-on-where-clause.rs +++ b/src/test/ui/compile-fail-migration/cycle-projection-based-on-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/cycle-projection-based-on-where-clause.stderr b/src/test/ui/compile-fail-migration/cycle-projection-based-on-where-clause.stderr new file mode 100644 index 00000000000..c7147bcddc4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cycle-projection-based-on-where-clause.stderr @@ -0,0 +1,23 @@ +error[E0391]: cycle detected when computing the bounds for type parameter `T` + --> $DIR/cycle-projection-based-on-where-clause.rs:27:19 + | +LL | T : Add<T::Item> + | ^^^^^^^ + | + = note: ...which again requires computing the bounds for type parameter `T`, completing the cycle +note: cycle used when processing `A` + --> $DIR/cycle-projection-based-on-where-clause.rs:27:19 + | +LL | T : Add<T::Item> + | ^^^^^^^ + +error[E0220]: associated type `Item` not found for `T` + --> $DIR/cycle-projection-based-on-where-clause.rs:27:19 + | +LL | T : Add<T::Item> + | ^^^^^^^ associated type `Item` not found + +error: aborting due to 2 previous errors + +Some errors occurred: E0220, E0391. +For more information about an error, try `rustc --explain E0220`. diff --git a/src/test/compile-fail/cycle-trait-default-type-trait.rs b/src/test/ui/compile-fail-migration/cycle-trait-default-type-trait.rs index b8bae215456..b8bae215456 100644 --- a/src/test/compile-fail/cycle-trait-default-type-trait.rs +++ b/src/test/ui/compile-fail-migration/cycle-trait-default-type-trait.rs diff --git a/src/test/ui/compile-fail-migration/cycle-trait-default-type-trait.stderr b/src/test/ui/compile-fail-migration/cycle-trait-default-type-trait.stderr new file mode 100644 index 00000000000..767a99a3265 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cycle-trait-default-type-trait.stderr @@ -0,0 +1,11 @@ +error[E0391]: cycle detected when processing `Foo::X` + --> $DIR/cycle-trait-default-type-trait.rs:14:19 + | +LL | trait Foo<X = Box<Foo>> { + | ^^^ + | + = note: ...which again requires processing `Foo::X`, completing the cycle + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/compile-fail/cycle-trait-supertrait-direct.rs b/src/test/ui/compile-fail-migration/cycle-trait-supertrait-direct.rs index b802463fcb0..b802463fcb0 100644 --- a/src/test/compile-fail/cycle-trait-supertrait-direct.rs +++ b/src/test/ui/compile-fail-migration/cycle-trait-supertrait-direct.rs diff --git a/src/test/ui/compile-fail-migration/cycle-trait-supertrait-direct.stderr b/src/test/ui/compile-fail-migration/cycle-trait-supertrait-direct.stderr new file mode 100644 index 00000000000..724d4b1ec67 --- /dev/null +++ b/src/test/ui/compile-fail-migration/cycle-trait-supertrait-direct.stderr @@ -0,0 +1,11 @@ +error[E0391]: cycle detected when computing the supertraits of `Chromosome` + --> $DIR/cycle-trait-supertrait-direct.rs:13:1 + | +LL | trait Chromosome: Chromosome { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: ...which again requires computing the supertraits of `Chromosome`, completing the cycle + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/compile-fail/dead-code-closure-bang.rs b/src/test/ui/compile-fail-migration/dead-code-closure-bang.rs index d808d797272..d808d797272 100644 --- a/src/test/compile-fail/dead-code-closure-bang.rs +++ b/src/test/ui/compile-fail-migration/dead-code-closure-bang.rs diff --git a/src/test/compile-fail/dead-code-ret.rs b/src/test/ui/compile-fail-migration/dead-code-ret.rs index 250d22db374..250d22db374 100644 --- a/src/test/compile-fail/dead-code-ret.rs +++ b/src/test/ui/compile-fail-migration/dead-code-ret.rs diff --git a/src/test/ui/compile-fail-migration/dead-code-ret.stderr b/src/test/ui/compile-fail-migration/dead-code-ret.stderr new file mode 100644 index 00000000000..9f940166966 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dead-code-ret.stderr @@ -0,0 +1,15 @@ +error: unreachable statement + --> $DIR/dead-code-ret.rs:17:5 + | +LL | println!("Paul is dead"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/dead-code-ret.rs:13:9 + | +LL | #![deny(unreachable_code)] + | ^^^^^^^^^^^^^^^^ + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + diff --git a/src/test/compile-fail/defaulted-never-note.rs b/src/test/ui/compile-fail-migration/defaulted-never-note.rs index ac8ac85824e..ac8ac85824e 100644 --- a/src/test/compile-fail/defaulted-never-note.rs +++ b/src/test/ui/compile-fail-migration/defaulted-never-note.rs diff --git a/src/test/ui/compile-fail-migration/defaulted-never-note.stderr b/src/test/ui/compile-fail-migration/defaulted-never-note.stderr new file mode 100644 index 00000000000..32922354fe6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/defaulted-never-note.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `!: ImplementedForUnitButNotNever` is not satisfied + --> $DIR/defaulted-never-note.rs:36:5 + | +LL | foo(_x); + | ^^^ the trait `ImplementedForUnitButNotNever` is not implemented for `!` + | + = note: the trait is implemented for `()`. Possibly this error has been caused by changes to Rust's type-inference algorithm (see: https://github.com/rust-lang/rust/issues/48950 for more info). Consider whether you meant to use the type `()` here instead. +note: required by `foo` + --> $DIR/defaulted-never-note.rs:31:1 + | +LL | fn foo<T: ImplementedForUnitButNotNever>(_t: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/dep-graph-assoc-type-codegen.rs b/src/test/ui/compile-fail-migration/dep-graph-assoc-type-codegen.rs index c20cfbc7e23..c20cfbc7e23 100644 --- a/src/test/compile-fail/dep-graph-assoc-type-codegen.rs +++ b/src/test/ui/compile-fail-migration/dep-graph-assoc-type-codegen.rs diff --git a/src/test/ui/compile-fail-migration/dep-graph-assoc-type-codegen.stderr b/src/test/ui/compile-fail-migration/dep-graph-assoc-type-codegen.stderr new file mode 100644 index 00000000000..e00b3ccf281 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dep-graph-assoc-type-codegen.stderr @@ -0,0 +1,8 @@ +error: OK + --> $DIR/dep-graph-assoc-type-codegen.rs:38:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/dep-graph-caller-callee.rs b/src/test/ui/compile-fail-migration/dep-graph-caller-callee.rs index 222c1972005..222c1972005 100644 --- a/src/test/compile-fail/dep-graph-caller-callee.rs +++ b/src/test/ui/compile-fail-migration/dep-graph-caller-callee.rs diff --git a/src/test/ui/compile-fail-migration/dep-graph-caller-callee.stderr b/src/test/ui/compile-fail-migration/dep-graph-caller-callee.stderr new file mode 100644 index 00000000000..8943b051c12 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dep-graph-caller-callee.stderr @@ -0,0 +1,14 @@ +error: OK + --> $DIR/dep-graph-caller-callee.rs:30:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `x::x` to `TypeckTables` + --> $DIR/dep-graph-caller-callee.rs:41:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/dep-graph-struct-signature.rs b/src/test/ui/compile-fail-migration/dep-graph-struct-signature.rs index 647605ae438..647605ae438 100644 --- a/src/test/compile-fail/dep-graph-struct-signature.rs +++ b/src/test/ui/compile-fail-migration/dep-graph-struct-signature.rs diff --git a/src/test/ui/compile-fail-migration/dep-graph-struct-signature.stderr b/src/test/ui/compile-fail-migration/dep-graph-struct-signature.stderr new file mode 100644 index 00000000000..cbb695d0cf2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dep-graph-struct-signature.stderr @@ -0,0 +1,140 @@ +error: no path from `WillChange` to `TypeOfItem` + --> $DIR/dep-graph-struct-signature.rs:37:5 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `WillChange` to `AssociatedItems` + --> $DIR/dep-graph-struct-signature.rs:38:5 + | +LL | #[rustc_then_this_would_need(AssociatedItems)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `WillChange` to `TraitDefOfItem` + --> $DIR/dep-graph-struct-signature.rs:39:5 + | +LL | #[rustc_then_this_would_need(TraitDefOfItem)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:45:5 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:46:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:49:5 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:50:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:55:5 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:62:5 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:70:9 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:72:9 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `WillChange` to `TypeOfItem` + --> $DIR/dep-graph-struct-signature.rs:77:5 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `WillChange` to `TypeOfItem` + --> $DIR/dep-graph-struct-signature.rs:84:5 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `WillChange` to `FnSignature` + --> $DIR/dep-graph-struct-signature.rs:90:5 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `WillChange` to `TypeckTables` + --> $DIR/dep-graph-struct-signature.rs:91:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `WillChange` to `FnSignature` + --> $DIR/dep-graph-struct-signature.rs:94:5 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path from `WillChange` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `WillChange` to `TypeckTables` + --> $DIR/dep-graph-struct-signature.rs:95:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path from `WillChange` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:41:9 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `WillChange` to `FnSignature` + --> $DIR/dep-graph-struct-signature.rs:86:9 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:57:9 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:58:9 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:64:9 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-struct-signature.rs:65:9 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 23 previous errors + diff --git a/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs b/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits-same-method.rs index 7dd02f57b36..7dd02f57b36 100644 --- a/src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs +++ b/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits-same-method.rs diff --git a/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits-same-method.stderr b/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits-same-method.stderr new file mode 100644 index 00000000000..877a056019f --- /dev/null +++ b/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits-same-method.stderr @@ -0,0 +1,14 @@ +error: OK + --> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:42:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `x::<impl Foo for u32>` to `TypeckTables` + --> $DIR/dep-graph-trait-impl-two-traits-same-method.rs:51:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/dep-graph-trait-impl-two-traits.rs b/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits.rs index 6b3525333bc..6b3525333bc 100644 --- a/src/test/compile-fail/dep-graph-trait-impl-two-traits.rs +++ b/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits.rs diff --git a/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits.stderr b/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits.stderr new file mode 100644 index 00000000000..f939fac3146 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dep-graph-trait-impl-two-traits.stderr @@ -0,0 +1,14 @@ +error: no path from `x::<impl Foo for char>` to `TypeckTables` + --> $DIR/dep-graph-trait-impl-two-traits.rs:41:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `x::<impl Foo for char>` to `TypeckTables` + --> $DIR/dep-graph-trait-impl-two-traits.rs:50:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/dep-graph-trait-impl.rs b/src/test/ui/compile-fail-migration/dep-graph-trait-impl.rs index 85b3e69065d..85b3e69065d 100644 --- a/src/test/compile-fail/dep-graph-trait-impl.rs +++ b/src/test/ui/compile-fail-migration/dep-graph-trait-impl.rs diff --git a/src/test/ui/compile-fail-migration/dep-graph-trait-impl.stderr b/src/test/ui/compile-fail-migration/dep-graph-trait-impl.stderr new file mode 100644 index 00000000000..c569e8584e7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dep-graph-trait-impl.stderr @@ -0,0 +1,32 @@ +error: OK + --> $DIR/dep-graph-trait-impl.rs:37:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-trait-impl.rs:42:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-trait-impl.rs:47:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-trait-impl.rs:52:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `x::<impl Foo for char>` to `TypeckTables` + --> $DIR/dep-graph-trait-impl.rs:65:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/dep-graph-type-alias.rs b/src/test/ui/compile-fail-migration/dep-graph-type-alias.rs index dca1fa4d98f..dca1fa4d98f 100644 --- a/src/test/compile-fail/dep-graph-type-alias.rs +++ b/src/test/ui/compile-fail-migration/dep-graph-type-alias.rs diff --git a/src/test/ui/compile-fail-migration/dep-graph-type-alias.stderr b/src/test/ui/compile-fail-migration/dep-graph-type-alias.stderr new file mode 100644 index 00000000000..b018c250667 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dep-graph-type-alias.stderr @@ -0,0 +1,74 @@ +error: no path from `TypeAlias` to `TypeOfItem` + --> $DIR/dep-graph-type-alias.rs:28:1 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-type-alias.rs:30:5 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `TypeAlias` to `TypeOfItem` + --> $DIR/dep-graph-type-alias.rs:35:1 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-type-alias.rs:38:9 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `TypeAlias` to `TypeOfItem` + --> $DIR/dep-graph-type-alias.rs:44:1 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: no path from `TypeAlias` to `TypeOfItem` + --> $DIR/dep-graph-type-alias.rs:52:1 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR no path + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-type-alias.rs:59:1 + | +LL | #[rustc_then_this_would_need(TypeOfItem)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-type-alias.rs:62:1 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-type-alias.rs:63:1 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-type-alias.rs:46:5 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-type-alias.rs:54:5 + | +LL | #[rustc_then_this_would_need(FnSignature)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: OK + --> $DIR/dep-graph-type-alias.rs:55:5 + | +LL | #[rustc_then_this_would_need(TypeckTables)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 12 previous errors + diff --git a/src/test/compile-fail/dep-graph-variance-alias.rs b/src/test/ui/compile-fail-migration/dep-graph-variance-alias.rs index 18cfd001804..18cfd001804 100644 --- a/src/test/compile-fail/dep-graph-variance-alias.rs +++ b/src/test/ui/compile-fail-migration/dep-graph-variance-alias.rs diff --git a/src/test/ui/compile-fail-migration/dep-graph-variance-alias.stderr b/src/test/ui/compile-fail-migration/dep-graph-variance-alias.stderr new file mode 100644 index 00000000000..a3b12013906 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dep-graph-variance-alias.stderr @@ -0,0 +1,8 @@ +error: OK + --> $DIR/dep-graph-variance-alias.rs:29:1 + | +LL | #[rustc_then_this_would_need(ItemVariances)] //~ ERROR OK + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/deprecated_no_stack_check.rs b/src/test/ui/compile-fail-migration/deprecated_no_stack_check.rs index 38aaefd52b3..38aaefd52b3 100644 --- a/src/test/compile-fail/deprecated_no_stack_check.rs +++ b/src/test/ui/compile-fail-migration/deprecated_no_stack_check.rs diff --git a/src/test/ui/compile-fail-migration/deprecated_no_stack_check.stderr b/src/test/ui/compile-fail-migration/deprecated_no_stack_check.stderr new file mode 100644 index 00000000000..2f847a253e4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deprecated_no_stack_check.stderr @@ -0,0 +1,9 @@ +error[E0557]: feature has been removed + --> $DIR/deprecated_no_stack_check.rs:12:12 + | +LL | #![feature(no_stack_check)] + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0557`. diff --git a/src/test/compile-fail/deprecation-in-staged-api.rs b/src/test/ui/compile-fail-migration/deprecation-in-staged-api.rs index 5c6facbf014..5c6facbf014 100644 --- a/src/test/compile-fail/deprecation-in-staged-api.rs +++ b/src/test/ui/compile-fail-migration/deprecation-in-staged-api.rs diff --git a/src/test/ui/compile-fail-migration/deprecation-in-staged-api.stderr b/src/test/ui/compile-fail-migration/deprecation-in-staged-api.stderr new file mode 100644 index 00000000000..9ad56585015 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deprecation-in-staged-api.stderr @@ -0,0 +1,8 @@ +error: `#[deprecated]` cannot be used in staged api, use `#[rustc_deprecated]` instead + --> $DIR/deprecation-in-staged-api.rs:18:1 + | +LL | fn main() { } //~ERROR `#[deprecated]` cannot be used in staged api + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/deprecation-lint-2.rs b/src/test/ui/compile-fail-migration/deprecation-lint-2.rs index 2817e06652a..2817e06652a 100644 --- a/src/test/compile-fail/deprecation-lint-2.rs +++ b/src/test/ui/compile-fail-migration/deprecation-lint-2.rs diff --git a/src/test/ui/compile-fail-migration/deprecation-lint-2.stderr b/src/test/ui/compile-fail-migration/deprecation-lint-2.stderr new file mode 100644 index 00000000000..fedc6b22f32 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deprecation-lint-2.stderr @@ -0,0 +1,15 @@ +error: use of deprecated item 'deprecation_lint::deprecated': text + --> $DIR/deprecation-lint-2.rs:22:5 + | +LL | macro_test!(); + | ^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/deprecation-lint-2.rs:14:9 + | +LL | #![deny(deprecated)] + | ^^^^^^^^^^ + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + diff --git a/src/test/compile-fail/deprecation-lint-3.rs b/src/test/ui/compile-fail-migration/deprecation-lint-3.rs index 7faaa181d39..7faaa181d39 100644 --- a/src/test/compile-fail/deprecation-lint-3.rs +++ b/src/test/ui/compile-fail-migration/deprecation-lint-3.rs diff --git a/src/test/ui/compile-fail-migration/deprecation-lint-3.stderr b/src/test/ui/compile-fail-migration/deprecation-lint-3.stderr new file mode 100644 index 00000000000..9dfc44ebc61 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deprecation-lint-3.stderr @@ -0,0 +1,15 @@ +error: use of deprecated item 'deprecation_lint::deprecated_text': text + --> $DIR/deprecation-lint-3.rs:23:5 + | +LL | macro_test_arg_nested!(deprecated_text); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/deprecation-lint-3.rs:14:9 + | +LL | #![deny(deprecated)] + | ^^^^^^^^^^ + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + diff --git a/src/test/compile-fail/deprecation-lint-nested.rs b/src/test/ui/compile-fail-migration/deprecation-lint-nested.rs index eedbba59c6f..eedbba59c6f 100644 --- a/src/test/compile-fail/deprecation-lint-nested.rs +++ b/src/test/ui/compile-fail-migration/deprecation-lint-nested.rs diff --git a/src/test/ui/compile-fail-migration/deprecation-lint-nested.stderr b/src/test/ui/compile-fail-migration/deprecation-lint-nested.stderr new file mode 100644 index 00000000000..4e2b462fd1b --- /dev/null +++ b/src/test/ui/compile-fail-migration/deprecation-lint-nested.stderr @@ -0,0 +1,44 @@ +error: use of deprecated item 'loud::DeprecatedType' + --> $DIR/deprecation-lint-nested.rs:65:16 + | +LL | struct Foo(DeprecatedType); //~ ERROR use of deprecated item + | ^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/deprecation-lint-nested.rs:11:9 + | +LL | #![deny(deprecated)] + | ^^^^^^^^^^ + +error: use of deprecated item 'loud::DeprecatedTrait' + --> $DIR/deprecation-lint-nested.rs:67:10 + | +LL | impl DeprecatedTrait for Foo {} //~ ERROR use of deprecated item + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'loud::DEPRECATED_STATIC' + --> $DIR/deprecation-lint-nested.rs:76:9 + | +LL | DEPRECATED_STATIC + //~ ERROR use of deprecated item + | ^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'loud::DEPRECATED_CONST' + --> $DIR/deprecation-lint-nested.rs:77:9 + | +LL | DEPRECATED_CONST //~ ERROR use of deprecated item + | ^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'loud::DeprecatedTrait' + --> $DIR/deprecation-lint-nested.rs:70:19 + | +LL | fn bar<T: DeprecatedTrait>() { //~ ERROR use of deprecated item + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'loud::deprecated_fn' + --> $DIR/deprecation-lint-nested.rs:71:13 + | +LL | deprecated_fn(); //~ ERROR use of deprecated item + | ^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + diff --git a/src/test/compile-fail/deprecation-lint.rs b/src/test/ui/compile-fail-migration/deprecation-lint.rs index 93eb6b6b115..93eb6b6b115 100644 --- a/src/test/compile-fail/deprecation-lint.rs +++ b/src/test/ui/compile-fail-migration/deprecation-lint.rs diff --git a/src/test/ui/compile-fail-migration/deprecation-lint.stderr b/src/test/ui/compile-fail-migration/deprecation-lint.stderr new file mode 100644 index 00000000000..addca669917 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deprecation-lint.stderr @@ -0,0 +1,728 @@ +error: use of deprecated item 'deprecation_lint::deprecated': text + --> $DIR/deprecation-lint.rs:27:9 + | +LL | deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::deprecated' + | ^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/deprecation-lint.rs:14:9 + | +LL | #![deny(deprecated)] + | ^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:32:9 + | +LL | Trait::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:34:9 + | +LL | <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::deprecated_text': text + --> $DIR/deprecation-lint.rs:36:9 + | +LL | deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::deprecated_text': text + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:41:9 + | +LL | Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:43:9 + | +LL | <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::DeprecatedStruct': text + --> $DIR/deprecation-lint.rs:45:17 + | +LL | let _ = DeprecatedStruct { //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedStruct': text + | ^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::DeprecatedUnitStruct': text + --> $DIR/deprecation-lint.rs:49:17 + | +LL | let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedUnitStruct': text + | ^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Enum::DeprecatedVariant': text + --> $DIR/deprecation-lint.rs:51:17 + | +LL | let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item 'deprecation_lint::Enum::DeprecatedVariant': text + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::DeprecatedTupleStruct': text + --> $DIR/deprecation-lint.rs:53:17 + | +LL | let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedTupleStruct': text + | ^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::nested::DeprecatedStruct': text + --> $DIR/deprecation-lint.rs:55:17 + | +LL | let _ = nested::DeprecatedStruct { //~ ERROR use of deprecated item 'deprecation_lint::nested::DeprecatedStruct': text + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::nested::DeprecatedUnitStruct': text + --> $DIR/deprecation-lint.rs:59:17 + | +LL | let _ = nested::DeprecatedUnitStruct; //~ ERROR use of deprecated item 'deprecation_lint::nested::DeprecatedUnitStruct': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::nested::Enum::DeprecatedVariant': text + --> $DIR/deprecation-lint.rs:61:17 + | +LL | let _ = nested::Enum::DeprecatedVariant; //~ ERROR use of deprecated item 'deprecation_lint::nested::Enum::DeprecatedVariant': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::nested::DeprecatedTupleStruct': text + --> $DIR/deprecation-lint.rs:63:17 + | +LL | let _ = nested::DeprecatedTupleStruct (1); //~ ERROR use of deprecated item 'deprecation_lint::nested::DeprecatedTupleStruct': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::deprecated_text': text + --> $DIR/deprecation-lint.rs:70:25 + | +LL | macro_test_arg!(deprecated_text()); //~ ERROR use of deprecated item 'deprecation_lint::deprecated_text': text + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::deprecated_text': text + --> $DIR/deprecation-lint.rs:71:41 + | +LL | macro_test_arg!(macro_test_arg!(deprecated_text())); //~ ERROR use of deprecated item 'deprecation_lint::deprecated_text': text + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:76:9 + | +LL | Trait::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:78:9 + | +LL | <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:80:9 + | +LL | Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:82:9 + | +LL | <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::DeprecatedTrait': text + --> $DIR/deprecation-lint.rs:92:10 + | +LL | impl DeprecatedTrait for S {} //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedTrait': text + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::DeprecatedTrait': text + --> $DIR/deprecation-lint.rs:93:24 + | +LL | trait LocalTrait : DeprecatedTrait { } //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedTrait': text + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated': text + --> $DIR/deprecation-lint.rs:124:17 + | +LL | let x = Deprecated { + | ^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated': text + --> $DIR/deprecation-lint.rs:133:13 + | +LL | let Deprecated { + | ^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated': text + --> $DIR/deprecation-lint.rs:139:13 + | +LL | let Deprecated + | ^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated2': text + --> $DIR/deprecation-lint.rs:143:17 + | +LL | let x = Deprecated2(1, 2, 3); + | ^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated2': text + --> $DIR/deprecation-lint.rs:153:13 + | +LL | let Deprecated2 + | ^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated2': text + --> $DIR/deprecation-lint.rs:162:13 + | +LL | let Deprecated2 + | ^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::deprecated_mod::deprecated': text + --> $DIR/deprecation-lint.rs:173:9 + | +LL | deprecated_mod::deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::deprecated_mod::deprecated': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::deprecated': text + --> $DIR/deprecation-lint.rs:256:9 + | +LL | deprecated(); //~ ERROR use of deprecated item 'this_crate::deprecated' + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:261:9 + | +LL | Trait::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:263:9 + | +LL | <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::deprecated_text': text + --> $DIR/deprecation-lint.rs:265:9 + | +LL | deprecated_text(); //~ ERROR use of deprecated item 'this_crate::deprecated_text': text + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:270:9 + | +LL | Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:272:9 + | +LL | <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::DeprecatedStruct': text + --> $DIR/deprecation-lint.rs:277:17 + | +LL | let _ = DeprecatedStruct { + | ^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::DeprecatedUnitStruct': text + --> $DIR/deprecation-lint.rs:282:17 + | +LL | let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item 'this_crate::DeprecatedUnitStruct': text + | ^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Enum::DeprecatedVariant': text + --> $DIR/deprecation-lint.rs:284:17 + | +LL | let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item 'this_crate::Enum::DeprecatedVariant': text + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::DeprecatedTupleStruct': text + --> $DIR/deprecation-lint.rs:286:17 + | +LL | let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item 'this_crate::DeprecatedTupleStruct': text + | ^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::nested::DeprecatedStruct': text + --> $DIR/deprecation-lint.rs:288:17 + | +LL | let _ = nested::DeprecatedStruct { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::nested::DeprecatedUnitStruct': text + --> $DIR/deprecation-lint.rs:293:17 + | +LL | let _ = nested::DeprecatedUnitStruct; //~ ERROR use of deprecated item 'this_crate::nested::DeprecatedUnitStruct': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::nested::Enum::DeprecatedVariant': text + --> $DIR/deprecation-lint.rs:295:17 + | +LL | let _ = nested::Enum::DeprecatedVariant; //~ ERROR use of deprecated item 'this_crate::nested::Enum::DeprecatedVariant': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::nested::DeprecatedTupleStruct': text + --> $DIR/deprecation-lint.rs:297:17 + | +LL | let _ = nested::DeprecatedTupleStruct (1); //~ ERROR use of deprecated item 'this_crate::nested::DeprecatedTupleStruct': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:302:9 + | +LL | Trait::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:304:9 + | +LL | <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:306:9 + | +LL | Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:308:9 + | +LL | <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::test_fn_closure_body::{{closure}}::bar' + --> $DIR/deprecation-lint.rs:326:13 + | +LL | bar(); //~ ERROR use of deprecated item 'this_crate::test_fn_closure_body::{{closure}}::bar' + | ^^^ + +error: use of deprecated item 'this_crate::DeprecatedTrait': text + --> $DIR/deprecation-lint.rs:345:10 + | +LL | impl DeprecatedTrait for S { } //~ ERROR use of deprecated item 'this_crate::DeprecatedTrait': text + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::DeprecatedTrait': text + --> $DIR/deprecation-lint.rs:347:24 + | +LL | trait LocalTrait : DeprecatedTrait { } //~ ERROR use of deprecated item 'this_crate::DeprecatedTrait': text + | ^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Deprecated': text + --> $DIR/deprecation-lint.rs:399:17 + | +LL | let x = Deprecated { + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Deprecated': text + --> $DIR/deprecation-lint.rs:408:13 + | +LL | let Deprecated { + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Deprecated': text + --> $DIR/deprecation-lint.rs:414:13 + | +LL | let Deprecated + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Deprecated2': text + --> $DIR/deprecation-lint.rs:419:17 + | +LL | let x = Deprecated2(1, 2, 3); + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Deprecated2': text + --> $DIR/deprecation-lint.rs:429:13 + | +LL | let Deprecated2 + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Deprecated2': text + --> $DIR/deprecation-lint.rs:438:13 + | +LL | let Deprecated2 + | ^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::MethodTester::method_deprecated': text + --> $DIR/deprecation-lint.rs:28:13 + | +LL | foo.method_deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::MethodTester::method_deprecated': text + --> $DIR/deprecation-lint.rs:29:9 + | +LL | Foo::method_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::MethodTester::method_deprecated': text + --> $DIR/deprecation-lint.rs:30:9 + | +LL | <Foo>::method_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:31:13 + | +LL | foo.trait_deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:33:9 + | +LL | <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::MethodTester::method_deprecated_text': text + --> $DIR/deprecation-lint.rs:37:13 + | +LL | foo.method_deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::MethodTester::method_deprecated_text': text + --> $DIR/deprecation-lint.rs:38:9 + | +LL | Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::MethodTester::method_deprecated_text': text + --> $DIR/deprecation-lint.rs:39:9 + | +LL | <Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:40:13 + | +LL | foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:42:9 + | +LL | <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::DeprecatedStruct::i': text + --> $DIR/deprecation-lint.rs:46:13 + | +LL | i: 0 //~ ERROR use of deprecated item 'deprecation_lint::DeprecatedStruct::i': text + | ^^^^ + +error: use of deprecated item 'deprecation_lint::nested::DeprecatedStruct::i': text + --> $DIR/deprecation-lint.rs:56:13 + | +LL | i: 0 //~ ERROR use of deprecated item 'deprecation_lint::nested::DeprecatedStruct::i': text + | ^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:75:13 + | +LL | foo.trait_deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:77:9 + | +LL | <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:79:13 + | +LL | foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:81:9 + | +LL | <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:86:13 + | +LL | foo.trait_deprecated(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:87:13 + | +LL | foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'deprecation_lint::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Stable::override2': text + --> $DIR/deprecation-lint.rs:97:13 + | +LL | override2: 3, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Stable::override2': text + --> $DIR/deprecation-lint.rs:101:17 + | +LL | let _ = x.override2; + | ^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Stable::override2': text + --> $DIR/deprecation-lint.rs:105:13 + | +LL | override2: _ + | ^^^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Stable2::2': text + --> $DIR/deprecation-lint.rs:113:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'deprecation_lint::Stable2::2': text + --> $DIR/deprecation-lint.rs:118:20 + | +LL | _) + | ^ + +error: use of deprecated item 'deprecation_lint::Deprecated::inherit': text + --> $DIR/deprecation-lint.rs:126:13 + | +LL | inherit: 1, + | ^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated::inherit': text + --> $DIR/deprecation-lint.rs:130:17 + | +LL | let _ = x.inherit; + | ^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated::inherit': text + --> $DIR/deprecation-lint.rs:135:13 + | +LL | inherit: _, + | ^^^^^^^^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated2::0': text + --> $DIR/deprecation-lint.rs:146:17 + | +LL | let _ = x.0; + | ^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated2::1': text + --> $DIR/deprecation-lint.rs:148:17 + | +LL | let _ = x.1; + | ^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated2::2': text + --> $DIR/deprecation-lint.rs:150:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'deprecation_lint::Deprecated2::0': text + --> $DIR/deprecation-lint.rs:155:14 + | +LL | (_, + | ^ + +error: use of deprecated item 'deprecation_lint::Deprecated2::1': text + --> $DIR/deprecation-lint.rs:157:14 + | +LL | _, + | ^ + +error: use of deprecated item 'deprecation_lint::Deprecated2::2': text + --> $DIR/deprecation-lint.rs:159:14 + | +LL | _) + | ^ + +error: use of deprecated item 'this_crate::MethodTester::method_deprecated': text + --> $DIR/deprecation-lint.rs:257:13 + | +LL | foo.method_deprecated(); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::MethodTester::method_deprecated': text + --> $DIR/deprecation-lint.rs:258:9 + | +LL | Foo::method_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::MethodTester::method_deprecated': text + --> $DIR/deprecation-lint.rs:259:9 + | +LL | <Foo>::method_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:260:13 + | +LL | foo.trait_deprecated(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:262:9 + | +LL | <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + --> $DIR/deprecation-lint.rs:266:13 + | +LL | foo.method_deprecated_text(); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + --> $DIR/deprecation-lint.rs:267:9 + | +LL | Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + --> $DIR/deprecation-lint.rs:268:9 + | +LL | <Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:269:13 + | +LL | foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:271:9 + | +LL | <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::DeprecatedStruct::i': text + --> $DIR/deprecation-lint.rs:279:13 + | +LL | i: 0 //~ ERROR use of deprecated item 'this_crate::DeprecatedStruct::i': text + | ^^^^ + +error: use of deprecated item 'this_crate::nested::DeprecatedStruct::i': text + --> $DIR/deprecation-lint.rs:290:13 + | +LL | i: 0 //~ ERROR use of deprecated item 'this_crate::nested::DeprecatedStruct::i': text + | ^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:301:13 + | +LL | foo.trait_deprecated(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:303:9 + | +LL | <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:305:13 + | +LL | foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:307:9 + | +LL | <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/deprecation-lint.rs:312:13 + | +LL | foo.trait_deprecated(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/deprecation-lint.rs:313:13 + | +LL | foo.trait_deprecated_text(); //~ ERROR use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Stable::override2': text + --> $DIR/deprecation-lint.rs:372:13 + | +LL | override2: 3, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Stable::override2': text + --> $DIR/deprecation-lint.rs:376:17 + | +LL | let _ = x.override2; + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Stable::override2': text + --> $DIR/deprecation-lint.rs:380:13 + | +LL | override2: _ + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Stable2::2': text + --> $DIR/deprecation-lint.rs:388:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'this_crate2::Stable2::2': text + --> $DIR/deprecation-lint.rs:393:20 + | +LL | _) + | ^ + +error: use of deprecated item 'this_crate2::Deprecated::inherit': text + --> $DIR/deprecation-lint.rs:401:13 + | +LL | inherit: 1, + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Deprecated::inherit': text + --> $DIR/deprecation-lint.rs:405:17 + | +LL | let _ = x.inherit; + | ^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Deprecated::inherit': text + --> $DIR/deprecation-lint.rs:410:13 + | +LL | inherit: _, + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate2::Deprecated2::0': text + --> $DIR/deprecation-lint.rs:422:17 + | +LL | let _ = x.0; + | ^^^ + +error: use of deprecated item 'this_crate2::Deprecated2::1': text + --> $DIR/deprecation-lint.rs:424:17 + | +LL | let _ = x.1; + | ^^^ + +error: use of deprecated item 'this_crate2::Deprecated2::2': text + --> $DIR/deprecation-lint.rs:426:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'this_crate2::Deprecated2::0': text + --> $DIR/deprecation-lint.rs:431:14 + | +LL | (_, + | ^ + +error: use of deprecated item 'this_crate2::Deprecated2::1': text + --> $DIR/deprecation-lint.rs:433:14 + | +LL | _, + | ^ + +error: use of deprecated item 'this_crate2::Deprecated2::2': text + --> $DIR/deprecation-lint.rs:435:14 + | +LL | _) + | ^ + +error: aborting due to 120 previous errors + diff --git a/src/test/compile-fail/deref-non-pointer.rs b/src/test/ui/compile-fail-migration/deref-non-pointer.rs index 1c711c0145d..1c711c0145d 100644 --- a/src/test/compile-fail/deref-non-pointer.rs +++ b/src/test/ui/compile-fail-migration/deref-non-pointer.rs diff --git a/src/test/ui/compile-fail-migration/deref-non-pointer.stderr b/src/test/ui/compile-fail-migration/deref-non-pointer.stderr new file mode 100644 index 00000000000..3e0ea06123d --- /dev/null +++ b/src/test/ui/compile-fail-migration/deref-non-pointer.stderr @@ -0,0 +1,9 @@ +error[E0614]: type `{integer}` cannot be dereferenced + --> $DIR/deref-non-pointer.rs:12:9 + | +LL | match *1 { //~ ERROR: cannot be dereferenced + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0614`. diff --git a/src/test/compile-fail/derive-assoc-type-not-impl.rs b/src/test/ui/compile-fail-migration/derive-assoc-type-not-impl.rs index 3799f2ffba4..3799f2ffba4 100644 --- a/src/test/compile-fail/derive-assoc-type-not-impl.rs +++ b/src/test/ui/compile-fail-migration/derive-assoc-type-not-impl.rs diff --git a/src/test/ui/compile-fail-migration/derive-assoc-type-not-impl.stderr b/src/test/ui/compile-fail-migration/derive-assoc-type-not-impl.stderr new file mode 100644 index 00000000000..c49e3387661 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derive-assoc-type-not-impl.stderr @@ -0,0 +1,18 @@ +error[E0599]: no method named `clone` found for type `Bar<NotClone>` in the current scope + --> $DIR/derive-assoc-type-not-impl.rs:28:30 + | +LL | struct Bar<T: Foo> { + | ------------------ method `clone` not found for this +... +LL | Bar::<NotClone> { x: 1 }.clone(); //~ ERROR + | ^^^^^ + | + = note: the method `clone` exists but the following trait bounds were not satisfied: + `Bar<NotClone> : std::clone::Clone` + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `clone`, perhaps you need to implement it: + candidate #1: `std::clone::Clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/derive-on-trait-item-or-impl-item.rs b/src/test/ui/compile-fail-migration/derive-on-trait-item-or-impl-item.rs index 9ff1c14f54c..9ff1c14f54c 100644 --- a/src/test/compile-fail/derive-on-trait-item-or-impl-item.rs +++ b/src/test/ui/compile-fail-migration/derive-on-trait-item-or-impl-item.rs diff --git a/src/test/ui/compile-fail-migration/derive-on-trait-item-or-impl-item.stderr b/src/test/ui/compile-fail-migration/derive-on-trait-item-or-impl-item.stderr new file mode 100644 index 00000000000..8246889b620 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derive-on-trait-item-or-impl-item.stderr @@ -0,0 +1,14 @@ +error: `derive` may only be applied to structs, enums and unions + --> $DIR/derive-on-trait-item-or-impl-item.rs:12:5 + | +LL | #[derive(Clone)] + | ^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/derive-on-trait-item-or-impl-item.rs:18:5 + | +LL | #[derive(Clone)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/derived-errors/issue-30580.rs b/src/test/ui/compile-fail-migration/derived-errors/issue-30580.rs index 553ad0a3341..553ad0a3341 100644 --- a/src/test/compile-fail/derived-errors/issue-30580.rs +++ b/src/test/ui/compile-fail-migration/derived-errors/issue-30580.rs diff --git a/src/test/ui/compile-fail-migration/derived-errors/issue-30580.stderr b/src/test/ui/compile-fail-migration/derived-errors/issue-30580.stderr new file mode 100644 index 00000000000..bf9a5a299e3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derived-errors/issue-30580.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `c` on type `&Foo` + --> $DIR/issue-30580.rs:22:11 + | +LL | b.c; //~ ERROR no field `c` on type `&Foo` + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/compile-fail/derived-errors/issue-31997.rs b/src/test/ui/compile-fail-migration/derived-errors/issue-31997.rs index 2e1d3c55a8f..2e1d3c55a8f 100644 --- a/src/test/compile-fail/derived-errors/issue-31997.rs +++ b/src/test/ui/compile-fail-migration/derived-errors/issue-31997.rs diff --git a/src/test/ui/compile-fail-migration/derived-errors/issue-31997.stderr b/src/test/ui/compile-fail-migration/derived-errors/issue-31997.stderr new file mode 100644 index 00000000000..25088e8654b --- /dev/null +++ b/src/test/ui/compile-fail-migration/derived-errors/issue-31997.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find function `bar` in this scope + --> $DIR/issue-31997.rs:23:21 + | +LL | try!(closure(|| bar(0 as *mut _))); //~ ERROR cannot find function `bar` in this scope + | ^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/derives-span-Clone-enum-struct-variant.rs b/src/test/ui/compile-fail-migration/derives-span-Clone-enum-struct-variant.rs index 244acbf6605..244acbf6605 100644 --- a/src/test/compile-fail/derives-span-Clone-enum-struct-variant.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Clone-enum-struct-variant.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Clone-enum-struct-variant.stderr b/src/test/ui/compile-fail-migration/derives-span-Clone-enum-struct-variant.stderr new file mode 100644 index 00000000000..fbe9d3f7d69 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Clone-enum-struct-variant.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::clone::Clone` is not satisfied + --> $DIR/derives-span-Clone-enum-struct-variant.rs:19:6 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ the trait `std::clone::Clone` is not implemented for `Error` + | + = note: required by `std::clone::Clone::clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Clone-enum.rs b/src/test/ui/compile-fail-migration/derives-span-Clone-enum.rs index 785a3d35430..785a3d35430 100644 --- a/src/test/compile-fail/derives-span-Clone-enum.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Clone-enum.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Clone-enum.stderr b/src/test/ui/compile-fail-migration/derives-span-Clone-enum.stderr new file mode 100644 index 00000000000..b5b3c8bfc85 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Clone-enum.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::clone::Clone` is not satisfied + --> $DIR/derives-span-Clone-enum.rs:19:6 + | +LL | Error //~ ERROR + | ^^^^^ the trait `std::clone::Clone` is not implemented for `Error` + | + = note: required by `std::clone::Clone::clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Clone-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Clone-struct.rs index b1b1dc7bed1..b1b1dc7bed1 100644 --- a/src/test/compile-fail/derives-span-Clone-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Clone-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Clone-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Clone-struct.stderr new file mode 100644 index 00000000000..ebd1e666b38 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Clone-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::clone::Clone` is not satisfied + --> $DIR/derives-span-Clone-struct.rs:18:5 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ the trait `std::clone::Clone` is not implemented for `Error` + | + = note: required by `std::clone::Clone::clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Clone-tuple-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Clone-tuple-struct.rs index d56e21b9a8a..d56e21b9a8a 100644 --- a/src/test/compile-fail/derives-span-Clone-tuple-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Clone-tuple-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Clone-tuple-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Clone-tuple-struct.stderr new file mode 100644 index 00000000000..6867baad2c1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Clone-tuple-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::clone::Clone` is not satisfied + --> $DIR/derives-span-Clone-tuple-struct.rs:18:5 + | +LL | Error //~ ERROR + | ^^^^^ the trait `std::clone::Clone` is not implemented for `Error` + | + = note: required by `std::clone::Clone::clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Debug-enum-struct-variant.rs b/src/test/ui/compile-fail-migration/derives-span-Debug-enum-struct-variant.rs index 4c25e482c2a..4c25e482c2a 100644 --- a/src/test/compile-fail/derives-span-Debug-enum-struct-variant.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Debug-enum-struct-variant.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Debug-enum-struct-variant.stderr b/src/test/ui/compile-fail-migration/derives-span-Debug-enum-struct-variant.stderr new file mode 100644 index 00000000000..f5939a2e937 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Debug-enum-struct-variant.stderr @@ -0,0 +1,14 @@ +error[E0277]: `Error` doesn't implement `std::fmt::Debug` + --> $DIR/derives-span-Debug-enum-struct-variant.rs:19:6 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ `Error` cannot be formatted using `{:?}` + | + = help: the trait `std::fmt::Debug` is not implemented for `Error` + = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` + = note: required because of the requirements on the impl of `std::fmt::Debug` for `&Error` + = note: required for the cast to the object type `dyn std::fmt::Debug` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Debug-enum.rs b/src/test/ui/compile-fail-migration/derives-span-Debug-enum.rs index 0cb02aa54e6..0cb02aa54e6 100644 --- a/src/test/compile-fail/derives-span-Debug-enum.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Debug-enum.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Debug-enum.stderr b/src/test/ui/compile-fail-migration/derives-span-Debug-enum.stderr new file mode 100644 index 00000000000..566a5786de7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Debug-enum.stderr @@ -0,0 +1,14 @@ +error[E0277]: `Error` doesn't implement `std::fmt::Debug` + --> $DIR/derives-span-Debug-enum.rs:19:6 + | +LL | Error //~ ERROR + | ^^^^^ `Error` cannot be formatted using `{:?}` + | + = help: the trait `std::fmt::Debug` is not implemented for `Error` + = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` + = note: required because of the requirements on the impl of `std::fmt::Debug` for `&Error` + = note: required for the cast to the object type `dyn std::fmt::Debug` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Debug-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Debug-struct.rs index 33fa82355ec..33fa82355ec 100644 --- a/src/test/compile-fail/derives-span-Debug-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Debug-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Debug-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Debug-struct.stderr new file mode 100644 index 00000000000..30145a78a26 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Debug-struct.stderr @@ -0,0 +1,14 @@ +error[E0277]: `Error` doesn't implement `std::fmt::Debug` + --> $DIR/derives-span-Debug-struct.rs:18:5 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ `Error` cannot be formatted using `{:?}` + | + = help: the trait `std::fmt::Debug` is not implemented for `Error` + = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` + = note: required because of the requirements on the impl of `std::fmt::Debug` for `&Error` + = note: required for the cast to the object type `dyn std::fmt::Debug` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Debug-tuple-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Debug-tuple-struct.rs index 760ed199f6a..760ed199f6a 100644 --- a/src/test/compile-fail/derives-span-Debug-tuple-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Debug-tuple-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Debug-tuple-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Debug-tuple-struct.stderr new file mode 100644 index 00000000000..963fc8a38f0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Debug-tuple-struct.stderr @@ -0,0 +1,14 @@ +error[E0277]: `Error` doesn't implement `std::fmt::Debug` + --> $DIR/derives-span-Debug-tuple-struct.rs:18:5 + | +LL | Error //~ ERROR + | ^^^^^ `Error` cannot be formatted using `{:?}` + | + = help: the trait `std::fmt::Debug` is not implemented for `Error` + = note: add `#[derive(Debug)]` or manually implement `std::fmt::Debug` + = note: required because of the requirements on the impl of `std::fmt::Debug` for `&Error` + = note: required for the cast to the object type `dyn std::fmt::Debug` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Default-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Default-struct.rs index 4adfe75adaf..4adfe75adaf 100644 --- a/src/test/compile-fail/derives-span-Default-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Default-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Default-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Default-struct.stderr new file mode 100644 index 00000000000..a9634e64fa9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Default-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::default::Default` is not satisfied + --> $DIR/derives-span-Default-struct.rs:18:5 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ the trait `std::default::Default` is not implemented for `Error` + | + = note: required by `std::default::Default::default` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Default-tuple-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Default-tuple-struct.rs index a5e3a7cd49f..a5e3a7cd49f 100644 --- a/src/test/compile-fail/derives-span-Default-tuple-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Default-tuple-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Default-tuple-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Default-tuple-struct.stderr new file mode 100644 index 00000000000..eb0ef61a57d --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Default-tuple-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::default::Default` is not satisfied + --> $DIR/derives-span-Default-tuple-struct.rs:18:5 + | +LL | Error //~ ERROR + | ^^^^^ the trait `std::default::Default` is not implemented for `Error` + | + = note: required by `std::default::Default::default` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Eq-enum-struct-variant.rs b/src/test/ui/compile-fail-migration/derives-span-Eq-enum-struct-variant.rs index 6abd1d31e66..6abd1d31e66 100644 --- a/src/test/compile-fail/derives-span-Eq-enum-struct-variant.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Eq-enum-struct-variant.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Eq-enum-struct-variant.stderr b/src/test/ui/compile-fail-migration/derives-span-Eq-enum-struct-variant.stderr new file mode 100644 index 00000000000..b230c014092 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Eq-enum-struct-variant.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::cmp::Eq` is not satisfied + --> $DIR/derives-span-Eq-enum-struct-variant.rs:19:6 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `Error` + | + = note: required by `std::cmp::AssertParamIsEq` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Eq-enum.rs b/src/test/ui/compile-fail-migration/derives-span-Eq-enum.rs index f361278a620..f361278a620 100644 --- a/src/test/compile-fail/derives-span-Eq-enum.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Eq-enum.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Eq-enum.stderr b/src/test/ui/compile-fail-migration/derives-span-Eq-enum.stderr new file mode 100644 index 00000000000..7f6d27a311d --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Eq-enum.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::cmp::Eq` is not satisfied + --> $DIR/derives-span-Eq-enum.rs:19:6 + | +LL | Error //~ ERROR + | ^^^^^ the trait `std::cmp::Eq` is not implemented for `Error` + | + = note: required by `std::cmp::AssertParamIsEq` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Eq-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Eq-struct.rs index 7067caa6d5c..7067caa6d5c 100644 --- a/src/test/compile-fail/derives-span-Eq-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Eq-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Eq-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Eq-struct.stderr new file mode 100644 index 00000000000..a9db0401959 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Eq-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::cmp::Eq` is not satisfied + --> $DIR/derives-span-Eq-struct.rs:18:5 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `Error` + | + = note: required by `std::cmp::AssertParamIsEq` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Eq-tuple-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Eq-tuple-struct.rs index 1a09628b770..1a09628b770 100644 --- a/src/test/compile-fail/derives-span-Eq-tuple-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Eq-tuple-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Eq-tuple-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Eq-tuple-struct.stderr new file mode 100644 index 00000000000..70f39f30eed --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Eq-tuple-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::cmp::Eq` is not satisfied + --> $DIR/derives-span-Eq-tuple-struct.rs:18:5 + | +LL | Error //~ ERROR + | ^^^^^ the trait `std::cmp::Eq` is not implemented for `Error` + | + = note: required by `std::cmp::AssertParamIsEq` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Hash-enum-struct-variant.rs b/src/test/ui/compile-fail-migration/derives-span-Hash-enum-struct-variant.rs index 907045cce47..907045cce47 100644 --- a/src/test/compile-fail/derives-span-Hash-enum-struct-variant.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Hash-enum-struct-variant.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Hash-enum-struct-variant.stderr b/src/test/ui/compile-fail-migration/derives-span-Hash-enum-struct-variant.stderr new file mode 100644 index 00000000000..bde7556f7ce --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Hash-enum-struct-variant.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied + --> $DIR/derives-span-Hash-enum-struct-variant.rs:19:6 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error` + | + = note: required by `std::hash::Hash::hash` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Hash-enum.rs b/src/test/ui/compile-fail-migration/derives-span-Hash-enum.rs index 321b9e71a0f..321b9e71a0f 100644 --- a/src/test/compile-fail/derives-span-Hash-enum.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Hash-enum.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Hash-enum.stderr b/src/test/ui/compile-fail-migration/derives-span-Hash-enum.stderr new file mode 100644 index 00000000000..72b8f3ada02 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Hash-enum.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied + --> $DIR/derives-span-Hash-enum.rs:19:6 + | +LL | Error //~ ERROR + | ^^^^^ the trait `std::hash::Hash` is not implemented for `Error` + | + = note: required by `std::hash::Hash::hash` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Hash-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Hash-struct.rs index 7f69c3a8e25..7f69c3a8e25 100644 --- a/src/test/compile-fail/derives-span-Hash-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Hash-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Hash-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Hash-struct.stderr new file mode 100644 index 00000000000..3068bcfe0a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Hash-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied + --> $DIR/derives-span-Hash-struct.rs:18:5 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error` + | + = note: required by `std::hash::Hash::hash` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Hash-tuple-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Hash-tuple-struct.rs index 2dee63c4298..2dee63c4298 100644 --- a/src/test/compile-fail/derives-span-Hash-tuple-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Hash-tuple-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Hash-tuple-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Hash-tuple-struct.stderr new file mode 100644 index 00000000000..a65fbd8b6e6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Hash-tuple-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied + --> $DIR/derives-span-Hash-tuple-struct.rs:18:5 + | +LL | Error //~ ERROR + | ^^^^^ the trait `std::hash::Hash` is not implemented for `Error` + | + = note: required by `std::hash::Hash::hash` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Ord-enum-struct-variant.rs b/src/test/ui/compile-fail-migration/derives-span-Ord-enum-struct-variant.rs index 8f4e393c96a..8f4e393c96a 100644 --- a/src/test/compile-fail/derives-span-Ord-enum-struct-variant.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Ord-enum-struct-variant.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Ord-enum-struct-variant.stderr b/src/test/ui/compile-fail-migration/derives-span-Ord-enum-struct-variant.stderr new file mode 100644 index 00000000000..5968efd5ca1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Ord-enum-struct-variant.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::cmp::Ord` is not satisfied + --> $DIR/derives-span-Ord-enum-struct-variant.rs:19:6 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `Error` + | + = note: required by `std::cmp::Ord::cmp` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Ord-enum.rs b/src/test/ui/compile-fail-migration/derives-span-Ord-enum.rs index b8ceacf3753..b8ceacf3753 100644 --- a/src/test/compile-fail/derives-span-Ord-enum.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Ord-enum.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Ord-enum.stderr b/src/test/ui/compile-fail-migration/derives-span-Ord-enum.stderr new file mode 100644 index 00000000000..074a8f84cec --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Ord-enum.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::cmp::Ord` is not satisfied + --> $DIR/derives-span-Ord-enum.rs:19:6 + | +LL | Error //~ ERROR + | ^^^^^ the trait `std::cmp::Ord` is not implemented for `Error` + | + = note: required by `std::cmp::Ord::cmp` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Ord-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Ord-struct.rs index 2ff62bac2bc..2ff62bac2bc 100644 --- a/src/test/compile-fail/derives-span-Ord-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Ord-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Ord-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Ord-struct.stderr new file mode 100644 index 00000000000..2e584e6ca87 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Ord-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::cmp::Ord` is not satisfied + --> $DIR/derives-span-Ord-struct.rs:18:5 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `Error` + | + = note: required by `std::cmp::Ord::cmp` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-Ord-tuple-struct.rs b/src/test/ui/compile-fail-migration/derives-span-Ord-tuple-struct.rs index 24eacb71d7b..24eacb71d7b 100644 --- a/src/test/compile-fail/derives-span-Ord-tuple-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-Ord-tuple-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-Ord-tuple-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-Ord-tuple-struct.stderr new file mode 100644 index 00000000000..0da452f0a6a --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-Ord-tuple-struct.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Error: std::cmp::Ord` is not satisfied + --> $DIR/derives-span-Ord-tuple-struct.rs:18:5 + | +LL | Error //~ ERROR + | ^^^^^ the trait `std::cmp::Ord` is not implemented for `Error` + | + = note: required by `std::cmp::Ord::cmp` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-PartialEq-enum-struct-variant.rs b/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum-struct-variant.rs index 14d94f1599e..14d94f1599e 100644 --- a/src/test/compile-fail/derives-span-PartialEq-enum-struct-variant.rs +++ b/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum-struct-variant.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum-struct-variant.stderr b/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum-struct-variant.stderr new file mode 100644 index 00000000000..cad446f8326 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum-struct-variant.stderr @@ -0,0 +1,19 @@ +error[E0369]: binary operation `==` cannot be applied to type `Error` + --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:19:6 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + +error[E0369]: binary operation `!=` cannot be applied to type `Error` + --> $DIR/derives-span-PartialEq-enum-struct-variant.rs:19:6 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/derives-span-PartialEq-enum.rs b/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum.rs index ab58bb938b9..ab58bb938b9 100644 --- a/src/test/compile-fail/derives-span-PartialEq-enum.rs +++ b/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum.stderr b/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum.stderr new file mode 100644 index 00000000000..e75d0693db5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-PartialEq-enum.stderr @@ -0,0 +1,19 @@ +error[E0369]: binary operation `==` cannot be applied to type `Error` + --> $DIR/derives-span-PartialEq-enum.rs:19:6 + | +LL | Error //~ ERROR + | ^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + +error[E0369]: binary operation `!=` cannot be applied to type `Error` + --> $DIR/derives-span-PartialEq-enum.rs:19:6 + | +LL | Error //~ ERROR + | ^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/derives-span-PartialEq-struct.rs b/src/test/ui/compile-fail-migration/derives-span-PartialEq-struct.rs index 05a0990ff03..05a0990ff03 100644 --- a/src/test/compile-fail/derives-span-PartialEq-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-PartialEq-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-PartialEq-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-PartialEq-struct.stderr new file mode 100644 index 00000000000..c8cd509a824 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-PartialEq-struct.stderr @@ -0,0 +1,19 @@ +error[E0369]: binary operation `==` cannot be applied to type `Error` + --> $DIR/derives-span-PartialEq-struct.rs:18:5 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + +error[E0369]: binary operation `!=` cannot be applied to type `Error` + --> $DIR/derives-span-PartialEq-struct.rs:18:5 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/derives-span-PartialEq-tuple-struct.rs b/src/test/ui/compile-fail-migration/derives-span-PartialEq-tuple-struct.rs index cdeb7ce45bc..cdeb7ce45bc 100644 --- a/src/test/compile-fail/derives-span-PartialEq-tuple-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-PartialEq-tuple-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-PartialEq-tuple-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-PartialEq-tuple-struct.stderr new file mode 100644 index 00000000000..b66189fb567 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-PartialEq-tuple-struct.stderr @@ -0,0 +1,19 @@ +error[E0369]: binary operation `==` cannot be applied to type `Error` + --> $DIR/derives-span-PartialEq-tuple-struct.rs:18:5 + | +LL | Error //~ ERROR + | ^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + +error[E0369]: binary operation `!=` cannot be applied to type `Error` + --> $DIR/derives-span-PartialEq-tuple-struct.rs:18:5 + | +LL | Error //~ ERROR + | ^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `Error` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/derives-span-PartialOrd-enum-struct-variant.rs b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum-struct-variant.rs index a5df717e06b..a5df717e06b 100644 --- a/src/test/compile-fail/derives-span-PartialOrd-enum-struct-variant.rs +++ b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum-struct-variant.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum-struct-variant.stderr b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum-struct-variant.stderr new file mode 100644 index 00000000000..7e55ba70c13 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum-struct-variant.stderr @@ -0,0 +1,12 @@ +error[E0277]: can't compare `Error` with `Error` + --> $DIR/derives-span-PartialOrd-enum-struct-variant.rs:19:6 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ no implementation for `Error < Error` and `Error > Error` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-PartialOrd-enum.rs b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum.rs index 3411d2f3119..3411d2f3119 100644 --- a/src/test/compile-fail/derives-span-PartialOrd-enum.rs +++ b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum.stderr b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum.stderr new file mode 100644 index 00000000000..d8b3bd9f1bc --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-enum.stderr @@ -0,0 +1,12 @@ +error[E0277]: can't compare `Error` with `Error` + --> $DIR/derives-span-PartialOrd-enum.rs:19:6 + | +LL | Error //~ ERROR + | ^^^^^ no implementation for `Error < Error` and `Error > Error` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-PartialOrd-struct.rs b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-struct.rs index 1feadc2fd83..1feadc2fd83 100644 --- a/src/test/compile-fail/derives-span-PartialOrd-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-PartialOrd-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-struct.stderr new file mode 100644 index 00000000000..afd93dce625 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-struct.stderr @@ -0,0 +1,12 @@ +error[E0277]: can't compare `Error` with `Error` + --> $DIR/derives-span-PartialOrd-struct.rs:18:5 + | +LL | x: Error //~ ERROR + | ^^^^^^^^ no implementation for `Error < Error` and `Error > Error` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/derives-span-PartialOrd-tuple-struct.rs b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-tuple-struct.rs index 9db0fed2d9e..9db0fed2d9e 100644 --- a/src/test/compile-fail/derives-span-PartialOrd-tuple-struct.rs +++ b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-tuple-struct.rs diff --git a/src/test/ui/compile-fail-migration/derives-span-PartialOrd-tuple-struct.stderr b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-tuple-struct.stderr new file mode 100644 index 00000000000..a65ee40f220 --- /dev/null +++ b/src/test/ui/compile-fail-migration/derives-span-PartialOrd-tuple-struct.stderr @@ -0,0 +1,12 @@ +error[E0277]: can't compare `Error` with `Error` + --> $DIR/derives-span-PartialOrd-tuple-struct.rs:18:5 + | +LL | Error //~ ERROR + | ^^^^^ no implementation for `Error < Error` and `Error > Error` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `Error` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/deriving-bounds.rs b/src/test/ui/compile-fail-migration/deriving-bounds.rs index 72d06274de4..72d06274de4 100644 --- a/src/test/compile-fail/deriving-bounds.rs +++ b/src/test/ui/compile-fail-migration/deriving-bounds.rs diff --git a/src/test/ui/compile-fail-migration/deriving-bounds.stderr b/src/test/ui/compile-fail-migration/deriving-bounds.stderr new file mode 100644 index 00000000000..2c42fd1b672 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deriving-bounds.stderr @@ -0,0 +1,14 @@ +error: this unsafe trait should be implemented explicitly + --> $DIR/deriving-bounds.rs:11:10 + | +LL | #[derive(Send)] + | ^^^^ + +error: this unsafe trait should be implemented explicitly + --> $DIR/deriving-bounds.rs:15:10 + | +LL | #[derive(Sync)] + | ^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/deriving-copyclone.rs b/src/test/ui/compile-fail-migration/deriving-copyclone.rs index 92fb7c5737a..92fb7c5737a 100644 --- a/src/test/compile-fail/deriving-copyclone.rs +++ b/src/test/ui/compile-fail-migration/deriving-copyclone.rs diff --git a/src/test/ui/compile-fail-migration/deriving-copyclone.stderr b/src/test/ui/compile-fail-migration/deriving-copyclone.stderr new file mode 100644 index 00000000000..2d0dc6649e7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deriving-copyclone.stderr @@ -0,0 +1,42 @@ +error[E0277]: the trait bound `C: std::marker::Copy` is not satisfied + --> $DIR/deriving-copyclone.rs:41:5 + | +LL | is_copy(B { a: 1, b: C }); //~ERROR Copy + | ^^^^^^^ the trait `std::marker::Copy` is not implemented for `C` + | + = note: required because of the requirements on the impl of `std::marker::Copy` for `B<C>` +note: required by `is_copy` + --> $DIR/deriving-copyclone.rs:28:1 + | +LL | fn is_copy<T: Copy>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `C: std::clone::Clone` is not satisfied + --> $DIR/deriving-copyclone.rs:42:5 + | +LL | is_clone(B { a: 1, b: C }); //~ERROR Clone + | ^^^^^^^^ the trait `std::clone::Clone` is not implemented for `C` + | + = note: required because of the requirements on the impl of `std::clone::Clone` for `B<C>` +note: required by `is_clone` + --> $DIR/deriving-copyclone.rs:29:1 + | +LL | fn is_clone<T: Clone>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `D: std::marker::Copy` is not satisfied + --> $DIR/deriving-copyclone.rs:45:5 + | +LL | is_copy(B { a: 1, b: D }); //~ERROR Copy + | ^^^^^^^ the trait `std::marker::Copy` is not implemented for `D` + | + = note: required because of the requirements on the impl of `std::marker::Copy` for `B<D>` +note: required by `is_copy` + --> $DIR/deriving-copyclone.rs:28:1 + | +LL | fn is_copy<T: Copy>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/deriving-meta-unknown-trait.rs b/src/test/ui/compile-fail-migration/deriving-meta-unknown-trait.rs index d388ece0844..d388ece0844 100644 --- a/src/test/compile-fail/deriving-meta-unknown-trait.rs +++ b/src/test/ui/compile-fail-migration/deriving-meta-unknown-trait.rs diff --git a/src/test/ui/compile-fail-migration/deriving-meta-unknown-trait.stderr b/src/test/ui/compile-fail-migration/deriving-meta-unknown-trait.stderr new file mode 100644 index 00000000000..aa0f1e21213 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deriving-meta-unknown-trait.stderr @@ -0,0 +1,8 @@ +error: cannot find derive macro `Eqr` in this scope + --> $DIR/deriving-meta-unknown-trait.rs:13:10 + | +LL | #[derive(Eqr)] + | ^^^ help: try: `Eq` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/deriving-no-inner-impl-error-message.rs b/src/test/ui/compile-fail-migration/deriving-no-inner-impl-error-message.rs index 129c859b919..129c859b919 100644 --- a/src/test/compile-fail/deriving-no-inner-impl-error-message.rs +++ b/src/test/ui/compile-fail-migration/deriving-no-inner-impl-error-message.rs diff --git a/src/test/ui/compile-fail-migration/deriving-no-inner-impl-error-message.stderr b/src/test/ui/compile-fail-migration/deriving-no-inner-impl-error-message.stderr new file mode 100644 index 00000000000..48d27ae1474 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deriving-no-inner-impl-error-message.stderr @@ -0,0 +1,28 @@ +error[E0369]: binary operation `==` cannot be applied to type `NoCloneOrEq` + --> $DIR/deriving-no-inner-impl-error-message.rs:15:5 + | +LL | x: NoCloneOrEq //~ ERROR binary operation `==` cannot be applied to type `NoCloneOrEq` + | ^^^^^^^^^^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `NoCloneOrEq` + +error[E0369]: binary operation `!=` cannot be applied to type `NoCloneOrEq` + --> $DIR/deriving-no-inner-impl-error-message.rs:15:5 + | +LL | x: NoCloneOrEq //~ ERROR binary operation `==` cannot be applied to type `NoCloneOrEq` + | ^^^^^^^^^^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `NoCloneOrEq` + +error[E0277]: the trait bound `NoCloneOrEq: std::clone::Clone` is not satisfied + --> $DIR/deriving-no-inner-impl-error-message.rs:20:5 + | +LL | x: NoCloneOrEq + | ^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `NoCloneOrEq` + | + = note: required by `std::clone::Clone::clone` + +error: aborting due to 3 previous errors + +Some errors occurred: E0277, E0369. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/deriving-non-type.rs b/src/test/ui/compile-fail-migration/deriving-non-type.rs index 84dd22435b8..84dd22435b8 100644 --- a/src/test/compile-fail/deriving-non-type.rs +++ b/src/test/ui/compile-fail-migration/deriving-non-type.rs diff --git a/src/test/ui/compile-fail-migration/deriving-non-type.stderr b/src/test/ui/compile-fail-migration/deriving-non-type.stderr new file mode 100644 index 00000000000..d9da03afb03 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deriving-non-type.stderr @@ -0,0 +1,56 @@ +error: `derive` may only be applied to structs, enums and unions + --> $DIR/deriving-non-type.rs:15:1 + | +LL | #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/deriving-non-type.rs:18:1 + | +LL | #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/deriving-non-type.rs:21:1 + | +LL | #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/deriving-non-type.rs:24:1 + | +LL | #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/deriving-non-type.rs:27:1 + | +LL | #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/deriving-non-type.rs:30:1 + | +LL | #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/deriving-non-type.rs:33:1 + | +LL | #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/deriving-non-type.rs:36:1 + | +LL | #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^^^^^ + +error: `derive` may only be applied to structs, enums and unions + --> $DIR/deriving-non-type.rs:39:1 + | +LL | #[derive(PartialEq)] //~ ERROR: `derive` may only be applied to structs, enums and unions + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 9 previous errors + diff --git a/src/test/compile-fail/deriving-primitive.rs b/src/test/ui/compile-fail-migration/deriving-primitive.rs index 04fdee5e3ed..04fdee5e3ed 100644 --- a/src/test/compile-fail/deriving-primitive.rs +++ b/src/test/ui/compile-fail-migration/deriving-primitive.rs diff --git a/src/test/ui/compile-fail-migration/deriving-primitive.stderr b/src/test/ui/compile-fail-migration/deriving-primitive.stderr new file mode 100644 index 00000000000..bc2d3393290 --- /dev/null +++ b/src/test/ui/compile-fail-migration/deriving-primitive.stderr @@ -0,0 +1,8 @@ +error: cannot find derive macro `FromPrimitive` in this scope + --> $DIR/deriving-primitive.rs:11:10 + | +LL | #[derive(FromPrimitive)] //~ ERROR cannot find derive macro `FromPrimitive` in this scope + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/destructure-trait-ref.rs b/src/test/ui/compile-fail-migration/destructure-trait-ref.rs index b5acdc12ca0..b5acdc12ca0 100644 --- a/src/test/compile-fail/destructure-trait-ref.rs +++ b/src/test/ui/compile-fail-migration/destructure-trait-ref.rs diff --git a/src/test/ui/compile-fail-migration/destructure-trait-ref.stderr b/src/test/ui/compile-fail-migration/destructure-trait-ref.stderr new file mode 100644 index 00000000000..0335fff7bce --- /dev/null +++ b/src/test/ui/compile-fail-migration/destructure-trait-ref.stderr @@ -0,0 +1,51 @@ +error[E0033]: type `&dyn T` cannot be dereferenced + --> $DIR/destructure-trait-ref.rs:36:9 + | +LL | let &x = &1isize as &T; //~ ERROR type `&dyn T` cannot be dereferenced + | ^^ type `&dyn T` cannot be dereferenced + +error[E0033]: type `&dyn T` cannot be dereferenced + --> $DIR/destructure-trait-ref.rs:37:10 + | +LL | let &&x = &(&1isize as &T); //~ ERROR type `&dyn T` cannot be dereferenced + | ^^ type `&dyn T` cannot be dereferenced + +error[E0033]: type `std::boxed::Box<dyn T>` cannot be dereferenced + --> $DIR/destructure-trait-ref.rs:38:9 + | +LL | let box x = box 1isize as Box<T>; //~ ERROR type `std::boxed::Box<dyn T>` cannot be dereferenced + | ^^^^^ type `std::boxed::Box<dyn T>` cannot be dereferenced + +error[E0308]: mismatched types + --> $DIR/destructure-trait-ref.rs:41:10 + | +LL | let &&x = &1isize as &T; + | ^^ expected trait T, found reference + | + = note: expected type `dyn T` + found type `&_` + = help: did you mean `x: &dyn T`? + +error[E0308]: mismatched types + --> $DIR/destructure-trait-ref.rs:46:11 + | +LL | let &&&x = &(&1isize as &T); + | ^^ expected trait T, found reference + | + = note: expected type `dyn T` + found type `&_` + = help: did you mean `x: &dyn T`? + +error[E0308]: mismatched types + --> $DIR/destructure-trait-ref.rs:51:13 + | +LL | let box box x = box 1isize as Box<T>; + | ^^^^^ expected trait T, found struct `std::boxed::Box` + | + = note: expected type `dyn T` + found type `std::boxed::Box<_>` + +error: aborting due to 6 previous errors + +Some errors occurred: E0033, E0308. +For more information about an error, try `rustc --explain E0033`. diff --git a/src/test/compile-fail/directory_ownership/foo/compiletest-ignore-dir b/src/test/ui/compile-fail-migration/directory_ownership/foo/compiletest-ignore-dir index e69de29bb2d..e69de29bb2d 100644 --- a/src/test/compile-fail/directory_ownership/foo/compiletest-ignore-dir +++ b/src/test/ui/compile-fail-migration/directory_ownership/foo/compiletest-ignore-dir diff --git a/src/test/compile-fail/directory_ownership/foo/mod_file_not_owning/aux2.rs b/src/test/ui/compile-fail-migration/directory_ownership/foo/mod_file_not_owning/aux2.rs index fc4bca865c9..fc4bca865c9 100644 --- a/src/test/compile-fail/directory_ownership/foo/mod_file_not_owning/aux2.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/foo/mod_file_not_owning/aux2.rs diff --git a/src/test/compile-fail/directory_ownership/foo/mod_file_not_owning_aux2.rs b/src/test/ui/compile-fail-migration/directory_ownership/foo/mod_file_not_owning_aux2.rs index fc4bca865c9..fc4bca865c9 100644 --- a/src/test/compile-fail/directory_ownership/foo/mod_file_not_owning_aux2.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/foo/mod_file_not_owning_aux2.rs diff --git a/src/test/compile-fail/directory_ownership/macro-expanded-mod.rs b/src/test/ui/compile-fail-migration/directory_ownership/macro-expanded-mod.rs index 8e631a64f7a..8e631a64f7a 100644 --- a/src/test/compile-fail/directory_ownership/macro-expanded-mod.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/macro-expanded-mod.rs diff --git a/src/test/ui/compile-fail-migration/directory_ownership/macro-expanded-mod.stderr b/src/test/ui/compile-fail-migration/directory_ownership/macro-expanded-mod.stderr new file mode 100644 index 00000000000..a9efcd883c1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/directory_ownership/macro-expanded-mod.stderr @@ -0,0 +1,8 @@ +error: Cannot declare a non-inline module inside a block unless it has a path attribute + --> $DIR/macro-expanded-mod.rs:22:15 + | +LL | mod_decl!(foo); //~ ERROR Cannot declare a non-inline module inside a block + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/bar.rs b/src/test/ui/compile-fail-migration/directory_ownership/macro_expanded_mod_helper/foo/bar.rs index 4ef92981314..4ef92981314 100644 --- a/src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/bar.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/macro_expanded_mod_helper/foo/bar.rs diff --git a/src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/mod.rs b/src/test/ui/compile-fail-migration/directory_ownership/macro_expanded_mod_helper/foo/mod.rs index 41a8c288e7c..41a8c288e7c 100644 --- a/src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/mod.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/macro_expanded_mod_helper/foo/mod.rs diff --git a/src/test/compile-fail/directory_ownership/mod_file_not_owning.rs b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning.rs index ff93fddf9b3..ff93fddf9b3 100644 --- a/src/test/compile-fail/directory_ownership/mod_file_not_owning.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning.rs diff --git a/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning.stderr b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning.stderr new file mode 100644 index 00000000000..e2937573997 --- /dev/null +++ b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning.stderr @@ -0,0 +1,15 @@ +error[E0658]: mod statements in non-mod.rs files are unstable (see issue #44660) + --> $DIR/mod_file_not_owning_aux1.rs:14:17 + | +LL | () => { mod mod_file_not_owning_aux2; } + | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | } +LL | m!(); + | ----- in this macro invocation + | + = help: add #![feature(non_modrs_mods)] to the crate attributes to enable + = help: on stable builds, rename this file to mod_file_not_owning_aux1/mod.rs + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1.rs b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux1.rs index 4ac94a92e37..4ac94a92e37 100644 --- a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux1.rs diff --git a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1/compiletest-ignore-dir b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux1/compiletest-ignore-dir index e69de29bb2d..e69de29bb2d 100644 --- a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1/compiletest-ignore-dir +++ b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux1/compiletest-ignore-dir diff --git a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1/mod_file_not_owning_aux2.rs b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux1/mod_file_not_owning_aux2.rs index fc4bca865c9..fc4bca865c9 100644 --- a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1/mod_file_not_owning_aux2.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux1/mod_file_not_owning_aux2.rs diff --git a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux2.rs b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux2.rs index 41401d640f6..41401d640f6 100644 --- a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux2.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux2.rs diff --git a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux3.rs b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux3.rs index 3a164fd55d9..3a164fd55d9 100644 --- a/src/test/compile-fail/directory_ownership/mod_file_not_owning_aux3.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/mod_file_not_owning_aux3.rs diff --git a/src/test/compile-fail/directory_ownership/non-inline-mod-restriction.rs b/src/test/ui/compile-fail-migration/directory_ownership/non-inline-mod-restriction.rs index c4ede12e820..c4ede12e820 100644 --- a/src/test/compile-fail/directory_ownership/non-inline-mod-restriction.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/non-inline-mod-restriction.rs diff --git a/src/test/ui/compile-fail-migration/directory_ownership/non-inline-mod-restriction.stderr b/src/test/ui/compile-fail-migration/directory_ownership/non-inline-mod-restriction.stderr new file mode 100644 index 00000000000..93debdd675a --- /dev/null +++ b/src/test/ui/compile-fail-migration/directory_ownership/non-inline-mod-restriction.stderr @@ -0,0 +1,8 @@ +error: Cannot declare a non-inline module inside a block unless it has a path attribute + --> $DIR/non-inline-mod-restriction.rs:14:9 + | +LL | mod foo; //~ ERROR Cannot declare a non-inline module inside a block + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/directory_ownership/unowned_mod_with_path.rs b/src/test/ui/compile-fail-migration/directory_ownership/unowned_mod_with_path.rs index 0cffb7cc9e5..0cffb7cc9e5 100644 --- a/src/test/compile-fail/directory_ownership/unowned_mod_with_path.rs +++ b/src/test/ui/compile-fail-migration/directory_ownership/unowned_mod_with_path.rs diff --git a/src/test/ui/compile-fail-migration/directory_ownership/unowned_mod_with_path.stderr b/src/test/ui/compile-fail-migration/directory_ownership/unowned_mod_with_path.stderr new file mode 100644 index 00000000000..0c0b4281434 --- /dev/null +++ b/src/test/ui/compile-fail-migration/directory_ownership/unowned_mod_with_path.stderr @@ -0,0 +1,15 @@ +error[E0658]: mod statements in non-mod.rs files are unstable (see issue #44660) + --> $DIR/mod_file_not_owning_aux1.rs:14:17 + | +LL | () => { mod mod_file_not_owning_aux2; } + | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | } +LL | m!(); + | ----- in this macro invocation + | + = help: add #![feature(non_modrs_mods)] to the crate attributes to enable + = help: on stable builds, rename this file to foo/mod.rs + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-let.nll.stderr b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-let.nll.stderr new file mode 100644 index 00000000000..a8be048d7df --- /dev/null +++ b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-let.nll.stderr @@ -0,0 +1,12 @@ +error[E0509]: cannot move out of type `X`, which implements the `Drop` trait + --> $DIR/disallowed-deconstructing-destructing-struct-let.rs:22:22 + | +LL | let X { x: y } = x; //~ ERROR cannot move out of type + | - ^ cannot move out of here + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref y` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-let.rs index 2621820c222..2621820c222 100644 --- a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs +++ b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-let.rs diff --git a/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-let.stderr b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-let.stderr new file mode 100644 index 00000000000..cbf5fc61f93 --- /dev/null +++ b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-let.stderr @@ -0,0 +1,12 @@ +error[E0509]: cannot move out of type `X`, which implements the `Drop` trait + --> $DIR/disallowed-deconstructing-destructing-struct-let.rs:22:9 + | +LL | let X { x: y } = x; //~ ERROR cannot move out of type + | ^^^^^^^-^^ + | | | + | | hint: to prevent move, use `ref y` or `ref mut y` + | cannot move out of here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-match.nll.stderr b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-match.nll.stderr new file mode 100644 index 00000000000..9f0d2d5f0e1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-match.nll.stderr @@ -0,0 +1,14 @@ +error[E0509]: cannot move out of type `X`, which implements the `Drop` trait + --> $DIR/disallowed-deconstructing-destructing-struct-match.rs:24:11 + | +LL | match x { + | ^ cannot move out of here +LL | X { x: y } => println!("contents: {}", y) + | - + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref y` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-match.rs index 38049209903..38049209903 100644 --- a/src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs +++ b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-match.rs diff --git a/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-match.stderr b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-match.stderr new file mode 100644 index 00000000000..af2a1a06b56 --- /dev/null +++ b/src/test/ui/compile-fail-migration/disallowed-deconstructing-destructing-struct-match.stderr @@ -0,0 +1,12 @@ +error[E0509]: cannot move out of type `X`, which implements the `Drop` trait + --> $DIR/disallowed-deconstructing-destructing-struct-match.rs:25:9 + | +LL | X { x: y } => println!("contents: {}", y) + | ^^^^^^^-^^ + | | | + | | hint: to prevent move, use `ref y` or `ref mut y` + | cannot move out of here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/compile-fail/discrim-ill-typed.rs b/src/test/ui/compile-fail-migration/discrim-ill-typed.rs index 62e54c3f237..62e54c3f237 100644 --- a/src/test/compile-fail/discrim-ill-typed.rs +++ b/src/test/ui/compile-fail-migration/discrim-ill-typed.rs diff --git a/src/test/ui/compile-fail-migration/discrim-ill-typed.stderr b/src/test/ui/compile-fail-migration/discrim-ill-typed.stderr new file mode 100644 index 00000000000..50911037794 --- /dev/null +++ b/src/test/ui/compile-fail-migration/discrim-ill-typed.stderr @@ -0,0 +1,51 @@ +error[E0308]: mismatched types + --> $DIR/discrim-ill-typed.rs:27:16 + | +LL | OhNo = 0_u8, + | ^^^^ expected i8, found u8 + +error[E0308]: mismatched types + --> $DIR/discrim-ill-typed.rs:40:16 + | +LL | OhNo = 0_i8, + | ^^^^ expected u8, found i8 + +error[E0308]: mismatched types + --> $DIR/discrim-ill-typed.rs:53:16 + | +LL | OhNo = 0_u16, + | ^^^^^ expected i16, found u16 + +error[E0308]: mismatched types + --> $DIR/discrim-ill-typed.rs:66:16 + | +LL | OhNo = 0_i16, + | ^^^^^ expected u16, found i16 + +error[E0308]: mismatched types + --> $DIR/discrim-ill-typed.rs:79:16 + | +LL | OhNo = 0_u32, + | ^^^^^ expected i32, found u32 + +error[E0308]: mismatched types + --> $DIR/discrim-ill-typed.rs:92:16 + | +LL | OhNo = 0_i32, + | ^^^^^ expected u32, found i32 + +error[E0308]: mismatched types + --> $DIR/discrim-ill-typed.rs:105:16 + | +LL | OhNo = 0_u64, + | ^^^^^ expected i64, found u64 + +error[E0308]: mismatched types + --> $DIR/discrim-ill-typed.rs:118:16 + | +LL | OhNo = 0_i64, + | ^^^^^ expected u64, found i64 + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/diverging-fn-tail-35849.rs b/src/test/ui/compile-fail-migration/diverging-fn-tail-35849.rs index 9ef5159cb77..9ef5159cb77 100644 --- a/src/test/compile-fail/diverging-fn-tail-35849.rs +++ b/src/test/ui/compile-fail-migration/diverging-fn-tail-35849.rs diff --git a/src/test/ui/compile-fail-migration/diverging-fn-tail-35849.stderr b/src/test/ui/compile-fail-migration/diverging-fn-tail-35849.stderr new file mode 100644 index 00000000000..8f8ab79b25b --- /dev/null +++ b/src/test/ui/compile-fail-migration/diverging-fn-tail-35849.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/diverging-fn-tail-35849.rs:13:9 + | +LL | fn assert_sizeof() -> ! { + | - expected `!` because of return type +LL | unsafe { +LL | ::std::mem::transmute::<f64, [u8; 8]>(panic!()) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array of 8 elements + | + = note: expected type `!` + found type `[u8; 8]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/diverging-tuple-parts-39485.rs b/src/test/ui/compile-fail-migration/diverging-tuple-parts-39485.rs index eedad08ab55..eedad08ab55 100644 --- a/src/test/compile-fail/diverging-tuple-parts-39485.rs +++ b/src/test/ui/compile-fail-migration/diverging-tuple-parts-39485.rs diff --git a/src/test/ui/compile-fail-migration/diverging-tuple-parts-39485.stderr b/src/test/ui/compile-fail-migration/diverging-tuple-parts-39485.stderr new file mode 100644 index 00000000000..603f8709c14 --- /dev/null +++ b/src/test/ui/compile-fail-migration/diverging-tuple-parts-39485.stderr @@ -0,0 +1,25 @@ +error[E0308]: mismatched types + --> $DIR/diverging-tuple-parts-39485.rs:18:5 + | +LL | fn g() { + | - help: try adding a return type: `-> &_` +LL | &panic!() //~ ERROR mismatched types + | ^^^^^^^^^ expected (), found reference + | + = note: expected type `()` + found type `&_` + +error[E0308]: mismatched types + --> $DIR/diverging-tuple-parts-39485.rs:22:5 + | +LL | fn f() -> isize { + | ----- expected `isize` because of return type +LL | (return 1, return 2) //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^ expected isize, found tuple + | + = note: expected type `isize` + found type `(!, !)` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/does-nothing.rs b/src/test/ui/compile-fail-migration/does-nothing.rs index 01de94bddbd..01de94bddbd 100644 --- a/src/test/compile-fail/does-nothing.rs +++ b/src/test/ui/compile-fail-migration/does-nothing.rs diff --git a/src/test/ui/compile-fail-migration/does-nothing.stderr b/src/test/ui/compile-fail-migration/does-nothing.stderr new file mode 100644 index 00000000000..fa4b1f2f1c8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/does-nothing.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `this_does_nothing_what_the` in this scope + --> $DIR/does-nothing.rs:11:32 + | +LL | fn main() { println!("doing"); this_does_nothing_what_the; println!("boing"); } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/dollar-crate-is-keyword-2.rs b/src/test/ui/compile-fail-migration/dollar-crate-is-keyword-2.rs index 87a29038035..87a29038035 100644 --- a/src/test/compile-fail/dollar-crate-is-keyword-2.rs +++ b/src/test/ui/compile-fail-migration/dollar-crate-is-keyword-2.rs diff --git a/src/test/ui/compile-fail-migration/dollar-crate-is-keyword-2.stderr b/src/test/ui/compile-fail-migration/dollar-crate-is-keyword-2.stderr new file mode 100644 index 00000000000..c9b4f894ff6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dollar-crate-is-keyword-2.stderr @@ -0,0 +1,31 @@ +error[E0432]: unresolved import `a::$crate` + --> $DIR/dollar-crate-is-keyword-2.rs:15:13 + | +LL | use a::$crate; //~ ERROR unresolved import `a::$crate` + | ^^^^^^^^^ no `$crate` in `a` +... +LL | m!(); + | ----- in this macro invocation + +error[E0433]: failed to resolve. `$crate` in paths can only be used in start position + --> $DIR/dollar-crate-is-keyword-2.rs:16:16 + | +LL | use a::$crate::b; //~ ERROR `$crate` in paths can only be used in start position + | ^^^^^^ `$crate` in paths can only be used in start position +... +LL | m!(); + | ----- in this macro invocation + +error[E0433]: failed to resolve. `$crate` in paths can only be used in start position + --> $DIR/dollar-crate-is-keyword-2.rs:17:21 + | +LL | type A = a::$crate; //~ ERROR `$crate` in paths can only be used in start position + | ^^^^^^ `$crate` in paths can only be used in start position +... +LL | m!(); + | ----- in this macro invocation + +error: aborting due to 3 previous errors + +Some errors occurred: E0432, E0433. +For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/dollar-crate-is-keyword.rs b/src/test/ui/compile-fail-migration/dollar-crate-is-keyword.rs index 4a667f020ad..4a667f020ad 100644 --- a/src/test/compile-fail/dollar-crate-is-keyword.rs +++ b/src/test/ui/compile-fail-migration/dollar-crate-is-keyword.rs diff --git a/src/test/ui/compile-fail-migration/dollar-crate-is-keyword.stderr b/src/test/ui/compile-fail-migration/dollar-crate-is-keyword.stderr new file mode 100644 index 00000000000..a9898973393 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dollar-crate-is-keyword.stderr @@ -0,0 +1,42 @@ +error: expected identifier, found reserved identifier `$crate` + --> $DIR/dollar-crate-is-keyword.rs:13:16 + | +LL | struct $crate {} //~ ERROR expected identifier, found reserved identifier `$crate` + | ^^^^^^ expected identifier, found reserved identifier +... +LL | m!(); + | ----- in this macro invocation + +error: expected identifier, found reserved identifier `$crate` + --> $DIR/dollar-crate-is-keyword.rs:17:23 + | +LL | use $crate as $crate; //~ ERROR expected identifier, found reserved identifier `$crate` + | ^^^^^^ expected identifier, found reserved identifier +... +LL | m!(); + | ----- in this macro invocation + +warning: `$crate` may not be imported + --> $DIR/dollar-crate-is-keyword.rs:15:9 + | +LL | use $crate; // OK + | ^^^^^^^^^^^ +... +LL | m!(); + | ----- in this macro invocation + | + = note: `use $crate;` was erroneously allowed and will become a hard error in a future release + +warning: `$crate` may not be imported + --> $DIR/dollar-crate-is-keyword.rs:17:9 + | +LL | use $crate as $crate; //~ ERROR expected identifier, found reserved identifier `$crate` + | ^^^^^^^^^^^^^^^^^^^^^ +... +LL | m!(); + | ----- in this macro invocation + | + = note: `use $crate;` was erroneously allowed and will become a hard error in a future release + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/double-type-import.rs b/src/test/ui/compile-fail-migration/double-type-import.rs index 9629da735b0..9629da735b0 100644 --- a/src/test/compile-fail/double-type-import.rs +++ b/src/test/ui/compile-fail-migration/double-type-import.rs diff --git a/src/test/ui/compile-fail-migration/double-type-import.stderr b/src/test/ui/compile-fail-migration/double-type-import.stderr new file mode 100644 index 00000000000..d5d977da4aa --- /dev/null +++ b/src/test/ui/compile-fail-migration/double-type-import.stderr @@ -0,0 +1,17 @@ +error[E0252]: the name `X` is defined multiple times + --> $DIR/double-type-import.rs:13:9 + | +LL | pub use self::bar::X; + | ------------ previous import of the type `X` here +LL | use self::bar::X; + | ^^^^^^^^^^^^ `X` reimported here + | + = note: `X` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | use self::bar::X as OtherX; + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0252`. diff --git a/src/test/compile-fail/drop-on-non-struct.rs b/src/test/ui/compile-fail-migration/drop-on-non-struct.rs index 26b247d0d0f..26b247d0d0f 100644 --- a/src/test/compile-fail/drop-on-non-struct.rs +++ b/src/test/ui/compile-fail-migration/drop-on-non-struct.rs diff --git a/src/test/ui/compile-fail-migration/drop-on-non-struct.stderr b/src/test/ui/compile-fail-migration/drop-on-non-struct.stderr new file mode 100644 index 00000000000..6582df6bddc --- /dev/null +++ b/src/test/ui/compile-fail-migration/drop-on-non-struct.stderr @@ -0,0 +1,19 @@ +error[E0120]: the Drop trait may only be implemented on structures + --> $DIR/drop-on-non-struct.rs:11:19 + | +LL | impl<'a> Drop for &'a mut isize { + | ^^^^^^^^^^^^^ implementing Drop requires a struct + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/drop-on-non-struct.rs:11:1 + | +LL | impl<'a> Drop for &'a mut isize { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error: aborting due to 2 previous errors + +Some errors occurred: E0117, E0120. +For more information about an error, try `rustc --explain E0117`. diff --git a/src/test/ui/compile-fail-migration/drop-with-active-borrows-1.nll.stderr b/src/test/ui/compile-fail-migration/drop-with-active-borrows-1.nll.stderr new file mode 100644 index 00000000000..30f9907401c --- /dev/null +++ b/src/test/ui/compile-fail-migration/drop-with-active-borrows-1.nll.stderr @@ -0,0 +1,13 @@ +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/drop-with-active-borrows-1.rs:14:10 + | +LL | let b: Vec<&str> = a.lines().collect(); + | - borrow of `a` occurs here +LL | drop(a); //~ ERROR cannot move out of `a` because it is borrowed + | ^ move out of `a` occurs here +LL | for s in &b { + | -- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/drop-with-active-borrows-1.rs b/src/test/ui/compile-fail-migration/drop-with-active-borrows-1.rs index 903365fb909..903365fb909 100644 --- a/src/test/compile-fail/drop-with-active-borrows-1.rs +++ b/src/test/ui/compile-fail-migration/drop-with-active-borrows-1.rs diff --git a/src/test/ui/compile-fail-migration/drop-with-active-borrows-1.stderr b/src/test/ui/compile-fail-migration/drop-with-active-borrows-1.stderr new file mode 100644 index 00000000000..60107427ea5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/drop-with-active-borrows-1.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/drop-with-active-borrows-1.rs:14:10 + | +LL | let b: Vec<&str> = a.lines().collect(); + | - borrow of `a` occurs here +LL | drop(a); //~ ERROR cannot move out of `a` because it is borrowed + | ^ move out of `a` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/ui/compile-fail-migration/drop-with-active-borrows-2.nll.stderr b/src/test/ui/compile-fail-migration/drop-with-active-borrows-2.nll.stderr new file mode 100644 index 00000000000..4f792a9c9d2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/drop-with-active-borrows-2.nll.stderr @@ -0,0 +1,18 @@ +error[E0597]: `raw_lines` does not live long enough + --> $DIR/drop-with-active-borrows-2.rs:13:5 + | +LL | raw_lines.iter().map(|l| l.trim()).collect() + | ^^^^^^^^^ borrowed value does not live long enough +LL | //~^ ERROR `raw_lines` does not live long enough +LL | } + | - `raw_lines` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 11:24... + --> $DIR/drop-with-active-borrows-2.rs:11:24 + | +LL | fn read_lines_borrowed<'a>() -> Vec<&'a str> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/drop-with-active-borrows-2.rs b/src/test/ui/compile-fail-migration/drop-with-active-borrows-2.rs index 33e4d3e62c4..33e4d3e62c4 100644 --- a/src/test/compile-fail/drop-with-active-borrows-2.rs +++ b/src/test/ui/compile-fail-migration/drop-with-active-borrows-2.rs diff --git a/src/test/ui/compile-fail-migration/drop-with-active-borrows-2.stderr b/src/test/ui/compile-fail-migration/drop-with-active-borrows-2.stderr new file mode 100644 index 00000000000..0fd4bf81039 --- /dev/null +++ b/src/test/ui/compile-fail-migration/drop-with-active-borrows-2.stderr @@ -0,0 +1,18 @@ +error[E0597]: `raw_lines` does not live long enough + --> $DIR/drop-with-active-borrows-2.rs:13:5 + | +LL | raw_lines.iter().map(|l| l.trim()).collect() + | ^^^^^^^^^ borrowed value does not live long enough +LL | //~^ ERROR `raw_lines` does not live long enough +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 11:24... + --> $DIR/drop-with-active-borrows-2.rs:11:24 + | +LL | fn read_lines_borrowed<'a>() -> Vec<&'a str> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/dropck_no_diverge_on_nonregular_1.rs b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_1.rs index f0968853819..f0968853819 100644 --- a/src/test/compile-fail/dropck_no_diverge_on_nonregular_1.rs +++ b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_1.rs diff --git a/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_1.stderr b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_1.stderr new file mode 100644 index 00000000000..f4dd867ec68 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_1.stderr @@ -0,0 +1,19 @@ +error[E0320]: overflow while adding drop-check rules for FingerTree<i32> + --> $DIR/dropck_no_diverge_on_nonregular_1.rs:34:9 + | +LL | let ft = //~ ERROR overflow while adding drop-check rules for FingerTree + | ^^ + | + = note: overflowed on FingerTree<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<i32>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error[E0320]: overflow while adding drop-check rules for FingerTree<i32> + --> $DIR/dropck_no_diverge_on_nonregular_1.rs:35:9 + | +LL | FingerTree::Single(1); + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: overflowed on FingerTree<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<i32>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0320`. diff --git a/src/test/compile-fail/dropck_no_diverge_on_nonregular_2.rs b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_2.rs index 886bd6bea20..886bd6bea20 100644 --- a/src/test/compile-fail/dropck_no_diverge_on_nonregular_2.rs +++ b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_2.rs diff --git a/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_2.stderr b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_2.stderr new file mode 100644 index 00000000000..ae9c50a66a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_2.stderr @@ -0,0 +1,19 @@ +error[E0320]: overflow while adding drop-check rules for FingerTree<i32> + --> $DIR/dropck_no_diverge_on_nonregular_2.rs:33:9 + | +LL | let ft = //~ ERROR overflow while adding drop-check rules for FingerTree + | ^^ + | + = note: overflowed on FingerTree<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<i32>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error[E0320]: overflow while adding drop-check rules for FingerTree<i32> + --> $DIR/dropck_no_diverge_on_nonregular_2.rs:34:9 + | +LL | FingerTree::Single(1); + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: overflowed on FingerTree<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<i32>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0320`. diff --git a/src/test/compile-fail/dropck_no_diverge_on_nonregular_3.rs b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_3.rs index 45531666ecf..45531666ecf 100644 --- a/src/test/compile-fail/dropck_no_diverge_on_nonregular_3.rs +++ b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_3.rs diff --git a/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_3.stderr b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_3.stderr new file mode 100644 index 00000000000..e0089f8b298 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dropck_no_diverge_on_nonregular_3.stderr @@ -0,0 +1,27 @@ +error[E0320]: overflow while adding drop-check rules for std::option::Option<Wrapper<u32>> + --> $DIR/dropck_no_diverge_on_nonregular_3.rs:42:9 + | +LL | let w = //~ ERROR overflow while adding drop-check rules for std::option + | ^ + | + = note: overflowed on FingerTree<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<u32>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error[E0320]: overflow while adding drop-check rules for std::option::Option<Wrapper<u32>> + --> $DIR/dropck_no_diverge_on_nonregular_3.rs:43:9 + | +LL | Some(Wrapper::Simple::<u32>); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: overflowed on FingerTree<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<u32>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error[E0320]: overflow while adding drop-check rules for Wrapper<u32> + --> $DIR/dropck_no_diverge_on_nonregular_3.rs:43:14 + | +LL | Some(Wrapper::Simple::<u32>); + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: overflowed on FingerTree<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<Node<u32>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0320`. diff --git a/src/test/ui/compile-fail-migration/dropck_trait_cycle_checked.nll.stderr b/src/test/ui/compile-fail-migration/dropck_trait_cycle_checked.nll.stderr new file mode 100644 index 00000000000..4be70a52202 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dropck_trait_cycle_checked.nll.stderr @@ -0,0 +1,71 @@ +error[E0597]: `o2` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:121:13 + | +LL | o1.set0(&o2); //~ ERROR `o2` does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - + | | + | `o2` dropped here while still borrowed + | borrow later used here, when `o2` is dropped + +error[E0597]: `o3` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:122:13 + | +LL | o1.set1(&o3); //~ ERROR `o3` does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - + | | + | `o3` dropped here while still borrowed + | borrow later used here, when `o3` is dropped + +error[E0597]: `o2` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:123:13 + | +LL | o2.set0(&o2); //~ ERROR `o2` does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - `o2` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `o3` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:124:13 + | +LL | o2.set1(&o3); //~ ERROR `o3` does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - `o3` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `o1` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:125:13 + | +LL | o3.set0(&o1); //~ ERROR `o1` does not live long enough + | ^^^ borrowed value does not live long enough +LL | o3.set1(&o2); //~ ERROR `o2` does not live long enough +LL | } + | - + | | + | `o1` dropped here while still borrowed + | borrow later used here, when `o1` is dropped + +error[E0597]: `o2` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:126:13 + | +LL | o3.set1(&o2); //~ ERROR `o2` does not live long enough + | ^^^ borrowed value does not live long enough +LL | } + | - `o2` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/dropck_trait_cycle_checked.rs b/src/test/ui/compile-fail-migration/dropck_trait_cycle_checked.rs index b6b7fa1a233..b6b7fa1a233 100644 --- a/src/test/compile-fail/dropck_trait_cycle_checked.rs +++ b/src/test/ui/compile-fail-migration/dropck_trait_cycle_checked.rs diff --git a/src/test/ui/compile-fail-migration/dropck_trait_cycle_checked.stderr b/src/test/ui/compile-fail-migration/dropck_trait_cycle_checked.stderr new file mode 100644 index 00000000000..ab255cf0c98 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dropck_trait_cycle_checked.stderr @@ -0,0 +1,68 @@ +error[E0597]: `o2` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:121:14 + | +LL | o1.set0(&o2); //~ ERROR `o2` does not live long enough + | ^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `o3` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:122:14 + | +LL | o1.set1(&o3); //~ ERROR `o3` does not live long enough + | ^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `o2` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:123:14 + | +LL | o2.set0(&o2); //~ ERROR `o2` does not live long enough + | ^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `o3` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:124:14 + | +LL | o2.set1(&o3); //~ ERROR `o3` does not live long enough + | ^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `o1` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:125:14 + | +LL | o3.set0(&o1); //~ ERROR `o1` does not live long enough + | ^^ borrowed value does not live long enough +LL | o3.set1(&o2); //~ ERROR `o2` does not live long enough +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `o2` does not live long enough + --> $DIR/dropck_trait_cycle_checked.rs:126:14 + | +LL | o3.set1(&o2); //~ ERROR `o2` does not live long enough + | ^^ borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/dst-bad-assign-2.rs b/src/test/ui/compile-fail-migration/dst-bad-assign-2.rs index 372f3187805..372f3187805 100644 --- a/src/test/compile-fail/dst-bad-assign-2.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-assign-2.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-assign-2.stderr b/src/test/ui/compile-fail-migration/dst-bad-assign-2.stderr new file mode 100644 index 00000000000..cfc25ebae57 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-assign-2.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time + --> $DIR/dst-bad-assign-2.rs:45:5 + | +LL | f5.ptr = *z; + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `dyn ToBar` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: the left-hand-side of an assignment must have a statically known size + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/dst-bad-assign-3.rs b/src/test/ui/compile-fail-migration/dst-bad-assign-3.rs index 339cfb5443d..339cfb5443d 100644 --- a/src/test/compile-fail/dst-bad-assign-3.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-assign-3.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-assign-3.stderr b/src/test/ui/compile-fail-migration/dst-bad-assign-3.stderr new file mode 100644 index 00000000000..5051972406b --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-assign-3.stderr @@ -0,0 +1,23 @@ +error[E0308]: mismatched types + --> $DIR/dst-bad-assign-3.rs:43:12 + | +LL | f5.2 = Bar1 {f: 36}; + | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` + | + = note: expected type `dyn ToBar` + found type `Bar1` + +error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time + --> $DIR/dst-bad-assign-3.rs:43:5 + | +LL | f5.2 = Bar1 {f: 36}; + | ^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `dyn ToBar` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: the left-hand-side of an assignment must have a statically known size + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/dst-bad-assign.rs b/src/test/ui/compile-fail-migration/dst-bad-assign.rs index 9a329c636ae..9a329c636ae 100644 --- a/src/test/compile-fail/dst-bad-assign.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-assign.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-assign.stderr b/src/test/ui/compile-fail-migration/dst-bad-assign.stderr new file mode 100644 index 00000000000..b911014b362 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-assign.stderr @@ -0,0 +1,23 @@ +error[E0308]: mismatched types + --> $DIR/dst-bad-assign.rs:45:14 + | +LL | f5.ptr = Bar1 {f: 36}; + | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` + | + = note: expected type `dyn ToBar` + found type `Bar1` + +error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time + --> $DIR/dst-bad-assign.rs:45:5 + | +LL | f5.ptr = Bar1 {f: 36}; + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `dyn ToBar` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: the left-hand-side of an assignment must have a statically known size + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/dst-bad-coerce1.rs b/src/test/ui/compile-fail-migration/dst-bad-coerce1.rs index b0de84a5300..b0de84a5300 100644 --- a/src/test/compile-fail/dst-bad-coerce1.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-coerce1.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-coerce1.stderr b/src/test/ui/compile-fail-migration/dst-bad-coerce1.stderr new file mode 100644 index 00000000000..bb59c4d5617 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-coerce1.stderr @@ -0,0 +1,38 @@ +error[E0308]: mismatched types + --> $DIR/dst-bad-coerce1.rs:26:29 + | +LL | let f3: &Fat<[usize]> = f2; + | ^^ expected slice, found array of 3 elements + | + = note: expected type `&Fat<[usize]>` + found type `&Fat<[isize; 3]>` + +error[E0277]: the trait bound `Foo: Bar` is not satisfied + --> $DIR/dst-bad-coerce1.rs:32:25 + | +LL | let f3: &Fat<Bar> = f2; + | ^^ the trait `Bar` is not implemented for `Foo` + | + = note: required for the cast to the object type `dyn Bar` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coerce1.rs:38:27 + | +LL | let f3: &([usize],) = f2; + | ^^ expected slice, found array of 3 elements + | + = note: expected type `&([usize],)` + found type `&([isize; 3],)` + +error[E0277]: the trait bound `Foo: Bar` is not satisfied + --> $DIR/dst-bad-coerce1.rs:44:23 + | +LL | let f3: &(Bar,) = f2; + | ^^ the trait `Bar` is not implemented for `Foo` + | + = note: required for the cast to the object type `dyn Bar` + +error: aborting due to 4 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/dst-bad-coerce2.rs b/src/test/ui/compile-fail-migration/dst-bad-coerce2.rs index 9e92f649b2d..9e92f649b2d 100644 --- a/src/test/compile-fail/dst-bad-coerce2.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-coerce2.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-coerce2.stderr b/src/test/ui/compile-fail-migration/dst-bad-coerce2.stderr new file mode 100644 index 00000000000..51991544a2e --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-coerce2.stderr @@ -0,0 +1,39 @@ +error[E0308]: mismatched types + --> $DIR/dst-bad-coerce2.rs:25:33 + | +LL | let f3: &mut Fat<[isize]> = f2; //~ ERROR mismatched types + | ^^ types differ in mutability + | + = note: expected type `&mut Fat<[isize]>` + found type `&Fat<[isize; 3]>` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coerce2.rs:30:29 + | +LL | let f3: &mut Fat<Bar> = f2; //~ ERROR mismatched types + | ^^ types differ in mutability + | + = note: expected type `&mut Fat<dyn Bar>` + found type `&Fat<Foo>` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coerce2.rs:35:31 + | +LL | let f3: &mut ([isize],) = f2; //~ ERROR mismatched types + | ^^ types differ in mutability + | + = note: expected type `&mut ([isize],)` + found type `&([isize; 3],)` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coerce2.rs:40:27 + | +LL | let f3: &mut (Bar,) = f2; //~ ERROR mismatched types + | ^^ types differ in mutability + | + = note: expected type `&mut (dyn Bar,)` + found type `&(Foo,)` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/dst-bad-coerce3.nll.stderr b/src/test/ui/compile-fail-migration/dst-bad-coerce3.nll.stderr new file mode 100644 index 00000000000..bc5b4ca71cf --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-coerce3.nll.stderr @@ -0,0 +1,63 @@ +error[E0597]: `f1` does not live long enough + --> $DIR/dst-bad-coerce3.rs:26:32 + | +LL | let f2: &Fat<[isize; 3]> = &f1; //~ ERROR `f1` does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - `f1` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:8... + --> $DIR/dst-bad-coerce3.rs:23:8 + | +LL | fn baz<'a>() { + | ^^ + +error[E0597]: `f1` does not live long enough + --> $DIR/dst-bad-coerce3.rs:31:25 + | +LL | let f2: &Fat<Foo> = &f1; //~ ERROR `f1` does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - `f1` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:8... + --> $DIR/dst-bad-coerce3.rs:23:8 + | +LL | fn baz<'a>() { + | ^^ + +error[E0597]: `f1` does not live long enough + --> $DIR/dst-bad-coerce3.rs:36:30 + | +LL | let f2: &([isize; 3],) = &f1; //~ ERROR `f1` does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - `f1` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:8... + --> $DIR/dst-bad-coerce3.rs:23:8 + | +LL | fn baz<'a>() { + | ^^ + +error[E0597]: `f1` does not live long enough + --> $DIR/dst-bad-coerce3.rs:41:23 + | +LL | let f2: &(Foo,) = &f1; //~ ERROR `f1` does not live long enough + | ^^^ borrowed value does not live long enough +LL | let f3: &'a (Bar,) = f2; +LL | } + | - `f1` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:8... + --> $DIR/dst-bad-coerce3.rs:23:8 + | +LL | fn baz<'a>() { + | ^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/dst-bad-coerce3.rs b/src/test/ui/compile-fail-migration/dst-bad-coerce3.rs index 35a147c15bb..35a147c15bb 100644 --- a/src/test/compile-fail/dst-bad-coerce3.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-coerce3.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-coerce3.stderr b/src/test/ui/compile-fail-migration/dst-bad-coerce3.stderr new file mode 100644 index 00000000000..3c4eb272082 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-coerce3.stderr @@ -0,0 +1,63 @@ +error[E0597]: `f1` does not live long enough + --> $DIR/dst-bad-coerce3.rs:26:33 + | +LL | let f2: &Fat<[isize; 3]> = &f1; //~ ERROR `f1` does not live long enough + | ^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:8... + --> $DIR/dst-bad-coerce3.rs:23:8 + | +LL | fn baz<'a>() { + | ^^ + +error[E0597]: `f1` does not live long enough + --> $DIR/dst-bad-coerce3.rs:31:26 + | +LL | let f2: &Fat<Foo> = &f1; //~ ERROR `f1` does not live long enough + | ^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:8... + --> $DIR/dst-bad-coerce3.rs:23:8 + | +LL | fn baz<'a>() { + | ^^ + +error[E0597]: `f1` does not live long enough + --> $DIR/dst-bad-coerce3.rs:36:31 + | +LL | let f2: &([isize; 3],) = &f1; //~ ERROR `f1` does not live long enough + | ^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:8... + --> $DIR/dst-bad-coerce3.rs:23:8 + | +LL | fn baz<'a>() { + | ^^ + +error[E0597]: `f1` does not live long enough + --> $DIR/dst-bad-coerce3.rs:41:24 + | +LL | let f2: &(Foo,) = &f1; //~ ERROR `f1` does not live long enough + | ^^ borrowed value does not live long enough +LL | let f3: &'a (Bar,) = f2; +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:8... + --> $DIR/dst-bad-coerce3.rs:23:8 + | +LL | fn baz<'a>() { + | ^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/dst-bad-coerce4.rs b/src/test/ui/compile-fail-migration/dst-bad-coerce4.rs index 874b7588ff9..874b7588ff9 100644 --- a/src/test/compile-fail/dst-bad-coerce4.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-coerce4.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-coerce4.stderr b/src/test/ui/compile-fail-migration/dst-bad-coerce4.stderr new file mode 100644 index 00000000000..279de13cf37 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-coerce4.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/dst-bad-coerce4.rs:22:32 + | +LL | let f2: &Fat<[isize; 3]> = f1; + | ^^ expected array of 3 elements, found slice + | + = note: expected type `&Fat<[isize; 3]>` + found type `&Fat<[isize]>` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coerce4.rs:30:30 + | +LL | let f2: &([isize; 3],) = f1; + | ^^ expected array of 3 elements, found slice + | + = note: expected type `&([isize; 3],)` + found type `&([isize],)` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/dst-bad-coercions.rs b/src/test/ui/compile-fail-migration/dst-bad-coercions.rs index 883c16b0895..883c16b0895 100644 --- a/src/test/compile-fail/dst-bad-coercions.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-coercions.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-coercions.stderr b/src/test/ui/compile-fail-migration/dst-bad-coercions.stderr new file mode 100644 index 00000000000..8901ef1caaa --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-coercions.stderr @@ -0,0 +1,72 @@ +error[E0308]: mismatched types + --> $DIR/dst-bad-coercions.rs:24:17 + | +LL | let y: &S = x; //~ ERROR mismatched types + | ^ expected &S, found *-ptr + | + = note: expected type `&S` + found type `*const S` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coercions.rs:25:17 + | +LL | let y: &T = x; //~ ERROR mismatched types + | ^ + | | + | expected &dyn T, found *-ptr + | help: consider borrowing here: `&x` + | + = note: expected type `&dyn T` + found type `*const S` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coercions.rs:29:17 + | +LL | let y: &S = x; //~ ERROR mismatched types + | ^ expected &S, found *-ptr + | + = note: expected type `&S` + found type `*mut S` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coercions.rs:30:17 + | +LL | let y: &T = x; //~ ERROR mismatched types + | ^ + | | + | expected &dyn T, found *-ptr + | help: consider borrowing here: `&x` + | + = note: expected type `&dyn T` + found type `*mut S` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coercions.rs:33:21 + | +LL | let x: &mut T = &S; //~ ERROR mismatched types + | ^^ types differ in mutability + | + = note: expected type `&mut dyn T` + found type `&S` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coercions.rs:34:21 + | +LL | let x: *mut T = &S; //~ ERROR mismatched types + | ^^ types differ in mutability + | + = note: expected type `*mut dyn T` + found type `&S` + +error[E0308]: mismatched types + --> $DIR/dst-bad-coercions.rs:35:21 + | +LL | let x: *mut S = &S; //~ ERROR mismatched types + | ^^ types differ in mutability + | + = note: expected type `*mut S` + found type `&S` + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/dst-bad-deep-2.rs b/src/test/ui/compile-fail-migration/dst-bad-deep-2.rs index a54301071ba..a54301071ba 100644 --- a/src/test/compile-fail/dst-bad-deep-2.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-deep-2.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-deep-2.stderr b/src/test/ui/compile-fail-migration/dst-bad-deep-2.stderr new file mode 100644 index 00000000000..44c88527da1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-deep-2.stderr @@ -0,0 +1,15 @@ +error[E0277]: the size for values of type `[isize]` cannot be known at compilation time + --> $DIR/dst-bad-deep-2.rs:21:30 + | +LL | let h: &(([isize],),) = &(*g,); + | ^^^^^ doesn't have a size known at compile-time + | + = help: within `(([isize],),)`, the trait `std::marker::Sized` is not implemented for `[isize]` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required because it appears within the type `([isize],)` + = note: required because it appears within the type `(([isize],),)` + = note: tuples must have a statically known size to be initialized + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/dst-bad-deep.rs b/src/test/ui/compile-fail-migration/dst-bad-deep.rs index 3d7e2b8f671..3d7e2b8f671 100644 --- a/src/test/compile-fail/dst-bad-deep.rs +++ b/src/test/ui/compile-fail-migration/dst-bad-deep.rs diff --git a/src/test/ui/compile-fail-migration/dst-bad-deep.stderr b/src/test/ui/compile-fail-migration/dst-bad-deep.stderr new file mode 100644 index 00000000000..1ff4b984cd6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-bad-deep.stderr @@ -0,0 +1,15 @@ +error[E0277]: the size for values of type `[isize]` cannot be known at compilation time + --> $DIR/dst-bad-deep.rs:23:34 + | +LL | let h: &Fat<Fat<[isize]>> = &Fat { ptr: *g }; + | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Fat<Fat<[isize]>>`, the trait `std::marker::Sized` is not implemented for `[isize]` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required because it appears within the type `Fat<[isize]>` + = note: required because it appears within the type `Fat<Fat<[isize]>>` + = note: structs must have a statically known size to be initialized + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/dst-index.nll.stderr b/src/test/ui/compile-fail-migration/dst-index.nll.stderr new file mode 100644 index 00000000000..767d8a84c04 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-index.nll.stderr @@ -0,0 +1,28 @@ +error[E0161]: cannot move a value of type str: the size of str cannot be statically determined + --> $DIR/dst-index.rs:41:5 + | +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:44:5 + | +LL | T[0]; + | ^^^^ cannot move out of borrowed content + +error: aborting due to 4 previous errors + +Some errors occurred: E0161, E0507. +For more information about an error, try `rustc --explain E0161`. diff --git a/src/test/compile-fail/dst-index.rs b/src/test/ui/compile-fail-migration/dst-index.rs index c52458934bd..c52458934bd 100644 --- a/src/test/compile-fail/dst-index.rs +++ b/src/test/ui/compile-fail-migration/dst-index.rs diff --git a/src/test/ui/compile-fail-migration/dst-index.stderr b/src/test/ui/compile-fail-migration/dst-index.stderr new file mode 100644 index 00000000000..7c5e79dab99 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-index.stderr @@ -0,0 +1,28 @@ +error[E0161]: cannot move a value of type str: the size of str cannot be statically determined + --> $DIR/dst-index.rs:41:5 + | +LL | S[0]; + | ^^^^ + +error[E0161]: cannot move a value of type (dyn std::fmt::Debug + 'static): the size of (dyn std::fmt::Debug + 'static) cannot be statically determined + --> $DIR/dst-index.rs:44:5 + | +LL | T[0]; + | ^^^^ + +error[E0507]: cannot move out of indexed content + --> $DIR/dst-index.rs:41:5 + | +LL | S[0]; + | ^^^^ cannot move out of indexed content + +error[E0507]: cannot move out of indexed content + --> $DIR/dst-index.rs:44:5 + | +LL | T[0]; + | ^^^^ cannot move out of indexed content + +error: aborting due to 4 previous errors + +Some errors occurred: E0161, E0507. +For more information about an error, try `rustc --explain E0161`. diff --git a/src/test/compile-fail/dst-object-from-unsized-type.rs b/src/test/ui/compile-fail-migration/dst-object-from-unsized-type.rs index 70b46b1bd79..70b46b1bd79 100644 --- a/src/test/compile-fail/dst-object-from-unsized-type.rs +++ b/src/test/ui/compile-fail-migration/dst-object-from-unsized-type.rs diff --git a/src/test/ui/compile-fail-migration/dst-object-from-unsized-type.stderr b/src/test/ui/compile-fail-migration/dst-object-from-unsized-type.stderr new file mode 100644 index 00000000000..67f959f297d --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-object-from-unsized-type.stderr @@ -0,0 +1,45 @@ +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/dst-object-from-unsized-type.rs:18:19 + | +LL | let u: &Foo = t; + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `T` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where T: std::marker::Sized` bound + = note: required for the cast to the object type `dyn Foo` + +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/dst-object-from-unsized-type.rs:23:19 + | +LL | let v: &Foo = t as &Foo; + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `T` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where T: std::marker::Sized` bound + = note: required for the cast to the object type `dyn Foo` + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/dst-object-from-unsized-type.rs:28:24 + | +LL | let _: &[&Foo] = &["hi"]; + | ^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required for the cast to the object type `dyn Foo` + +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time + --> $DIR/dst-object-from-unsized-type.rs:33:19 + | +LL | let _: &Foo = x as &Foo; + | ^ doesn't have a size known at compile-time + | + = help: 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-sized> + = note: required for the cast to the object type `dyn Foo` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/dst-rvalue.nll.stderr b/src/test/ui/compile-fail-migration/dst-rvalue.nll.stderr new file mode 100644 index 00000000000..5eadcc3def5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-rvalue.nll.stderr @@ -0,0 +1,28 @@ +error[E0161]: cannot move a value of type str: the size of str cannot be statically determined + --> $DIR/dst-rvalue.rs:16:28 + | +LL | let _x: Box<str> = box *"hello world"; + | ^^^^^^^^^^^^^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/dst-rvalue.rs:16:28 + | +LL | let _x: Box<str> = 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[E0508]: cannot move out of type `[isize]`, a non-copy slice + --> $DIR/dst-rvalue.rs:21:32 + | +LL | let _x: Box<[isize]> = box *array; + | ^^^^^^ cannot move out of here + +error: aborting due to 4 previous errors + +Some errors occurred: E0161, E0507, E0508. +For more information about an error, try `rustc --explain E0161`. diff --git a/src/test/compile-fail/dst-rvalue.rs b/src/test/ui/compile-fail-migration/dst-rvalue.rs index 69bda8c1671..69bda8c1671 100644 --- a/src/test/compile-fail/dst-rvalue.rs +++ b/src/test/ui/compile-fail-migration/dst-rvalue.rs diff --git a/src/test/ui/compile-fail-migration/dst-rvalue.stderr b/src/test/ui/compile-fail-migration/dst-rvalue.stderr new file mode 100644 index 00000000000..0957105c8a7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-rvalue.stderr @@ -0,0 +1,28 @@ +error[E0161]: cannot move a value of type str: the size of str cannot be statically determined + --> $DIR/dst-rvalue.rs:16:28 + | +LL | let _x: Box<str> = box *"hello world"; + | ^^^^^^^^^^^^^^ + +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<str> = box *"hello world"; + | ^^^^^^^^^^^^^^ cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/dst-rvalue.rs:21:32 + | +LL | let _x: Box<[isize]> = box *array; + | ^^^^^^ cannot move out of borrowed content + +error: aborting due to 4 previous errors + +Some errors occurred: E0161, E0507. +For more information about an error, try `rustc --explain E0161`. diff --git a/src/test/compile-fail/dst-sized-trait-param.rs b/src/test/ui/compile-fail-migration/dst-sized-trait-param.rs index 7316a48970f..7316a48970f 100644 --- a/src/test/compile-fail/dst-sized-trait-param.rs +++ b/src/test/ui/compile-fail-migration/dst-sized-trait-param.rs diff --git a/src/test/ui/compile-fail-migration/dst-sized-trait-param.stderr b/src/test/ui/compile-fail-migration/dst-sized-trait-param.stderr new file mode 100644 index 00000000000..111d41baa57 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dst-sized-trait-param.stderr @@ -0,0 +1,21 @@ +error[E0277]: the size for values of type `[isize]` cannot be known at compilation time + --> $DIR/dst-sized-trait-param.rs:17:6 + | +LL | impl Foo<[isize]> for usize { } + | ^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[isize]` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + +error[E0277]: the size for values of type `[usize]` cannot be known at compilation time + --> $DIR/dst-sized-trait-param.rs:20:6 + | +LL | impl Foo<isize> for [usize] { } + | ^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[usize]` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/dupe-symbols-1.rs b/src/test/ui/compile-fail-migration/dupe-symbols-1.rs index 9fa4eafcad0..9fa4eafcad0 100644 --- a/src/test/compile-fail/dupe-symbols-1.rs +++ b/src/test/ui/compile-fail-migration/dupe-symbols-1.rs diff --git a/src/test/ui/compile-fail-migration/dupe-symbols-1.stderr b/src/test/ui/compile-fail-migration/dupe-symbols-1.stderr new file mode 100644 index 00000000000..c702a0f3a1b --- /dev/null +++ b/src/test/ui/compile-fail-migration/dupe-symbols-1.stderr @@ -0,0 +1,10 @@ +error: symbol `fail` is already defined + --> $DIR/dupe-symbols-1.rs:19:1 + | +LL | / pub fn b() { +LL | | //~^ symbol `fail` is already defined +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/dupe-symbols-2.rs b/src/test/ui/compile-fail-migration/dupe-symbols-2.rs index 1f19bd2f249..1f19bd2f249 100644 --- a/src/test/compile-fail/dupe-symbols-2.rs +++ b/src/test/ui/compile-fail-migration/dupe-symbols-2.rs diff --git a/src/test/ui/compile-fail-migration/dupe-symbols-2.stderr b/src/test/ui/compile-fail-migration/dupe-symbols-2.stderr new file mode 100644 index 00000000000..5d5e9d73d7b --- /dev/null +++ b/src/test/ui/compile-fail-migration/dupe-symbols-2.stderr @@ -0,0 +1,10 @@ +error: symbol `fail` is already defined + --> $DIR/dupe-symbols-2.rs:22:5 + | +LL | / pub extern fn fail() { +LL | | //~^ symbol `fail` is already defined +LL | | } + | |_____^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/dupe-symbols-3.rs b/src/test/ui/compile-fail-migration/dupe-symbols-3.rs index 98a61c33c58..98a61c33c58 100644 --- a/src/test/compile-fail/dupe-symbols-3.rs +++ b/src/test/ui/compile-fail-migration/dupe-symbols-3.rs diff --git a/src/test/ui/compile-fail-migration/dupe-symbols-3.stderr b/src/test/ui/compile-fail-migration/dupe-symbols-3.stderr new file mode 100644 index 00000000000..6801016373d --- /dev/null +++ b/src/test/ui/compile-fail-migration/dupe-symbols-3.stderr @@ -0,0 +1,10 @@ +error: symbol `fail` is already defined + --> $DIR/dupe-symbols-3.rs:19:1 + | +LL | / pub fn fail() { +LL | | //~^ symbol `fail` is already defined +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/dupe-symbols-4.rs b/src/test/ui/compile-fail-migration/dupe-symbols-4.rs index 9e730699d25..9e730699d25 100644 --- a/src/test/compile-fail/dupe-symbols-4.rs +++ b/src/test/ui/compile-fail-migration/dupe-symbols-4.rs diff --git a/src/test/ui/compile-fail-migration/dupe-symbols-4.stderr b/src/test/ui/compile-fail-migration/dupe-symbols-4.stderr new file mode 100644 index 00000000000..fdbb5ce90c1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dupe-symbols-4.stderr @@ -0,0 +1,8 @@ +error: symbol `fail` is already defined + --> $DIR/dupe-symbols-4.rs:30:5 + | +LL | fn fail(self) {} + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/dupe-symbols-5.rs b/src/test/ui/compile-fail-migration/dupe-symbols-5.rs index eb4b50d03ca..eb4b50d03ca 100644 --- a/src/test/compile-fail/dupe-symbols-5.rs +++ b/src/test/ui/compile-fail-migration/dupe-symbols-5.rs diff --git a/src/test/ui/compile-fail-migration/dupe-symbols-5.stderr b/src/test/ui/compile-fail-migration/dupe-symbols-5.stderr new file mode 100644 index 00000000000..8ded374127b --- /dev/null +++ b/src/test/ui/compile-fail-migration/dupe-symbols-5.stderr @@ -0,0 +1,10 @@ +error: symbol `fail` is already defined + --> $DIR/dupe-symbols-5.rs:18:1 + | +LL | / pub fn b() { +LL | | //~^ symbol `fail` is already defined +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/dupe-symbols-6.rs b/src/test/ui/compile-fail-migration/dupe-symbols-6.rs index 6f412d9a0de..6f412d9a0de 100644 --- a/src/test/compile-fail/dupe-symbols-6.rs +++ b/src/test/ui/compile-fail-migration/dupe-symbols-6.rs diff --git a/src/test/ui/compile-fail-migration/dupe-symbols-6.stderr b/src/test/ui/compile-fail-migration/dupe-symbols-6.stderr new file mode 100644 index 00000000000..6dbb831832a --- /dev/null +++ b/src/test/ui/compile-fail-migration/dupe-symbols-6.stderr @@ -0,0 +1,8 @@ +error: symbol `fail` is already defined + --> $DIR/dupe-symbols-6.rs:17:1 + | +LL | static HELLO_TWICE: u16 = 0; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/dupe-symbols-7.rs b/src/test/ui/compile-fail-migration/dupe-symbols-7.rs index c2880ba6f51..c2880ba6f51 100644 --- a/src/test/compile-fail/dupe-symbols-7.rs +++ b/src/test/ui/compile-fail-migration/dupe-symbols-7.rs diff --git a/src/test/ui/compile-fail-migration/dupe-symbols-7.stderr b/src/test/ui/compile-fail-migration/dupe-symbols-7.stderr new file mode 100644 index 00000000000..5fadbd5bd10 --- /dev/null +++ b/src/test/ui/compile-fail-migration/dupe-symbols-7.stderr @@ -0,0 +1,10 @@ +error: entry symbol `main` defined multiple times + --> $DIR/dupe-symbols-7.rs:15:1 + | +LL | fn main(){} + | ^^^^^^^^^^^ + | + = help: did you use #[no_mangle] on `fn main`? Use #[start] instead + +error: aborting due to previous error + diff --git a/src/test/compile-fail/duplicate-parameter.rs b/src/test/ui/compile-fail-migration/duplicate-parameter.rs index 7586bc61cd6..7586bc61cd6 100644 --- a/src/test/compile-fail/duplicate-parameter.rs +++ b/src/test/ui/compile-fail-migration/duplicate-parameter.rs diff --git a/src/test/ui/compile-fail-migration/duplicate-parameter.stderr b/src/test/ui/compile-fail-migration/duplicate-parameter.stderr new file mode 100644 index 00000000000..6cc7244ea79 --- /dev/null +++ b/src/test/ui/compile-fail-migration/duplicate-parameter.stderr @@ -0,0 +1,9 @@ +error[E0415]: identifier `a` is bound more than once in this parameter list + --> $DIR/duplicate-parameter.rs:11:16 + | +LL | fn f(a: isize, a: isize) {} + | ^ used as parameter more than once + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0415`. diff --git a/src/test/compile-fail/duplicate-type-parameter.rs b/src/test/ui/compile-fail-migration/duplicate-type-parameter.rs index 3b0f8ee5bda..3b0f8ee5bda 100644 --- a/src/test/compile-fail/duplicate-type-parameter.rs +++ b/src/test/ui/compile-fail-migration/duplicate-type-parameter.rs diff --git a/src/test/ui/compile-fail-migration/duplicate-type-parameter.stderr b/src/test/ui/compile-fail-migration/duplicate-type-parameter.stderr new file mode 100644 index 00000000000..186a1e52bb8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/duplicate-type-parameter.stderr @@ -0,0 +1,66 @@ +error[E0403]: the name `T` is already used for a type parameter in this type parameter list + --> $DIR/duplicate-type-parameter.rs:11:12 + | +LL | type Foo<T,T> = Option<T>; + | - ^ already used + | | + | first use of `T` + +error[E0403]: the name `T` is already used for a type parameter in this type parameter list + --> $DIR/duplicate-type-parameter.rs:14:14 + | +LL | struct Bar<T,T>(T); + | - ^ already used + | | + | first use of `T` + +error[E0403]: the name `T` is already used for a type parameter in this type parameter list + --> $DIR/duplicate-type-parameter.rs:17:14 + | +LL | struct Baz<T,T> { + | - ^ already used + | | + | first use of `T` + +error[E0403]: the name `T` is already used for a type parameter in this type parameter list + --> $DIR/duplicate-type-parameter.rs:22:12 + | +LL | enum Boo<T,T> { + | - ^ already used + | | + | first use of `T` + +error[E0403]: the name `T` is already used for a type parameter in this type parameter list + --> $DIR/duplicate-type-parameter.rs:28:11 + | +LL | fn quux<T,T>(x: T) {} + | - ^ already used + | | + | first use of `T` + +error[E0403]: the name `T` is already used for a type parameter in this type parameter list + --> $DIR/duplicate-type-parameter.rs:31:13 + | +LL | trait Qux<T,T> {} + | - ^ already used + | | + | first use of `T` + +error[E0403]: the name `T` is already used for a type parameter in this type parameter list + --> $DIR/duplicate-type-parameter.rs:34:8 + | +LL | impl<T,T> Qux<T,T> for Option<T> {} + | - ^ already used + | | + | first use of `T` + +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/duplicate-type-parameter.rs:34:6 + | +LL | impl<T,T> Qux<T,T> for Option<T> {} + | ^ unconstrained type parameter + +error: aborting due to 8 previous errors + +Some errors occurred: E0207, E0403. +For more information about an error, try `rustc --explain E0207`. diff --git a/src/test/compile-fail/duplicate_entry_error.rs b/src/test/ui/compile-fail-migration/duplicate_entry_error.rs index 176aa7cca53..176aa7cca53 100644 --- a/src/test/compile-fail/duplicate_entry_error.rs +++ b/src/test/ui/compile-fail-migration/duplicate_entry_error.rs diff --git a/src/test/ui/compile-fail-migration/duplicate_entry_error.stderr b/src/test/ui/compile-fail-migration/duplicate_entry_error.stderr new file mode 100644 index 00000000000..b330d2f30f8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/duplicate_entry_error.stderr @@ -0,0 +1,14 @@ +error[E0152]: duplicate lang item found: `panic_impl`. + --> $DIR/duplicate_entry_error.rs:20:1 + | +LL | / fn panic_impl(info: &PanicInfo) -> ! { +LL | | //~^ ERROR: duplicate lang item found: `panic_impl`. +LL | | loop {} +LL | | } + | |_^ + | + = note: first defined in crate `std`. + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0152`. diff --git a/src/test/compile-fail/dyn-trait-compatibility.rs b/src/test/ui/compile-fail-migration/dyn-trait-compatibility.rs index 454b6d2f566..454b6d2f566 100644 --- a/src/test/compile-fail/dyn-trait-compatibility.rs +++ b/src/test/ui/compile-fail-migration/dyn-trait-compatibility.rs diff --git a/src/test/ui/compile-fail-migration/dyn-trait-compatibility.stderr b/src/test/ui/compile-fail-migration/dyn-trait-compatibility.stderr new file mode 100644 index 00000000000..1ff3249371b --- /dev/null +++ b/src/test/ui/compile-fail-migration/dyn-trait-compatibility.stderr @@ -0,0 +1,52 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `dyn` + --> $DIR/dyn-trait-compatibility.rs:13:11 + | +LL | type A1 = dyn::dyn; + | ^^^ Use of undeclared type or module `dyn` + +error[E0433]: failed to resolve. Use of undeclared type or module `dyn` + --> $DIR/dyn-trait-compatibility.rs:19:23 + | +LL | type A3 = dyn<<dyn as dyn>::dyn>; + | ^^^ Use of undeclared type or module `dyn` + +error[E0412]: cannot find type `dyn` in this scope + --> $DIR/dyn-trait-compatibility.rs:11:11 + | +LL | type A0 = dyn; + | ^^^ not found in this scope + +error[E0412]: cannot find type `dyn` in this scope + --> $DIR/dyn-trait-compatibility.rs:15:11 + | +LL | type A2 = dyn<dyn, dyn>; + | ^^^ not found in this scope + +error[E0412]: cannot find type `dyn` in this scope + --> $DIR/dyn-trait-compatibility.rs:15:15 + | +LL | type A2 = dyn<dyn, dyn>; + | ^^^ not found in this scope + +error[E0412]: cannot find type `dyn` in this scope + --> $DIR/dyn-trait-compatibility.rs:15:20 + | +LL | type A2 = dyn<dyn, dyn>; + | ^^^ not found in this scope + +error[E0412]: cannot find type `dyn` in this scope + --> $DIR/dyn-trait-compatibility.rs:19:11 + | +LL | type A3 = dyn<<dyn as dyn>::dyn>; + | ^^^ not found in this scope + +error[E0412]: cannot find type `dyn` in this scope + --> $DIR/dyn-trait-compatibility.rs:19:16 + | +LL | type A3 = dyn<<dyn as dyn>::dyn>; + | ^^^ not found in this scope + +error: aborting due to 8 previous errors + +Some errors occurred: E0412, E0433. +For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/compile-fail/edition-extern-crate-allowed.rs b/src/test/ui/compile-fail-migration/edition-extern-crate-allowed.rs index 7368564e250..7368564e250 100644 --- a/src/test/compile-fail/edition-extern-crate-allowed.rs +++ b/src/test/ui/compile-fail-migration/edition-extern-crate-allowed.rs diff --git a/src/test/ui/compile-fail-migration/edition-extern-crate-allowed.stderr b/src/test/ui/compile-fail-migration/edition-extern-crate-allowed.stderr new file mode 100644 index 00000000000..7c1ccc540c5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/edition-extern-crate-allowed.stderr @@ -0,0 +1,13 @@ +warning: unused extern crate + --> $DIR/edition-extern-crate-allowed.rs:17:1 + | +LL | extern crate edition_extern_crate_allowed; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it + | +note: lint level defined here + --> $DIR/edition-extern-crate-allowed.rs:15:9 + | +LL | #![warn(rust_2018_idioms)] + | ^^^^^^^^^^^^^^^^ + = note: #[warn(unused_extern_crates)] implied by #[warn(rust_2018_idioms)] + diff --git a/src/test/compile-fail/edition-feature-ok.rs b/src/test/ui/compile-fail-migration/edition-feature-ok.rs index 3a3a6ff95f9..3a3a6ff95f9 100644 --- a/src/test/compile-fail/edition-feature-ok.rs +++ b/src/test/ui/compile-fail-migration/edition-feature-ok.rs diff --git a/src/test/compile-fail/edition-raw-pointer-method-2015.rs b/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2015.rs index 4ba44fa54d8..4ba44fa54d8 100644 --- a/src/test/compile-fail/edition-raw-pointer-method-2015.rs +++ b/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2015.rs diff --git a/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2015.stderr b/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2015.stderr new file mode 100644 index 00000000000..7fd098c98e3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2015.stderr @@ -0,0 +1,17 @@ +error: type annotations needed + --> $DIR/edition-raw-pointer-method-2015.rs:20:15 + | +LL | let _ = y.is_null(); + | ^^^^^^^ + | +note: lint level defined here + --> $DIR/edition-raw-pointer-method-2015.rs:16:8 + | +LL | #[deny(warnings)] + | ^^^^^^^^ + = note: #[deny(tyvar_behind_raw_pointer)] implied by #[deny(warnings)] + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in the 2018 edition! + = note: for more information, see issue #46906 <https://github.com/rust-lang/rust/issues/46906> + +error: aborting due to previous error + diff --git a/src/test/compile-fail/edition-raw-pointer-method-2018.rs b/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2018.rs index c8548ed35b9..c8548ed35b9 100644 --- a/src/test/compile-fail/edition-raw-pointer-method-2018.rs +++ b/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2018.rs diff --git a/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2018.stderr b/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2018.stderr new file mode 100644 index 00000000000..0708b4bbd46 --- /dev/null +++ b/src/test/ui/compile-fail-migration/edition-raw-pointer-method-2018.stderr @@ -0,0 +1,9 @@ +error[E0699]: the type of this value must be known to call a method on a raw pointer on it + --> $DIR/edition-raw-pointer-method-2018.rs:20:15 + | +LL | let _ = y.is_null(); + | ^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0699`. diff --git a/src/test/compile-fail/elided-test.rs b/src/test/ui/compile-fail-migration/elided-test.rs index 0cdd0010a74..0cdd0010a74 100644 --- a/src/test/compile-fail/elided-test.rs +++ b/src/test/ui/compile-fail-migration/elided-test.rs diff --git a/src/test/ui/compile-fail-migration/elided-test.stderr b/src/test/ui/compile-fail-migration/elided-test.stderr new file mode 100644 index 00000000000..d22eee4e8bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/elided-test.stderr @@ -0,0 +1,7 @@ +error[E0601]: `main` function not found in crate `elided_test` + | + = note: consider adding a `main` function to `$DIR/elided-test.rs` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/compile-fail/empty-comment.rs b/src/test/ui/compile-fail-migration/empty-comment.rs index a5568ff826b..a5568ff826b 100644 --- a/src/test/compile-fail/empty-comment.rs +++ b/src/test/ui/compile-fail-migration/empty-comment.rs diff --git a/src/test/ui/compile-fail-migration/empty-comment.stderr b/src/test/ui/compile-fail-migration/empty-comment.stderr new file mode 100644 index 00000000000..d6990c4eaeb --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-comment.stderr @@ -0,0 +1,8 @@ +error: unexpected end of macro invocation + --> $DIR/empty-comment.rs:20:5 + | +LL | one_arg_macro!(/**/); //~ ERROR unexpected end + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/empty-extern-arg.rs b/src/test/ui/compile-fail-migration/empty-extern-arg.rs index 8791481d9e7..8791481d9e7 100644 --- a/src/test/compile-fail/empty-extern-arg.rs +++ b/src/test/ui/compile-fail-migration/empty-extern-arg.rs diff --git a/src/test/ui/compile-fail-migration/empty-extern-arg.stderr b/src/test/ui/compile-fail-migration/empty-extern-arg.stderr new file mode 100644 index 00000000000..c81a647b094 --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-extern-arg.stderr @@ -0,0 +1,7 @@ +error: extern location for std does not exist: + +error[E0463]: can't find crate for `std` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/empty-linkname.rs b/src/test/ui/compile-fail-migration/empty-linkname.rs index 20e0f9cd0b2..20e0f9cd0b2 100644 --- a/src/test/compile-fail/empty-linkname.rs +++ b/src/test/ui/compile-fail-migration/empty-linkname.rs diff --git a/src/test/ui/compile-fail-migration/empty-linkname.stderr b/src/test/ui/compile-fail-migration/empty-linkname.stderr new file mode 100644 index 00000000000..9a637aa7833 --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-linkname.stderr @@ -0,0 +1,9 @@ +error[E0454]: #[link(name = "")] given with empty name + --> $DIR/empty-linkname.rs:11:1 + | +LL | #[link(name = "")] //~ ERROR: given with empty name + | ^^^^^^^^^^^^^^^^^^ empty name given + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0454`. diff --git a/src/test/compile-fail/empty-macro-use.rs b/src/test/ui/compile-fail-migration/empty-macro-use.rs index 823a7426079..823a7426079 100644 --- a/src/test/compile-fail/empty-macro-use.rs +++ b/src/test/ui/compile-fail-migration/empty-macro-use.rs diff --git a/src/test/ui/compile-fail-migration/empty-macro-use.stderr b/src/test/ui/compile-fail-migration/empty-macro-use.stderr new file mode 100644 index 00000000000..8feb0930718 --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-macro-use.stderr @@ -0,0 +1,8 @@ +error: cannot find macro `macro_two!` in this scope + --> $DIR/empty-macro-use.rs:17:5 + | +LL | macro_two!(); + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/empty-never-array.rs b/src/test/ui/compile-fail-migration/empty-never-array.rs index 53b24e17319..53b24e17319 100644 --- a/src/test/compile-fail/empty-never-array.rs +++ b/src/test/ui/compile-fail-migration/empty-never-array.rs diff --git a/src/test/ui/compile-fail-migration/empty-never-array.stderr b/src/test/ui/compile-fail-migration/empty-never-array.stderr new file mode 100644 index 00000000000..d9ef2f30aab --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-never-array.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in local binding: `T(_, _)` not covered + --> $DIR/empty-never-array.rs:20:9 + | +LL | let Helper::U(u) = Helper::T(t, []); + | ^^^^^^^^^^^^ pattern `T(_, _)` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/compile-fail/empty-struct-braces-expr.rs b/src/test/ui/compile-fail-migration/empty-struct-braces-expr.rs index 3096e8f8313..3096e8f8313 100644 --- a/src/test/compile-fail/empty-struct-braces-expr.rs +++ b/src/test/ui/compile-fail-migration/empty-struct-braces-expr.rs diff --git a/src/test/ui/compile-fail-migration/empty-struct-braces-expr.stderr b/src/test/ui/compile-fail-migration/empty-struct-braces-expr.stderr new file mode 100644 index 00000000000..9b6114875e2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-struct-braces-expr.stderr @@ -0,0 +1,68 @@ +error[E0423]: expected value, found struct `Empty1` + --> $DIR/empty-struct-braces-expr.rs:25:14 + | +LL | let e1 = Empty1; //~ ERROR expected value, found struct `Empty1` + | ^^^^^^ + | | + | did you mean `XEmpty2`? + | did you mean `Empty1 { /* fields */ }`? + +error[E0423]: expected function, found struct `Empty1` + --> $DIR/empty-struct-braces-expr.rs:26:14 + | +LL | let e1 = Empty1(); //~ ERROR expected function, found struct `Empty1` + | ^^^^^^ + | | + | did you mean `XEmpty2`? + | did you mean `Empty1 { /* fields */ }`? + +error[E0423]: expected value, found struct variant `E::Empty3` + --> $DIR/empty-struct-braces-expr.rs:27:14 + | +LL | let e3 = E::Empty3; //~ ERROR expected value, found struct variant `E::Empty3` + | ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`? + +error[E0423]: expected function, found struct variant `E::Empty3` + --> $DIR/empty-struct-braces-expr.rs:28:14 + | +LL | let e3 = E::Empty3(); //~ ERROR expected function, found struct variant `E::Empty3` + | ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`? + +error[E0423]: expected value, found struct `XEmpty1` + --> $DIR/empty-struct-braces-expr.rs:30:15 + | +LL | let xe1 = XEmpty1; //~ ERROR expected value, found struct `XEmpty1` + | ^^^^^^^ + | | + | did you mean `XEmpty2`? + | did you mean `XEmpty1 { /* fields */ }`? + +error[E0423]: expected function, found struct `XEmpty1` + --> $DIR/empty-struct-braces-expr.rs:31:15 + | +LL | let xe1 = XEmpty1(); //~ ERROR expected function, found struct `XEmpty1` + | ^^^^^^^ + | | + | did you mean `XEmpty2`? + | did you mean `XEmpty1 { /* fields */ }`? + +error[E0599]: no variant named `Empty3` found for type `empty_struct::XE` in the current scope + --> $DIR/empty-struct-braces-expr.rs:32:15 + | +LL | let xe3 = XE::Empty3; //~ ERROR no variant named `Empty3` found for type + | ^^^^^^^^^^ variant not found in `empty_struct::XE` + | + = note: did you mean `empty_struct::XE::XEmpty3`? + +error[E0599]: no variant named `Empty3` found for type `empty_struct::XE` in the current scope + --> $DIR/empty-struct-braces-expr.rs:33:15 + | +LL | let xe3 = XE::Empty3(); //~ ERROR no variant named `Empty3` found for type + | ^^^^^^^^^^ variant not found in `empty_struct::XE` + | + = note: did you mean `empty_struct::XE::XEmpty3`? + +error: aborting due to 8 previous errors + +Some errors occurred: E0423, E0599. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/compile-fail/empty-struct-braces-pat-1.rs b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-1.rs index e527170e9f9..e527170e9f9 100644 --- a/src/test/compile-fail/empty-struct-braces-pat-1.rs +++ b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-1.rs diff --git a/src/test/ui/compile-fail-migration/empty-struct-braces-pat-1.stderr b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-1.stderr new file mode 100644 index 00000000000..aad47f4d954 --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-1.stderr @@ -0,0 +1,18 @@ +error[E0532]: expected unit struct/variant or constant, found struct variant `E::Empty3` + --> $DIR/empty-struct-braces-pat-1.rs:34:9 + | +LL | E::Empty3 => () + | ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`? + +error[E0532]: expected unit struct/variant or constant, found struct variant `XE::XEmpty3` + --> $DIR/empty-struct-braces-pat-1.rs:41:9 + | +LL | XE::XEmpty3 => () + | ^^^^------- + | | | + | | did you mean `XEmpty4`? + | did you mean `XE::XEmpty3 { /* fields */ }`? + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/compile-fail/empty-struct-braces-pat-2.rs b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-2.rs index d3b13457dc6..d3b13457dc6 100644 --- a/src/test/compile-fail/empty-struct-braces-pat-2.rs +++ b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-2.rs diff --git a/src/test/ui/compile-fail-migration/empty-struct-braces-pat-2.stderr b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-2.stderr new file mode 100644 index 00000000000..26fb42c4e94 --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-2.stderr @@ -0,0 +1,39 @@ +error[E0532]: expected tuple struct/variant, found struct `Empty1` + --> $DIR/empty-struct-braces-pat-2.rs:25:9 + | +LL | Empty1() => () //~ ERROR expected tuple struct/variant, found struct `Empty1` + | ^^^^^^ + | | + | did you mean `XEmpty6`? + | did you mean `Empty1 { /* fields */ }`? + +error[E0532]: expected tuple struct/variant, found struct `XEmpty1` + --> $DIR/empty-struct-braces-pat-2.rs:28:9 + | +LL | XEmpty1() => () //~ ERROR expected tuple struct/variant, found struct `XEmpty1` + | ^^^^^^^ + | | + | did you mean `XEmpty6`? + | did you mean `XEmpty1 { /* fields */ }`? + +error[E0532]: expected tuple struct/variant, found struct `Empty1` + --> $DIR/empty-struct-braces-pat-2.rs:31:9 + | +LL | Empty1(..) => () //~ ERROR expected tuple struct/variant, found struct `Empty1` + | ^^^^^^ + | | + | did you mean `XEmpty6`? + | did you mean `Empty1 { /* fields */ }`? + +error[E0532]: expected tuple struct/variant, found struct `XEmpty1` + --> $DIR/empty-struct-braces-pat-2.rs:34:9 + | +LL | XEmpty1(..) => () //~ ERROR expected tuple struct/variant, found struct `XEmpty1` + | ^^^^^^^ + | | + | did you mean `XEmpty6`? + | did you mean `XEmpty1 { /* fields */ }`? + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/compile-fail/empty-struct-braces-pat-3.rs b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-3.rs index d6c5b953492..d6c5b953492 100644 --- a/src/test/compile-fail/empty-struct-braces-pat-3.rs +++ b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-3.rs diff --git a/src/test/ui/compile-fail-migration/empty-struct-braces-pat-3.stderr b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-3.stderr new file mode 100644 index 00000000000..389bf0a65c6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-struct-braces-pat-3.stderr @@ -0,0 +1,33 @@ +error[E0532]: expected tuple struct/variant, found struct variant `E::Empty3` + --> $DIR/empty-struct-braces-pat-3.rs:27:9 + | +LL | E::Empty3() => () + | ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`? + +error[E0532]: expected tuple struct/variant, found struct variant `XE::XEmpty3` + --> $DIR/empty-struct-braces-pat-3.rs:31:9 + | +LL | XE::XEmpty3() => () + | ^^^^------- + | | | + | | did you mean `XEmpty5`? + | did you mean `XE::XEmpty3 { /* fields */ }`? + +error[E0532]: expected tuple struct/variant, found struct variant `E::Empty3` + --> $DIR/empty-struct-braces-pat-3.rs:35:9 + | +LL | E::Empty3(..) => () + | ^^^^^^^^^ did you mean `E::Empty3 { /* fields */ }`? + +error[E0532]: expected tuple struct/variant, found struct variant `XE::XEmpty3` + --> $DIR/empty-struct-braces-pat-3.rs:39:9 + | +LL | XE::XEmpty3(..) => () + | ^^^^------- + | | | + | | did you mean `XEmpty5`? + | did you mean `XE::XEmpty3 { /* fields */ }`? + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/compile-fail/empty-struct-tuple-pat.rs b/src/test/ui/compile-fail-migration/empty-struct-tuple-pat.rs index 5e683eafade..5e683eafade 100644 --- a/src/test/compile-fail/empty-struct-tuple-pat.rs +++ b/src/test/ui/compile-fail-migration/empty-struct-tuple-pat.rs diff --git a/src/test/ui/compile-fail-migration/empty-struct-tuple-pat.stderr b/src/test/ui/compile-fail-migration/empty-struct-tuple-pat.stderr new file mode 100644 index 00000000000..3d219b1752f --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-struct-tuple-pat.stderr @@ -0,0 +1,36 @@ +error[E0530]: match bindings cannot shadow tuple structs + --> $DIR/empty-struct-tuple-pat.rs:32:9 + | +LL | struct Empty2(); + | ---------------- a tuple struct `Empty2` is defined here +... +LL | Empty2 => () //~ ERROR match bindings cannot shadow tuple structs + | ^^^^^^ cannot be named the same as a tuple struct + +error[E0530]: match bindings cannot shadow tuple structs + --> $DIR/empty-struct-tuple-pat.rs:35:9 + | +LL | use empty_struct::*; + | --------------- a tuple struct `XEmpty6` is imported here +... +LL | XEmpty6 => () //~ ERROR match bindings cannot shadow tuple structs + | ^^^^^^^ cannot be named the same as a tuple struct + +error[E0532]: expected unit struct/variant or constant, found tuple variant `E::Empty4` + --> $DIR/empty-struct-tuple-pat.rs:39:9 + | +LL | E::Empty4 => () + | ^^^^^^^^^ not a unit struct/variant or constant + +error[E0532]: expected unit struct/variant or constant, found tuple variant `XE::XEmpty5` + --> $DIR/empty-struct-tuple-pat.rs:43:9 + | +LL | XE::XEmpty5 => (), + | ^^^^------- + | | + | did you mean `XEmpty4`? + +error: aborting due to 4 previous errors + +Some errors occurred: E0530, E0532. +For more information about an error, try `rustc --explain E0530`. diff --git a/src/test/compile-fail/empty-struct-unit-pat.rs b/src/test/ui/compile-fail-migration/empty-struct-unit-pat.rs index 532c2d85053..532c2d85053 100644 --- a/src/test/compile-fail/empty-struct-unit-pat.rs +++ b/src/test/ui/compile-fail-migration/empty-struct-unit-pat.rs diff --git a/src/test/ui/compile-fail-migration/empty-struct-unit-pat.stderr b/src/test/ui/compile-fail-migration/empty-struct-unit-pat.stderr new file mode 100644 index 00000000000..042b53521c2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/empty-struct-unit-pat.stderr @@ -0,0 +1,55 @@ +error[E0532]: expected tuple struct/variant, found unit struct `Empty2` + --> $DIR/empty-struct-unit-pat.rs:31:9 + | +LL | Empty2() => () //~ ERROR expected tuple struct/variant, found unit struct `Empty2` + | ^^^^^^ did you mean `XEmpty6`? + +error[E0532]: expected tuple struct/variant, found unit struct `XEmpty2` + --> $DIR/empty-struct-unit-pat.rs:34:9 + | +LL | XEmpty2() => () //~ ERROR expected tuple struct/variant, found unit struct `XEmpty2` + | ^^^^^^^ did you mean `XEmpty6`? + +error[E0532]: expected tuple struct/variant, found unit struct `Empty2` + --> $DIR/empty-struct-unit-pat.rs:37:9 + | +LL | Empty2(..) => () //~ ERROR expected tuple struct/variant, found unit struct `Empty2` + | ^^^^^^ did you mean `XEmpty6`? + +error[E0532]: expected tuple struct/variant, found unit struct `XEmpty2` + --> $DIR/empty-struct-unit-pat.rs:40:9 + | +LL | XEmpty2(..) => () //~ ERROR expected tuple struct/variant, found unit struct `XEmpty2` + | ^^^^^^^ did you mean `XEmpty6`? + +error[E0532]: expected tuple struct/variant, found unit variant `E::Empty4` + --> $DIR/empty-struct-unit-pat.rs:44:9 + | +LL | E::Empty4() => () //~ ERROR expected tuple struct/variant, found unit variant `E::Empty4` + | ^^^^^^^^^ not a tuple struct/variant + +error[E0532]: expected tuple struct/variant, found unit variant `XE::XEmpty4` + --> $DIR/empty-struct-unit-pat.rs:47:9 + | +LL | XE::XEmpty4() => (), + | ^^^^------- + | | + | did you mean `XEmpty5`? + +error[E0532]: expected tuple struct/variant, found unit variant `E::Empty4` + --> $DIR/empty-struct-unit-pat.rs:52:9 + | +LL | E::Empty4(..) => () //~ ERROR expected tuple struct/variant, found unit variant `E::Empty4` + | ^^^^^^^^^ not a tuple struct/variant + +error[E0532]: expected tuple struct/variant, found unit variant `XE::XEmpty4` + --> $DIR/empty-struct-unit-pat.rs:55:9 + | +LL | XE::XEmpty4(..) => (), + | ^^^^------- + | | + | did you mean `XEmpty5`? + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/compile-fail/enable-unstable-lib-feature.rs b/src/test/ui/compile-fail-migration/enable-unstable-lib-feature.rs index b10a0a60f14..b10a0a60f14 100644 --- a/src/test/compile-fail/enable-unstable-lib-feature.rs +++ b/src/test/ui/compile-fail-migration/enable-unstable-lib-feature.rs diff --git a/src/test/ui/compile-fail-migration/enable-unstable-lib-feature.stderr b/src/test/ui/compile-fail-migration/enable-unstable-lib-feature.stderr new file mode 100644 index 00000000000..20b2eb51fcb --- /dev/null +++ b/src/test/ui/compile-fail-migration/enable-unstable-lib-feature.stderr @@ -0,0 +1,14 @@ +error: function `BOGUS` should have a snake case name such as `bogus` + --> $DIR/enable-unstable-lib-feature.rs:22:1 + | +LL | pub fn BOGUS() { } //~ ERROR + | ^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/enable-unstable-lib-feature.rs:16:9 + | +LL | #![deny(non_snake_case)] // To trigger a hard error + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/enum-discrim-autosizing.rs b/src/test/ui/compile-fail-migration/enum-discrim-autosizing.rs index 3a243330ad9..3a243330ad9 100644 --- a/src/test/compile-fail/enum-discrim-autosizing.rs +++ b/src/test/ui/compile-fail-migration/enum-discrim-autosizing.rs diff --git a/src/test/ui/compile-fail-migration/enum-discrim-autosizing.stderr b/src/test/ui/compile-fail-migration/enum-discrim-autosizing.stderr new file mode 100644 index 00000000000..3b4ac436898 --- /dev/null +++ b/src/test/ui/compile-fail-migration/enum-discrim-autosizing.stderr @@ -0,0 +1,16 @@ +error[E0601]: `main` function not found in crate `enum_discrim_autosizing` + | + = note: consider adding a `main` function to `$DIR/enum-discrim-autosizing.rs` + +error[E0081]: discriminant value `0` already exists + --> $DIR/enum-discrim-autosizing.rs:18:12 + | +LL | Au64 = 0, + | - first use of `0` +LL | Bu64 = 0x8000_0000_0000_0000 //~ERROR already exists + | ^^^^^^^^^^^^^^^^^^^^^ enum already has `0` + +error: aborting due to 2 previous errors + +Some errors occurred: E0081, E0601. +For more information about an error, try `rustc --explain E0081`. diff --git a/src/test/compile-fail/enum-discrim-too-small.rs b/src/test/ui/compile-fail-migration/enum-discrim-too-small.rs index 393a67be57f..393a67be57f 100644 --- a/src/test/compile-fail/enum-discrim-too-small.rs +++ b/src/test/ui/compile-fail-migration/enum-discrim-too-small.rs diff --git a/src/test/ui/compile-fail-migration/enum-discrim-too-small.stderr b/src/test/ui/compile-fail-migration/enum-discrim-too-small.stderr new file mode 100644 index 00000000000..4c8ff52c12b --- /dev/null +++ b/src/test/ui/compile-fail-migration/enum-discrim-too-small.stderr @@ -0,0 +1,35 @@ +error[E0600]: cannot apply unary operator `-` to type `u8` + --> $DIR/enum-discrim-too-small.rs:16:11 + | +LL | Cu8 = -23, + | ^^^ cannot apply unary operator `-` + | + = note: unsigned values cannot be negated + +error[E0600]: cannot apply unary operator `-` to type `u16` + --> $DIR/enum-discrim-too-small.rs:24:12 + | +LL | Cu16 = -22333, + | ^^^^^^ cannot apply unary operator `-` + | + = note: unsigned values cannot be negated + +error[E0600]: cannot apply unary operator `-` to type `u32` + --> $DIR/enum-discrim-too-small.rs:32:12 + | +LL | Cu32 = -2_000_000_000, + | ^^^^^^^^^^^^^^ cannot apply unary operator `-` + | + = note: unsigned values cannot be negated + +error[E0600]: cannot apply unary operator `-` to type `u64` + --> $DIR/enum-discrim-too-small.rs:40:12 + | +LL | Cu32 = -2_000_000_000, + | ^^^^^^^^^^^^^^ cannot apply unary operator `-` + | + = note: unsigned values cannot be negated + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0600`. diff --git a/src/test/compile-fail/enum-discrim-too-small2.rs b/src/test/ui/compile-fail-migration/enum-discrim-too-small2.rs index d66716c14c3..d66716c14c3 100644 --- a/src/test/compile-fail/enum-discrim-too-small2.rs +++ b/src/test/ui/compile-fail-migration/enum-discrim-too-small2.rs diff --git a/src/test/ui/compile-fail-migration/enum-discrim-too-small2.stderr b/src/test/ui/compile-fail-migration/enum-discrim-too-small2.stderr new file mode 100644 index 00000000000..536dbf64a9d --- /dev/null +++ b/src/test/ui/compile-fail-migration/enum-discrim-too-small2.stderr @@ -0,0 +1,32 @@ +error: literal out of range for i8 + --> $DIR/enum-discrim-too-small2.rs:18:11 + | +LL | Ci8 = 223, //~ ERROR literal out of range for i8 + | ^^^ + | +note: lint level defined here + --> $DIR/enum-discrim-too-small2.rs:11:9 + | +LL | #![deny(overflowing_literals)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: literal out of range for i16 + --> $DIR/enum-discrim-too-small2.rs:25:12 + | +LL | Ci16 = 55555, //~ ERROR literal out of range for i16 + | ^^^^^ + +error: literal out of range for i32 + --> $DIR/enum-discrim-too-small2.rs:32:12 + | +LL | Ci32 = 3_000_000_000, //~ ERROR literal out of range for i32 + | ^^^^^^^^^^^^^ + +error: literal out of range for i64 + --> $DIR/enum-discrim-too-small2.rs:39:12 + | +LL | Ci64 = 9223372036854775809, //~ ERROR literal out of range for i64 + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/enum-in-scope.rs b/src/test/ui/compile-fail-migration/enum-in-scope.rs index bc1bd03f2d6..bc1bd03f2d6 100644 --- a/src/test/compile-fail/enum-in-scope.rs +++ b/src/test/ui/compile-fail-migration/enum-in-scope.rs diff --git a/src/test/ui/compile-fail-migration/enum-in-scope.stderr b/src/test/ui/compile-fail-migration/enum-in-scope.stderr new file mode 100644 index 00000000000..1e8d5940495 --- /dev/null +++ b/src/test/ui/compile-fail-migration/enum-in-scope.stderr @@ -0,0 +1,12 @@ +error[E0530]: let bindings cannot shadow tuple structs + --> $DIR/enum-in-scope.rs:14:9 + | +LL | struct hello(isize); + | -------------------- a tuple struct `hello` is defined here +... +LL | let hello = 0; //~ERROR let bindings cannot shadow tuple structs + | ^^^^^ cannot be named the same as a tuple struct + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0530`. diff --git a/src/test/compile-fail/enum-to-float-cast-2.rs b/src/test/ui/compile-fail-migration/enum-to-float-cast-2.rs index e6f473c8aac..e6f473c8aac 100644 --- a/src/test/compile-fail/enum-to-float-cast-2.rs +++ b/src/test/ui/compile-fail-migration/enum-to-float-cast-2.rs diff --git a/src/test/ui/compile-fail-migration/enum-to-float-cast-2.stderr b/src/test/ui/compile-fail-migration/enum-to-float-cast-2.stderr new file mode 100644 index 00000000000..e8e6d8fbcfb --- /dev/null +++ b/src/test/ui/compile-fail-migration/enum-to-float-cast-2.stderr @@ -0,0 +1,19 @@ +error[E0606]: casting `E` as `f32` is invalid + --> $DIR/enum-to-float-cast-2.rs:24:13 + | +LL | let a = E::L0 as f32; //~ ERROR casting + | ^^^^^^^^^^^^ + | + = help: cast through an integer first + +error[E0606]: casting `F` as `f32` is invalid + --> $DIR/enum-to-float-cast-2.rs:25:13 + | +LL | let c = F::H1 as f32; //~ ERROR casting + | ^^^^^^^^^^^^ + | + = help: cast through an integer first + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0606`. diff --git a/src/test/compile-fail/enum-to-float-cast.rs b/src/test/ui/compile-fail-migration/enum-to-float-cast.rs index b562ba0e41a..b562ba0e41a 100644 --- a/src/test/compile-fail/enum-to-float-cast.rs +++ b/src/test/ui/compile-fail-migration/enum-to-float-cast.rs diff --git a/src/test/ui/compile-fail-migration/enum-to-float-cast.stderr b/src/test/ui/compile-fail-migration/enum-to-float-cast.stderr new file mode 100644 index 00000000000..adc2015909c --- /dev/null +++ b/src/test/ui/compile-fail-migration/enum-to-float-cast.stderr @@ -0,0 +1,19 @@ +error[E0606]: casting `E` as `f32` is invalid + --> $DIR/enum-to-float-cast.rs:23:18 + | +LL | static C0: f32 = E::L0 as f32; //~ ERROR casting + | ^^^^^^^^^^^^ + | + = help: cast through an integer first + +error[E0606]: casting `F` as `f32` is invalid + --> $DIR/enum-to-float-cast.rs:24:18 + | +LL | static C1: f32 = F::H1 as f32; //~ ERROR casting + | ^^^^^^^^^^^^ + | + = help: cast through an integer first + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0606`. diff --git a/src/test/compile-fail/enum-variant-type-2.rs b/src/test/ui/compile-fail-migration/enum-variant-type-2.rs index 258bfd1e3ba..258bfd1e3ba 100644 --- a/src/test/compile-fail/enum-variant-type-2.rs +++ b/src/test/ui/compile-fail-migration/enum-variant-type-2.rs diff --git a/src/test/ui/compile-fail-migration/enum-variant-type-2.stderr b/src/test/ui/compile-fail-migration/enum-variant-type-2.stderr new file mode 100644 index 00000000000..7a786af71bb --- /dev/null +++ b/src/test/ui/compile-fail-migration/enum-variant-type-2.stderr @@ -0,0 +1,12 @@ +error[E0573]: expected type, found variant `Foo::Bar` + --> $DIR/enum-variant-type-2.rs:17:11 + | +LL | fn foo(x: Foo::Bar) {} //~ ERROR expected type, found variant `Foo::Bar` + | ^^^^^^^^ + | | + | not a type + | help: you can try using the variant's enum: `Foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/compile-fail/enums-pats-not-idents.rs b/src/test/ui/compile-fail-migration/enums-pats-not-idents.rs index 36bd54f599b..36bd54f599b 100644 --- a/src/test/compile-fail/enums-pats-not-idents.rs +++ b/src/test/ui/compile-fail-migration/enums-pats-not-idents.rs diff --git a/src/test/ui/compile-fail-migration/enums-pats-not-idents.stderr b/src/test/ui/compile-fail-migration/enums-pats-not-idents.stderr new file mode 100644 index 00000000000..5bd119622e5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/enums-pats-not-idents.stderr @@ -0,0 +1,9 @@ +error[E0531]: cannot find tuple struct/variant `a` in this scope + --> $DIR/enums-pats-not-idents.rs:12:9 + | +LL | let a(1) = 13; //~ ERROR cannot find tuple struct/variant `a` in this scope + | ^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0531`. diff --git a/src/test/compile-fail/error-should-say-copy-not-pod.rs b/src/test/ui/compile-fail-migration/error-should-say-copy-not-pod.rs index 8b1e2fc1966..8b1e2fc1966 100644 --- a/src/test/compile-fail/error-should-say-copy-not-pod.rs +++ b/src/test/ui/compile-fail-migration/error-should-say-copy-not-pod.rs diff --git a/src/test/ui/compile-fail-migration/error-should-say-copy-not-pod.stderr b/src/test/ui/compile-fail-migration/error-should-say-copy-not-pod.stderr new file mode 100644 index 00000000000..704cd4f4838 --- /dev/null +++ b/src/test/ui/compile-fail-migration/error-should-say-copy-not-pod.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied + --> $DIR/error-should-say-copy-not-pod.rs:16:5 + | +LL | check_bound("nocopy".to_string()); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::string::String` + | +note: required by `check_bound` + --> $DIR/error-should-say-copy-not-pod.rs:13:1 + | +LL | fn check_bound<T:Copy>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/estr-subtyping.rs b/src/test/ui/compile-fail-migration/estr-subtyping.rs index b5c6db0cea9..b5c6db0cea9 100644 --- a/src/test/compile-fail/estr-subtyping.rs +++ b/src/test/ui/compile-fail-migration/estr-subtyping.rs diff --git a/src/test/ui/compile-fail-migration/estr-subtyping.stderr b/src/test/ui/compile-fail-migration/estr-subtyping.stderr new file mode 100644 index 00000000000..fcff9d0380e --- /dev/null +++ b/src/test/ui/compile-fail-migration/estr-subtyping.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/estr-subtyping.rs:20:15 + | +LL | wants_uniq(x); //~ ERROR mismatched types + | ^ + | | + | expected struct `std::string::String`, found &str + | help: try using a conversion method: `x.to_string()` + | + = note: expected type `std::string::String` + found type `&str` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/eval-enum.rs b/src/test/ui/compile-fail-migration/eval-enum.rs index ada038114d8..ada038114d8 100644 --- a/src/test/compile-fail/eval-enum.rs +++ b/src/test/ui/compile-fail-migration/eval-enum.rs diff --git a/src/test/ui/compile-fail-migration/eval-enum.stderr b/src/test/ui/compile-fail-migration/eval-enum.stderr new file mode 100644 index 00000000000..f26c48f1a72 --- /dev/null +++ b/src/test/ui/compile-fail-migration/eval-enum.stderr @@ -0,0 +1,41 @@ +error: attempt to divide by zero + --> $DIR/eval-enum.rs:12:15 + | +LL | DivZero = 1/0, + | ^^^ + | + = note: #[deny(const_err)] on by default + +error: this expression will panic at runtime + --> $DIR/eval-enum.rs:12:15 + | +LL | DivZero = 1/0, + | ^^^ attempt to divide by zero + +error[E0080]: could not evaluate enum discriminant + --> $DIR/eval-enum.rs:12:15 + | +LL | DivZero = 1/0, + | ^^^ attempt to divide by zero + +error: attempt to calculate the remainder with a divisor of zero + --> $DIR/eval-enum.rs:16:15 + | +LL | RemZero = 1%0, + | ^^^ + +error: this expression will panic at runtime + --> $DIR/eval-enum.rs:16:15 + | +LL | RemZero = 1%0, + | ^^^ attempt to calculate the remainder with a divisor of zero + +error[E0080]: could not evaluate enum discriminant + --> $DIR/eval-enum.rs:16:15 + | +LL | RemZero = 1%0, + | ^^^ attempt to calculate the remainder with a divisor of zero + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/compile-fail/exclusive-drop-and-copy.rs b/src/test/ui/compile-fail-migration/exclusive-drop-and-copy.rs index b4cb2469659..b4cb2469659 100644 --- a/src/test/compile-fail/exclusive-drop-and-copy.rs +++ b/src/test/ui/compile-fail-migration/exclusive-drop-and-copy.rs diff --git a/src/test/ui/compile-fail-migration/exclusive-drop-and-copy.stderr b/src/test/ui/compile-fail-migration/exclusive-drop-and-copy.stderr new file mode 100644 index 00000000000..1c5e62e21a8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/exclusive-drop-and-copy.stderr @@ -0,0 +1,15 @@ +error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor + --> $DIR/exclusive-drop-and-copy.rs:13:10 + | +LL | #[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented + | ^^^^ Copy not allowed on types with destructors + +error[E0184]: the trait `Copy` may not be implemented for this type; the type has a destructor + --> $DIR/exclusive-drop-and-copy.rs:20:10 + | +LL | #[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented + | ^^^^ Copy not allowed on types with destructors + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0184`. diff --git a/src/test/compile-fail/exclusive_range_pattern_syntax_collision.rs b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision.rs index 69e5898ed4d..69e5898ed4d 100644 --- a/src/test/compile-fail/exclusive_range_pattern_syntax_collision.rs +++ b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision.rs diff --git a/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision.stderr b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision.stderr new file mode 100644 index 00000000000..6ccf7efbb88 --- /dev/null +++ b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision.stderr @@ -0,0 +1,8 @@ +error: unexpected token: `,` + --> $DIR/exclusive_range_pattern_syntax_collision.rs:15:15 + | +LL | [_, 99.., _] => {}, //~ ERROR unexpected token: `,` + | ^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/exclusive_range_pattern_syntax_collision2.rs b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision2.rs index 9212ea86118..9212ea86118 100644 --- a/src/test/compile-fail/exclusive_range_pattern_syntax_collision2.rs +++ b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision2.rs diff --git a/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision2.stderr b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision2.stderr new file mode 100644 index 00000000000..d1863cbfb6f --- /dev/null +++ b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision2.stderr @@ -0,0 +1,8 @@ +error: unexpected token: `]` + --> $DIR/exclusive_range_pattern_syntax_collision2.rs:15:15 + | +LL | [_, 99..] => {}, //~ ERROR unexpected token: `]` + | ^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/exclusive_range_pattern_syntax_collision3.rs b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision3.rs index d83305857ac..d83305857ac 100644 --- a/src/test/compile-fail/exclusive_range_pattern_syntax_collision3.rs +++ b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision3.rs diff --git a/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision3.stderr b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision3.stderr new file mode 100644 index 00000000000..21b2d0c5c57 --- /dev/null +++ b/src/test/ui/compile-fail-migration/exclusive_range_pattern_syntax_collision3.stderr @@ -0,0 +1,8 @@ +error: expected one of `,` or `]`, found `9` + --> $DIR/exclusive_range_pattern_syntax_collision3.rs:15:12 + | +LL | [..9, 99..100, _] => {}, //~ ERROR expected one of `,` or `]`, found `9` + | ^ expected one of `,` or `]` here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/expanded-cfg.rs b/src/test/ui/compile-fail-migration/expanded-cfg.rs index 77351f6e4f1..77351f6e4f1 100644 --- a/src/test/compile-fail/expanded-cfg.rs +++ b/src/test/ui/compile-fail-migration/expanded-cfg.rs diff --git a/src/test/ui/compile-fail-migration/expanded-cfg.stderr b/src/test/ui/compile-fail-migration/expanded-cfg.stderr new file mode 100644 index 00000000000..d7bc47fad27 --- /dev/null +++ b/src/test/ui/compile-fail-migration/expanded-cfg.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/expanded-cfg.rs:32:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/explicit-call-to-dtor.rs b/src/test/ui/compile-fail-migration/explicit-call-to-dtor.rs index 90030488dd6..90030488dd6 100644 --- a/src/test/compile-fail/explicit-call-to-dtor.rs +++ b/src/test/ui/compile-fail-migration/explicit-call-to-dtor.rs diff --git a/src/test/ui/compile-fail-migration/explicit-call-to-dtor.stderr b/src/test/ui/compile-fail-migration/explicit-call-to-dtor.stderr new file mode 100644 index 00000000000..264d820042b --- /dev/null +++ b/src/test/ui/compile-fail-migration/explicit-call-to-dtor.stderr @@ -0,0 +1,9 @@ +error[E0040]: explicit use of destructor method + --> $DIR/explicit-call-to-dtor.rs:23:7 + | +LL | x.drop(); //~ ERROR explicit use of destructor method + | ^^^^ explicit destructor calls not allowed + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0040`. diff --git a/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs b/src/test/ui/compile-fail-migration/explicit-call-to-supertrait-dtor.rs index 63ed74dfa49..63ed74dfa49 100644 --- a/src/test/compile-fail/explicit-call-to-supertrait-dtor.rs +++ b/src/test/ui/compile-fail-migration/explicit-call-to-supertrait-dtor.rs diff --git a/src/test/ui/compile-fail-migration/explicit-call-to-supertrait-dtor.stderr b/src/test/ui/compile-fail-migration/explicit-call-to-supertrait-dtor.stderr new file mode 100644 index 00000000000..0d0ae629def --- /dev/null +++ b/src/test/ui/compile-fail-migration/explicit-call-to-supertrait-dtor.stderr @@ -0,0 +1,9 @@ +error[E0040]: explicit use of destructor method + --> $DIR/explicit-call-to-supertrait-dtor.rs:27:14 + | +LL | self.drop(); //~ ERROR explicit use of destructor method + | ^^^^ explicit destructor calls not allowed + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0040`. diff --git a/src/test/compile-fail/explicit-self-lifetime-mismatch.rs b/src/test/ui/compile-fail-migration/explicit-self-lifetime-mismatch.rs index eac134ff3cc..eac134ff3cc 100644 --- a/src/test/compile-fail/explicit-self-lifetime-mismatch.rs +++ b/src/test/ui/compile-fail-migration/explicit-self-lifetime-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/explicit-self-lifetime-mismatch.stderr b/src/test/ui/compile-fail-migration/explicit-self-lifetime-mismatch.stderr new file mode 100644 index 00000000000..6a22d20467b --- /dev/null +++ b/src/test/ui/compile-fail-migration/explicit-self-lifetime-mismatch.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched method receiver + --> $DIR/explicit-self-lifetime-mismatch.rs:18:12 + | +LL | Foo<'b,'a> + | ^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Foo<'a, 'b>` + found type `Foo<'b, 'a>` +note: the lifetime 'b as defined on the impl at 16:9... + --> $DIR/explicit-self-lifetime-mismatch.rs:16:9 + | +LL | impl<'a,'b> Foo<'a,'b> { + | ^^ +note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 16:6 + --> $DIR/explicit-self-lifetime-mismatch.rs:16:6 + | +LL | impl<'a,'b> Foo<'a,'b> { + | ^^ + +error[E0308]: mismatched method receiver + --> $DIR/explicit-self-lifetime-mismatch.rs:18:12 + | +LL | Foo<'b,'a> + | ^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Foo<'a, 'b>` + found type `Foo<'b, 'a>` +note: the lifetime 'a as defined on the impl at 16:6... + --> $DIR/explicit-self-lifetime-mismatch.rs:16:6 + | +LL | impl<'a,'b> Foo<'a,'b> { + | ^^ +note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 16:9 + --> $DIR/explicit-self-lifetime-mismatch.rs:16:9 + | +LL | impl<'a,'b> Foo<'a,'b> { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/export-fully-qualified.rs b/src/test/ui/compile-fail-migration/export-fully-qualified.rs index 19fa13f8377..19fa13f8377 100644 --- a/src/test/compile-fail/export-fully-qualified.rs +++ b/src/test/ui/compile-fail-migration/export-fully-qualified.rs diff --git a/src/test/ui/compile-fail-migration/export-fully-qualified.stderr b/src/test/ui/compile-fail-migration/export-fully-qualified.stderr new file mode 100644 index 00000000000..b8409929763 --- /dev/null +++ b/src/test/ui/compile-fail-migration/export-fully-qualified.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `foo` + --> $DIR/export-fully-qualified.rs:16:20 + | +LL | pub fn bar() { foo::baz(); } //~ ERROR failed to resolve. Use of undeclared type or module `foo` + | ^^^ Use of undeclared type or module `foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/export-import.rs b/src/test/ui/compile-fail-migration/export-import.rs index 3877250126d..3877250126d 100644 --- a/src/test/compile-fail/export-import.rs +++ b/src/test/ui/compile-fail-migration/export-import.rs diff --git a/src/test/ui/compile-fail-migration/export-import.stderr b/src/test/ui/compile-fail-migration/export-import.stderr new file mode 100644 index 00000000000..2f12485f123 --- /dev/null +++ b/src/test/ui/compile-fail-migration/export-import.stderr @@ -0,0 +1,9 @@ +error[E0603]: function `unexported` is private + --> $DIR/export-import.rs:11:5 + | +LL | use m::unexported; + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/export-tag-variant.rs b/src/test/ui/compile-fail-migration/export-tag-variant.rs index b6e8cf71ddd..b6e8cf71ddd 100644 --- a/src/test/compile-fail/export-tag-variant.rs +++ b/src/test/ui/compile-fail-migration/export-tag-variant.rs diff --git a/src/test/ui/compile-fail-migration/export-tag-variant.stderr b/src/test/ui/compile-fail-migration/export-tag-variant.stderr new file mode 100644 index 00000000000..da67e2c4199 --- /dev/null +++ b/src/test/ui/compile-fail-migration/export-tag-variant.stderr @@ -0,0 +1,9 @@ +error[E0603]: enum `y` is private + --> $DIR/export-tag-variant.rs:17:21 + | +LL | fn main() { let z = foo::y::y1; } //~ ERROR: enum `y` is private + | ^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/export.rs b/src/test/ui/compile-fail-migration/export.rs index c28ea70c752..c28ea70c752 100644 --- a/src/test/compile-fail/export.rs +++ b/src/test/ui/compile-fail-migration/export.rs diff --git a/src/test/ui/compile-fail-migration/export.stderr b/src/test/ui/compile-fail-migration/export.stderr new file mode 100644 index 00000000000..dd19e83750b --- /dev/null +++ b/src/test/ui/compile-fail-migration/export.stderr @@ -0,0 +1,34 @@ +error[E0425]: cannot find function `log` in this scope + --> $DIR/export.rs:12:26 + | +LL | pub fn x(y: isize) { log(debug, y); } + | ^^^ not found in this scope + +error[E0425]: cannot find value `debug` in this scope + --> $DIR/export.rs:12:30 + | +LL | pub fn x(y: isize) { log(debug, y); } + | ^^^^^ not found in this scope + +error[E0425]: cannot find function `log` in this scope + --> $DIR/export.rs:15:22 + | +LL | fn z(y: isize) { log(debug, y); } + | ^^^ not found in this scope + +error[E0425]: cannot find value `debug` in this scope + --> $DIR/export.rs:15:26 + | +LL | fn z(y: isize) { log(debug, y); } + | ^^^^^ not found in this scope + +error[E0603]: function `z` is private + --> $DIR/export.rs:20:13 + | +LL | fn main() { foo::z(10); } //~ ERROR function `z` is private + | ^^^^^^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0425, E0603. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/export2.rs b/src/test/ui/compile-fail-migration/export2.rs index dc96ce7f504..dc96ce7f504 100644 --- a/src/test/compile-fail/export2.rs +++ b/src/test/ui/compile-fail-migration/export2.rs diff --git a/src/test/ui/compile-fail-migration/export2.stderr b/src/test/ui/compile-fail-migration/export2.stderr new file mode 100644 index 00000000000..c76afb8a1e2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/export2.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `bar` + --> $DIR/export2.rs:12:18 + | +LL | pub fn x() { bar::x(); } //~ ERROR failed to resolve. Use of undeclared type or module `bar` + | ^^^ Use of undeclared type or module `bar` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/expr_attr_paren_order.rs b/src/test/ui/compile-fail-migration/expr_attr_paren_order.rs index 49b2fa0e350..49b2fa0e350 100644 --- a/src/test/compile-fail/expr_attr_paren_order.rs +++ b/src/test/ui/compile-fail-migration/expr_attr_paren_order.rs diff --git a/src/test/ui/compile-fail-migration/expr_attr_paren_order.stderr b/src/test/ui/compile-fail-migration/expr_attr_paren_order.stderr new file mode 100644 index 00000000000..938ff51b37d --- /dev/null +++ b/src/test/ui/compile-fail-migration/expr_attr_paren_order.stderr @@ -0,0 +1,14 @@ +error: variable `X` should have a snake case name such as `x` + --> $DIR/expr_attr_paren_order.rs:29:17 + | +LL | let X = 0; //~ ERROR snake case name + | ^ + | +note: lint level defined here + --> $DIR/expr_attr_paren_order.rs:27:17 + | +LL | #![deny(non_snake_case)] + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/ext-nonexistent.rs b/src/test/ui/compile-fail-migration/ext-nonexistent.rs index a5bf7960624..a5bf7960624 100644 --- a/src/test/compile-fail/ext-nonexistent.rs +++ b/src/test/ui/compile-fail-migration/ext-nonexistent.rs diff --git a/src/test/ui/compile-fail-migration/ext-nonexistent.stderr b/src/test/ui/compile-fail-migration/ext-nonexistent.stderr new file mode 100644 index 00000000000..ff027f18476 --- /dev/null +++ b/src/test/ui/compile-fail-migration/ext-nonexistent.stderr @@ -0,0 +1,8 @@ +error: cannot find macro `iamnotanextensionthatexists!` in this scope + --> $DIR/ext-nonexistent.rs:12:13 + | +LL | fn main() { iamnotanextensionthatexists!(""); } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extenv-arg-2-not-string-literal.rs b/src/test/ui/compile-fail-migration/extenv-arg-2-not-string-literal.rs index c2362689721..c2362689721 100644 --- a/src/test/compile-fail/extenv-arg-2-not-string-literal.rs +++ b/src/test/ui/compile-fail-migration/extenv-arg-2-not-string-literal.rs diff --git a/src/test/ui/compile-fail-migration/extenv-arg-2-not-string-literal.stderr b/src/test/ui/compile-fail-migration/extenv-arg-2-not-string-literal.stderr new file mode 100644 index 00000000000..4a10deb4bdd --- /dev/null +++ b/src/test/ui/compile-fail-migration/extenv-arg-2-not-string-literal.stderr @@ -0,0 +1,8 @@ +error: expected string literal + --> $DIR/extenv-arg-2-not-string-literal.rs:11:25 + | +LL | fn main() { env!("one", 10); } //~ ERROR: expected string literal + | ^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extenv-no-args.rs b/src/test/ui/compile-fail-migration/extenv-no-args.rs index afa47dbe744..afa47dbe744 100644 --- a/src/test/compile-fail/extenv-no-args.rs +++ b/src/test/ui/compile-fail-migration/extenv-no-args.rs diff --git a/src/test/ui/compile-fail-migration/extenv-no-args.stderr b/src/test/ui/compile-fail-migration/extenv-no-args.stderr new file mode 100644 index 00000000000..ebd97c014f1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/extenv-no-args.stderr @@ -0,0 +1,8 @@ +error: env! takes 1 or 2 arguments + --> $DIR/extenv-no-args.rs:11:13 + | +LL | fn main() { env!(); } //~ ERROR: env! takes 1 or 2 arguments + | ^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extenv-not-defined-custom.rs b/src/test/ui/compile-fail-migration/extenv-not-defined-custom.rs index 485b6c09f0a..485b6c09f0a 100644 --- a/src/test/compile-fail/extenv-not-defined-custom.rs +++ b/src/test/ui/compile-fail-migration/extenv-not-defined-custom.rs diff --git a/src/test/ui/compile-fail-migration/extenv-not-defined-custom.stderr b/src/test/ui/compile-fail-migration/extenv-not-defined-custom.stderr new file mode 100644 index 00000000000..845f87df916 --- /dev/null +++ b/src/test/ui/compile-fail-migration/extenv-not-defined-custom.stderr @@ -0,0 +1,8 @@ +error: my error message + --> $DIR/extenv-not-defined-custom.rs:11:13 + | +LL | fn main() { env!("__HOPEFULLY_NOT_DEFINED__", "my error message"); } //~ ERROR: my error message + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extenv-not-defined-default.rs b/src/test/ui/compile-fail-migration/extenv-not-defined-default.rs index d99d4dc33a2..d99d4dc33a2 100644 --- a/src/test/compile-fail/extenv-not-defined-default.rs +++ b/src/test/ui/compile-fail-migration/extenv-not-defined-default.rs diff --git a/src/test/ui/compile-fail-migration/extenv-not-defined-default.stderr b/src/test/ui/compile-fail-migration/extenv-not-defined-default.stderr new file mode 100644 index 00000000000..0db6f536edb --- /dev/null +++ b/src/test/ui/compile-fail-migration/extenv-not-defined-default.stderr @@ -0,0 +1,8 @@ +error: environment variable `__HOPEFULLY_NOT_DEFINED__` not defined + --> $DIR/extenv-not-defined-default.rs:12:5 + | +LL | env!("__HOPEFULLY_NOT_DEFINED__"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extenv-not-string-literal.rs b/src/test/ui/compile-fail-migration/extenv-not-string-literal.rs index 07ce47a14d8..07ce47a14d8 100644 --- a/src/test/compile-fail/extenv-not-string-literal.rs +++ b/src/test/ui/compile-fail-migration/extenv-not-string-literal.rs diff --git a/src/test/ui/compile-fail-migration/extenv-not-string-literal.stderr b/src/test/ui/compile-fail-migration/extenv-not-string-literal.stderr new file mode 100644 index 00000000000..1660d8665dc --- /dev/null +++ b/src/test/ui/compile-fail-migration/extenv-not-string-literal.stderr @@ -0,0 +1,8 @@ +error: expected string literal + --> $DIR/extenv-not-string-literal.rs:11:18 + | +LL | fn main() { env!(10, "two"); } //~ ERROR: expected string literal + | ^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extenv-too-many-args.rs b/src/test/ui/compile-fail-migration/extenv-too-many-args.rs index c6c4f0ec6b8..c6c4f0ec6b8 100644 --- a/src/test/compile-fail/extenv-too-many-args.rs +++ b/src/test/ui/compile-fail-migration/extenv-too-many-args.rs diff --git a/src/test/ui/compile-fail-migration/extenv-too-many-args.stderr b/src/test/ui/compile-fail-migration/extenv-too-many-args.stderr new file mode 100644 index 00000000000..e4eda9e9e9a --- /dev/null +++ b/src/test/ui/compile-fail-migration/extenv-too-many-args.stderr @@ -0,0 +1,8 @@ +error: env! takes 1 or 2 arguments + --> $DIR/extenv-too-many-args.rs:11:13 + | +LL | fn main() { env!("one", "two", "three"); } //~ ERROR: env! takes 1 or 2 arguments + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extern-crate-visibility.rs b/src/test/ui/compile-fail-migration/extern-crate-visibility.rs index 6bb88e40910..6bb88e40910 100644 --- a/src/test/compile-fail/extern-crate-visibility.rs +++ b/src/test/ui/compile-fail-migration/extern-crate-visibility.rs diff --git a/src/test/ui/compile-fail-migration/extern-crate-visibility.stderr b/src/test/ui/compile-fail-migration/extern-crate-visibility.stderr new file mode 100644 index 00000000000..cadb636bf0d --- /dev/null +++ b/src/test/ui/compile-fail-migration/extern-crate-visibility.stderr @@ -0,0 +1,15 @@ +error[E0603]: extern crate `core` is private + --> $DIR/extern-crate-visibility.rs:16:5 + | +LL | use foo::core::cell; //~ ERROR extern crate `core` is private + | ^^^^^^^^^^^^^^^ + +error[E0603]: extern crate `core` is private + --> $DIR/extern-crate-visibility.rs:19:5 + | +LL | foo::core::cell::Cell::new(0); //~ ERROR extern crate `core` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/extern-macro.rs b/src/test/ui/compile-fail-migration/extern-macro.rs index 4267103ab9a..4267103ab9a 100644 --- a/src/test/compile-fail/extern-macro.rs +++ b/src/test/ui/compile-fail-migration/extern-macro.rs diff --git a/src/test/ui/compile-fail-migration/extern-macro.stderr b/src/test/ui/compile-fail-migration/extern-macro.stderr new file mode 100644 index 00000000000..8918ac3143b --- /dev/null +++ b/src/test/ui/compile-fail-migration/extern-macro.stderr @@ -0,0 +1,8 @@ +error: fail to resolve non-ident macro path + --> $DIR/extern-macro.rs:17:13 + | +LL | let _ = Foo::bar!(); //~ ERROR fail to resolve non-ident macro path + | ^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extern-main-fn.rs b/src/test/ui/compile-fail-migration/extern-main-fn.rs index d9bdb4ecd04..d9bdb4ecd04 100644 --- a/src/test/compile-fail/extern-main-fn.rs +++ b/src/test/ui/compile-fail-migration/extern-main-fn.rs diff --git a/src/test/ui/compile-fail-migration/extern-main-fn.stderr b/src/test/ui/compile-fail-migration/extern-main-fn.stderr new file mode 100644 index 00000000000..24e9d138693 --- /dev/null +++ b/src/test/ui/compile-fail-migration/extern-main-fn.stderr @@ -0,0 +1,12 @@ +error[E0580]: main function has wrong type + --> $DIR/extern-main-fn.rs:11:1 + | +LL | extern fn main() {} //~ ERROR: main function has wrong type [E0580] + | ^^^^^^^^^^^^^^^^ expected "Rust" fn, found "C" fn + | + = note: expected type `fn()` + found type `extern "C" fn()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0580`. diff --git a/src/test/compile-fail/extern-types-distinct-types.rs b/src/test/ui/compile-fail-migration/extern-types-distinct-types.rs index 8b434bbfc6d..8b434bbfc6d 100644 --- a/src/test/compile-fail/extern-types-distinct-types.rs +++ b/src/test/ui/compile-fail-migration/extern-types-distinct-types.rs diff --git a/src/test/ui/compile-fail-migration/extern-types-distinct-types.stderr b/src/test/ui/compile-fail-migration/extern-types-distinct-types.stderr new file mode 100644 index 00000000000..6c74f63744f --- /dev/null +++ b/src/test/ui/compile-fail-migration/extern-types-distinct-types.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/extern-types-distinct-types.rs:19:5 + | +LL | r //~ ERROR mismatched types + | ^ expected extern type `B`, found extern type `A` + | + = note: expected type `&B` + found type `&A` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/extern-types-not-sync-send.rs b/src/test/ui/compile-fail-migration/extern-types-not-sync-send.rs index 10abb80a2f7..10abb80a2f7 100644 --- a/src/test/compile-fail/extern-types-not-sync-send.rs +++ b/src/test/ui/compile-fail-migration/extern-types-not-sync-send.rs diff --git a/src/test/ui/compile-fail-migration/extern-types-not-sync-send.stderr b/src/test/ui/compile-fail-migration/extern-types-not-sync-send.stderr new file mode 100644 index 00000000000..f076aa0fd68 --- /dev/null +++ b/src/test/ui/compile-fail-migration/extern-types-not-sync-send.stderr @@ -0,0 +1,29 @@ +error[E0277]: `A` cannot be shared between threads safely + --> $DIR/extern-types-not-sync-send.rs:23:5 + | +LL | assert_sync::<A>(); + | ^^^^^^^^^^^^^^^^ `A` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `A` +note: required by `assert_sync` + --> $DIR/extern-types-not-sync-send.rs:19:1 + | +LL | fn assert_sync<T: ?Sized + Sync>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `A` cannot be sent between threads safely + --> $DIR/extern-types-not-sync-send.rs:26:5 + | +LL | assert_send::<A>(); + | ^^^^^^^^^^^^^^^^ `A` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `A` +note: required by `assert_send` + --> $DIR/extern-types-not-sync-send.rs:20:1 + | +LL | fn assert_send<T: ?Sized + Send>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/extern-types-unsized.rs b/src/test/ui/compile-fail-migration/extern-types-unsized.rs index f2db4553868..f2db4553868 100644 --- a/src/test/compile-fail/extern-types-unsized.rs +++ b/src/test/ui/compile-fail-migration/extern-types-unsized.rs diff --git a/src/test/ui/compile-fail-migration/extern-types-unsized.stderr b/src/test/ui/compile-fail-migration/extern-types-unsized.stderr new file mode 100644 index 00000000000..b86602a687b --- /dev/null +++ b/src/test/ui/compile-fail-migration/extern-types-unsized.stderr @@ -0,0 +1,63 @@ +error[E0277]: the size for values of type `A` cannot be known at compilation time + --> $DIR/extern-types-unsized.rs:32:5 + | +LL | assert_sized::<A>(); + | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `A` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> +note: required by `assert_sized` + --> $DIR/extern-types-unsized.rs:29:1 + | +LL | fn assert_sized<T>() { } + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `A` cannot be known at compilation time + --> $DIR/extern-types-unsized.rs:35:5 + | +LL | assert_sized::<Foo>(); + | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Foo`, the trait `std::marker::Sized` is not implemented for `A` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required because it appears within the type `Foo` +note: required by `assert_sized` + --> $DIR/extern-types-unsized.rs:29:1 + | +LL | fn assert_sized<T>() { } + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `A` cannot be known at compilation time + --> $DIR/extern-types-unsized.rs:38:5 + | +LL | assert_sized::<Bar<A>>(); + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Bar<A>`, the trait `std::marker::Sized` is not implemented for `A` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required because it appears within the type `Bar<A>` +note: required by `assert_sized` + --> $DIR/extern-types-unsized.rs:29:1 + | +LL | fn assert_sized<T>() { } + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `A` cannot be known at compilation time + --> $DIR/extern-types-unsized.rs:41:5 + | +LL | assert_sized::<Bar<Bar<A>>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Bar<Bar<A>>`, the trait `std::marker::Sized` is not implemented for `A` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required because it appears within the type `Bar<A>` + = note: required because it appears within the type `Bar<Bar<A>>` +note: required by `assert_sized` + --> $DIR/extern-types-unsized.rs:29:1 + | +LL | fn assert_sized<T>() { } + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/extern-with-type-bounds.rs b/src/test/ui/compile-fail-migration/extern-with-type-bounds.rs index 9493a1ae892..9493a1ae892 100644 --- a/src/test/compile-fail/extern-with-type-bounds.rs +++ b/src/test/ui/compile-fail-migration/extern-with-type-bounds.rs diff --git a/src/test/ui/compile-fail-migration/extern-with-type-bounds.stderr b/src/test/ui/compile-fail-migration/extern-with-type-bounds.stderr new file mode 100644 index 00000000000..4b62a12d36b --- /dev/null +++ b/src/test/ui/compile-fail-migration/extern-with-type-bounds.stderr @@ -0,0 +1,9 @@ +error[E0405]: cannot find trait `NoSuchTrait` in this scope + --> $DIR/extern-with-type-bounds.rs:26:20 + | +LL | fn align_of<T: NoSuchTrait>() -> usize; + | ^^^^^^^^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0405`. diff --git a/src/test/compile-fail/extern-wrong-value-type.rs b/src/test/ui/compile-fail-migration/extern-wrong-value-type.rs index 66b06c505e4..66b06c505e4 100644 --- a/src/test/compile-fail/extern-wrong-value-type.rs +++ b/src/test/ui/compile-fail-migration/extern-wrong-value-type.rs diff --git a/src/test/ui/compile-fail-migration/extern-wrong-value-type.stderr b/src/test/ui/compile-fail-migration/extern-wrong-value-type.stderr new file mode 100644 index 00000000000..35e0d68e46a --- /dev/null +++ b/src/test/ui/compile-fail-migration/extern-wrong-value-type.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `extern "C" fn() {f}: std::ops::Fn<()>` is not satisfied + --> $DIR/extern-wrong-value-type.rs:19:5 + | +LL | is_fn(f); + | ^^^^^ the trait `std::ops::Fn<()>` is not implemented for `extern "C" fn() {f}` + | +note: required by `is_fn` + --> $DIR/extern-wrong-value-type.rs:14:1 + | +LL | fn is_fn<F>(_: F) where F: Fn() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/external-doc-error.rs b/src/test/ui/compile-fail-migration/external-doc-error.rs index 1ae0d0bd276..1ae0d0bd276 100644 --- a/src/test/compile-fail/external-doc-error.rs +++ b/src/test/ui/compile-fail-migration/external-doc-error.rs diff --git a/src/test/ui/compile-fail-migration/external-doc-error.stderr b/src/test/ui/compile-fail-migration/external-doc-error.stderr new file mode 100644 index 00000000000..0af15be39ea --- /dev/null +++ b/src/test/ui/compile-fail-migration/external-doc-error.stderr @@ -0,0 +1,8 @@ +error: couldn't read $DIR/not-a-file.md: No such file or directory (os error 2) + --> $DIR/external-doc-error.rs:13:1 + | +LL | #[doc(include = "not-a-file.md")] //~ ERROR: couldn't read + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extoption_env-no-args.rs b/src/test/ui/compile-fail-migration/extoption_env-no-args.rs index fd56756584a..fd56756584a 100644 --- a/src/test/compile-fail/extoption_env-no-args.rs +++ b/src/test/ui/compile-fail-migration/extoption_env-no-args.rs diff --git a/src/test/ui/compile-fail-migration/extoption_env-no-args.stderr b/src/test/ui/compile-fail-migration/extoption_env-no-args.stderr new file mode 100644 index 00000000000..d01aefe46b1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/extoption_env-no-args.stderr @@ -0,0 +1,8 @@ +error: option_env! takes 1 argument + --> $DIR/extoption_env-no-args.rs:11:13 + | +LL | fn main() { option_env!(); } //~ ERROR: option_env! takes 1 argument + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extoption_env-not-string-literal.rs b/src/test/ui/compile-fail-migration/extoption_env-not-string-literal.rs index 6371a5c711d..6371a5c711d 100644 --- a/src/test/compile-fail/extoption_env-not-string-literal.rs +++ b/src/test/ui/compile-fail-migration/extoption_env-not-string-literal.rs diff --git a/src/test/ui/compile-fail-migration/extoption_env-not-string-literal.stderr b/src/test/ui/compile-fail-migration/extoption_env-not-string-literal.stderr new file mode 100644 index 00000000000..af4163259ea --- /dev/null +++ b/src/test/ui/compile-fail-migration/extoption_env-not-string-literal.stderr @@ -0,0 +1,8 @@ +error: argument must be a string literal + --> $DIR/extoption_env-not-string-literal.rs:11:25 + | +LL | fn main() { option_env!(10); } //~ ERROR: argument must be a string literal + | ^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/extoption_env-too-many-args.rs b/src/test/ui/compile-fail-migration/extoption_env-too-many-args.rs index b31e857c14e..b31e857c14e 100644 --- a/src/test/compile-fail/extoption_env-too-many-args.rs +++ b/src/test/ui/compile-fail-migration/extoption_env-too-many-args.rs diff --git a/src/test/ui/compile-fail-migration/extoption_env-too-many-args.stderr b/src/test/ui/compile-fail-migration/extoption_env-too-many-args.stderr new file mode 100644 index 00000000000..0e4569d7a01 --- /dev/null +++ b/src/test/ui/compile-fail-migration/extoption_env-too-many-args.stderr @@ -0,0 +1,8 @@ +error: option_env! takes 1 argument + --> $DIR/extoption_env-too-many-args.rs:11:13 + | +LL | fn main() { option_env!("one", "two"); } //~ ERROR: option_env! takes 1 argument + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/fail-no-dead-code-core.rs b/src/test/ui/compile-fail-migration/fail-no-dead-code-core.rs index aed76e36fca..aed76e36fca 100644 --- a/src/test/compile-fail/fail-no-dead-code-core.rs +++ b/src/test/ui/compile-fail-migration/fail-no-dead-code-core.rs diff --git a/src/test/ui/compile-fail-migration/fail-no-dead-code-core.stderr b/src/test/ui/compile-fail-migration/fail-no-dead-code-core.stderr new file mode 100644 index 00000000000..d2af77a28d3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/fail-no-dead-code-core.stderr @@ -0,0 +1,14 @@ +error: function is never used: `foo` + --> $DIR/fail-no-dead-code-core.rs:17:1 + | +LL | fn foo() { //~ ERROR function is never used + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/fail-no-dead-code-core.rs:11:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/fail-no-dead-code.rs b/src/test/ui/compile-fail-migration/fail-no-dead-code.rs index 6e5d3a31355..6e5d3a31355 100644 --- a/src/test/compile-fail/fail-no-dead-code.rs +++ b/src/test/ui/compile-fail-migration/fail-no-dead-code.rs diff --git a/src/test/ui/compile-fail-migration/fail-no-dead-code.stderr b/src/test/ui/compile-fail-migration/fail-no-dead-code.stderr new file mode 100644 index 00000000000..f355c7dd731 --- /dev/null +++ b/src/test/ui/compile-fail-migration/fail-no-dead-code.stderr @@ -0,0 +1,14 @@ +error: function is never used: `foo` + --> $DIR/fail-no-dead-code.rs:14:1 + | +LL | fn foo() { //~ ERROR function is never used + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/fail-no-dead-code.rs:11:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/fail-simple.rs b/src/test/ui/compile-fail-migration/fail-simple.rs index a20ff864705..a20ff864705 100644 --- a/src/test/compile-fail/fail-simple.rs +++ b/src/test/ui/compile-fail-migration/fail-simple.rs diff --git a/src/test/ui/compile-fail-migration/fail-simple.stderr b/src/test/ui/compile-fail-migration/fail-simple.stderr new file mode 100644 index 00000000000..764f2c464bc --- /dev/null +++ b/src/test/ui/compile-fail-migration/fail-simple.stderr @@ -0,0 +1,8 @@ +error: no rules expected the token `@` + --> $DIR/fail-simple.rs:12:12 + | +LL | panic!(@); //~ ERROR no rules expected the token `@` + | ^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/feature-gate-alloc-error-handler.rs b/src/test/ui/compile-fail-migration/feature-gate-alloc-error-handler.rs index 66691af2d03..66691af2d03 100644 --- a/src/test/compile-fail/feature-gate-alloc-error-handler.rs +++ b/src/test/ui/compile-fail-migration/feature-gate-alloc-error-handler.rs diff --git a/src/test/ui/compile-fail-migration/feature-gate-alloc-error-handler.stderr b/src/test/ui/compile-fail-migration/feature-gate-alloc-error-handler.stderr new file mode 100644 index 00000000000..255d5b06c17 --- /dev/null +++ b/src/test/ui/compile-fail-migration/feature-gate-alloc-error-handler.stderr @@ -0,0 +1,11 @@ +error[E0658]: #[alloc_error_handler] is an unstable feature (see issue #51540) + --> $DIR/feature-gate-alloc-error-handler.rs:18:1 + | +LL | #[alloc_error_handler] //~ ERROR #[alloc_error_handler] is an unstable feature (see issue #51540) + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(alloc_error_handler)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/feature-gate-panic-implementation.rs b/src/test/ui/compile-fail-migration/feature-gate-panic-implementation.rs index ae9fbc7b13b..ae9fbc7b13b 100644 --- a/src/test/compile-fail/feature-gate-panic-implementation.rs +++ b/src/test/ui/compile-fail-migration/feature-gate-panic-implementation.rs diff --git a/src/test/ui/compile-fail-migration/feature-gate-panic-implementation.stderr b/src/test/ui/compile-fail-migration/feature-gate-panic-implementation.stderr new file mode 100644 index 00000000000..f99228bef1d --- /dev/null +++ b/src/test/ui/compile-fail-migration/feature-gate-panic-implementation.stderr @@ -0,0 +1,11 @@ +error[E0658]: #[panic_implementation] is an unstable feature (see issue #44489) + --> $DIR/feature-gate-panic-implementation.rs:18:1 + | +LL | #[panic_implementation] //~ ERROR #[panic_implementation] is an unstable feature (see issue #44489) + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(panic_implementation)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/feature-gate-tool_lints.rs b/src/test/ui/compile-fail-migration/feature-gate-tool_lints.rs index c311eb7ed7a..c311eb7ed7a 100644 --- a/src/test/compile-fail/feature-gate-tool_lints.rs +++ b/src/test/ui/compile-fail-migration/feature-gate-tool_lints.rs diff --git a/src/test/ui/compile-fail-migration/feature-gate-tool_lints.stderr b/src/test/ui/compile-fail-migration/feature-gate-tool_lints.stderr new file mode 100644 index 00000000000..8840b3906dc --- /dev/null +++ b/src/test/ui/compile-fail-migration/feature-gate-tool_lints.stderr @@ -0,0 +1,11 @@ +error[E0658]: scoped lint `clippy::assign_ops` is experimental (see issue #44690) + --> $DIR/feature-gate-tool_lints.rs:11:8 + | +LL | #[warn(clippy::assign_ops)] //~ ERROR scoped lint `clippy::assign_ops` is experimental + | ^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(tool_lints)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs b/src/test/ui/compile-fail-migration/feature-gate-without_gate_irrefutable_pattern.rs index 7bcddbb6a2f..7bcddbb6a2f 100644 --- a/src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs +++ b/src/test/ui/compile-fail-migration/feature-gate-without_gate_irrefutable_pattern.rs diff --git a/src/test/ui/compile-fail-migration/feature-gate-without_gate_irrefutable_pattern.stderr b/src/test/ui/compile-fail-migration/feature-gate-without_gate_irrefutable_pattern.stderr new file mode 100644 index 00000000000..2b23962a304 --- /dev/null +++ b/src/test/ui/compile-fail-migration/feature-gate-without_gate_irrefutable_pattern.stderr @@ -0,0 +1,9 @@ +error[E0162]: irrefutable if-let pattern + --> $DIR/feature-gate-without_gate_irrefutable_pattern.rs:15:12 + | +LL | if let _ = 5 {} + | ^ irrefutable pattern + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0162`. diff --git a/src/test/compile-fail/feature-gated-feature-in-macro-arg.rs b/src/test/ui/compile-fail-migration/feature-gated-feature-in-macro-arg.rs index ae342af4a52..ae342af4a52 100644 --- a/src/test/compile-fail/feature-gated-feature-in-macro-arg.rs +++ b/src/test/ui/compile-fail-migration/feature-gated-feature-in-macro-arg.rs diff --git a/src/test/ui/compile-fail-migration/feature-gated-feature-in-macro-arg.stderr b/src/test/ui/compile-fail-migration/feature-gated-feature-in-macro-arg.stderr new file mode 100644 index 00000000000..41b3e3eaf10 --- /dev/null +++ b/src/test/ui/compile-fail-migration/feature-gated-feature-in-macro-arg.stderr @@ -0,0 +1,13 @@ +error[E0658]: intrinsics are subject to change + --> $DIR/feature-gated-feature-in-macro-arg.rs:18:9 + | +LL | / extern "rust-intrinsic" { //~ ERROR intrinsics are subject to change +LL | | fn atomic_fence(); +LL | | } + | |_________^ + | + = help: add #![feature(intrinsics)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/float-literal-inference-restrictions.rs b/src/test/ui/compile-fail-migration/float-literal-inference-restrictions.rs index 1e58df69f16..1e58df69f16 100644 --- a/src/test/compile-fail/float-literal-inference-restrictions.rs +++ b/src/test/ui/compile-fail-migration/float-literal-inference-restrictions.rs diff --git a/src/test/ui/compile-fail-migration/float-literal-inference-restrictions.stderr b/src/test/ui/compile-fail-migration/float-literal-inference-restrictions.stderr new file mode 100644 index 00000000000..80ca6d073dc --- /dev/null +++ b/src/test/ui/compile-fail-migration/float-literal-inference-restrictions.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/float-literal-inference-restrictions.rs:12:18 + | +LL | let x: f32 = 1; //~ ERROR mismatched types + | ^ expected f32, found integral variable + | + = note: expected type `f32` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/float-literal-inference-restrictions.rs:13:18 + | +LL | let y: f32 = 1f64; //~ ERROR mismatched types + | ^^^^ expected f32, found f64 + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/fn-bad-block-type.rs b/src/test/ui/compile-fail-migration/fn-bad-block-type.rs index c5c355cfbce..c5c355cfbce 100644 --- a/src/test/compile-fail/fn-bad-block-type.rs +++ b/src/test/ui/compile-fail-migration/fn-bad-block-type.rs diff --git a/src/test/ui/compile-fail-migration/fn-bad-block-type.stderr b/src/test/ui/compile-fail-migration/fn-bad-block-type.stderr new file mode 100644 index 00000000000..23d76e54531 --- /dev/null +++ b/src/test/ui/compile-fail-migration/fn-bad-block-type.stderr @@ -0,0 +1,11 @@ +error[E0308]: mismatched types + --> $DIR/fn-bad-block-type.rs:13:19 + | +LL | fn f() -> isize { true } + | ----- ^^^^ expected isize, found bool + | | + | expected `isize` because of return type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/fn-compare-mismatch.rs b/src/test/ui/compile-fail-migration/fn-compare-mismatch.rs index 27be1ada445..27be1ada445 100644 --- a/src/test/compile-fail/fn-compare-mismatch.rs +++ b/src/test/ui/compile-fail-migration/fn-compare-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/fn-compare-mismatch.stderr b/src/test/ui/compile-fail-migration/fn-compare-mismatch.stderr new file mode 100644 index 00000000000..995a17e01bf --- /dev/null +++ b/src/test/ui/compile-fail-migration/fn-compare-mismatch.stderr @@ -0,0 +1,21 @@ +error[E0369]: binary operation `==` cannot be applied to type `fn() {main::f}` + --> $DIR/fn-compare-mismatch.rs:14:13 + | +LL | let x = f == g; + | ^^^^^^ + | + = note: an implementation of `std::cmp::PartialEq` might be missing for `fn() {main::f}` + +error[E0308]: mismatched types + --> $DIR/fn-compare-mismatch.rs:14:18 + | +LL | let x = f == g; + | ^ expected fn item, found a different fn item + | + = note: expected type `fn() {main::f}` + found type `fn() {main::g}` + +error: aborting due to 2 previous errors + +Some errors occurred: E0308, E0369. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/fn-item-type.rs b/src/test/ui/compile-fail-migration/fn-item-type.rs index 6217a9f16b9..6217a9f16b9 100644 --- a/src/test/compile-fail/fn-item-type.rs +++ b/src/test/ui/compile-fail-migration/fn-item-type.rs diff --git a/src/test/ui/compile-fail-migration/fn-item-type.stderr b/src/test/ui/compile-fail-migration/fn-item-type.stderr new file mode 100644 index 00000000000..59dd4b294aa --- /dev/null +++ b/src/test/ui/compile-fail-migration/fn-item-type.stderr @@ -0,0 +1,39 @@ +error[E0308]: mismatched types + --> $DIR/fn-item-type.rs:23:19 + | +LL | eq(foo::<u8>, bar::<u8>); + | ^^^^^^^^^ expected fn item, found a different fn item + | + = note: expected type `fn(isize) -> isize {foo::<u8>}` + found type `fn(isize) -> isize {bar::<u8>}` + +error[E0308]: mismatched types + --> $DIR/fn-item-type.rs:29:19 + | +LL | eq(foo::<u8>, foo::<i8>); + | ^^^^^^^^^ expected u8, found i8 + | + = note: expected type `fn(isize) -> isize {foo::<u8>}` + found type `fn(isize) -> isize {foo::<i8>}` + +error[E0308]: mismatched types + --> $DIR/fn-item-type.rs:33:23 + | +LL | eq(bar::<String>, bar::<Vec<u8>>); + | ^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `std::vec::Vec` + | + = note: expected type `fn(isize) -> isize {bar::<std::string::String>}` + found type `fn(isize) -> isize {bar::<std::vec::Vec<u8>>}` + +error[E0308]: mismatched types + --> $DIR/fn-item-type.rs:40:26 + | +LL | eq(<u8 as Foo>::foo, <u16 as Foo>::foo); + | ^^^^^^^^^^^^^^^^^ expected u8, found u16 + | + = note: expected type `fn() {<u8 as Foo>::foo}` + found type `fn() {<u16 as Foo>::foo}` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/fn-trait-formatting.rs b/src/test/ui/compile-fail-migration/fn-trait-formatting.rs index 56d64d77ee2..56d64d77ee2 100644 --- a/src/test/compile-fail/fn-trait-formatting.rs +++ b/src/test/ui/compile-fail-migration/fn-trait-formatting.rs diff --git a/src/test/ui/compile-fail-migration/fn-trait-formatting.stderr b/src/test/ui/compile-fail-migration/fn-trait-formatting.stderr new file mode 100644 index 00000000000..5bf1ed76d5f --- /dev/null +++ b/src/test/ui/compile-fail-migration/fn-trait-formatting.stderr @@ -0,0 +1,46 @@ +error[E0308]: mismatched types + --> $DIR/fn-trait-formatting.rs:16:17 + | +LL | let _: () = (box |_: isize| {}) as Box<FnOnce(isize)>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` + | + = note: expected type `()` + found type `std::boxed::Box<dyn std::ops::FnOnce(isize)>` + +error[E0308]: mismatched types + --> $DIR/fn-trait-formatting.rs:20:17 + | +LL | let _: () = (box |_: isize, isize| {}) as Box<Fn(isize, isize)>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` + | + = note: expected type `()` + found type `std::boxed::Box<dyn std::ops::Fn(isize, isize)>` + +error[E0308]: mismatched types + --> $DIR/fn-trait-formatting.rs:24:17 + | +LL | let _: () = (box || -> isize { unimplemented!() }) as Box<FnMut() -> isize>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` + | + = note: expected type `()` + found type `std::boxed::Box<dyn std::ops::FnMut() -> isize>` + +error[E0277]: the trait bound `{integer}: std::ops::Fn<(isize,)>` is not satisfied + --> $DIR/fn-trait-formatting.rs:29:5 + | +LL | needs_fn(1); + | ^^^^^^^^ the trait `std::ops::Fn<(isize,)>` is not implemented for `{integer}` + | + = help: the following implementations were found: + <&'a F as std::ops::Fn<A>> + <core::str::LinesAnyMap as std::ops::Fn<(&'a str,)>> +note: required by `needs_fn` + --> $DIR/fn-trait-formatting.rs:13:1 + | +LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/for-expn.rs b/src/test/ui/compile-fail-migration/for-expn.rs index 7e9d4df005d..7e9d4df005d 100644 --- a/src/test/compile-fail/for-expn.rs +++ b/src/test/ui/compile-fail-migration/for-expn.rs diff --git a/src/test/ui/compile-fail-migration/for-expn.stderr b/src/test/ui/compile-fail-migration/for-expn.stderr new file mode 100644 index 00000000000..14c2c1a6d3d --- /dev/null +++ b/src/test/ui/compile-fail-migration/for-expn.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `foo` in this scope + --> $DIR/for-expn.rs:16:7 + | +LL | foo //~ ERROR cannot find value `foo` in this scope + | ^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/for-loop-bogosity.rs b/src/test/ui/compile-fail-migration/for-loop-bogosity.rs index 96ad184fd35..96ad184fd35 100644 --- a/src/test/compile-fail/for-loop-bogosity.rs +++ b/src/test/ui/compile-fail-migration/for-loop-bogosity.rs diff --git a/src/test/ui/compile-fail-migration/for-loop-bogosity.stderr b/src/test/ui/compile-fail-migration/for-loop-bogosity.stderr new file mode 100644 index 00000000000..0476ec06c70 --- /dev/null +++ b/src/test/ui/compile-fail-migration/for-loop-bogosity.stderr @@ -0,0 +1,12 @@ +error[E0277]: the trait bound `MyStruct: std::iter::Iterator` is not satisfied + --> $DIR/for-loop-bogosity.rs:27:14 + | +LL | for x in bogus { //~ ERROR `MyStruct: std::iter::Iterator` is not satisfied + | ^^^^^ `MyStruct` is not an iterator; maybe try calling `.iter()` or a similar method + | + = help: the trait `std::iter::Iterator` is not implemented for `MyStruct` + = note: required by `std::iter::IntoIterator::into_iter` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/for-loop-refutable-pattern-error-message.rs b/src/test/ui/compile-fail-migration/for-loop-refutable-pattern-error-message.rs index 81c4db68628..81c4db68628 100644 --- a/src/test/compile-fail/for-loop-refutable-pattern-error-message.rs +++ b/src/test/ui/compile-fail-migration/for-loop-refutable-pattern-error-message.rs diff --git a/src/test/ui/compile-fail-migration/for-loop-refutable-pattern-error-message.stderr b/src/test/ui/compile-fail-migration/for-loop-refutable-pattern-error-message.stderr new file mode 100644 index 00000000000..b76c2ffc240 --- /dev/null +++ b/src/test/ui/compile-fail-migration/for-loop-refutable-pattern-error-message.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in `for` loop binding: `&_` not covered + --> $DIR/for-loop-refutable-pattern-error-message.rs:12:9 + | +LL | for &1 in [1].iter() {} //~ ERROR refutable pattern in `for` loop binding + | ^^ pattern `&_` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/compile-fail/for-loop-type-error.rs b/src/test/ui/compile-fail-migration/for-loop-type-error.rs index 7f0e40128f5..7f0e40128f5 100644 --- a/src/test/compile-fail/for-loop-type-error.rs +++ b/src/test/ui/compile-fail-migration/for-loop-type-error.rs diff --git a/src/test/ui/compile-fail-migration/for-loop-type-error.stderr b/src/test/ui/compile-fail-migration/for-loop-type-error.stderr new file mode 100644 index 00000000000..f80a457dce3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/for-loop-type-error.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `+` cannot be applied to type `()` + --> $DIR/for-loop-type-error.rs:12:13 + | +LL | let x = () + (); //~ ERROR binary operation + | ^^^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/for-loop-unconstrained-element-type.rs b/src/test/ui/compile-fail-migration/for-loop-unconstrained-element-type.rs index fb5553166ba..fb5553166ba 100644 --- a/src/test/compile-fail/for-loop-unconstrained-element-type.rs +++ b/src/test/ui/compile-fail-migration/for-loop-unconstrained-element-type.rs diff --git a/src/test/ui/compile-fail-migration/for-loop-unconstrained-element-type.stderr b/src/test/ui/compile-fail-migration/for-loop-unconstrained-element-type.stderr new file mode 100644 index 00000000000..c3723c52fda --- /dev/null +++ b/src/test/ui/compile-fail-migration/for-loop-unconstrained-element-type.stderr @@ -0,0 +1,12 @@ +error[E0282]: type annotations needed + --> $DIR/for-loop-unconstrained-element-type.rs:18:14 + | +LL | for i in Vec::new() { } //~ ERROR type annotations needed + | ^^^^^^^^^^ + | | + | cannot infer type + | the element type for this iterator is not specified + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/compile-fail/foreign-fn-return-lifetime.rs b/src/test/ui/compile-fail-migration/foreign-fn-return-lifetime.rs index da77066150c..da77066150c 100644 --- a/src/test/compile-fail/foreign-fn-return-lifetime.rs +++ b/src/test/ui/compile-fail-migration/foreign-fn-return-lifetime.rs diff --git a/src/test/ui/compile-fail-migration/foreign-fn-return-lifetime.stderr b/src/test/ui/compile-fail-migration/foreign-fn-return-lifetime.stderr new file mode 100644 index 00000000000..ea15897b3d6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/foreign-fn-return-lifetime.stderr @@ -0,0 +1,12 @@ +error[E0106]: missing lifetime specifier + --> $DIR/foreign-fn-return-lifetime.rs:13:15 + | +LL | fn f() -> &u8; //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from + = help: consider giving it a 'static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/compile-fail/foreign-unsafe-fn-called.rs b/src/test/ui/compile-fail-migration/foreign-unsafe-fn-called.rs index 5fad4c3677c..5fad4c3677c 100644 --- a/src/test/compile-fail/foreign-unsafe-fn-called.rs +++ b/src/test/ui/compile-fail-migration/foreign-unsafe-fn-called.rs diff --git a/src/test/ui/compile-fail-migration/foreign-unsafe-fn-called.stderr b/src/test/ui/compile-fail-migration/foreign-unsafe-fn-called.stderr new file mode 100644 index 00000000000..498dd04e08f --- /dev/null +++ b/src/test/ui/compile-fail-migration/foreign-unsafe-fn-called.stderr @@ -0,0 +1,11 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/foreign-unsafe-fn-called.rs:19:5 + | +LL | test::free(); + | ^^^^^^^^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/fully-qualified-type-name1.rs b/src/test/ui/compile-fail-migration/fully-qualified-type-name1.rs index 1a7ceb2e763..1a7ceb2e763 100644 --- a/src/test/compile-fail/fully-qualified-type-name1.rs +++ b/src/test/ui/compile-fail-migration/fully-qualified-type-name1.rs diff --git a/src/test/ui/compile-fail-migration/fully-qualified-type-name1.stderr b/src/test/ui/compile-fail-migration/fully-qualified-type-name1.stderr new file mode 100644 index 00000000000..55553c084c9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/fully-qualified-type-name1.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/fully-qualified-type-name1.rs:15:9 + | +LL | x = 5; + | ^ + | | + | expected enum `std::option::Option`, found integral variable + | help: try using a variant of the expected type: `Some(5)` + | + = note: expected type `std::option::Option<usize>` + found type `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/fully-qualified-type-name2.rs b/src/test/ui/compile-fail-migration/fully-qualified-type-name2.rs index 9ba8a11d536..9ba8a11d536 100644 --- a/src/test/compile-fail/fully-qualified-type-name2.rs +++ b/src/test/ui/compile-fail-migration/fully-qualified-type-name2.rs diff --git a/src/test/ui/compile-fail-migration/fully-qualified-type-name2.stderr b/src/test/ui/compile-fail-migration/fully-qualified-type-name2.stderr new file mode 100644 index 00000000000..f2881894b0a --- /dev/null +++ b/src/test/ui/compile-fail-migration/fully-qualified-type-name2.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/fully-qualified-type-name2.rs:22:12 + | +LL | return x; + | ^ expected enum `y::foo`, found enum `x::foo` + | + = note: expected type `y::foo` + found type `x::foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/fully-qualified-type-name3.rs b/src/test/ui/compile-fail-migration/fully-qualified-type-name3.rs index dc0c9a093ff..dc0c9a093ff 100644 --- a/src/test/compile-fail/fully-qualified-type-name3.rs +++ b/src/test/ui/compile-fail-migration/fully-qualified-type-name3.rs diff --git a/src/test/compile-fail/fully-qualified-type-name4.rs b/src/test/ui/compile-fail-migration/fully-qualified-type-name4.rs index 3c8fde751f1..3c8fde751f1 100644 --- a/src/test/compile-fail/fully-qualified-type-name4.rs +++ b/src/test/ui/compile-fail-migration/fully-qualified-type-name4.rs diff --git a/src/test/ui/compile-fail-migration/fully-qualified-type-name4.stderr b/src/test/ui/compile-fail-migration/fully-qualified-type-name4.stderr new file mode 100644 index 00000000000..eb855484468 --- /dev/null +++ b/src/test/ui/compile-fail-migration/fully-qualified-type-name4.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/fully-qualified-type-name4.rs:16:12 + | +LL | return x; + | ^ expected enum `std::option::Option`, found usize + | + = note: expected type `std::option::Option<usize>` + found type `usize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/functional-struct-update-noncopyable.nll.stderr b/src/test/ui/compile-fail-migration/functional-struct-update-noncopyable.nll.stderr new file mode 100644 index 00000000000..832b570512a --- /dev/null +++ b/src/test/ui/compile-fail-migration/functional-struct-update-noncopyable.nll.stderr @@ -0,0 +1,9 @@ +error[E0509]: cannot move out of type `A`, which implements the `Drop` trait + --> $DIR/functional-struct-update-noncopyable.rs:22:14 + | +LL | let _b = A { y: Arc::new(3), ..a }; //~ ERROR cannot move out of type `A` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/compile-fail/functional-struct-update-noncopyable.rs b/src/test/ui/compile-fail-migration/functional-struct-update-noncopyable.rs index 7ce32bbc975..7ce32bbc975 100644 --- a/src/test/compile-fail/functional-struct-update-noncopyable.rs +++ b/src/test/ui/compile-fail-migration/functional-struct-update-noncopyable.rs diff --git a/src/test/ui/compile-fail-migration/functional-struct-update-noncopyable.stderr b/src/test/ui/compile-fail-migration/functional-struct-update-noncopyable.stderr new file mode 100644 index 00000000000..ad4fb97ae09 --- /dev/null +++ b/src/test/ui/compile-fail-migration/functional-struct-update-noncopyable.stderr @@ -0,0 +1,9 @@ +error[E0509]: cannot move out of type `A`, which implements the `Drop` trait + --> $DIR/functional-struct-update-noncopyable.rs:22:36 + | +LL | let _b = A { y: Arc::new(3), ..a }; //~ ERROR cannot move out of type `A` + | ^ cannot move out of here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0509`. diff --git a/src/test/compile-fail/functional-struct-update-respects-privacy.rs b/src/test/ui/compile-fail-migration/functional-struct-update-respects-privacy.rs index 3f41401eb69..3f41401eb69 100644 --- a/src/test/compile-fail/functional-struct-update-respects-privacy.rs +++ b/src/test/ui/compile-fail-migration/functional-struct-update-respects-privacy.rs diff --git a/src/test/ui/compile-fail-migration/functional-struct-update-respects-privacy.stderr b/src/test/ui/compile-fail-migration/functional-struct-update-respects-privacy.stderr new file mode 100644 index 00000000000..35a2f8460b6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/functional-struct-update-respects-privacy.stderr @@ -0,0 +1,9 @@ +error[E0451]: field `secret_uid` of struct `foo::S` is private + --> $DIR/functional-struct-update-respects-privacy.rs:38:49 + | +LL | let s_2 = foo::S { b: format!("ess two"), ..s_1 }; // FRU ... + | ^^^ field `secret_uid` is private + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0451`. diff --git a/src/test/compile-fail/future-incompatible-lint-group.rs b/src/test/ui/compile-fail-migration/future-incompatible-lint-group.rs index 5f320135edf..5f320135edf 100644 --- a/src/test/compile-fail/future-incompatible-lint-group.rs +++ b/src/test/ui/compile-fail-migration/future-incompatible-lint-group.rs diff --git a/src/test/ui/compile-fail-migration/future-incompatible-lint-group.stderr b/src/test/ui/compile-fail-migration/future-incompatible-lint-group.stderr new file mode 100644 index 00000000000..56f4ff33eb2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/future-incompatible-lint-group.stderr @@ -0,0 +1,17 @@ +error: anonymous parameters are deprecated and will be removed in the next edition. + --> $DIR/future-incompatible-lint-group.rs:14:10 + | +LL | fn f(u8) {} //~ ERROR anonymous parameters are deprecated + | ^^ help: Try naming the parameter or explicitly ignoring it: `_: u8` + | +note: lint level defined here + --> $DIR/future-incompatible-lint-group.rs:11:9 + | +LL | #![deny(future_incompatible)] + | ^^^^^^^^^^^^^^^^^^^ + = note: #[deny(anonymous_parameters)] implied by #[deny(future_incompatible)] + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41686 <https://github.com/rust-lang/rust/issues/41686> + +error: aborting due to previous error + diff --git a/src/test/compile-fail/gated-attr-literals.rs b/src/test/ui/compile-fail-migration/gated-attr-literals.rs index 8d36745116b..8d36745116b 100644 --- a/src/test/compile-fail/gated-attr-literals.rs +++ b/src/test/ui/compile-fail-migration/gated-attr-literals.rs diff --git a/src/test/ui/compile-fail-migration/gated-attr-literals.stderr b/src/test/ui/compile-fail-migration/gated-attr-literals.stderr new file mode 100644 index 00000000000..e123c7cfa1a --- /dev/null +++ b/src/test/ui/compile-fail-migration/gated-attr-literals.stderr @@ -0,0 +1,195 @@ +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:20:1 + | +LL | #[fake_attr] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:21:1 + | +LL | #[fake_attr(100)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:21:1 + | +LL | #[fake_attr(100)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:23:1 + | +LL | #[fake_attr(1, 2, 3)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:23:1 + | +LL | #[fake_attr(1, 2, 3)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:25:1 + | +LL | #[fake_attr("hello")] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:25:1 + | +LL | #[fake_attr("hello")] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:27:1 + | +LL | #[fake_attr(name = "hello")] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:28:1 + | +LL | #[fake_attr(1, "hi", key = 12, true, false)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:28:1 + | +LL | #[fake_attr(1, "hi", key = 12, true, false)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:30:1 + | +LL | #[fake_attr(key = "hello", val = 10)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:30:1 + | +LL | #[fake_attr(key = "hello", val = 10)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:32:1 + | +LL | #[fake_attr(key("hello"), val(10))] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:32:1 + | +LL | #[fake_attr(key("hello"), val(10))] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:34:1 + | +LL | #[fake_attr(enabled = true, disabled = false)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:34:1 + | +LL | #[fake_attr(enabled = true, disabled = false)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:36:1 + | +LL | #[fake_attr(true)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:36:1 + | +LL | #[fake_attr(true)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:38:1 + | +LL | #[fake_attr(pi = 3.14159)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:38:1 + | +LL | #[fake_attr(pi = 3.14159)] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:40:1 + | +LL | #[fake_attr(b"hi")] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:40:1 + | +LL | #[fake_attr(b"hi")] //~ ERROR attribute `fake_attr` is currently unknown + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error[E0658]: The attribute `fake_doc` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642) + --> $DIR/gated-attr-literals.rs:42:1 + | +LL | #[fake_doc(r"doc")] //~ ERROR attribute `fake_doc` is currently unknown + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(custom_attribute)] to the crate attributes to enable + +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:42:1 + | +LL | #[fake_doc(r"doc")] //~ ERROR attribute `fake_doc` is currently unknown + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error: aborting due to 24 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/gated-bad-feature.rs b/src/test/ui/compile-fail-migration/gated-bad-feature.rs index 5baafd41531..5baafd41531 100644 --- a/src/test/compile-fail/gated-bad-feature.rs +++ b/src/test/ui/compile-fail-migration/gated-bad-feature.rs diff --git a/src/test/ui/compile-fail-migration/gated-bad-feature.stderr b/src/test/ui/compile-fail-migration/gated-bad-feature.stderr new file mode 100644 index 00000000000..2bed241d68c --- /dev/null +++ b/src/test/ui/compile-fail-migration/gated-bad-feature.stderr @@ -0,0 +1,38 @@ +error[E0556]: malformed feature, expected just one word + --> $DIR/gated-bad-feature.rs:13:5 + | +LL | foo(bar), + | ^^^^^^^^ + +error[E0556]: malformed feature, expected just one word + --> $DIR/gated-bad-feature.rs:14:5 + | +LL | foo = "baz" + | ^^^^^^^^^^^ + +error[E0555]: malformed feature attribute, expected #![feature(...)] + --> $DIR/gated-bad-feature.rs:19:1 + | +LL | #![feature] //~ ERROR: malformed feature + | ^^^^^^^^^^^ + +error[E0555]: malformed feature attribute, expected #![feature(...)] + --> $DIR/gated-bad-feature.rs:20:1 + | +LL | #![feature = "foo"] //~ ERROR: malformed feature + | ^^^^^^^^^^^^^^^^^^^ + +error[E0557]: feature has been removed + --> $DIR/gated-bad-feature.rs:22:12 + | +LL | #![feature(test_removed_feature)] //~ ERROR: feature has been removed + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0601]: `main` function not found in crate `gated_bad_feature` + | + = note: consider adding a `main` function to `$DIR/gated-bad-feature.rs` + +error: aborting due to 6 previous errors + +Some errors occurred: E0555, E0556, E0557, E0601. +For more information about an error, try `rustc --explain E0555`. diff --git a/src/test/compile-fail/generator-yielding-or-returning-itself.rs b/src/test/ui/compile-fail-migration/generator-yielding-or-returning-itself.rs index 13abdf616b2..13abdf616b2 100644 --- a/src/test/compile-fail/generator-yielding-or-returning-itself.rs +++ b/src/test/ui/compile-fail-migration/generator-yielding-or-returning-itself.rs diff --git a/src/test/ui/compile-fail-migration/generator-yielding-or-returning-itself.stderr b/src/test/ui/compile-fail-migration/generator-yielding-or-returning-itself.stderr new file mode 100644 index 00000000000..a52e717ebae --- /dev/null +++ b/src/test/ui/compile-fail-migration/generator-yielding-or-returning-itself.stderr @@ -0,0 +1,39 @@ +error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:25:34: 29:6 _] as std::ops::Generator>::Return == [generator@$DIR/generator-yielding-or-returning-itself.rs:25:34: 29:6 _]` + --> $DIR/generator-yielding-or-returning-itself.rs:25:5 + | +LL | want_cyclic_generator_return(|| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size + | + = note: closures cannot capture themselves or take themselves as argument; + this error may be the result of a recent compiler bug-fix, + see https://github.com/rust-lang/rust/issues/46062 for more details +note: required by `want_cyclic_generator_return` + --> $DIR/generator-yielding-or-returning-itself.rs:19:1 + | +LL | / pub fn want_cyclic_generator_return<T>(_: T) +LL | | where T: Generator<Yield = (), Return = T> +LL | | { +LL | | } + | |_^ + +error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:38:33: 42:6 _] as std::ops::Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:38:33: 42:6 _]` + --> $DIR/generator-yielding-or-returning-itself.rs:38:5 + | +LL | want_cyclic_generator_yield(|| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size + | + = note: closures cannot capture themselves or take themselves as argument; + this error may be the result of a recent compiler bug-fix, + see https://github.com/rust-lang/rust/issues/46062 for more details +note: required by `want_cyclic_generator_yield` + --> $DIR/generator-yielding-or-returning-itself.rs:32:1 + | +LL | / pub fn want_cyclic_generator_yield<T>(_: T) +LL | | where T: Generator<Yield = T, Return = ()> +LL | | { +LL | | } + | |_^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/compile-fail/generic-extern-lifetime.rs b/src/test/ui/compile-fail-migration/generic-extern-lifetime.rs index fa2d4743937..fa2d4743937 100644 --- a/src/test/compile-fail/generic-extern-lifetime.rs +++ b/src/test/ui/compile-fail-migration/generic-extern-lifetime.rs diff --git a/src/test/ui/compile-fail-migration/generic-extern-lifetime.stderr b/src/test/ui/compile-fail-migration/generic-extern-lifetime.stderr new file mode 100644 index 00000000000..9276ae0d412 --- /dev/null +++ b/src/test/ui/compile-fail-migration/generic-extern-lifetime.stderr @@ -0,0 +1,21 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/generic-extern-lifetime.rs:16:24 + | +LL | pub fn life2<'b>(x:&'a i32, y:&'b i32); //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/generic-extern-lifetime.rs:18:36 + | +LL | pub fn life4<'b>(x: for<'c> fn(&'a i32)); //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/generic-extern-lifetime.rs:21:38 + | +LL | pub fn life7<'b>() -> for<'c> fn(&'a i32); //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0261`. diff --git a/src/test/compile-fail/generic-extern.rs b/src/test/ui/compile-fail-migration/generic-extern.rs index a7140d1be87..a7140d1be87 100644 --- a/src/test/compile-fail/generic-extern.rs +++ b/src/test/ui/compile-fail-migration/generic-extern.rs diff --git a/src/test/ui/compile-fail-migration/generic-extern.stderr b/src/test/ui/compile-fail-migration/generic-extern.stderr new file mode 100644 index 00000000000..c1ba2cced54 --- /dev/null +++ b/src/test/ui/compile-fail-migration/generic-extern.stderr @@ -0,0 +1,11 @@ +error[E0044]: foreign items may not have type parameters + --> $DIR/generic-extern.rs:12:5 + | +LL | fn foo<T>(); //~ ERROR foreign items may not have type parameters + | ^^^^^^^^^^^^ can't have type parameters + | + = help: use specialization instead of type parameters by replacing them with concrete types like `u32` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0044`. diff --git a/src/test/compile-fail/generic-impl-less-params-with-defaults.rs b/src/test/ui/compile-fail-migration/generic-impl-less-params-with-defaults.rs index 3f5f7bb3a53..3f5f7bb3a53 100644 --- a/src/test/compile-fail/generic-impl-less-params-with-defaults.rs +++ b/src/test/ui/compile-fail-migration/generic-impl-less-params-with-defaults.rs diff --git a/src/test/ui/compile-fail-migration/generic-impl-less-params-with-defaults.stderr b/src/test/ui/compile-fail-migration/generic-impl-less-params-with-defaults.stderr new file mode 100644 index 00000000000..a10b500f9f8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/generic-impl-less-params-with-defaults.stderr @@ -0,0 +1,9 @@ +error[E0243]: wrong number of type arguments: expected at least 2, found 1 + --> $DIR/generic-impl-less-params-with-defaults.rs:21:5 + | +LL | Foo::<isize>::new(); + | ^^^^^^^^^^^^^^^^^ expected at least 2 type arguments + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0243`. diff --git a/src/test/compile-fail/generic-impl-more-params-with-defaults.rs b/src/test/ui/compile-fail-migration/generic-impl-more-params-with-defaults.rs index 31411992089..31411992089 100644 --- a/src/test/compile-fail/generic-impl-more-params-with-defaults.rs +++ b/src/test/ui/compile-fail-migration/generic-impl-more-params-with-defaults.rs diff --git a/src/test/ui/compile-fail-migration/generic-impl-more-params-with-defaults.stderr b/src/test/ui/compile-fail-migration/generic-impl-more-params-with-defaults.stderr new file mode 100644 index 00000000000..6b54baefb1d --- /dev/null +++ b/src/test/ui/compile-fail-migration/generic-impl-more-params-with-defaults.stderr @@ -0,0 +1,9 @@ +error[E0244]: wrong number of type arguments: expected at most 2, found 3 + --> $DIR/generic-impl-more-params-with-defaults.rs:23:5 + | +LL | Vec::<isize, Heap, bool>::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type arguments + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0244`. diff --git a/src/test/compile-fail/generic-lifetime-trait-impl.rs b/src/test/ui/compile-fail-migration/generic-lifetime-trait-impl.rs index 9b9f09f4777..9b9f09f4777 100644 --- a/src/test/compile-fail/generic-lifetime-trait-impl.rs +++ b/src/test/ui/compile-fail-migration/generic-lifetime-trait-impl.rs diff --git a/src/test/ui/compile-fail-migration/generic-lifetime-trait-impl.stderr b/src/test/ui/compile-fail-migration/generic-lifetime-trait-impl.stderr new file mode 100644 index 00000000000..182eab0a69b --- /dev/null +++ b/src/test/ui/compile-fail-migration/generic-lifetime-trait-impl.stderr @@ -0,0 +1,12 @@ +error[E0195]: lifetime parameters or bounds on method `bar` do not match the trait declaration + --> $DIR/generic-lifetime-trait-impl.rs:29:11 + | +LL | fn bar<'b, T: Bar<'b>>(self) -> &'b str; + | ---------------- lifetimes in impl do not match this method in trait +... +LL | fn bar<T: Bar<'a>>(self) -> &'a str { panic!() } //~ ERROR lifetime + | ^^^^^^^^^^^^ lifetimes do not match method in trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0195`. diff --git a/src/test/compile-fail/generic-no-mangle.rs b/src/test/ui/compile-fail-migration/generic-no-mangle.rs index 2b4c94d281f..2b4c94d281f 100644 --- a/src/test/compile-fail/generic-no-mangle.rs +++ b/src/test/ui/compile-fail-migration/generic-no-mangle.rs diff --git a/src/test/ui/compile-fail-migration/generic-no-mangle.stderr b/src/test/ui/compile-fail-migration/generic-no-mangle.stderr new file mode 100644 index 00000000000..4eaa3973329 --- /dev/null +++ b/src/test/ui/compile-fail-migration/generic-no-mangle.stderr @@ -0,0 +1,24 @@ +error: functions generic over types must be mangled + --> $DIR/generic-no-mangle.rs:14:1 + | +LL | #[no_mangle] + | ------------ help: remove this attribute +LL | pub fn foo<T>() {} //~ ERROR functions generic over types must be mangled + | ^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/generic-no-mangle.rs:11:9 + | +LL | #![deny(no_mangle_generic_items)] + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: functions generic over types must be mangled + --> $DIR/generic-no-mangle.rs:17:1 + | +LL | #[no_mangle] + | ------------ help: remove this attribute +LL | pub extern fn bar<T>() {} //~ ERROR functions generic over types must be mangled + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/generic-non-trailing-defaults.rs b/src/test/ui/compile-fail-migration/generic-non-trailing-defaults.rs index 13b7753082c..13b7753082c 100644 --- a/src/test/compile-fail/generic-non-trailing-defaults.rs +++ b/src/test/ui/compile-fail-migration/generic-non-trailing-defaults.rs diff --git a/src/test/ui/compile-fail-migration/generic-non-trailing-defaults.stderr b/src/test/ui/compile-fail-migration/generic-non-trailing-defaults.stderr new file mode 100644 index 00000000000..ce8badf6d30 --- /dev/null +++ b/src/test/ui/compile-fail-migration/generic-non-trailing-defaults.stderr @@ -0,0 +1,21 @@ +error: type parameters with a default must be trailing + --> $DIR/generic-non-trailing-defaults.rs:13:12 + | +LL | struct Vec<A = Heap, T>(A, T); + | ^ + +error: type parameters with a default must be trailing + --> $DIR/generic-non-trailing-defaults.rs:16:15 + | +LL | struct Foo<A, B = Vec<C>, C>(A, B, C); + | ^ + +error[E0128]: type parameters with a default cannot use forward declared identifiers + --> $DIR/generic-non-trailing-defaults.rs:16:23 + | +LL | struct Foo<A, B = Vec<C>, C>(A, B, C); + | ^ defaulted type parameters cannot be forward declared + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0128`. diff --git a/src/test/compile-fail/generic-type-params-forward-mention.rs b/src/test/ui/compile-fail-migration/generic-type-params-forward-mention.rs index bfa6af0da43..bfa6af0da43 100644 --- a/src/test/compile-fail/generic-type-params-forward-mention.rs +++ b/src/test/ui/compile-fail-migration/generic-type-params-forward-mention.rs diff --git a/src/test/ui/compile-fail-migration/generic-type-params-forward-mention.stderr b/src/test/ui/compile-fail-migration/generic-type-params-forward-mention.stderr new file mode 100644 index 00000000000..542716326f1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/generic-type-params-forward-mention.stderr @@ -0,0 +1,9 @@ +error[E0128]: type parameters with a default cannot use forward declared identifiers + --> $DIR/generic-type-params-forward-mention.rs:12:23 + | +LL | struct Foo<T = Option<U>, U = bool>(T, U); + | ^ defaulted type parameters cannot be forward declared + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0128`. diff --git a/src/test/compile-fail/generic-type-params-name-repr.rs b/src/test/ui/compile-fail-migration/generic-type-params-name-repr.rs index 71d7cf792e4..71d7cf792e4 100644 --- a/src/test/compile-fail/generic-type-params-name-repr.rs +++ b/src/test/ui/compile-fail-migration/generic-type-params-name-repr.rs diff --git a/src/test/ui/compile-fail-migration/generic-type-params-name-repr.stderr b/src/test/ui/compile-fail-migration/generic-type-params-name-repr.stderr new file mode 100644 index 00000000000..1c65aeadae6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/generic-type-params-name-repr.stderr @@ -0,0 +1,57 @@ +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:23:25 + | +LL | let _: Foo<isize> = (); + | ^^ expected struct `Foo`, found () + | + = note: expected type `Foo<isize>` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:30:31 + | +LL | let _: Foo<isize, B, C> = (); + | ^^ expected struct `Foo`, found () + | + = note: expected type `Foo<isize>` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:37:37 + | +LL | let _: HashMap<String, isize> = (); + | ^^ expected struct `HashMap`, found () + | + = note: expected type `HashMap<std::string::String, isize>` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:42:51 + | +LL | let _: HashMap<String, isize, Hash<String>> = (); + | ^^ expected struct `HashMap`, found () + | + = note: expected type `HashMap<std::string::String, isize>` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:49:31 + | +LL | let _: Foo<A, isize, C> = (); + | ^^ expected struct `Foo`, found () + | + = note: expected type `Foo<A, isize>` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:56:27 + | +LL | let _: Foo<A, B, C> = (); + | ^^ expected struct `Foo`, found () + | + = note: expected type `Foo` + found type `()` + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/glob-cycles.rs b/src/test/ui/compile-fail-migration/glob-cycles.rs index 8f1b8ec91db..8f1b8ec91db 100644 --- a/src/test/compile-fail/glob-cycles.rs +++ b/src/test/ui/compile-fail-migration/glob-cycles.rs diff --git a/src/test/ui/compile-fail-migration/glob-cycles.stderr b/src/test/ui/compile-fail-migration/glob-cycles.stderr new file mode 100644 index 00000000000..a9fd9306e21 --- /dev/null +++ b/src/test/ui/compile-fail-migration/glob-cycles.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/glob-cycles.rs:29:1 + | +LL | pub fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/glob-resolve1.rs b/src/test/ui/compile-fail-migration/glob-resolve1.rs index 2723b4ce256..2723b4ce256 100644 --- a/src/test/compile-fail/glob-resolve1.rs +++ b/src/test/ui/compile-fail-migration/glob-resolve1.rs diff --git a/src/test/ui/compile-fail-migration/glob-resolve1.stderr b/src/test/ui/compile-fail-migration/glob-resolve1.stderr new file mode 100644 index 00000000000..650dd2c3b19 --- /dev/null +++ b/src/test/ui/compile-fail-migration/glob-resolve1.stderr @@ -0,0 +1,79 @@ +error[E0425]: cannot find function `fpriv` in this scope + --> $DIR/glob-resolve1.rs:32:5 + | +LL | fpriv(); //~ ERROR cannot find function `fpriv` in this scope + | ^^^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use bar::fpriv; + | + +error[E0425]: cannot find function `epriv` in this scope + --> $DIR/glob-resolve1.rs:33:5 + | +LL | epriv(); //~ ERROR cannot find function `epriv` in this scope + | ^^^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use bar::epriv; + | + +error[E0423]: expected value, found enum `B` + --> $DIR/glob-resolve1.rs:34:5 + | +LL | B; //~ ERROR expected value, found enum `B` + | ^ + | + = note: did you mean to use one of the following variants? + - `B::B1` + +error[E0425]: cannot find value `C` in this scope + --> $DIR/glob-resolve1.rs:35:5 + | +LL | C; //~ ERROR cannot find value `C` in this scope + | ^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use bar::C; + | + +error[E0425]: cannot find function `import` in this scope + --> $DIR/glob-resolve1.rs:36:5 + | +LL | import(); //~ ERROR: cannot find function `import` in this scope + | ^^^^^^ not found in this scope + +error[E0412]: cannot find type `A` in this scope + --> $DIR/glob-resolve1.rs:38:11 + | +LL | foo::<A>(); //~ ERROR: cannot find type `A` in this scope + | ^ did you mean `B`? +help: possible candidate is found in another module, you can import it into scope + | +LL | use bar::A; + | + +error[E0412]: cannot find type `C` in this scope + --> $DIR/glob-resolve1.rs:39:11 + | +LL | foo::<C>(); //~ ERROR: cannot find type `C` in this scope + | ^ did you mean `B`? +help: possible candidate is found in another module, you can import it into scope + | +LL | use bar::C; + | + +error[E0412]: cannot find type `D` in this scope + --> $DIR/glob-resolve1.rs:40:11 + | +LL | foo::<D>(); //~ ERROR: cannot find type `D` in this scope + | ^ did you mean `B`? +help: possible candidate is found in another module, you can import it into scope + | +LL | use bar::D; + | + +error: aborting due to 8 previous errors + +Some errors occurred: E0412, E0423, E0425. +For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/ui/compile-fail-migration/hashmap-iter-value-lifetime.nll.stderr b/src/test/ui/compile-fail-migration/hashmap-iter-value-lifetime.nll.stderr new file mode 100644 index 00000000000..ec52d19cd1c --- /dev/null +++ b/src/test/ui/compile-fail-migration/hashmap-iter-value-lifetime.nll.stderr @@ -0,0 +1,15 @@ +error[E0502]: cannot borrow `my_stuff` as mutable because it is also borrowed as immutable + --> $DIR/hashmap-iter-value-lifetime.rs:17:5 + | +LL | let (_, thing) = my_stuff.iter().next().unwrap(); + | -------- immutable borrow occurs here +LL | +LL | my_stuff.clear(); //~ ERROR cannot borrow + | ^^^^^^^^^^^^^^^^ mutable borrow occurs here +LL | +LL | println!("{}", *thing); + | ------ borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/hashmap-iter-value-lifetime.rs b/src/test/ui/compile-fail-migration/hashmap-iter-value-lifetime.rs index 9cf145a1ff3..9cf145a1ff3 100644 --- a/src/test/compile-fail/hashmap-iter-value-lifetime.rs +++ b/src/test/ui/compile-fail-migration/hashmap-iter-value-lifetime.rs diff --git a/src/test/ui/compile-fail-migration/hashmap-iter-value-lifetime.stderr b/src/test/ui/compile-fail-migration/hashmap-iter-value-lifetime.stderr new file mode 100644 index 00000000000..16e9c527391 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hashmap-iter-value-lifetime.stderr @@ -0,0 +1,15 @@ +error[E0502]: cannot borrow `my_stuff` as mutable because it is also borrowed as immutable + --> $DIR/hashmap-iter-value-lifetime.rs:17:5 + | +LL | let (_, thing) = my_stuff.iter().next().unwrap(); + | -------- immutable borrow occurs here +LL | +LL | my_stuff.clear(); //~ ERROR cannot borrow + | ^^^^^^^^ mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/hashmap-lifetimes.rs b/src/test/ui/compile-fail-migration/hashmap-lifetimes.rs index 6858599f63a..6858599f63a 100644 --- a/src/test/compile-fail/hashmap-lifetimes.rs +++ b/src/test/ui/compile-fail-migration/hashmap-lifetimes.rs diff --git a/src/test/ui/compile-fail-migration/hashmap-lifetimes.stderr b/src/test/ui/compile-fail-migration/hashmap-lifetimes.stderr new file mode 100644 index 00000000000..fa3e6452325 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hashmap-lifetimes.stderr @@ -0,0 +1,13 @@ +error[E0502]: cannot borrow `my_stuff` as mutable because it is also borrowed as immutable + --> $DIR/hashmap-lifetimes.rs:16:5 + | +LL | let mut it = my_stuff.iter(); + | -------- immutable borrow occurs here +LL | my_stuff.insert(1, 43); //~ ERROR cannot borrow + | ^^^^^^^^ mutable borrow occurs here +LL | } + | - immutable borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/hidden-rt-injection.rs b/src/test/ui/compile-fail-migration/hidden-rt-injection.rs index a27a8464707..a27a8464707 100644 --- a/src/test/compile-fail/hidden-rt-injection.rs +++ b/src/test/ui/compile-fail-migration/hidden-rt-injection.rs diff --git a/src/test/ui/compile-fail-migration/hidden-rt-injection.stderr b/src/test/ui/compile-fail-migration/hidden-rt-injection.stderr new file mode 100644 index 00000000000..103cdf05485 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hidden-rt-injection.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `native` + --> $DIR/hidden-rt-injection.rs:15:9 + | +LL | use native; //~ ERROR unresolved import + | ^^^^^^ no `native` in the root + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/hidden-rt-injection2.rs b/src/test/ui/compile-fail-migration/hidden-rt-injection2.rs index fa6584ddd98..fa6584ddd98 100644 --- a/src/test/compile-fail/hidden-rt-injection2.rs +++ b/src/test/ui/compile-fail-migration/hidden-rt-injection2.rs diff --git a/src/test/ui/compile-fail-migration/hidden-rt-injection2.stderr b/src/test/ui/compile-fail-migration/hidden-rt-injection2.stderr new file mode 100644 index 00000000000..df0527f307a --- /dev/null +++ b/src/test/ui/compile-fail-migration/hidden-rt-injection2.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `rt` + --> $DIR/hidden-rt-injection2.rs:15:9 + | +LL | use rt; //~ ERROR unresolved import + | ^^ no `rt` in the root + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr new file mode 100644 index 00000000000..d668a931459 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr @@ -0,0 +1,16 @@ +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a +... +LL | / check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32, +LL | | for<'a> fn(&'a u32, &'a u32) -> &'a u32) } + | |_________________________________________________________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32>` + found type `std::option::Option<for<'a> fn(&'a u32, &'a u32) -> &'a u32>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_a_b_vs_bound_a.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_b_vs_bound_a.stderr new file mode 100644 index 00000000000..23854f9c147 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_b_vs_bound_a.stderr @@ -0,0 +1,16 @@ +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a +... +LL | / check! { bound_a_b_vs_bound_a: (for<'a,'b> fn(&'a u32, &'b u32), +LL | | for<'a> fn(&'a u32, &'a u32)) } + | |__________________________________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<for<'a, 'b> fn(&'a u32, &'b u32)>` + found type `std::option::Option<for<'a> fn(&'a u32, &'a u32)>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_a_vs_bound_a.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_vs_bound_a.stderr new file mode 100644 index 00000000000..01a9f578fbc --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_vs_bound_a.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/hr-subtype.rs:110:1 + | +LL | / fn main() { +LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful +LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful +LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful +LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful +LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_a_vs_bound_b.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_vs_bound_b.stderr new file mode 100644 index 00000000000..01a9f578fbc --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_vs_bound_b.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/hr-subtype.rs:110:1 + | +LL | / fn main() { +LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful +LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful +LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful +LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful +LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_a_vs_free_x.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_vs_free_x.stderr new file mode 100644 index 00000000000..14e498593f3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_a_vs_free_x.stderr @@ -0,0 +1,16 @@ +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a +... +LL | / check! { bound_a_vs_free_x: (for<'a> fn(&'a u32), +LL | | fn(&'x u32)) } + | |___________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<for<'a> fn(&'a u32)>` + found type `std::option::Option<fn(&'x u32)>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr new file mode 100644 index 00000000000..a66a4ace910 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr @@ -0,0 +1,16 @@ +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a +... +LL | / check! { bound_co_a_b_vs_bound_co_a: (for<'a,'b> fn(Co<'a>, Co<'b>), +LL | | for<'a> fn(Co<'a>, Co<'a>)) } + | |______________________________________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<for<'a, 'b> fn(Co<'a>, Co<'b>)>` + found type `std::option::Option<for<'a> fn(Co<'a>, Co<'a>)>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr new file mode 100644 index 00000000000..9f94b45140c --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr @@ -0,0 +1,16 @@ +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a +... +LL | / check! { bound_co_a_co_b_ret_contra_a: (for<'a,'b> fn(Co<'a>, Co<'b>) -> Contra<'a>, +LL | | for<'a> fn(Co<'a>, Co<'a>) -> Contra<'a>) } + | |______________________________________________________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<for<'a, 'b> fn(Co<'a>, Co<'b>) -> Contra<'a>>` + found type `std::option::Option<for<'a> fn(Co<'a>, Co<'a>) -> Contra<'a>>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_co_a_vs_bound_co_b.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_co_a_vs_bound_co_b.stderr new file mode 100644 index 00000000000..01a9f578fbc --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_co_a_vs_bound_co_b.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/hr-subtype.rs:110:1 + | +LL | / fn main() { +LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful +LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful +LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful +LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful +LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr new file mode 100644 index 00000000000..511369703ba --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr @@ -0,0 +1,16 @@ +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a +... +LL | / check! { bound_contra_a_contra_b_ret_co_a: (for<'a,'b> fn(Contra<'a>, Contra<'b>) -> Co<'a>, +LL | | for<'a> fn(Contra<'a>, Contra<'a>) -> Co<'a>) } + | |______________________________________________________________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<for<'a, 'b> fn(Contra<'a>, Contra<'b>) -> Co<'a>>` + found type `std::option::Option<for<'a> fn(Contra<'a>, Contra<'a>) -> Co<'a>>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr new file mode 100644 index 00000000000..d39d5f76a6e --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr @@ -0,0 +1,16 @@ +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a +... +LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>), +LL | | for<'a> fn(Inv<'a>, Inv<'a>)) } + | |__________________________________________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<for<'a, 'b> fn(Inv<'a>, Inv<'b>)>` + found type `std::option::Option<for<'a> fn(Inv<'a>, Inv<'a>)>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr b/src/test/ui/compile-fail-migration/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr new file mode 100644 index 00000000000..01a9f578fbc --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/hr-subtype.rs:110:1 + | +LL | / fn main() { +LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful +LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful +LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful +LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful +LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr b/src/test/ui/compile-fail-migration/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr new file mode 100644 index 00000000000..1999df909ed --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr @@ -0,0 +1,34 @@ +warning: not reporting region error due to nll + --> $DIR/hr-subtype.rs:43:26 + | +LL | gimme::<$t2>(None::<$t1>); + | ^^^^^^^^^^^ +... +LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), +LL | | fn(Inv<'y>)) } + | |__________________________________________________- in this macro invocation + +warning: not reporting region error due to nll + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ +... +LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), +LL | | fn(Inv<'y>)) } + | |__________________________________________________- in this macro invocation + +error: compilation successful + --> $DIR/hr-subtype.rs:110:1 + | +LL | / fn main() { +LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful +LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful +LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful +LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful +LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/hr-subtype.free_inv_x_vs_free_inv_y.stderr b/src/test/ui/compile-fail-migration/hr-subtype.free_inv_x_vs_free_inv_y.stderr new file mode 100644 index 00000000000..bf562700bb4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.free_inv_x_vs_free_inv_y.stderr @@ -0,0 +1,65 @@ +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:43:26 + | +LL | gimme::<$t2>(None::<$t1>); + | ^^^^^^^^^^^ lifetime mismatch +... +LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), +LL | | fn(Inv<'y>)) } + | |__________________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<fn(Inv<'y>)>` + found type `std::option::Option<fn(Inv<'x>)>` +note: the lifetime 'x as defined on the function body at 42:20... + --> $DIR/hr-subtype.rs:42:20 + | +LL | fn subtype<'x,'y:'x,'z:'y>() { + | ^^ +... +LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), +LL | | fn(Inv<'y>)) } + | |__________________________________________________- in this macro invocation +note: ...does not necessarily outlive the lifetime 'y as defined on the function body at 42:23 + --> $DIR/hr-subtype.rs:42:23 + | +LL | fn subtype<'x,'y:'x,'z:'y>() { + | ^^ +... +LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), +LL | | fn(Inv<'y>)) } + | |__________________________________________________- in this macro invocation + +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ lifetime mismatch +... +LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), +LL | | fn(Inv<'y>)) } + | |__________________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<fn(Inv<'x>)>` + found type `std::option::Option<fn(Inv<'y>)>` +note: the lifetime 'x as defined on the function body at 48:22... + --> $DIR/hr-subtype.rs:48:22 + | +LL | fn supertype<'x,'y:'x,'z:'y>() { + | ^^ +... +LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), +LL | | fn(Inv<'y>)) } + | |__________________________________________________- in this macro invocation +note: ...does not necessarily outlive the lifetime 'y as defined on the function body at 48:25 + --> $DIR/hr-subtype.rs:48:25 + | +LL | fn supertype<'x,'y:'x,'z:'y>() { + | ^^ +... +LL | / check! { free_inv_x_vs_free_inv_y: (fn(Inv<'x>), +LL | | fn(Inv<'y>)) } + | |__________________________________________________- in this macro invocation + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/hr-subtype.free_x_vs_free_x.stderr b/src/test/ui/compile-fail-migration/hr-subtype.free_x_vs_free_x.stderr new file mode 100644 index 00000000000..01a9f578fbc --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.free_x_vs_free_x.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/hr-subtype.rs:110:1 + | +LL | / fn main() { +LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful +LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful +LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful +LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful +LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/hr-subtype.free_x_vs_free_y.nll.stderr b/src/test/ui/compile-fail-migration/hr-subtype.free_x_vs_free_y.nll.stderr new file mode 100644 index 00000000000..f76b26b5191 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.free_x_vs_free_y.nll.stderr @@ -0,0 +1,24 @@ +warning: not reporting region error due to nll + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ +... +LL | / check! { free_x_vs_free_y: (fn(&'x u32), +LL | | fn(&'y u32)) } + | |__________________________________________- in this macro invocation + +error: compilation successful + --> $DIR/hr-subtype.rs:110:1 + | +LL | / fn main() { +LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful +LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful +LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful +LL | | //[bound_co_a_vs_bound_co_b]~^^^^ ERROR compilation successful +LL | | //[free_x_vs_free_x]~^^^^^ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/hr-subtype.free_x_vs_free_y.stderr b/src/test/ui/compile-fail-migration/hr-subtype.free_x_vs_free_y.stderr new file mode 100644 index 00000000000..228f6db38fb --- /dev/null +++ b/src/test/ui/compile-fail-migration/hr-subtype.free_x_vs_free_y.stderr @@ -0,0 +1,34 @@ +error[E0308]: mismatched types + --> $DIR/hr-subtype.rs:49:26 + | +LL | gimme::<$t1>(None::<$t2>); + | ^^^^^^^^^^^ lifetime mismatch +... +LL | / check! { free_x_vs_free_y: (fn(&'x u32), +LL | | fn(&'y u32)) } + | |__________________________________________- in this macro invocation + | + = note: expected type `std::option::Option<fn(&'x u32)>` + found type `std::option::Option<fn(&'y u32)>` +note: the lifetime 'x as defined on the function body at 48:22... + --> $DIR/hr-subtype.rs:48:22 + | +LL | fn supertype<'x,'y:'x,'z:'y>() { + | ^^ +... +LL | / check! { free_x_vs_free_y: (fn(&'x u32), +LL | | fn(&'y u32)) } + | |__________________________________________- in this macro invocation +note: ...does not necessarily outlive the lifetime 'y as defined on the function body at 48:25 + --> $DIR/hr-subtype.rs:48:25 + | +LL | fn supertype<'x,'y:'x,'z:'y>() { + | ^^ +... +LL | / check! { free_x_vs_free_y: (fn(&'x u32), +LL | | fn(&'y u32)) } + | |__________________________________________- in this macro invocation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/hr-subtype.rs b/src/test/ui/compile-fail-migration/hr-subtype.rs index 86df2382732..86df2382732 100644 --- a/src/test/compile-fail/hr-subtype.rs +++ b/src/test/ui/compile-fail-migration/hr-subtype.rs diff --git a/src/test/compile-fail/hrtb-conflate-regions.rs b/src/test/ui/compile-fail-migration/hrtb-conflate-regions.rs index 845429d4b0c..845429d4b0c 100644 --- a/src/test/compile-fail/hrtb-conflate-regions.rs +++ b/src/test/ui/compile-fail-migration/hrtb-conflate-regions.rs diff --git a/src/test/ui/compile-fail-migration/hrtb-conflate-regions.stderr b/src/test/ui/compile-fail-migration/hrtb-conflate-regions.stderr new file mode 100644 index 00000000000..42778c12960 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-conflate-regions.stderr @@ -0,0 +1,20 @@ +error[E0277]: the trait bound `for<'a, 'b> SomeStruct: Foo<(&'a isize, &'b isize)>` is not satisfied + --> $DIR/hrtb-conflate-regions.rs:38:10 + | +LL | fn b() { want_foo2::<SomeStruct>(); } //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Foo<(&'a isize, &'b isize)>` is not implemented for `SomeStruct` + | + = help: the following implementations were found: + <SomeStruct as Foo<(&'a isize, &'a isize)>> +note: required by `want_foo2` + --> $DIR/hrtb-conflate-regions.rs:18:1 + | +LL | / fn want_foo2<T>() +LL | | where T : for<'a,'b> Foo<(&'a isize, &'b isize)> +LL | | { +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/hrtb-debruijn-in-receiver.nll.stderr b/src/test/ui/compile-fail-migration/hrtb-debruijn-in-receiver.nll.stderr new file mode 100644 index 00000000000..06970229325 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-debruijn-in-receiver.nll.stderr @@ -0,0 +1,14 @@ +error[E0499]: cannot borrow `foo` as mutable more than once at a time + --> $DIR/hrtb-debruijn-in-receiver.rs:27:5 + | +LL | foo.insert(); + | --- first mutable borrow occurs here +LL | foo.insert(); //~ ERROR cannot borrow + | ^^^ + | | + | second mutable borrow occurs here + | borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/hrtb-debruijn-in-receiver.rs b/src/test/ui/compile-fail-migration/hrtb-debruijn-in-receiver.rs index 2365f494075..2365f494075 100644 --- a/src/test/compile-fail/hrtb-debruijn-in-receiver.rs +++ b/src/test/ui/compile-fail-migration/hrtb-debruijn-in-receiver.rs diff --git a/src/test/ui/compile-fail-migration/hrtb-debruijn-in-receiver.stderr b/src/test/ui/compile-fail-migration/hrtb-debruijn-in-receiver.stderr new file mode 100644 index 00000000000..9a560caf5e9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-debruijn-in-receiver.stderr @@ -0,0 +1,13 @@ +error[E0499]: cannot borrow `foo` as mutable more than once at a time + --> $DIR/hrtb-debruijn-in-receiver.rs:27:5 + | +LL | foo.insert(); + | --- first mutable borrow occurs here +LL | foo.insert(); //~ ERROR cannot borrow + | ^^^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/hrtb-higher-ranker-supertraits-transitive.rs b/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits-transitive.rs index b55dccec2d5..b55dccec2d5 100644 --- a/src/test/compile-fail/hrtb-higher-ranker-supertraits-transitive.rs +++ b/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits-transitive.rs diff --git a/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits-transitive.stderr b/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits-transitive.stderr new file mode 100644 index 00000000000..dca9feab201 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits-transitive.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied + --> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:57:5 + | +LL | want_bar_for_any_ccx(b); //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B` + | + = help: consider adding a `where for<'ccx> B: Bar<'ccx>` bound +note: required by `want_bar_for_any_ccx` + --> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:41:1 + | +LL | / fn want_bar_for_any_ccx<B>(b: &B) +LL | | where B : for<'ccx> Bar<'ccx> +LL | | { +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/hrtb-higher-ranker-supertraits.rs b/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits.rs index 4c5add4acea..4c5add4acea 100644 --- a/src/test/compile-fail/hrtb-higher-ranker-supertraits.rs +++ b/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits.rs diff --git a/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits.stderr b/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits.stderr new file mode 100644 index 00000000000..ad069e10182 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-higher-ranker-supertraits.stderr @@ -0,0 +1,40 @@ +error[E0277]: the trait bound `for<'tcx> F: Foo<'tcx>` is not satisfied + --> $DIR/hrtb-higher-ranker-supertraits.rs:28:5 + | +LL | want_foo_for_any_tcx(f); //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F` + | + = help: consider adding a `where for<'tcx> F: Foo<'tcx>` bound +note: required by `want_foo_for_any_tcx` + --> $DIR/hrtb-higher-ranker-supertraits.rs:31:1 + | +LL | / fn want_foo_for_any_tcx<F>(f: &F) +LL | | where F : for<'tcx> Foo<'tcx> +LL | | { +LL | | want_foo_for_some_tcx(f); +LL | | want_foo_for_any_tcx(f); +LL | | } + | |_^ + +error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied + --> $DIR/hrtb-higher-ranker-supertraits.rs:45:5 + | +LL | want_bar_for_any_ccx(b); //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B` + | + = help: consider adding a `where for<'ccx> B: Bar<'ccx>` bound +note: required by `want_bar_for_any_ccx` + --> $DIR/hrtb-higher-ranker-supertraits.rs:48:1 + | +LL | / fn want_bar_for_any_ccx<B>(b: &B) +LL | | where B : for<'ccx> Bar<'ccx> +LL | | { +LL | | want_foo_for_some_tcx(b); +... | +LL | | want_bar_for_any_ccx(b); +LL | | } + | |_^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.ast.nll.stderr b/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.ast.nll.stderr new file mode 100644 index 00000000000..e533ecc6eb0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/hrtb-identity-fn-borrows.rs:27:5 + | +LL | let y = f.call(&x); + | -- borrow of `x` occurs here +LL | x = 5; //[ast]~ ERROR cannot assign + | ^^^^^ assignment to borrowed `x` occurs here +... +LL | drop(y); + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.ast.stderr b/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.ast.stderr new file mode 100644 index 00000000000..6888ec9bddb --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.ast.stderr @@ -0,0 +1,11 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/hrtb-identity-fn-borrows.rs:27:5 + | +LL | let y = f.call(&x); + | - borrow of `x` occurs here +LL | x = 5; //[ast]~ ERROR cannot assign + | ^^^^^ assignment to borrowed `x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.mir.stderr b/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.mir.stderr new file mode 100644 index 00000000000..e533ecc6eb0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.mir.stderr @@ -0,0 +1,14 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/hrtb-identity-fn-borrows.rs:27:5 + | +LL | let y = f.call(&x); + | -- borrow of `x` occurs here +LL | x = 5; //[ast]~ ERROR cannot assign + | ^^^^^ assignment to borrowed `x` occurs here +... +LL | drop(y); + | - borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/hrtb-identity-fn-borrows.rs b/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.rs index e98cf4eb2ab..e98cf4eb2ab 100644 --- a/src/test/compile-fail/hrtb-identity-fn-borrows.rs +++ b/src/test/ui/compile-fail-migration/hrtb-identity-fn-borrows.rs diff --git a/src/test/compile-fail/hrtb-just-for-static.rs b/src/test/ui/compile-fail-migration/hrtb-just-for-static.rs index aec950f992c..aec950f992c 100644 --- a/src/test/compile-fail/hrtb-just-for-static.rs +++ b/src/test/ui/compile-fail-migration/hrtb-just-for-static.rs diff --git a/src/test/ui/compile-fail-migration/hrtb-just-for-static.stderr b/src/test/ui/compile-fail-migration/hrtb-just-for-static.stderr new file mode 100644 index 00000000000..615a8b3bde5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-just-for-static.stderr @@ -0,0 +1,20 @@ +error[E0277]: the trait bound `for<'a> StaticInt: Foo<&'a isize>` is not satisfied + --> $DIR/hrtb-just-for-static.rs:34:5 + | +LL | want_hrtb::<StaticInt>() //~ ERROR `for<'a> StaticInt: Foo<&'a isize>` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `StaticInt` + | + = help: the following implementations were found: + <StaticInt as Foo<&'static isize>> +note: required by `want_hrtb` + --> $DIR/hrtb-just-for-static.rs:18:1 + | +LL | / fn want_hrtb<T>() +LL | | where T : for<'a> Foo<&'a isize> +LL | | { +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/hrtb-perfect-forwarding.rs b/src/test/ui/compile-fail-migration/hrtb-perfect-forwarding.rs index fcfbeefced0..fcfbeefced0 100644 --- a/src/test/compile-fail/hrtb-perfect-forwarding.rs +++ b/src/test/ui/compile-fail-migration/hrtb-perfect-forwarding.rs diff --git a/src/test/ui/compile-fail-migration/hrtb-perfect-forwarding.stderr b/src/test/ui/compile-fail-migration/hrtb-perfect-forwarding.stderr new file mode 100644 index 00000000000..5e8674df053 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hrtb-perfect-forwarding.stderr @@ -0,0 +1,23 @@ +error[E0277]: the trait bound `for<'a> T: Bar<&'a isize>` is not satisfied + --> $DIR/hrtb-perfect-forwarding.rs:56:5 + | +LL | foo_hrtb_bar_not(&mut t); //~ ERROR `for<'a> T: Bar<&'a isize>` is not satisfied + | ^^^^^^^^^^^^^^^^ the trait `for<'a> Bar<&'a isize>` is not implemented for `T` + | + = help: consider adding a `where for<'a> T: Bar<&'a isize>` bound + = note: required because of the requirements on the impl of `for<'a> Foo<&'a isize>` for `&mut T` +note: required by `foo_hrtb_bar_not` + --> $DIR/hrtb-perfect-forwarding.rs:49:1 + | +LL | / fn foo_hrtb_bar_not<'b,T>(mut t: T) +LL | | where T : for<'a> Foo<&'a isize> + Bar<&'b isize> +LL | | { +LL | | // Not OK -- The forwarding impl for `Foo` requires that `Bar` also +... | +LL | | foo_hrtb_bar_not(&mut t); //~ ERROR `for<'a> T: Bar<&'a isize>` is not satisfied +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/huge-array-simple.rs b/src/test/ui/compile-fail-migration/huge-array-simple.rs index 54340cf7ac4..54340cf7ac4 100644 --- a/src/test/compile-fail/huge-array-simple.rs +++ b/src/test/ui/compile-fail-migration/huge-array-simple.rs diff --git a/src/test/compile-fail/huge-array.rs b/src/test/ui/compile-fail-migration/huge-array.rs index 7de84802e1d..7de84802e1d 100644 --- a/src/test/compile-fail/huge-array.rs +++ b/src/test/ui/compile-fail-migration/huge-array.rs diff --git a/src/test/ui/compile-fail-migration/huge-array.stderr b/src/test/ui/compile-fail-migration/huge-array.stderr new file mode 100644 index 00000000000..38d9effcfb5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/huge-array.stderr @@ -0,0 +1,4 @@ +error: the type `[[u8; 1518599999]; 1518600000]` is too big for the current architecture + +error: aborting due to previous error + diff --git a/src/test/compile-fail/huge-enum.rs b/src/test/ui/compile-fail-migration/huge-enum.rs index 6e7c05370b9..6e7c05370b9 100644 --- a/src/test/compile-fail/huge-enum.rs +++ b/src/test/ui/compile-fail-migration/huge-enum.rs diff --git a/src/test/ui/compile-fail-migration/huge-enum.stderr b/src/test/ui/compile-fail-migration/huge-enum.stderr new file mode 100644 index 00000000000..239428badc2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/huge-enum.stderr @@ -0,0 +1,4 @@ +error: the type `std::option::Option<[u32; 35184372088831]>` is too big for the current architecture + +error: aborting due to previous error + diff --git a/src/test/compile-fail/huge-struct.rs b/src/test/ui/compile-fail-migration/huge-struct.rs index a10c61d6606..a10c61d6606 100644 --- a/src/test/compile-fail/huge-struct.rs +++ b/src/test/ui/compile-fail-migration/huge-struct.rs diff --git a/src/test/ui/compile-fail-migration/huge-struct.stderr b/src/test/ui/compile-fail-migration/huge-struct.stderr new file mode 100644 index 00000000000..15807309d48 --- /dev/null +++ b/src/test/ui/compile-fail-migration/huge-struct.stderr @@ -0,0 +1,4 @@ +error: the type `S32<S1M<S1M<u32>>>` is too big for the current architecture + +error: aborting due to previous error + diff --git a/src/test/compile-fail/hygienic-label-1.rs b/src/test/ui/compile-fail-migration/hygienic-label-1.rs index 305b43402da..305b43402da 100644 --- a/src/test/compile-fail/hygienic-label-1.rs +++ b/src/test/ui/compile-fail-migration/hygienic-label-1.rs diff --git a/src/test/ui/compile-fail-migration/hygienic-label-1.stderr b/src/test/ui/compile-fail-migration/hygienic-label-1.stderr new file mode 100644 index 00000000000..051466b183d --- /dev/null +++ b/src/test/ui/compile-fail-migration/hygienic-label-1.stderr @@ -0,0 +1,12 @@ +error[E0426]: use of undeclared label `'x` + --> $DIR/hygienic-label-1.rs:12:19 + | +LL | () => { break 'x; } //~ ERROR use of undeclared label `'x` + | ^^ did you mean `'x`? +... +LL | 'x: loop { foo!() } + | ------ in this macro invocation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0426`. diff --git a/src/test/compile-fail/hygienic-label-2.rs b/src/test/ui/compile-fail-migration/hygienic-label-2.rs index 24194d7bbe9..24194d7bbe9 100644 --- a/src/test/compile-fail/hygienic-label-2.rs +++ b/src/test/ui/compile-fail-migration/hygienic-label-2.rs diff --git a/src/test/ui/compile-fail-migration/hygienic-label-2.stderr b/src/test/ui/compile-fail-migration/hygienic-label-2.stderr new file mode 100644 index 00000000000..081c1c7e69e --- /dev/null +++ b/src/test/ui/compile-fail-migration/hygienic-label-2.stderr @@ -0,0 +1,9 @@ +error[E0426]: use of undeclared label `'x` + --> $DIR/hygienic-label-2.rs:16:16 + | +LL | foo!(break 'x); //~ ERROR use of undeclared label `'x` + | ^^ did you mean `'x`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0426`. diff --git a/src/test/compile-fail/hygienic-label-3.rs b/src/test/ui/compile-fail-migration/hygienic-label-3.rs index b107b71024d..b107b71024d 100644 --- a/src/test/compile-fail/hygienic-label-3.rs +++ b/src/test/ui/compile-fail-migration/hygienic-label-3.rs diff --git a/src/test/ui/compile-fail-migration/hygienic-label-3.stderr b/src/test/ui/compile-fail-migration/hygienic-label-3.stderr new file mode 100644 index 00000000000..e5593df49f4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/hygienic-label-3.stderr @@ -0,0 +1,12 @@ +error[E0426]: use of undeclared label `'x` + --> $DIR/hygienic-label-3.rs:12:19 + | +LL | () => { break 'x; } //~ ERROR use of undeclared label `'x` + | ^^ did you mean `'x`? +... +LL | foo!() + | ------ in this macro invocation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0426`. diff --git a/src/test/compile-fail/hygienic-label-4.rs b/src/test/ui/compile-fail-migration/hygienic-label-4.rs index 5bfcb6360e4..5bfcb6360e4 100644 --- a/src/test/compile-fail/hygienic-label-4.rs +++ b/src/test/ui/compile-fail-migration/hygienic-label-4.rs diff --git a/src/test/ui/compile-fail-migration/hygienic-label-4.stderr b/src/test/ui/compile-fail-migration/hygienic-label-4.stderr new file mode 100644 index 00000000000..60351386a0b --- /dev/null +++ b/src/test/ui/compile-fail-migration/hygienic-label-4.stderr @@ -0,0 +1,9 @@ +error[E0426]: use of undeclared label `'x` + --> $DIR/hygienic-label-4.rs:16:16 + | +LL | foo!(break 'x); //~ ERROR use of undeclared label `'x` + | ^^ did you mean `'x`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0426`. diff --git a/src/test/compile-fail/if-branch-types.rs b/src/test/ui/compile-fail-migration/if-branch-types.rs index ca9803f66b2..ca9803f66b2 100644 --- a/src/test/compile-fail/if-branch-types.rs +++ b/src/test/ui/compile-fail-migration/if-branch-types.rs diff --git a/src/test/ui/compile-fail-migration/if-branch-types.stderr b/src/test/ui/compile-fail-migration/if-branch-types.stderr new file mode 100644 index 00000000000..cefd94dc99b --- /dev/null +++ b/src/test/ui/compile-fail-migration/if-branch-types.stderr @@ -0,0 +1,12 @@ +error[E0308]: if and else have incompatible types + --> $DIR/if-branch-types.rs:12:13 + | +LL | let x = if true { 10i32 } else { 10u32 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32 + | + = note: expected type `i32` + found type `u32` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/if-let.rs b/src/test/ui/compile-fail-migration/if-let.rs index 1e9144910b0..1e9144910b0 100644 --- a/src/test/compile-fail/if-let.rs +++ b/src/test/ui/compile-fail-migration/if-let.rs diff --git a/src/test/ui/compile-fail-migration/if-let.stderr b/src/test/ui/compile-fail-migration/if-let.stderr new file mode 100644 index 00000000000..de8d6feb3c4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/if-let.stderr @@ -0,0 +1,39 @@ +error[E0162]: irrefutable if-let pattern + --> $DIR/if-let.rs:23:10 + | +LL | foo!(a, 1, { //~ ERROR irrefutable if-let + | ^ irrefutable pattern + +error[E0162]: irrefutable if-let pattern + --> $DIR/if-let.rs:26:10 + | +LL | bar!(a, 1, { //~ ERROR irrefutable if-let + | ^ irrefutable pattern + +error[E0162]: irrefutable if-let pattern + --> $DIR/if-let.rs:32:12 + | +LL | if let a = 1 { //~ ERROR irrefutable if-let + | ^ irrefutable pattern + +error[E0162]: irrefutable if-let pattern + --> $DIR/if-let.rs:36:12 + | +LL | if let a = 1 { //~ ERROR irrefutable if-let + | ^ irrefutable pattern + +error[E0162]: irrefutable if-let pattern + --> $DIR/if-let.rs:46:19 + | +LL | } else if let a = 1 { //~ ERROR irrefutable if-let + | ^ irrefutable pattern + +error[E0162]: irrefutable if-let pattern + --> $DIR/if-let.rs:52:19 + | +LL | } else if let a = 1 { //~ ERROR irrefutable if-let + | ^ irrefutable pattern + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0162`. diff --git a/src/test/compile-fail/if-loop.rs b/src/test/ui/compile-fail-migration/if-loop.rs index 15f04df6939..15f04df6939 100644 --- a/src/test/compile-fail/if-loop.rs +++ b/src/test/ui/compile-fail-migration/if-loop.rs diff --git a/src/test/ui/compile-fail-migration/if-loop.stderr b/src/test/ui/compile-fail-migration/if-loop.stderr new file mode 100644 index 00000000000..6862560570d --- /dev/null +++ b/src/test/ui/compile-fail-migration/if-loop.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/if-loop.rs:20:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/if-typeck.rs b/src/test/ui/compile-fail-migration/if-typeck.rs index d5d7d2005be..d5d7d2005be 100644 --- a/src/test/compile-fail/if-typeck.rs +++ b/src/test/ui/compile-fail-migration/if-typeck.rs diff --git a/src/test/ui/compile-fail-migration/if-typeck.stderr b/src/test/ui/compile-fail-migration/if-typeck.stderr new file mode 100644 index 00000000000..6d96f8bf223 --- /dev/null +++ b/src/test/ui/compile-fail-migration/if-typeck.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/if-typeck.rs:19:8 + | +LL | if f { } + | ^ expected bool, found fn item + | + = note: expected type `bool` + found type `fn() {f}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/if-without-else-result.rs b/src/test/ui/compile-fail-migration/if-without-else-result.rs index 95bcce5a847..95bcce5a847 100644 --- a/src/test/compile-fail/if-without-else-result.rs +++ b/src/test/ui/compile-fail-migration/if-without-else-result.rs diff --git a/src/test/ui/compile-fail-migration/if-without-else-result.stderr b/src/test/ui/compile-fail-migration/if-without-else-result.stderr new file mode 100644 index 00000000000..ab97f6c81f7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/if-without-else-result.stderr @@ -0,0 +1,12 @@ +error[E0317]: if may be missing an else clause + --> $DIR/if-without-else-result.rs:12:13 + | +LL | let a = if true { true }; + | ^^^^^^^^^^^^^^^^ expected (), found bool + | + = note: expected type `()` + found type `bool` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0317`. diff --git a/src/test/compile-fail/ifmt-bad-format-args.rs b/src/test/ui/compile-fail-migration/ifmt-bad-format-args.rs index 8bd3cb0f60b..8bd3cb0f60b 100644 --- a/src/test/compile-fail/ifmt-bad-format-args.rs +++ b/src/test/ui/compile-fail-migration/ifmt-bad-format-args.rs diff --git a/src/test/ui/compile-fail-migration/ifmt-bad-format-args.stderr b/src/test/ui/compile-fail-migration/ifmt-bad-format-args.stderr new file mode 100644 index 00000000000..d2fe12925d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/ifmt-bad-format-args.stderr @@ -0,0 +1,18 @@ +error: requires at least a format string argument + --> $DIR/ifmt-bad-format-args.rs:12:5 + | +LL | format_args!(); //~ ERROR: requires at least a format string argument + | ^^^^^^^^^^^^^^^ + +error: format argument must be a string literal + --> $DIR/ifmt-bad-format-args.rs:13:18 + | +LL | format_args!(|| {}); //~ ERROR: must be a string literal + | ^^^^^ +help: you might be missing a string literal to format with + | +LL | format_args!("{}", || {}); //~ ERROR: must be a string literal + | ^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/ifmt-unimpl.rs b/src/test/ui/compile-fail-migration/ifmt-unimpl.rs index 9b9bae92c33..9b9bae92c33 100644 --- a/src/test/compile-fail/ifmt-unimpl.rs +++ b/src/test/ui/compile-fail-migration/ifmt-unimpl.rs diff --git a/src/test/ui/compile-fail-migration/ifmt-unimpl.stderr b/src/test/ui/compile-fail-migration/ifmt-unimpl.stderr new file mode 100644 index 00000000000..fbb3136693a --- /dev/null +++ b/src/test/ui/compile-fail-migration/ifmt-unimpl.stderr @@ -0,0 +1,12 @@ +error[E0277]: the trait bound `str: std::fmt::UpperHex` is not satisfied + --> $DIR/ifmt-unimpl.rs:12:21 + | +LL | format!("{:X}", "3"); + | ^^^ the trait `std::fmt::UpperHex` is not implemented for `str` + | + = note: required because of the requirements on the impl of `std::fmt::UpperHex` for `&str` + = note: required by `std::fmt::UpperHex::fmt` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/ifmt-unknown-trait.rs b/src/test/ui/compile-fail-migration/ifmt-unknown-trait.rs index d90b3d3cf81..d90b3d3cf81 100644 --- a/src/test/compile-fail/ifmt-unknown-trait.rs +++ b/src/test/ui/compile-fail-migration/ifmt-unknown-trait.rs diff --git a/src/test/ui/compile-fail-migration/ifmt-unknown-trait.stderr b/src/test/ui/compile-fail-migration/ifmt-unknown-trait.stderr new file mode 100644 index 00000000000..3c746e4c53b --- /dev/null +++ b/src/test/ui/compile-fail-migration/ifmt-unknown-trait.stderr @@ -0,0 +1,8 @@ +error: unknown format trait `notimplemented` + --> $DIR/ifmt-unknown-trait.rs:12:34 + | +LL | format!("{:notimplemented}", "3"); + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/illegal-ufcs-drop.rs b/src/test/ui/compile-fail-migration/illegal-ufcs-drop.rs index f4c653bd573..f4c653bd573 100644 --- a/src/test/compile-fail/illegal-ufcs-drop.rs +++ b/src/test/ui/compile-fail-migration/illegal-ufcs-drop.rs diff --git a/src/test/ui/compile-fail-migration/illegal-ufcs-drop.stderr b/src/test/ui/compile-fail-migration/illegal-ufcs-drop.stderr new file mode 100644 index 00000000000..f82c54664a9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/illegal-ufcs-drop.stderr @@ -0,0 +1,9 @@ +error[E0040]: explicit use of destructor method + --> $DIR/illegal-ufcs-drop.rs:19:5 + | +LL | Drop::drop(&mut Foo) //~ ERROR explicit use of destructor method + | ^^^^^^^^^^ explicit destructor calls not allowed + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0040`. diff --git a/src/test/ui/compile-fail-migration/immut-function-arguments.ast.nll.stderr b/src/test/ui/compile-fail-migration/immut-function-arguments.ast.nll.stderr new file mode 100644 index 00000000000..c8236340627 --- /dev/null +++ b/src/test/ui/compile-fail-migration/immut-function-arguments.ast.nll.stderr @@ -0,0 +1,19 @@ +error[E0384]: cannot assign to immutable argument `y` + --> $DIR/immut-function-arguments.rs:15:5 + | +LL | fn f(y: Box<isize>) { + | - consider changing this to `mut y` +LL | *y = 5; //[ast]~ ERROR cannot assign + | ^^^^^^ cannot assign to immutable argument + +error[E0384]: cannot assign to immutable argument `q` + --> $DIR/immut-function-arguments.rs:20:35 + | +LL | let _frob = |q: Box<isize>| { *q = 2; }; //[ast]~ ERROR cannot assign + | - ^^^^^^ cannot assign to immutable argument + | | + | consider changing this to `mut q` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/immut-function-arguments.ast.stderr b/src/test/ui/compile-fail-migration/immut-function-arguments.ast.stderr new file mode 100644 index 00000000000..54125b955cb --- /dev/null +++ b/src/test/ui/compile-fail-migration/immut-function-arguments.ast.stderr @@ -0,0 +1,19 @@ +error[E0594]: cannot assign to immutable `Box` content `*y` + --> $DIR/immut-function-arguments.rs:15:5 + | +LL | fn f(y: Box<isize>) { + | - consider changing this to `mut y` +LL | *y = 5; //[ast]~ ERROR cannot assign + | ^^^^^^ cannot borrow as mutable + +error[E0594]: cannot assign to immutable `Box` content `*q` + --> $DIR/immut-function-arguments.rs:20:35 + | +LL | let _frob = |q: Box<isize>| { *q = 2; }; //[ast]~ ERROR cannot assign + | - ^^^^^^ cannot borrow as mutable + | | + | consider changing this to `mut q` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/immut-function-arguments.mir.stderr b/src/test/ui/compile-fail-migration/immut-function-arguments.mir.stderr new file mode 100644 index 00000000000..c8236340627 --- /dev/null +++ b/src/test/ui/compile-fail-migration/immut-function-arguments.mir.stderr @@ -0,0 +1,19 @@ +error[E0384]: cannot assign to immutable argument `y` + --> $DIR/immut-function-arguments.rs:15:5 + | +LL | fn f(y: Box<isize>) { + | - consider changing this to `mut y` +LL | *y = 5; //[ast]~ ERROR cannot assign + | ^^^^^^ cannot assign to immutable argument + +error[E0384]: cannot assign to immutable argument `q` + --> $DIR/immut-function-arguments.rs:20:35 + | +LL | let _frob = |q: Box<isize>| { *q = 2; }; //[ast]~ ERROR cannot assign + | - ^^^^^^ cannot assign to immutable argument + | | + | consider changing this to `mut q` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/compile-fail/immut-function-arguments.rs b/src/test/ui/compile-fail-migration/immut-function-arguments.rs index 61a074952ef..61a074952ef 100644 --- a/src/test/compile-fail/immut-function-arguments.rs +++ b/src/test/ui/compile-fail-migration/immut-function-arguments.rs diff --git a/src/test/compile-fail/impl-bounds-checking.rs b/src/test/ui/compile-fail-migration/impl-bounds-checking.rs index f90365b71ae..f90365b71ae 100644 --- a/src/test/compile-fail/impl-bounds-checking.rs +++ b/src/test/ui/compile-fail-migration/impl-bounds-checking.rs diff --git a/src/test/ui/compile-fail-migration/impl-bounds-checking.stderr b/src/test/ui/compile-fail-migration/impl-bounds-checking.stderr new file mode 100644 index 00000000000..80666131b2c --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-bounds-checking.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `isize: Clone2` is not satisfied + --> $DIR/impl-bounds-checking.rs:20:6 + | +LL | impl Getter<isize> for isize { //~ ERROR `isize: Clone2` is not satisfied + | ^^^^^^^^^^^^^ the trait `Clone2` is not implemented for `isize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/impl-trait/impl-generic-mismatch-ab.rs b/src/test/ui/compile-fail-migration/impl-trait/impl-generic-mismatch-ab.rs index 23549918ff1..23549918ff1 100644 --- a/src/test/compile-fail/impl-trait/impl-generic-mismatch-ab.rs +++ b/src/test/ui/compile-fail-migration/impl-trait/impl-generic-mismatch-ab.rs diff --git a/src/test/ui/compile-fail-migration/impl-trait/impl-generic-mismatch-ab.stderr b/src/test/ui/compile-fail-migration/impl-trait/impl-generic-mismatch-ab.stderr new file mode 100644 index 00000000000..77ecdf2f5ac --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-trait/impl-generic-mismatch-ab.stderr @@ -0,0 +1,15 @@ +error[E0053]: method `foo` has an incompatible type for trait + --> $DIR/impl-generic-mismatch-ab.rs:18:32 + | +LL | fn foo<A: Debug>(&self, a: &A, b: &impl Debug); + | -- type in trait +... +LL | fn foo<B: Debug>(&self, a: &impl Debug, b: &B) { } + | ^^^^^^^^^^^ expected type parameter, found a different type parameter + | + = note: expected type `fn(&(), &B, &impl Debug)` + found type `fn(&(), &impl Debug, &B)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/compile-fail/impl-trait/infinite-impl-trait-issue-38064.rs b/src/test/ui/compile-fail-migration/impl-trait/infinite-impl-trait-issue-38064.rs index 653ef1723e0..653ef1723e0 100644 --- a/src/test/compile-fail/impl-trait/infinite-impl-trait-issue-38064.rs +++ b/src/test/ui/compile-fail-migration/impl-trait/infinite-impl-trait-issue-38064.rs diff --git a/src/test/ui/compile-fail-migration/impl-trait/infinite-impl-trait-issue-38064.stderr b/src/test/ui/compile-fail-migration/impl-trait/infinite-impl-trait-issue-38064.stderr new file mode 100644 index 00000000000..f260cce647b --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-trait/infinite-impl-trait-issue-38064.stderr @@ -0,0 +1,7 @@ +error[E0275]: overflow evaluating the requirement `impl Quux` + | + = help: consider adding a `#![recursion_limit="128"]` attribute to your crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/ui/compile-fail-migration/impl-trait/must_outlive_least_region_or_bound.nll.stderr b/src/test/ui/compile-fail-migration/impl-trait/must_outlive_least_region_or_bound.nll.stderr new file mode 100644 index 00000000000..6d581952ac9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-trait/must_outlive_least_region_or_bound.nll.stderr @@ -0,0 +1,73 @@ +warning: not reporting region error due to nll + --> $DIR/must_outlive_least_region_or_bound.rs:13:35 + | +LL | fn elided(x: &i32) -> impl Copy { x } + | ^ + +warning: not reporting region error due to nll + --> $DIR/must_outlive_least_region_or_bound.rs:16:44 + | +LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x } + | ^ + +warning: not reporting region error due to nll + --> $DIR/must_outlive_least_region_or_bound.rs:22:69 + | +LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } + | ^ + +warning: not reporting region error due to nll + --> $DIR/must_outlive_least_region_or_bound.rs:29:5 + | +LL | move |_| println!("{}", y) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/must_outlive_least_region_or_bound.rs:32:51 + | +LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static { + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0621]: explicit lifetime required in the type of `x` + --> $DIR/must_outlive_least_region_or_bound.rs:13:35 + | +LL | fn elided(x: &i32) -> impl Copy { x } + | ---- ^ lifetime `'static` required + | | + | help: add explicit lifetime `'static` to the type of `x`: `&'static i32` + +error: unsatisfied lifetime constraints + --> $DIR/must_outlive_least_region_or_bound.rs:16:44 + | +LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x } + | -- lifetime `'a` defined here ^ return requires that `'a` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/must_outlive_least_region_or_bound.rs:22:69 + | +LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } + | -- lifetime `'a` defined here ^ return requires that `'a` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/must_outlive_least_region_or_bound.rs:29:5 + | +LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | //~^ ERROR lifetime mismatch +LL | move |_| println!("{}", y) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/must_outlive_least_region_or_bound.rs:34:5 + | +LL | x + | ^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + +error: aborting due to 5 previous errors + +Some errors occurred: E0310, E0621. +For more information about an error, try `rustc --explain E0310`. diff --git a/src/test/compile-fail/impl-trait/must_outlive_least_region_or_bound.rs b/src/test/ui/compile-fail-migration/impl-trait/must_outlive_least_region_or_bound.rs index 537fc975bcf..537fc975bcf 100644 --- a/src/test/compile-fail/impl-trait/must_outlive_least_region_or_bound.rs +++ b/src/test/ui/compile-fail-migration/impl-trait/must_outlive_least_region_or_bound.rs diff --git a/src/test/ui/compile-fail-migration/impl-trait/must_outlive_least_region_or_bound.stderr b/src/test/ui/compile-fail-migration/impl-trait/must_outlive_least_region_or_bound.stderr new file mode 100644 index 00000000000..48686cbcaf2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-trait/must_outlive_least_region_or_bound.stderr @@ -0,0 +1,71 @@ +error[E0621]: explicit lifetime required in the type of `x` + --> $DIR/must_outlive_least_region_or_bound.rs:13:23 + | +LL | fn elided(x: &i32) -> impl Copy { x } + | ---- ^^^^^^^^^ lifetime `'static` required + | | + | help: add explicit lifetime `'static` to the type of `x`: `&'static i32` + +error: cannot infer an appropriate lifetime + --> $DIR/must_outlive_least_region_or_bound.rs:16:44 + | +LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x } + | --------- ^ ...but this borrow... + | | + | this return type evaluates to the `'static` lifetime... + | +note: ...can't outlive the lifetime 'a as defined on the function body at 16:13 + --> $DIR/must_outlive_least_region_or_bound.rs:16:13 + | +LL | fn explicit<'a>(x: &'a i32) -> impl Copy { x } + | ^^ +help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime 'a as defined on the function body at 16:13 + | +LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x } + | ^^^^^^^^^^^^^^ + +error: cannot infer an appropriate lifetime + --> $DIR/must_outlive_least_region_or_bound.rs:22:69 + | +LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } + | -------------------------------- ^ ...but this borrow... + | | + | this return type evaluates to the `'static` lifetime... + | +note: ...can't outlive the lifetime 'a as defined on the function body at 22:15 + --> $DIR/must_outlive_least_region_or_bound.rs:22:15 + | +LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static { x } + | ^^ +help: you can add a constraint to the return type to make it last less than `'static` and match the lifetime 'a as defined on the function body at 22:15 + | +LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'static + 'a { x } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0623]: lifetime mismatch + --> $DIR/must_outlive_least_region_or_bound.rs:27:61 + | +LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32) { + | ------- ^^^^^^^^^^^^^^^^ + | | | + | | ...but data from `y` is returned here + | this parameter and the return type are declared with different lifetimes... + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/must_outlive_least_region_or_bound.rs:32:51 + | +LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static { + | -- ^^^^^^^^^^^^^^^^^^^^ + | | + | help: consider adding an explicit lifetime bound `T: 'static`... + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/must_outlive_least_region_or_bound.rs:32:51 + | +LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static { + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0310, E0621, E0623. +For more information about an error, try `rustc --explain E0310`. diff --git a/src/test/compile-fail/impl-trait/needs_least_region_or_bound.rs b/src/test/ui/compile-fail-migration/impl-trait/needs_least_region_or_bound.rs index 6c0a0b800ce..6c0a0b800ce 100644 --- a/src/test/compile-fail/impl-trait/needs_least_region_or_bound.rs +++ b/src/test/ui/compile-fail-migration/impl-trait/needs_least_region_or_bound.rs diff --git a/src/test/ui/compile-fail-migration/impl-trait/needs_least_region_or_bound.stderr b/src/test/ui/compile-fail-migration/impl-trait/needs_least_region_or_bound.stderr new file mode 100644 index 00000000000..fd2665dc762 --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-trait/needs_least_region_or_bound.stderr @@ -0,0 +1,8 @@ +error: ambiguous lifetime bound in `impl Trait` + --> $DIR/needs_least_region_or_bound.rs:16:55 + | +LL | fn no_least_region<'a, 'b>(x: &'a u32, y: &'b u32) -> impl MultiRegionTrait<'a, 'b> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ neither `'a` nor `'b` outlives the other + +error: aborting due to previous error + diff --git a/src/test/compile-fail/impl-trait/no-trait.rs b/src/test/ui/compile-fail-migration/impl-trait/no-trait.rs index 5299ba297d0..5299ba297d0 100644 --- a/src/test/compile-fail/impl-trait/no-trait.rs +++ b/src/test/ui/compile-fail-migration/impl-trait/no-trait.rs diff --git a/src/test/ui/compile-fail-migration/impl-trait/no-trait.stderr b/src/test/ui/compile-fail-migration/impl-trait/no-trait.stderr new file mode 100644 index 00000000000..fdd01c87d1c --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-trait/no-trait.stderr @@ -0,0 +1,8 @@ +error: at least one trait must be specified + --> $DIR/no-trait.rs:11:11 + | +LL | fn f() -> impl 'static {} //~ ERROR at least one trait must be specified + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/impl-trait/type_parameters_captured.nll.stderr b/src/test/ui/compile-fail-migration/impl-trait/type_parameters_captured.nll.stderr new file mode 100644 index 00000000000..823ee446729 --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-trait/type_parameters_captured.nll.stderr @@ -0,0 +1,17 @@ +warning: not reporting region error due to nll + --> $DIR/type_parameters_captured.rs:17:20 + | +LL | fn foo<T>(x: T) -> impl Any + 'static { + | ^^^^^^^^^^^^^^^^^^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/type_parameters_captured.rs:19:5 + | +LL | x + | ^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/compile-fail/impl-trait/type_parameters_captured.rs b/src/test/ui/compile-fail-migration/impl-trait/type_parameters_captured.rs index 7c3430ab90e..7c3430ab90e 100644 --- a/src/test/compile-fail/impl-trait/type_parameters_captured.rs +++ b/src/test/ui/compile-fail-migration/impl-trait/type_parameters_captured.rs diff --git a/src/test/ui/compile-fail-migration/impl-trait/type_parameters_captured.stderr b/src/test/ui/compile-fail-migration/impl-trait/type_parameters_captured.stderr new file mode 100644 index 00000000000..3b9b0e08a45 --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-trait/type_parameters_captured.stderr @@ -0,0 +1,17 @@ +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/type_parameters_captured.rs:17:20 + | +LL | fn foo<T>(x: T) -> impl Any + 'static { + | - ^^^^^^^^^^^^^^^^^^ + | | + | help: consider adding an explicit lifetime bound `T: 'static`... + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/type_parameters_captured.rs:17:20 + | +LL | fn foo<T>(x: T) -> impl Any + 'static { + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/compile-fail/impl-trait/where-allowed.rs b/src/test/ui/compile-fail-migration/impl-trait/where-allowed.rs index 2891cd59e3e..2891cd59e3e 100644 --- a/src/test/compile-fail/impl-trait/where-allowed.rs +++ b/src/test/ui/compile-fail-migration/impl-trait/where-allowed.rs diff --git a/src/test/ui/compile-fail-migration/impl-trait/where-allowed.stderr b/src/test/ui/compile-fail-migration/impl-trait/where-allowed.stderr new file mode 100644 index 00000000000..b15893e7c28 --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-trait/where-allowed.stderr @@ -0,0 +1,244 @@ +error[E0666]: nested `impl Trait` is not allowed + --> $DIR/where-allowed.rs:60:51 + | +LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() } + | --------^^^^^^^^^^- + | | | + | | nested `impl Trait` here + | outer `impl Trait` + +error[E0666]: nested `impl Trait` is not allowed + --> $DIR/where-allowed.rs:69:57 + | +LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() } + | --------^^^^^^^^^^- + | | | + | | nested `impl Trait` here + | outer `impl Trait` + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:28:40 + | +LL | fn in_fn_parameter_in_parameters(_: fn(impl Debug)) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:32:42 + | +LL | fn in_fn_return_in_parameters(_: fn() -> impl Debug) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:36:38 + | +LL | fn in_fn_parameter_in_return() -> fn(impl Debug) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:40:40 + | +LL | fn in_fn_return_in_return() -> fn() -> impl Debug { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:44:49 + | +LL | fn in_dyn_Fn_parameter_in_parameters(_: &dyn Fn(impl Debug)) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:48:51 + | +LL | fn in_dyn_Fn_return_in_parameters(_: &dyn Fn() -> impl Debug) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:52:55 + | +LL | fn in_dyn_Fn_parameter_in_return() -> &'static dyn Fn(impl Debug) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:56:57 + | +LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:60:51 + | +LL | fn in_impl_Fn_parameter_in_parameters(_: &impl Fn(impl Debug)) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:65:53 + | +LL | fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:69:57 + | +LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:74:59 + | +LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:78:38 + | +LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:82:40 + | +LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:95:32 + | +LL | struct InBraceStructField { x: impl Debug } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:99:41 + | +LL | struct InAdtInBraceStructField { x: Vec<impl Debug> } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:103:27 + | +LL | struct InTupleStructField(impl Debug); + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:108:25 + | +LL | InBraceVariant { x: impl Debug }, + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:110:20 + | +LL | InTupleVariant(impl Debug), + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:121:23 + | +LL | fn in_return() -> impl Debug; + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:132:16 + | +LL | type Out = impl Debug; + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:138:34 + | +LL | fn in_trait_impl_return() -> impl Debug { () } + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:151:33 + | +LL | fn in_foreign_parameters(_: impl Debug); + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:154:31 + | +LL | fn in_foreign_return() -> impl Debug; + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:167:23 + | +LL | type InTypeAlias<R> = impl Debug; + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:170:39 + | +LL | type InReturnInTypeAlias<R> = fn() -> impl Debug; + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:174:16 + | +LL | impl PartialEq<impl Debug> for () { + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:179:24 + | +LL | impl PartialEq<()> for impl Debug { + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:184:6 + | +LL | impl impl Debug { + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:190:24 + | +LL | impl InInherentImplAdt<impl Debug> { + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:196:11 + | +LL | where impl Debug: Debug + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:203:15 + | +LL | where Vec<impl Debug>: Debug + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:210:24 + | +LL | where T: PartialEq<impl Debug> + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:217:17 + | +LL | where T: Fn(impl Debug) + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:224:22 + | +LL | where T: Fn() -> impl Debug + | ^^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:230:29 + | +LL | let _in_local_variable: impl Fn() = || {}; + | ^^^^^^^^^ + +error[E0562]: `impl Trait` not allowed outside of function and inherent method return types + --> $DIR/where-allowed.rs:232:46 + | +LL | let _in_return_in_local_variable = || -> impl Fn() { || {} }; + | ^^^^^^^^^ + +error: aborting due to 39 previous errors + +Some errors occurred: E0562, E0666. +For more information about an error, try `rustc --explain E0562`. diff --git a/src/test/compile-fail/impl-unused-tps-inherent.rs b/src/test/ui/compile-fail-migration/impl-unused-tps-inherent.rs index 3803bb9b045..3803bb9b045 100644 --- a/src/test/compile-fail/impl-unused-tps-inherent.rs +++ b/src/test/ui/compile-fail-migration/impl-unused-tps-inherent.rs diff --git a/src/test/ui/compile-fail-migration/impl-unused-tps-inherent.stderr b/src/test/ui/compile-fail-migration/impl-unused-tps-inherent.stderr new file mode 100644 index 00000000000..c1f31deb858 --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-unused-tps-inherent.stderr @@ -0,0 +1,15 @@ +error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-unused-tps-inherent.rs:19:6 + | +LL | impl<T> MyType { + | ^ unconstrained type parameter + +error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-unused-tps-inherent.rs:27:8 + | +LL | impl<T,U> MyType1<T> { + | ^ unconstrained type parameter + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/compile-fail/impl-unused-tps.rs b/src/test/ui/compile-fail-migration/impl-unused-tps.rs index c9399afbb93..c9399afbb93 100644 --- a/src/test/compile-fail/impl-unused-tps.rs +++ b/src/test/ui/compile-fail-migration/impl-unused-tps.rs diff --git a/src/test/ui/compile-fail-migration/impl-unused-tps.stderr b/src/test/ui/compile-fail-migration/impl-unused-tps.stderr new file mode 100644 index 00000000000..f50cc00b2f6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/impl-unused-tps.stderr @@ -0,0 +1,33 @@ +error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-unused-tps.rs:23:8 + | +LL | impl<T,U> Foo<T> for [isize;1] { + | ^ unconstrained type parameter + +error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-unused-tps.rs:40:8 + | +LL | impl<T,U> Bar for T { + | ^ unconstrained type parameter + +error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-unused-tps.rs:48:8 + | +LL | impl<T,U> Bar for T + | ^ unconstrained type parameter + +error[E0207]: the type parameter `U` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-unused-tps.rs:56:8 + | +LL | impl<T,U,V> Foo<T> for T + | ^ unconstrained type parameter + +error[E0207]: the type parameter `V` is not constrained by the impl trait, self type, or predicates + --> $DIR/impl-unused-tps.rs:56:10 + | +LL | impl<T,U,V> Foo<T> for T + | ^ unconstrained type parameter + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0207`. diff --git a/src/test/compile-fail/implicit-method-bind.rs b/src/test/ui/compile-fail-migration/implicit-method-bind.rs index e116966670d..e116966670d 100644 --- a/src/test/compile-fail/implicit-method-bind.rs +++ b/src/test/ui/compile-fail-migration/implicit-method-bind.rs diff --git a/src/test/ui/compile-fail-migration/implicit-method-bind.stderr b/src/test/ui/compile-fail-migration/implicit-method-bind.stderr new file mode 100644 index 00000000000..5de9e58807c --- /dev/null +++ b/src/test/ui/compile-fail-migration/implicit-method-bind.stderr @@ -0,0 +1,11 @@ +error[E0615]: attempted to take value of method `abs` on type `i32` + --> $DIR/implicit-method-bind.rs:12:20 + | +LL | let _f = 10i32.abs; //~ ERROR attempted to take value of method + | ^^^ + | + = help: maybe a `()` to call it is missing? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0615`. diff --git a/src/test/compile-fail/import-crate-var.rs b/src/test/ui/compile-fail-migration/import-crate-var.rs index b09883d9ade..b09883d9ade 100644 --- a/src/test/compile-fail/import-crate-var.rs +++ b/src/test/ui/compile-fail-migration/import-crate-var.rs diff --git a/src/test/ui/compile-fail-migration/import-crate-var.stderr b/src/test/ui/compile-fail-migration/import-crate-var.stderr new file mode 100644 index 00000000000..d2e22391406 --- /dev/null +++ b/src/test/ui/compile-fail-migration/import-crate-var.stderr @@ -0,0 +1,19 @@ +warning: `$crate` may not be imported + --> $DIR/import-crate-var.rs:22:5 + | +LL | m!(); + | ^^^^^ + | + = note: `use $crate;` was erroneously allowed and will become a hard error in a future release + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: compilation successful + --> $DIR/import-crate-var.rs:21:1 + | +LL | / fn main() { +LL | | m!(); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/import-from-missing.rs b/src/test/ui/compile-fail-migration/import-from-missing.rs index 220b255bde4..220b255bde4 100644 --- a/src/test/compile-fail/import-from-missing.rs +++ b/src/test/ui/compile-fail-migration/import-from-missing.rs diff --git a/src/test/ui/compile-fail-migration/import-from-missing.stderr b/src/test/ui/compile-fail-migration/import-from-missing.stderr new file mode 100644 index 00000000000..1b40fe45c7f --- /dev/null +++ b/src/test/ui/compile-fail-migration/import-from-missing.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `spam::eggs` + --> $DIR/import-from-missing.rs:11:17 + | +LL | use spam::{ham, eggs}; //~ ERROR unresolved import `spam::eggs` [E0432] + | ^^^^ no `eggs` in `spam` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/import-glob-0.rs b/src/test/ui/compile-fail-migration/import-glob-0.rs index 774eaf174d9..774eaf174d9 100644 --- a/src/test/compile-fail/import-glob-0.rs +++ b/src/test/ui/compile-fail-migration/import-glob-0.rs diff --git a/src/test/ui/compile-fail-migration/import-glob-0.stderr b/src/test/ui/compile-fail-migration/import-glob-0.stderr new file mode 100644 index 00000000000..91cae30776d --- /dev/null +++ b/src/test/ui/compile-fail-migration/import-glob-0.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find function `f999` in this scope + --> $DIR/import-glob-0.rs:24:5 + | +LL | f999(); //~ ERROR cannot find function `f999` in this scope + | ^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/import-glob-circular.rs b/src/test/ui/compile-fail-migration/import-glob-circular.rs index d9cc17791ed..d9cc17791ed 100644 --- a/src/test/compile-fail/import-glob-circular.rs +++ b/src/test/ui/compile-fail-migration/import-glob-circular.rs diff --git a/src/test/ui/compile-fail-migration/import-glob-circular.stderr b/src/test/ui/compile-fail-migration/import-glob-circular.stderr new file mode 100644 index 00000000000..078a6a3937a --- /dev/null +++ b/src/test/ui/compile-fail-migration/import-glob-circular.stderr @@ -0,0 +1,14 @@ +error[E0425]: cannot find function `f1066` in this scope + --> $DIR/import-glob-circular.rs:26:17 + | +LL | fn test() { f1066(); } //~ ERROR cannot find function `f1066` in this scope + | ^^^^^ not found in this scope + +error[E0601]: `main` function not found in crate `import_glob_circular` + | + = note: consider adding a `main` function to `$DIR/import-glob-circular.rs` + +error: aborting due to 2 previous errors + +Some errors occurred: E0425, E0601. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/import-loop-2.rs b/src/test/ui/compile-fail-migration/import-loop-2.rs index b7bbe11a4dc..b7bbe11a4dc 100644 --- a/src/test/compile-fail/import-loop-2.rs +++ b/src/test/ui/compile-fail-migration/import-loop-2.rs diff --git a/src/test/ui/compile-fail-migration/import-loop-2.stderr b/src/test/ui/compile-fail-migration/import-loop-2.stderr new file mode 100644 index 00000000000..717f74643eb --- /dev/null +++ b/src/test/ui/compile-fail-migration/import-loop-2.stderr @@ -0,0 +1,19 @@ +error[E0432]: unresolved import `a::x` + --> $DIR/import-loop-2.rs:18:13 + | +LL | pub use a::x; + | ^^^^ no `x` in `a` + +error[E0601]: `main` function not found in crate `import_loop_2` + | + = note: the main function must be defined at the crate level but you have one or more functions named 'main' that are not defined at the crate level. Either move the definition or attach the `#[main]` attribute to override this behavior. +note: here is a function named 'main' + --> $DIR/import-loop-2.rs:20:5 + | +LL | fn main() { let y = x; } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0432, E0601. +For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/import-loop.rs b/src/test/ui/compile-fail-migration/import-loop.rs index f9b57f00776..f9b57f00776 100644 --- a/src/test/compile-fail/import-loop.rs +++ b/src/test/ui/compile-fail-migration/import-loop.rs diff --git a/src/test/ui/compile-fail-migration/import-loop.stderr b/src/test/ui/compile-fail-migration/import-loop.stderr new file mode 100644 index 00000000000..b9a1204bb73 --- /dev/null +++ b/src/test/ui/compile-fail-migration/import-loop.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `y::x` + --> $DIR/import-loop.rs:16:13 + | +LL | pub use y::x; + | ^^^^ no `x` in `y` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/import-prefix-macro-1.rs b/src/test/ui/compile-fail-migration/import-prefix-macro-1.rs index beb15a11a96..beb15a11a96 100644 --- a/src/test/compile-fail/import-prefix-macro-1.rs +++ b/src/test/ui/compile-fail-migration/import-prefix-macro-1.rs diff --git a/src/test/ui/compile-fail-migration/import-prefix-macro-1.stderr b/src/test/ui/compile-fail-migration/import-prefix-macro-1.stderr new file mode 100644 index 00000000000..e3f436e4ea8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/import-prefix-macro-1.stderr @@ -0,0 +1,11 @@ +error: expected one of `::`, `;`, or `as`, found `{` + --> $DIR/import-prefix-macro-1.rs:21:27 + | +LL | ($p: path) => (use $p {S, Z}); //~ERROR expected one of `::`, `;`, or `as`, found `{` + | ^ expected one of `::`, `;`, or `as` here +... +LL | import! { a::b::c } + | ------------------- in this macro invocation + +error: aborting due to previous error + diff --git a/src/test/compile-fail/import-prefix-macro-2.rs b/src/test/ui/compile-fail-migration/import-prefix-macro-2.rs index 56c6273aa9a..56c6273aa9a 100644 --- a/src/test/compile-fail/import-prefix-macro-2.rs +++ b/src/test/ui/compile-fail-migration/import-prefix-macro-2.rs diff --git a/src/test/ui/compile-fail-migration/import-prefix-macro-2.stderr b/src/test/ui/compile-fail-migration/import-prefix-macro-2.stderr new file mode 100644 index 00000000000..ab9e32afdf0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/import-prefix-macro-2.stderr @@ -0,0 +1,11 @@ +error: expected identifier, found `a::b::c` + --> $DIR/import-prefix-macro-2.rs:21:26 + | +LL | ($p: path) => (use ::$p {S, Z}); //~ERROR expected identifier, found `a::b::c` + | ^^ expected identifier +... +LL | import! { a::b::c } + | ------------------- in this macro invocation + +error: aborting due to previous error + diff --git a/src/test/compile-fail/import-trait-method.rs b/src/test/ui/compile-fail-migration/import-trait-method.rs index 75081b10d86..75081b10d86 100644 --- a/src/test/compile-fail/import-trait-method.rs +++ b/src/test/ui/compile-fail-migration/import-trait-method.rs diff --git a/src/test/ui/compile-fail-migration/import-trait-method.stderr b/src/test/ui/compile-fail-migration/import-trait-method.stderr new file mode 100644 index 00000000000..917a68a7c8b --- /dev/null +++ b/src/test/ui/compile-fail-migration/import-trait-method.stderr @@ -0,0 +1,9 @@ +error[E0253]: `foo` is not directly importable + --> $DIR/import-trait-method.rs:15:5 + | +LL | use Foo::foo; //~ ERROR not directly importable + | ^^^^^^^^ cannot be imported directly + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0253`. diff --git a/src/test/compile-fail/import.rs b/src/test/ui/compile-fail-migration/import.rs index 81a5334ed7a..81a5334ed7a 100644 --- a/src/test/compile-fail/import.rs +++ b/src/test/ui/compile-fail-migration/import.rs diff --git a/src/test/ui/compile-fail-migration/import.stderr b/src/test/ui/compile-fail-migration/import.stderr new file mode 100644 index 00000000000..89665586844 --- /dev/null +++ b/src/test/ui/compile-fail-migration/import.stderr @@ -0,0 +1,22 @@ +error[E0432]: unresolved import `zed::baz` + --> $DIR/import.rs:12:5 + | +LL | use zed::baz; //~ ERROR unresolved import `zed::baz` [E0432] + | ^^^^^^^^ no `baz` in `zed`. Did you mean to use `bar`? + +error[E0432]: unresolved import `foo` + --> $DIR/import.rs:18:9 + | +LL | use foo; //~ ERROR unresolved import `foo` [E0432] + | ^^^ no `foo` in the root + +error[E0603]: unresolved item `foo` is private + --> $DIR/import.rs:23:5 + | +LL | zed::foo(); //~ ERROR `foo` is private + | ^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0432, E0603. +For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/import2.rs b/src/test/ui/compile-fail-migration/import2.rs index c4bd9ff1e2a..c4bd9ff1e2a 100644 --- a/src/test/compile-fail/import2.rs +++ b/src/test/ui/compile-fail-migration/import2.rs diff --git a/src/test/ui/compile-fail-migration/import2.stderr b/src/test/ui/compile-fail-migration/import2.stderr new file mode 100644 index 00000000000..c07506845c4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/import2.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `baz::zed` + --> $DIR/import2.rs:11:10 + | +LL | use baz::zed::bar; //~ ERROR unresolved import `baz::zed` [E0432] + | ^^^ Could not find `zed` in `baz` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/import3.rs b/src/test/ui/compile-fail-migration/import3.rs index 0a7827587a6..0a7827587a6 100644 --- a/src/test/compile-fail/import3.rs +++ b/src/test/ui/compile-fail-migration/import3.rs diff --git a/src/test/ui/compile-fail-migration/import3.stderr b/src/test/ui/compile-fail-migration/import3.stderr new file mode 100644 index 00000000000..5211b862b3d --- /dev/null +++ b/src/test/ui/compile-fail-migration/import3.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `main` + --> $DIR/import3.rs:12:5 + | +LL | use main::bar; + | ^^^^ Maybe a missing `extern crate main;`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/import4.rs b/src/test/ui/compile-fail-migration/import4.rs index 5f3163e9390..5f3163e9390 100644 --- a/src/test/compile-fail/import4.rs +++ b/src/test/ui/compile-fail-migration/import4.rs diff --git a/src/test/ui/compile-fail-migration/import4.stderr b/src/test/ui/compile-fail-migration/import4.stderr new file mode 100644 index 00000000000..d74e781ad4a --- /dev/null +++ b/src/test/ui/compile-fail-migration/import4.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `a::foo` + --> $DIR/import4.rs:15:17 + | +LL | mod b { pub use a::foo; } + | ^^^^^^ no `foo` in `a` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/imports/reexports.rs b/src/test/ui/compile-fail-migration/imports/reexports.rs index f50b5b0e849..f50b5b0e849 100644 --- a/src/test/compile-fail/imports/reexports.rs +++ b/src/test/ui/compile-fail-migration/imports/reexports.rs diff --git a/src/test/ui/compile-fail-migration/imports/reexports.stderr b/src/test/ui/compile-fail-migration/imports/reexports.stderr new file mode 100644 index 00000000000..a166344314b --- /dev/null +++ b/src/test/ui/compile-fail-migration/imports/reexports.stderr @@ -0,0 +1,34 @@ +error[E0364]: `foo` is private, and cannot be re-exported + --> $DIR/reexports.rs:16:17 + | +LL | pub use super::foo; //~ ERROR cannot be re-exported + | ^^^^^^^^^^ + | +note: consider marking `foo` as `pub` in the imported module + --> $DIR/reexports.rs:16:17 + | +LL | pub use super::foo; //~ ERROR cannot be re-exported + | ^^^^^^^^^^ + +error: A non-empty glob must import something with the glob's visibility + --> $DIR/reexports.rs:17:17 + | +LL | pub use super::*; //~ ERROR must import something with the glob's visibility + | ^^^^^^^^ + +error[E0603]: module `foo` is private + --> $DIR/reexports.rs:38:9 + | +LL | use b::a::foo::S; //~ ERROR `foo` + | ^^^^^^^^^^^^ + +error[E0603]: module `foo` is private + --> $DIR/reexports.rs:39:9 + | +LL | use b::b::foo::S as T; //~ ERROR `foo` + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0364, E0603. +For more information about an error, try `rustc --explain E0364`. diff --git a/src/test/compile-fail/imports/unused-macro-use.rs b/src/test/ui/compile-fail-migration/imports/unused-macro-use.rs index 365521970cd..365521970cd 100644 --- a/src/test/compile-fail/imports/unused-macro-use.rs +++ b/src/test/ui/compile-fail-migration/imports/unused-macro-use.rs diff --git a/src/test/ui/compile-fail-migration/imports/unused-macro-use.stderr b/src/test/ui/compile-fail-migration/imports/unused-macro-use.stderr new file mode 100644 index 00000000000..0920b5c6d1e --- /dev/null +++ b/src/test/ui/compile-fail-migration/imports/unused-macro-use.stderr @@ -0,0 +1,21 @@ +error: unused `#[macro_use]` import + --> $DIR/unused-macro-use.rs:13:1 + | +LL | #[macro_use] //~ ERROR unused `#[macro_use]` import + | ^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/unused-macro-use.rs:11:9 + | +LL | #![deny(unused)] + | ^^^^^^ + = note: #[deny(unused_imports)] implied by #[deny(unused)] + +error: unused `#[macro_use]` import + --> $DIR/unused-macro-use.rs:17:5 + | +LL | panic //~ ERROR unused `#[macro_use]` import + | ^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/imports/unused.rs b/src/test/ui/compile-fail-migration/imports/unused.rs index 1eb756fe9e4..1eb756fe9e4 100644 --- a/src/test/compile-fail/imports/unused.rs +++ b/src/test/ui/compile-fail-migration/imports/unused.rs diff --git a/src/test/ui/compile-fail-migration/imports/unused.stderr b/src/test/ui/compile-fail-migration/imports/unused.stderr new file mode 100644 index 00000000000..ff5c937aa83 --- /dev/null +++ b/src/test/ui/compile-fail-migration/imports/unused.stderr @@ -0,0 +1,15 @@ +error: unused import: `super::f` + --> $DIR/unused.rs:17:24 + | +LL | pub(super) use super::f; //~ ERROR unused + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/unused.rs:11:9 + | +LL | #![deny(unused)] + | ^^^^^^ + = note: #[deny(unused_imports)] implied by #[deny(unused)] + +error: aborting due to previous error + diff --git a/src/test/compile-fail/inaccessible-test-modules.rs b/src/test/ui/compile-fail-migration/inaccessible-test-modules.rs index bfc1ac2daef..bfc1ac2daef 100644 --- a/src/test/compile-fail/inaccessible-test-modules.rs +++ b/src/test/ui/compile-fail-migration/inaccessible-test-modules.rs diff --git a/src/test/ui/compile-fail-migration/inaccessible-test-modules.stderr b/src/test/ui/compile-fail-migration/inaccessible-test-modules.stderr new file mode 100644 index 00000000000..ce8eaf59027 --- /dev/null +++ b/src/test/ui/compile-fail-migration/inaccessible-test-modules.stderr @@ -0,0 +1,15 @@ +error[E0432]: unresolved import `__test` + --> $DIR/inaccessible-test-modules.rs:15:5 + | +LL | use __test as x; //~ ERROR unresolved import `__test` + | ^^^^^^^^^^^ no `__test` in the root. Did you mean to use `__test`? + +error[E0432]: unresolved import `__test_reexports` + --> $DIR/inaccessible-test-modules.rs:16:5 + | +LL | use __test_reexports as y; //~ ERROR unresolved import `__test_reexports` + | ^^^^^^^^^^^^^^^^^^^^^ no `__test_reexports` in the root. Did you mean to use `__test_reexports`? + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/index-bot.rs b/src/test/ui/compile-fail-migration/index-bot.rs index fc88ff6f47b..fc88ff6f47b 100644 --- a/src/test/compile-fail/index-bot.rs +++ b/src/test/ui/compile-fail-migration/index-bot.rs diff --git a/src/test/ui/compile-fail-migration/index-bot.stderr b/src/test/ui/compile-fail-migration/index-bot.stderr new file mode 100644 index 00000000000..1086196d6ae --- /dev/null +++ b/src/test/ui/compile-fail-migration/index-bot.stderr @@ -0,0 +1,9 @@ +error[E0608]: cannot index into a value of type `!` + --> $DIR/index-bot.rs:12:5 + | +LL | (return)[0]; //~ ERROR cannot index into a value of type `!` + | ^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0608`. diff --git a/src/test/compile-fail/index_message.rs b/src/test/ui/compile-fail-migration/index_message.rs index b9daad936c3..b9daad936c3 100644 --- a/src/test/compile-fail/index_message.rs +++ b/src/test/ui/compile-fail-migration/index_message.rs diff --git a/src/test/ui/compile-fail-migration/index_message.stderr b/src/test/ui/compile-fail-migration/index_message.stderr new file mode 100644 index 00000000000..208d33e9cd5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/index_message.stderr @@ -0,0 +1,9 @@ +error[E0608]: cannot index into a value of type `()` + --> $DIR/index_message.rs:13:13 + | +LL | let _ = z[0]; //~ ERROR cannot index into a value of type `()` + | ^^^^ help: to access tuple elements, use: `z.0` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0608`. diff --git a/src/test/compile-fail/indexing-requires-a-uint.rs b/src/test/ui/compile-fail-migration/indexing-requires-a-uint.rs index 624944f7344..624944f7344 100644 --- a/src/test/compile-fail/indexing-requires-a-uint.rs +++ b/src/test/ui/compile-fail-migration/indexing-requires-a-uint.rs diff --git a/src/test/ui/compile-fail-migration/indexing-requires-a-uint.stderr b/src/test/ui/compile-fail-migration/indexing-requires-a-uint.stderr new file mode 100644 index 00000000000..e9608e0b235 --- /dev/null +++ b/src/test/ui/compile-fail-migration/indexing-requires-a-uint.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `u8: std::slice::SliceIndex<[{integer}]>` is not satisfied + --> $DIR/indexing-requires-a-uint.rs:16:5 + | +LL | [0][0u8]; //~ ERROR: the trait bound `u8: std::slice::SliceIndex<[{integer}]>` is not satisfied + | ^^^^^^^^ slice indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::slice::SliceIndex<[{integer}]>` is not implemented for `u8` + = note: required because of the requirements on the impl of `std::ops::Index<u8>` for `[{integer}]` + +error[E0308]: mismatched types + --> $DIR/indexing-requires-a-uint.rs:22:18 + | +LL | bar::<isize>(i); // i should not be re-coerced back to an isize + | ^ expected isize, found usize + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/infinite-autoderef.rs b/src/test/ui/compile-fail-migration/infinite-autoderef.rs index 3635c4dbb02..3635c4dbb02 100644 --- a/src/test/compile-fail/infinite-autoderef.rs +++ b/src/test/ui/compile-fail-migration/infinite-autoderef.rs diff --git a/src/test/ui/compile-fail-migration/infinite-autoderef.stderr b/src/test/ui/compile-fail-migration/infinite-autoderef.stderr new file mode 100644 index 00000000000..b5e20ea5cbf --- /dev/null +++ b/src/test/ui/compile-fail-migration/infinite-autoderef.stderr @@ -0,0 +1,52 @@ +error[E0308]: mismatched types + --> $DIR/infinite-autoderef.rs:30:13 + | +LL | x = box x; + | ^^^^^ + | | + | cyclic type of infinite size + | help: try using a conversion method: `box x.to_string()` + +error[E0055]: reached the recursion limit while auto-dereferencing Foo + --> $DIR/infinite-autoderef.rs:35:5 + | +LL | Foo.foo; + | ^^^^^^^ deref recursion limit reached + | + = help: consider adding a `#![recursion_limit="128"]` attribute to your crate + +error[E0055]: reached the recursion limit while auto-dereferencing Foo + --> $DIR/infinite-autoderef.rs:35:9 + | +LL | Foo.foo; + | ^^^ deref recursion limit reached + | + = help: consider adding a `#![recursion_limit="128"]` attribute to your crate + +error[E0609]: no field `foo` on type `Foo` + --> $DIR/infinite-autoderef.rs:35:9 + | +LL | Foo.foo; + | ^^^ unknown field + +error[E0055]: reached the recursion limit while auto-dereferencing Foo + --> $DIR/infinite-autoderef.rs:36:9 + | +LL | Foo.bar(); + | ^^^ deref recursion limit reached + | + = help: consider adding a `#![recursion_limit="128"]` attribute to your crate + +error[E0599]: no method named `bar` found for type `Foo` in the current scope + --> $DIR/infinite-autoderef.rs:36:9 + | +LL | struct Foo; + | ----------- method `bar` not found for this +... +LL | Foo.bar(); + | ^^^ + +error: aborting due to 6 previous errors + +Some errors occurred: E0055, E0308, E0599, E0609. +For more information about an error, try `rustc --explain E0055`. diff --git a/src/test/compile-fail/infinite-instantiation.rs b/src/test/ui/compile-fail-migration/infinite-instantiation.rs index 08e6bf24691..08e6bf24691 100644 --- a/src/test/compile-fail/infinite-instantiation.rs +++ b/src/test/ui/compile-fail-migration/infinite-instantiation.rs diff --git a/src/test/ui/compile-fail-migration/infinite-instantiation.stderr b/src/test/ui/compile-fail-migration/infinite-instantiation.stderr new file mode 100644 index 00000000000..483605fc389 --- /dev/null +++ b/src/test/ui/compile-fail-migration/infinite-instantiation.stderr @@ -0,0 +1,14 @@ +error: reached the recursion limit while instantiating `function::<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<std::option::Option<usize>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/infinite-instantiation.rs:33:1 + | +LL | / fn function<T:ToOpt + Clone>(counter: usize, t: T) { +LL | | //~^ ERROR reached the recursion limit while instantiating `function::<std::option::Option< +LL | | if counter > 0 { +LL | | function(counter - 1, t.to_option()); +... | +LL | | } +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/infinite-macro-expansion.rs b/src/test/ui/compile-fail-migration/infinite-macro-expansion.rs index 14d22702db7..14d22702db7 100644 --- a/src/test/compile-fail/infinite-macro-expansion.rs +++ b/src/test/ui/compile-fail-migration/infinite-macro-expansion.rs diff --git a/src/test/ui/compile-fail-migration/infinite-macro-expansion.stderr b/src/test/ui/compile-fail-migration/infinite-macro-expansion.stderr new file mode 100644 index 00000000000..79216693475 --- /dev/null +++ b/src/test/ui/compile-fail-migration/infinite-macro-expansion.stderr @@ -0,0 +1,13 @@ +error: recursion limit reached while expanding the macro `recursive` + --> $DIR/infinite-macro-expansion.rs:12:12 + | +LL | () => (recursive!()) //~ ERROR recursion limit reached while expanding the macro `recursive` + | ^^^^^^^^^^^^ +... +LL | recursive!() + | ------------ in this macro invocation + | + = help: consider adding a `#![recursion_limit="128"]` attribute to your crate + +error: aborting due to previous error + diff --git a/src/test/compile-fail/infinite-tag-type-recursion.rs b/src/test/ui/compile-fail-migration/infinite-tag-type-recursion.rs index c9a7f731aea..c9a7f731aea 100644 --- a/src/test/compile-fail/infinite-tag-type-recursion.rs +++ b/src/test/ui/compile-fail-migration/infinite-tag-type-recursion.rs diff --git a/src/test/ui/compile-fail-migration/infinite-tag-type-recursion.stderr b/src/test/ui/compile-fail-migration/infinite-tag-type-recursion.stderr new file mode 100644 index 00000000000..e1fa3dec64c --- /dev/null +++ b/src/test/ui/compile-fail-migration/infinite-tag-type-recursion.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `mlist` has infinite size + --> $DIR/infinite-tag-type-recursion.rs:11:1 + | +LL | enum mlist { cons(isize, mlist), nil, } + | ^^^^^^^^^^ ----- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `mlist` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/compile-fail/infinite-vec-type-recursion.rs b/src/test/ui/compile-fail-migration/infinite-vec-type-recursion.rs index 42c80b54313..42c80b54313 100644 --- a/src/test/compile-fail/infinite-vec-type-recursion.rs +++ b/src/test/ui/compile-fail-migration/infinite-vec-type-recursion.rs diff --git a/src/test/ui/compile-fail-migration/infinite-vec-type-recursion.stderr b/src/test/ui/compile-fail-migration/infinite-vec-type-recursion.stderr new file mode 100644 index 00000000000..3e2d3d6d726 --- /dev/null +++ b/src/test/ui/compile-fail-migration/infinite-vec-type-recursion.stderr @@ -0,0 +1,11 @@ +error[E0391]: cycle detected when processing `x` + --> $DIR/infinite-vec-type-recursion.rs:11:14 + | +LL | type x = Vec<x>; + | ^ + | + = note: ...which again requires processing `x`, completing the cycle + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/compile-fail/inhabitedness-infinite-loop.rs b/src/test/ui/compile-fail-migration/inhabitedness-infinite-loop.rs index d11aacec196..d11aacec196 100644 --- a/src/test/compile-fail/inhabitedness-infinite-loop.rs +++ b/src/test/ui/compile-fail-migration/inhabitedness-infinite-loop.rs diff --git a/src/test/ui/compile-fail-migration/inhabitedness-infinite-loop.stderr b/src/test/ui/compile-fail-migration/inhabitedness-infinite-loop.stderr new file mode 100644 index 00000000000..24237f3a1b6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/inhabitedness-infinite-loop.stderr @@ -0,0 +1,4 @@ +error: reached recursion limit while checking inhabitedness of `Foo<'_, (((((((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))), (((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))))), ((((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))), (((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))))), (((((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))), (((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))))), ((((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))), (((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))))))), ((((((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))), (((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))))), ((((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))), (((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))))), (((((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))), (((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))))), ((((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))))), (((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))), ((((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))))), (((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))), ((((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))))), (((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))), ((((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !))))), (((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))), ((((!, !), (!, !)), ((!, !), (!, !))), (((!, !), (!, !)), ((!, !), (!, !)))))))))))))))>` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/init-unsafe.rs b/src/test/ui/compile-fail-migration/init-unsafe.rs index 9e599cebd7a..9e599cebd7a 100644 --- a/src/test/compile-fail/init-unsafe.rs +++ b/src/test/ui/compile-fail-migration/init-unsafe.rs diff --git a/src/test/ui/compile-fail-migration/init-unsafe.stderr b/src/test/ui/compile-fail-migration/init-unsafe.stderr new file mode 100644 index 00000000000..f3d041fde01 --- /dev/null +++ b/src/test/ui/compile-fail-migration/init-unsafe.stderr @@ -0,0 +1,11 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/init-unsafe.rs:17:17 + | +LL | let stuff = init::<isize>(); //~ ERROR call to unsafe function is unsafe + | ^^^^^^^^^^^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/inner-static-type-parameter.rs b/src/test/ui/compile-fail-migration/inner-static-type-parameter.rs index 4d763017c0f..4d763017c0f 100644 --- a/src/test/compile-fail/inner-static-type-parameter.rs +++ b/src/test/ui/compile-fail-migration/inner-static-type-parameter.rs diff --git a/src/test/ui/compile-fail-migration/inner-static-type-parameter.stderr b/src/test/ui/compile-fail-migration/inner-static-type-parameter.stderr new file mode 100644 index 00000000000..1820e5c57dd --- /dev/null +++ b/src/test/ui/compile-fail-migration/inner-static-type-parameter.stderr @@ -0,0 +1,22 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/inner-static-type-parameter.rs:16:19 + | +LL | fn foo<T>() { + | --- - type variable from outer function + | | + | try adding a local type parameter in this method instead +LL | static a: Bar<T> = Bar::What; + | ^ use of type variable from outer function + +error[E0392]: parameter `T` is never used + --> $DIR/inner-static-type-parameter.rs:13:10 + | +LL | enum Bar<T> { What } //~ ERROR parameter `T` is never used + | ^ unused type parameter + | + = help: consider removing `T` or using a marker such as `std::marker::PhantomData` + +error: aborting due to 2 previous errors + +Some errors occurred: E0392, E0401. +For more information about an error, try `rustc --explain E0392`. diff --git a/src/test/compile-fail/integer-literal-suffix-inference.rs b/src/test/ui/compile-fail-migration/integer-literal-suffix-inference.rs index 7a850d90a87..7a850d90a87 100644 --- a/src/test/compile-fail/integer-literal-suffix-inference.rs +++ b/src/test/ui/compile-fail-migration/integer-literal-suffix-inference.rs diff --git a/src/test/ui/compile-fail-migration/integer-literal-suffix-inference.stderr b/src/test/ui/compile-fail-migration/integer-literal-suffix-inference.stderr new file mode 100644 index 00000000000..1c5d656020c --- /dev/null +++ b/src/test/ui/compile-fail-migration/integer-literal-suffix-inference.stderr @@ -0,0 +1,291 @@ +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:42:11 + | +LL | id_i8(a16); + | ^^^ expected i8, found i16 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:45:11 + | +LL | id_i8(a32); + | ^^^ expected i8, found i32 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:48:11 + | +LL | id_i8(a64); + | ^^^ expected i8, found i64 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:52:12 + | +LL | id_i16(a8); + | ^^ expected i16, found i8 +help: you can cast an `i8` to `i16`, which will sign-extend the source value + | +LL | id_i16(a8.into()); + | ^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:56:12 + | +LL | id_i16(a32); + | ^^^ expected i16, found i32 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:59:12 + | +LL | id_i16(a64); + | ^^^ expected i16, found i64 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:63:12 + | +LL | id_i32(a8); + | ^^ expected i32, found i8 +help: you can cast an `i8` to `i32`, which will sign-extend the source value + | +LL | id_i32(a8.into()); + | ^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:66:12 + | +LL | id_i32(a16); + | ^^^ expected i32, found i16 +help: you can cast an `i16` to `i32`, which will sign-extend the source value + | +LL | id_i32(a16.into()); + | ^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:70:12 + | +LL | id_i32(a64); + | ^^^ expected i32, found i64 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:74:12 + | +LL | id_i64(a8); + | ^^ expected i64, found i8 +help: you can cast an `i8` to `i64`, which will sign-extend the source value + | +LL | id_i64(a8.into()); + | ^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:77:12 + | +LL | id_i64(a16); + | ^^^ expected i64, found i16 +help: you can cast an `i16` to `i64`, which will sign-extend the source value + | +LL | id_i64(a16.into()); + | ^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:80:12 + | +LL | id_i64(a32); + | ^^^ expected i64, found i32 +help: you can cast an `i32` to `i64`, which will sign-extend the source value + | +LL | id_i64(a32.into()); + | ^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:86:11 + | +LL | id_i8(c16); + | ^^^ expected i8, found i16 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:89:11 + | +LL | id_i8(c32); + | ^^^ expected i8, found i32 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:92:11 + | +LL | id_i8(c64); + | ^^^ expected i8, found i64 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:96:12 + | +LL | id_i16(c8); + | ^^ expected i16, found i8 +help: you can cast an `i8` to `i16`, which will sign-extend the source value + | +LL | id_i16(c8.into()); + | ^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:100:12 + | +LL | id_i16(c32); + | ^^^ expected i16, found i32 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:103:12 + | +LL | id_i16(c64); + | ^^^ expected i16, found i64 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:107:12 + | +LL | id_i32(c8); + | ^^ expected i32, found i8 +help: you can cast an `i8` to `i32`, which will sign-extend the source value + | +LL | id_i32(c8.into()); + | ^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:110:12 + | +LL | id_i32(c16); + | ^^^ expected i32, found i16 +help: you can cast an `i16` to `i32`, which will sign-extend the source value + | +LL | id_i32(c16.into()); + | ^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:114:12 + | +LL | id_i32(c64); + | ^^^ expected i32, found i64 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:118:12 + | +LL | id_i64(a8); + | ^^ expected i64, found i8 +help: you can cast an `i8` to `i64`, which will sign-extend the source value + | +LL | id_i64(a8.into()); + | ^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:121:12 + | +LL | id_i64(a16); + | ^^^ expected i64, found i16 +help: you can cast an `i16` to `i64`, which will sign-extend the source value + | +LL | id_i64(a16.into()); + | ^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:124:12 + | +LL | id_i64(a32); + | ^^^ expected i64, found i32 +help: you can cast an `i32` to `i64`, which will sign-extend the source value + | +LL | id_i64(a32.into()); + | ^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:130:11 + | +LL | id_u8(b16); + | ^^^ expected u8, found u16 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:133:11 + | +LL | id_u8(b32); + | ^^^ expected u8, found u32 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:136:11 + | +LL | id_u8(b64); + | ^^^ expected u8, found u64 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:140:12 + | +LL | id_u16(b8); + | ^^ expected u16, found u8 +help: you can cast an `u8` to `u16`, which will zero-extend the source value + | +LL | id_u16(b8.into()); + | ^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:144:12 + | +LL | id_u16(b32); + | ^^^ expected u16, found u32 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:147:12 + | +LL | id_u16(b64); + | ^^^ expected u16, found u64 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:151:12 + | +LL | id_u32(b8); + | ^^ expected u32, found u8 +help: you can cast an `u8` to `u32`, which will zero-extend the source value + | +LL | id_u32(b8.into()); + | ^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:154:12 + | +LL | id_u32(b16); + | ^^^ expected u32, found u16 +help: you can cast an `u16` to `u32`, which will zero-extend the source value + | +LL | id_u32(b16.into()); + | ^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:158:12 + | +LL | id_u32(b64); + | ^^^ expected u32, found u64 + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:162:12 + | +LL | id_u64(b8); + | ^^ expected u64, found u8 +help: you can cast an `u8` to `u64`, which will zero-extend the source value + | +LL | id_u64(b8.into()); + | ^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:165:12 + | +LL | id_u64(b16); + | ^^^ expected u64, found u16 +help: you can cast an `u16` to `u64`, which will zero-extend the source value + | +LL | id_u64(b16.into()); + | ^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/integer-literal-suffix-inference.rs:168:12 + | +LL | id_u64(b32); + | ^^^ expected u64, found u32 +help: you can cast an `u32` to `u64`, which will zero-extend the source value + | +LL | id_u64(b32.into()); + | ^^^^^^^^^^ + +error: aborting due to 36 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/integral-indexing.rs b/src/test/ui/compile-fail-migration/integral-indexing.rs index 4b01afb8131..4b01afb8131 100644 --- a/src/test/compile-fail/integral-indexing.rs +++ b/src/test/ui/compile-fail-migration/integral-indexing.rs diff --git a/src/test/ui/compile-fail-migration/integral-indexing.stderr b/src/test/ui/compile-fail-migration/integral-indexing.stderr new file mode 100644 index 00000000000..d86421a7985 --- /dev/null +++ b/src/test/ui/compile-fail-migration/integral-indexing.stderr @@ -0,0 +1,75 @@ +error[E0277]: the trait bound `u8: std::slice::SliceIndex<[isize]>` is not satisfied + --> $DIR/integral-indexing.rs:16:5 + | +LL | v[3u8]; //~ERROR : std::slice::SliceIndex<[isize]>` is not satisfied + | ^^^^^^ slice indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::slice::SliceIndex<[isize]>` is not implemented for `u8` + = note: required because of the requirements on the impl of `std::ops::Index<u8>` for `std::vec::Vec<isize>` + +error[E0277]: the trait bound `i8: std::slice::SliceIndex<[isize]>` is not satisfied + --> $DIR/integral-indexing.rs:17:5 + | +LL | v[3i8]; //~ERROR : std::slice::SliceIndex<[isize]>` is not satisfied + | ^^^^^^ slice indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::slice::SliceIndex<[isize]>` is not implemented for `i8` + = note: required because of the requirements on the impl of `std::ops::Index<i8>` for `std::vec::Vec<isize>` + +error[E0277]: the trait bound `u32: std::slice::SliceIndex<[isize]>` is not satisfied + --> $DIR/integral-indexing.rs:18:5 + | +LL | v[3u32]; //~ERROR : std::slice::SliceIndex<[isize]>` is not satisfied + | ^^^^^^^ slice indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::slice::SliceIndex<[isize]>` is not implemented for `u32` + = note: required because of the requirements on the impl of `std::ops::Index<u32>` for `std::vec::Vec<isize>` + +error[E0277]: the trait bound `i32: std::slice::SliceIndex<[isize]>` is not satisfied + --> $DIR/integral-indexing.rs:19:5 + | +LL | v[3i32]; //~ERROR : std::slice::SliceIndex<[isize]>` is not satisfied + | ^^^^^^^ slice indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::slice::SliceIndex<[isize]>` is not implemented for `i32` + = note: required because of the requirements on the impl of `std::ops::Index<i32>` for `std::vec::Vec<isize>` + +error[E0277]: the trait bound `u8: std::slice::SliceIndex<[u8]>` is not satisfied + --> $DIR/integral-indexing.rs:22:5 + | +LL | s.as_bytes()[3u8]; //~ERROR : std::slice::SliceIndex<[u8]>` is not satisfied + | ^^^^^^^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::slice::SliceIndex<[u8]>` is not implemented for `u8` + = note: required because of the requirements on the impl of `std::ops::Index<u8>` for `[u8]` + +error[E0277]: the trait bound `i8: std::slice::SliceIndex<[u8]>` is not satisfied + --> $DIR/integral-indexing.rs:23:5 + | +LL | s.as_bytes()[3i8]; //~ERROR : std::slice::SliceIndex<[u8]>` is not satisfied + | ^^^^^^^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::slice::SliceIndex<[u8]>` is not implemented for `i8` + = note: required because of the requirements on the impl of `std::ops::Index<i8>` for `[u8]` + +error[E0277]: the trait bound `u32: std::slice::SliceIndex<[u8]>` is not satisfied + --> $DIR/integral-indexing.rs:24:5 + | +LL | s.as_bytes()[3u32]; //~ERROR : std::slice::SliceIndex<[u8]>` is not satisfied + | ^^^^^^^^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::slice::SliceIndex<[u8]>` is not implemented for `u32` + = note: required because of the requirements on the impl of `std::ops::Index<u32>` for `[u8]` + +error[E0277]: the trait bound `i32: std::slice::SliceIndex<[u8]>` is not satisfied + --> $DIR/integral-indexing.rs:25:5 + | +LL | s.as_bytes()[3i32]; //~ERROR : std::slice::SliceIndex<[u8]>` is not satisfied + | ^^^^^^^^^^^^^^^^^^ slice indices are of type `usize` or ranges of `usize` + | + = help: the trait `std::slice::SliceIndex<[u8]>` is not implemented for `i32` + = note: required because of the requirements on the impl of `std::ops::Index<i32>` for `[u8]` + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/integral-variable-unification-error.rs b/src/test/ui/compile-fail-migration/integral-variable-unification-error.rs index f2686ae4d19..f2686ae4d19 100644 --- a/src/test/compile-fail/integral-variable-unification-error.rs +++ b/src/test/ui/compile-fail-migration/integral-variable-unification-error.rs diff --git a/src/test/ui/compile-fail-migration/integral-variable-unification-error.stderr b/src/test/ui/compile-fail-migration/integral-variable-unification-error.stderr new file mode 100644 index 00000000000..bbaa6030866 --- /dev/null +++ b/src/test/ui/compile-fail-migration/integral-variable-unification-error.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/integral-variable-unification-error.rs:13:9 + | +LL | x = 5.0; + | ^^^ expected integral variable, found floating-point variable + | + = note: expected type `{integer}` + found type `{float}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/internal-unstable-noallow.rs b/src/test/ui/compile-fail-migration/internal-unstable-noallow.rs index 2e42e9d3b01..2e42e9d3b01 100644 --- a/src/test/compile-fail/internal-unstable-noallow.rs +++ b/src/test/ui/compile-fail-migration/internal-unstable-noallow.rs diff --git a/src/test/ui/compile-fail-migration/internal-unstable-noallow.stderr b/src/test/ui/compile-fail-migration/internal-unstable-noallow.stderr new file mode 100644 index 00000000000..fc8100525e9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/internal-unstable-noallow.stderr @@ -0,0 +1,39 @@ +error[E0658]: use of unstable library feature 'function' + --> $DIR/internal-unstable-noallow.rs:26:5 + | +LL | call_unstable_noallow!(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(function)] to the crate attributes to enable + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error[E0658]: use of unstable library feature 'struct_field' + --> $DIR/internal-unstable-noallow.rs:28:5 + | +LL | construct_unstable_noallow!(0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(struct_field)] to the crate attributes to enable + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error[E0658]: use of unstable library feature 'method' + --> $DIR/internal-unstable-noallow.rs:30:35 + | +LL | |x: internal_unstable::Foo| { call_method_noallow!(x) }; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(method)] to the crate attributes to enable + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error[E0658]: use of unstable library feature 'struct2_field' + --> $DIR/internal-unstable-noallow.rs:32:35 + | +LL | |x: internal_unstable::Bar| { access_field_noallow!(x) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(struct2_field)] to the crate attributes to enable + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/internal-unstable-thread-local.rs b/src/test/ui/compile-fail-migration/internal-unstable-thread-local.rs index 74526fb3d83..74526fb3d83 100644 --- a/src/test/compile-fail/internal-unstable-thread-local.rs +++ b/src/test/ui/compile-fail-migration/internal-unstable-thread-local.rs diff --git a/src/test/ui/compile-fail-migration/internal-unstable-thread-local.stderr b/src/test/ui/compile-fail-migration/internal-unstable-thread-local.stderr new file mode 100644 index 00000000000..b77b94663ff --- /dev/null +++ b/src/test/ui/compile-fail-migration/internal-unstable-thread-local.stderr @@ -0,0 +1,11 @@ +error[E0658]: use of unstable library feature 'function' + --> $DIR/internal-unstable-thread-local.rs:19:32 + | +LL | thread_local!(static BAR: () = internal_unstable::unstable()); //~ ERROR use of unstable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(function)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/internal-unstable.rs b/src/test/ui/compile-fail-migration/internal-unstable.rs index e01259f0deb..e01259f0deb 100644 --- a/src/test/compile-fail/internal-unstable.rs +++ b/src/test/ui/compile-fail-migration/internal-unstable.rs diff --git a/src/test/ui/compile-fail-migration/internal-unstable.stderr b/src/test/ui/compile-fail-migration/internal-unstable.stderr new file mode 100644 index 00000000000..ec4f0725c34 --- /dev/null +++ b/src/test/ui/compile-fail-migration/internal-unstable.stderr @@ -0,0 +1,46 @@ +error[E0658]: use of unstable library feature 'function' + --> $DIR/internal-unstable.rs:43:25 + | +LL | pass_through_allow!(internal_unstable::unstable()); //~ ERROR use of unstable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(function)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'function' + --> $DIR/internal-unstable.rs:45:27 + | +LL | pass_through_noallow!(internal_unstable::unstable()); //~ ERROR use of unstable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(function)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'function' + --> $DIR/internal-unstable.rs:49:22 + | +LL | println!("{:?}", internal_unstable::unstable()); //~ ERROR use of unstable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(function)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'function' + --> $DIR/internal-unstable.rs:51:10 + | +LL | bar!(internal_unstable::unstable()); //~ ERROR use of unstable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(function)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'function' + --> $DIR/internal-unstable.rs:22:9 + | +LL | internal_unstable::unstable(); //~ ERROR use of unstable + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | bar!(internal_unstable::unstable()); //~ ERROR use of unstable + | ------------------------------------ in this macro invocation + | + = help: add #![feature(function)] to the crate attributes to enable + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/intrinsic-invalid-number-of-arguments.rs b/src/test/ui/compile-fail-migration/intrinsic-invalid-number-of-arguments.rs index a224690af76..a224690af76 100644 --- a/src/test/compile-fail/intrinsic-invalid-number-of-arguments.rs +++ b/src/test/ui/compile-fail-migration/intrinsic-invalid-number-of-arguments.rs diff --git a/src/test/ui/compile-fail-migration/intrinsic-invalid-number-of-arguments.stderr b/src/test/ui/compile-fail-migration/intrinsic-invalid-number-of-arguments.stderr new file mode 100644 index 00000000000..af852b669c4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/intrinsic-invalid-number-of-arguments.stderr @@ -0,0 +1,9 @@ +error[E0444]: platform-specific intrinsic has invalid number of arguments: found 3, expected 1 + --> $DIR/intrinsic-invalid-number-of-arguments.rs:20:5 + | +LL | fn x86_mm_movemask_pd(x: f64x2, y: f64x2, z: f64x2) -> i32; //~ platform-specific intrinsic + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0444`. diff --git a/src/test/compile-fail/invalid-crate-type.rs b/src/test/ui/compile-fail-migration/invalid-crate-type.rs index 4b6b6c2fe76..4b6b6c2fe76 100644 --- a/src/test/compile-fail/invalid-crate-type.rs +++ b/src/test/ui/compile-fail-migration/invalid-crate-type.rs diff --git a/src/test/ui/compile-fail-migration/invalid-crate-type.stderr b/src/test/ui/compile-fail-migration/invalid-crate-type.stderr new file mode 100644 index 00000000000..6dc8a0f2bbb --- /dev/null +++ b/src/test/ui/compile-fail-migration/invalid-crate-type.stderr @@ -0,0 +1,10 @@ +error: invalid `crate_type` value + --> $DIR/invalid-crate-type.rs:12:1 + | +LL | #![crate_type="foo"] //~ ERROR invalid `crate_type` value + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: #[deny(unknown_crate_types)] on by default + +error: aborting due to previous error + diff --git a/src/test/compile-fail/invalid-inline.rs b/src/test/ui/compile-fail-migration/invalid-inline.rs index 93b985b4fb0..93b985b4fb0 100644 --- a/src/test/compile-fail/invalid-inline.rs +++ b/src/test/ui/compile-fail-migration/invalid-inline.rs diff --git a/src/test/ui/compile-fail-migration/invalid-inline.stderr b/src/test/ui/compile-fail-migration/invalid-inline.stderr new file mode 100644 index 00000000000..d4861c23aee --- /dev/null +++ b/src/test/ui/compile-fail-migration/invalid-inline.stderr @@ -0,0 +1,22 @@ +error[E0535]: invalid argument + --> $DIR/invalid-inline.rs:12:10 + | +LL | #[inline(please_no)] //~ ERROR invalid argument + | ^^^^^^^^^ + +error[E0534]: expected one argument + --> $DIR/invalid-inline.rs:16:1 + | +LL | #[inline(please,no)] //~ ERROR expected one argument + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0534]: expected one argument + --> $DIR/invalid-inline.rs:20:1 + | +LL | #[inline()] //~ ERROR expected one argument + | ^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0534, E0535. +For more information about an error, try `rustc --explain E0534`. diff --git a/src/test/compile-fail/invalid-macro-matcher.rs b/src/test/ui/compile-fail-migration/invalid-macro-matcher.rs index d710f5647dd..d710f5647dd 100644 --- a/src/test/compile-fail/invalid-macro-matcher.rs +++ b/src/test/ui/compile-fail-migration/invalid-macro-matcher.rs diff --git a/src/test/ui/compile-fail-migration/invalid-macro-matcher.stderr b/src/test/ui/compile-fail-migration/invalid-macro-matcher.stderr new file mode 100644 index 00000000000..d3ddb613f94 --- /dev/null +++ b/src/test/ui/compile-fail-migration/invalid-macro-matcher.stderr @@ -0,0 +1,8 @@ +error: invalid macro matcher; matchers must be contained in balanced delimiters + --> $DIR/invalid-macro-matcher.rs:14:5 + | +LL | _ => (); //~ ERROR invalid macro matcher + | ^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/invalid-plugin-attr.rs b/src/test/ui/compile-fail-migration/invalid-plugin-attr.rs index 3bf09e10ae8..3bf09e10ae8 100644 --- a/src/test/compile-fail/invalid-plugin-attr.rs +++ b/src/test/ui/compile-fail-migration/invalid-plugin-attr.rs diff --git a/src/test/ui/compile-fail-migration/invalid-plugin-attr.stderr b/src/test/ui/compile-fail-migration/invalid-plugin-attr.stderr new file mode 100644 index 00000000000..a5d321ea9bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/invalid-plugin-attr.stderr @@ -0,0 +1,20 @@ +error: unused attribute + --> $DIR/invalid-plugin-attr.rs:14:1 + | +LL | #[plugin(bla)] //~ ERROR unused attribute + | ^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/invalid-plugin-attr.rs:11:9 + | +LL | #![deny(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + +error: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] + --> $DIR/invalid-plugin-attr.rs:14:1 + | +LL | #[plugin(bla)] //~ ERROR unused attribute + | ^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/invalid_crate_type_syntax.rs b/src/test/ui/compile-fail-migration/invalid_crate_type_syntax.rs index 6d42515704e..6d42515704e 100644 --- a/src/test/compile-fail/invalid_crate_type_syntax.rs +++ b/src/test/ui/compile-fail-migration/invalid_crate_type_syntax.rs diff --git a/src/test/ui/compile-fail-migration/invalid_crate_type_syntax.stderr b/src/test/ui/compile-fail-migration/invalid_crate_type_syntax.stderr new file mode 100644 index 00000000000..b609695b86e --- /dev/null +++ b/src/test/ui/compile-fail-migration/invalid_crate_type_syntax.stderr @@ -0,0 +1,15 @@ +error: `crate_type` requires a value + --> $DIR/invalid_crate_type_syntax.rs:12:1 + | +LL | #![crate_type(lib)] //~ ERROR `crate_type` requires a value + | ^^^^^^^^^^^^^^^^^^^ + | + = note: for example: `#![crate_type="lib"]` + +error[E0601]: `main` function not found in crate `invalid_crate_type_syntax` + | + = note: consider adding a `main` function to `$DIR/invalid_crate_type_syntax.rs` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/compile-fail/isssue-38821.rs b/src/test/ui/compile-fail-migration/isssue-38821.rs index 63de780e109..63de780e109 100644 --- a/src/test/compile-fail/isssue-38821.rs +++ b/src/test/ui/compile-fail-migration/isssue-38821.rs diff --git a/src/test/ui/compile-fail-migration/isssue-38821.stderr b/src/test/ui/compile-fail-migration/isssue-38821.stderr new file mode 100644 index 00000000000..a9e12e40d5d --- /dev/null +++ b/src/test/ui/compile-fail-migration/isssue-38821.stderr @@ -0,0 +1,12 @@ +error[E0277]: the trait bound `<Col as Expression>::SqlType: NotNull` is not satisfied + --> $DIR/isssue-38821.rs:33:17 + | +LL | #[derive(Debug, Copy, Clone)] + | ^^^^ the trait `NotNull` is not implemented for `<Col as Expression>::SqlType` + | + = help: consider adding a `where <Col as Expression>::SqlType: NotNull` bound + = note: required because of the requirements on the impl of `IntoNullable` for `<Col as Expression>::SqlType` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/issue-10755.rs b/src/test/ui/compile-fail-migration/issue-10755.rs index 57915bce456..57915bce456 100644 --- a/src/test/compile-fail/issue-10755.rs +++ b/src/test/ui/compile-fail-migration/issue-10755.rs diff --git a/src/test/ui/compile-fail-migration/issue-10755.stderr b/src/test/ui/compile-fail-migration/issue-10755.stderr new file mode 100644 index 00000000000..db64944d44f --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-10755.stderr @@ -0,0 +1,6 @@ +error: linker `llllll` not found + | + = note: No such file or directory (os error 2) + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-11593.rs b/src/test/ui/compile-fail-migration/issue-11593.rs index 2749438433d..2749438433d 100644 --- a/src/test/compile-fail/issue-11593.rs +++ b/src/test/ui/compile-fail-migration/issue-11593.rs diff --git a/src/test/ui/compile-fail-migration/issue-11593.stderr b/src/test/ui/compile-fail-migration/issue-11593.stderr new file mode 100644 index 00000000000..24e1a5eb6f4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-11593.stderr @@ -0,0 +1,9 @@ +error[E0603]: trait `Foo` is private + --> $DIR/issue-11593.rs:17:6 + | +LL | impl private_trait_xc::Foo for Bar {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/issue-11680.rs b/src/test/ui/compile-fail-migration/issue-11680.rs index 7dccd781106..7dccd781106 100644 --- a/src/test/compile-fail/issue-11680.rs +++ b/src/test/ui/compile-fail-migration/issue-11680.rs diff --git a/src/test/ui/compile-fail-migration/issue-11680.stderr b/src/test/ui/compile-fail-migration/issue-11680.stderr new file mode 100644 index 00000000000..37cfe960600 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-11680.stderr @@ -0,0 +1,15 @@ +error[E0603]: enum `Foo` is private + --> $DIR/issue-11680.rs:16:14 + | +LL | let _b = other::Foo::Bar(1); + | ^^^^^^^^^^^^^^^ + +error[E0603]: enum `Foo` is private + --> $DIR/issue-11680.rs:19:14 + | +LL | let _b = other::test::Foo::Bar(1); + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/issue-15919.rs b/src/test/ui/compile-fail-migration/issue-15919.rs index df7e7c102b2..df7e7c102b2 100644 --- a/src/test/compile-fail/issue-15919.rs +++ b/src/test/ui/compile-fail-migration/issue-15919.rs diff --git a/src/test/ui/compile-fail-migration/issue-15919.stderr b/src/test/ui/compile-fail-migration/issue-15919.stderr new file mode 100644 index 00000000000..a69e7b43e25 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-15919.stderr @@ -0,0 +1,4 @@ +error: the type `[usize; 18446744073709551615]` is too big for the current architecture + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-16725.rs b/src/test/ui/compile-fail-migration/issue-16725.rs index cadf602a4cf..cadf602a4cf 100644 --- a/src/test/compile-fail/issue-16725.rs +++ b/src/test/ui/compile-fail-migration/issue-16725.rs diff --git a/src/test/ui/compile-fail-migration/issue-16725.stderr b/src/test/ui/compile-fail-migration/issue-16725.stderr new file mode 100644 index 00000000000..709f3cf50b9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-16725.stderr @@ -0,0 +1,9 @@ +error[E0603]: function `bar` is private + --> $DIR/issue-16725.rs:16:14 + | +LL | unsafe { foo::bar(); } + | ^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/issue-17718-const-privacy.rs b/src/test/ui/compile-fail-migration/issue-17718-const-privacy.rs index 523a387956a..523a387956a 100644 --- a/src/test/compile-fail/issue-17718-const-privacy.rs +++ b/src/test/ui/compile-fail-migration/issue-17718-const-privacy.rs diff --git a/src/test/ui/compile-fail-migration/issue-17718-const-privacy.stderr b/src/test/ui/compile-fail-migration/issue-17718-const-privacy.stderr new file mode 100644 index 00000000000..a453e599c8b --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-17718-const-privacy.stderr @@ -0,0 +1,15 @@ +error[E0603]: constant `B` is private + --> $DIR/issue-17718-const-privacy.rs:15:5 + | +LL | use a::B; //~ ERROR: constant `B` is private + | ^^^^ + +error[E0603]: constant `BAR` is private + --> $DIR/issue-17718-const-privacy.rs:18:5 + | +LL | BAR, //~ ERROR: constant `BAR` is private + | ^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/issue-17913.rs b/src/test/ui/compile-fail-migration/issue-17913.rs index 80e5f2b6e21..80e5f2b6e21 100644 --- a/src/test/compile-fail/issue-17913.rs +++ b/src/test/ui/compile-fail-migration/issue-17913.rs diff --git a/src/test/ui/compile-fail-migration/issue-17913.stderr b/src/test/ui/compile-fail-migration/issue-17913.stderr new file mode 100644 index 00000000000..ca8a28c0fd7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-17913.stderr @@ -0,0 +1,4 @@ +error: the type `[&usize; 17293822569102704640]` is too big for the current architecture + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/issue-19163.nll.stderr b/src/test/ui/compile-fail-migration/issue-19163.nll.stderr new file mode 100644 index 00000000000..32059bf0af1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-19163.nll.stderr @@ -0,0 +1,9 @@ +error[E0596]: cannot borrow data in a `&` reference as mutable + --> $DIR/issue-19163.rs:19:14 + | +LL | mywrite!(&v, "Hello world"); + | ^^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/issue-19163.rs b/src/test/ui/compile-fail-migration/issue-19163.rs index cd6f7c4fd8f..cd6f7c4fd8f 100644 --- a/src/test/compile-fail/issue-19163.rs +++ b/src/test/ui/compile-fail-migration/issue-19163.rs diff --git a/src/test/ui/compile-fail-migration/issue-19163.stderr b/src/test/ui/compile-fail-migration/issue-19163.stderr new file mode 100644 index 00000000000..f7e65e18326 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-19163.stderr @@ -0,0 +1,9 @@ +error[E0596]: cannot borrow immutable borrowed content as mutable + --> $DIR/issue-19163.rs:19:14 + | +LL | mywrite!(&v, "Hello world"); + | ^^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/issue-1920-1.rs b/src/test/ui/compile-fail-migration/issue-1920-1.rs index 97dd290a45b..97dd290a45b 100644 --- a/src/test/compile-fail/issue-1920-1.rs +++ b/src/test/ui/compile-fail-migration/issue-1920-1.rs diff --git a/src/test/ui/compile-fail-migration/issue-1920-1.stderr b/src/test/ui/compile-fail-migration/issue-1920-1.stderr new file mode 100644 index 00000000000..bd823ad6fb6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-1920-1.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `foo::issue_1920::S: std::clone::Clone` is not satisfied + --> $DIR/issue-1920-1.rs:22:5 + | +LL | assert_clone::<foo::issue_1920::S>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `foo::issue_1920::S` + | +note: required by `assert_clone` + --> $DIR/issue-1920-1.rs:19:1 + | +LL | fn assert_clone<T>() where T : Clone { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/issue-1920-2.rs b/src/test/ui/compile-fail-migration/issue-1920-2.rs index 2af6e2cc991..2af6e2cc991 100644 --- a/src/test/compile-fail/issue-1920-2.rs +++ b/src/test/ui/compile-fail-migration/issue-1920-2.rs diff --git a/src/test/ui/compile-fail-migration/issue-1920-2.stderr b/src/test/ui/compile-fail-migration/issue-1920-2.stderr new file mode 100644 index 00000000000..cf98a893a18 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-1920-2.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `bar::S: std::clone::Clone` is not satisfied + --> $DIR/issue-1920-2.rs:20:5 + | +LL | assert_clone::<bar::S>(); + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `bar::S` + | +note: required by `assert_clone` + --> $DIR/issue-1920-2.rs:17:1 + | +LL | fn assert_clone<T>() where T : Clone { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/issue-1920-3.rs b/src/test/ui/compile-fail-migration/issue-1920-3.rs index fa6efea845f..fa6efea845f 100644 --- a/src/test/compile-fail/issue-1920-3.rs +++ b/src/test/ui/compile-fail-migration/issue-1920-3.rs diff --git a/src/test/ui/compile-fail-migration/issue-1920-3.stderr b/src/test/ui/compile-fail-migration/issue-1920-3.stderr new file mode 100644 index 00000000000..6f5efd0dc4e --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-1920-3.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `issue_1920::S: std::clone::Clone` is not satisfied + --> $DIR/issue-1920-3.rs:24:5 + | +LL | assert_clone::<foo::issue_1920::S>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `issue_1920::S` + | +note: required by `assert_clone` + --> $DIR/issue-1920-3.rs:21:1 + | +LL | fn assert_clone<T>() where T : Clone { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/issue-21146.rs b/src/test/ui/compile-fail-migration/issue-21146.rs index 457d40e62b0..457d40e62b0 100644 --- a/src/test/compile-fail/issue-21146.rs +++ b/src/test/ui/compile-fail-migration/issue-21146.rs diff --git a/src/test/ui/compile-fail-migration/issue-21146.stderr b/src/test/ui/compile-fail-migration/issue-21146.stderr new file mode 100644 index 00000000000..fab38123ea8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-21146.stderr @@ -0,0 +1,8 @@ +error: expected one of `!` or `::`, found `<eof>` + --> $DIR/auxiliary/issue-21146-inc.rs:13:1 + | +LL | parse_error + | ^^^^^^^^^^^ expected one of `!` or `::` here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-21202.rs b/src/test/ui/compile-fail-migration/issue-21202.rs index 2bce838c1cf..2bce838c1cf 100644 --- a/src/test/compile-fail/issue-21202.rs +++ b/src/test/ui/compile-fail-migration/issue-21202.rs diff --git a/src/test/ui/compile-fail-migration/issue-21202.stderr b/src/test/ui/compile-fail-migration/issue-21202.stderr new file mode 100644 index 00000000000..9d17ff64769 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-21202.stderr @@ -0,0 +1,9 @@ +error[E0624]: method `foo` is private + --> $DIR/issue-21202.rs:20:9 + | +LL | Foo::foo(&f); + | ^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0624`. diff --git a/src/test/compile-fail/issue-22638.rs b/src/test/ui/compile-fail-migration/issue-22638.rs index 1c534ebbd43..1c534ebbd43 100644 --- a/src/test/compile-fail/issue-22638.rs +++ b/src/test/ui/compile-fail-migration/issue-22638.rs diff --git a/src/test/ui/compile-fail-migration/issue-22638.stderr b/src/test/ui/compile-fail-migration/issue-22638.stderr new file mode 100644 index 00000000000..a549c00a341 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-22638.stderr @@ -0,0 +1,14 @@ +error: reached the type-length limit while instantiating `D::matches::<[closure@/home/david/projects/rust/workdirs/rust1/s...` + --> $DIR/issue-22638.rs:60:5 + | +LL | / pub fn matches<F: Fn()>(&self, f: &F) { +LL | | //~^ ERROR reached the type-length limit while instantiating `D::matches::<[closure +LL | | let &D(ref a) = self; +LL | | a.matches(f) +LL | | } + | |_____^ + | + = note: consider adding a `#![type_length_limit="40000000"]` attribute to your crate + +error: aborting due to previous error + diff --git a/src/test/compile-fail/issue-23595-1.rs b/src/test/ui/compile-fail-migration/issue-23595-1.rs index a3422d859c6..a3422d859c6 100644 --- a/src/test/compile-fail/issue-23595-1.rs +++ b/src/test/ui/compile-fail-migration/issue-23595-1.rs diff --git a/src/test/ui/compile-fail-migration/issue-23595-1.stderr b/src/test/ui/compile-fail-migration/issue-23595-1.stderr new file mode 100644 index 00000000000..624534eb8d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-23595-1.stderr @@ -0,0 +1,21 @@ +error[E0191]: the value of the associated type `ChildKey` (from the trait `Hierarchy`) must be specified + --> $DIR/issue-23595-1.rs:18:50 + | +LL | type Children = Index<Self::ChildKey, Output=Hierarchy>; + | ^^^^^^^^^ missing associated type `ChildKey` value + +error[E0191]: the value of the associated type `Children` (from the trait `Hierarchy`) must be specified + --> $DIR/issue-23595-1.rs:18:50 + | +LL | type Children = Index<Self::ChildKey, Output=Hierarchy>; + | ^^^^^^^^^ missing associated type `Children` value + +error[E0191]: the value of the associated type `Value` (from the trait `Hierarchy`) must be specified + --> $DIR/issue-23595-1.rs:18:50 + | +LL | type Children = Index<Self::ChildKey, Output=Hierarchy>; + | ^^^^^^^^^ missing associated type `Value` value + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0191`. diff --git a/src/test/compile-fail/issue-26548.rs b/src/test/ui/compile-fail-migration/issue-26548.rs index 85ddf8d9493..85ddf8d9493 100644 --- a/src/test/compile-fail/issue-26548.rs +++ b/src/test/ui/compile-fail-migration/issue-26548.rs diff --git a/src/test/ui/compile-fail-migration/issue-26548.stderr b/src/test/ui/compile-fail-migration/issue-26548.stderr new file mode 100644 index 00000000000..7ebeb76b657 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-26548.stderr @@ -0,0 +1,13 @@ +error[E0391]: cycle detected when computing layout of `std::option::Option<S>` + | +note: ...which requires computing layout of `S`... + = note: ...which again requires computing layout of `std::option::Option<S>`, completing the cycle +note: cycle used when processing `main` + --> $DIR/issue-26548.rs:19:1 + | +LL | fn main() { //~ NOTE cycle used when processing `main` + | ^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/compile-fail/issue-28075.rs b/src/test/ui/compile-fail-migration/issue-28075.rs index 0f6b9d1b5dc..0f6b9d1b5dc 100644 --- a/src/test/compile-fail/issue-28075.rs +++ b/src/test/ui/compile-fail-migration/issue-28075.rs diff --git a/src/test/ui/compile-fail-migration/issue-28075.stderr b/src/test/ui/compile-fail-migration/issue-28075.stderr new file mode 100644 index 00000000000..b42a322cbb4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-28075.stderr @@ -0,0 +1,11 @@ +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/issue-28075.rs:19:22 + | +LL | use lint_stability::{unstable, deprecated}; + | ^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/issue-28388-1.rs b/src/test/ui/compile-fail-migration/issue-28388-1.rs index 187d91731d0..187d91731d0 100644 --- a/src/test/compile-fail/issue-28388-1.rs +++ b/src/test/ui/compile-fail-migration/issue-28388-1.rs diff --git a/src/test/ui/compile-fail-migration/issue-28388-1.stderr b/src/test/ui/compile-fail-migration/issue-28388-1.stderr new file mode 100644 index 00000000000..9f4b6cb56e7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-28388-1.stderr @@ -0,0 +1,9 @@ +error[E0578]: cannot find module or enum `foo` in the crate root + --> $DIR/issue-28388-1.rs:13:5 + | +LL | use foo::{}; //~ ERROR cannot find module or enum `foo` in the crate root + | ^^^ not found in the crate root + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0578`. diff --git a/src/test/compile-fail/issue-28388-2.rs b/src/test/ui/compile-fail-migration/issue-28388-2.rs index 4ed5bfab06f..4ed5bfab06f 100644 --- a/src/test/compile-fail/issue-28388-2.rs +++ b/src/test/ui/compile-fail-migration/issue-28388-2.rs diff --git a/src/test/ui/compile-fail-migration/issue-28388-2.stderr b/src/test/ui/compile-fail-migration/issue-28388-2.stderr new file mode 100644 index 00000000000..7809934942c --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-28388-2.stderr @@ -0,0 +1,9 @@ +error[E0603]: module `n` is private + --> $DIR/issue-28388-2.rs:17:5 + | +LL | use m::n::{}; + | ^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/issue-28388-3.rs b/src/test/ui/compile-fail-migration/issue-28388-3.rs index 12e3457ef9e..12e3457ef9e 100644 --- a/src/test/compile-fail/issue-28388-3.rs +++ b/src/test/ui/compile-fail-migration/issue-28388-3.rs diff --git a/src/test/ui/compile-fail-migration/issue-28388-3.stderr b/src/test/ui/compile-fail-migration/issue-28388-3.stderr new file mode 100644 index 00000000000..653fdb5a4d4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-28388-3.stderr @@ -0,0 +1,11 @@ +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/issue-28388-3.rs:17:5 + | +LL | use lint_stability::UnstableEnum::{}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/issue-28625.rs b/src/test/ui/compile-fail-migration/issue-28625.rs index dc9155ed66c..dc9155ed66c 100644 --- a/src/test/compile-fail/issue-28625.rs +++ b/src/test/ui/compile-fail-migration/issue-28625.rs diff --git a/src/test/ui/compile-fail-migration/issue-28625.stderr b/src/test/ui/compile-fail-migration/issue-28625.stderr new file mode 100644 index 00000000000..90b50f193fb --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-28625.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/issue-28625.rs:20:14 + | +LL | unsafe { std::mem::transmute(a) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: &ArrayPeano<T> (64 bits) + = note: target type: &[T] (128 bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/compile-fail/issue-28848.rs b/src/test/ui/compile-fail-migration/issue-28848.rs index 1a06d59f0b1..1a06d59f0b1 100644 --- a/src/test/compile-fail/issue-28848.rs +++ b/src/test/ui/compile-fail-migration/issue-28848.rs diff --git a/src/test/ui/compile-fail-migration/issue-28848.stderr b/src/test/ui/compile-fail-migration/issue-28848.stderr new file mode 100644 index 00000000000..738a1c0c6f6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-28848.stderr @@ -0,0 +1,20 @@ +error[E0478]: lifetime bound not satisfied + --> $DIR/issue-28848.rs:20:5 + | +LL | Foo::<'a, 'b>::xmute(u) //~ ERROR lifetime bound not satisfied + | ^^^^^^^^^^^^^^^^^^^^ + | +note: lifetime parameter instantiated with the lifetime 'b as defined on the function body at 19:16 + --> $DIR/issue-28848.rs:19:16 + | +LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () { + | ^^ +note: but lifetime parameter must outlive the lifetime 'a as defined on the function body at 19:12 + --> $DIR/issue-28848.rs:19:12 + | +LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0478`. diff --git a/src/test/compile-fail/issue-29181.rs b/src/test/ui/compile-fail-migration/issue-29181.rs index 2fcec51912e..2fcec51912e 100644 --- a/src/test/compile-fail/issue-29181.rs +++ b/src/test/ui/compile-fail-migration/issue-29181.rs diff --git a/src/test/ui/compile-fail-migration/issue-29181.stderr b/src/test/ui/compile-fail-migration/issue-29181.stderr new file mode 100644 index 00000000000..5dda7848926 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-29181.stderr @@ -0,0 +1,9 @@ +error[E0599]: no method named `homura` found for type `{integer}` in the current scope + --> $DIR/issue-29181.rs:16:7 + | +LL | 0.homura(); //~ ERROR no method named `homura` found + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/issue-30123.rs b/src/test/ui/compile-fail-migration/issue-30123.rs index 653097ad69f..653097ad69f 100644 --- a/src/test/compile-fail/issue-30123.rs +++ b/src/test/ui/compile-fail-migration/issue-30123.rs diff --git a/src/test/ui/compile-fail-migration/issue-30123.stderr b/src/test/ui/compile-fail-migration/issue-30123.stderr new file mode 100644 index 00000000000..094c962de29 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-30123.stderr @@ -0,0 +1,9 @@ +error[E0599]: no function or associated item named `new_undirected` found for type `issue_30123_aux::Graph<i32, i32>` in the current scope + --> $DIR/issue-30123.rs:17:14 + | +LL | let ug = Graph::<i32, i32>::new_undirected(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `issue_30123_aux::Graph<i32, i32>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/issue-30535.rs b/src/test/ui/compile-fail-migration/issue-30535.rs index 90f5220a623..90f5220a623 100644 --- a/src/test/compile-fail/issue-30535.rs +++ b/src/test/ui/compile-fail-migration/issue-30535.rs diff --git a/src/test/ui/compile-fail-migration/issue-30535.stderr b/src/test/ui/compile-fail-migration/issue-30535.stderr new file mode 100644 index 00000000000..c3838fdb9cf --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-30535.stderr @@ -0,0 +1,11 @@ +error[E0573]: expected type, found variant `foo::Foo::FooV` + --> $DIR/issue-30535.rs:16:8 + | +LL | _: foo::Foo::FooV //~ ERROR expected type, found variant `foo::Foo::FooV` + | ^^^^^^^^^^^^^^ not a type + | + = help: there is an enum variant `foo::Foo::FooV`, try using `foo::Foo`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/compile-fail/issue-32377.rs b/src/test/ui/compile-fail-migration/issue-32377.rs index 5091ba4ee1a..5091ba4ee1a 100644 --- a/src/test/compile-fail/issue-32377.rs +++ b/src/test/ui/compile-fail-migration/issue-32377.rs diff --git a/src/test/ui/compile-fail-migration/issue-32377.stderr b/src/test/ui/compile-fail-migration/issue-32377.stderr new file mode 100644 index 00000000000..a0698885caa --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-32377.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/issue-32377.rs:23:14 + | +LL | unsafe { mem::transmute(x) } + | ^^^^^^^^^^^^^^ + | + = note: source type: [usize; 2] (128 bits) + = note: target type: Bar<U> (0 bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/compile-fail/issue-36881.rs b/src/test/ui/compile-fail-migration/issue-36881.rs index 0f5aa24926b..0f5aa24926b 100644 --- a/src/test/compile-fail/issue-36881.rs +++ b/src/test/ui/compile-fail-migration/issue-36881.rs diff --git a/src/test/ui/compile-fail-migration/issue-36881.stderr b/src/test/ui/compile-fail-migration/issue-36881.stderr new file mode 100644 index 00000000000..39132fde762 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-36881.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `issue_36881_aux` + --> $DIR/issue-36881.rs:16:9 + | +LL | use issue_36881_aux::Foo; //~ ERROR unresolved import + | ^^^^^^^^^^^^^^^ Maybe a missing `extern crate issue_36881_aux;`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/issue-37131.rs b/src/test/ui/compile-fail-migration/issue-37131.rs index efb0b249a8a..efb0b249a8a 100644 --- a/src/test/compile-fail/issue-37131.rs +++ b/src/test/ui/compile-fail-migration/issue-37131.rs diff --git a/src/test/ui/compile-fail-migration/issue-37131.stderr b/src/test/ui/compile-fail-migration/issue-37131.stderr new file mode 100644 index 00000000000..660a6935f36 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-37131.stderr @@ -0,0 +1,7 @@ +error[E0463]: can't find crate for `std` + | + = note: the `thumbv6m-none-eabi` target may not be installed + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/issue-41549.rs b/src/test/ui/compile-fail-migration/issue-41549.rs index 67be194c8ed..67be194c8ed 100644 --- a/src/test/compile-fail/issue-41549.rs +++ b/src/test/ui/compile-fail-migration/issue-41549.rs diff --git a/src/test/ui/compile-fail-migration/issue-41549.stderr b/src/test/ui/compile-fail-migration/issue-41549.stderr new file mode 100644 index 00000000000..e5362727d94 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-41549.stderr @@ -0,0 +1,12 @@ +error[E0326]: implemented const `CONST` has an incompatible type for trait + --> $DIR/issue-41549.rs:19:18 + | +LL | const CONST: () = (); //~ ERROR incompatible type for trait + | ^^ expected u32, found () + | + = note: expected type `u32` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0326`. diff --git a/src/test/compile-fail/issue-43733-2.rs b/src/test/ui/compile-fail-migration/issue-43733-2.rs index a5ba9ef9bd3..a5ba9ef9bd3 100644 --- a/src/test/compile-fail/issue-43733-2.rs +++ b/src/test/ui/compile-fail-migration/issue-43733-2.rs diff --git a/src/test/ui/compile-fail-migration/issue-43733-2.stderr b/src/test/ui/compile-fail-migration/issue-43733-2.stderr new file mode 100644 index 00000000000..8eb150ff833 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-43733-2.stderr @@ -0,0 +1,23 @@ +error[E0277]: `std::cell::UnsafeCell<std::option::Option<()>>` cannot be shared between threads safely + --> $DIR/issue-43733-2.rs:35:1 + | +LL | static __KEY: Key<()> = Key::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<std::option::Option<()>>` cannot be shared between threads safely + | + = help: within `std::thread::Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell<std::option::Option<()>>` + = note: required because it appears within the type `std::thread::Key<()>` + = note: shared static variables must have a type that implements `Sync` + +error[E0277]: `std::cell::Cell<bool>` cannot be shared between threads safely + --> $DIR/issue-43733-2.rs:35:1 + | +LL | static __KEY: Key<()> = Key::new(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::Cell<bool>` cannot be shared between threads safely + | + = help: within `std::thread::Key<()>`, the trait `std::marker::Sync` is not implemented for `std::cell::Cell<bool>` + = note: required because it appears within the type `std::thread::Key<()>` + = note: shared static variables must have a type that implements `Sync` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/issue-46209-private-enum-variant-reexport.rs b/src/test/ui/compile-fail-migration/issue-46209-private-enum-variant-reexport.rs index f5a20dd96dc..f5a20dd96dc 100644 --- a/src/test/compile-fail/issue-46209-private-enum-variant-reexport.rs +++ b/src/test/ui/compile-fail-migration/issue-46209-private-enum-variant-reexport.rs diff --git a/src/test/ui/compile-fail-migration/issue-46209-private-enum-variant-reexport.stderr b/src/test/ui/compile-fail-migration/issue-46209-private-enum-variant-reexport.stderr new file mode 100644 index 00000000000..9e5abdeaa43 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-46209-private-enum-variant-reexport.stderr @@ -0,0 +1,44 @@ +error: enum is private and its variants cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:19:13 + | +LL | pub use self::PettyOfficer::*; + | ^^^^^^^^^^^^^^^^^^^^^ +... +LL | pub(in rank) enum PettyOfficer { + | ------------------------------ help: consider making the enum public: `pub enum PettyOfficer` + +error: enum is private and its variants cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:21:13 + | +LL | pub use self::Crewman::*; + | ^^^^^^^^^^^^^^^^ +... +LL | crate enum Crewman { + | ------------------ help: consider making the enum public: `pub enum Crewman` + +error: enum is private and its variants cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:14:13 + | +LL | pub use self::Professor::*; + | ^^^^^^^^^^^^^^^^^^ +... +LL | enum Professor { + | -------------- help: consider making the enum public: `pub enum Professor` + +error: variant `JuniorGrade` is private and cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:16:32 + | +LL | pub use self::Lieutenant::{JuniorGrade, Full}; + | ^^^^^^^^^^^ +... +LL | enum Lieutenant { + | --------------- help: consider making the enum public: `pub enum Lieutenant` + +error: variant `Full` is private and cannot be re-exported + --> $DIR/issue-46209-private-enum-variant-reexport.rs:16:45 + | +LL | pub use self::Lieutenant::{JuniorGrade, Full}; + | ^^^^ + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/issue-50264-inner-deref-trait/option_deref.rs b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/option_deref.rs index 4c67fb3bef1..4c67fb3bef1 100644 --- a/src/test/compile-fail/issue-50264-inner-deref-trait/option_deref.rs +++ b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/option_deref.rs diff --git a/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/option_deref.stderr b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/option_deref.stderr new file mode 100644 index 00000000000..a56cd6e8d2f --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/option_deref.stderr @@ -0,0 +1,12 @@ +error[E0599]: no method named `deref` found for type `std::option::Option<{integer}>` in the current scope + --> $DIR/option_deref.rs:14:29 + | +LL | let _result = &Some(42).deref(); + | ^^^^^ + | + = note: the method `deref` exists but the following trait bounds were not satisfied: + `{integer} : std::ops::Deref` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/issue-50264-inner-deref-trait/result_deref.rs b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref.rs index 73bdf0b9209..73bdf0b9209 100644 --- a/src/test/compile-fail/issue-50264-inner-deref-trait/result_deref.rs +++ b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref.rs diff --git a/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref.stderr b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref.stderr new file mode 100644 index 00000000000..d3d7c1993ca --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref.stderr @@ -0,0 +1,12 @@ +error[E0599]: no method named `deref` found for type `std::result::Result<{integer}, _>` in the current scope + --> $DIR/result_deref.rs:14:27 + | +LL | let _result = &Ok(42).deref(); + | ^^^^^ + | + = note: the method `deref` exists but the following trait bounds were not satisfied: + `{integer} : std::ops::Deref` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/issue-50264-inner-deref-trait/result_deref_err.rs b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_err.rs index 5d1e7472d8f..5d1e7472d8f 100644 --- a/src/test/compile-fail/issue-50264-inner-deref-trait/result_deref_err.rs +++ b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_err.rs diff --git a/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_err.stderr b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_err.stderr new file mode 100644 index 00000000000..bf75687b21f --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_err.stderr @@ -0,0 +1,13 @@ +error[E0599]: no method named `deref_err` found for type `std::result::Result<_, {integer}>` in the current scope + --> $DIR/result_deref_err.rs:14:28 + | +LL | let _result = &Err(41).deref_err(); + | ^^^^^^^^^ + | + = note: the method `deref_err` exists but the following trait bounds were not satisfied: + `{integer} : std::ops::Deref` + = help: did you mean `deref_ok`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/issue-50264-inner-deref-trait/result_deref_ok.rs b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_ok.rs index bee8e0c062b..bee8e0c062b 100644 --- a/src/test/compile-fail/issue-50264-inner-deref-trait/result_deref_ok.rs +++ b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_ok.rs diff --git a/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_ok.stderr b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_ok.stderr new file mode 100644 index 00000000000..a77333a7568 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-50264-inner-deref-trait/result_deref_ok.stderr @@ -0,0 +1,12 @@ +error[E0599]: no method named `deref_ok` found for type `std::result::Result<{integer}, _>` in the current scope + --> $DIR/result_deref_ok.rs:14:27 + | +LL | let _result = &Ok(42).deref_ok(); + | ^^^^^^^^ + | + = note: the method `deref_ok` exists but the following trait bounds were not satisfied: + `{integer} : std::ops::Deref` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/issue-52489.rs b/src/test/ui/compile-fail-migration/issue-52489.rs index c43cc12ca02..c43cc12ca02 100644 --- a/src/test/compile-fail/issue-52489.rs +++ b/src/test/ui/compile-fail-migration/issue-52489.rs diff --git a/src/test/ui/compile-fail-migration/issue-52489.stderr b/src/test/ui/compile-fail-migration/issue-52489.stderr new file mode 100644 index 00000000000..5b38a0789ad --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-52489.stderr @@ -0,0 +1,11 @@ +error[E0658]: use of unstable library feature 'issue_52489_unstable' + --> $DIR/issue-52489.rs:14:5 + | +LL | use issue_52489; + | ^^^^^^^^^^^ + | + = help: add #![feature(issue_52489_unstable)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/compile-fail-migration/issue-5500-1.ast.stderr b/src/test/ui/compile-fail-migration/issue-5500-1.ast.stderr new file mode 100644 index 00000000000..611eea533b2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-5500-1.ast.stderr @@ -0,0 +1,15 @@ +error[E0594]: cannot assign to field `_iter.node` of immutable binding + --> $DIR/issue-5500-1.rs:22:5 + | +LL | let _iter = TrieMapIterator{node: &a}; + | ----- consider changing this to `mut _iter` +LL | / _iter.node = & //[ast]~ ERROR cannot assign to field `_iter.node` of immutable binding +LL | | //[mir]~^ ERROR cannot assign to field `_iter.node` of immutable binding (Ast) +LL | | // MIR doesn't generate an error because the code isn't reachable. This is OK +LL | | // because the test is here to check that the compiler doesn't ICE (cf. #5500). +LL | | panic!() + | |____________^ cannot mutably borrow field of immutable binding + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/issue-5500-1.mir.stderr b/src/test/ui/compile-fail-migration/issue-5500-1.mir.stderr new file mode 100644 index 00000000000..465485e5e29 --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-5500-1.mir.stderr @@ -0,0 +1,15 @@ +error[E0594]: cannot assign to field `_iter.node` of immutable binding (Ast) + --> $DIR/issue-5500-1.rs:22:5 + | +LL | let _iter = TrieMapIterator{node: &a}; + | ----- consider changing this to `mut _iter` +LL | / _iter.node = & //[ast]~ ERROR cannot assign to field `_iter.node` of immutable binding +LL | | //[mir]~^ ERROR cannot assign to field `_iter.node` of immutable binding (Ast) +LL | | // MIR doesn't generate an error because the code isn't reachable. This is OK +LL | | // because the test is here to check that the compiler doesn't ICE (cf. #5500). +LL | | panic!() + | |____________^ cannot mutably borrow field of immutable binding + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/issue-5500-1.rs b/src/test/ui/compile-fail-migration/issue-5500-1.rs index 4bd147a5e1c..8d6efa774a3 100644 --- a/src/test/compile-fail/issue-5500-1.rs +++ b/src/test/ui/compile-fail-migration/issue-5500-1.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll // revisions: ast mir //[mir]compile-flags: -Z borrowck=compare diff --git a/src/test/compile-fail/issue-5844.rs b/src/test/ui/compile-fail-migration/issue-5844.rs index 02e5b9b0921..02e5b9b0921 100644 --- a/src/test/compile-fail/issue-5844.rs +++ b/src/test/ui/compile-fail-migration/issue-5844.rs diff --git a/src/test/ui/compile-fail-migration/issue-5844.stderr b/src/test/ui/compile-fail-migration/issue-5844.stderr new file mode 100644 index 00000000000..05b0b63439f --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue-5844.stderr @@ -0,0 +1,11 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/issue-5844.rs:16:5 + | +LL | issue_5844_aux::rand(); //~ ERROR: requires unsafe + | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/issue32829.rs b/src/test/ui/compile-fail-migration/issue32829.rs index 2b223bac8e6..2b223bac8e6 100644 --- a/src/test/compile-fail/issue32829.rs +++ b/src/test/ui/compile-fail-migration/issue32829.rs diff --git a/src/test/ui/compile-fail-migration/issue32829.stderr b/src/test/ui/compile-fail-migration/issue32829.stderr new file mode 100644 index 00000000000..dad0880dbdf --- /dev/null +++ b/src/test/ui/compile-fail-migration/issue32829.stderr @@ -0,0 +1,94 @@ +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/issue32829.rs:17:9 + | +LL | 5; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue32829.rs:25:9 + | +LL | invalid(); + | ^^^^^^^^^ + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/issue32829.rs:25:9 + | +LL | invalid(); + | ^^^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in constants are unstable (see issue #48821) + --> $DIR/issue32829.rs:34:9 + | +LL | valid(); + | ^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in statics are unstable (see issue #48821) + --> $DIR/issue32829.rs:42:9 + | +LL | 5; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue32829.rs:50:9 + | +LL | invalid(); + | ^^^^^^^^^ + +error[E0658]: statements in statics are unstable (see issue #48821) + --> $DIR/issue32829.rs:50:9 + | +LL | invalid(); + | ^^^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in statics are unstable (see issue #48821) + --> $DIR/issue32829.rs:59:9 + | +LL | valid(); + | ^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in statics are unstable (see issue #48821) + --> $DIR/issue32829.rs:67:9 + | +LL | 5; + | ^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants + --> $DIR/issue32829.rs:75:9 + | +LL | invalid(); + | ^^^^^^^^^ + +error[E0658]: statements in statics are unstable (see issue #48821) + --> $DIR/issue32829.rs:75:9 + | +LL | invalid(); + | ^^^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in statics are unstable (see issue #48821) + --> $DIR/issue32829.rs:84:9 + | +LL | valid(); + | ^^^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error: aborting due to 12 previous errors + +Some errors occurred: E0015, E0658. +For more information about an error, try `rustc --explain E0015`. diff --git a/src/test/compile-fail/keyword-extern-as-identifier.rs b/src/test/ui/compile-fail-migration/keyword-extern-as-identifier.rs index 3e445853957..3e445853957 100644 --- a/src/test/compile-fail/keyword-extern-as-identifier.rs +++ b/src/test/ui/compile-fail-migration/keyword-extern-as-identifier.rs diff --git a/src/test/ui/compile-fail-migration/keyword-extern-as-identifier.stderr b/src/test/ui/compile-fail-migration/keyword-extern-as-identifier.stderr new file mode 100644 index 00000000000..0aa5fc08d6f --- /dev/null +++ b/src/test/ui/compile-fail-migration/keyword-extern-as-identifier.stderr @@ -0,0 +1,9 @@ +error[E0532]: expected unit struct/variant or constant, found module `extern` + --> $DIR/keyword-extern-as-identifier.rs:14:9 + | +LL | let extern = 0; //~ ERROR expected unit struct/variant or constant, found module `extern` + | ^^^^^^ not a unit struct/variant or constant + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/compile-fail/keyword-false-as-identifier.rs b/src/test/ui/compile-fail-migration/keyword-false-as-identifier.rs index f246d6e75df..f246d6e75df 100644 --- a/src/test/compile-fail/keyword-false-as-identifier.rs +++ b/src/test/ui/compile-fail-migration/keyword-false-as-identifier.rs diff --git a/src/test/ui/compile-fail-migration/keyword-false-as-identifier.stderr b/src/test/ui/compile-fail-migration/keyword-false-as-identifier.stderr new file mode 100644 index 00000000000..13f675404f6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/keyword-false-as-identifier.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/keyword-false-as-identifier.rs:12:9 + | +LL | let false = 22; //~ error: mismatched types + | ^^^^^ expected integral variable, found bool + | + = note: expected type `{integer}` + found type `bool` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/keyword-self-as-identifier.rs b/src/test/ui/compile-fail-migration/keyword-self-as-identifier.rs index b50fc68bed6..b50fc68bed6 100644 --- a/src/test/compile-fail/keyword-self-as-identifier.rs +++ b/src/test/ui/compile-fail-migration/keyword-self-as-identifier.rs diff --git a/src/test/ui/compile-fail-migration/keyword-self-as-identifier.stderr b/src/test/ui/compile-fail-migration/keyword-self-as-identifier.stderr new file mode 100644 index 00000000000..c47f4aeabef --- /dev/null +++ b/src/test/ui/compile-fail-migration/keyword-self-as-identifier.stderr @@ -0,0 +1,9 @@ +error[E0531]: cannot find unit struct/variant or constant `Self` in this scope + --> $DIR/keyword-self-as-identifier.rs:12:9 + | +LL | let Self = 22; //~ ERROR cannot find unit struct/variant or constant `Self` in this scope + | ^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0531`. diff --git a/src/test/compile-fail/keyword-super-as-identifier.rs b/src/test/ui/compile-fail-migration/keyword-super-as-identifier.rs index 54dac771f01..54dac771f01 100644 --- a/src/test/compile-fail/keyword-super-as-identifier.rs +++ b/src/test/ui/compile-fail-migration/keyword-super-as-identifier.rs diff --git a/src/test/ui/compile-fail-migration/keyword-super-as-identifier.stderr b/src/test/ui/compile-fail-migration/keyword-super-as-identifier.stderr new file mode 100644 index 00000000000..649be45c224 --- /dev/null +++ b/src/test/ui/compile-fail-migration/keyword-super-as-identifier.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. There are too many initial `super`s. + --> $DIR/keyword-super-as-identifier.rs:12:9 + | +LL | let super = 22; //~ ERROR failed to resolve. There are too many initial `super`s + | ^^^^^ There are too many initial `super`s. + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/keyword-super.rs b/src/test/ui/compile-fail-migration/keyword-super.rs index 02047bd639f..02047bd639f 100644 --- a/src/test/compile-fail/keyword-super.rs +++ b/src/test/ui/compile-fail-migration/keyword-super.rs diff --git a/src/test/ui/compile-fail-migration/keyword-super.stderr b/src/test/ui/compile-fail-migration/keyword-super.stderr new file mode 100644 index 00000000000..ac692ad45d2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/keyword-super.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. There are too many initial `super`s. + --> $DIR/keyword-super.rs:12:9 + | +LL | let super: isize; //~ ERROR failed to resolve. There are too many initial `super`s + | ^^^^^ There are too many initial `super`s. + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/keyword-true-as-identifier.rs b/src/test/ui/compile-fail-migration/keyword-true-as-identifier.rs index b09d09db560..b09d09db560 100644 --- a/src/test/compile-fail/keyword-true-as-identifier.rs +++ b/src/test/ui/compile-fail-migration/keyword-true-as-identifier.rs diff --git a/src/test/ui/compile-fail-migration/keyword-true-as-identifier.stderr b/src/test/ui/compile-fail-migration/keyword-true-as-identifier.stderr new file mode 100644 index 00000000000..776470ba77c --- /dev/null +++ b/src/test/ui/compile-fail-migration/keyword-true-as-identifier.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/keyword-true-as-identifier.rs:12:9 + | +LL | let true = 22; //~ error: mismatched types + | ^^^^ expected integral variable, found bool + | + = note: expected type `{integer}` + found type `bool` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/kindck-copy.rs b/src/test/ui/compile-fail-migration/kindck-copy.rs index 747fe2d2046..747fe2d2046 100644 --- a/src/test/compile-fail/kindck-copy.rs +++ b/src/test/ui/compile-fail-migration/kindck-copy.rs diff --git a/src/test/ui/compile-fail-migration/kindck-copy.stderr b/src/test/ui/compile-fail-migration/kindck-copy.stderr new file mode 100644 index 00000000000..8d72d912689 --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-copy.stderr @@ -0,0 +1,139 @@ +error[E0277]: the trait bound `&'static mut isize: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:37:5 + | +LL | assert_copy::<&'static mut isize>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'static mut isize` + | + = help: the following implementations were found: + <isize as std::marker::Copy> +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `&'a mut isize: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:38:5 + | +LL | assert_copy::<&'a mut isize>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'a mut isize` + | + = help: the following implementations were found: + <isize as std::marker::Copy> +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::boxed::Box<isize>: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:41:5 + | +LL | assert_copy::<Box<isize>>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<isize>` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:42:5 + | +LL | assert_copy::<String>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::string::String` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::vec::Vec<isize>: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:43:5 + | +LL | assert_copy::<Vec<isize> >(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::vec::Vec<isize>` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::boxed::Box<&'a mut isize>: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:44:5 + | +LL | assert_copy::<Box<&'a mut isize>>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<&'a mut isize>` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::boxed::Box<dyn Dummy>: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:52:5 + | +LL | assert_copy::<Box<Dummy>>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<dyn Dummy>` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::boxed::Box<dyn Dummy + std::marker::Send>: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:53:5 + | +LL | assert_copy::<Box<Dummy+Send>>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<dyn Dummy + std::marker::Send>` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `&'a mut (dyn Dummy + std::marker::Send + 'a): std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:56:5 + | +LL | assert_copy::<&'a mut (Dummy+Send)>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'a mut (dyn Dummy + std::marker::Send + 'a)` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `MyNoncopyStruct: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:74:5 + | +LL | assert_copy::<MyNoncopyStruct>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `MyNoncopyStruct` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::rc::Rc<isize>: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:77:5 + | +LL | assert_copy::<Rc<isize>>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::rc::Rc<isize>` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy<T:Copy>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/kindck-impl-type-params-2.rs b/src/test/ui/compile-fail-migration/kindck-impl-type-params-2.rs index 21aefc4f9c1..21aefc4f9c1 100644 --- a/src/test/compile-fail/kindck-impl-type-params-2.rs +++ b/src/test/ui/compile-fail-migration/kindck-impl-type-params-2.rs diff --git a/src/test/ui/compile-fail-migration/kindck-impl-type-params-2.stderr b/src/test/ui/compile-fail-migration/kindck-impl-type-params-2.stderr new file mode 100644 index 00000000000..e4c02085ddb --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-impl-type-params-2.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `std::boxed::Box<{integer}>: std::marker::Copy` is not satisfied + --> $DIR/kindck-impl-type-params-2.rs:23:5 + | +LL | take_param(&x); + | ^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>` + | + = note: required because of the requirements on the impl of `Foo` for `std::boxed::Box<{integer}>` +note: required by `take_param` + --> $DIR/kindck-impl-type-params-2.rs:19:1 + | +LL | fn take_param<T:Foo>(foo: &T) { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/kindck-impl-type-params.nll.stderr b/src/test/ui/compile-fail-migration/kindck-impl-type-params.nll.stderr new file mode 100644 index 00000000000..8f24baf7fc4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-impl-type-params.nll.stderr @@ -0,0 +1,69 @@ +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/kindck-impl-type-params.rs:28:13 + | +LL | let a = &t as &Gettable<T>; + | ^^ `T` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `T` + = help: consider adding a `where T: std::marker::Send` bound + = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>` + = note: required for the cast to the object type `dyn Gettable<T>` + +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/kindck-impl-type-params.rs:28:13 + | +LL | let a = &t as &Gettable<T>; + | ^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound + = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>` + = note: required for the cast to the object type `dyn Gettable<T>` + +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/kindck-impl-type-params.rs:35:27 + | +LL | let a: &Gettable<T> = &t; + | ^^ `T` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `T` + = help: consider adding a `where T: std::marker::Send` bound + = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>` + = note: required for the cast to the object type `dyn Gettable<T>` + +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/kindck-impl-type-params.rs:35:27 + | +LL | let a: &Gettable<T> = &t; + | ^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound + = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>` + = note: required for the cast to the object type `dyn Gettable<T>` + +warning: not reporting region error due to nll + --> $DIR/kindck-impl-type-params.rs:42:13 + | +LL | let a = &t as &Gettable<&'a isize>; + | ^^ + +error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied + --> $DIR/kindck-impl-type-params.rs:48:13 + | +LL | let a = t as Box<Gettable<String>>; + | ^ the trait `std::marker::Copy` is not implemented for `std::string::String` + | + = note: required because of the requirements on the impl of `Gettable<std::string::String>` for `S<std::string::String>` + = note: required for the cast to the object type `dyn Gettable<std::string::String>` + +error[E0277]: the trait bound `foo3::Foo: std::marker::Copy` is not satisfied + --> $DIR/kindck-impl-type-params.rs:56:33 + | +LL | let a: Box<Gettable<Foo>> = t; + | ^ the trait `std::marker::Copy` is not implemented for `foo3::Foo` + | + = note: required because of the requirements on the impl of `Gettable<foo3::Foo>` for `S<foo3::Foo>` + = note: required for the cast to the object type `dyn Gettable<foo3::Foo>` + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/kindck-impl-type-params.rs b/src/test/ui/compile-fail-migration/kindck-impl-type-params.rs index 3a0e66f58e0..3a0e66f58e0 100644 --- a/src/test/compile-fail/kindck-impl-type-params.rs +++ b/src/test/ui/compile-fail-migration/kindck-impl-type-params.rs diff --git a/src/test/ui/compile-fail-migration/kindck-impl-type-params.stderr b/src/test/ui/compile-fail-migration/kindck-impl-type-params.stderr new file mode 100644 index 00000000000..b938d40c765 --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-impl-type-params.stderr @@ -0,0 +1,72 @@ +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/kindck-impl-type-params.rs:28:13 + | +LL | let a = &t as &Gettable<T>; + | ^^ `T` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `T` + = help: consider adding a `where T: std::marker::Send` bound + = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>` + = note: required for the cast to the object type `dyn Gettable<T>` + +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/kindck-impl-type-params.rs:28:13 + | +LL | let a = &t as &Gettable<T>; + | ^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound + = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>` + = note: required for the cast to the object type `dyn Gettable<T>` + +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/kindck-impl-type-params.rs:35:27 + | +LL | let a: &Gettable<T> = &t; + | ^^ `T` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `T` + = help: consider adding a `where T: std::marker::Send` bound + = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>` + = note: required for the cast to the object type `dyn Gettable<T>` + +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/kindck-impl-type-params.rs:35:27 + | +LL | let a: &Gettable<T> = &t; + | ^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound + = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>` + = note: required for the cast to the object type `dyn Gettable<T>` + +error[E0477]: the type `&'a isize` does not fulfill the required lifetime + --> $DIR/kindck-impl-type-params.rs:42:13 + | +LL | let a = &t as &Gettable<&'a isize>; + | ^^ + | + = note: type must satisfy the static lifetime + +error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied + --> $DIR/kindck-impl-type-params.rs:48:13 + | +LL | let a = t as Box<Gettable<String>>; + | ^ the trait `std::marker::Copy` is not implemented for `std::string::String` + | + = note: required because of the requirements on the impl of `Gettable<std::string::String>` for `S<std::string::String>` + = note: required for the cast to the object type `dyn Gettable<std::string::String>` + +error[E0277]: the trait bound `foo3::Foo: std::marker::Copy` is not satisfied + --> $DIR/kindck-impl-type-params.rs:56:33 + | +LL | let a: Box<Gettable<Foo>> = t; + | ^ the trait `std::marker::Copy` is not implemented for `foo3::Foo` + | + = note: required because of the requirements on the impl of `Gettable<foo3::Foo>` for `S<foo3::Foo>` + = note: required for the cast to the object type `dyn Gettable<foo3::Foo>` + +error: aborting due to 7 previous errors + +Some errors occurred: E0277, E0477. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/kindck-inherited-copy-bound.rs b/src/test/ui/compile-fail-migration/kindck-inherited-copy-bound.rs index 0731fbaf01c..0731fbaf01c 100644 --- a/src/test/compile-fail/kindck-inherited-copy-bound.rs +++ b/src/test/ui/compile-fail-migration/kindck-inherited-copy-bound.rs diff --git a/src/test/ui/compile-fail-migration/kindck-inherited-copy-bound.stderr b/src/test/ui/compile-fail-migration/kindck-inherited-copy-bound.stderr new file mode 100644 index 00000000000..542ecc0c004 --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-inherited-copy-bound.stderr @@ -0,0 +1,34 @@ +error[E0277]: the trait bound `std::boxed::Box<{integer}>: std::marker::Copy` is not satisfied + --> $DIR/kindck-inherited-copy-bound.rs:28:5 + | +LL | take_param(&x); //~ ERROR E0277 + | ^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>` + | + = note: required because of the requirements on the impl of `Foo` for `std::boxed::Box<{integer}>` +note: required by `take_param` + --> $DIR/kindck-inherited-copy-bound.rs:24:1 + | +LL | fn take_param<T:Foo>(foo: &T) { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/kindck-inherited-copy-bound.rs:34:19 + | +LL | let z = &x as &Foo; + | ^^^^ the trait `Foo` cannot be made into an object + | + = note: the trait cannot require that `Self : Sized` + +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/kindck-inherited-copy-bound.rs:34:13 + | +LL | let z = &x as &Foo; + | ^^ the trait `Foo` cannot be made into an object + | + = note: the trait cannot require that `Self : Sized` + = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Foo>` for `&std::boxed::Box<{integer}>` + +error: aborting due to 3 previous errors + +Some errors occurred: E0038, E0277. +For more information about an error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/ui/compile-fail-migration/kindck-nonsendable-1.rs index 43c212b2af5..43c212b2af5 100644 --- a/src/test/compile-fail/kindck-nonsendable-1.rs +++ b/src/test/ui/compile-fail-migration/kindck-nonsendable-1.rs diff --git a/src/test/ui/compile-fail-migration/kindck-nonsendable-1.stderr b/src/test/ui/compile-fail-migration/kindck-nonsendable-1.stderr new file mode 100644 index 00000000000..a8aa02e1d62 --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-nonsendable-1.stderr @@ -0,0 +1,17 @@ +error[E0277]: `std::rc::Rc<usize>` cannot be sent between threads safely + --> $DIR/kindck-nonsendable-1.rs:20:5 + | +LL | bar(move|| foo(x)); + | ^^^ `std::rc::Rc<usize>` cannot be sent between threads safely + | + = help: within `[closure@$DIR/kindck-nonsendable-1.rs:20:9: 20:22 x:std::rc::Rc<usize>]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<usize>` + = note: required because it appears within the type `[closure@$DIR/kindck-nonsendable-1.rs:20:9: 20:22 x:std::rc::Rc<usize>]` +note: required by `bar` + --> $DIR/kindck-nonsendable-1.rs:16:1 + | +LL | fn bar<F:FnOnce() + Send>(_: F) { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/kindck-send-object.rs b/src/test/ui/compile-fail-migration/kindck-send-object.rs index 82b97878549..82b97878549 100644 --- a/src/test/compile-fail/kindck-send-object.rs +++ b/src/test/ui/compile-fail-migration/kindck-send-object.rs diff --git a/src/test/ui/compile-fail-migration/kindck-send-object.stderr b/src/test/ui/compile-fail-migration/kindck-send-object.stderr new file mode 100644 index 00000000000..e342352d590 --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-send-object.stderr @@ -0,0 +1,32 @@ +error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely + --> $DIR/kindck-send-object.rs:22:5 + | +LL | assert_send::<&'static (Dummy+'static)>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `(dyn Dummy + 'static)` + = note: required because of the requirements on the impl of `std::marker::Send` for `&'static (dyn Dummy + 'static)` +note: required by `assert_send` + --> $DIR/kindck-send-object.rs:15:1 + | +LL | fn assert_send<T:Send>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `dyn Dummy` cannot be sent between threads safely + --> $DIR/kindck-send-object.rs:27:5 + | +LL | assert_send::<Box<Dummy>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `dyn Dummy` + = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<dyn Dummy>` + = note: required because it appears within the type `std::boxed::Box<dyn Dummy>` +note: required by `assert_send` + --> $DIR/kindck-send-object.rs:15:1 + | +LL | fn assert_send<T:Send>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/kindck-send-object1.nll.stderr b/src/test/ui/compile-fail-migration/kindck-send-object1.nll.stderr new file mode 100644 index 00000000000..6613a29cd76 --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-send-object1.nll.stderr @@ -0,0 +1,38 @@ +error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely + --> $DIR/kindck-send-object1.rs:20:5 + | +LL | assert_send::<&'a Dummy>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `(dyn Dummy + 'a)` + = note: required because of the requirements on the impl of `std::marker::Send` for `&'a (dyn Dummy + 'a)` +note: required by `assert_send` + --> $DIR/kindck-send-object1.rs:15:1 + | +LL | fn assert_send<T:Send+'static>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/kindck-send-object1.rs:24:5 + | +LL | assert_send::<&'a (Dummy+Sync)>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely + --> $DIR/kindck-send-object1.rs:39:5 + | +LL | assert_send::<Box<Dummy+'a>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `(dyn Dummy + 'a)` + = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<(dyn Dummy + 'a)>` + = note: required because it appears within the type `std::boxed::Box<(dyn Dummy + 'a)>` +note: required by `assert_send` + --> $DIR/kindck-send-object1.rs:15:1 + | +LL | fn assert_send<T:Send+'static>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/kindck-send-object1.rs b/src/test/ui/compile-fail-migration/kindck-send-object1.rs index 853630aa416..853630aa416 100644 --- a/src/test/compile-fail/kindck-send-object1.rs +++ b/src/test/ui/compile-fail-migration/kindck-send-object1.rs diff --git a/src/test/ui/compile-fail-migration/kindck-send-object1.stderr b/src/test/ui/compile-fail-migration/kindck-send-object1.stderr new file mode 100644 index 00000000000..d906b7d9e16 --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-send-object1.stderr @@ -0,0 +1,41 @@ +error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely + --> $DIR/kindck-send-object1.rs:20:5 + | +LL | assert_send::<&'a Dummy>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `(dyn Dummy + 'a)` + = note: required because of the requirements on the impl of `std::marker::Send` for `&'a (dyn Dummy + 'a)` +note: required by `assert_send` + --> $DIR/kindck-send-object1.rs:15:1 + | +LL | fn assert_send<T:Send+'static>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0477]: the type `&'a (dyn Dummy + std::marker::Sync + 'a)` does not fulfill the required lifetime + --> $DIR/kindck-send-object1.rs:24:5 + | +LL | assert_send::<&'a (Dummy+Sync)>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime + +error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely + --> $DIR/kindck-send-object1.rs:39:5 + | +LL | assert_send::<Box<Dummy+'a>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `(dyn Dummy + 'a)` + = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<(dyn Dummy + 'a)>` + = note: required because it appears within the type `std::boxed::Box<(dyn Dummy + 'a)>` +note: required by `assert_send` + --> $DIR/kindck-send-object1.rs:15:1 + | +LL | fn assert_send<T:Send+'static>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0277, E0477. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/kindck-send-object2.rs b/src/test/ui/compile-fail-migration/kindck-send-object2.rs index 0265f888e7c..0265f888e7c 100644 --- a/src/test/compile-fail/kindck-send-object2.rs +++ b/src/test/ui/compile-fail-migration/kindck-send-object2.rs diff --git a/src/test/ui/compile-fail-migration/kindck-send-object2.stderr b/src/test/ui/compile-fail-migration/kindck-send-object2.stderr new file mode 100644 index 00000000000..475159cd400 --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-send-object2.stderr @@ -0,0 +1,32 @@ +error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely + --> $DIR/kindck-send-object2.rs:17:5 + | +LL | assert_send::<&'static Dummy>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `(dyn Dummy + 'static)` + = note: required because of the requirements on the impl of `std::marker::Send` for `&'static (dyn Dummy + 'static)` +note: required by `assert_send` + --> $DIR/kindck-send-object2.rs:13:1 + | +LL | fn assert_send<T:Send>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `dyn Dummy` cannot be sent between threads safely + --> $DIR/kindck-send-object2.rs:22:5 + | +LL | assert_send::<Box<Dummy>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `dyn Dummy` + = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<dyn Dummy>` + = note: required because it appears within the type `std::boxed::Box<dyn Dummy>` +note: required by `assert_send` + --> $DIR/kindck-send-object2.rs:13:1 + | +LL | fn assert_send<T:Send>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/kindck-send-owned.rs b/src/test/ui/compile-fail-migration/kindck-send-owned.rs index e48460a8753..e48460a8753 100644 --- a/src/test/compile-fail/kindck-send-owned.rs +++ b/src/test/ui/compile-fail-migration/kindck-send-owned.rs diff --git a/src/test/ui/compile-fail-migration/kindck-send-owned.stderr b/src/test/ui/compile-fail-migration/kindck-send-owned.stderr new file mode 100644 index 00000000000..f5781bd968e --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-send-owned.stderr @@ -0,0 +1,18 @@ +error[E0277]: `*mut u8` cannot be sent between threads safely + --> $DIR/kindck-send-owned.rs:22:5 + | +LL | assert_send::<Box<*mut u8>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut u8` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `*mut u8` + = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<*mut u8>` + = note: required because it appears within the type `std::boxed::Box<*mut u8>` +note: required by `assert_send` + --> $DIR/kindck-send-owned.rs:13:1 + | +LL | fn assert_send<T:Send>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/kindck-send-unsafe.rs b/src/test/ui/compile-fail-migration/kindck-send-unsafe.rs index 99b995b0906..99b995b0906 100644 --- a/src/test/compile-fail/kindck-send-unsafe.rs +++ b/src/test/ui/compile-fail-migration/kindck-send-unsafe.rs diff --git a/src/test/compile-fail/kindck-send-unsafe.rs~rust-lang_master b/src/test/ui/compile-fail-migration/kindck-send-unsafe.rs~rust-lang_master index a9bbfcfa262..a9bbfcfa262 100644 --- a/src/test/compile-fail/kindck-send-unsafe.rs~rust-lang_master +++ b/src/test/ui/compile-fail-migration/kindck-send-unsafe.rs~rust-lang_master diff --git a/src/test/ui/compile-fail-migration/kindck-send-unsafe.stderr b/src/test/ui/compile-fail-migration/kindck-send-unsafe.stderr new file mode 100644 index 00000000000..846de09ba3c --- /dev/null +++ b/src/test/ui/compile-fail-migration/kindck-send-unsafe.stderr @@ -0,0 +1,16 @@ +error[E0277]: `*mut &'a isize` cannot be sent between threads safely + --> $DIR/kindck-send-unsafe.rs:16:5 + | +LL | assert_send::<*mut &'a isize>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut &'a isize` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `*mut &'a isize` +note: required by `assert_send` + --> $DIR/kindck-send-unsafe.rs:13:1 + | +LL | fn assert_send<T:Send>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/label-static.rs b/src/test/ui/compile-fail-migration/label-static.rs index a0fb25ea06e..a0fb25ea06e 100644 --- a/src/test/compile-fail/label-static.rs +++ b/src/test/ui/compile-fail-migration/label-static.rs diff --git a/src/test/ui/compile-fail-migration/label-static.stderr b/src/test/ui/compile-fail-migration/label-static.stderr new file mode 100644 index 00000000000..f5b6eba0089 --- /dev/null +++ b/src/test/ui/compile-fail-migration/label-static.stderr @@ -0,0 +1,14 @@ +error: invalid label name `'static` + --> $DIR/label-static.rs:12:5 + | +LL | 'static: loop { //~ ERROR invalid label name `'static` + | ^^^^^^^ + +error: invalid label name `'static` + --> $DIR/label-static.rs:13:15 + | +LL | break 'static //~ ERROR invalid label name `'static` + | ^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/label-underscore.rs b/src/test/ui/compile-fail-migration/label-underscore.rs index 30411bf8789..30411bf8789 100644 --- a/src/test/compile-fail/label-underscore.rs +++ b/src/test/ui/compile-fail-migration/label-underscore.rs diff --git a/src/test/ui/compile-fail-migration/label-underscore.stderr b/src/test/ui/compile-fail-migration/label-underscore.stderr new file mode 100644 index 00000000000..9a567094c82 --- /dev/null +++ b/src/test/ui/compile-fail-migration/label-underscore.stderr @@ -0,0 +1,14 @@ +error: invalid label name `'_` + --> $DIR/label-underscore.rs:12:5 + | +LL | '_: loop { //~ ERROR invalid label name `'_` + | ^^ + +error: invalid label name `'_` + --> $DIR/label-underscore.rs:13:15 + | +LL | break '_ //~ ERROR invalid label name `'_` + | ^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lang-item-missing.rs b/src/test/ui/compile-fail-migration/lang-item-missing.rs index ce2fa2548c3..ce2fa2548c3 100644 --- a/src/test/compile-fail/lang-item-missing.rs +++ b/src/test/ui/compile-fail-migration/lang-item-missing.rs diff --git a/src/test/ui/compile-fail-migration/lang-item-missing.stderr b/src/test/ui/compile-fail-migration/lang-item-missing.stderr new file mode 100644 index 00000000000..f7516c7d377 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lang-item-missing.stderr @@ -0,0 +1,4 @@ +error: requires `sized` lang_item + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lexical-scopes.rs b/src/test/ui/compile-fail-migration/lexical-scopes.rs index 39da0d47a95..39da0d47a95 100644 --- a/src/test/compile-fail/lexical-scopes.rs +++ b/src/test/ui/compile-fail-migration/lexical-scopes.rs diff --git a/src/test/ui/compile-fail-migration/lexical-scopes.stderr b/src/test/ui/compile-fail-migration/lexical-scopes.stderr new file mode 100644 index 00000000000..3a6ae52c68d --- /dev/null +++ b/src/test/ui/compile-fail-migration/lexical-scopes.stderr @@ -0,0 +1,20 @@ +error[E0574]: expected struct, variant or union type, found type parameter `T` + --> $DIR/lexical-scopes.rs:13:13 + | +LL | let t = T { i: 0 }; //~ ERROR expected struct, variant or union type, found type parameter `T` + | ^ not a struct, variant or union type +help: possible better candidate is found in another module, you can import it into scope + | +LL | use T; + | + +error[E0599]: no function or associated item named `f` found for type `Foo` in the current scope + --> $DIR/lexical-scopes.rs:20:5 + | +LL | Foo::f(); //~ ERROR no function or associated item named `f` + | ^^^^^^ function or associated item not found in `Foo` + +error: aborting due to 2 previous errors + +Some errors occurred: E0574, E0599. +For more information about an error, try `rustc --explain E0574`. diff --git a/src/test/ui/compile-fail-migration/lifetime-bound-will-change-warning.nll.stderr b/src/test/ui/compile-fail-migration/lifetime-bound-will-change-warning.nll.stderr new file mode 100644 index 00000000000..ab9bb195631 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lifetime-bound-will-change-warning.nll.stderr @@ -0,0 +1,32 @@ +warning: not reporting region error due to nll + --> $DIR/lifetime-bound-will-change-warning.rs:44:13 + | +LL | ref_obj(x) //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/lifetime-bound-will-change-warning.rs:49:18 + | +LL | lib::ref_obj(x) //~ ERROR mismatched types + | ^ + +error: borrowed data escapes outside of function + --> $DIR/lifetime-bound-will-change-warning.rs:44:5 + | +LL | fn test2<'a>(x: &'a Box<Fn()+'a>) { + | - `x` is a reference that is only valid in the function body +LL | // but ref_obj will not, so warn. +LL | ref_obj(x) //~ ERROR mismatched types + | ^^^^^^^^^^ `x` escapes the function body here + +error: borrowed data escapes outside of function + --> $DIR/lifetime-bound-will-change-warning.rs:49:5 + | +LL | fn test2cc<'a>(x: &'a Box<Fn()+'a>) { + | - `x` is a reference that is only valid in the function body +LL | // same as test2, but cross crate +LL | lib::ref_obj(x) //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^ `x` escapes the function body here + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lifetime-bound-will-change-warning.rs b/src/test/ui/compile-fail-migration/lifetime-bound-will-change-warning.rs index 7e9a4f82478..7e9a4f82478 100644 --- a/src/test/compile-fail/lifetime-bound-will-change-warning.rs +++ b/src/test/ui/compile-fail-migration/lifetime-bound-will-change-warning.rs diff --git a/src/test/ui/compile-fail-migration/lifetime-bound-will-change-warning.stderr b/src/test/ui/compile-fail-migration/lifetime-bound-will-change-warning.stderr new file mode 100644 index 00000000000..01f215c97f2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lifetime-bound-will-change-warning.stderr @@ -0,0 +1,33 @@ +error[E0308]: mismatched types + --> $DIR/lifetime-bound-will-change-warning.rs:44:13 + | +LL | ref_obj(x) //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>` + found type `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>` +note: the lifetime 'a as defined on the function body at 42:10... + --> $DIR/lifetime-bound-will-change-warning.rs:42:10 + | +LL | fn test2<'a>(x: &'a Box<Fn()+'a>) { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/lifetime-bound-will-change-warning.rs:49:18 + | +LL | lib::ref_obj(x) //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `&std::boxed::Box<(dyn std::ops::Fn() + 'static)>` + found type `&std::boxed::Box<(dyn std::ops::Fn() + 'a)>` +note: the lifetime 'a as defined on the function body at 47:12... + --> $DIR/lifetime-bound-will-change-warning.rs:47:12 + | +LL | fn test2cc<'a>(x: &'a Box<Fn()+'a>) { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/lifetime-no-keyword.rs b/src/test/ui/compile-fail-migration/lifetime-no-keyword.rs index d583c4fc6c6..d583c4fc6c6 100644 --- a/src/test/compile-fail/lifetime-no-keyword.rs +++ b/src/test/ui/compile-fail-migration/lifetime-no-keyword.rs diff --git a/src/test/ui/compile-fail-migration/lifetime-no-keyword.stderr b/src/test/ui/compile-fail-migration/lifetime-no-keyword.stderr new file mode 100644 index 00000000000..1dcbe336c69 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lifetime-no-keyword.stderr @@ -0,0 +1,26 @@ +error: lifetimes cannot use keyword names + --> $DIR/lifetime-no-keyword.rs:13:8 + | +LL | fn baz<'let>(a: &'let isize) { } //~ ERROR lifetimes cannot use keyword names + | ^^^^ + +error: lifetimes cannot use keyword names + --> $DIR/lifetime-no-keyword.rs:13:18 + | +LL | fn baz<'let>(a: &'let isize) { } //~ ERROR lifetimes cannot use keyword names + | ^^^^ + +error: lifetimes cannot use keyword names + --> $DIR/lifetime-no-keyword.rs:15:8 + | +LL | fn zab<'self>(a: &'self isize) { } //~ ERROR lifetimes cannot use keyword names + | ^^^^^ + +error: lifetimes cannot use keyword names + --> $DIR/lifetime-no-keyword.rs:15:19 + | +LL | fn zab<'self>(a: &'self isize) { } //~ ERROR lifetimes cannot use keyword names + | ^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/linkage2.rs b/src/test/ui/compile-fail-migration/linkage2.rs index afae4a451d6..afae4a451d6 100644 --- a/src/test/compile-fail/linkage2.rs +++ b/src/test/ui/compile-fail-migration/linkage2.rs diff --git a/src/test/ui/compile-fail-migration/linkage2.stderr b/src/test/ui/compile-fail-migration/linkage2.stderr new file mode 100644 index 00000000000..d9edac160da --- /dev/null +++ b/src/test/ui/compile-fail-migration/linkage2.stderr @@ -0,0 +1,8 @@ +error: must have type `*const T` or `*mut T` + --> $DIR/linkage2.rs:14:32 + | +LL | #[linkage = "extern_weak"] static foo: i32; + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/linkage3.rs b/src/test/ui/compile-fail-migration/linkage3.rs index c222989ed66..c222989ed66 100644 --- a/src/test/compile-fail/linkage3.rs +++ b/src/test/ui/compile-fail-migration/linkage3.rs diff --git a/src/test/ui/compile-fail-migration/linkage3.stderr b/src/test/ui/compile-fail-migration/linkage3.stderr new file mode 100644 index 00000000000..3429ced8ce4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/linkage3.stderr @@ -0,0 +1,8 @@ +error: invalid linkage specified + --> $DIR/linkage3.rs:14:24 + | +LL | #[linkage = "foo"] static foo: *const i32; + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/linkage4.rs b/src/test/ui/compile-fail-migration/linkage4.rs index 1cf6e90d6c8..1cf6e90d6c8 100644 --- a/src/test/compile-fail/linkage4.rs +++ b/src/test/ui/compile-fail-migration/linkage4.rs diff --git a/src/test/ui/compile-fail-migration/linkage4.stderr b/src/test/ui/compile-fail-migration/linkage4.stderr new file mode 100644 index 00000000000..c04f88d37a5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/linkage4.stderr @@ -0,0 +1,11 @@ +error[E0658]: the `linkage` attribute is experimental and not portable across platforms (see issue #29603) + --> $DIR/linkage4.rs:11:1 + | +LL | #[linkage = "external"] + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(linkage)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/lint-attr-non-item-node.rs b/src/test/ui/compile-fail-migration/lint-attr-non-item-node.rs index 930f69e51e1..930f69e51e1 100644 --- a/src/test/compile-fail/lint-attr-non-item-node.rs +++ b/src/test/ui/compile-fail-migration/lint-attr-non-item-node.rs diff --git a/src/test/ui/compile-fail-migration/lint-attr-non-item-node.stderr b/src/test/ui/compile-fail-migration/lint-attr-non-item-node.stderr new file mode 100644 index 00000000000..33d096c5bcf --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-attr-non-item-node.stderr @@ -0,0 +1,14 @@ +error: unreachable statement + --> $DIR/lint-attr-non-item-node.rs:17:9 + | +LL | "unreachable"; //~ ERROR unreachable statement + | ^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-attr-non-item-node.rs:14:12 + | +LL | #[deny(unreachable_code)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-change-warnings.rs b/src/test/ui/compile-fail-migration/lint-change-warnings.rs index 19e253e3b8e..19e253e3b8e 100644 --- a/src/test/compile-fail/lint-change-warnings.rs +++ b/src/test/ui/compile-fail-migration/lint-change-warnings.rs diff --git a/src/test/ui/compile-fail-migration/lint-change-warnings.stderr b/src/test/ui/compile-fail-migration/lint-change-warnings.stderr new file mode 100644 index 00000000000..353802f5c28 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-change-warnings.stderr @@ -0,0 +1,36 @@ +error: denote infinite loops with `loop { ... }` + --> $DIR/lint-change-warnings.rs:15:5 + | +LL | while true {} //~ ERROR: infinite + | ^^^^^^^^^^ help: use `loop` + | +note: lint level defined here + --> $DIR/lint-change-warnings.rs:11:9 + | +LL | #![deny(warnings)] + | ^^^^^^^^ + = note: #[deny(while_true)] implied by #[deny(warnings)] + +warning: denote infinite loops with `loop { ... }` + --> $DIR/lint-change-warnings.rs:25:5 + | +LL | while true {} //~ WARNING: infinite + | ^^^^^^^^^^ help: use `loop` + | + = note: #[warn(while_true)] on by default + +error: denote infinite loops with `loop { ... }` + --> $DIR/lint-change-warnings.rs:30:5 + | +LL | while true {} //~ ERROR: infinite + | ^^^^^^^^^^ help: use `loop` + | +note: lint level defined here + --> $DIR/lint-change-warnings.rs:28:10 + | +LL | #[forbid(warnings)] + | ^^^^^^^^ + = note: #[forbid(while_true)] implied by #[forbid(warnings)] + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lint-ctypes-enum.rs b/src/test/ui/compile-fail-migration/lint-ctypes-enum.rs index 7b7ffd8fc10..7b7ffd8fc10 100644 --- a/src/test/compile-fail/lint-ctypes-enum.rs +++ b/src/test/ui/compile-fail-migration/lint-ctypes-enum.rs diff --git a/src/test/ui/compile-fail-migration/lint-ctypes-enum.stderr b/src/test/ui/compile-fail-migration/lint-ctypes-enum.stderr new file mode 100644 index 00000000000..9b1c04b2a1d --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-ctypes-enum.stderr @@ -0,0 +1,46 @@ +error: `extern` block uses type `U` which is not FFI-safe: enum has no representation hint + --> $DIR/lint-ctypes-enum.rs:30:13 + | +LL | fn uf(x: U); //~ ERROR enum has no representation hint + | ^ + | +note: lint level defined here + --> $DIR/lint-ctypes-enum.rs:11:9 + | +LL | #![deny(improper_ctypes)] + | ^^^^^^^^^^^^^^^ + = help: consider adding a #[repr(...)] attribute to this enum +note: type defined here + --> $DIR/lint-ctypes-enum.rs:15:1 + | +LL | enum U { A } + | ^^^^^^^^^^^^ + +error: `extern` block uses type `B` which is not FFI-safe: enum has no representation hint + --> $DIR/lint-ctypes-enum.rs:31:13 + | +LL | fn bf(x: B); //~ ERROR enum has no representation hint + | ^ + | + = help: consider adding a #[repr(...)] attribute to this enum +note: type defined here + --> $DIR/lint-ctypes-enum.rs:16:1 + | +LL | enum B { C, D } + | ^^^^^^^^^^^^^^^ + +error: `extern` block uses type `T` which is not FFI-safe: enum has no representation hint + --> $DIR/lint-ctypes-enum.rs:32:13 + | +LL | fn tf(x: T); //~ ERROR enum has no representation hint + | ^ + | + = help: consider adding a #[repr(...)] attribute to this enum +note: type defined here + --> $DIR/lint-ctypes-enum.rs:17:1 + | +LL | enum T { E, F, G } + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/lint-dead-code-1.rs b/src/test/ui/compile-fail-migration/lint-dead-code-1.rs index 2fe72365bab..2fe72365bab 100644 --- a/src/test/compile-fail/lint-dead-code-1.rs +++ b/src/test/ui/compile-fail-migration/lint-dead-code-1.rs diff --git a/src/test/ui/compile-fail-migration/lint-dead-code-1.stderr b/src/test/ui/compile-fail-migration/lint-dead-code-1.stderr new file mode 100644 index 00000000000..9802b7e8f38 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-dead-code-1.stderr @@ -0,0 +1,62 @@ +error: struct is never constructed: `Bar` + --> $DIR/lint-dead-code-1.rs:22:5 + | +LL | pub struct Bar; //~ ERROR: struct is never constructed + | ^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-dead-code-1.rs:15:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: static item is never used: `priv_static` + --> $DIR/lint-dead-code-1.rs:30:1 + | +LL | static priv_static: isize = 0; //~ ERROR: static item is never used + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: constant item is never used: `priv_const` + --> $DIR/lint-dead-code-1.rs:37:1 + | +LL | const priv_const: isize = 0; //~ ERROR: constant item is never used + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: struct is never constructed: `PrivStruct` + --> $DIR/lint-dead-code-1.rs:45:1 + | +LL | struct PrivStruct; //~ ERROR: struct is never constructed + | ^^^^^^^^^^^^^^^^^^ + +error: enum is never used: `priv_enum` + --> $DIR/lint-dead-code-1.rs:74:1 + | +LL | enum priv_enum { foo2, bar2 } //~ ERROR: enum is never used + | ^^^^^^^^^^^^^^ + +error: variant is never constructed: `bar3` + --> $DIR/lint-dead-code-1.rs:77:5 + | +LL | bar3 //~ ERROR variant is never constructed + | ^^^^ + +error: function is never used: `priv_fn` + --> $DIR/lint-dead-code-1.rs:98:1 + | +LL | fn priv_fn() { //~ ERROR: function is never used + | ^^^^^^^^^^^^ + +error: function is never used: `foo` + --> $DIR/lint-dead-code-1.rs:103:1 + | +LL | fn foo() { //~ ERROR: function is never used + | ^^^^^^^^ + +error: function is never used: `bar` + --> $DIR/lint-dead-code-1.rs:108:1 + | +LL | fn bar() { //~ ERROR: function is never used + | ^^^^^^^^ + +error: aborting due to 9 previous errors + diff --git a/src/test/compile-fail/lint-dead-code-2.rs b/src/test/ui/compile-fail-migration/lint-dead-code-2.rs index 4a0e4f4319e..4a0e4f4319e 100644 --- a/src/test/compile-fail/lint-dead-code-2.rs +++ b/src/test/ui/compile-fail-migration/lint-dead-code-2.rs diff --git a/src/test/ui/compile-fail-migration/lint-dead-code-2.stderr b/src/test/ui/compile-fail-migration/lint-dead-code-2.stderr new file mode 100644 index 00000000000..6e713c84f16 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-dead-code-2.stderr @@ -0,0 +1,26 @@ +error: function is never used: `dead_fn` + --> $DIR/lint-dead-code-2.rs:32:1 + | +LL | fn dead_fn() {} //~ ERROR: function is never used + | ^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-dead-code-2.rs:12:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: function is never used: `dead_fn2` + --> $DIR/lint-dead-code-2.rs:35:1 + | +LL | fn dead_fn2() {} //~ ERROR: function is never used + | ^^^^^^^^^^^^^ + +error: function is never used: `main` + --> $DIR/lint-dead-code-2.rs:48:1 + | +LL | fn main() { //~ ERROR: function is never used + | ^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/lint-dead-code-3.rs b/src/test/ui/compile-fail-migration/lint-dead-code-3.rs index 112d3630952..112d3630952 100644 --- a/src/test/compile-fail/lint-dead-code-3.rs +++ b/src/test/ui/compile-fail-migration/lint-dead-code-3.rs diff --git a/src/test/ui/compile-fail-migration/lint-dead-code-3.stderr b/src/test/ui/compile-fail-migration/lint-dead-code-3.stderr new file mode 100644 index 00000000000..994e93e8557 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-dead-code-3.stderr @@ -0,0 +1,38 @@ +error: struct is never constructed: `Foo` + --> $DIR/lint-dead-code-3.rs:23:1 + | +LL | struct Foo; //~ ERROR: struct is never constructed + | ^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-dead-code-3.rs:13:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: method is never used: `foo` + --> $DIR/lint-dead-code-3.rs:25:5 + | +LL | fn foo(&self) { //~ ERROR: method is never used + | ^^^^^^^^^^^^^ + +error: function is never used: `bar` + --> $DIR/lint-dead-code-3.rs:30:1 + | +LL | fn bar() { //~ ERROR: function is never used + | ^^^^^^^^ + +error: enum is never used: `c_void` + --> $DIR/lint-dead-code-3.rs:69:1 + | +LL | enum c_void {} //~ ERROR: enum is never used + | ^^^^^^^^^^^ + +error: foreign function is never used: `free` + --> $DIR/lint-dead-code-3.rs:71:5 + | +LL | fn free(p: *const c_void); //~ ERROR: foreign function is never used + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/lint-dead-code-4.rs b/src/test/ui/compile-fail-migration/lint-dead-code-4.rs index 1296cf46e6f..1296cf46e6f 100644 --- a/src/test/compile-fail/lint-dead-code-4.rs +++ b/src/test/ui/compile-fail-migration/lint-dead-code-4.rs diff --git a/src/test/ui/compile-fail-migration/lint-dead-code-4.stderr b/src/test/ui/compile-fail-migration/lint-dead-code-4.stderr new file mode 100644 index 00000000000..fce2cf76898 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-dead-code-4.stderr @@ -0,0 +1,72 @@ +error: field is never used: `b` + --> $DIR/lint-dead-code-4.rs:17:5 + | +LL | b: bool, //~ ERROR: field is never used + | ^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-dead-code-4.rs:13:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: variant is never constructed: `X` + --> $DIR/lint-dead-code-4.rs:25:5 + | +LL | X, //~ ERROR variant is never constructed + | ^ + +error: variant is never constructed: `Y` + --> $DIR/lint-dead-code-4.rs:26:5 + | +LL | / Y { //~ ERROR variant is never constructed +LL | | a: String, +LL | | b: i32, +LL | | c: i32, +LL | | }, + | |_____^ + +error: enum is never used: `ABC` + --> $DIR/lint-dead-code-4.rs:34:1 + | +LL | enum ABC { //~ ERROR enum is never used + | ^^^^^^^^ + +error: variant is never constructed: `I` + --> $DIR/lint-dead-code-4.rs:46:5 + | +LL | I, //~ ERROR variant is never constructed + | ^ + +error: field is never used: `b` + --> $DIR/lint-dead-code-4.rs:49:9 + | +LL | b: i32, //~ ERROR field is never used + | ^^^^^^ + +error: field is never used: `c` + --> $DIR/lint-dead-code-4.rs:50:9 + | +LL | c: i32, //~ ERROR field is never used + | ^^^^^^ + +error: variant is never constructed: `K` + --> $DIR/lint-dead-code-4.rs:52:5 + | +LL | K //~ ERROR variant is never constructed + | ^ + +error: field is never used: `x` + --> $DIR/lint-dead-code-4.rs:71:5 + | +LL | x: usize, //~ ERROR: field is never used + | ^^^^^^^^ + +error: field is never used: `c` + --> $DIR/lint-dead-code-4.rs:73:5 + | +LL | c: bool, //~ ERROR: field is never used + | ^^^^^^^ + +error: aborting due to 10 previous errors + diff --git a/src/test/compile-fail/lint-dead-code-5.rs b/src/test/ui/compile-fail-migration/lint-dead-code-5.rs index ee5cf24823d..ee5cf24823d 100644 --- a/src/test/compile-fail/lint-dead-code-5.rs +++ b/src/test/ui/compile-fail-migration/lint-dead-code-5.rs diff --git a/src/test/ui/compile-fail-migration/lint-dead-code-5.stderr b/src/test/ui/compile-fail-migration/lint-dead-code-5.stderr new file mode 100644 index 00000000000..37ca0f479f5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-dead-code-5.stderr @@ -0,0 +1,32 @@ +error: variant is never constructed: `Variant2` + --> $DIR/lint-dead-code-5.rs:16:5 + | +LL | Variant2 //~ ERROR: variant is never constructed + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-dead-code-5.rs:12:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: variant is never constructed: `Variant5` + --> $DIR/lint-dead-code-5.rs:23:5 + | +LL | Variant5 { _x: isize }, //~ ERROR: variant is never constructed: `Variant5` + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: variant is never constructed: `Variant6` + --> $DIR/lint-dead-code-5.rs:24:5 + | +LL | Variant6(isize), //~ ERROR: variant is never constructed: `Variant6` + | ^^^^^^^^^^^^^^^ + +error: enum is never used: `Enum3` + --> $DIR/lint-dead-code-5.rs:28:1 + | +LL | enum Enum3 { //~ ERROR: enum is never used + | ^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/lint-dead-code-type-alias.rs b/src/test/ui/compile-fail-migration/lint-dead-code-type-alias.rs index aaa01aa6bbe..aaa01aa6bbe 100644 --- a/src/test/compile-fail/lint-dead-code-type-alias.rs +++ b/src/test/ui/compile-fail-migration/lint-dead-code-type-alias.rs diff --git a/src/test/ui/compile-fail-migration/lint-dead-code-type-alias.stderr b/src/test/ui/compile-fail-migration/lint-dead-code-type-alias.stderr new file mode 100644 index 00000000000..bd11e64c781 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-dead-code-type-alias.stderr @@ -0,0 +1,14 @@ +error: type alias is never used: `Unused` + --> $DIR/lint-dead-code-type-alias.rs:14:1 + | +LL | type Unused = u8; //~ ERROR type alias is never used + | ^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-dead-code-type-alias.rs:11:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-dead-code-variant.rs b/src/test/ui/compile-fail-migration/lint-dead-code-variant.rs index 3301560c315..3301560c315 100644 --- a/src/test/compile-fail/lint-dead-code-variant.rs +++ b/src/test/ui/compile-fail-migration/lint-dead-code-variant.rs diff --git a/src/test/ui/compile-fail-migration/lint-dead-code-variant.stderr b/src/test/ui/compile-fail-migration/lint-dead-code-variant.stderr new file mode 100644 index 00000000000..05b7e35337a --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-dead-code-variant.stderr @@ -0,0 +1,14 @@ +error: variant is never constructed: `Variant1` + --> $DIR/lint-dead-code-variant.rs:15:5 + | +LL | Variant1, //~ ERROR: variant is never constructed + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-dead-code-variant.rs:11:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-directives-on-use-items-issue-10534.rs b/src/test/ui/compile-fail-migration/lint-directives-on-use-items-issue-10534.rs index 18159aec708..18159aec708 100644 --- a/src/test/compile-fail/lint-directives-on-use-items-issue-10534.rs +++ b/src/test/ui/compile-fail-migration/lint-directives-on-use-items-issue-10534.rs diff --git a/src/test/ui/compile-fail-migration/lint-directives-on-use-items-issue-10534.stderr b/src/test/ui/compile-fail-migration/lint-directives-on-use-items-issue-10534.stderr new file mode 100644 index 00000000000..2c4602ae20b --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-directives-on-use-items-issue-10534.stderr @@ -0,0 +1,26 @@ +error: unused import: `a::x` + --> $DIR/lint-directives-on-use-items-issue-10534.rs:22:9 + | +LL | use a::x; //~ ERROR: unused import + | ^^^^ + | +note: lint level defined here + --> $DIR/lint-directives-on-use-items-issue-10534.rs:11:9 + | +LL | #![deny(unused_imports)] + | ^^^^^^^^^^^^^^ + +error: unused import: `a::y` + --> $DIR/lint-directives-on-use-items-issue-10534.rs:31:9 + | +LL | use a::y; //~ ERROR: unused import + | ^^^^ + | +note: lint level defined here + --> $DIR/lint-directives-on-use-items-issue-10534.rs:30:12 + | +LL | #[deny(unused_imports)] + | ^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lint-exceeding-bitshifts.rs b/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts.rs index 5ebfcc4926b..5ebfcc4926b 100644 --- a/src/test/compile-fail/lint-exceeding-bitshifts.rs +++ b/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts.rs diff --git a/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts.stderr b/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts.stderr new file mode 100644 index 00000000000..5124a69195a --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts.stderr @@ -0,0 +1,116 @@ +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:17:15 + | +LL | let n = 1u8 << 8; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-exceeding-bitshifts.rs:11:9 + | +LL | #![deny(exceeding_bitshifts, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:19:15 + | +LL | let n = 1u16 << 16; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:21:15 + | +LL | let n = 1u32 << 32; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:23:15 + | +LL | let n = 1u64 << 64; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:25:15 + | +LL | let n = 1i8 << 8; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:27:15 + | +LL | let n = 1i16 << 16; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:29:15 + | +LL | let n = 1i32 << 32; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:31:15 + | +LL | let n = 1i64 << 64; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^^ + +error: attempt to shift right with overflow + --> $DIR/lint-exceeding-bitshifts.rs:34:15 + | +LL | let n = 1u8 >> 8; //~ ERROR: attempt to shift right with overflow + | ^^^^^^^^ + +error: attempt to shift right with overflow + --> $DIR/lint-exceeding-bitshifts.rs:36:15 + | +LL | let n = 1u16 >> 16; //~ ERROR: attempt to shift right with overflow + | ^^^^^^^^^^ + +error: attempt to shift right with overflow + --> $DIR/lint-exceeding-bitshifts.rs:38:15 + | +LL | let n = 1u32 >> 32; //~ ERROR: attempt to shift right with overflow + | ^^^^^^^^^^ + +error: attempt to shift right with overflow + --> $DIR/lint-exceeding-bitshifts.rs:40:15 + | +LL | let n = 1u64 >> 64; //~ ERROR: attempt to shift right with overflow + | ^^^^^^^^^^ + +error: attempt to shift right with overflow + --> $DIR/lint-exceeding-bitshifts.rs:42:15 + | +LL | let n = 1i8 >> 8; //~ ERROR: attempt to shift right with overflow + | ^^^^^^^^ + +error: attempt to shift right with overflow + --> $DIR/lint-exceeding-bitshifts.rs:44:15 + | +LL | let n = 1i16 >> 16; //~ ERROR: attempt to shift right with overflow + | ^^^^^^^^^^ + +error: attempt to shift right with overflow + --> $DIR/lint-exceeding-bitshifts.rs:46:15 + | +LL | let n = 1i32 >> 32; //~ ERROR: attempt to shift right with overflow + | ^^^^^^^^^^ + +error: attempt to shift right with overflow + --> $DIR/lint-exceeding-bitshifts.rs:48:15 + | +LL | let n = 1i64 >> 64; //~ ERROR: attempt to shift right with overflow + | ^^^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:52:15 + | +LL | let n = n << 8; //~ ERROR: attempt to shift left with overflow + | ^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts.rs:54:15 + | +LL | let n = 1u8 << -8; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^ + +error: aborting due to 18 previous errors + diff --git a/src/test/compile-fail/lint-exceeding-bitshifts2.rs b/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts2.rs index 3ba300eb7c4..3ba300eb7c4 100644 --- a/src/test/compile-fail/lint-exceeding-bitshifts2.rs +++ b/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts2.rs diff --git a/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts2.stderr b/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts2.stderr new file mode 100644 index 00000000000..17b4235a73f --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-exceeding-bitshifts2.stderr @@ -0,0 +1,26 @@ +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts2.rs:17:15 + | +LL | let n = 1u8 << (4+4); //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-exceeding-bitshifts2.rs:11:9 + | +LL | #![deny(exceeding_bitshifts, const_err)] + | ^^^^^^^^^^^^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts2.rs:25:15 + | +LL | let n = 1_isize << BITS; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^^^^^^^ + +error: attempt to shift left with overflow + --> $DIR/lint-exceeding-bitshifts2.rs:26:15 + | +LL | let n = 1_usize << BITS; //~ ERROR: attempt to shift left with overflow + | ^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/lint-forbid-cmdline.rs b/src/test/ui/compile-fail-migration/lint-forbid-cmdline.rs index 6a4d17b33de..6a4d17b33de 100644 --- a/src/test/compile-fail/lint-forbid-cmdline.rs +++ b/src/test/ui/compile-fail-migration/lint-forbid-cmdline.rs diff --git a/src/test/ui/compile-fail-migration/lint-forbid-cmdline.stderr b/src/test/ui/compile-fail-migration/lint-forbid-cmdline.stderr new file mode 100644 index 00000000000..37a2699e898 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-forbid-cmdline.stderr @@ -0,0 +1,11 @@ +error[E0453]: allow(deprecated) overruled by outer forbid(deprecated) + --> $DIR/lint-forbid-cmdline.rs:13:9 + | +LL | #[allow(deprecated)] //~ ERROR allow(deprecated) overruled by outer forbid(deprecated) + | ^^^^^^^^^^ overruled by previous forbid + | + = note: `forbid` lint level was set on command line + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0453`. diff --git a/src/test/compile-fail/lint-impl-fn.rs b/src/test/ui/compile-fail-migration/lint-impl-fn.rs index 54a720d75b5..54a720d75b5 100644 --- a/src/test/compile-fail/lint-impl-fn.rs +++ b/src/test/ui/compile-fail-migration/lint-impl-fn.rs diff --git a/src/test/ui/compile-fail-migration/lint-impl-fn.stderr b/src/test/ui/compile-fail-migration/lint-impl-fn.stderr new file mode 100644 index 00000000000..ed37e877875 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-impl-fn.stderr @@ -0,0 +1,38 @@ +error: denote infinite loops with `loop { ... }` + --> $DIR/lint-impl-fn.rs:20:21 + | +LL | fn bar(&self) { while true {} } //~ ERROR: infinite loops + | ^^^^^^^^^^ help: use `loop` + | +note: lint level defined here + --> $DIR/lint-impl-fn.rs:19:12 + | +LL | #[deny(while_true)] + | ^^^^^^^^^^ + +error: denote infinite loops with `loop { ... }` + --> $DIR/lint-impl-fn.rs:28:25 + | +LL | fn foo(&self) { while true {} } //~ ERROR: infinite loops + | ^^^^^^^^^^ help: use `loop` + | +note: lint level defined here + --> $DIR/lint-impl-fn.rs:23:8 + | +LL | #[deny(while_true)] + | ^^^^^^^^^^ + +error: denote infinite loops with `loop { ... }` + --> $DIR/lint-impl-fn.rs:37:5 + | +LL | while true {} //~ ERROR: infinite loops + | ^^^^^^^^^^ help: use `loop` + | +note: lint level defined here + --> $DIR/lint-impl-fn.rs:35:8 + | +LL | #[deny(while_true)] + | ^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/lint-malformed.rs b/src/test/ui/compile-fail-migration/lint-malformed.rs index ad5e3aa3f06..ad5e3aa3f06 100644 --- a/src/test/compile-fail/lint-malformed.rs +++ b/src/test/ui/compile-fail-migration/lint-malformed.rs diff --git a/src/test/ui/compile-fail-migration/lint-malformed.stderr b/src/test/ui/compile-fail-migration/lint-malformed.stderr new file mode 100644 index 00000000000..7b8155cb410 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-malformed.stderr @@ -0,0 +1,15 @@ +error[E0452]: malformed lint attribute + --> $DIR/lint-malformed.rs:11:1 + | +LL | #![deny = "foo"] //~ ERROR malformed lint attribute + | ^^^^^^^^^^^^^^^^ + +error[E0452]: malformed lint attribute + --> $DIR/lint-malformed.rs:12:10 + | +LL | #![allow(bar = "baz")] //~ ERROR malformed lint attribute + | ^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0452`. diff --git a/src/test/compile-fail/lint-misplaced-attr.rs b/src/test/ui/compile-fail-migration/lint-misplaced-attr.rs index 18ea5a383f6..18ea5a383f6 100644 --- a/src/test/compile-fail/lint-misplaced-attr.rs +++ b/src/test/ui/compile-fail-migration/lint-misplaced-attr.rs diff --git a/src/test/ui/compile-fail-migration/lint-misplaced-attr.stderr b/src/test/ui/compile-fail-migration/lint-misplaced-attr.stderr new file mode 100644 index 00000000000..17f29a6ba79 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-misplaced-attr.stderr @@ -0,0 +1,32 @@ +error: unused attribute + --> $DIR/lint-misplaced-attr.rs:17:5 + | +LL | #![crate_type = "bin"] //~ ERROR unused attribute + | ^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-misplaced-attr.rs:14:9 + | +LL | #![deny(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + +error: crate-level attribute should be in the root module + --> $DIR/lint-misplaced-attr.rs:17:5 + | +LL | #![crate_type = "bin"] //~ ERROR unused attribute + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: unused attribute + --> $DIR/lint-misplaced-attr.rs:21:1 + | +LL | #[crate_type = "bin"] fn main() {} //~ ERROR unused attribute + | ^^^^^^^^^^^^^^^^^^^^^ + +error: crate-level attribute should be an inner attribute: add an exclamation mark: #![foo] + --> $DIR/lint-misplaced-attr.rs:21:1 + | +LL | #[crate_type = "bin"] fn main() {} //~ ERROR unused attribute + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/lint-missing-copy-implementations.rs b/src/test/ui/compile-fail-migration/lint-missing-copy-implementations.rs index 94a11aac067..94a11aac067 100644 --- a/src/test/compile-fail/lint-missing-copy-implementations.rs +++ b/src/test/ui/compile-fail-migration/lint-missing-copy-implementations.rs diff --git a/src/test/ui/compile-fail-migration/lint-missing-copy-implementations.stderr b/src/test/ui/compile-fail-migration/lint-missing-copy-implementations.stderr new file mode 100644 index 00000000000..3cb89ef794a --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-missing-copy-implementations.stderr @@ -0,0 +1,16 @@ +error: type could implement `Copy`; consider adding `impl Copy` + --> $DIR/lint-missing-copy-implementations.rs:16:5 + | +LL | / pub struct Foo { //~ ERROR type could implement `Copy`; consider adding `impl Copy` +LL | | pub field: i32 +LL | | } + | |_____^ + | +note: lint level defined here + --> $DIR/lint-missing-copy-implementations.rs:13:9 + | +LL | #![deny(missing_copy_implementations)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-missing-doc.rs b/src/test/ui/compile-fail-migration/lint-missing-doc.rs index 4add67f61e0..4add67f61e0 100644 --- a/src/test/compile-fail/lint-missing-doc.rs +++ b/src/test/ui/compile-fail-migration/lint-missing-doc.rs diff --git a/src/test/ui/compile-fail-migration/lint-missing-doc.stderr b/src/test/ui/compile-fail-migration/lint-missing-doc.stderr new file mode 100644 index 00000000000..e61d56d8518 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-missing-doc.stderr @@ -0,0 +1,122 @@ +error: missing documentation for a type alias + --> $DIR/lint-missing-doc.rs:21:1 + | +LL | pub type PubTypedef = String; //~ ERROR: missing documentation for a type alias + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-missing-doc.rs:13:9 + | +LL | #![deny(missing_docs)] + | ^^^^^^^^^^^^ + +error: missing documentation for a struct + --> $DIR/lint-missing-doc.rs:28:1 + | +LL | pub struct PubFoo { //~ ERROR: missing documentation for a struct + | ^^^^^^^^^^^^^^^^^ + +error: missing documentation for a struct field + --> $DIR/lint-missing-doc.rs:29:5 + | +LL | pub a: isize, //~ ERROR: missing documentation for a struct field + | ^^^^^^^^^^^^ + +error: missing documentation for a module + --> $DIR/lint-missing-doc.rs:40:1 + | +LL | pub mod pub_module_no_dox {} //~ ERROR: missing documentation for a module + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for a function + --> $DIR/lint-missing-doc.rs:44:1 + | +LL | pub fn foo2() {} //~ ERROR: missing documentation for a function + | ^^^^^^^^^^^^^ + +error: missing documentation for a trait + --> $DIR/lint-missing-doc.rs:62:1 + | +LL | pub trait C { //~ ERROR: missing documentation for a trait + | ^^^^^^^^^^^ + +error: missing documentation for a trait method + --> $DIR/lint-missing-doc.rs:63:5 + | +LL | fn foo(&self); //~ ERROR: missing documentation for a trait method + | ^^^^^^^^^^^^^^ + +error: missing documentation for a trait method + --> $DIR/lint-missing-doc.rs:64:5 + | +LL | fn foo_with_impl(&self) {} //~ ERROR: missing documentation for a trait method + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for an associated type + --> $DIR/lint-missing-doc.rs:74:5 + | +LL | type AssociatedType; //~ ERROR: missing documentation for an associated type + | ^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for an associated type + --> $DIR/lint-missing-doc.rs:75:5 + | +LL | type AssociatedTypeDef = Self; //~ ERROR: missing documentation for an associated type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for a method + --> $DIR/lint-missing-doc.rs:91:5 + | +LL | pub fn foo() {} //~ ERROR: missing documentation for a method + | ^^^^^^^^^^^^ + +error: missing documentation for an enum + --> $DIR/lint-missing-doc.rs:128:1 + | +LL | pub enum PubBaz { //~ ERROR: missing documentation for an enum + | ^^^^^^^^^^^^^^^ + +error: missing documentation for a variant + --> $DIR/lint-missing-doc.rs:129:5 + | +LL | PubBazA { //~ ERROR: missing documentation for a variant + | ^^^^^^^ + +error: missing documentation for a struct field + --> $DIR/lint-missing-doc.rs:130:9 + | +LL | a: isize, //~ ERROR: missing documentation for a struct field + | ^^^^^^^^ + +error: missing documentation for a constant + --> $DIR/lint-missing-doc.rs:161:1 + | +LL | pub const FOO4: u32 = 0; //~ ERROR: missing documentation for a const + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for a static + --> $DIR/lint-missing-doc.rs:171:1 + | +LL | pub static BAR4: u32 = 0; //~ ERROR: missing documentation for a static + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for a function + --> $DIR/lint-missing-doc.rs:177:5 + | +LL | pub fn undocumented1() {} //~ ERROR: missing documentation for a function + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for a function + --> $DIR/lint-missing-doc.rs:178:5 + | +LL | pub fn undocumented2() {} //~ ERROR: missing documentation for a function + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: missing documentation for a function + --> $DIR/lint-missing-doc.rs:184:9 + | +LL | pub fn also_undocumented1() {} //~ ERROR: missing documentation for a function + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 19 previous errors + diff --git a/src/test/compile-fail/lint-non-camel-case-types.rs b/src/test/ui/compile-fail-migration/lint-non-camel-case-types.rs index 5dcdf3a863f..5dcdf3a863f 100644 --- a/src/test/compile-fail/lint-non-camel-case-types.rs +++ b/src/test/ui/compile-fail-migration/lint-non-camel-case-types.rs diff --git a/src/test/ui/compile-fail-migration/lint-non-camel-case-types.stderr b/src/test/ui/compile-fail-migration/lint-non-camel-case-types.stderr new file mode 100644 index 00000000000..85610dc7fa3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-non-camel-case-types.stderr @@ -0,0 +1,88 @@ +error: type `ONE_TWO_THREE` should have a camel case name such as `OneTwoThree` + --> $DIR/lint-non-camel-case-types.rs:14:1 + | +LL | struct ONE_TWO_THREE; + | ^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-non-camel-case-types.rs:11:11 + | +LL | #![forbid(non_camel_case_types)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: type `foo` should have a camel case name such as `Foo` + --> $DIR/lint-non-camel-case-types.rs:17:1 + | +LL | / struct foo { //~ ERROR type `foo` should have a camel case name such as `Foo` +LL | | bar: isize, +LL | | } + | |_^ + +error: type `foo2` should have a camel case name such as `Foo2` + --> $DIR/lint-non-camel-case-types.rs:21:1 + | +LL | / enum foo2 { //~ ERROR type `foo2` should have a camel case name such as `Foo2` +LL | | Bar +LL | | } + | |_^ + +error: type `foo3` should have a camel case name such as `Foo3` + --> $DIR/lint-non-camel-case-types.rs:25:1 + | +LL | / struct foo3 { //~ ERROR type `foo3` should have a camel case name such as `Foo3` +LL | | bar: isize +LL | | } + | |_^ + +error: type `foo4` should have a camel case name such as `Foo4` + --> $DIR/lint-non-camel-case-types.rs:29:1 + | +LL | type foo4 = isize; //~ ERROR type `foo4` should have a camel case name such as `Foo4` + | ^^^^^^^^^^^^^^^^^^ + +error: variant `bar` should have a camel case name such as `Bar` + --> $DIR/lint-non-camel-case-types.rs:32:5 + | +LL | bar //~ ERROR variant `bar` should have a camel case name such as `Bar` + | ^^^ + +error: trait `foo6` should have a camel case name such as `Foo6` + --> $DIR/lint-non-camel-case-types.rs:35:1 + | +LL | / trait foo6 { //~ ERROR trait `foo6` should have a camel case name such as `Foo6` +LL | | fn dummy(&self) { } +LL | | } + | |_^ + +error: type parameter `ty` should have a camel case name such as `Ty` + --> $DIR/lint-non-camel-case-types.rs:39:6 + | +LL | fn f<ty>(_: ty) {} //~ ERROR type parameter `ty` should have a camel case name such as `Ty` + | ^^ + +error: type `__` should have a camel case name such as `CamelCase` + --> $DIR/lint-non-camel-case-types.rs:46:1 + | +LL | type __ = isize; //~ ERROR type `__` should have a camel case name such as `CamelCase` + | ^^^^^^^^^^^^^^^^ + +error: type `X86__64` should have a camel case name such as `X86_64` + --> $DIR/lint-non-camel-case-types.rs:50:1 + | +LL | struct X86__64; //~ ERROR type `X86__64` should have a camel case name such as `X86_64` + | ^^^^^^^^^^^^^^^ + +error: type `Abc_123` should have a camel case name such as `Abc123` + --> $DIR/lint-non-camel-case-types.rs:52:1 + | +LL | struct Abc_123; //~ ERROR type `Abc_123` should have a camel case name such as `Abc123` + | ^^^^^^^^^^^^^^^ + +error: type `A1_b2_c3` should have a camel case name such as `A1B2C3` + --> $DIR/lint-non-camel-case-types.rs:54:1 + | +LL | struct A1_b2_c3; //~ ERROR type `A1_b2_c3` should have a camel case name such as `A1B2C3` + | ^^^^^^^^^^^^^^^^ + +error: aborting due to 12 previous errors + diff --git a/src/test/compile-fail/lint-non-snake-case-crate-2.rs b/src/test/ui/compile-fail-migration/lint-non-snake-case-crate-2.rs index fe22c21df24..fe22c21df24 100644 --- a/src/test/compile-fail/lint-non-snake-case-crate-2.rs +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-crate-2.rs diff --git a/src/test/ui/compile-fail-migration/lint-non-snake-case-crate-2.stderr b/src/test/ui/compile-fail-migration/lint-non-snake-case-crate-2.stderr new file mode 100644 index 00000000000..ce49d9a0b80 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-crate-2.stderr @@ -0,0 +1,10 @@ +error: crate `NonSnakeCase` should have a snake case name such as `non_snake_case` + | +note: lint level defined here + --> $DIR/lint-non-snake-case-crate-2.rs:14:9 + | +LL | #![deny(non_snake_case)] + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-non-snake-case-crate.rs b/src/test/ui/compile-fail-migration/lint-non-snake-case-crate.rs index 9ca0a34e6ff..9ca0a34e6ff 100644 --- a/src/test/compile-fail/lint-non-snake-case-crate.rs +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-crate.rs diff --git a/src/test/ui/compile-fail-migration/lint-non-snake-case-crate.stderr b/src/test/ui/compile-fail-migration/lint-non-snake-case-crate.stderr new file mode 100644 index 00000000000..4d55661daa0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-crate.stderr @@ -0,0 +1,14 @@ +error: crate `NonSnakeCase` should have a snake case name such as `non_snake_case` + --> $DIR/lint-non-snake-case-crate.rs:11:1 + | +LL | #![crate_name = "NonSnakeCase"] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-non-snake-case-crate.rs:13:9 + | +LL | #![deny(non_snake_case)] + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-non-snake-case-functions.rs b/src/test/ui/compile-fail-migration/lint-non-snake-case-functions.rs index 6cfdc6ad90b..6cfdc6ad90b 100644 --- a/src/test/compile-fail/lint-non-snake-case-functions.rs +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-functions.rs diff --git a/src/test/ui/compile-fail-migration/lint-non-snake-case-functions.stderr b/src/test/ui/compile-fail-migration/lint-non-snake-case-functions.stderr new file mode 100644 index 00000000000..f7ac48da901 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-functions.stderr @@ -0,0 +1,62 @@ +error: method `Foo_Method` should have a snake case name such as `foo_method` + --> $DIR/lint-non-snake-case-functions.rs:17:5 + | +LL | fn Foo_Method() {} + | ^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-non-snake-case-functions.rs:11:9 + | +LL | #![deny(non_snake_case)] + | ^^^^^^^^^^^^^^ + +error: method `foo__method` should have a snake case name such as `foo_method` + --> $DIR/lint-non-snake-case-functions.rs:21:5 + | +LL | fn foo__method(&self) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: method `xyZ` should have a snake case name such as `xy_z` + --> $DIR/lint-non-snake-case-functions.rs:24:5 + | +LL | pub fn xyZ(&mut self) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: method `render_HTML` should have a snake case name such as `render_html` + --> $DIR/lint-non-snake-case-functions.rs:27:5 + | +LL | fn render_HTML() {} + | ^^^^^^^^^^^^^^^^^^^ + +error: trait method `ABC` should have a snake case name such as `abc` + --> $DIR/lint-non-snake-case-functions.rs:32:5 + | +LL | fn ABC(); + | ^^^^^^^^^ + +error: trait method `a_b_C` should have a snake case name such as `a_b_c` + --> $DIR/lint-non-snake-case-functions.rs:35:5 + | +LL | fn a_b_C(&self) {} + | ^^^^^^^^^^^^^^^^^^ + +error: trait method `something__else` should have a snake case name such as `something_else` + --> $DIR/lint-non-snake-case-functions.rs:38:5 + | +LL | fn something__else(&mut self); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: function `Cookie` should have a snake case name such as `cookie` + --> $DIR/lint-non-snake-case-functions.rs:48:1 + | +LL | fn Cookie() {} + | ^^^^^^^^^^^^^^ + +error: function `bi_S_Cuit` should have a snake case name such as `bi_s_cuit` + --> $DIR/lint-non-snake-case-functions.rs:51:1 + | +LL | pub fn bi_S_Cuit() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 9 previous errors + diff --git a/src/test/compile-fail/lint-non-snake-case-lifetimes.rs b/src/test/ui/compile-fail-migration/lint-non-snake-case-lifetimes.rs index 64669d90d06..64669d90d06 100644 --- a/src/test/compile-fail/lint-non-snake-case-lifetimes.rs +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-lifetimes.rs diff --git a/src/test/ui/compile-fail-migration/lint-non-snake-case-lifetimes.stderr b/src/test/ui/compile-fail-migration/lint-non-snake-case-lifetimes.stderr new file mode 100644 index 00000000000..dc9b5b8cd75 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-lifetimes.stderr @@ -0,0 +1,14 @@ +error: lifetime `'FooBar` should have a snake case name such as `'foo_bar` + --> $DIR/lint-non-snake-case-lifetimes.rs:14:6 + | +LL | fn f<'FooBar>( //~ ERROR lifetime `'FooBar` should have a snake case name such as `'foo_bar` + | ^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-non-snake-case-lifetimes.rs:11:9 + | +LL | #![deny(non_snake_case)] + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-non-snake-case-modules.rs b/src/test/ui/compile-fail-migration/lint-non-snake-case-modules.rs index 5bc84698ec9..5bc84698ec9 100644 --- a/src/test/compile-fail/lint-non-snake-case-modules.rs +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-modules.rs diff --git a/src/test/ui/compile-fail-migration/lint-non-snake-case-modules.stderr b/src/test/ui/compile-fail-migration/lint-non-snake-case-modules.stderr new file mode 100644 index 00000000000..d55d80f31b5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-non-snake-case-modules.stderr @@ -0,0 +1,16 @@ +error: module `FooBar` should have a snake case name such as `foo_bar` + --> $DIR/lint-non-snake-case-modules.rs:14:1 + | +LL | / mod FooBar { //~ ERROR module `FooBar` should have a snake case name such as `foo_bar` +LL | | pub struct S; +LL | | } + | |_^ + | +note: lint level defined here + --> $DIR/lint-non-snake-case-modules.rs:11:9 + | +LL | #![deny(non_snake_case)] + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-non-uppercase-statics.rs b/src/test/ui/compile-fail-migration/lint-non-uppercase-statics.rs index 84cc24a0010..84cc24a0010 100644 --- a/src/test/compile-fail/lint-non-uppercase-statics.rs +++ b/src/test/ui/compile-fail-migration/lint-non-uppercase-statics.rs diff --git a/src/test/ui/compile-fail-migration/lint-non-uppercase-statics.stderr b/src/test/ui/compile-fail-migration/lint-non-uppercase-statics.stderr new file mode 100644 index 00000000000..0d56c577734 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-non-uppercase-statics.stderr @@ -0,0 +1,20 @@ +error: static variable `foo` should have an upper case name such as `FOO` + --> $DIR/lint-non-uppercase-statics.rs:14:1 + | +LL | static foo: isize = 1; //~ ERROR static variable `foo` should have an upper case name such as `FOO` + | ^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-non-uppercase-statics.rs:11:11 + | +LL | #![forbid(non_upper_case_globals)] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: static variable `bar` should have an upper case name such as `BAR` + --> $DIR/lint-non-uppercase-statics.rs:16:1 + | +LL | static mut bar: isize = 1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lint-obsolete-attr.rs b/src/test/ui/compile-fail-migration/lint-obsolete-attr.rs index b234f08d04a..b234f08d04a 100644 --- a/src/test/compile-fail/lint-obsolete-attr.rs +++ b/src/test/ui/compile-fail-migration/lint-obsolete-attr.rs diff --git a/src/test/ui/compile-fail-migration/lint-obsolete-attr.stderr b/src/test/ui/compile-fail-migration/lint-obsolete-attr.stderr new file mode 100644 index 00000000000..4a8a55e260e --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-obsolete-attr.stderr @@ -0,0 +1,20 @@ +error: unused attribute + --> $DIR/lint-obsolete-attr.rs:18:1 + | +LL | #[ab_isize="stdcall"] extern {} //~ ERROR unused attribute + | ^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-obsolete-attr.rs:14:9 + | +LL | #![deny(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + +error: unused attribute + --> $DIR/lint-obsolete-attr.rs:20:1 + | +LL | #[fixed_stack_segment] fn f() {} //~ ERROR unused attribute + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lint-output-format.rs b/src/test/ui/compile-fail-migration/lint-output-format.rs index 81e0b708b87..81e0b708b87 100644 --- a/src/test/compile-fail/lint-output-format.rs +++ b/src/test/ui/compile-fail-migration/lint-output-format.rs diff --git a/src/test/ui/compile-fail-migration/lint-output-format.stderr b/src/test/ui/compile-fail-migration/lint-output-format.stderr new file mode 100644 index 00000000000..bcc279929c6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-output-format.stderr @@ -0,0 +1,27 @@ +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-output-format.rs:16:1 + | +LL | extern crate lint_output_format; //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-output-format.rs:17:31 + | +LL | use lint_output_format::{foo, bar}; //~ ERROR use of unstable library feature + | ^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-output-format.rs:21:14 + | +LL | let _y = bar(); //~ ERROR use of unstable library feature + | ^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/lint-owned-heap-memory.rs b/src/test/ui/compile-fail-migration/lint-owned-heap-memory.rs index 9c68da8beaf..9c68da8beaf 100644 --- a/src/test/compile-fail/lint-owned-heap-memory.rs +++ b/src/test/ui/compile-fail-migration/lint-owned-heap-memory.rs diff --git a/src/test/ui/compile-fail-migration/lint-owned-heap-memory.stderr b/src/test/ui/compile-fail-migration/lint-owned-heap-memory.stderr new file mode 100644 index 00000000000..5b61d30fd39 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-owned-heap-memory.stderr @@ -0,0 +1,20 @@ +error: type uses owned (Box type) pointers: std::boxed::Box<isize> + --> $DIR/lint-owned-heap-memory.rs:16:5 + | +LL | x: Box<isize> //~ ERROR type uses owned + | ^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-owned-heap-memory.rs:12:11 + | +LL | #![forbid(box_pointers)] + | ^^^^^^^^^^^^ + +error: type uses owned (Box type) pointers: std::boxed::Box<isize> + --> $DIR/lint-owned-heap-memory.rs:20:29 + | +LL | let _x : Foo = Foo {x : box 10}; + | ^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lint-qualification.rs b/src/test/ui/compile-fail-migration/lint-qualification.rs index 57c2166565f..57c2166565f 100644 --- a/src/test/compile-fail/lint-qualification.rs +++ b/src/test/ui/compile-fail-migration/lint-qualification.rs diff --git a/src/test/ui/compile-fail-migration/lint-qualification.stderr b/src/test/ui/compile-fail-migration/lint-qualification.stderr new file mode 100644 index 00000000000..f4c8186caf7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-qualification.stderr @@ -0,0 +1,14 @@ +error: unnecessary qualification + --> $DIR/lint-qualification.rs:19:5 + | +LL | foo::bar(); //~ ERROR: unnecessary qualification + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-qualification.rs:11:9 + | +LL | #![deny(unused_qualifications)] + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-removed-allow.rs b/src/test/ui/compile-fail-migration/lint-removed-allow.rs index 9f84190ea18..9f84190ea18 100644 --- a/src/test/compile-fail/lint-removed-allow.rs +++ b/src/test/ui/compile-fail-migration/lint-removed-allow.rs diff --git a/src/test/ui/compile-fail-migration/lint-removed-allow.stderr b/src/test/ui/compile-fail-migration/lint-removed-allow.stderr new file mode 100644 index 00000000000..8f4c757e54b --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-removed-allow.stderr @@ -0,0 +1,14 @@ +error: unused variable: `unused` + --> $DIR/lint-removed-allow.rs:18:17 + | +LL | fn main() { let unused = (); } //~ ERROR unused + | ^^^^^^ help: consider using `_unused` instead + | +note: lint level defined here + --> $DIR/lint-removed-allow.rs:17:8 + | +LL | #[deny(unused_variables)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-removed-cmdline.rs b/src/test/ui/compile-fail-migration/lint-removed-cmdline.rs index 09725b20146..09725b20146 100644 --- a/src/test/compile-fail/lint-removed-cmdline.rs +++ b/src/test/ui/compile-fail-migration/lint-removed-cmdline.rs diff --git a/src/test/ui/compile-fail-migration/lint-removed-cmdline.stderr b/src/test/ui/compile-fail-migration/lint-removed-cmdline.stderr new file mode 100644 index 00000000000..86faeec9542 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-removed-cmdline.stderr @@ -0,0 +1,19 @@ +warning: lint `raw_pointer_derive` has been removed: `using derive with raw pointers is ok` + | + = note: requested on the command line with `-D raw_pointer_derive` + +error: unused variable: `unused` + --> $DIR/lint-removed-cmdline.rs:22:17 + | +LL | fn main() { let unused = (); } + | ^^^^^^ help: consider using `_unused` instead + | +note: lint level defined here + --> $DIR/lint-removed-cmdline.rs:21:8 + | +LL | #[deny(warnings)] + | ^^^^^^^^ + = note: #[deny(unused_variables)] implied by #[deny(warnings)] + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-removed.rs b/src/test/ui/compile-fail-migration/lint-removed.rs index 4e53852008f..4e53852008f 100644 --- a/src/test/compile-fail/lint-removed.rs +++ b/src/test/ui/compile-fail-migration/lint-removed.rs diff --git a/src/test/ui/compile-fail-migration/lint-removed.stderr b/src/test/ui/compile-fail-migration/lint-removed.stderr new file mode 100644 index 00000000000..7d66186f349 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-removed.stderr @@ -0,0 +1,22 @@ +warning: lint `raw_pointer_derive` has been removed: `using derive with raw pointers is ok` + --> $DIR/lint-removed.rs:16:8 + | +LL | #[deny(raw_pointer_derive)] //~ WARN `raw_pointer_derive` has been removed + | ^^^^^^^^^^^^^^^^^^ + | + = note: #[warn(renamed_and_removed_lints)] on by default + +error: unused variable: `unused` + --> $DIR/lint-removed.rs:18:17 + | +LL | fn main() { let unused = (); } //~ ERROR unused + | ^^^^^^ help: consider using `_unused` instead + | +note: lint level defined here + --> $DIR/lint-removed.rs:17:8 + | +LL | #[deny(unused_variables)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-renamed-allow.rs b/src/test/ui/compile-fail-migration/lint-renamed-allow.rs index f6b94e89826..f6b94e89826 100644 --- a/src/test/compile-fail/lint-renamed-allow.rs +++ b/src/test/ui/compile-fail-migration/lint-renamed-allow.rs diff --git a/src/test/ui/compile-fail-migration/lint-renamed-allow.stderr b/src/test/ui/compile-fail-migration/lint-renamed-allow.stderr new file mode 100644 index 00000000000..6b2eb272701 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-renamed-allow.stderr @@ -0,0 +1,15 @@ +error: unused variable: `unused` + --> $DIR/lint-renamed-allow.rs:18:17 + | +LL | fn main() { let unused = (); } //~ ERROR unused + | ^^^^^^ help: consider using `_unused` instead + | +note: lint level defined here + --> $DIR/lint-renamed-allow.rs:17:8 + | +LL | #[deny(unused)] + | ^^^^^^ + = note: #[deny(unused_variables)] implied by #[deny(unused)] + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-renamed-cmdline.rs b/src/test/ui/compile-fail-migration/lint-renamed-cmdline.rs index f5abf2733b9..f5abf2733b9 100644 --- a/src/test/compile-fail/lint-renamed-cmdline.rs +++ b/src/test/ui/compile-fail-migration/lint-renamed-cmdline.rs diff --git a/src/test/ui/compile-fail-migration/lint-renamed-cmdline.stderr b/src/test/ui/compile-fail-migration/lint-renamed-cmdline.stderr new file mode 100644 index 00000000000..5e154a0033d --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-renamed-cmdline.stderr @@ -0,0 +1,19 @@ +warning: lint `bare_trait_object` has been renamed to `bare_trait_objects` + | + = note: requested on the command line with `-D bare_trait_object` + +error: unused variable: `unused` + --> $DIR/lint-renamed-cmdline.rs:18:17 + | +LL | fn main() { let unused = (); } + | ^^^^^^ help: consider using `_unused` instead + | +note: lint level defined here + --> $DIR/lint-renamed-cmdline.rs:17:8 + | +LL | #[deny(unused)] + | ^^^^^^ + = note: #[deny(unused_variables)] implied by #[deny(unused)] + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-renamed.rs b/src/test/ui/compile-fail-migration/lint-renamed.rs index c147ec5cf95..c147ec5cf95 100644 --- a/src/test/compile-fail/lint-renamed.rs +++ b/src/test/ui/compile-fail-migration/lint-renamed.rs diff --git a/src/test/ui/compile-fail-migration/lint-renamed.stderr b/src/test/ui/compile-fail-migration/lint-renamed.stderr new file mode 100644 index 00000000000..a87efc9e92c --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-renamed.stderr @@ -0,0 +1,23 @@ +warning: lint `bare_trait_object` has been renamed to `bare_trait_objects` + --> $DIR/lint-renamed.rs:11:8 + | +LL | #[deny(bare_trait_object)] + | ^^^^^^^^^^^^^^^^^ help: use the new name: `bare_trait_objects` + | + = note: #[warn(renamed_and_removed_lints)] on by default + +error: unused variable: `unused` + --> $DIR/lint-renamed.rs:14:17 + | +LL | fn main() { let unused = (); } //~ ERROR unused + | ^^^^^^ help: consider using `_unused` instead + | +note: lint level defined here + --> $DIR/lint-renamed.rs:13:8 + | +LL | #[deny(unused)] + | ^^^^^^ + = note: #[deny(unused_variables)] implied by #[deny(unused)] + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-shorthand-field.rs b/src/test/ui/compile-fail-migration/lint-shorthand-field.rs index 97a976a493f..97a976a493f 100644 --- a/src/test/compile-fail/lint-shorthand-field.rs +++ b/src/test/ui/compile-fail-migration/lint-shorthand-field.rs diff --git a/src/test/ui/compile-fail-migration/lint-shorthand-field.stderr b/src/test/ui/compile-fail-migration/lint-shorthand-field.stderr new file mode 100644 index 00000000000..516be532f5d --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-shorthand-field.stderr @@ -0,0 +1,24 @@ +error: the `x:` in this pattern is redundant + --> $DIR/lint-shorthand-field.rs:22:13 + | +LL | x: x, //~ ERROR the `x:` in this pattern is redundant + | --^^ + | | + | help: remove this + | +note: lint level defined here + --> $DIR/lint-shorthand-field.rs:12:9 + | +LL | #![deny(non_shorthand_field_patterns)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: the `y:` in this pattern is redundant + --> $DIR/lint-shorthand-field.rs:23:13 + | +LL | y: ref y, //~ ERROR the `y:` in this pattern is redundant + | --^^^^^^ + | | + | help: remove this + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lint-stability-2.rs b/src/test/ui/compile-fail-migration/lint-stability-2.rs index 1f2fa077caf..1f2fa077caf 100644 --- a/src/test/compile-fail/lint-stability-2.rs +++ b/src/test/ui/compile-fail-migration/lint-stability-2.rs diff --git a/src/test/ui/compile-fail-migration/lint-stability-2.stderr b/src/test/ui/compile-fail-migration/lint-stability-2.stderr new file mode 100644 index 00000000000..e87e0514433 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-stability-2.stderr @@ -0,0 +1,259 @@ +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:50:13 + | +LL | foo.method_deprecated_unstable(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:52:9 + | +LL | Foo::method_deprecated_unstable(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:54:9 + | +LL | <Foo>::method_deprecated_unstable(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:56:13 + | +LL | foo.trait_deprecated_unstable(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:58:9 + | +LL | <Foo>::trait_deprecated_unstable(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:61:13 + | +LL | foo.method_deprecated_unstable_text(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:63:9 + | +LL | Foo::method_deprecated_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:65:9 + | +LL | <Foo>::method_deprecated_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:67:13 + | +LL | foo.trait_deprecated_unstable_text(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:69:9 + | +LL | <Foo>::trait_deprecated_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:72:13 + | +LL | foo.method_unstable(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:73:9 + | +LL | Foo::method_unstable(&foo); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:74:9 + | +LL | <Foo>::method_unstable(&foo); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:75:13 + | +LL | foo.trait_unstable(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:76:9 + | +LL | <Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability-2.rs:78:13 + | +LL | foo.method_unstable_text(); + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability-2.rs:80:9 + | +LL | Foo::method_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability-2.rs:82:9 + | +LL | <Foo>::method_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability-2.rs:84:13 + | +LL | foo.trait_unstable_text(); + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability-2.rs:86:9 + | +LL | <Foo>::trait_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:141:13 + | +LL | foo.trait_deprecated_unstable(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:143:9 + | +LL | <Foo>::trait_deprecated_unstable(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:145:13 + | +LL | foo.trait_deprecated_unstable_text(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:147:9 + | +LL | <Foo>::trait_deprecated_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:149:13 + | +LL | foo.trait_unstable(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:150:9 + | +LL | <Foo>::trait_unstable(&foo); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability-2.rs:151:13 + | +LL | foo.trait_unstable_text(); + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability-2.rs:153:9 + | +LL | <Foo>::trait_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:164:13 + | +LL | foo.trait_deprecated_unstable(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:166:13 + | +LL | foo.trait_deprecated_unstable_text(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-2.rs:168:13 + | +LL | foo.trait_unstable(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability-2.rs:169:13 + | +LL | foo.trait_unstable_text(); + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error: aborting due to 32 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/lint-stability-deprecated.rs b/src/test/ui/compile-fail-migration/lint-stability-deprecated.rs index de2c27bdcbc..de2c27bdcbc 100644 --- a/src/test/compile-fail/lint-stability-deprecated.rs +++ b/src/test/ui/compile-fail-migration/lint-stability-deprecated.rs diff --git a/src/test/ui/compile-fail-migration/lint-stability-deprecated.stderr b/src/test/ui/compile-fail-migration/lint-stability-deprecated.stderr new file mode 100644 index 00000000000..afebb4f36a4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-stability-deprecated.stderr @@ -0,0 +1,644 @@ +warning: use of deprecated item 'lint_stability::deprecated': text + --> $DIR/lint-stability-deprecated.rs:36:9 + | +LL | deprecated(); //~ WARN use of deprecated item 'lint_stability::deprecated' + | ^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-stability-deprecated.rs:17:9 + | +LL | #![warn(deprecated)] + | ^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:41:9 + | +LL | Trait::trait_deprecated(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:43:9 + | +LL | <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:45:9 + | +LL | deprecated_text(); //~ WARN use of deprecated item 'lint_stability::deprecated_text': text + | ^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:50:9 + | +LL | Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:52:9 + | +LL | <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:54:9 + | +LL | deprecated_unstable(); //~ WARN use of deprecated item 'lint_stability::deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:59:9 + | +LL | Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:61:9 + | +LL | <Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:63:9 + | +LL | deprecated_unstable_text(); //~ WARN use of deprecated item 'lint_stability::deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:68:9 + | +LL | Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:70:9 + | +LL | <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedStruct': text + --> $DIR/lint-stability-deprecated.rs:117:17 + | +LL | let _ = DeprecatedStruct { //~ WARN use of deprecated item 'lint_stability::DeprecatedStruct' + | ^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedUnstableStruct': text + --> $DIR/lint-stability-deprecated.rs:120:17 + | +LL | let _ = DeprecatedUnstableStruct { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedUnitStruct': text + --> $DIR/lint-stability-deprecated.rs:127:17 + | +LL | let _ = DeprecatedUnitStruct; //~ WARN use of deprecated item 'lint_stability::DeprecatedUnitStruct' + | ^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedUnstableUnitStruct': text + --> $DIR/lint-stability-deprecated.rs:128:17 + | +LL | let _ = DeprecatedUnstableUnitStruct; //~ WARN use of deprecated item 'lint_stability::DeprecatedUnstableUnitStruct' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Enum::DeprecatedVariant': text + --> $DIR/lint-stability-deprecated.rs:132:17 + | +LL | let _ = Enum::DeprecatedVariant; //~ WARN use of deprecated item 'lint_stability::Enum::DeprecatedVariant' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Enum::DeprecatedUnstableVariant': text + --> $DIR/lint-stability-deprecated.rs:133:17 + | +LL | let _ = Enum::DeprecatedUnstableVariant; //~ WARN use of deprecated item 'lint_stability::Enum::DeprecatedUnstableVariant' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedTupleStruct': text + --> $DIR/lint-stability-deprecated.rs:137:17 + | +LL | let _ = DeprecatedTupleStruct (1); //~ WARN use of deprecated item 'lint_stability::DeprecatedTupleStruct' + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedUnstableTupleStruct': text + --> $DIR/lint-stability-deprecated.rs:138:17 + | +LL | let _ = DeprecatedUnstableTupleStruct (1); //~ WARN use of deprecated item 'lint_stability::DeprecatedUnstableTupleStruct' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:147:25 + | +LL | macro_test_arg!(deprecated_text()); //~ WARN use of deprecated item 'lint_stability::deprecated_text': text + | ^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:148:25 + | +LL | macro_test_arg!(deprecated_unstable_text()); //~ WARN use of deprecated item 'lint_stability::deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:149:41 + | +LL | macro_test_arg!(macro_test_arg!(deprecated_text())); //~ WARN use of deprecated item 'lint_stability::deprecated_text': text + | ^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:154:9 + | +LL | Trait::trait_deprecated(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:156:9 + | +LL | <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:158:9 + | +LL | Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:160:9 + | +LL | <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:162:9 + | +LL | Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:164:9 + | +LL | <Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:166:9 + | +LL | Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:168:9 + | +LL | <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedTrait': text + --> $DIR/lint-stability-deprecated.rs:196:10 + | +LL | impl DeprecatedTrait for S {} //~ WARN use of deprecated item 'lint_stability::DeprecatedTrait': text + | ^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedTrait': text + --> $DIR/lint-stability-deprecated.rs:198:25 + | +LL | trait LocalTrait2 : DeprecatedTrait { } //~ WARN use of deprecated item 'lint_stability::DeprecatedTrait': text + | ^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'inheritance::inherited_stability::unstable_mod::deprecated': text + --> $DIR/lint-stability-deprecated.rs:217:9 + | +LL | unstable_mod::deprecated(); //~ WARN use of deprecated item 'inheritance::inherited_stability::unstable_mod::deprecated': text + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::deprecated': text + --> $DIR/lint-stability-deprecated.rs:339:9 + | +LL | deprecated(); //~ WARN use of deprecated item 'this_crate::deprecated' + | ^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:344:9 + | +LL | Trait::trait_deprecated(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:346:9 + | +LL | <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:348:9 + | +LL | deprecated_text(); //~ WARN use of deprecated item 'this_crate::deprecated_text': text + | ^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:353:9 + | +LL | Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:355:9 + | +LL | <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::DeprecatedStruct': text + --> $DIR/lint-stability-deprecated.rs:393:17 + | +LL | let _ = DeprecatedStruct { + | ^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::DeprecatedUnitStruct': text + --> $DIR/lint-stability-deprecated.rs:400:17 + | +LL | let _ = DeprecatedUnitStruct; //~ WARN use of deprecated item 'this_crate::DeprecatedUnitStruct' + | ^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Enum::DeprecatedVariant': text + --> $DIR/lint-stability-deprecated.rs:404:17 + | +LL | let _ = Enum::DeprecatedVariant; //~ WARN use of deprecated item 'this_crate::Enum::DeprecatedVariant' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::DeprecatedTupleStruct': text + --> $DIR/lint-stability-deprecated.rs:408:17 + | +LL | let _ = DeprecatedTupleStruct (1); //~ WARN use of deprecated item 'this_crate::DeprecatedTupleStruct' + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:415:9 + | +LL | Trait::trait_deprecated(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:417:9 + | +LL | <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:419:9 + | +LL | Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:421:9 + | +LL | <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::test_fn_body::fn_in_body': text + --> $DIR/lint-stability-deprecated.rs:448:9 + | +LL | fn_in_body(); //~ WARN use of deprecated item 'this_crate::test_fn_body::fn_in_body': text + | ^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::DeprecatedTrait': text + --> $DIR/lint-stability-deprecated.rs:468:10 + | +LL | impl DeprecatedTrait for S { } //~ WARN use of deprecated item 'this_crate::DeprecatedTrait' + | ^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::DeprecatedTrait': text + --> $DIR/lint-stability-deprecated.rs:470:24 + | +LL | trait LocalTrait : DeprecatedTrait { } //~ WARN use of deprecated item 'this_crate::DeprecatedTrait' + | ^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::MethodTester::test_method_body::fn_in_body': text + --> $DIR/lint-stability-deprecated.rs:456:13 + | +LL | fn_in_body(); //~ WARN use of deprecated item 'this_crate::MethodTester::test_method_body::fn_in_body': text + | ^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::TraitWithAssociatedTypes::TypeDeprecated': text + --> $DIR/lint-stability-deprecated.rs:109:48 + | +LL | struct S2<T: TraitWithAssociatedTypes>(T::TypeDeprecated); + | ^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::TraitWithAssociatedTypes::TypeDeprecated': text + --> $DIR/lint-stability-deprecated.rs:113:13 + | +LL | TypeDeprecated = u16, + | ^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated': text + --> $DIR/lint-stability-deprecated.rs:37:13 + | +LL | foo.method_deprecated(); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated': text + --> $DIR/lint-stability-deprecated.rs:38:9 + | +LL | Foo::method_deprecated(&foo); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated': text + --> $DIR/lint-stability-deprecated.rs:39:9 + | +LL | <Foo>::method_deprecated(&foo); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:40:13 + | +LL | foo.trait_deprecated(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:42:9 + | +LL | <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:46:13 + | +LL | foo.method_deprecated_text(); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:47:9 + | +LL | Foo::method_deprecated_text(&foo); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:48:9 + | +LL | <Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:49:13 + | +LL | foo.trait_deprecated_text(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:51:9 + | +LL | <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:55:13 + | +LL | foo.method_deprecated_unstable(); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:56:9 + | +LL | Foo::method_deprecated_unstable(&foo); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:57:9 + | +LL | <Foo>::method_deprecated_unstable(&foo); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:58:13 + | +LL | foo.trait_deprecated_unstable(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:60:9 + | +LL | <Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:64:13 + | +LL | foo.method_deprecated_unstable_text(); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:65:9 + | +LL | Foo::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:66:9 + | +LL | <Foo>::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated item 'lint_stability::MethodTester::method_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:67:13 + | +LL | foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:69:9 + | +LL | <Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedStruct::i': text + --> $DIR/lint-stability-deprecated.rs:118:13 + | +LL | i: 0 //~ WARN use of deprecated item 'lint_stability::DeprecatedStruct::i' + | ^^^^ + +warning: use of deprecated item 'lint_stability::DeprecatedUnstableStruct::i': text + --> $DIR/lint-stability-deprecated.rs:122:13 + | +LL | i: 0 //~ WARN use of deprecated item 'lint_stability::DeprecatedUnstableStruct::i' + | ^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:153:13 + | +LL | foo.trait_deprecated(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:155:9 + | +LL | <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:157:13 + | +LL | foo.trait_deprecated_text(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:159:9 + | +LL | <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:161:13 + | +LL | foo.trait_deprecated_unstable(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:163:9 + | +LL | <Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:165:13 + | +LL | foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:167:9 + | +LL | <Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:184:13 + | +LL | foo.trait_deprecated(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:185:13 + | +LL | foo.trait_deprecated_text(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable': text + --> $DIR/lint-stability-deprecated.rs:186:13 + | +LL | foo.trait_deprecated_unstable(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable' + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + --> $DIR/lint-stability-deprecated.rs:187:13 + | +LL | foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated item 'lint_stability::Trait::trait_deprecated_unstable_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::MethodTester::method_deprecated': text + --> $DIR/lint-stability-deprecated.rs:340:13 + | +LL | foo.method_deprecated(); //~ WARN use of deprecated item 'this_crate::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::MethodTester::method_deprecated': text + --> $DIR/lint-stability-deprecated.rs:341:9 + | +LL | Foo::method_deprecated(&foo); //~ WARN use of deprecated item 'this_crate::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::MethodTester::method_deprecated': text + --> $DIR/lint-stability-deprecated.rs:342:9 + | +LL | <Foo>::method_deprecated(&foo); //~ WARN use of deprecated item 'this_crate::MethodTester::method_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:343:13 + | +LL | foo.trait_deprecated(); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:345:9 + | +LL | <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:349:13 + | +LL | foo.method_deprecated_text(); //~ WARN use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:350:9 + | +LL | Foo::method_deprecated_text(&foo); //~ WARN use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:351:9 + | +LL | <Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated item 'this_crate::MethodTester::method_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:352:13 + | +LL | foo.trait_deprecated_text(); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:354:9 + | +LL | <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::DeprecatedStruct::i': text + --> $DIR/lint-stability-deprecated.rs:395:13 + | +LL | i: 0 //~ WARN use of deprecated item 'this_crate::DeprecatedStruct::i' + | ^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:414:13 + | +LL | foo.trait_deprecated(); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:416:9 + | +LL | <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:418:13 + | +LL | foo.trait_deprecated_text(); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:420:9 + | +LL | <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated': text + --> $DIR/lint-stability-deprecated.rs:437:13 + | +LL | foo.trait_deprecated(); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated' + | ^^^^^^^^^^^^^^^^ + +warning: use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + --> $DIR/lint-stability-deprecated.rs:438:13 + | +LL | foo.trait_deprecated_text(); //~ WARN use of deprecated item 'this_crate::Trait::trait_deprecated_text': text + | ^^^^^^^^^^^^^^^^^^^^^ + +error: compilation successful + --> $DIR/lint-stability-deprecated.rs:473:16 + | +LL | #[rustc_error] fn main() {} //~ ERROR: compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-stability-fields-deprecated.rs b/src/test/ui/compile-fail-migration/lint-stability-fields-deprecated.rs index 0ad4466d0e2..0ad4466d0e2 100644 --- a/src/test/compile-fail/lint-stability-fields-deprecated.rs +++ b/src/test/ui/compile-fail-migration/lint-stability-fields-deprecated.rs diff --git a/src/test/ui/compile-fail-migration/lint-stability-fields-deprecated.stderr b/src/test/ui/compile-fail-migration/lint-stability-fields-deprecated.stderr new file mode 100644 index 00000000000..f7bc87ee9d9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-stability-fields-deprecated.stderr @@ -0,0 +1,380 @@ +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated': text + --> $DIR/lint-stability-fields-deprecated.rs:104:17 + | +LL | let x = Deprecated { + | ^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-stability-fields-deprecated.rs:13:9 + | +LL | #![deny(deprecated)] + | ^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated': text + --> $DIR/lint-stability-fields-deprecated.rs:121:13 + | +LL | let Deprecated { + | ^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated': text + --> $DIR/lint-stability-fields-deprecated.rs:131:13 + | +LL | let Deprecated + | ^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated2': text + --> $DIR/lint-stability-fields-deprecated.rs:136:17 + | +LL | let x = Deprecated2(1, 2, 3); + | ^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated2': text + --> $DIR/lint-stability-fields-deprecated.rs:146:13 + | +LL | let Deprecated2 + | ^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated2': text + --> $DIR/lint-stability-fields-deprecated.rs:155:13 + | +LL | let Deprecated2 + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated': text + --> $DIR/lint-stability-fields-deprecated.rs:291:17 + | +LL | let x = Deprecated { + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated': text + --> $DIR/lint-stability-fields-deprecated.rs:308:13 + | +LL | let Deprecated { + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated': text + --> $DIR/lint-stability-fields-deprecated.rs:318:13 + | +LL | let Deprecated + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated2': text + --> $DIR/lint-stability-fields-deprecated.rs:323:17 + | +LL | let x = Deprecated2(1, 2, 3); + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated2': text + --> $DIR/lint-stability-fields-deprecated.rs:333:13 + | +LL | let Deprecated2 + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated2': text + --> $DIR/lint-stability-fields-deprecated.rs:342:13 + | +LL | let Deprecated2 + | ^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Stable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:28:13 + | +LL | override2: 3, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Stable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:34:17 + | +LL | let _ = x.override2; + | ^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Stable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:40:13 + | +LL | override2: _ + | ^^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Stable2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:50:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Stable2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:55:20 + | +LL | _) + | ^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Unstable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:65:13 + | +LL | override2: 3, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Unstable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:71:17 + | +LL | let _ = x.override2; + | ^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Unstable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:77:13 + | +LL | override2: _ + | ^^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Unstable2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:90:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Unstable2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:96:14 + | +LL | _) + | ^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated::inherit': text + --> $DIR/lint-stability-fields-deprecated.rs:106:13 + | +LL | inherit: 1, + | ^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated::override1': text + --> $DIR/lint-stability-fields-deprecated.rs:108:13 + | +LL | override1: 2, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:110:13 + | +LL | override2: 3, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated::inherit': text + --> $DIR/lint-stability-fields-deprecated.rs:114:17 + | +LL | let _ = x.inherit; + | ^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated::override1': text + --> $DIR/lint-stability-fields-deprecated.rs:116:17 + | +LL | let _ = x.override1; + | ^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:118:17 + | +LL | let _ = x.override2; + | ^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated::inherit': text + --> $DIR/lint-stability-fields-deprecated.rs:123:13 + | +LL | inherit: _, + | ^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated::override1': text + --> $DIR/lint-stability-fields-deprecated.rs:125:13 + | +LL | override1: _, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:127:13 + | +LL | override2: _ + | ^^^^^^^^^^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated2::0': text + --> $DIR/lint-stability-fields-deprecated.rs:139:17 + | +LL | let _ = x.0; + | ^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated2::1': text + --> $DIR/lint-stability-fields-deprecated.rs:141:17 + | +LL | let _ = x.1; + | ^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:143:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated2::0': text + --> $DIR/lint-stability-fields-deprecated.rs:148:14 + | +LL | (_, + | ^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated2::1': text + --> $DIR/lint-stability-fields-deprecated.rs:150:14 + | +LL | _, + | ^ + +error: use of deprecated item 'cross_crate::lint_stability_fields::Deprecated2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:152:14 + | +LL | _) + | ^ + +error: use of deprecated item 'this_crate::Stable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:215:13 + | +LL | override2: 3, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Stable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:221:17 + | +LL | let _ = x.override2; + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Stable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:227:13 + | +LL | override2: _ + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Stable2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:237:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'this_crate::Stable2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:242:20 + | +LL | _) + | ^ + +error: use of deprecated item 'this_crate::Unstable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:252:13 + | +LL | override2: 3, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Unstable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:258:17 + | +LL | let _ = x.override2; + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Unstable::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:264:13 + | +LL | override2: _ + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Unstable2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:277:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'this_crate::Unstable2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:283:14 + | +LL | _) + | ^ + +error: use of deprecated item 'this_crate::Deprecated::inherit': text + --> $DIR/lint-stability-fields-deprecated.rs:293:13 + | +LL | inherit: 1, + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated::override1': text + --> $DIR/lint-stability-fields-deprecated.rs:295:13 + | +LL | override1: 2, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:297:13 + | +LL | override2: 3, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated::inherit': text + --> $DIR/lint-stability-fields-deprecated.rs:301:17 + | +LL | let _ = x.inherit; + | ^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated::override1': text + --> $DIR/lint-stability-fields-deprecated.rs:303:17 + | +LL | let _ = x.override1; + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:305:17 + | +LL | let _ = x.override2; + | ^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated::inherit': text + --> $DIR/lint-stability-fields-deprecated.rs:310:13 + | +LL | inherit: _, + | ^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated::override1': text + --> $DIR/lint-stability-fields-deprecated.rs:312:13 + | +LL | override1: _, + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated::override2': text + --> $DIR/lint-stability-fields-deprecated.rs:314:13 + | +LL | override2: _ + | ^^^^^^^^^^^^ + +error: use of deprecated item 'this_crate::Deprecated2::0': text + --> $DIR/lint-stability-fields-deprecated.rs:326:17 + | +LL | let _ = x.0; + | ^^^ + +error: use of deprecated item 'this_crate::Deprecated2::1': text + --> $DIR/lint-stability-fields-deprecated.rs:328:17 + | +LL | let _ = x.1; + | ^^^ + +error: use of deprecated item 'this_crate::Deprecated2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:330:17 + | +LL | let _ = x.2; + | ^^^ + +error: use of deprecated item 'this_crate::Deprecated2::0': text + --> $DIR/lint-stability-fields-deprecated.rs:335:14 + | +LL | (_, + | ^ + +error: use of deprecated item 'this_crate::Deprecated2::1': text + --> $DIR/lint-stability-fields-deprecated.rs:337:14 + | +LL | _, + | ^ + +error: use of deprecated item 'this_crate::Deprecated2::2': text + --> $DIR/lint-stability-fields-deprecated.rs:339:14 + | +LL | _) + | ^ + +error: aborting due to 62 previous errors + diff --git a/src/test/compile-fail/lint-stability-fields.rs b/src/test/ui/compile-fail-migration/lint-stability-fields.rs index db6b64dabfe..db6b64dabfe 100644 --- a/src/test/compile-fail/lint-stability-fields.rs +++ b/src/test/ui/compile-fail-migration/lint-stability-fields.rs diff --git a/src/test/ui/compile-fail-migration/lint-stability-fields.stderr b/src/test/ui/compile-fail-migration/lint-stability-fields.stderr new file mode 100644 index 00000000000..2f176062c30 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-stability-fields.stderr @@ -0,0 +1,347 @@ +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:61:17 + | +LL | let x = Unstable { //~ ERROR use of unstable + | ^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:71:13 + | +LL | let Unstable { //~ ERROR use of unstable + | ^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:77:13 + | +LL | let Unstable //~ ERROR use of unstable + | ^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:82:17 + | +LL | let x = reexport::Unstable2(1, 2, 3); //~ ERROR use of unstable + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:84:17 + | +LL | let x = Unstable2(1, 2, 3); //~ ERROR use of unstable + | ^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:90:13 + | +LL | let Unstable2 //~ ERROR use of unstable + | ^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:95:13 + | +LL | let Unstable2 //~ ERROR use of unstable + | ^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:100:17 + | +LL | let x = Deprecated { //~ ERROR use of unstable + | ^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:110:13 + | +LL | let Deprecated { //~ ERROR use of unstable + | ^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:116:13 + | +LL | let Deprecated //~ ERROR use of unstable + | ^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:120:17 + | +LL | let x = Deprecated2(1, 2, 3); //~ ERROR use of unstable + | ^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:126:13 + | +LL | let Deprecated2 //~ ERROR use of unstable + | ^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:131:13 + | +LL | let Deprecated2 //~ ERROR use of unstable + | ^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:31:13 + | +LL | override1: 2, //~ ERROR use of unstable + | ^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:32:13 + | +LL | override2: 3, //~ ERROR use of unstable + | ^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:36:17 + | +LL | let _ = x.override1; //~ ERROR use of unstable + | ^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:37:17 + | +LL | let _ = x.override2; //~ ERROR use of unstable + | ^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:41:13 + | +LL | override1: _, //~ ERROR use of unstable + | ^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:42:13 + | +LL | override2: _ //~ ERROR use of unstable + | ^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:50:17 + | +LL | let _ = x.1; //~ ERROR use of unstable + | ^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:51:17 + | +LL | let _ = x.2; //~ ERROR use of unstable + | ^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:54:20 + | +LL | _, //~ ERROR use of unstable + | ^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:55:20 + | +LL | _) //~ ERROR use of unstable + | ^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:62:13 + | +LL | inherit: 1, //~ ERROR use of unstable + | ^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:64:13 + | +LL | override2: 3, //~ ERROR use of unstable + | ^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:67:17 + | +LL | let _ = x.inherit; //~ ERROR use of unstable + | ^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:69:17 + | +LL | let _ = x.override2; //~ ERROR use of unstable + | ^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:72:13 + | +LL | inherit: _, //~ ERROR use of unstable + | ^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:74:13 + | +LL | override2: _ //~ ERROR use of unstable + | ^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:86:17 + | +LL | let _ = x.0; //~ ERROR use of unstable + | ^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:88:17 + | +LL | let _ = x.2; //~ ERROR use of unstable + | ^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:91:14 + | +LL | (_, //~ ERROR use of unstable + | ^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:93:14 + | +LL | _) //~ ERROR use of unstable + | ^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:101:13 + | +LL | inherit: 1, //~ ERROR use of unstable + | ^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:103:13 + | +LL | override2: 3, //~ ERROR use of unstable + | ^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:106:17 + | +LL | let _ = x.inherit; //~ ERROR use of unstable + | ^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:108:17 + | +LL | let _ = x.override2; //~ ERROR use of unstable + | ^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:111:13 + | +LL | inherit: _, //~ ERROR use of unstable + | ^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:113:13 + | +LL | override2: _ //~ ERROR use of unstable + | ^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:122:17 + | +LL | let _ = x.0; //~ ERROR use of unstable + | ^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:124:17 + | +LL | let _ = x.2; //~ ERROR use of unstable + | ^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:127:14 + | +LL | (_, //~ ERROR use of unstable + | ^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability-fields.rs:129:14 + | +LL | _) //~ ERROR use of unstable + | ^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error: aborting due to 43 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/lint-stability.rs b/src/test/ui/compile-fail-migration/lint-stability.rs index 720b1235d47..720b1235d47 100644 --- a/src/test/compile-fail/lint-stability.rs +++ b/src/test/ui/compile-fail-migration/lint-stability.rs diff --git a/src/test/ui/compile-fail-migration/lint-stability.stderr b/src/test/ui/compile-fail-migration/lint-stability.stderr new file mode 100644 index 00000000000..893c70f85f1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-stability.stderr @@ -0,0 +1,331 @@ +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:27:5 + | +LL | extern crate stability_cfg2; //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:55:9 + | +LL | deprecated_unstable(); + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:57:9 + | +LL | Trait::trait_deprecated_unstable(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:59:9 + | +LL | <Foo as Trait>::trait_deprecated_unstable(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:62:9 + | +LL | deprecated_unstable_text(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:64:9 + | +LL | Trait::trait_deprecated_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:66:9 + | +LL | <Foo as Trait>::trait_deprecated_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:69:9 + | +LL | unstable(); //~ ERROR use of unstable library feature + | ^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:70:9 + | +LL | Trait::trait_unstable(&foo); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:71:9 + | +LL | <Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability.rs:73:9 + | +LL | unstable_text(); + | ^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability.rs:75:9 + | +LL | Trait::trait_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability.rs:77:9 + | +LL | <Foo as Trait>::trait_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:109:17 + | +LL | let _ = DeprecatedUnstableStruct { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:113:17 + | +LL | let _ = UnstableStruct { i: 0 }; //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:117:17 + | +LL | let _ = DeprecatedUnstableUnitStruct; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:119:17 + | +LL | let _ = UnstableUnitStruct; //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:123:17 + | +LL | let _ = Enum::DeprecatedUnstableVariant; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:125:17 + | +LL | let _ = Enum::UnstableVariant; //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:129:17 + | +LL | let _ = DeprecatedUnstableTupleStruct (1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:131:17 + | +LL | let _ = UnstableTupleStruct (1); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:140:25 + | +LL | macro_test_arg!(deprecated_unstable_text()); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:154:9 + | +LL | Trait::trait_deprecated_unstable(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:156:9 + | +LL | <Foo as Trait>::trait_deprecated_unstable(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:158:9 + | +LL | Trait::trait_deprecated_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:160:9 + | +LL | <Foo as Trait>::trait_deprecated_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:162:9 + | +LL | Trait::trait_unstable(&foo); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:163:9 + | +LL | <Foo as Trait>::trait_unstable(&foo); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability.rs:164:9 + | +LL | Trait::trait_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': text + --> $DIR/lint-stability.rs:166:9 + | +LL | <Foo as Trait>::trait_unstable_text(&foo); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:182:10 + | +LL | impl UnstableTrait for S { } //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:184:24 + | +LL | trait LocalTrait : UnstableTrait { } //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:189:9 + | +LL | fn trait_unstable(&self) {} //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:194:5 + | +LL | extern crate inherited_stability; //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:195:9 + | +LL | use self::inherited_stability::*; //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:198:9 + | +LL | unstable(); //~ ERROR use of unstable library feature + | ^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:201:9 + | +LL | stable_mod::unstable(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:205:9 + | +LL | unstable_mod::unstable(); //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:207:17 + | +LL | let _ = Unstable::UnstableVariant; //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:98:48 + | +LL | struct S1<T: TraitWithAssociatedTypes>(T::TypeUnstable); + | ^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature' + --> $DIR/lint-stability.rs:102:13 + | +LL | TypeUnstable = u8, //~ ERROR use of unstable library feature + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error: aborting due to 41 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/lint-stability2.rs b/src/test/ui/compile-fail-migration/lint-stability2.rs index d2ec00d6495..d2ec00d6495 100644 --- a/src/test/compile-fail/lint-stability2.rs +++ b/src/test/ui/compile-fail-migration/lint-stability2.rs diff --git a/src/test/ui/compile-fail-migration/lint-stability2.stderr b/src/test/ui/compile-fail-migration/lint-stability2.stderr new file mode 100644 index 00000000000..5585fc9f83a --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-stability2.stderr @@ -0,0 +1,15 @@ +error: use of deprecated item 'lint_stability::deprecated': text + --> $DIR/lint-stability2.rs:22:5 + | +LL | macro_test!(); + | ^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-stability2.rs:14:9 + | +LL | #![deny(deprecated)] + | ^^^^^^^^^^ + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-stability3.rs b/src/test/ui/compile-fail-migration/lint-stability3.rs index 44a36f215f3..44a36f215f3 100644 --- a/src/test/compile-fail/lint-stability3.rs +++ b/src/test/ui/compile-fail-migration/lint-stability3.rs diff --git a/src/test/ui/compile-fail-migration/lint-stability3.stderr b/src/test/ui/compile-fail-migration/lint-stability3.stderr new file mode 100644 index 00000000000..722223f6243 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-stability3.stderr @@ -0,0 +1,15 @@ +error: use of deprecated item 'lint_stability::deprecated_text': text + --> $DIR/lint-stability3.rs:23:5 + | +LL | macro_test_arg_nested!(deprecated_text); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-stability3.rs:14:9 + | +LL | #![deny(deprecated)] + | ^^^^^^^^^^ + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-type-limits.rs b/src/test/ui/compile-fail-migration/lint-type-limits.rs index 29929c120c3..29929c120c3 100644 --- a/src/test/compile-fail/lint-type-limits.rs +++ b/src/test/ui/compile-fail-migration/lint-type-limits.rs diff --git a/src/test/ui/compile-fail-migration/lint-type-limits.stderr b/src/test/ui/compile-fail-migration/lint-type-limits.stderr new file mode 100644 index 00000000000..49b379a9901 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-type-limits.stderr @@ -0,0 +1,58 @@ +error: comparison is useless due to type limits + --> $DIR/lint-type-limits.rs:18:11 + | +LL | while i >= 0 { //~ ERROR comparison is useless due to type limits + | ^^^^^^ + | + = note: requested on the command line with `-D unused-comparisons` + +error: comparison is useless due to type limits + --> $DIR/lint-type-limits.rs:29:13 + | +LL | let _ = u > 255; //~ ERROR comparison is useless due to type limits + | ^^^^^^^ + +error: comparison is useless due to type limits + --> $DIR/lint-type-limits.rs:30:13 + | +LL | let _ = 255 < u; //~ ERROR comparison is useless due to type limits + | ^^^^^^^ + +error: comparison is useless due to type limits + --> $DIR/lint-type-limits.rs:31:13 + | +LL | let _ = u < 0; //~ ERROR comparison is useless due to type limits + | ^^^^^ + +error: comparison is useless due to type limits + --> $DIR/lint-type-limits.rs:32:13 + | +LL | let _ = 0 > u; //~ ERROR comparison is useless due to type limits + | ^^^^^ + +error: comparison is useless due to type limits + --> $DIR/lint-type-limits.rs:33:13 + | +LL | let _ = u <= 255; //~ ERROR comparison is useless due to type limits + | ^^^^^^^^ + +error: comparison is useless due to type limits + --> $DIR/lint-type-limits.rs:34:13 + | +LL | let _ = 255 >= u; //~ ERROR comparison is useless due to type limits + | ^^^^^^^^ + +error: comparison is useless due to type limits + --> $DIR/lint-type-limits.rs:35:13 + | +LL | let _ = u >= 0; //~ ERROR comparison is useless due to type limits + | ^^^^^^ + +error: comparison is useless due to type limits + --> $DIR/lint-type-limits.rs:36:13 + | +LL | let _ = 0 <= u; //~ ERROR comparison is useless due to type limits + | ^^^^^^ + +error: aborting due to 9 previous errors + diff --git a/src/test/compile-fail/lint-type-limits2.rs b/src/test/ui/compile-fail-migration/lint-type-limits2.rs index 8fc18d16469..8fc18d16469 100644 --- a/src/test/compile-fail/lint-type-limits2.rs +++ b/src/test/ui/compile-fail-migration/lint-type-limits2.rs diff --git a/src/test/ui/compile-fail-migration/lint-type-limits2.stderr b/src/test/ui/compile-fail-migration/lint-type-limits2.stderr new file mode 100644 index 00000000000..a7abf7ad364 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-type-limits2.stderr @@ -0,0 +1,18 @@ +error: comparison is useless due to type limits + --> $DIR/lint-type-limits2.rs:22:5 + | +LL | 128 > bar() //~ ERROR comparison is useless due to type limits + | ^^^^^^^^^^^ + | + = note: requested on the command line with `-D unused-comparisons` + +warning: literal out of range for i8 + --> $DIR/lint-type-limits2.rs:22:5 + | +LL | 128 > bar() //~ ERROR comparison is useless due to type limits + | ^^^ + | + = note: #[warn(overflowing_literals)] on by default + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-type-limits3.rs b/src/test/ui/compile-fail-migration/lint-type-limits3.rs index b09dc0acdbf..b09dc0acdbf 100644 --- a/src/test/compile-fail/lint-type-limits3.rs +++ b/src/test/ui/compile-fail-migration/lint-type-limits3.rs diff --git a/src/test/ui/compile-fail-migration/lint-type-limits3.stderr b/src/test/ui/compile-fail-migration/lint-type-limits3.stderr new file mode 100644 index 00000000000..b6e14ac64e5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-type-limits3.stderr @@ -0,0 +1,18 @@ +error: comparison is useless due to type limits + --> $DIR/lint-type-limits3.rs:18:11 + | +LL | while 200 != i { //~ ERROR comparison is useless due to type limits + | ^^^^^^^^ + | + = note: requested on the command line with `-D unused-comparisons` + +warning: literal out of range for i8 + --> $DIR/lint-type-limits3.rs:18:11 + | +LL | while 200 != i { //~ ERROR comparison is useless due to type limits + | ^^^ + | + = note: #[warn(overflowing_literals)] on by default + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-type-overflow.rs b/src/test/ui/compile-fail-migration/lint-type-overflow.rs index ce336905c01..ce336905c01 100644 --- a/src/test/compile-fail/lint-type-overflow.rs +++ b/src/test/ui/compile-fail-migration/lint-type-overflow.rs diff --git a/src/test/ui/compile-fail-migration/lint-type-overflow.stderr b/src/test/ui/compile-fail-migration/lint-type-overflow.stderr new file mode 100644 index 00000000000..67f4537e1e6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-type-overflow.stderr @@ -0,0 +1,116 @@ +error: literal out of range for u8 + --> $DIR/lint-type-overflow.rs:21:18 + | +LL | let x1: u8 = 256; //~ error: literal out of range for u8 + | ^^^ + | +note: lint level defined here + --> $DIR/lint-type-overflow.rs:12:9 + | +LL | #![deny(overflowing_literals)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: literal out of range for u8 + --> $DIR/lint-type-overflow.rs:24:14 + | +LL | let x1 = 256_u8; //~ error: literal out of range for u8 + | ^^^^^^ + +error: literal out of range for i8 + --> $DIR/lint-type-overflow.rs:27:18 + | +LL | let x1: i8 = 128; //~ error: literal out of range for i8 + | ^^^ + +error: literal out of range for i8 + --> $DIR/lint-type-overflow.rs:29:19 + | +LL | let x3: i8 = -129; //~ error: literal out of range for i8 + | ^^^ + +error: literal out of range for i8 + --> $DIR/lint-type-overflow.rs:30:19 + | +LL | let x3: i8 = -(129); //~ error: literal out of range for i8 + | ^^^^^ + +error: literal out of range for i8 + --> $DIR/lint-type-overflow.rs:31:20 + | +LL | let x3: i8 = -{129}; //~ error: literal out of range for i8 + | ^^^ + +error: literal out of range for i8 + --> $DIR/lint-type-overflow.rs:33:10 + | +LL | test(1000); //~ error: literal out of range for i8 + | ^^^^ + +error: literal out of range for i8 + --> $DIR/lint-type-overflow.rs:35:13 + | +LL | let x = 128_i8; //~ error: literal out of range for i8 + | ^^^^^^ + +error: literal out of range for i8 + --> $DIR/lint-type-overflow.rs:39:14 + | +LL | let x = -129_i8; //~ error: literal out of range for i8 + | ^^^^^^ + +error: literal out of range for i32 + --> $DIR/lint-type-overflow.rs:43:18 + | +LL | let x: i32 = 2147483648; //~ error: literal out of range for i32 + | ^^^^^^^^^^ + +error: literal out of range for i32 + --> $DIR/lint-type-overflow.rs:44:13 + | +LL | let x = 2147483648_i32; //~ error: literal out of range for i32 + | ^^^^^^^^^^^^^^ + +error: literal out of range for i32 + --> $DIR/lint-type-overflow.rs:47:19 + | +LL | let x: i32 = -2147483649; //~ error: literal out of range for i32 + | ^^^^^^^^^^ + +error: literal out of range for i32 + --> $DIR/lint-type-overflow.rs:48:14 + | +LL | let x = -2147483649_i32; //~ error: literal out of range for i32 + | ^^^^^^^^^^^^^^ + +error: literal out of range for i32 + --> $DIR/lint-type-overflow.rs:49:13 + | +LL | let x = 2147483648; //~ error: literal out of range for i32 + | ^^^^^^^^^^ + +error: literal out of range for i64 + --> $DIR/lint-type-overflow.rs:51:13 + | +LL | let x = 9223372036854775808_i64; //~ error: literal out of range for i64 + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: literal out of range for i64 + --> $DIR/lint-type-overflow.rs:53:13 + | +LL | let x = 18446744073709551615_i64; //~ error: literal out of range for i64 + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: literal out of range for i64 + --> $DIR/lint-type-overflow.rs:54:19 + | +LL | let x: i64 = -9223372036854775809; //~ error: literal out of range for i64 + | ^^^^^^^^^^^^^^^^^^^ + +error: literal out of range for i64 + --> $DIR/lint-type-overflow.rs:55:14 + | +LL | let x = -9223372036854775809_i64; //~ error: literal out of range for i64 + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 18 previous errors + diff --git a/src/test/compile-fail/lint-type-overflow2.rs b/src/test/ui/compile-fail-migration/lint-type-overflow2.rs index f7cf8a68d56..f7cf8a68d56 100644 --- a/src/test/compile-fail/lint-type-overflow2.rs +++ b/src/test/ui/compile-fail-migration/lint-type-overflow2.rs diff --git a/src/test/ui/compile-fail-migration/lint-type-overflow2.stderr b/src/test/ui/compile-fail-migration/lint-type-overflow2.stderr new file mode 100644 index 00000000000..ecfd2584bba --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-type-overflow2.stderr @@ -0,0 +1,50 @@ +warning: literal out of range for i8 + --> $DIR/lint-type-overflow2.rs:19:20 + | +LL | let x2: i8 = --128; //~ warn: literal out of range for i8 + | ^^^ + | +note: lint level defined here + --> $DIR/lint-type-overflow2.rs:12:9 + | +LL | #![warn(overflowing_literals)] + | ^^^^^^^^^^^^^^^^^^^^ + +warning: literal out of range for f32 + --> $DIR/lint-type-overflow2.rs:21:14 + | +LL | let x = -3.40282357e+38_f32; //~ warn: literal out of range for f32 + | ^^^^^^^^^^^^^^^^^^ + +warning: literal out of range for f32 + --> $DIR/lint-type-overflow2.rs:22:14 + | +LL | let x = 3.40282357e+38_f32; //~ warn: literal out of range for f32 + | ^^^^^^^^^^^^^^^^^^ + +warning: literal out of range for f64 + --> $DIR/lint-type-overflow2.rs:23:14 + | +LL | let x = -1.7976931348623159e+308_f64; //~ warn: literal out of range for f64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: literal out of range for f64 + --> $DIR/lint-type-overflow2.rs:24:14 + | +LL | let x = 1.7976931348623159e+308_f64; //~ warn: literal out of range for f64 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: compilation successful + --> $DIR/lint-type-overflow2.rs:18:1 + | +LL | / fn main() { //~ ERROR: compilation successful +LL | | let x2: i8 = --128; //~ warn: literal out of range for i8 +LL | | +LL | | let x = -3.40282357e+38_f32; //~ warn: literal out of range for f32 +... | +LL | | let x = 1.7976931348623159e+308_f64; //~ warn: literal out of range for f64 +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-unexported-no-mangle.rs b/src/test/ui/compile-fail-migration/lint-unexported-no-mangle.rs index cd64dfa7a47..cd64dfa7a47 100644 --- a/src/test/compile-fail/lint-unexported-no-mangle.rs +++ b/src/test/ui/compile-fail-migration/lint-unexported-no-mangle.rs diff --git a/src/test/ui/compile-fail-migration/lint-unexported-no-mangle.stderr b/src/test/ui/compile-fail-migration/lint-unexported-no-mangle.stderr new file mode 100644 index 00000000000..e7d49f339e6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unexported-no-mangle.stderr @@ -0,0 +1,43 @@ +error: function is marked #[no_mangle], but not exported + --> $DIR/lint-unexported-no-mangle.rs:14:1 + | +LL | fn foo() { //~ ERROR function is marked #[no_mangle], but not exported + | ^ + | | + | _help: try making it public: `pub` + | | +LL | | } + | |_^ + | + = note: requested on the command line with `-F private-no-mangle-fns` + +error: const items should never be #[no_mangle] + --> $DIR/lint-unexported-no-mangle.rs:19:1 + | +LL | const FOO: u64 = 1; //~ ERROR const items should never be #[no_mangle] + | -----^^^^^^^^^^^^^^ + | | + | help: try a static value: `pub static` + | + = note: requested on the command line with `-F no-mangle-const-items` + +error: const items should never be #[no_mangle] + --> $DIR/lint-unexported-no-mangle.rs:22:1 + | +LL | pub const PUB_FOO: u64 = 1; //~ ERROR const items should never be #[no_mangle] + | ---------^^^^^^^^^^^^^^^^^^ + | | + | help: try a static value: `pub static` + +error: static is marked #[no_mangle], but not exported + --> $DIR/lint-unexported-no-mangle.rs:33:1 + | +LL | static PRIVATE_BAR: u64 = 1; //~ ERROR static is marked #[no_mangle], but not exported + | -^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | help: try making it public: `pub` + | + = note: requested on the command line with `-F private-no-mangle-statics` + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/lint-unknown-attr.rs b/src/test/ui/compile-fail-migration/lint-unknown-attr.rs index af4e81be195..af4e81be195 100644 --- a/src/test/compile-fail/lint-unknown-attr.rs +++ b/src/test/ui/compile-fail-migration/lint-unknown-attr.rs diff --git a/src/test/ui/compile-fail-migration/lint-unknown-attr.stderr b/src/test/ui/compile-fail-migration/lint-unknown-attr.stderr new file mode 100644 index 00000000000..5f915232c14 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unknown-attr.stderr @@ -0,0 +1,26 @@ +error: unused attribute + --> $DIR/lint-unknown-attr.rs:19:1 + | +LL | #[dance] mod a {} //~ ERROR unused attribute + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-unknown-attr.rs:15:9 + | +LL | #![deny(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + +error: unused attribute + --> $DIR/lint-unknown-attr.rs:21:1 + | +LL | #[dance] fn main() {} //~ ERROR unused attribute + | ^^^^^^^^ + +error: unused attribute + --> $DIR/lint-unknown-attr.rs:17:1 + | +LL | #![mutable_doc] //~ ERROR unused attribute + | ^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/lint-unknown-feature-default.rs b/src/test/ui/compile-fail-migration/lint-unknown-feature-default.rs index 5a0568f05e6..5a0568f05e6 100644 --- a/src/test/compile-fail/lint-unknown-feature-default.rs +++ b/src/test/ui/compile-fail-migration/lint-unknown-feature-default.rs diff --git a/src/test/ui/compile-fail-migration/lint-unknown-feature-default.stderr b/src/test/ui/compile-fail-migration/lint-unknown-feature-default.stderr new file mode 100644 index 00000000000..bd4079ffd2e --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unknown-feature-default.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/lint-unknown-feature-default.rs:20:1 + | +LL | fn main() { } //~ ERROR: compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-unknown-feature.rs b/src/test/ui/compile-fail-migration/lint-unknown-feature.rs index 81f99f99492..81f99f99492 100644 --- a/src/test/compile-fail/lint-unknown-feature.rs +++ b/src/test/ui/compile-fail-migration/lint-unknown-feature.rs diff --git a/src/test/ui/compile-fail-migration/lint-unknown-feature.stderr b/src/test/ui/compile-fail-migration/lint-unknown-feature.stderr new file mode 100644 index 00000000000..e2744c03872 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unknown-feature.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/lint-unknown-feature.rs:20:1 + | +LL | fn main() {} //~ ERROR: compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-unknown-lint-cmdline.rs b/src/test/ui/compile-fail-migration/lint-unknown-lint-cmdline.rs index 0c41959f8a7..0c41959f8a7 100644 --- a/src/test/compile-fail/lint-unknown-lint-cmdline.rs +++ b/src/test/ui/compile-fail-migration/lint-unknown-lint-cmdline.rs diff --git a/src/test/ui/compile-fail-migration/lint-unknown-lint-cmdline.stderr b/src/test/ui/compile-fail-migration/lint-unknown-lint-cmdline.stderr new file mode 100644 index 00000000000..86360041026 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unknown-lint-cmdline.stderr @@ -0,0 +1,7 @@ +error[E0602]: unknown lint: `bogus` + | + = note: requested on the command line with `-D bogus` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0602`. diff --git a/src/test/compile-fail/lint-unknown-lint.rs b/src/test/ui/compile-fail-migration/lint-unknown-lint.rs index 2de8d849d19..2de8d849d19 100644 --- a/src/test/compile-fail/lint-unknown-lint.rs +++ b/src/test/ui/compile-fail-migration/lint-unknown-lint.rs diff --git a/src/test/ui/compile-fail-migration/lint-unknown-lint.stderr b/src/test/ui/compile-fail-migration/lint-unknown-lint.stderr new file mode 100644 index 00000000000..b398a2f3690 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unknown-lint.stderr @@ -0,0 +1,23 @@ +warning: unknown lint: `not_a_real_lint` + --> $DIR/lint-unknown-lint.rs:11:10 + | +LL | #![allow(not_a_real_lint)] //~ WARN unknown lint + | ^^^^^^^^^^^^^^^ + | + = note: #[warn(unknown_lints)] on by default + +error: unused variable: `unused` + --> $DIR/lint-unknown-lint.rs:13:17 + | +LL | fn main() { let unused = (); } //~ ERROR unused variable + | ^^^^^^ help: consider using `_unused` instead + | +note: lint level defined here + --> $DIR/lint-unknown-lint.rs:12:9 + | +LL | #![deny(unused)] + | ^^^^^^ + = note: #[deny(unused_variables)] implied by #[deny(unused)] + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-unnecessary-import-braces.rs b/src/test/ui/compile-fail-migration/lint-unnecessary-import-braces.rs index 214a03c13f4..214a03c13f4 100644 --- a/src/test/compile-fail/lint-unnecessary-import-braces.rs +++ b/src/test/ui/compile-fail-migration/lint-unnecessary-import-braces.rs diff --git a/src/test/ui/compile-fail-migration/lint-unnecessary-import-braces.stderr b/src/test/ui/compile-fail-migration/lint-unnecessary-import-braces.stderr new file mode 100644 index 00000000000..a4fd474e5cc --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unnecessary-import-braces.stderr @@ -0,0 +1,14 @@ +error: braces around A is unnecessary + --> $DIR/lint-unnecessary-import-braces.rs:13:1 + | +LL | use test::{A}; //~ ERROR braces around A is unnecessary + | ^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-unnecessary-import-braces.rs:11:9 + | +LL | #![deny(unused_import_braces)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/lint-unnecessary-parens.rs b/src/test/ui/compile-fail-migration/lint-unnecessary-parens.rs index 7cd0a6bbf0f..7cd0a6bbf0f 100644 --- a/src/test/compile-fail/lint-unnecessary-parens.rs +++ b/src/test/ui/compile-fail-migration/lint-unnecessary-parens.rs diff --git a/src/test/ui/compile-fail-migration/lint-unnecessary-parens.stderr b/src/test/ui/compile-fail-migration/lint-unnecessary-parens.stderr new file mode 100644 index 00000000000..8861524b185 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unnecessary-parens.stderr @@ -0,0 +1,80 @@ +error: unnecessary parentheses around `return` value + --> $DIR/lint-unnecessary-parens.rs:20:12 + | +LL | return (1); //~ ERROR unnecessary parentheses around `return` value + | ^^^ help: remove these parentheses + | +note: lint level defined here + --> $DIR/lint-unnecessary-parens.rs:11:9 + | +LL | #![deny(unused_parens)] + | ^^^^^^^^^^^^^ + +error: unnecessary parentheses around `return` value + --> $DIR/lint-unnecessary-parens.rs:23:12 + | +LL | return (X { y }); //~ ERROR unnecessary parentheses around `return` value + | ^^^^^^^^^ help: remove these parentheses + +error: unnecessary parentheses around function argument + --> $DIR/lint-unnecessary-parens.rs:28:9 + | +LL | bar((true)); //~ ERROR unnecessary parentheses around function argument + | ^^^^^^ help: remove these parentheses + +error: unnecessary parentheses around `if` condition + --> $DIR/lint-unnecessary-parens.rs:30:8 + | +LL | if (true) {} //~ ERROR unnecessary parentheses around `if` condition + | ^^^^^^ help: remove these parentheses + +error: unnecessary parentheses around `while` condition + --> $DIR/lint-unnecessary-parens.rs:31:11 + | +LL | while (true) {} //~ ERROR unnecessary parentheses around `while` condition + | ^^^^^^ help: remove these parentheses + +error: unnecessary parentheses around `match` head expression + --> $DIR/lint-unnecessary-parens.rs:32:11 + | +LL | match (true) { //~ ERROR unnecessary parentheses around `match` head expression + | ^^^^^^ help: remove these parentheses + +error: unnecessary parentheses around `if let` head expression + --> $DIR/lint-unnecessary-parens.rs:35:16 + | +LL | if let 1 = (1) {} //~ ERROR unnecessary parentheses around `if let` head expression + | ^^^ help: remove these parentheses + +error: unnecessary parentheses around `while let` head expression + --> $DIR/lint-unnecessary-parens.rs:36:19 + | +LL | while let 1 = (2) {} //~ ERROR unnecessary parentheses around `while let` head expression + | ^^^ help: remove these parentheses + +error: unnecessary parentheses around method argument + --> $DIR/lint-unnecessary-parens.rs:50:24 + | +LL | X { y: false }.foo((true)); //~ ERROR unnecessary parentheses around method argument + | ^^^^^^ help: remove these parentheses + +error: unnecessary parentheses around assigned value + --> $DIR/lint-unnecessary-parens.rs:52:18 + | +LL | let mut _a = (0); //~ ERROR unnecessary parentheses around assigned value + | ^^^ help: remove these parentheses + +error: unnecessary parentheses around assigned value + --> $DIR/lint-unnecessary-parens.rs:53:10 + | +LL | _a = (0); //~ ERROR unnecessary parentheses around assigned value + | ^^^ help: remove these parentheses + +error: unnecessary parentheses around assigned value + --> $DIR/lint-unnecessary-parens.rs:54:11 + | +LL | _a += (1); //~ ERROR unnecessary parentheses around assigned value + | ^^^ help: remove these parentheses + +error: aborting due to 12 previous errors + diff --git a/src/test/compile-fail/lint-unsafe-code.rs b/src/test/ui/compile-fail-migration/lint-unsafe-code.rs index 10f245aaaf9..10f245aaaf9 100644 --- a/src/test/compile-fail/lint-unsafe-code.rs +++ b/src/test/ui/compile-fail-migration/lint-unsafe-code.rs diff --git a/src/test/ui/compile-fail-migration/lint-unsafe-code.stderr b/src/test/ui/compile-fail-migration/lint-unsafe-code.stderr new file mode 100644 index 00000000000..ee2aba066ec --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unsafe-code.stderr @@ -0,0 +1,95 @@ +error: declaration of an `unsafe` function + --> $DIR/lint-unsafe-code.rs:33:1 + | +LL | unsafe fn baz() {} //~ ERROR: declaration of an `unsafe` function + | ^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-unsafe-code.rs:13:9 + | +LL | #![deny(unsafe_code)] + | ^^^^^^^^^^^ + +error: declaration of an `unsafe` trait + --> $DIR/lint-unsafe-code.rs:34:1 + | +LL | unsafe trait Foo {} //~ ERROR: declaration of an `unsafe` trait + | ^^^^^^^^^^^^^^^^^^^ + +error: implementation of an `unsafe` trait + --> $DIR/lint-unsafe-code.rs:35:1 + | +LL | unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: declaration of an `unsafe` method + --> $DIR/lint-unsafe-code.rs:38:5 + | +LL | unsafe fn baz(&self); //~ ERROR: declaration of an `unsafe` method + | ^^^^^^^^^^^^^^^^^^^^^ + +error: implementation of an `unsafe` method + --> $DIR/lint-unsafe-code.rs:39:5 + | +LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: implementation of an `unsafe` method + --> $DIR/lint-unsafe-code.rs:40:5 + | +LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: implementation of an `unsafe` method + --> $DIR/lint-unsafe-code.rs:44:5 + | +LL | unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: implementation of an `unsafe` method + --> $DIR/lint-unsafe-code.rs:45:5 + | +LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: implementation of an `unsafe` method + --> $DIR/lint-unsafe-code.rs:64:5 + | +LL | unsafe fn provided_override(&self) {} //~ ERROR: implementation of an `unsafe` method + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: implementation of an `unsafe` method + --> $DIR/lint-unsafe-code.rs:75:5 + | +LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: implementation of an `unsafe` method + --> $DIR/lint-unsafe-code.rs:81:5 + | +LL | unsafe fn provided(&self) {} //~ ERROR: implementation of an `unsafe` method + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: implementation of an `unsafe` method + --> $DIR/lint-unsafe-code.rs:85:5 + | +LL | unsafe fn baz(&self) {} //~ ERROR: implementation of an `unsafe` method + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: usage of an `unsafe` block + --> $DIR/lint-unsafe-code.rs:96:5 + | +LL | unsafe {} //~ ERROR: usage of an `unsafe` block + | ^^^^^^^^^ + +error: usage of an `unsafe` block + --> $DIR/lint-unsafe-code.rs:29:9 + | +LL | unsafe {} //~ ERROR: usage of an `unsafe` block + | ^^^^^^^^^ +... +LL | unsafe_in_macro!() + | ------------------ in this macro invocation + +error: aborting due to 14 previous errors + diff --git a/src/test/compile-fail/lint-unused-extern-crate.rs b/src/test/ui/compile-fail-migration/lint-unused-extern-crate.rs index 8f0b53fd599..8f0b53fd599 100644 --- a/src/test/compile-fail/lint-unused-extern-crate.rs +++ b/src/test/ui/compile-fail-migration/lint-unused-extern-crate.rs diff --git a/src/test/ui/compile-fail-migration/lint-unused-extern-crate.stderr b/src/test/ui/compile-fail-migration/lint-unused-extern-crate.stderr new file mode 100644 index 00000000000..3a488b1e073 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unused-extern-crate.stderr @@ -0,0 +1,20 @@ +error: unused extern crate + --> $DIR/lint-unused-extern-crate.rs:21:1 + | +LL | extern crate lint_unused_extern_crate5; //~ ERROR: unused extern crate + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it + | +note: lint level defined here + --> $DIR/lint-unused-extern-crate.rs:17:9 + | +LL | #![deny(unused_extern_crates)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unused extern crate + --> $DIR/lint-unused-extern-crate.rs:39:5 + | +LL | extern crate lint_unused_extern_crate2; //~ ERROR unused extern crate + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove it + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lint-unused-imports.rs b/src/test/ui/compile-fail-migration/lint-unused-imports.rs index 5bb2ab75c53..5bb2ab75c53 100644 --- a/src/test/compile-fail/lint-unused-imports.rs +++ b/src/test/ui/compile-fail-migration/lint-unused-imports.rs diff --git a/src/test/ui/compile-fail-migration/lint-unused-imports.stderr b/src/test/ui/compile-fail-migration/lint-unused-imports.stderr new file mode 100644 index 00000000000..a0292b6907e --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unused-imports.stderr @@ -0,0 +1,56 @@ +error: unused import: `use std::fmt::{};` + --> $DIR/lint-unused-imports.rs:18:1 + | +LL | use std::fmt::{}; + | ^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-unused-imports.rs:11:9 + | +LL | #![deny(unused_imports)] + | ^^^^^^^^^^^^^^ + +error: unused imports: `None`, `Some` + --> $DIR/lint-unused-imports.rs:22:27 + | +LL | use std::option::Option::{Some, None}; + | ^^^^ ^^^^ + +error: unused import: `test::A` + --> $DIR/lint-unused-imports.rs:25:5 + | +LL | use test::A; //~ ERROR unused import: `test::A` + | ^^^^^^^ + +error: unused import: `bar` + --> $DIR/lint-unused-imports.rs:34:18 + | +LL | use test2::{foo, bar}; //~ ERROR unused import: `bar` + | ^^^ + +error: unused import: `foo::Square` + --> $DIR/lint-unused-imports.rs:62:13 + | +LL | use foo::Square; //~ ERROR unused import: `foo::Square` + | ^^^^^^^^^^^ + +error: unused import: `self::g` + --> $DIR/lint-unused-imports.rs:78:9 + | +LL | use self::g; //~ ERROR unused import: `self::g` + | ^^^^^^^ + +error: unused import: `test2::foo` + --> $DIR/lint-unused-imports.rs:87:9 + | +LL | use test2::foo; //~ ERROR unused import: `test2::foo` + | ^^^^^^^^^^ + +error: unused import: `test::B2` + --> $DIR/lint-unused-imports.rs:30:5 + | +LL | use test::B2; //~ ERROR unused import: `test::B2` + | ^^^^^^^^ + +error: aborting due to 8 previous errors + diff --git a/src/test/compile-fail/lint-unused-mut-self.rs b/src/test/ui/compile-fail-migration/lint-unused-mut-self.rs index 370f664e430..370f664e430 100644 --- a/src/test/compile-fail/lint-unused-mut-self.rs +++ b/src/test/ui/compile-fail-migration/lint-unused-mut-self.rs diff --git a/src/test/ui/compile-fail-migration/lint-unused-mut-self.stderr b/src/test/ui/compile-fail-migration/lint-unused-mut-self.stderr new file mode 100644 index 00000000000..af2baaa2e0a --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unused-mut-self.stderr @@ -0,0 +1,24 @@ +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-self.rs:18:12 + | +LL | fn foo(mut self) {} //~ ERROR: variable does not need to be mutable + | ----^^^^ + | | + | help: remove this `mut` + | +note: lint level defined here + --> $DIR/lint-unused-mut-self.rs:14:9 + | +LL | #![deny(unused_mut)] + | ^^^^^^^^^^ + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-self.rs:19:12 + | +LL | fn bar(mut self: Box<Foo>) {} //~ ERROR: variable does not need to be mutable + | ----^^^^ + | | + | help: remove this `mut` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/compile-fail-migration/lint-unused-mut-variables.lexical.stderr b/src/test/ui/compile-fail-migration/lint-unused-mut-variables.lexical.stderr new file mode 100644 index 00000000000..40f68c67827 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unused-mut-variables.lexical.stderr @@ -0,0 +1,150 @@ +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:59:14 + | +LL | let x = |mut y: isize| 10; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + | +note: lint level defined here + --> $DIR/lint-unused-mut-variables.rs:19:9 + | +LL | #![deny(unused_mut)] + | ^^^^^^^^^^ + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:24:9 + | +LL | let mut a = 3; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:26:9 + | +LL | let mut a = 2; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:28:9 + | +LL | let mut b = 3; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:30:9 + | +LL | let mut a = vec![3]; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:32:10 + | +LL | let (mut a, b) = (1, 2); //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:34:9 + | +LL | let mut a; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:38:9 + | +LL | let mut b; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:47:9 + | +LL | mut x => {} //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:51:8 + | +LL | (mut x, 1) | //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:64:9 + | +LL | let mut a = &mut 5; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:69:9 + | +LL | let mut b = (&mut a,); //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:72:9 + | +LL | let mut x = &mut 1; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:84:9 + | +LL | let mut v : &mut Vec<()> = &mut vec![]; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:61:13 + | +LL | fn what(mut foo: isize) {} //[lexical]~ ERROR: variable does not need to be mutable + | ----^^^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:79:20 + | +LL | fn mut_ref_arg(mut arg : &mut [u8]) -> &mut [u8] { + | ----^^^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:143:9 + | +LL | let mut b = vec![2]; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + | +note: lint level defined here + --> $DIR/lint-unused-mut-variables.rs:139:8 + | +LL | #[deny(unused_mut)] + | ^^^^^^^^^^ + +error: aborting due to 17 previous errors + diff --git a/src/test/ui/compile-fail-migration/lint-unused-mut-variables.nll.stderr b/src/test/ui/compile-fail-migration/lint-unused-mut-variables.nll.stderr new file mode 100644 index 00000000000..40f68c67827 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-unused-mut-variables.nll.stderr @@ -0,0 +1,150 @@ +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:59:14 + | +LL | let x = |mut y: isize| 10; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + | +note: lint level defined here + --> $DIR/lint-unused-mut-variables.rs:19:9 + | +LL | #![deny(unused_mut)] + | ^^^^^^^^^^ + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:24:9 + | +LL | let mut a = 3; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:26:9 + | +LL | let mut a = 2; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:28:9 + | +LL | let mut b = 3; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:30:9 + | +LL | let mut a = vec![3]; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:32:10 + | +LL | let (mut a, b) = (1, 2); //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:34:9 + | +LL | let mut a; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:38:9 + | +LL | let mut b; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:47:9 + | +LL | mut x => {} //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:51:8 + | +LL | (mut x, 1) | //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:64:9 + | +LL | let mut a = &mut 5; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:69:9 + | +LL | let mut b = (&mut a,); //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:72:9 + | +LL | let mut x = &mut 1; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:84:9 + | +LL | let mut v : &mut Vec<()> = &mut vec![]; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:61:13 + | +LL | fn what(mut foo: isize) {} //[lexical]~ ERROR: variable does not need to be mutable + | ----^^^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:79:20 + | +LL | fn mut_ref_arg(mut arg : &mut [u8]) -> &mut [u8] { + | ----^^^ + | | + | help: remove this `mut` + +error: variable does not need to be mutable + --> $DIR/lint-unused-mut-variables.rs:143:9 + | +LL | let mut b = vec![2]; //[lexical]~ ERROR: variable does not need to be mutable + | ----^ + | | + | help: remove this `mut` + | +note: lint level defined here + --> $DIR/lint-unused-mut-variables.rs:139:8 + | +LL | #[deny(unused_mut)] + | ^^^^^^^^^^ + +error: aborting due to 17 previous errors + diff --git a/src/test/compile-fail/lint-unused-mut-variables.rs b/src/test/ui/compile-fail-migration/lint-unused-mut-variables.rs index 14d836074dc..14d836074dc 100644 --- a/src/test/compile-fail/lint-unused-mut-variables.rs +++ b/src/test/ui/compile-fail-migration/lint-unused-mut-variables.rs diff --git a/src/test/compile-fail/lint-uppercase-variables.rs b/src/test/ui/compile-fail-migration/lint-uppercase-variables.rs index 1d947684792..1d947684792 100644 --- a/src/test/compile-fail/lint-uppercase-variables.rs +++ b/src/test/ui/compile-fail-migration/lint-uppercase-variables.rs diff --git a/src/test/ui/compile-fail-migration/lint-uppercase-variables.stderr b/src/test/ui/compile-fail-migration/lint-uppercase-variables.stderr new file mode 100644 index 00000000000..c8381d89adc --- /dev/null +++ b/src/test/ui/compile-fail-migration/lint-uppercase-variables.stderr @@ -0,0 +1,52 @@ +warning[E0170]: pattern binding `Foo` is named the same as one of the variants of the type `foo::Foo` + --> $DIR/lint-uppercase-variables.rs:32:9 + | +LL | Foo => {} + | ^^^ help: to match on the variant, qualify the path: `foo::Foo::Foo` + +warning: unused variable: `Foo` + --> $DIR/lint-uppercase-variables.rs:32:9 + | +LL | Foo => {} + | ^^^ help: consider using `_Foo` instead + | +note: lint level defined here + --> $DIR/lint-uppercase-variables.rs:11:9 + | +LL | #![warn(unused)] + | ^^^^^^ + = note: #[warn(unused_variables)] implied by #[warn(unused)] + +error: structure field `X` should have a snake case name such as `x` + --> $DIR/lint-uppercase-variables.rs:20:5 + | +LL | X: usize //~ ERROR structure field `X` should have a snake case name such as `x` + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/lint-uppercase-variables.rs:13:9 + | +LL | #![deny(non_snake_case)] + | ^^^^^^^^^^^^^^ + +error: variable `Xx` should have a snake case name such as `xx` + --> $DIR/lint-uppercase-variables.rs:23:9 + | +LL | fn test(Xx: usize) { //~ ERROR variable `Xx` should have a snake case name such as `xx` + | ^^ + +error: variable `Test` should have a snake case name such as `test` + --> $DIR/lint-uppercase-variables.rs:28:9 + | +LL | let Test: usize = 0; //~ ERROR variable `Test` should have a snake case name such as `test` + | ^^^^ + +error: variable `Foo` should have a snake case name such as `foo` + --> $DIR/lint-uppercase-variables.rs:32:9 + | +LL | Foo => {} + | ^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0170`. diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.ast.nll.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.ast.nll.stderr new file mode 100644 index 00000000000..58a76bd2cf3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.ast.nll.stderr @@ -0,0 +1,12 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/liveness-assign-imm-local-in-loop.rs:18:9 + | +LL | let v: isize; + | - consider changing this to `mut v` +... +LL | v = 1; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.ast.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.ast.stderr new file mode 100644 index 00000000000..54419fd5b25 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.ast.stderr @@ -0,0 +1,9 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/liveness-assign-imm-local-in-loop.rs:18:9 + | +LL | v = 1; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.mir.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.mir.stderr new file mode 100644 index 00000000000..58a76bd2cf3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.mir.stderr @@ -0,0 +1,12 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/liveness-assign-imm-local-in-loop.rs:18:9 + | +LL | let v: isize; + | - consider changing this to `mut v` +... +LL | v = 1; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/compile-fail/liveness-assign-imm-local-in-loop.rs b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.rs index 7bc3680ca77..7bc3680ca77 100644 --- a/src/test/compile-fail/liveness-assign-imm-local-in-loop.rs +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-loop.rs diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.ast.nll.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.ast.nll.stderr new file mode 100644 index 00000000000..091547ed122 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/liveness-assign-imm-local-in-op-eq.rs:19:5 + | +LL | let v: isize; + | - consider changing this to `mut v` +LL | //[mir]~^ NOTE consider changing this to `mut v` +LL | v = 2; //[ast]~ NOTE first assignment + | ----- first assignment to `v` +LL | //[mir]~^ NOTE first assignment +LL | v += 1; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.ast.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.ast.stderr new file mode 100644 index 00000000000..a98c3c29bd2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.ast.stderr @@ -0,0 +1,12 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/liveness-assign-imm-local-in-op-eq.rs:19:5 + | +LL | v = 2; //[ast]~ NOTE first assignment + | ----- first assignment to `v` +LL | //[mir]~^ NOTE first assignment +LL | v += 1; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.mir.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.mir.stderr new file mode 100644 index 00000000000..091547ed122 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.mir.stderr @@ -0,0 +1,15 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/liveness-assign-imm-local-in-op-eq.rs:19:5 + | +LL | let v: isize; + | - consider changing this to `mut v` +LL | //[mir]~^ NOTE consider changing this to `mut v` +LL | v = 2; //[ast]~ NOTE first assignment + | ----- first assignment to `v` +LL | //[mir]~^ NOTE first assignment +LL | v += 1; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/compile-fail/liveness-assign-imm-local-in-op-eq.rs b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.rs index 7812cdd8684..7812cdd8684 100644 --- a/src/test/compile-fail/liveness-assign-imm-local-in-op-eq.rs +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-in-op-eq.rs diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.ast.nll.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.ast.nll.stderr new file mode 100644 index 00000000000..e954b1f5e0f --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/liveness-assign-imm-local-with-drop.rs:19:5 + | +LL | let b = Box::new(1); //[ast]~ NOTE first assignment + | - + | | + | first assignment to `b` + | consider changing this to `mut b` +... +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.ast.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.ast.stderr new file mode 100644 index 00000000000..6abcf175f48 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.ast.stderr @@ -0,0 +1,12 @@ +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/liveness-assign-imm-local-with-drop.rs:19:5 + | +LL | let b = Box::new(1); //[ast]~ NOTE first assignment + | - first assignment to `b` +... +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.mir.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.mir.stderr new file mode 100644 index 00000000000..e954b1f5e0f --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.mir.stderr @@ -0,0 +1,15 @@ +error[E0384]: cannot assign twice to immutable variable `b` + --> $DIR/liveness-assign-imm-local-with-drop.rs:19:5 + | +LL | let b = Box::new(1); //[ast]~ NOTE first assignment + | - + | | + | first assignment to `b` + | consider changing this to `mut b` +... +LL | b = Box::new(2); //[ast]~ ERROR cannot assign twice to immutable variable + | ^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/compile-fail/liveness-assign-imm-local-with-drop.rs b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.rs index bb61a9037d9..bb61a9037d9 100644 --- a/src/test/compile-fail/liveness-assign-imm-local-with-drop.rs +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-drop.rs diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.ast.nll.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.ast.nll.stderr new file mode 100644 index 00000000000..70a6ab3edf8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/liveness-assign-imm-local-with-init.rs:19:5 + | +LL | let v: isize = 1; //[ast]~ NOTE first assignment + | - + | | + | first assignment to `v` + | consider changing this to `mut v` +... +LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.ast.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.ast.stderr new file mode 100644 index 00000000000..47c780e83e8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.ast.stderr @@ -0,0 +1,12 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/liveness-assign-imm-local-with-init.rs:19:5 + | +LL | let v: isize = 1; //[ast]~ NOTE first assignment + | - first assignment to `v` +... +LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.mir.stderr b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.mir.stderr new file mode 100644 index 00000000000..70a6ab3edf8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.mir.stderr @@ -0,0 +1,15 @@ +error[E0384]: cannot assign twice to immutable variable `v` + --> $DIR/liveness-assign-imm-local-with-init.rs:19:5 + | +LL | let v: isize = 1; //[ast]~ NOTE first assignment + | - + | | + | first assignment to `v` + | consider changing this to `mut v` +... +LL | v = 2; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/compile-fail/liveness-assign-imm-local-with-init.rs b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.rs index 672e9fab837..672e9fab837 100644 --- a/src/test/compile-fail/liveness-assign-imm-local-with-init.rs +++ b/src/test/ui/compile-fail-migration/liveness-assign-imm-local-with-init.rs diff --git a/src/test/compile-fail/liveness-closure-require-ret.rs b/src/test/ui/compile-fail-migration/liveness-closure-require-ret.rs index 17cd8231222..17cd8231222 100644 --- a/src/test/compile-fail/liveness-closure-require-ret.rs +++ b/src/test/ui/compile-fail-migration/liveness-closure-require-ret.rs diff --git a/src/test/ui/compile-fail-migration/liveness-closure-require-ret.stderr b/src/test/ui/compile-fail-migration/liveness-closure-require-ret.stderr new file mode 100644 index 00000000000..569640c9e20 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-closure-require-ret.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/liveness-closure-require-ret.rs:12:37 + | +LL | fn main() { println!("{}", force(|| {})); } //~ ERROR mismatched types + | ^^ expected isize, found () + | + = note: expected type `isize` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/liveness-dead.rs b/src/test/ui/compile-fail-migration/liveness-dead.rs index ddd8fc68c43..ddd8fc68c43 100644 --- a/src/test/compile-fail/liveness-dead.rs +++ b/src/test/ui/compile-fail-migration/liveness-dead.rs diff --git a/src/test/ui/compile-fail-migration/liveness-dead.stderr b/src/test/ui/compile-fail-migration/liveness-dead.stderr new file mode 100644 index 00000000000..6709fee0abb --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-dead.stderr @@ -0,0 +1,32 @@ +error: value assigned to `x` is never read + --> $DIR/liveness-dead.rs:19:13 + | +LL | let mut x: isize = 3; //~ ERROR: value assigned to `x` is never read + | ^ + | +note: lint level defined here + --> $DIR/liveness-dead.rs:12:9 + | +LL | #![deny(unused_assignments)] + | ^^^^^^^^^^^^^^^^^^ + +error: value assigned to `x` is never read + --> $DIR/liveness-dead.rs:27:5 + | +LL | x = 4; //~ ERROR: value assigned to `x` is never read + | ^ + +error: value passed to `x` is never read + --> $DIR/liveness-dead.rs:30:11 + | +LL | fn f4(mut x: i32) { //~ ERROR: value passed to `x` is never read + | ^ + +error: value assigned to `x` is never read + --> $DIR/liveness-dead.rs:37:5 + | +LL | x = 4; //~ ERROR: value assigned to `x` is never read + | ^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/liveness-forgot-ret.rs b/src/test/ui/compile-fail-migration/liveness-forgot-ret.rs index 1ee4be08a1c..1ee4be08a1c 100644 --- a/src/test/compile-fail/liveness-forgot-ret.rs +++ b/src/test/ui/compile-fail-migration/liveness-forgot-ret.rs diff --git a/src/test/ui/compile-fail-migration/liveness-forgot-ret.stderr b/src/test/ui/compile-fail-migration/liveness-forgot-ret.stderr new file mode 100644 index 00000000000..8da489bc9ab --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-forgot-ret.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/liveness-forgot-ret.rs:13:25 + | +LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected isize, found () + | + = note: expected type `isize` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/liveness-issue-2163.rs b/src/test/ui/compile-fail-migration/liveness-issue-2163.rs index 69bceec8c32..69bceec8c32 100644 --- a/src/test/compile-fail/liveness-issue-2163.rs +++ b/src/test/ui/compile-fail-migration/liveness-issue-2163.rs diff --git a/src/test/ui/compile-fail-migration/liveness-issue-2163.stderr b/src/test/ui/compile-fail-migration/liveness-issue-2163.stderr new file mode 100644 index 00000000000..66cd67821be --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-issue-2163.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/liveness-issue-2163.rs:15:30 + | +LL | a.iter().all(|_| -> bool { + | ______________________________^ +LL | | //~^ ERROR mismatched types +LL | | }); + | |_____^ expected bool, found () + | + = note: expected type `bool` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/liveness-missing-ret2.rs b/src/test/ui/compile-fail-migration/liveness-missing-ret2.rs index a35eb1af4f3..a35eb1af4f3 100644 --- a/src/test/compile-fail/liveness-missing-ret2.rs +++ b/src/test/ui/compile-fail-migration/liveness-missing-ret2.rs diff --git a/src/test/ui/compile-fail-migration/liveness-missing-ret2.stderr b/src/test/ui/compile-fail-migration/liveness-missing-ret2.stderr new file mode 100644 index 00000000000..b7bbea6225d --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-missing-ret2.stderr @@ -0,0 +1,17 @@ +error[E0308]: mismatched types + --> $DIR/liveness-missing-ret2.rs:11:17 + | +LL | fn f() -> isize { //~ ERROR mismatched types + | _________________^ +LL | | // Make sure typestate doesn't interpret this match expression as +LL | | // the function result +LL | | match true { true => { } _ => {} }; +LL | | } + | |_^ expected isize, found () + | + = note: expected type `isize` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/liveness-move-call-arg.rs b/src/test/ui/compile-fail-migration/liveness-move-call-arg.rs index 9340964c1fb..9340964c1fb 100644 --- a/src/test/compile-fail/liveness-move-call-arg.rs +++ b/src/test/ui/compile-fail-migration/liveness-move-call-arg.rs diff --git a/src/test/ui/compile-fail-migration/liveness-move-call-arg.stderr b/src/test/ui/compile-fail-migration/liveness-move-call-arg.stderr new file mode 100644 index 00000000000..f3423b8f5fa --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-move-call-arg.stderr @@ -0,0 +1,11 @@ +error[E0382]: use of moved value: `x` + --> $DIR/liveness-move-call-arg.rs:19:14 + | +LL | take(x); //~ ERROR use of moved value: `x` + | ^ value moved here in previous iteration of loop + | + = note: move occurs because `x` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/liveness-move-in-loop.rs b/src/test/ui/compile-fail-migration/liveness-move-in-loop.rs index 65ccaceac08..65ccaceac08 100644 --- a/src/test/compile-fail/liveness-move-in-loop.rs +++ b/src/test/ui/compile-fail-migration/liveness-move-in-loop.rs diff --git a/src/test/ui/compile-fail-migration/liveness-move-in-loop.stderr b/src/test/ui/compile-fail-migration/liveness-move-in-loop.stderr new file mode 100644 index 00000000000..decc7659a64 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-move-in-loop.stderr @@ -0,0 +1,11 @@ +error[E0382]: use of moved value: `y` + --> $DIR/liveness-move-in-loop.rs:21:25 + | +LL | x = y; //~ ERROR use of moved value + | ^ value moved here in previous iteration of loop + | + = note: move occurs because `y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/liveness-move-in-while.nll.stderr b/src/test/ui/compile-fail-migration/liveness-move-in-while.nll.stderr new file mode 100644 index 00000000000..5ca5dc64709 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-move-in-while.nll.stderr @@ -0,0 +1,21 @@ +error[E0382]: borrow of moved value: `y` + --> $DIR/liveness-move-in-while.rs:17:24 + | +LL | println!("{}", y); //~ ERROR use of moved value: `y` + | ^ value borrowed here after move +LL | while true { while true { while true { x = y; x.clone(); } } } + | - value moved here + | + = note: move occurs because `y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `y` + --> $DIR/liveness-move-in-while.rs:18:52 + | +LL | while true { while true { while true { x = y; x.clone(); } } } + | ^ value moved here in previous iteration of loop + | + = note: move occurs because `y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/liveness-move-in-while.rs b/src/test/ui/compile-fail-migration/liveness-move-in-while.rs index cadfd487121..cadfd487121 100644 --- a/src/test/compile-fail/liveness-move-in-while.rs +++ b/src/test/ui/compile-fail-migration/liveness-move-in-while.rs diff --git a/src/test/ui/compile-fail-migration/liveness-move-in-while.stderr b/src/test/ui/compile-fail-migration/liveness-move-in-while.stderr new file mode 100644 index 00000000000..7ac3ea38cb5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-move-in-while.stderr @@ -0,0 +1,21 @@ +error[E0382]: use of moved value: `y` + --> $DIR/liveness-move-in-while.rs:17:24 + | +LL | println!("{}", y); //~ ERROR use of moved value: `y` + | ^ value used here after move +LL | while true { while true { while true { x = y; x.clone(); } } } + | - value moved here + | + = note: move occurs because `y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `y` + --> $DIR/liveness-move-in-while.rs:18:52 + | +LL | while true { while true { while true { x = y; x.clone(); } } } + | ^ value moved here in previous iteration of loop + | + = note: move occurs because `y` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/liveness-unused.rs b/src/test/ui/compile-fail-migration/liveness-unused.rs index d056d6be806..d056d6be806 100644 --- a/src/test/compile-fail/liveness-unused.rs +++ b/src/test/ui/compile-fail-migration/liveness-unused.rs diff --git a/src/test/ui/compile-fail-migration/liveness-unused.stderr b/src/test/ui/compile-fail-migration/liveness-unused.stderr new file mode 100644 index 00000000000..2846f242fbe --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-unused.stderr @@ -0,0 +1,111 @@ +warning: unreachable statement + --> $DIR/liveness-unused.rs:102:9 + | +LL | drop(*x as i32); //~ WARNING unreachable statement + | ^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/liveness-unused.rs:11:9 + | +LL | #![warn(unused)] + | ^^^^^^ + = note: #[warn(unreachable_code)] implied by #[warn(unused)] + +error: unused variable: `x` + --> $DIR/liveness-unused.rs:18:7 + | +LL | fn f1(x: isize) { + | ^ help: consider using `_x` instead + | +note: lint level defined here + --> $DIR/liveness-unused.rs:12:9 + | +LL | #![deny(unused_variables)] + | ^^^^^^^^^^^^^^^^ + +error: unused variable: `x` + --> $DIR/liveness-unused.rs:22:8 + | +LL | fn f1b(x: &mut isize) { + | ^ help: consider using `_x` instead + +error: unused variable: `x` + --> $DIR/liveness-unused.rs:30:9 + | +LL | let x: isize; + | ^ help: consider using `_x` instead + +error: unused variable: `x` + --> $DIR/liveness-unused.rs:35:9 + | +LL | let x = 3; + | ^ help: consider using `_x` instead + +error: variable `x` is assigned to, but never used + --> $DIR/liveness-unused.rs:40:13 + | +LL | let mut x = 3; + | ^ + | + = note: consider using `_x` instead + +error: value assigned to `x` is never read + --> $DIR/liveness-unused.rs:42:5 + | +LL | x += 4; + | ^ + | +note: lint level defined here + --> $DIR/liveness-unused.rs:13:9 + | +LL | #![deny(unused_assignments)] + | ^^^^^^^^^^^^^^^^^^ + +error: variable `z` is assigned to, but never used + --> $DIR/liveness-unused.rs:47:13 + | +LL | let mut z = 3; + | ^ + | + = note: consider using `_z` instead + +error: unused variable: `i` + --> $DIR/liveness-unused.rs:69:12 + | +LL | Some(i) => { + | ^ help: consider using `_i` instead + +error: unused variable: `x` + --> $DIR/liveness-unused.rs:89:9 + | +LL | for x in 1..10 { } + | ^ help: consider using `_x` instead + +error: unused variable: `x` + --> $DIR/liveness-unused.rs:94:10 + | +LL | for (x, _) in [1, 2, 3].iter().enumerate() { } + | ^ help: consider using `_x` instead + +error: unused variable: `x` + --> $DIR/liveness-unused.rs:99:13 + | +LL | for (_, x) in [1, 2, 3].iter().enumerate() { + | ^ help: consider using `_x` instead + +error: variable `x` is assigned to, but never used + --> $DIR/liveness-unused.rs:122:9 + | +LL | let x; + | ^ + | + = note: consider using `_x` instead + +error: value assigned to `x` is never read + --> $DIR/liveness-unused.rs:126:9 + | +LL | x = 0; //~ ERROR value assigned to `x` is never read + | ^ + +error: aborting due to 13 previous errors + diff --git a/src/test/ui/compile-fail-migration/liveness-use-after-move.nll.stderr b/src/test/ui/compile-fail-migration/liveness-use-after-move.nll.stderr new file mode 100644 index 00000000000..62d9a8b115a --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-use-after-move.nll.stderr @@ -0,0 +1,11 @@ +error[E0382]: borrow of moved value: `*x` + --> $DIR/liveness-use-after-move.rs:16:20 + | +LL | let y = x; + | - value moved here +LL | println!("{}", *x); //~ ERROR use of moved value: `*x` + | ^^ value borrowed here after move + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/liveness-use-after-move.rs b/src/test/ui/compile-fail-migration/liveness-use-after-move.rs index 6fcab380030..6fcab380030 100644 --- a/src/test/compile-fail/liveness-use-after-move.rs +++ b/src/test/ui/compile-fail-migration/liveness-use-after-move.rs diff --git a/src/test/ui/compile-fail-migration/liveness-use-after-move.stderr b/src/test/ui/compile-fail-migration/liveness-use-after-move.stderr new file mode 100644 index 00000000000..be6f89c7357 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-use-after-move.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `*x` + --> $DIR/liveness-use-after-move.rs:16:20 + | +LL | let y = x; + | - value moved here +LL | println!("{}", *x); //~ ERROR use of moved value: `*x` + | ^^ value used here after move + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/liveness-use-after-send.nll.stderr b/src/test/ui/compile-fail-migration/liveness-use-after-send.nll.stderr new file mode 100644 index 00000000000..dbffe6c9135 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-use-after-send.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: borrow of moved value: `message` + --> $DIR/liveness-use-after-send.rs:26:20 + | +LL | send(ch, message); + | ------- value moved here +LL | println!("{}", message); //~ ERROR use of moved value: `message` + | ^^^^^^^ value borrowed here after move + | + = note: move occurs because `message` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/liveness-use-after-send.rs b/src/test/ui/compile-fail-migration/liveness-use-after-send.rs index 03d8d62e0b4..03d8d62e0b4 100644 --- a/src/test/compile-fail/liveness-use-after-send.rs +++ b/src/test/ui/compile-fail-migration/liveness-use-after-send.rs diff --git a/src/test/ui/compile-fail-migration/liveness-use-after-send.stderr b/src/test/ui/compile-fail-migration/liveness-use-after-send.stderr new file mode 100644 index 00000000000..94499aabb97 --- /dev/null +++ b/src/test/ui/compile-fail-migration/liveness-use-after-send.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `message` + --> $DIR/liveness-use-after-send.rs:26:20 + | +LL | send(ch, message); + | ------- value moved here +LL | println!("{}", message); //~ ERROR use of moved value: `message` + | ^^^^^^^ value used here after move + | + = note: move occurs because `message` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/loop-break-value.rs b/src/test/ui/compile-fail-migration/loop-break-value.rs index 938f7fba2a0..938f7fba2a0 100644 --- a/src/test/compile-fail/loop-break-value.rs +++ b/src/test/ui/compile-fail-migration/loop-break-value.rs diff --git a/src/test/ui/compile-fail-migration/loop-break-value.stderr b/src/test/ui/compile-fail-migration/loop-break-value.stderr new file mode 100644 index 00000000000..ca286285c38 --- /dev/null +++ b/src/test/ui/compile-fail-migration/loop-break-value.stderr @@ -0,0 +1,156 @@ +error[E0571]: `break` with value from a `while` loop + --> $DIR/loop-break-value.rs:38:9 + | +LL | break (); //~ ERROR `break` with value from a `while` loop + | ^^^^^^^^ can only break with a value inside `loop` or breakable block +help: instead, use `break` on its own without a value inside this `while` loop + | +LL | break; //~ ERROR `break` with value from a `while` loop + | ^^^^^ + +error[E0571]: `break` with value from a `while` loop + --> $DIR/loop-break-value.rs:40:13 + | +LL | break 'while_loop 123; + | ^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block +help: instead, use `break` on its own without a value inside this `while` loop + | +LL | break; + | ^^^^^ + +error[E0571]: `break` with value from a `while let` loop + --> $DIR/loop-break-value.rs:48:12 + | +LL | if break () { //~ ERROR `break` with value from a `while let` loop + | ^^^^^^^^ can only break with a value inside `loop` or breakable block +help: instead, use `break` on its own without a value inside this `while let` loop + | +LL | if break { //~ ERROR `break` with value from a `while let` loop + | ^^^^^ + +error[E0571]: `break` with value from a `while let` loop + --> $DIR/loop-break-value.rs:53:9 + | +LL | break None; + | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block +help: instead, use `break` on its own without a value inside this `while let` loop + | +LL | break; + | ^^^^^ + +error[E0571]: `break` with value from a `while let` loop + --> $DIR/loop-break-value.rs:59:13 + | +LL | break 'while_let_loop "nope"; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block +help: instead, use `break` on its own without a value inside this `while let` loop + | +LL | break; + | ^^^^^ + +error[E0571]: `break` with value from a `for` loop + --> $DIR/loop-break-value.rs:66:9 + | +LL | break (); //~ ERROR `break` with value from a `for` loop + | ^^^^^^^^ can only break with a value inside `loop` or breakable block +help: instead, use `break` on its own without a value inside this `for` loop + | +LL | break; //~ ERROR `break` with value from a `for` loop + | ^^^^^ + +error[E0571]: `break` with value from a `for` loop + --> $DIR/loop-break-value.rs:67:9 + | +LL | break [()]; + | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block +help: instead, use `break` on its own without a value inside this `for` loop + | +LL | break; + | ^^^^^ + +error[E0571]: `break` with value from a `for` loop + --> $DIR/loop-break-value.rs:74:13 + | +LL | break 'for_loop Some(17); + | ^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block +help: instead, use `break` on its own without a value inside this `for` loop + | +LL | break; + | ^^^^^ + +error[E0308]: mismatched types + --> $DIR/loop-break-value.rs:14:31 + | +LL | let val: ! = loop { break break; }; + | ^^^^^ expected (), found ! + | + = note: expected type `()` + found type `!` + +error[E0308]: mismatched types + --> $DIR/loop-break-value.rs:21:19 + | +LL | break 123; //~ ERROR mismatched types + | ^^^ expected &str, found integral variable + | + = note: expected type `&str` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/loop-break-value.rs:26:15 + | +LL | break "asdf"; //~ ERROR mismatched types + | ^^^^^^ expected i32, found reference + | + = note: expected type `i32` + found type `&'static str` + +error[E0308]: mismatched types + --> $DIR/loop-break-value.rs:31:31 + | +LL | break 'outer_loop "nope"; //~ ERROR mismatched types + | ^^^^^^ expected i32, found reference + | + = note: expected type `i32` + found type `&'static str` + +error[E0308]: mismatched types + --> $DIR/loop-break-value.rs:83:26 + | +LL | break 'c 123; //~ ERROR mismatched types + | ^^^ expected (), found integral variable + | + = note: expected type `()` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/loop-break-value.rs:90:15 + | +LL | break (break, break); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^ expected (), found tuple + | + = note: expected type `()` + found type `(!, !)` + +error[E0308]: mismatched types + --> $DIR/loop-break-value.rs:95:15 + | +LL | break 2; //~ ERROR mismatched types + | ^ expected (), found integral variable + | + = note: expected type `()` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/loop-break-value.rs:100:9 + | +LL | break; //~ ERROR mismatched types + | ^^^^^ expected (), found integral variable + | + = note: expected type `()` + found type `{integer}` + +error: aborting due to 16 previous errors + +Some errors occurred: E0308, E0571. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/loop-labeled-break-value.rs b/src/test/ui/compile-fail-migration/loop-labeled-break-value.rs index f0792c145d2..f0792c145d2 100644 --- a/src/test/compile-fail/loop-labeled-break-value.rs +++ b/src/test/ui/compile-fail-migration/loop-labeled-break-value.rs diff --git a/src/test/ui/compile-fail-migration/loop-labeled-break-value.stderr b/src/test/ui/compile-fail-migration/loop-labeled-break-value.stderr new file mode 100644 index 00000000000..7d140aa8aac --- /dev/null +++ b/src/test/ui/compile-fail-migration/loop-labeled-break-value.stderr @@ -0,0 +1,30 @@ +error[E0308]: mismatched types + --> $DIR/loop-labeled-break-value.rs:13:29 + | +LL | let _: i32 = loop { break }; //~ ERROR mismatched types + | ^^^^^ expected (), found i32 + | + = note: expected type `()` + found type `i32` + +error[E0308]: mismatched types + --> $DIR/loop-labeled-break-value.rs:16:37 + | +LL | let _: i32 = 'inner: loop { break 'inner }; //~ ERROR mismatched types + | ^^^^^^^^^^^^ expected (), found i32 + | + = note: expected type `()` + found type `i32` + +error[E0308]: mismatched types + --> $DIR/loop-labeled-break-value.rs:19:45 + | +LL | let _: i32 = 'inner2: loop { loop { break 'inner2 } }; //~ ERROR mismatched types + | ^^^^^^^^^^^^^ expected (), found i32 + | + = note: expected type `()` + found type `i32` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/loop-proper-liveness.nll.stderr b/src/test/ui/compile-fail-migration/loop-proper-liveness.nll.stderr new file mode 100644 index 00000000000..cbf7094d837 --- /dev/null +++ b/src/test/ui/compile-fail-migration/loop-proper-liveness.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: borrow of possibly uninitialized variable: `x` + --> $DIR/loop-proper-liveness.rs:19:22 + | +LL | println!("{:?}", x); //~ ERROR use of possibly uninitialized variable + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/loop-proper-liveness.rs b/src/test/ui/compile-fail-migration/loop-proper-liveness.rs index e411313c273..e411313c273 100644 --- a/src/test/compile-fail/loop-proper-liveness.rs +++ b/src/test/ui/compile-fail-migration/loop-proper-liveness.rs diff --git a/src/test/ui/compile-fail-migration/loop-proper-liveness.stderr b/src/test/ui/compile-fail-migration/loop-proper-liveness.stderr new file mode 100644 index 00000000000..554abea91e3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/loop-proper-liveness.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `x` + --> $DIR/loop-proper-liveness.rs:19:22 + | +LL | println!("{:?}", x); //~ ERROR use of possibly uninitialized variable + | ^ use of possibly uninitialized `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/loop-properly-diverging-2.rs b/src/test/ui/compile-fail-migration/loop-properly-diverging-2.rs index c22091ce63c..c22091ce63c 100644 --- a/src/test/compile-fail/loop-properly-diverging-2.rs +++ b/src/test/ui/compile-fail-migration/loop-properly-diverging-2.rs diff --git a/src/test/ui/compile-fail-migration/loop-properly-diverging-2.stderr b/src/test/ui/compile-fail-migration/loop-properly-diverging-2.stderr new file mode 100644 index 00000000000..f9836538382 --- /dev/null +++ b/src/test/ui/compile-fail-migration/loop-properly-diverging-2.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/loop-properly-diverging-2.rs:12:23 + | +LL | let x: i32 = loop { break }; //~ ERROR mismatched types + | ^^^^^ expected (), found i32 + | + = note: expected type `()` + found type `i32` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/lto-duplicate-symbols.rs b/src/test/ui/compile-fail-migration/lto-duplicate-symbols.rs index 9c1dbfc2af9..9c1dbfc2af9 100644 --- a/src/test/compile-fail/lto-duplicate-symbols.rs +++ b/src/test/ui/compile-fail-migration/lto-duplicate-symbols.rs diff --git a/src/test/ui/compile-fail-migration/lto-duplicate-symbols.stderr b/src/test/ui/compile-fail-migration/lto-duplicate-symbols.stderr new file mode 100644 index 00000000000..2f0e57199bb --- /dev/null +++ b/src/test/ui/compile-fail-migration/lto-duplicate-symbols.stderr @@ -0,0 +1,6 @@ +warning: Linking globals named 'foo': symbol multiply defined! + +error: failed to load bc of "lto_duplicate_symbols10-8787f43e282added376259c1adb08b80.rs": + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/lub-if.nll.stderr b/src/test/ui/compile-fail-migration/lub-if.nll.stderr new file mode 100644 index 00000000000..a34e280bfa6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lub-if.nll.stderr @@ -0,0 +1,30 @@ +warning: not reporting region error due to nll + --> $DIR/lub-if.rs:38:9 + | +LL | s //~ ERROR E0312 + | ^ + +warning: not reporting region error due to nll + --> $DIR/lub-if.rs:45:9 + | +LL | s //~ ERROR E0312 + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/lub-if.rs:34:8 + | +LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str { + | -- lifetime `'a` defined here +LL | if maybestr.is_none() { + | ^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/lub-if.rs:43:8 + | +LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str { + | -- lifetime `'a` defined here +LL | if maybestr.is_some() { + | ^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lub-if.rs b/src/test/ui/compile-fail-migration/lub-if.rs index 8d2a0fd07e8..8d2a0fd07e8 100644 --- a/src/test/compile-fail/lub-if.rs +++ b/src/test/ui/compile-fail-migration/lub-if.rs diff --git a/src/test/ui/compile-fail-migration/lub-if.stderr b/src/test/ui/compile-fail-migration/lub-if.stderr new file mode 100644 index 00000000000..4a436810170 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lub-if.stderr @@ -0,0 +1,29 @@ +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/lub-if.rs:38:9 + | +LL | s //~ ERROR E0312 + | ^ + | + = note: ...the reference is valid for the static lifetime... +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 33:17 + --> $DIR/lub-if.rs:33:17 + | +LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str { + | ^^ + +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/lub-if.rs:45:9 + | +LL | s //~ ERROR E0312 + | ^ + | + = note: ...the reference is valid for the static lifetime... +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 42:17 + --> $DIR/lub-if.rs:42:17 + | +LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/compile-fail-migration/lub-match.nll.stderr b/src/test/ui/compile-fail-migration/lub-match.nll.stderr new file mode 100644 index 00000000000..22bd6ea4081 --- /dev/null +++ b/src/test/ui/compile-fail-migration/lub-match.nll.stderr @@ -0,0 +1,30 @@ +warning: not reporting region error due to nll + --> $DIR/lub-match.rs:40:13 + | +LL | s //~ ERROR E0312 + | ^ + +warning: not reporting region error due to nll + --> $DIR/lub-match.rs:49:13 + | +LL | s //~ ERROR E0312 + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/lub-match.rs:36:11 + | +LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str { + | -- lifetime `'a` defined here +LL | match *maybestr { + | ^^^^^^^^^ requires that `'a` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/lub-match.rs:46:11 + | +LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str { + | -- lifetime `'a` defined here +LL | match *maybestr { + | ^^^^^^^^^ requires that `'a` must outlive `'static` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/lub-match.rs b/src/test/ui/compile-fail-migration/lub-match.rs index b9423feb5c1..b9423feb5c1 100644 --- a/src/test/compile-fail/lub-match.rs +++ b/src/test/ui/compile-fail-migration/lub-match.rs diff --git a/src/test/ui/compile-fail-migration/lub-match.stderr b/src/test/ui/compile-fail-migration/lub-match.stderr new file mode 100644 index 00000000000..3543676ad2f --- /dev/null +++ b/src/test/ui/compile-fail-migration/lub-match.stderr @@ -0,0 +1,29 @@ +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/lub-match.rs:40:13 + | +LL | s //~ ERROR E0312 + | ^ + | + = note: ...the reference is valid for the static lifetime... +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 35:17 + --> $DIR/lub-match.rs:35:17 + | +LL | pub fn opt_str2<'a>(maybestr: &'a Option<String>) -> &'static str { + | ^^ + +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/lub-match.rs:49:13 + | +LL | s //~ ERROR E0312 + | ^ + | + = note: ...the reference is valid for the static lifetime... +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 45:17 + --> $DIR/lub-match.rs:45:17 + | +LL | pub fn opt_str3<'a>(maybestr: &'a Option<String>) -> &'static str { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/compile-fail/macro-attribute.rs b/src/test/ui/compile-fail-migration/macro-attribute.rs index a77b1724876..a77b1724876 100644 --- a/src/test/compile-fail/macro-attribute.rs +++ b/src/test/ui/compile-fail-migration/macro-attribute.rs diff --git a/src/test/ui/compile-fail-migration/macro-attribute.stderr b/src/test/ui/compile-fail-migration/macro-attribute.stderr new file mode 100644 index 00000000000..8a3eb207953 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-attribute.stderr @@ -0,0 +1,8 @@ +error: unexpected token: `$` + --> $DIR/macro-attribute.rs:11:7 + | +LL | #[doc = $not_there] //~ error: unexpected token: `$` + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/macro-comma-behavior.core.stderr b/src/test/ui/compile-fail-migration/macro-comma-behavior.core.stderr new file mode 100644 index 00000000000..5ff31f05079 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-comma-behavior.core.stderr @@ -0,0 +1,44 @@ +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:27:23 + | +LL | assert_eq!(1, 1, "{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:30:23 + | +LL | assert_ne!(1, 2, "{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:36:29 + | +LL | debug_assert_eq!(1, 1, "{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:39:29 + | +LL | debug_assert_ne!(1, 2, "{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:60:19 + | +LL | format_args!("{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:78:21 + | +LL | unimplemented!("{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:87:24 + | +LL | write!(f, "{}",)?; + | ^^ + +error: aborting due to 7 previous errors + diff --git a/src/test/compile-fail/macro-comma-behavior.rs b/src/test/ui/compile-fail-migration/macro-comma-behavior.rs index 620e57b463d..620e57b463d 100644 --- a/src/test/compile-fail/macro-comma-behavior.rs +++ b/src/test/ui/compile-fail-migration/macro-comma-behavior.rs diff --git a/src/test/ui/compile-fail-migration/macro-comma-behavior.std.stderr b/src/test/ui/compile-fail-migration/macro-comma-behavior.std.stderr new file mode 100644 index 00000000000..a87271ed026 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-comma-behavior.std.stderr @@ -0,0 +1,62 @@ +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:27:23 + | +LL | assert_eq!(1, 1, "{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:30:23 + | +LL | assert_ne!(1, 2, "{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:36:29 + | +LL | debug_assert_eq!(1, 1, "{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:39:29 + | +LL | debug_assert_ne!(1, 2, "{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:44:18 + | +LL | eprint!("{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:56:18 + | +LL | format!("{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:60:19 + | +LL | format_args!("{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:67:17 + | +LL | print!("{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:78:21 + | +LL | unimplemented!("{}",); + | ^^ + +error: 1 positional argument in format string, but no arguments were given + --> $DIR/macro-comma-behavior.rs:87:24 + | +LL | write!(f, "{}",)?; + | ^^ + +error: aborting due to 10 previous errors + diff --git a/src/test/compile-fail/macro-comma-support.rs b/src/test/ui/compile-fail-migration/macro-comma-support.rs index e5fe9b4dd7f..e5fe9b4dd7f 100644 --- a/src/test/compile-fail/macro-comma-support.rs +++ b/src/test/ui/compile-fail-migration/macro-comma-support.rs diff --git a/src/test/ui/compile-fail-migration/macro-comma-support.stderr b/src/test/ui/compile-fail-migration/macro-comma-support.stderr new file mode 100644 index 00000000000..2ebba22d7a1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-comma-support.stderr @@ -0,0 +1,14 @@ +error: lel + --> $DIR/macro-comma-support.rs:16:5 + | +LL | compile_error!("lel"); //~ ERROR lel + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: lel + --> $DIR/macro-comma-support.rs:17:5 + | +LL | compile_error!("lel",); //~ ERROR lel + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/macro-crate-nonterminal-non-root.rs b/src/test/ui/compile-fail-migration/macro-crate-nonterminal-non-root.rs index 76211b88bd7..76211b88bd7 100644 --- a/src/test/compile-fail/macro-crate-nonterminal-non-root.rs +++ b/src/test/ui/compile-fail-migration/macro-crate-nonterminal-non-root.rs diff --git a/src/test/ui/compile-fail-migration/macro-crate-nonterminal-non-root.stderr b/src/test/ui/compile-fail-migration/macro-crate-nonterminal-non-root.stderr new file mode 100644 index 00000000000..029128ae92a --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-crate-nonterminal-non-root.stderr @@ -0,0 +1,9 @@ +error[E0468]: an `extern crate` loading macros must be at the crate root + --> $DIR/macro-crate-nonterminal-non-root.rs:15:5 + | +LL | extern crate macro_crate_nonterminal; //~ ERROR must be at the crate root + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0468`. diff --git a/src/test/compile-fail/macro-error.rs b/src/test/ui/compile-fail-migration/macro-error.rs index 82a5aa48729..82a5aa48729 100644 --- a/src/test/compile-fail/macro-error.rs +++ b/src/test/ui/compile-fail-migration/macro-error.rs diff --git a/src/test/ui/compile-fail-migration/macro-error.stderr b/src/test/ui/compile-fail-migration/macro-error.stderr new file mode 100644 index 00000000000..42808eb2a6b --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-error.stderr @@ -0,0 +1,14 @@ +error: macro rhs must be delimited + --> $DIR/macro-error.rs:12:18 + | +LL | ($a:expr) => a; //~ ERROR macro rhs must be delimited + | ^ + +error: non-type macro in type position: cfg + --> $DIR/macro-error.rs:18:12 + | +LL | let _: cfg!(foo) = (); //~ ERROR non-type macro in type position + | ^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/macro-expanded-include/file.txt b/src/test/ui/compile-fail-migration/macro-expanded-include/file.txt index e69de29bb2d..e69de29bb2d 100644 --- a/src/test/compile-fail/macro-expanded-include/file.txt +++ b/src/test/ui/compile-fail-migration/macro-expanded-include/file.txt diff --git a/src/test/compile-fail/macro-expanded-include/foo/mod.rs b/src/test/ui/compile-fail-migration/macro-expanded-include/foo/mod.rs index 888bdf5179a..888bdf5179a 100644 --- a/src/test/compile-fail/macro-expanded-include/foo/mod.rs +++ b/src/test/ui/compile-fail-migration/macro-expanded-include/foo/mod.rs diff --git a/src/test/compile-fail/macro-expanded-include/test.rs b/src/test/ui/compile-fail-migration/macro-expanded-include/test.rs index 4afb61ab76c..4afb61ab76c 100644 --- a/src/test/compile-fail/macro-expanded-include/test.rs +++ b/src/test/ui/compile-fail-migration/macro-expanded-include/test.rs diff --git a/src/test/ui/compile-fail-migration/macro-expanded-include/test.stderr b/src/test/ui/compile-fail-migration/macro-expanded-include/test.stderr new file mode 100644 index 00000000000..3ef0275cfbe --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-expanded-include/test.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/test.rs:23:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-expansion-tests.rs b/src/test/ui/compile-fail-migration/macro-expansion-tests.rs index 06f2d86e5d9..06f2d86e5d9 100644 --- a/src/test/compile-fail/macro-expansion-tests.rs +++ b/src/test/ui/compile-fail-migration/macro-expansion-tests.rs diff --git a/src/test/ui/compile-fail-migration/macro-expansion-tests.stderr b/src/test/ui/compile-fail-migration/macro-expansion-tests.stderr new file mode 100644 index 00000000000..a3d4f3cd348 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-expansion-tests.stderr @@ -0,0 +1,18 @@ +error: cannot find macro `m!` in this scope + --> $DIR/macro-expansion-tests.rs:17:21 + | +LL | fn g() -> i32 { m!() } + | ^ + | + = help: have you added the `#[macro_use]` on the module/import? + +error: cannot find macro `m!` in this scope + --> $DIR/macro-expansion-tests.rs:25:21 + | +LL | fn g() -> i32 { m!() } + | ^ + | + = help: have you added the `#[macro_use]` on the module/import? + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/macro-follow.rs b/src/test/ui/compile-fail-migration/macro-follow.rs index 6e80e9b574b..6e80e9b574b 100644 --- a/src/test/compile-fail/macro-follow.rs +++ b/src/test/ui/compile-fail-migration/macro-follow.rs diff --git a/src/test/ui/compile-fail-migration/macro-follow.stderr b/src/test/ui/compile-fail-migration/macro-follow.stderr new file mode 100644 index 00000000000..ccd658af89f --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-follow.stderr @@ -0,0 +1,512 @@ +error: `$p:pat` is followed by `(`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:17:14 + | +LL | ($p:pat ()) => {}; //~ERROR `$p:pat` is followed by `(` + | ^ + +error: `$p:pat` is followed by `[`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:18:14 + | +LL | ($p:pat []) => {}; //~ERROR `$p:pat` is followed by `[` + | ^ + +error: `$p:pat` is followed by `{`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:19:14 + | +LL | ($p:pat {}) => {}; //~ERROR `$p:pat` is followed by `{` + | ^ + +error: `$p:pat` is followed by `:`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:20:13 + | +LL | ($p:pat :) => {}; //~ERROR `$p:pat` is followed by `:` + | ^ + +error: `$p:pat` is followed by `>`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:21:13 + | +LL | ($p:pat >) => {}; //~ERROR `$p:pat` is followed by `>` + | ^ + +error: `$p:pat` is followed by `+`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:22:13 + | +LL | ($p:pat +) => {}; //~ERROR `$p:pat` is followed by `+` + | ^ + +error: `$p:pat` is followed by `ident`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:23:13 + | +LL | ($p:pat ident) => {}; //~ERROR `$p:pat` is followed by `ident` + | ^^^^^ + +error: `$p:pat` is followed by `$p:pat`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:24:13 + | +LL | ($p:pat $p:pat) => {}; //~ERROR `$p:pat` is followed by `$p:pat` + | ^^^^^^ + +error: `$p:pat` is followed by `$e:expr`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:25:13 + | +LL | ($p:pat $e:expr) => {}; //~ERROR `$p:pat` is followed by `$e:expr` + | ^^^^^^^ + +error: `$p:pat` is followed by `$t:ty`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:26:13 + | +LL | ($p:pat $t:ty) => {}; //~ERROR `$p:pat` is followed by `$t:ty` + | ^^^^^ + +error: `$p:pat` is followed by `$s:stmt`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:27:13 + | +LL | ($p:pat $s:stmt) => {}; //~ERROR `$p:pat` is followed by `$s:stmt` + | ^^^^^^^ + +error: `$p:pat` is followed by `$p:path`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:28:13 + | +LL | ($p:pat $p:path) => {}; //~ERROR `$p:pat` is followed by `$p:path` + | ^^^^^^^ + +error: `$p:pat` is followed by `$b:block`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:29:13 + | +LL | ($p:pat $b:block) => {}; //~ERROR `$p:pat` is followed by `$b:block` + | ^^^^^^^^ + +error: `$p:pat` is followed by `$i:ident`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:30:13 + | +LL | ($p:pat $i:ident) => {}; //~ERROR `$p:pat` is followed by `$i:ident` + | ^^^^^^^^ + +error: `$p:pat` is followed by `$t:tt`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:31:13 + | +LL | ($p:pat $t:tt) => {}; //~ERROR `$p:pat` is followed by `$t:tt` + | ^^^^^ + +error: `$p:pat` is followed by `$i:item`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:32:13 + | +LL | ($p:pat $i:item) => {}; //~ERROR `$p:pat` is followed by `$i:item` + | ^^^^^^^ + +error: `$p:pat` is followed by `$m:meta`, which is not allowed for `pat` fragments + --> $DIR/macro-follow.rs:33:13 + | +LL | ($p:pat $m:meta) => {}; //~ERROR `$p:pat` is followed by `$m:meta` + | ^^^^^^^ + +error: `$e:expr` is followed by `(`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:37:15 + | +LL | ($e:expr ()) => {}; //~ERROR `$e:expr` is followed by `(` + | ^ + +error: `$e:expr` is followed by `[`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:38:15 + | +LL | ($e:expr []) => {}; //~ERROR `$e:expr` is followed by `[` + | ^ + +error: `$e:expr` is followed by `{`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:39:15 + | +LL | ($e:expr {}) => {}; //~ERROR `$e:expr` is followed by `{` + | ^ + +error: `$e:expr` is followed by `=`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:40:14 + | +LL | ($e:expr =) => {}; //~ERROR `$e:expr` is followed by `=` + | ^ + +error: `$e:expr` is followed by `|`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:41:14 + | +LL | ($e:expr |) => {}; //~ERROR `$e:expr` is followed by `|` + | ^ + +error: `$e:expr` is followed by `:`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:42:14 + | +LL | ($e:expr :) => {}; //~ERROR `$e:expr` is followed by `:` + | ^ + +error: `$e:expr` is followed by `>`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:43:14 + | +LL | ($e:expr >) => {}; //~ERROR `$e:expr` is followed by `>` + | ^ + +error: `$e:expr` is followed by `+`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:44:14 + | +LL | ($e:expr +) => {}; //~ERROR `$e:expr` is followed by `+` + | ^ + +error: `$e:expr` is followed by `ident`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:45:14 + | +LL | ($e:expr ident) => {}; //~ERROR `$e:expr` is followed by `ident` + | ^^^^^ + +error: `$e:expr` is followed by `if`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:46:14 + | +LL | ($e:expr if) => {}; //~ERROR `$e:expr` is followed by `if` + | ^^ + +error: `$e:expr` is followed by `in`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:47:14 + | +LL | ($e:expr in) => {}; //~ERROR `$e:expr` is followed by `in` + | ^^ + +error: `$e:expr` is followed by `$p:pat`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:48:14 + | +LL | ($e:expr $p:pat) => {}; //~ERROR `$e:expr` is followed by `$p:pat` + | ^^^^^^ + +error: `$e:expr` is followed by `$e:expr`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:49:14 + | +LL | ($e:expr $e:expr) => {}; //~ERROR `$e:expr` is followed by `$e:expr` + | ^^^^^^^ + +error: `$e:expr` is followed by `$t:ty`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:50:14 + | +LL | ($e:expr $t:ty) => {}; //~ERROR `$e:expr` is followed by `$t:ty` + | ^^^^^ + +error: `$e:expr` is followed by `$s:stmt`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:51:14 + | +LL | ($e:expr $s:stmt) => {}; //~ERROR `$e:expr` is followed by `$s:stmt` + | ^^^^^^^ + +error: `$e:expr` is followed by `$p:path`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:52:14 + | +LL | ($e:expr $p:path) => {}; //~ERROR `$e:expr` is followed by `$p:path` + | ^^^^^^^ + +error: `$e:expr` is followed by `$b:block`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:53:14 + | +LL | ($e:expr $b:block) => {}; //~ERROR `$e:expr` is followed by `$b:block` + | ^^^^^^^^ + +error: `$e:expr` is followed by `$i:ident`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:54:14 + | +LL | ($e:expr $i:ident) => {}; //~ERROR `$e:expr` is followed by `$i:ident` + | ^^^^^^^^ + +error: `$e:expr` is followed by `$t:tt`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:55:14 + | +LL | ($e:expr $t:tt) => {}; //~ERROR `$e:expr` is followed by `$t:tt` + | ^^^^^ + +error: `$e:expr` is followed by `$i:item`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:56:14 + | +LL | ($e:expr $i:item) => {}; //~ERROR `$e:expr` is followed by `$i:item` + | ^^^^^^^ + +error: `$e:expr` is followed by `$m:meta`, which is not allowed for `expr` fragments + --> $DIR/macro-follow.rs:57:14 + | +LL | ($e:expr $m:meta) => {}; //~ERROR `$e:expr` is followed by `$m:meta` + | ^^^^^^^ + +error: `$t:ty` is followed by `(`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:62:13 + | +LL | ($t:ty ()) => {}; //~ERROR `$t:ty` is followed by `(` + | ^ + +error: `$t:ty` is followed by `+`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:64:12 + | +LL | ($t:ty +) => {}; //~ERROR `$t:ty` is followed by `+` + | ^ + +error: `$t:ty` is followed by `ident`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:65:12 + | +LL | ($t:ty ident) => {}; //~ERROR `$t:ty` is followed by `ident` + | ^^^^^ + +error: `$t:ty` is followed by `if`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:66:12 + | +LL | ($t:ty if) => {}; //~ERROR `$t:ty` is followed by `if` + | ^^ + +error: `$t:ty` is followed by `$p:pat`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:67:12 + | +LL | ($t:ty $p:pat) => {}; //~ERROR `$t:ty` is followed by `$p:pat` + | ^^^^^^ + +error: `$t:ty` is followed by `$e:expr`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:68:12 + | +LL | ($t:ty $e:expr) => {}; //~ERROR `$t:ty` is followed by `$e:expr` + | ^^^^^^^ + +error: `$t:ty` is followed by `$t:ty`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:69:12 + | +LL | ($t:ty $t:ty) => {}; //~ERROR `$t:ty` is followed by `$t:ty` + | ^^^^^ + +error: `$t:ty` is followed by `$s:stmt`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:70:12 + | +LL | ($t:ty $s:stmt) => {}; //~ERROR `$t:ty` is followed by `$s:stmt` + | ^^^^^^^ + +error: `$t:ty` is followed by `$p:path`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:71:12 + | +LL | ($t:ty $p:path) => {}; //~ERROR `$t:ty` is followed by `$p:path` + | ^^^^^^^ + +error: `$t:ty` is followed by `$i:ident`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:73:12 + | +LL | ($t:ty $i:ident) => {}; //~ERROR `$t:ty` is followed by `$i:ident` + | ^^^^^^^^ + +error: `$t:ty` is followed by `$t:tt`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:74:12 + | +LL | ($t:ty $t:tt) => {}; //~ERROR `$t:ty` is followed by `$t:tt` + | ^^^^^ + +error: `$t:ty` is followed by `$i:item`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:75:12 + | +LL | ($t:ty $i:item) => {}; //~ERROR `$t:ty` is followed by `$i:item` + | ^^^^^^^ + +error: `$t:ty` is followed by `$m:meta`, which is not allowed for `ty` fragments + --> $DIR/macro-follow.rs:76:12 + | +LL | ($t:ty $m:meta) => {}; //~ERROR `$t:ty` is followed by `$m:meta` + | ^^^^^^^ + +error: `$s:stmt` is followed by `(`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:80:15 + | +LL | ($s:stmt ()) => {}; //~ERROR `$s:stmt` is followed by `(` + | ^ + +error: `$s:stmt` is followed by `[`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:81:15 + | +LL | ($s:stmt []) => {}; //~ERROR `$s:stmt` is followed by `[` + | ^ + +error: `$s:stmt` is followed by `{`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:82:15 + | +LL | ($s:stmt {}) => {}; //~ERROR `$s:stmt` is followed by `{` + | ^ + +error: `$s:stmt` is followed by `=`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:83:14 + | +LL | ($s:stmt =) => {}; //~ERROR `$s:stmt` is followed by `=` + | ^ + +error: `$s:stmt` is followed by `|`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:84:14 + | +LL | ($s:stmt |) => {}; //~ERROR `$s:stmt` is followed by `|` + | ^ + +error: `$s:stmt` is followed by `:`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:85:14 + | +LL | ($s:stmt :) => {}; //~ERROR `$s:stmt` is followed by `:` + | ^ + +error: `$s:stmt` is followed by `>`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:86:14 + | +LL | ($s:stmt >) => {}; //~ERROR `$s:stmt` is followed by `>` + | ^ + +error: `$s:stmt` is followed by `+`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:87:14 + | +LL | ($s:stmt +) => {}; //~ERROR `$s:stmt` is followed by `+` + | ^ + +error: `$s:stmt` is followed by `ident`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:88:14 + | +LL | ($s:stmt ident) => {}; //~ERROR `$s:stmt` is followed by `ident` + | ^^^^^ + +error: `$s:stmt` is followed by `if`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:89:14 + | +LL | ($s:stmt if) => {}; //~ERROR `$s:stmt` is followed by `if` + | ^^ + +error: `$s:stmt` is followed by `in`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:90:14 + | +LL | ($s:stmt in) => {}; //~ERROR `$s:stmt` is followed by `in` + | ^^ + +error: `$s:stmt` is followed by `$p:pat`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:91:14 + | +LL | ($s:stmt $p:pat) => {}; //~ERROR `$s:stmt` is followed by `$p:pat` + | ^^^^^^ + +error: `$s:stmt` is followed by `$e:expr`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:92:14 + | +LL | ($s:stmt $e:expr) => {}; //~ERROR `$s:stmt` is followed by `$e:expr` + | ^^^^^^^ + +error: `$s:stmt` is followed by `$t:ty`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:93:14 + | +LL | ($s:stmt $t:ty) => {}; //~ERROR `$s:stmt` is followed by `$t:ty` + | ^^^^^ + +error: `$s:stmt` is followed by `$s:stmt`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:94:14 + | +LL | ($s:stmt $s:stmt) => {}; //~ERROR `$s:stmt` is followed by `$s:stmt` + | ^^^^^^^ + +error: `$s:stmt` is followed by `$p:path`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:95:14 + | +LL | ($s:stmt $p:path) => {}; //~ERROR `$s:stmt` is followed by `$p:path` + | ^^^^^^^ + +error: `$s:stmt` is followed by `$b:block`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:96:14 + | +LL | ($s:stmt $b:block) => {}; //~ERROR `$s:stmt` is followed by `$b:block` + | ^^^^^^^^ + +error: `$s:stmt` is followed by `$i:ident`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:97:14 + | +LL | ($s:stmt $i:ident) => {}; //~ERROR `$s:stmt` is followed by `$i:ident` + | ^^^^^^^^ + +error: `$s:stmt` is followed by `$t:tt`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:98:14 + | +LL | ($s:stmt $t:tt) => {}; //~ERROR `$s:stmt` is followed by `$t:tt` + | ^^^^^ + +error: `$s:stmt` is followed by `$i:item`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:99:14 + | +LL | ($s:stmt $i:item) => {}; //~ERROR `$s:stmt` is followed by `$i:item` + | ^^^^^^^ + +error: `$s:stmt` is followed by `$m:meta`, which is not allowed for `stmt` fragments + --> $DIR/macro-follow.rs:100:14 + | +LL | ($s:stmt $m:meta) => {}; //~ERROR `$s:stmt` is followed by `$m:meta` + | ^^^^^^^ + +error: `$p:path` is followed by `(`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:104:15 + | +LL | ($p:path ()) => {}; //~ERROR `$p:path` is followed by `(` + | ^ + +error: `$p:path` is followed by `+`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:106:14 + | +LL | ($p:path +) => {}; //~ERROR `$p:path` is followed by `+` + | ^ + +error: `$p:path` is followed by `ident`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:107:14 + | +LL | ($p:path ident) => {}; //~ERROR `$p:path` is followed by `ident` + | ^^^^^ + +error: `$p:path` is followed by `if`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:108:14 + | +LL | ($p:path if) => {}; //~ERROR `$p:path` is followed by `if` + | ^^ + +error: `$p:path` is followed by `$p:pat`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:109:14 + | +LL | ($p:path $p:pat) => {}; //~ERROR `$p:path` is followed by `$p:pat` + | ^^^^^^ + +error: `$p:path` is followed by `$e:expr`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:110:14 + | +LL | ($p:path $e:expr) => {}; //~ERROR `$p:path` is followed by `$e:expr` + | ^^^^^^^ + +error: `$p:path` is followed by `$t:ty`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:111:14 + | +LL | ($p:path $t:ty) => {}; //~ERROR `$p:path` is followed by `$t:ty` + | ^^^^^ + +error: `$p:path` is followed by `$s:stmt`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:112:14 + | +LL | ($p:path $s:stmt) => {}; //~ERROR `$p:path` is followed by `$s:stmt` + | ^^^^^^^ + +error: `$p:path` is followed by `$p:path`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:113:14 + | +LL | ($p:path $p:path) => {}; //~ERROR `$p:path` is followed by `$p:path` + | ^^^^^^^ + +error: `$p:path` is followed by `$i:ident`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:115:14 + | +LL | ($p:path $i:ident) => {}; //~ERROR `$p:path` is followed by `$i:ident` + | ^^^^^^^^ + +error: `$p:path` is followed by `$t:tt`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:116:14 + | +LL | ($p:path $t:tt) => {}; //~ERROR `$p:path` is followed by `$t:tt` + | ^^^^^ + +error: `$p:path` is followed by `$i:item`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:117:14 + | +LL | ($p:path $i:item) => {}; //~ERROR `$p:path` is followed by `$i:item` + | ^^^^^^^ + +error: `$p:path` is followed by `$m:meta`, which is not allowed for `path` fragments + --> $DIR/macro-follow.rs:118:14 + | +LL | ($p:path $m:meta) => {}; //~ERROR `$p:path` is followed by `$m:meta` + | ^^^^^^^ + +error: aborting due to 85 previous errors + diff --git a/src/test/compile-fail/macro-followed-by-seq-bad.rs b/src/test/ui/compile-fail-migration/macro-followed-by-seq-bad.rs index 21cc946ded6..21cc946ded6 100644 --- a/src/test/compile-fail/macro-followed-by-seq-bad.rs +++ b/src/test/ui/compile-fail-migration/macro-followed-by-seq-bad.rs diff --git a/src/test/ui/compile-fail-migration/macro-followed-by-seq-bad.stderr b/src/test/ui/compile-fail-migration/macro-followed-by-seq-bad.stderr new file mode 100644 index 00000000000..bb070334d36 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-followed-by-seq-bad.stderr @@ -0,0 +1,14 @@ +error: `$a:expr` is followed by `$b:tt`, which is not allowed for `expr` fragments + --> $DIR/macro-followed-by-seq-bad.rs:17:15 + | +LL | ( $a:expr $($b:tt)* ) => { }; //~ ERROR not allowed for `expr` fragments + | ^^^^^ + +error: `$a:ty` is followed by `$b:tt`, which is not allowed for `ty` fragments + --> $DIR/macro-followed-by-seq-bad.rs:18:13 + | +LL | ( $a:ty $($b:tt)* ) => { }; //~ ERROR not allowed for `ty` fragments + | ^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/macro-inner-attributes.rs b/src/test/ui/compile-fail-migration/macro-inner-attributes.rs index 1111b21d455..1111b21d455 100644 --- a/src/test/compile-fail/macro-inner-attributes.rs +++ b/src/test/ui/compile-fail-migration/macro-inner-attributes.rs diff --git a/src/test/ui/compile-fail-migration/macro-inner-attributes.stderr b/src/test/ui/compile-fail-migration/macro-inner-attributes.stderr new file mode 100644 index 00000000000..11922bc448b --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-inner-attributes.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `a` + --> $DIR/macro-inner-attributes.rs:27:5 + | +LL | a::bar(); + | ^ Use of undeclared type or module `a` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/macro-input-future-proofing.rs b/src/test/ui/compile-fail-migration/macro-input-future-proofing.rs index e5fdba63b0f..e5fdba63b0f 100644 --- a/src/test/compile-fail/macro-input-future-proofing.rs +++ b/src/test/ui/compile-fail-migration/macro-input-future-proofing.rs diff --git a/src/test/ui/compile-fail-migration/macro-input-future-proofing.stderr b/src/test/ui/compile-fail-migration/macro-input-future-proofing.stderr new file mode 100644 index 00000000000..aed7a8a119c --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-input-future-proofing.stderr @@ -0,0 +1,56 @@ +error: `$ty:ty` is followed by `<`, which is not allowed for `ty` fragments + --> $DIR/macro-input-future-proofing.rs:14:13 + | +LL | ($ty:ty <) => (); //~ ERROR `$ty:ty` is followed by `<`, which is not allowed for `ty` + | ^ + +error: `$ty:ty` is followed by `<`, which is not allowed for `ty` fragments + --> $DIR/macro-input-future-proofing.rs:15:13 + | +LL | ($ty:ty < foo ,) => (); //~ ERROR `$ty:ty` is followed by `<`, which is not allowed for `ty` + | ^ + +error: `$pa:pat` is followed by `>`, which is not allowed for `pat` fragments + --> $DIR/macro-input-future-proofing.rs:21:14 + | +LL | ($pa:pat >) => (); //~ ERROR `$pa:pat` is followed by `>`, which is not allowed for `pat` + | ^ + +error: `$pa:pat` is followed by `$pb:pat`, which is not allowed for `pat` fragments + --> $DIR/macro-input-future-proofing.rs:23:14 + | +LL | ($pa:pat $pb:pat $ty:ty ,) => (); + | ^^^^^^^ + +error: `$pb:pat` is followed by `$ty:ty`, which is not allowed for `pat` fragments + --> $DIR/macro-input-future-proofing.rs:23:22 + | +LL | ($pa:pat $pb:pat $ty:ty ,) => (); + | ^^^^^^ + +error: `$ty:ty` is followed by `-`, which is not allowed for `ty` fragments + --> $DIR/macro-input-future-proofing.rs:26:17 + | +LL | ($($ty:ty)* -) => (); //~ ERROR `$ty:ty` is followed by `-` + | ^ + +error: `$b:ty` is followed by `-`, which is not allowed for `ty` fragments + --> $DIR/macro-input-future-proofing.rs:27:23 + | +LL | ($($a:ty, $b:ty)* -) => (); //~ ERROR `$b:ty` is followed by `-` + | ^ + +error: `$ty:ty` is followed by `-`, which is not allowed for `ty` fragments + --> $DIR/macro-input-future-proofing.rs:28:7 + | +LL | ($($ty:ty)-+) => (); //~ ERROR `$ty:ty` is followed by `-`, which is not allowed for `ty` + | ^^^^^^^^ + +error: `$a:expr` is followed by `$b:tt`, which is not allowed for `expr` fragments + --> $DIR/macro-input-future-proofing.rs:29:21 + | +LL | ( $($a:expr)* $($b:tt)* ) => { }; + | ^^^^^ + +error: aborting due to 9 previous errors + diff --git a/src/test/compile-fail/macro-local-data-key-priv.rs b/src/test/ui/compile-fail-migration/macro-local-data-key-priv.rs index 3ae629cd895..3ae629cd895 100644 --- a/src/test/compile-fail/macro-local-data-key-priv.rs +++ b/src/test/ui/compile-fail-migration/macro-local-data-key-priv.rs diff --git a/src/test/ui/compile-fail-migration/macro-local-data-key-priv.stderr b/src/test/ui/compile-fail-migration/macro-local-data-key-priv.stderr new file mode 100644 index 00000000000..57f4f790cb1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-local-data-key-priv.stderr @@ -0,0 +1,9 @@ +error[E0603]: constant `baz` is private + --> $DIR/macro-local-data-key-priv.rs:18:5 + | +LL | bar::baz.with(|_| ()); + | ^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/macro-match-nonterminal.rs b/src/test/ui/compile-fail-migration/macro-match-nonterminal.rs index 6cca729e2c2..6cca729e2c2 100644 --- a/src/test/compile-fail/macro-match-nonterminal.rs +++ b/src/test/ui/compile-fail-migration/macro-match-nonterminal.rs diff --git a/src/test/ui/compile-fail-migration/macro-match-nonterminal.stderr b/src/test/ui/compile-fail-migration/macro-match-nonterminal.stderr new file mode 100644 index 00000000000..26648c443cb --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-match-nonterminal.stderr @@ -0,0 +1,8 @@ +error: missing fragment specifier + --> $DIR/macro-match-nonterminal.rs:11:24 + | +LL | macro_rules! test { ($a, $b) => (()); } //~ ERROR missing fragment + | ^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-missing-delimiters.rs b/src/test/ui/compile-fail-migration/macro-missing-delimiters.rs index eed2a207e89..eed2a207e89 100644 --- a/src/test/compile-fail/macro-missing-delimiters.rs +++ b/src/test/ui/compile-fail-migration/macro-missing-delimiters.rs diff --git a/src/test/ui/compile-fail-migration/macro-missing-delimiters.stderr b/src/test/ui/compile-fail-migration/macro-missing-delimiters.stderr new file mode 100644 index 00000000000..eb43e39ea56 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-missing-delimiters.stderr @@ -0,0 +1,8 @@ +error: invalid macro matcher; matchers must be contained in balanced delimiters + --> $DIR/macro-missing-delimiters.rs:12:5 + | +LL | baz => () //~ ERROR invalid macro matcher; + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-missing-fragment.rs b/src/test/ui/compile-fail-migration/macro-missing-fragment.rs index 66f4ce55be8..66f4ce55be8 100644 --- a/src/test/compile-fail/macro-missing-fragment.rs +++ b/src/test/ui/compile-fail-migration/macro-missing-fragment.rs diff --git a/src/test/ui/compile-fail-migration/macro-missing-fragment.stderr b/src/test/ui/compile-fail-migration/macro-missing-fragment.stderr new file mode 100644 index 00000000000..48e07ed9dbd --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-missing-fragment.stderr @@ -0,0 +1,8 @@ +error: missing fragment specifier + --> $DIR/macro-missing-fragment.rs:12:20 + | +LL | ( $( any_token $field_rust_type )* ) => {}; //~ ERROR missing fragment + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-non-lifetime.rs b/src/test/ui/compile-fail-migration/macro-non-lifetime.rs index 647d7aaa759..647d7aaa759 100644 --- a/src/test/compile-fail/macro-non-lifetime.rs +++ b/src/test/ui/compile-fail-migration/macro-non-lifetime.rs diff --git a/src/test/ui/compile-fail-migration/macro-non-lifetime.stderr b/src/test/ui/compile-fail-migration/macro-non-lifetime.stderr new file mode 100644 index 00000000000..93b7f481842 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-non-lifetime.stderr @@ -0,0 +1,8 @@ +error: no rules expected the token `a` + --> $DIR/macro-non-lifetime.rs:18:8 + | +LL | m!(a); + | ^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-outer-attributes.rs b/src/test/ui/compile-fail-migration/macro-outer-attributes.rs index acb58596fe4..acb58596fe4 100644 --- a/src/test/compile-fail/macro-outer-attributes.rs +++ b/src/test/ui/compile-fail-migration/macro-outer-attributes.rs diff --git a/src/test/ui/compile-fail-migration/macro-outer-attributes.stderr b/src/test/ui/compile-fail-migration/macro-outer-attributes.stderr new file mode 100644 index 00000000000..4cc8cd5dc90 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-outer-attributes.stderr @@ -0,0 +1,13 @@ +error[E0425]: cannot find function `bar` in module `a` + --> $DIR/macro-outer-attributes.rs:28:8 + | +LL | a::bar(); //~ ERROR cannot find function `bar` in module `a` + | ^^^ not found in `a` +help: possible candidate is found in another module, you can import it into scope + | +LL | use b::bar; + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/macro-parameter-span.rs b/src/test/ui/compile-fail-migration/macro-parameter-span.rs index 3b168fec953..3b168fec953 100644 --- a/src/test/compile-fail/macro-parameter-span.rs +++ b/src/test/ui/compile-fail-migration/macro-parameter-span.rs diff --git a/src/test/ui/compile-fail-migration/macro-parameter-span.stderr b/src/test/ui/compile-fail-migration/macro-parameter-span.stderr new file mode 100644 index 00000000000..749221e9bf0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-parameter-span.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `x` in this scope + --> $DIR/macro-parameter-span.rs:21:9 + | +LL | x //~ ERROR cannot find value `x` in this scope + | ^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/macro-stability.rs b/src/test/ui/compile-fail-migration/macro-stability.rs index a4b922c0fe1..a4b922c0fe1 100644 --- a/src/test/compile-fail/macro-stability.rs +++ b/src/test/ui/compile-fail-migration/macro-stability.rs diff --git a/src/test/ui/compile-fail-migration/macro-stability.stderr b/src/test/ui/compile-fail-migration/macro-stability.stderr new file mode 100644 index 00000000000..947133f287d --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-stability.stderr @@ -0,0 +1,11 @@ +error[E0658]: macro unstable_macro! is unstable + --> $DIR/macro-stability.rs:21:5 + | +LL | unstable_macro!(); //~ ERROR: macro unstable_macro! is unstable + | ^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unstable_macros)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/macro-stmt-matchers.rs b/src/test/ui/compile-fail-migration/macro-stmt-matchers.rs index 8f46d3301eb..8f46d3301eb 100644 --- a/src/test/compile-fail/macro-stmt-matchers.rs +++ b/src/test/ui/compile-fail-migration/macro-stmt-matchers.rs diff --git a/src/test/ui/compile-fail-migration/macro-stmt-matchers.stderr b/src/test/ui/compile-fail-migration/macro-stmt-matchers.stderr new file mode 100644 index 00000000000..ef6210bb6f7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-stmt-matchers.stderr @@ -0,0 +1,11 @@ +error: compilation successful + --> $DIR/macro-stmt-matchers.rs:14:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | macro_rules! m { ($s:stmt;) => { $s } } +LL | | m!(vec![].push(0);); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-tt-matchers.rs b/src/test/ui/compile-fail-migration/macro-tt-matchers.rs index 7255e7d00b6..7255e7d00b6 100644 --- a/src/test/compile-fail/macro-tt-matchers.rs +++ b/src/test/ui/compile-fail-migration/macro-tt-matchers.rs diff --git a/src/test/ui/compile-fail-migration/macro-tt-matchers.stderr b/src/test/ui/compile-fail-migration/macro-tt-matchers.stderr new file mode 100644 index 00000000000..b7551c1bd93 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-tt-matchers.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/macro-tt-matchers.rs:21:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-use-bad-args-1.rs b/src/test/ui/compile-fail-migration/macro-use-bad-args-1.rs index a07cc834411..a07cc834411 100644 --- a/src/test/compile-fail/macro-use-bad-args-1.rs +++ b/src/test/ui/compile-fail-migration/macro-use-bad-args-1.rs diff --git a/src/test/ui/compile-fail-migration/macro-use-bad-args-1.stderr b/src/test/ui/compile-fail-migration/macro-use-bad-args-1.stderr new file mode 100644 index 00000000000..19a8c7c0382 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-use-bad-args-1.stderr @@ -0,0 +1,14 @@ +error[E0466]: bad macro import + --> $DIR/macro-use-bad-args-1.rs:14:13 + | +LL | #[macro_use(foo(bar))] //~ ERROR bad macro import + | ^^^^^^^^ + +error[E0601]: `main` function not found in crate `macro_use_bad_args_1` + | + = note: consider adding a `main` function to `$DIR/macro-use-bad-args-1.rs` + +error: aborting due to 2 previous errors + +Some errors occurred: E0466, E0601. +For more information about an error, try `rustc --explain E0466`. diff --git a/src/test/compile-fail/macro-use-bad-args-2.rs b/src/test/ui/compile-fail-migration/macro-use-bad-args-2.rs index 89004f16897..89004f16897 100644 --- a/src/test/compile-fail/macro-use-bad-args-2.rs +++ b/src/test/ui/compile-fail-migration/macro-use-bad-args-2.rs diff --git a/src/test/ui/compile-fail-migration/macro-use-bad-args-2.stderr b/src/test/ui/compile-fail-migration/macro-use-bad-args-2.stderr new file mode 100644 index 00000000000..0ac18201d79 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-use-bad-args-2.stderr @@ -0,0 +1,14 @@ +error[E0466]: bad macro import + --> $DIR/macro-use-bad-args-2.rs:14:13 + | +LL | #[macro_use(foo="bar")] //~ ERROR bad macro import + | ^^^^^^^^^ + +error[E0601]: `main` function not found in crate `macro_use_bad_args_2` + | + = note: consider adding a `main` function to `$DIR/macro-use-bad-args-2.rs` + +error: aborting due to 2 previous errors + +Some errors occurred: E0466, E0601. +For more information about an error, try `rustc --explain E0466`. diff --git a/src/test/compile-fail/macro-use-scope.rs b/src/test/ui/compile-fail-migration/macro-use-scope.rs index 9d389413ba9..9d389413ba9 100644 --- a/src/test/compile-fail/macro-use-scope.rs +++ b/src/test/ui/compile-fail-migration/macro-use-scope.rs diff --git a/src/test/ui/compile-fail-migration/macro-use-scope.stderr b/src/test/ui/compile-fail-migration/macro-use-scope.stderr new file mode 100644 index 00000000000..2e81750d43b --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-use-scope.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/macro-use-scope.rs:32:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-use-undef.rs b/src/test/ui/compile-fail-migration/macro-use-undef.rs index dd725aae95e..dd725aae95e 100644 --- a/src/test/compile-fail/macro-use-undef.rs +++ b/src/test/ui/compile-fail-migration/macro-use-undef.rs diff --git a/src/test/ui/compile-fail-migration/macro-use-undef.stderr b/src/test/ui/compile-fail-migration/macro-use-undef.stderr new file mode 100644 index 00000000000..6fc57a34794 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-use-undef.stderr @@ -0,0 +1,9 @@ +error[E0469]: imported macro not found + --> $DIR/macro-use-undef.rs:13:24 + | +LL | #[macro_use(macro_two, no_way)] //~ ERROR imported macro not found + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0469`. diff --git a/src/test/compile-fail/macro-use-wrong-name.rs b/src/test/ui/compile-fail-migration/macro-use-wrong-name.rs index 143ecb4ce5e..143ecb4ce5e 100644 --- a/src/test/compile-fail/macro-use-wrong-name.rs +++ b/src/test/ui/compile-fail-migration/macro-use-wrong-name.rs diff --git a/src/test/ui/compile-fail-migration/macro-use-wrong-name.stderr b/src/test/ui/compile-fail-migration/macro-use-wrong-name.stderr new file mode 100644 index 00000000000..26271a21623 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-use-wrong-name.stderr @@ -0,0 +1,8 @@ +error: cannot find macro `macro_two!` in this scope + --> $DIR/macro-use-wrong-name.rs:17:5 + | +LL | macro_two!(); + | ^^^^^^^^^ help: you could try the macro: `macro_one` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/macro-with-seps-err-msg.rs b/src/test/ui/compile-fail-migration/macro-with-seps-err-msg.rs index 1281adce5c5..1281adce5c5 100644 --- a/src/test/compile-fail/macro-with-seps-err-msg.rs +++ b/src/test/ui/compile-fail-migration/macro-with-seps-err-msg.rs diff --git a/src/test/ui/compile-fail-migration/macro-with-seps-err-msg.stderr b/src/test/ui/compile-fail-migration/macro-with-seps-err-msg.stderr new file mode 100644 index 00000000000..a19d3337282 --- /dev/null +++ b/src/test/ui/compile-fail-migration/macro-with-seps-err-msg.stderr @@ -0,0 +1,27 @@ +error[E0658]: non-ident macro paths are experimental (see issue #35896) + --> $DIR/macro-with-seps-err-msg.rs:16:5 + | +LL | globnar::brotz!(); //~ ERROR non-ident macro paths are experimental + | ^^^^^^^^^^^^^^ + | + = help: add #![feature(use_extern_macros)] to the crate attributes to enable + +error[E0658]: non-ident macro paths are experimental (see issue #35896) + --> $DIR/macro-with-seps-err-msg.rs:17:14 + | +LL | #[derive(foo::Bar)] struct T; //~ ERROR non-ident macro paths are experimental + | ^^^^^^^^ + | + = help: add #![feature(use_extern_macros)] to the crate attributes to enable + +error[E0658]: non-ident macro paths are experimental (see issue #35896) + --> $DIR/macro-with-seps-err-msg.rs:18:5 + | +LL | ::foo!(); //~ ERROR non-ident macro paths are experimental + | ^^^^^ + | + = help: add #![feature(use_extern_macros)] to the crate attributes to enable + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/macros-in-extern.rs b/src/test/ui/compile-fail-migration/macros-in-extern.rs index 40053853b15..40053853b15 100644 --- a/src/test/compile-fail/macros-in-extern.rs +++ b/src/test/ui/compile-fail-migration/macros-in-extern.rs diff --git a/src/test/ui/compile-fail-migration/macros-in-extern.stderr b/src/test/ui/compile-fail-migration/macros-in-extern.stderr new file mode 100644 index 00000000000..ffac282040c --- /dev/null +++ b/src/test/ui/compile-fail-migration/macros-in-extern.stderr @@ -0,0 +1,27 @@ +error[E0658]: macro and proc-macro invocations in `extern {}` blocks are experimental. (see issue #49476) + --> $DIR/macros-in-extern.rs:36:5 + | +LL | returns_isize!(rust_get_test_int); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(macros_in_extern)] to the crate attributes to enable + +error[E0658]: macro and proc-macro invocations in `extern {}` blocks are experimental. (see issue #49476) + --> $DIR/macros-in-extern.rs:38:5 + | +LL | takes_u32_returns_u32!(rust_dbg_extern_identity_u32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(macros_in_extern)] to the crate attributes to enable + +error[E0658]: macro and proc-macro invocations in `extern {}` blocks are experimental. (see issue #49476) + --> $DIR/macros-in-extern.rs:40:5 + | +LL | emits_nothing!(); + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(macros_in_extern)] to the crate attributes to enable + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/macros-nonfatal-errors.rs b/src/test/ui/compile-fail-migration/macros-nonfatal-errors.rs index 7046ee12b50..7046ee12b50 100644 --- a/src/test/compile-fail/macros-nonfatal-errors.rs +++ b/src/test/ui/compile-fail-migration/macros-nonfatal-errors.rs diff --git a/src/test/ui/compile-fail-migration/macros-nonfatal-errors.stderr b/src/test/ui/compile-fail-migration/macros-nonfatal-errors.stderr new file mode 100644 index 00000000000..c44dcfd12af --- /dev/null +++ b/src/test/ui/compile-fail-migration/macros-nonfatal-errors.stderr @@ -0,0 +1,100 @@ +error[E0665]: `Default` cannot be derived for enums, only structs + --> $DIR/macros-nonfatal-errors.rs:17:10 + | +LL | #[derive(Default)] //~ ERROR + | ^^^^^^^ + +error: inline assembly must be a string literal + --> $DIR/macros-nonfatal-errors.rs:21:10 + | +LL | asm!(invalid); //~ ERROR + | ^^^^^^^ + +error: concat_idents! requires ident args. + --> $DIR/macros-nonfatal-errors.rs:23:5 + | +LL | concat_idents!("not", "idents"); //~ ERROR + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: argument must be a string literal + --> $DIR/macros-nonfatal-errors.rs:25:17 + | +LL | option_env!(invalid); //~ ERROR + | ^^^^^^^ + +error: expected string literal + --> $DIR/macros-nonfatal-errors.rs:26:10 + | +LL | env!(invalid); //~ ERROR + | ^^^^^^^ + +error: expected string literal + --> $DIR/macros-nonfatal-errors.rs:27:10 + | +LL | env!(foo, abr, baz); //~ ERROR + | ^^^ + +error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined + --> $DIR/macros-nonfatal-errors.rs:28:5 + | +LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0658]: non-ident macro paths are experimental (see issue #35896) + --> $DIR/macros-nonfatal-errors.rs:30:5 + | +LL | foo::blah!(); //~ ERROR + | ^^^^^^^^^ + | + = help: add #![feature(use_extern_macros)] to the crate attributes to enable + +error: format argument must be a string literal + --> $DIR/macros-nonfatal-errors.rs:32:13 + | +LL | format!(invalid); //~ ERROR + | ^^^^^^^ +help: you might be missing a string literal to format with + | +LL | format!("{}", invalid); //~ ERROR + | ^^^^^ + +error: argument must be a string literal + --> $DIR/macros-nonfatal-errors.rs:34:14 + | +LL | include!(invalid); //~ ERROR + | ^^^^^^^ + +error: argument must be a string literal + --> $DIR/macros-nonfatal-errors.rs:36:18 + | +LL | include_str!(invalid); //~ ERROR + | ^^^^^^^ + +error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2) + --> $DIR/macros-nonfatal-errors.rs:37:5 + | +LL | include_str!("i'd be quite surprised if a file with this name existed"); //~ ERROR + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: argument must be a string literal + --> $DIR/macros-nonfatal-errors.rs:38:20 + | +LL | include_bytes!(invalid); //~ ERROR + | ^^^^^^^ + +error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2) + --> $DIR/macros-nonfatal-errors.rs:39:5 + | +LL | include_bytes!("i'd be quite surprised if a file with this name existed"); //~ ERROR + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: trace_macros! accepts only `true` or `false` + --> $DIR/macros-nonfatal-errors.rs:41:5 + | +LL | trace_macros!(invalid); //~ ERROR + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 15 previous errors + +Some errors occurred: E0658, E0665. +For more information about an error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/main-wrong-type.rs b/src/test/ui/compile-fail-migration/main-wrong-type.rs index 402cd3a2d31..402cd3a2d31 100644 --- a/src/test/compile-fail/main-wrong-type.rs +++ b/src/test/ui/compile-fail-migration/main-wrong-type.rs diff --git a/src/test/ui/compile-fail-migration/main-wrong-type.stderr b/src/test/ui/compile-fail-migration/main-wrong-type.stderr new file mode 100644 index 00000000000..15094bd1fbb --- /dev/null +++ b/src/test/ui/compile-fail-migration/main-wrong-type.stderr @@ -0,0 +1,12 @@ +error[E0580]: main function has wrong type + --> $DIR/main-wrong-type.rs:16:1 + | +LL | fn main(foo: S) { + | ^^^^^^^^^^^^^^^ incorrect number of function parameters + | + = note: expected type `fn()` + found type `fn(S)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0580`. diff --git a/src/test/compile-fail/malformed-derive-entry.rs b/src/test/ui/compile-fail-migration/malformed-derive-entry.rs index ac000628f2b..ac000628f2b 100644 --- a/src/test/compile-fail/malformed-derive-entry.rs +++ b/src/test/ui/compile-fail-migration/malformed-derive-entry.rs diff --git a/src/test/ui/compile-fail-migration/malformed-derive-entry.stderr b/src/test/ui/compile-fail-migration/malformed-derive-entry.stderr new file mode 100644 index 00000000000..b1984f52430 --- /dev/null +++ b/src/test/ui/compile-fail-migration/malformed-derive-entry.stderr @@ -0,0 +1,26 @@ +error: expected one of `)`, `,`, or `::`, found `(` + --> $DIR/malformed-derive-entry.rs:11:14 + | +LL | #[derive(Copy(Bad))] + | ^ expected one of `)`, `,`, or `::` here + +error: expected one of `)`, `,`, or `::`, found `=` + --> $DIR/malformed-derive-entry.rs:15:14 + | +LL | #[derive(Copy="bad")] + | ^ expected one of `)`, `,`, or `::` here + +warning: empty trait list in `derive` + --> $DIR/malformed-derive-entry.rs:19:1 + | +LL | #[derive()] + | ^^^^^^^^^^^ + +warning: empty trait list in `derive` + --> $DIR/malformed-derive-entry.rs:23:1 + | +LL | #[derive] + | ^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/malformed-plugin-1.rs b/src/test/ui/compile-fail-migration/malformed-plugin-1.rs index 214a5e5e3eb..214a5e5e3eb 100644 --- a/src/test/compile-fail/malformed-plugin-1.rs +++ b/src/test/ui/compile-fail-migration/malformed-plugin-1.rs diff --git a/src/test/ui/compile-fail-migration/malformed-plugin-1.stderr b/src/test/ui/compile-fail-migration/malformed-plugin-1.stderr new file mode 100644 index 00000000000..5ceabc3b8ba --- /dev/null +++ b/src/test/ui/compile-fail-migration/malformed-plugin-1.stderr @@ -0,0 +1,9 @@ +error[E0498]: malformed plugin attribute + --> $DIR/malformed-plugin-1.rs:12:1 + | +LL | #![plugin] //~ ERROR malformed plugin attribute + | ^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0498`. diff --git a/src/test/compile-fail/malformed-plugin-2.rs b/src/test/ui/compile-fail-migration/malformed-plugin-2.rs index 1b112608bee..1b112608bee 100644 --- a/src/test/compile-fail/malformed-plugin-2.rs +++ b/src/test/ui/compile-fail-migration/malformed-plugin-2.rs diff --git a/src/test/ui/compile-fail-migration/malformed-plugin-2.stderr b/src/test/ui/compile-fail-migration/malformed-plugin-2.stderr new file mode 100644 index 00000000000..56c87f9f8dd --- /dev/null +++ b/src/test/ui/compile-fail-migration/malformed-plugin-2.stderr @@ -0,0 +1,9 @@ +error[E0498]: malformed plugin attribute + --> $DIR/malformed-plugin-2.rs:12:1 + | +LL | #![plugin="bleh"] //~ ERROR malformed plugin attribute + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0498`. diff --git a/src/test/compile-fail/malformed-plugin-3.rs b/src/test/ui/compile-fail-migration/malformed-plugin-3.rs index 0c948831de2..0c948831de2 100644 --- a/src/test/compile-fail/malformed-plugin-3.rs +++ b/src/test/ui/compile-fail-migration/malformed-plugin-3.rs diff --git a/src/test/ui/compile-fail-migration/malformed-plugin-3.stderr b/src/test/ui/compile-fail-migration/malformed-plugin-3.stderr new file mode 100644 index 00000000000..fff52c649e8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/malformed-plugin-3.stderr @@ -0,0 +1,9 @@ +error[E0498]: malformed plugin attribute + --> $DIR/malformed-plugin-3.rs:12:1 + | +LL | #![plugin(foo="bleh")] //~ ERROR malformed plugin attribute + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0498`. diff --git a/src/test/compile-fail/malformed_macro_lhs.rs b/src/test/ui/compile-fail-migration/malformed_macro_lhs.rs index 0b437be5393..0b437be5393 100644 --- a/src/test/compile-fail/malformed_macro_lhs.rs +++ b/src/test/ui/compile-fail-migration/malformed_macro_lhs.rs diff --git a/src/test/ui/compile-fail-migration/malformed_macro_lhs.stderr b/src/test/ui/compile-fail-migration/malformed_macro_lhs.stderr new file mode 100644 index 00000000000..6b4241890b1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/malformed_macro_lhs.stderr @@ -0,0 +1,8 @@ +error: invalid macro matcher; matchers must be contained in balanced delimiters + --> $DIR/malformed_macro_lhs.rs:12:5 + | +LL | t => (1); //~ ERROR invalid macro matcher + | ^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/manual-link-bad-form.rs b/src/test/ui/compile-fail-migration/manual-link-bad-form.rs index fc4fa838a56..fc4fa838a56 100644 --- a/src/test/compile-fail/manual-link-bad-form.rs +++ b/src/test/ui/compile-fail-migration/manual-link-bad-form.rs diff --git a/src/test/ui/compile-fail-migration/manual-link-bad-form.stderr b/src/test/ui/compile-fail-migration/manual-link-bad-form.stderr new file mode 100644 index 00000000000..ed3c4c4fc4d --- /dev/null +++ b/src/test/ui/compile-fail-migration/manual-link-bad-form.stderr @@ -0,0 +1,4 @@ +error: empty library name given via `-l` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/manual-link-bad-kind.rs b/src/test/ui/compile-fail-migration/manual-link-bad-kind.rs index e9cbdb09948..e9cbdb09948 100644 --- a/src/test/compile-fail/manual-link-bad-kind.rs +++ b/src/test/ui/compile-fail-migration/manual-link-bad-kind.rs diff --git a/src/test/ui/compile-fail-migration/manual-link-bad-kind.stderr b/src/test/ui/compile-fail-migration/manual-link-bad-kind.stderr new file mode 100644 index 00000000000..03c33a97512 --- /dev/null +++ b/src/test/ui/compile-fail-migration/manual-link-bad-kind.stderr @@ -0,0 +1,2 @@ +error: unknown library kind `bar`, expected one of dylib, framework, or static + diff --git a/src/test/compile-fail/manual-link-bad-search-path.rs b/src/test/ui/compile-fail-migration/manual-link-bad-search-path.rs index 2bf61cbe24c..2bf61cbe24c 100644 --- a/src/test/compile-fail/manual-link-bad-search-path.rs +++ b/src/test/ui/compile-fail-migration/manual-link-bad-search-path.rs diff --git a/src/test/ui/compile-fail-migration/manual-link-bad-search-path.stderr b/src/test/ui/compile-fail-migration/manual-link-bad-search-path.stderr new file mode 100644 index 00000000000..2c0649ea152 --- /dev/null +++ b/src/test/ui/compile-fail-migration/manual-link-bad-search-path.stderr @@ -0,0 +1,2 @@ +error: empty search path given via `-L` + diff --git a/src/test/compile-fail/manual-link-framework.rs b/src/test/ui/compile-fail-migration/manual-link-framework.rs index 1ecf63813e9..1ecf63813e9 100644 --- a/src/test/compile-fail/manual-link-framework.rs +++ b/src/test/ui/compile-fail-migration/manual-link-framework.rs diff --git a/src/test/ui/compile-fail-migration/manual-link-framework.stderr b/src/test/ui/compile-fail-migration/manual-link-framework.stderr new file mode 100644 index 00000000000..3e8da8b2f93 --- /dev/null +++ b/src/test/ui/compile-fail-migration/manual-link-framework.stderr @@ -0,0 +1,4 @@ +error: native frameworks are only available on macOS targets + +error: aborting due to previous error + diff --git a/src/test/compile-fail/map-types.rs b/src/test/ui/compile-fail-migration/map-types.rs index e8ff9e817af..e8ff9e817af 100644 --- a/src/test/compile-fail/map-types.rs +++ b/src/test/ui/compile-fail-migration/map-types.rs diff --git a/src/test/ui/compile-fail-migration/map-types.stderr b/src/test/ui/compile-fail-migration/map-types.stderr new file mode 100644 index 00000000000..722113c7525 --- /dev/null +++ b/src/test/ui/compile-fail-migration/map-types.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `std::boxed::Box<dyn Map<isize, isize>>: Map<usize, isize>` is not satisfied + --> $DIR/map-types.rs:27:37 + | +LL | let y: Box<Map<usize, isize>> = Box::new(x); + | ^^^^^^^^^^^ the trait `Map<usize, isize>` is not implemented for `std::boxed::Box<dyn Map<isize, isize>>` + | + = note: required for the cast to the object type `dyn Map<usize, isize>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/match-argm-statics-2.rs b/src/test/ui/compile-fail-migration/match-argm-statics-2.rs index 70e148627c4..70e148627c4 100644 --- a/src/test/compile-fail/match-argm-statics-2.rs +++ b/src/test/ui/compile-fail-migration/match-argm-statics-2.rs diff --git a/src/test/ui/compile-fail-migration/match-argm-statics-2.stderr b/src/test/ui/compile-fail-migration/match-argm-statics-2.stderr new file mode 100644 index 00000000000..485b2a3202f --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-argm-statics-2.stderr @@ -0,0 +1,21 @@ +error[E0004]: non-exhaustive patterns: `(true, false)` not covered + --> $DIR/match-argm-statics-2.rs:27:11 + | +LL | match (true, false) { + | ^^^^^^^^^^^^^ pattern `(true, false)` not covered + +error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered + --> $DIR/match-argm-statics-2.rs:39:11 + | +LL | match Some(Some(North)) { + | ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered + +error[E0004]: non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }` not covered + --> $DIR/match-argm-statics-2.rs:58:11 + | +LL | match (Foo { bar: Some(North), baz: NewBool(true) }) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `Foo { bar: Some(North), baz: NewBool(true) }` not covered + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/match-arm-statics.rs b/src/test/ui/compile-fail-migration/match-arm-statics.rs index 40d73ab51c7..40d73ab51c7 100644 --- a/src/test/compile-fail/match-arm-statics.rs +++ b/src/test/ui/compile-fail-migration/match-arm-statics.rs diff --git a/src/test/ui/compile-fail-migration/match-arm-statics.stderr b/src/test/ui/compile-fail-migration/match-arm-statics.stderr new file mode 100644 index 00000000000..8862be2254f --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-arm-statics.stderr @@ -0,0 +1,26 @@ +error: unreachable pattern + --> $DIR/match-arm-statics.rs:35:9 + | +LL | (true, true) => () + | ^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/match-arm-statics.rs:12:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/match-arm-statics.rs:50:9 + | +LL | Some(Some(East)) => (), + | ^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/match-arm-statics.rs:70:9 + | +LL | Foo { bar: Some(EAST), baz: NewBool(false) } => () + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/match-byte-array-patterns-2.rs b/src/test/ui/compile-fail-migration/match-byte-array-patterns-2.rs index abb770df107..abb770df107 100644 --- a/src/test/compile-fail/match-byte-array-patterns-2.rs +++ b/src/test/ui/compile-fail-migration/match-byte-array-patterns-2.rs diff --git a/src/test/ui/compile-fail-migration/match-byte-array-patterns-2.stderr b/src/test/ui/compile-fail-migration/match-byte-array-patterns-2.stderr new file mode 100644 index 00000000000..bc52376d824 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-byte-array-patterns-2.stderr @@ -0,0 +1,15 @@ +error[E0004]: non-exhaustive patterns: `&[_, _, _, _]` not covered + --> $DIR/match-byte-array-patterns-2.rs:14:11 + | +LL | match buf { //~ ERROR non-exhaustive + | ^^^ pattern `&[_, _, _, _]` not covered + +error[E0004]: non-exhaustive patterns: `&[]`, `&[_]`, `&[_, _]` and 3 more not covered + --> $DIR/match-byte-array-patterns-2.rs:20:11 + | +LL | match buf { //~ ERROR non-exhaustive + | ^^^ patterns `&[]`, `&[_]`, `&[_, _]` and 3 more not covered + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/match-byte-array-patterns.rs b/src/test/ui/compile-fail-migration/match-byte-array-patterns.rs index 9db4319b786..9db4319b786 100644 --- a/src/test/compile-fail/match-byte-array-patterns.rs +++ b/src/test/ui/compile-fail-migration/match-byte-array-patterns.rs diff --git a/src/test/ui/compile-fail-migration/match-byte-array-patterns.stderr b/src/test/ui/compile-fail-migration/match-byte-array-patterns.stderr new file mode 100644 index 00000000000..da3d57743aa --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-byte-array-patterns.stderr @@ -0,0 +1,56 @@ +error: unreachable pattern + --> $DIR/match-byte-array-patterns.rs:19:9 + | +LL | &[0x41, 0x41, 0x41, 0x41] => {} //~ ERROR unreachable pattern + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/match-byte-array-patterns.rs:12:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/match-byte-array-patterns.rs:25:9 + | +LL | b"AAAA" => {}, //~ ERROR unreachable pattern + | ^^^^^^^ + +error: unreachable pattern + --> $DIR/match-byte-array-patterns.rs:31:9 + | +LL | b"AAAA" => {}, //~ ERROR unreachable pattern + | ^^^^^^^ + +error: unreachable pattern + --> $DIR/match-byte-array-patterns.rs:37:9 + | +LL | b"AAAA" => {}, //~ ERROR unreachable pattern + | ^^^^^^^ + +error: unreachable pattern + --> $DIR/match-byte-array-patterns.rs:45:9 + | +LL | &[0x41, 0x41, 0x41, 0x41] => {} //~ ERROR unreachable pattern + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/match-byte-array-patterns.rs:51:9 + | +LL | b"AAAA" => {}, //~ ERROR unreachable pattern + | ^^^^^^^ + +error: unreachable pattern + --> $DIR/match-byte-array-patterns.rs:57:9 + | +LL | b"AAAA" => {}, //~ ERROR unreachable pattern + | ^^^^^^^ + +error: unreachable pattern + --> $DIR/match-byte-array-patterns.rs:63:9 + | +LL | b"AAAA" => {}, //~ ERROR unreachable pattern + | ^^^^^^^ + +error: aborting due to 8 previous errors + diff --git a/src/test/compile-fail/match-ill-type2.rs b/src/test/ui/compile-fail-migration/match-ill-type2.rs index aa47ea670fd..aa47ea670fd 100644 --- a/src/test/compile-fail/match-ill-type2.rs +++ b/src/test/ui/compile-fail-migration/match-ill-type2.rs diff --git a/src/test/ui/compile-fail-migration/match-ill-type2.stderr b/src/test/ui/compile-fail-migration/match-ill-type2.stderr new file mode 100644 index 00000000000..b649a38476e --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-ill-type2.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/match-ill-type2.rs:14:9 + | +LL | 2u32 => 1, //~ ERROR mismatched types + | ^^^^ expected i32, found u32 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/match-join.rs b/src/test/ui/compile-fail-migration/match-join.rs index 888094fd016..888094fd016 100644 --- a/src/test/compile-fail/match-join.rs +++ b/src/test/ui/compile-fail-migration/match-join.rs diff --git a/src/test/ui/compile-fail-migration/match-join.stderr b/src/test/ui/compile-fail-migration/match-join.stderr new file mode 100644 index 00000000000..a4a8a9d7174 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-join.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `x` in this scope + --> $DIR/match-join.rs:19:20 + | +LL | println!("{}", x); //~ ERROR cannot find value `x` in this scope + | ^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/match-no-arms-unreachable-after.rs b/src/test/ui/compile-fail-migration/match-no-arms-unreachable-after.rs index db08f5e5e66..db08f5e5e66 100644 --- a/src/test/compile-fail/match-no-arms-unreachable-after.rs +++ b/src/test/ui/compile-fail-migration/match-no-arms-unreachable-after.rs diff --git a/src/test/ui/compile-fail-migration/match-no-arms-unreachable-after.stderr b/src/test/ui/compile-fail-migration/match-no-arms-unreachable-after.stderr new file mode 100644 index 00000000000..35fae051870 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-no-arms-unreachable-after.stderr @@ -0,0 +1,14 @@ +error: unreachable statement + --> $DIR/match-no-arms-unreachable-after.rs:18:5 + | +LL | let x = 2; //~ ERROR unreachable + | ^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/match-no-arms-unreachable-after.rs:12:9 + | +LL | #![deny(unreachable_code)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/match-non-exhaustive.rs b/src/test/ui/compile-fail-migration/match-non-exhaustive.rs index a24d2ed4b7f..a24d2ed4b7f 100644 --- a/src/test/compile-fail/match-non-exhaustive.rs +++ b/src/test/ui/compile-fail-migration/match-non-exhaustive.rs diff --git a/src/test/ui/compile-fail-migration/match-non-exhaustive.stderr b/src/test/ui/compile-fail-migration/match-non-exhaustive.stderr new file mode 100644 index 00000000000..04f09caceed --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-non-exhaustive.stderr @@ -0,0 +1,15 @@ +error[E0004]: non-exhaustive patterns: `_` not covered + --> $DIR/match-non-exhaustive.rs:12:11 + | +LL | match 0 { 1 => () } //~ ERROR non-exhaustive patterns + | ^ pattern `_` not covered + +error[E0004]: non-exhaustive patterns: `_` not covered + --> $DIR/match-non-exhaustive.rs:13:11 + | +LL | match 0 { 0 if false => () } //~ ERROR non-exhaustive patterns + | ^ pattern `_` not covered + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/match-pattern-field-mismatch-2.rs b/src/test/ui/compile-fail-migration/match-pattern-field-mismatch-2.rs index aed9130d60e..aed9130d60e 100644 --- a/src/test/compile-fail/match-pattern-field-mismatch-2.rs +++ b/src/test/ui/compile-fail-migration/match-pattern-field-mismatch-2.rs diff --git a/src/test/ui/compile-fail-migration/match-pattern-field-mismatch-2.stderr b/src/test/ui/compile-fail-migration/match-pattern-field-mismatch-2.stderr new file mode 100644 index 00000000000..b43fa9149bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-pattern-field-mismatch-2.stderr @@ -0,0 +1,9 @@ +error[E0532]: expected tuple struct/variant, found unit variant `color::no_color` + --> $DIR/match-pattern-field-mismatch-2.rs:22:11 + | +LL | color::no_color(_) => { } + | ^^^^^^^^^^^^^^^ not a tuple struct/variant + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/compile-fail/match-pattern-field-mismatch.rs b/src/test/ui/compile-fail-migration/match-pattern-field-mismatch.rs index ddd5d633170..ddd5d633170 100644 --- a/src/test/compile-fail/match-pattern-field-mismatch.rs +++ b/src/test/ui/compile-fail-migration/match-pattern-field-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/match-pattern-field-mismatch.stderr b/src/test/ui/compile-fail-migration/match-pattern-field-mismatch.stderr new file mode 100644 index 00000000000..d975f9afc7c --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-pattern-field-mismatch.stderr @@ -0,0 +1,9 @@ +error[E0023]: this pattern has 2 fields, but the corresponding tuple variant has 3 fields + --> $DIR/match-pattern-field-mismatch.rs:20:11 + | +LL | color::rgb(_, _) => { } + | ^^^^^^^^^^^^^^^^ expected 3 fields, found 2 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0023`. diff --git a/src/test/compile-fail/match-privately-empty.rs b/src/test/ui/compile-fail-migration/match-privately-empty.rs index 8777ef2ffe3..8777ef2ffe3 100644 --- a/src/test/compile-fail/match-privately-empty.rs +++ b/src/test/ui/compile-fail-migration/match-privately-empty.rs diff --git a/src/test/ui/compile-fail-migration/match-privately-empty.stderr b/src/test/ui/compile-fail-migration/match-privately-empty.stderr new file mode 100644 index 00000000000..04b4ce00e9b --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-privately-empty.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered + --> $DIR/match-privately-empty.rs:23:11 + | +LL | match private::DATA { + | ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/match-range-fail-2.rs b/src/test/ui/compile-fail-migration/match-range-fail-2.rs index b42e2ff919a..b42e2ff919a 100644 --- a/src/test/compile-fail/match-range-fail-2.rs +++ b/src/test/ui/compile-fail-migration/match-range-fail-2.rs diff --git a/src/test/ui/compile-fail-migration/match-range-fail-2.stderr b/src/test/ui/compile-fail-migration/match-range-fail-2.stderr new file mode 100644 index 00000000000..616f74ed858 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-range-fail-2.stderr @@ -0,0 +1,22 @@ +error[E0030]: lower range bound must be less than or equal to upper + --> $DIR/match-range-fail-2.rs:15:9 + | +LL | 6 ..= 1 => { } + | ^ lower bound larger than upper bound + +error[E0579]: lower range bound must be less than upper + --> $DIR/match-range-fail-2.rs:21:9 + | +LL | 0 .. 0 => { } + | ^ + +error[E0030]: lower range bound must be less than or equal to upper + --> $DIR/match-range-fail-2.rs:27:9 + | +LL | 0xFFFF_FFFF_FFFF_FFFF ..= 1 => { } + | ^^^^^^^^^^^^^^^^^^^^^ lower bound larger than upper bound + +error: aborting due to 3 previous errors + +Some errors occurred: E0030, E0579. +For more information about an error, try `rustc --explain E0030`. diff --git a/src/test/compile-fail/match-range-fail-dominate.rs b/src/test/ui/compile-fail-migration/match-range-fail-dominate.rs index 256aa180f4a..256aa180f4a 100644 --- a/src/test/compile-fail/match-range-fail-dominate.rs +++ b/src/test/ui/compile-fail-migration/match-range-fail-dominate.rs diff --git a/src/test/ui/compile-fail-migration/match-range-fail-dominate.stderr b/src/test/ui/compile-fail-migration/match-range-fail-dominate.stderr new file mode 100644 index 00000000000..d75630e09c5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-range-fail-dominate.stderr @@ -0,0 +1,66 @@ +error: unreachable pattern + --> $DIR/match-range-fail-dominate.rs:22:7 + | +LL | 5 ... 6 => { } + | ^^^^^^^ + | +note: lint level defined here + --> $DIR/match-range-fail-dominate.rs:17:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/match-range-fail-dominate.rs:28:7 + | +LL | 4 ... 6 => { } + | ^^^^^^^ + +error: unreachable pattern + --> $DIR/match-range-fail-dominate.rs:34:7 + | +LL | 4 ... 6 => { } + | ^^^^^^^ + +error: unreachable pattern + --> $DIR/match-range-fail-dominate.rs:40:7 + | +LL | 'a' ... 'z' => {} + | ^^^^^^^^^^^ + +warning: floating-point types cannot be used in patterns + --> $DIR/match-range-fail-dominate.rs:45:7 + | +LL | 0.01f64 ... 6.5f64 => {} + | ^^^^^^^ + | + = note: #[warn(illegal_floating_point_literal_pattern)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> + +warning: floating-point types cannot be used in patterns + --> $DIR/match-range-fail-dominate.rs:45:19 + | +LL | 0.01f64 ... 6.5f64 => {} + | ^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> + +warning: floating-point types cannot be used in patterns + --> $DIR/match-range-fail-dominate.rs:46:7 + | +LL | 0.02f64 => {} + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> + +error: unreachable pattern + --> $DIR/match-range-fail-dominate.rs:46:7 + | +LL | 0.02f64 => {} + | ^^^^^^^ + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/match-range-fail.rs b/src/test/ui/compile-fail-migration/match-range-fail.rs index ca99b0c7b89..ca99b0c7b89 100644 --- a/src/test/compile-fail/match-range-fail.rs +++ b/src/test/ui/compile-fail-migration/match-range-fail.rs diff --git a/src/test/ui/compile-fail-migration/match-range-fail.stderr b/src/test/ui/compile-fail-migration/match-range-fail.stderr new file mode 100644 index 00000000000..dbc251020a9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-range-fail.stderr @@ -0,0 +1,31 @@ +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/match-range-fail.rs:13:9 + | +LL | "bar" ..= "foo" => { } + | ^^^^^^^^^^^^^^^ ranges require char or numeric types + | + = note: start type: &'static str + = note: end type: &'static str + +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/match-range-fail.rs:20:16 + | +LL | 10 ..= "what" => () + | ^^^^^^ ranges require char or numeric types + | + = note: start type: {integer} + = note: end type: &'static str + +error[E0308]: mismatched types + --> $DIR/match-range-fail.rs:27:9 + | +LL | 'c' ..= 100 => { } + | ^^^^^^^^^^^ expected integral variable, found char + | + = note: expected type `{integer}` + found type `char` + +error: aborting due to 3 previous errors + +Some errors occurred: E0029, E0308. +For more information about an error, try `rustc --explain E0029`. diff --git a/src/test/compile-fail/match-ref-ice.rs b/src/test/ui/compile-fail-migration/match-ref-ice.rs index cb8f8fad532..cb8f8fad532 100644 --- a/src/test/compile-fail/match-ref-ice.rs +++ b/src/test/ui/compile-fail-migration/match-ref-ice.rs diff --git a/src/test/ui/compile-fail-migration/match-ref-ice.stderr b/src/test/ui/compile-fail-migration/match-ref-ice.stderr new file mode 100644 index 00000000000..1dc87afddea --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-ref-ice.stderr @@ -0,0 +1,14 @@ +error: unreachable pattern + --> $DIR/match-ref-ice.rs:23:9 + | +LL | [1, 2, 3] => (), //~ ERROR unreachable pattern + | ^^^^^^^^^ + | +note: lint level defined here + --> $DIR/match-ref-ice.rs:11:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/match-ref-mut-invariance.nll.stderr b/src/test/ui/compile-fail-migration/match-ref-mut-invariance.nll.stderr new file mode 100644 index 00000000000..cabf933bb81 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-ref-mut-invariance.nll.stderr @@ -0,0 +1,21 @@ +warning: not reporting region error due to nll + --> $DIR/match-ref-mut-invariance.rs:20:37 + | +LL | match self.0 { ref mut x => x } //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/match-ref-mut-invariance.rs:19:49 + | +LL | impl<'b> S<'b> { + | -- lifetime `'b` defined here +LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { + | ____________--___________________________________^ + | | | + | | lifetime `'a` defined here +LL | | match self.0 { ref mut x => x } //~ ERROR mismatched types +LL | | } + | |_____^ requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/match-ref-mut-invariance.rs b/src/test/ui/compile-fail-migration/match-ref-mut-invariance.rs index c2b54a972bd..c2b54a972bd 100644 --- a/src/test/compile-fail/match-ref-mut-invariance.rs +++ b/src/test/ui/compile-fail-migration/match-ref-mut-invariance.rs diff --git a/src/test/ui/compile-fail-migration/match-ref-mut-invariance.stderr b/src/test/ui/compile-fail-migration/match-ref-mut-invariance.stderr new file mode 100644 index 00000000000..24677fe8597 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-ref-mut-invariance.stderr @@ -0,0 +1,22 @@ +error[E0308]: mismatched types + --> $DIR/match-ref-mut-invariance.rs:20:37 + | +LL | match self.0 { ref mut x => x } //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `&'a mut &'a i32` + found type `&'a mut &'b i32` +note: the lifetime 'a as defined on the method body at 19:12... + --> $DIR/match-ref-mut-invariance.rs:19:12 + | +LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { + | ^^ +note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 18:6 + --> $DIR/match-ref-mut-invariance.rs:18:6 + | +LL | impl<'b> S<'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/match-ref-mut-let-invariance.nll.stderr b/src/test/ui/compile-fail-migration/match-ref-mut-let-invariance.nll.stderr new file mode 100644 index 00000000000..f01a9f3a3b0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-ref-mut-let-invariance.nll.stderr @@ -0,0 +1,22 @@ +warning: not reporting region error due to nll + --> $DIR/match-ref-mut-let-invariance.rs:21:9 + | +LL | x //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/match-ref-mut-let-invariance.rs:19:49 + | +LL | impl<'b> S<'b> { + | -- lifetime `'b` defined here +LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { + | ____________--___________________________________^ + | | | + | | lifetime `'a` defined here +LL | | let ref mut x = self.0; +LL | | x //~ ERROR mismatched types +LL | | } + | |_____^ requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/match-ref-mut-let-invariance.rs b/src/test/ui/compile-fail-migration/match-ref-mut-let-invariance.rs index ea16c61dfd4..ea16c61dfd4 100644 --- a/src/test/compile-fail/match-ref-mut-let-invariance.rs +++ b/src/test/ui/compile-fail-migration/match-ref-mut-let-invariance.rs diff --git a/src/test/ui/compile-fail-migration/match-ref-mut-let-invariance.stderr b/src/test/ui/compile-fail-migration/match-ref-mut-let-invariance.stderr new file mode 100644 index 00000000000..cc096d68ebd --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-ref-mut-let-invariance.stderr @@ -0,0 +1,22 @@ +error[E0308]: mismatched types + --> $DIR/match-ref-mut-let-invariance.rs:21:9 + | +LL | x //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `&'a mut &'a i32` + found type `&'a mut &'b i32` +note: the lifetime 'a as defined on the method body at 19:12... + --> $DIR/match-ref-mut-let-invariance.rs:19:12 + | +LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { + | ^^ +note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 18:6 + --> $DIR/match-ref-mut-let-invariance.rs:18:6 + | +LL | impl<'b> S<'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/match-slice-patterns.rs b/src/test/ui/compile-fail-migration/match-slice-patterns.rs index a8ec95da3d8..a8ec95da3d8 100644 --- a/src/test/compile-fail/match-slice-patterns.rs +++ b/src/test/ui/compile-fail-migration/match-slice-patterns.rs diff --git a/src/test/ui/compile-fail-migration/match-slice-patterns.stderr b/src/test/ui/compile-fail-migration/match-slice-patterns.stderr new file mode 100644 index 00000000000..cefd7df8b78 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-slice-patterns.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `&[_, Some(_), None, _]` not covered + --> $DIR/match-slice-patterns.rs:14:11 + | +LL | match list { + | ^^^^ pattern `&[_, Some(_), None, _]` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/match-static-const-lc.rs b/src/test/ui/compile-fail-migration/match-static-const-lc.rs index afc858c0c29..afc858c0c29 100644 --- a/src/test/compile-fail/match-static-const-lc.rs +++ b/src/test/ui/compile-fail-migration/match-static-const-lc.rs diff --git a/src/test/ui/compile-fail-migration/match-static-const-lc.stderr b/src/test/ui/compile-fail-migration/match-static-const-lc.stderr new file mode 100644 index 00000000000..08eb5712875 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-static-const-lc.stderr @@ -0,0 +1,26 @@ +error: constant in pattern `a` should have an upper case name such as `A` + --> $DIR/match-static-const-lc.rs:21:13 + | +LL | (0, a) => 0, + | ^ + | +note: lint level defined here + --> $DIR/match-static-const-lc.rs:14:9 + | +LL | #![deny(non_upper_case_globals)] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: constant in pattern `aha` should have an upper case name such as `AHA` + --> $DIR/match-static-const-lc.rs:36:13 + | +LL | (0, aha) => 0, + | ^^^ + +error: constant in pattern `not_okay` should have an upper case name such as `NOT_OKAY` + --> $DIR/match-static-const-lc.rs:50:13 + | +LL | (0, not_okay) => 0, + | ^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/match-struct.rs b/src/test/ui/compile-fail-migration/match-struct.rs index 0dbdda1f9ba..0dbdda1f9ba 100644 --- a/src/test/compile-fail/match-struct.rs +++ b/src/test/ui/compile-fail-migration/match-struct.rs diff --git a/src/test/ui/compile-fail-migration/match-struct.stderr b/src/test/ui/compile-fail-migration/match-struct.stderr new file mode 100644 index 00000000000..43f17b2d747 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-struct.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/match-struct.rs:17:9 + | +LL | E::C(_) => (), + | ^^^^^^^ expected struct `S`, found enum `E` + | + = note: expected type `S` + found type `E` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/match-tag-nullary.rs b/src/test/ui/compile-fail-migration/match-tag-nullary.rs index 0fb26200359..0fb26200359 100644 --- a/src/test/compile-fail/match-tag-nullary.rs +++ b/src/test/ui/compile-fail-migration/match-tag-nullary.rs diff --git a/src/test/ui/compile-fail-migration/match-tag-nullary.stderr b/src/test/ui/compile-fail-migration/match-tag-nullary.stderr new file mode 100644 index 00000000000..869d8ac7747 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-tag-nullary.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/match-tag-nullary.rs:16:40 + | +LL | fn main() { let x: a = a::A; match x { b::B => { } } } + | ^^^^ expected enum `a`, found enum `b` + | + = note: expected type `a` + found type `b` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/match-tag-unary.rs b/src/test/ui/compile-fail-migration/match-tag-unary.rs index 48733fd423d..48733fd423d 100644 --- a/src/test/compile-fail/match-tag-unary.rs +++ b/src/test/ui/compile-fail-migration/match-tag-unary.rs diff --git a/src/test/ui/compile-fail-migration/match-tag-unary.stderr b/src/test/ui/compile-fail-migration/match-tag-unary.stderr new file mode 100644 index 00000000000..bb4deee2569 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-tag-unary.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/match-tag-unary.rs:16:43 + | +LL | fn main() { let x: a = a::A(0); match x { b::B(y) => { } } } + | ^^^^^^^ expected enum `a`, found enum `b` + | + = note: expected type `a` + found type `b` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/match-unreachable-warning-with-diverging-discrim.rs b/src/test/ui/compile-fail-migration/match-unreachable-warning-with-diverging-discrim.rs index aae0f3135d8..aae0f3135d8 100644 --- a/src/test/compile-fail/match-unreachable-warning-with-diverging-discrim.rs +++ b/src/test/ui/compile-fail-migration/match-unreachable-warning-with-diverging-discrim.rs diff --git a/src/test/ui/compile-fail-migration/match-unreachable-warning-with-diverging-discrim.stderr b/src/test/ui/compile-fail-migration/match-unreachable-warning-with-diverging-discrim.stderr new file mode 100644 index 00000000000..10a86f92fe1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-unreachable-warning-with-diverging-discrim.stderr @@ -0,0 +1,14 @@ +error: unreachable expression + --> $DIR/match-unreachable-warning-with-diverging-discrim.rs:15:5 + | +LL | match (return) { } //~ ERROR unreachable expression + | ^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/match-unreachable-warning-with-diverging-discrim.rs:12:9 + | +LL | #![deny(unreachable_code)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/match-unresolved-one-arm.rs b/src/test/ui/compile-fail-migration/match-unresolved-one-arm.rs index ea0f8db99e8..ea0f8db99e8 100644 --- a/src/test/compile-fail/match-unresolved-one-arm.rs +++ b/src/test/ui/compile-fail-migration/match-unresolved-one-arm.rs diff --git a/src/test/ui/compile-fail-migration/match-unresolved-one-arm.stderr b/src/test/ui/compile-fail-migration/match-unresolved-one-arm.stderr new file mode 100644 index 00000000000..fa689a8092b --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-unresolved-one-arm.stderr @@ -0,0 +1,12 @@ +error[E0282]: type annotations needed + --> $DIR/match-unresolved-one-arm.rs:14:9 + | +LL | let x = match () { //~ ERROR type annotations needed + | ^ + | | + | cannot infer type + | consider giving `x` a type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/compile-fail/match-vec-fixed.rs b/src/test/ui/compile-fail-migration/match-vec-fixed.rs index 05971d70167..05971d70167 100644 --- a/src/test/compile-fail/match-vec-fixed.rs +++ b/src/test/ui/compile-fail-migration/match-vec-fixed.rs diff --git a/src/test/ui/compile-fail-migration/match-vec-fixed.stderr b/src/test/ui/compile-fail-migration/match-vec-fixed.stderr new file mode 100644 index 00000000000..1b85034ef6b --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-vec-fixed.stderr @@ -0,0 +1,20 @@ +error: unreachable pattern + --> $DIR/match-vec-fixed.rs:17:9 + | +LL | [_, _, _] => {} //~ ERROR unreachable pattern + | ^^^^^^^^^ + | +note: lint level defined here + --> $DIR/match-vec-fixed.rs:11:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/match-vec-fixed.rs:21:9 + | +LL | [_, 1, _] => {} //~ ERROR unreachable pattern + | ^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/match-vec-mismatch-2.rs b/src/test/ui/compile-fail-migration/match-vec-mismatch-2.rs index 52c5375f4e7..52c5375f4e7 100644 --- a/src/test/compile-fail/match-vec-mismatch-2.rs +++ b/src/test/ui/compile-fail-migration/match-vec-mismatch-2.rs diff --git a/src/test/ui/compile-fail-migration/match-vec-mismatch-2.stderr b/src/test/ui/compile-fail-migration/match-vec-mismatch-2.stderr new file mode 100644 index 00000000000..66f58bdff32 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-vec-mismatch-2.stderr @@ -0,0 +1,9 @@ +error[E0529]: expected an array or slice, found `()` + --> $DIR/match-vec-mismatch-2.rs:13:9 + | +LL | [()] => { } + | ^^^^ pattern cannot match with input type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0529`. diff --git a/src/test/compile-fail/match-vec-mismatch.rs b/src/test/ui/compile-fail-migration/match-vec-mismatch.rs index d737aa0029b..d737aa0029b 100644 --- a/src/test/compile-fail/match-vec-mismatch.rs +++ b/src/test/ui/compile-fail-migration/match-vec-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/match-vec-mismatch.stderr b/src/test/ui/compile-fail-migration/match-vec-mismatch.stderr new file mode 100644 index 00000000000..c30ddf9d0fa --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-vec-mismatch.stderr @@ -0,0 +1,36 @@ +error[E0425]: cannot find value `does_not_exist` in this scope + --> $DIR/match-vec-mismatch.rs:38:11 + | +LL | match does_not_exist { //~ ERROR cannot find value `does_not_exist` in this scope + | ^^^^^^^^^^^^^^ not found in this scope + +error[E0529]: expected an array or slice, found `std::string::String` + --> $DIR/match-vec-mismatch.rs:15:9 + | +LL | ['f', 'o', ..] => {} + | ^^^^^^^^^^^^^^ pattern cannot match with input type `std::string::String` + +error[E0527]: pattern requires 1 elements but array has 3 + --> $DIR/match-vec-mismatch.rs:30:9 + | +LL | [0] => {}, //~ ERROR pattern requires + | ^^^ expected 3 elements + +error[E0528]: pattern requires at least 4 elements but array has 3 + --> $DIR/match-vec-mismatch.rs:35:9 + | +LL | [0, 1, 2, 3, x..] => {} //~ ERROR pattern requires + | ^^^^^^^^^^^^^^^^^ pattern cannot match array of 3 elements + +error[E0282]: type annotations needed + --> $DIR/match-vec-mismatch.rs:46:9 + | +LL | [] => {} //~ ERROR type annotations needed + | ^^ cannot infer type + | + = note: type must be known at this point + +error: aborting due to 5 previous errors + +Some errors occurred: E0282, E0425, E0527, E0528, E0529. +For more information about an error, try `rustc --explain E0282`. diff --git a/src/test/compile-fail/match-vec-unreachable.rs b/src/test/ui/compile-fail-migration/match-vec-unreachable.rs index d6e3fdbe088..d6e3fdbe088 100644 --- a/src/test/compile-fail/match-vec-unreachable.rs +++ b/src/test/ui/compile-fail-migration/match-vec-unreachable.rs diff --git a/src/test/ui/compile-fail-migration/match-vec-unreachable.stderr b/src/test/ui/compile-fail-migration/match-vec-unreachable.stderr new file mode 100644 index 00000000000..e8869e86bf9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/match-vec-unreachable.stderr @@ -0,0 +1,26 @@ +error: unreachable pattern + --> $DIR/match-vec-unreachable.rs:19:9 + | +LL | [(1, 2), (2, 3), b] => (), //~ ERROR unreachable pattern + | ^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/match-vec-unreachable.rs:12:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/match-vec-unreachable.rs:29:9 + | +LL | [_, _, _, _, _] => { } //~ ERROR unreachable pattern + | ^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/match-vec-unreachable.rs:37:9 + | +LL | ['a', 'b', 'c'] => {} //~ ERROR unreachable pattern + | ^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/maybe-bounds-where-cpass.rs b/src/test/ui/compile-fail-migration/maybe-bounds-where-cpass.rs index f10526200ff..f10526200ff 100644 --- a/src/test/compile-fail/maybe-bounds-where-cpass.rs +++ b/src/test/ui/compile-fail-migration/maybe-bounds-where-cpass.rs diff --git a/src/test/ui/compile-fail-migration/maybe-bounds-where-cpass.stderr b/src/test/ui/compile-fail-migration/maybe-bounds-where-cpass.stderr new file mode 100644 index 00000000000..d60e4cdffb4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/maybe-bounds-where-cpass.stderr @@ -0,0 +1,11 @@ +error: compilation successful + --> $DIR/maybe-bounds-where-cpass.rs:16:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let u = vec![1, 2, 3]; +LL | | let _s: S<[u8]> = S(&u[..]); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/maybe-bounds-where.rs b/src/test/ui/compile-fail-migration/maybe-bounds-where.rs index 211fac2ee23..211fac2ee23 100644 --- a/src/test/compile-fail/maybe-bounds-where.rs +++ b/src/test/ui/compile-fail-migration/maybe-bounds-where.rs diff --git a/src/test/ui/compile-fail-migration/maybe-bounds-where.stderr b/src/test/ui/compile-fail-migration/maybe-bounds-where.stderr new file mode 100644 index 00000000000..02aafecb7a4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/maybe-bounds-where.stderr @@ -0,0 +1,45 @@ +error: `?Trait` bounds are only permitted at the point where a type parameter is declared + --> $DIR/maybe-bounds-where.rs:11:23 + | +LL | struct S1<T>(T) where (T): ?Sized; + | ^^^ + +error: `?Trait` bounds are only permitted at the point where a type parameter is declared + --> $DIR/maybe-bounds-where.rs:14:23 + | +LL | struct S2<T>(T) where u8: ?Sized; + | ^^ + +error: `?Trait` bounds are only permitted at the point where a type parameter is declared + --> $DIR/maybe-bounds-where.rs:17:23 + | +LL | struct S3<T>(T) where &'static T: ?Sized; + | ^^^^^^^^^^ + +error: `?Trait` bounds are only permitted at the point where a type parameter is declared + --> $DIR/maybe-bounds-where.rs:22:31 + | +LL | struct S4<T>(T) where for<'a> T: ?Trait<'a>; + | ^ + +error: `?Trait` bounds are only permitted at the point where a type parameter is declared + --> $DIR/maybe-bounds-where.rs:30:18 + | +LL | fn f() where T: ?Sized {} + | ^ + +error[E0203]: type parameter has more than one relaxed default bound, only one is supported + --> $DIR/maybe-bounds-where.rs:25:11 + | +LL | struct S5<T>(*const T) where T: ?Trait<'static> + ?Sized; + | ^ + +warning: default bound relaxed for a type parameter, but this does nothing because the given bound is not a default. Only `?Sized` is supported + --> $DIR/maybe-bounds-where.rs:25:11 + | +LL | struct S5<T>(*const T) where T: ?Trait<'static> + ?Sized; + | ^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0203`. diff --git a/src/test/ui/compile-fail-migration/meta-expected-error-correct-rev.a.stderr b/src/test/ui/compile-fail-migration/meta-expected-error-correct-rev.a.stderr new file mode 100644 index 00000000000..20b93068c64 --- /dev/null +++ b/src/test/ui/compile-fail-migration/meta-expected-error-correct-rev.a.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/meta-expected-error-correct-rev.rs:17:18 + | +LL | let x: u32 = 22_usize; //[a]~ ERROR mismatched types + | ^^^^^^^^ expected u32, found usize + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/meta-expected-error-correct-rev.rs b/src/test/ui/compile-fail-migration/meta-expected-error-correct-rev.rs index bd70879d13e..bd70879d13e 100644 --- a/src/test/compile-fail/meta-expected-error-correct-rev.rs +++ b/src/test/ui/compile-fail-migration/meta-expected-error-correct-rev.rs diff --git a/src/test/ui/compile-fail-migration/meta-expected-error-wrong-rev.a.stderr b/src/test/ui/compile-fail-migration/meta-expected-error-wrong-rev.a.stderr new file mode 100644 index 00000000000..e78144be157 --- /dev/null +++ b/src/test/ui/compile-fail-migration/meta-expected-error-wrong-rev.a.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/meta-expected-error-wrong-rev.rs:21:18 + | +LL | let x: u32 = 22_usize; //[b]~ ERROR mismatched types + | ^^^^^^^^ expected u32, found usize + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/meta-expected-error-wrong-rev.rs b/src/test/ui/compile-fail-migration/meta-expected-error-wrong-rev.rs index 3c13050812c..3c13050812c 100644 --- a/src/test/compile-fail/meta-expected-error-wrong-rev.rs +++ b/src/test/ui/compile-fail-migration/meta-expected-error-wrong-rev.rs diff --git a/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs b/src/test/ui/compile-fail-migration/method-ambig-one-trait-unknown-int-type.rs index 9acf5a52166..9acf5a52166 100644 --- a/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs +++ b/src/test/ui/compile-fail-migration/method-ambig-one-trait-unknown-int-type.rs diff --git a/src/test/ui/compile-fail-migration/method-ambig-one-trait-unknown-int-type.stderr b/src/test/ui/compile-fail-migration/method-ambig-one-trait-unknown-int-type.stderr new file mode 100644 index 00000000000..7f034b9e53d --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-ambig-one-trait-unknown-int-type.stderr @@ -0,0 +1,18 @@ +error[E0282]: type annotations needed + --> $DIR/method-ambig-one-trait-unknown-int-type.rs:34:17 + | +LL | let mut x = Vec::new(); + | ----- ^^^^^^^^ cannot infer type for `T` + | | + | consider giving `x` a type + +error[E0308]: mismatched types + --> $DIR/method-ambig-one-trait-unknown-int-type.rs:43:20 + | +LL | let y: usize = x.foo(); //~ ERROR mismatched types + | ^^^^^^^ expected usize, found isize + +error: aborting due to 2 previous errors + +Some errors occurred: E0282, E0308. +For more information about an error, try `rustc --explain E0282`. diff --git a/src/test/compile-fail/method-ambig-two-traits-cross-crate.rs b/src/test/ui/compile-fail-migration/method-ambig-two-traits-cross-crate.rs index c1d4551fd9e..c1d4551fd9e 100644 --- a/src/test/compile-fail/method-ambig-two-traits-cross-crate.rs +++ b/src/test/ui/compile-fail-migration/method-ambig-two-traits-cross-crate.rs diff --git a/src/test/ui/compile-fail-migration/method-ambig-two-traits-cross-crate.stderr b/src/test/ui/compile-fail-migration/method-ambig-two-traits-cross-crate.stderr new file mode 100644 index 00000000000..7a75f20f65a --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-ambig-two-traits-cross-crate.stderr @@ -0,0 +1,16 @@ +error[E0034]: multiple applicable items in scope + --> $DIR/method-ambig-two-traits-cross-crate.rs:21:21 + | +LL | fn main() { 1_usize.me(); } //~ ERROR E0034 + | ^^ multiple `me` found + | +note: candidate #1 is defined in an impl of the trait `me2` for the type `usize` + --> $DIR/method-ambig-two-traits-cross-crate.rs:20:22 + | +LL | impl me2 for usize { fn me(&self) -> usize { *self } } + | ^^^^^^^^^^^^^^^^^^^^^ + = note: candidate #2 is defined in an impl of the trait `ambig_impl_2_lib::me` for the type `usize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0034`. diff --git a/src/test/compile-fail/method-ambig-two-traits-from-bounds.rs b/src/test/ui/compile-fail-migration/method-ambig-two-traits-from-bounds.rs index 184927c0135..184927c0135 100644 --- a/src/test/compile-fail/method-ambig-two-traits-from-bounds.rs +++ b/src/test/ui/compile-fail-migration/method-ambig-two-traits-from-bounds.rs diff --git a/src/test/ui/compile-fail-migration/method-ambig-two-traits-from-bounds.stderr b/src/test/ui/compile-fail-migration/method-ambig-two-traits-from-bounds.stderr new file mode 100644 index 00000000000..06003d900b7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-ambig-two-traits-from-bounds.stderr @@ -0,0 +1,22 @@ +error[E0034]: multiple applicable items in scope + --> $DIR/method-ambig-two-traits-from-bounds.rs:15:7 + | +LL | t.foo(); //~ ERROR E0034 + | ^^^ multiple `foo` found + | +note: candidate #1 is defined in the trait `A` + --> $DIR/method-ambig-two-traits-from-bounds.rs:11:11 + | +LL | trait A { fn foo(&self); } + | ^^^^^^^^^^^^^^ + = help: to disambiguate the method call, write `A::foo(t)` instead +note: candidate #2 is defined in the trait `B` + --> $DIR/method-ambig-two-traits-from-bounds.rs:12:11 + | +LL | trait B { fn foo(&self); } + | ^^^^^^^^^^^^^^ + = help: to disambiguate the method call, write `B::foo(t)` instead + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0034`. diff --git a/src/test/compile-fail/method-ambig-two-traits-with-default-method.rs b/src/test/ui/compile-fail-migration/method-ambig-two-traits-with-default-method.rs index 17312fb1869..17312fb1869 100644 --- a/src/test/compile-fail/method-ambig-two-traits-with-default-method.rs +++ b/src/test/ui/compile-fail-migration/method-ambig-two-traits-with-default-method.rs diff --git a/src/test/ui/compile-fail-migration/method-ambig-two-traits-with-default-method.stderr b/src/test/ui/compile-fail-migration/method-ambig-two-traits-with-default-method.stderr new file mode 100644 index 00000000000..d67e17d228f --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-ambig-two-traits-with-default-method.stderr @@ -0,0 +1,20 @@ +error[E0034]: multiple applicable items in scope + --> $DIR/method-ambig-two-traits-with-default-method.rs:22:13 + | +LL | 1_usize.method(); //~ ERROR E0034 + | ^^^^^^ multiple `method` found + | +note: candidate #1 is defined in an impl of the trait `Foo` for the type `usize` + --> $DIR/method-ambig-two-traits-with-default-method.rs:15:13 + | +LL | trait Foo { fn method(&self) {} } + | ^^^^^^^^^^^^^^^^ +note: candidate #2 is defined in an impl of the trait `Bar` for the type `usize` + --> $DIR/method-ambig-two-traits-with-default-method.rs:16:13 + | +LL | trait Bar { fn method(&self) {} } + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0034`. diff --git a/src/test/compile-fail/method-call-lifetime-args-lint.rs b/src/test/ui/compile-fail-migration/method-call-lifetime-args-lint.rs index b2a94e0af42..b2a94e0af42 100644 --- a/src/test/compile-fail/method-call-lifetime-args-lint.rs +++ b/src/test/ui/compile-fail-migration/method-call-lifetime-args-lint.rs diff --git a/src/test/ui/compile-fail-migration/method-call-lifetime-args-lint.stderr b/src/test/ui/compile-fail-migration/method-call-lifetime-args-lint.stderr new file mode 100644 index 00000000000..682cfbdb84a --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-call-lifetime-args-lint.stderr @@ -0,0 +1,187 @@ +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:33:14 + | +LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {} + | -- the late bound lifetime parameter is introduced here +... +LL | S.late::<'static>(&0, &0); + | ^^^^^^^ + | +note: lint level defined here + --> $DIR/method-call-lifetime-args-lint.rs:11:9 + | +LL | #![deny(late_bound_lifetime_arguments)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:36:14 + | +LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {} + | -- the late bound lifetime parameter is introduced here +... +LL | S.late::<'static, 'static>(&0, &0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:39:14 + | +LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {} + | -- the late bound lifetime parameter is introduced here +... +LL | S.late::<'static, 'static, 'static>(&0, &0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:43:20 + | +LL | fn late_early<'a, 'b>(self, _: &'a u8) -> &'b u8 { loop {} } + | -- the late bound lifetime parameter is introduced here +... +LL | S.late_early::<'static>(&0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:46:20 + | +LL | fn late_early<'a, 'b>(self, _: &'a u8) -> &'b u8 { loop {} } + | -- the late bound lifetime parameter is introduced here +... +LL | S.late_early::<'static, 'static>(&0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:49:20 + | +LL | fn late_early<'a, 'b>(self, _: &'a u8) -> &'b u8 { loop {} } + | -- the late bound lifetime parameter is introduced here +... +LL | S.late_early::<'static, 'static, 'static>(&0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:54:23 + | +LL | fn late_implicit(self, _: &u8, _: &u8) {} + | - the late bound lifetime parameter is introduced here +... +LL | S.late_implicit::<'static>(&0, &0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:57:23 + | +LL | fn late_implicit(self, _: &u8, _: &u8) {} + | - the late bound lifetime parameter is introduced here +... +LL | S.late_implicit::<'static, 'static>(&0, &0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:60:23 + | +LL | fn late_implicit(self, _: &u8, _: &u8) {} + | - the late bound lifetime parameter is introduced here +... +LL | S.late_implicit::<'static, 'static, 'static>(&0, &0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:64:29 + | +LL | fn late_implicit_early<'b>(self, _: &u8) -> &'b u8 { loop {} } + | - the late bound lifetime parameter is introduced here +... +LL | S.late_implicit_early::<'static>(&0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:67:29 + | +LL | fn late_implicit_early<'b>(self, _: &u8) -> &'b u8 { loop {} } + | - the late bound lifetime parameter is introduced here +... +LL | S.late_implicit_early::<'static, 'static>(&0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:70:29 + | +LL | fn late_implicit_early<'b>(self, _: &u8) -> &'b u8 { loop {} } + | - the late bound lifetime parameter is introduced here +... +LL | S.late_implicit_early::<'static, 'static, 'static>(&0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:79:21 + | +LL | fn late_early<'a, 'b>(self, _: &'a u8) -> &'b u8 { loop {} } + | -- the late bound lifetime parameter is introduced here +... +LL | S::late_early::<'static>(S, &0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:83:30 + | +LL | fn late_implicit_early<'b>(self, _: &u8) -> &'b u8 { loop {} } + | - the late bound lifetime parameter is introduced here +... +LL | S::late_implicit_early::<'static>(S, &0); + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint.rs:92:9 + | +LL | fn f<'early, 'late, T: 'early>() {} + | ----- the late bound lifetime parameter is introduced here +... +LL | f::<'static, u8>; + | ^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #42868 <https://github.com/rust-lang/rust/issues/42868> + +error: aborting due to 15 previous errors + diff --git a/src/test/compile-fail/method-call-lifetime-args-subst-index.rs b/src/test/ui/compile-fail-migration/method-call-lifetime-args-subst-index.rs index a9505e4f936..a9505e4f936 100644 --- a/src/test/compile-fail/method-call-lifetime-args-subst-index.rs +++ b/src/test/ui/compile-fail-migration/method-call-lifetime-args-subst-index.rs diff --git a/src/test/ui/compile-fail-migration/method-call-lifetime-args-subst-index.stderr b/src/test/ui/compile-fail-migration/method-call-lifetime-args-subst-index.stderr new file mode 100644 index 00000000000..2848ff88c17 --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-call-lifetime-args-subst-index.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/method-call-lifetime-args-subst-index.rs:25:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/method-call-lifetime-args-unresolved.rs b/src/test/ui/compile-fail-migration/method-call-lifetime-args-unresolved.rs index 4910bfaf4f6..4910bfaf4f6 100644 --- a/src/test/compile-fail/method-call-lifetime-args-unresolved.rs +++ b/src/test/ui/compile-fail-migration/method-call-lifetime-args-unresolved.rs diff --git a/src/test/ui/compile-fail-migration/method-call-lifetime-args-unresolved.stderr b/src/test/ui/compile-fail-migration/method-call-lifetime-args-unresolved.stderr new file mode 100644 index 00000000000..8eb860d9474 --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-call-lifetime-args-unresolved.stderr @@ -0,0 +1,9 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/method-call-lifetime-args-unresolved.rs:12:15 + | +LL | 0.clone::<'a>(); //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0261`. diff --git a/src/test/compile-fail/method-call-lifetime-args.rs b/src/test/ui/compile-fail-migration/method-call-lifetime-args.rs index f0a87c74703..f0a87c74703 100644 --- a/src/test/compile-fail/method-call-lifetime-args.rs +++ b/src/test/ui/compile-fail-migration/method-call-lifetime-args.rs diff --git a/src/test/ui/compile-fail-migration/method-call-lifetime-args.stderr b/src/test/ui/compile-fail-migration/method-call-lifetime-args.stderr new file mode 100644 index 00000000000..736dba9061e --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-call-lifetime-args.stderr @@ -0,0 +1,196 @@ +error[E0090]: too few lifetime parameters provided: expected 2 lifetime parameters, found 1 lifetime parameter + --> $DIR/method-call-lifetime-args.rs:26:7 + | +LL | S.early::<'static>(); + | ^^^^^ expected 2 lifetime parameters + +error[E0088]: too many lifetime parameters provided: expected at most 2 lifetime parameters, found 3 lifetime parameters + --> $DIR/method-call-lifetime-args.rs:28:33 + | +LL | S.early::<'static, 'static, 'static>(); + | ^^^^^^^ expected 2 lifetime parameters + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:37:15 + | +LL | S::late::<'static>(S, &0, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:14:13 + | +LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {} + | ^^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:39:15 + | +LL | S::late::<'static, 'static>(S, &0, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:14:13 + | +LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {} + | ^^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:41:15 + | +LL | S::late::<'static, 'static, 'static>(S, &0, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:14:13 + | +LL | fn late<'a, 'b>(self, _: &'a u8, _: &'b u8) {} + | ^^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:44:21 + | +LL | S::late_early::<'static, 'static>(S, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:17:19 + | +LL | fn late_early<'a, 'b>(self, _: &'a u8) -> &'b u8 { loop {} } + | ^^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:46:21 + | +LL | S::late_early::<'static, 'static, 'static>(S, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:17:19 + | +LL | fn late_early<'a, 'b>(self, _: &'a u8) -> &'b u8 { loop {} } + | ^^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:50:24 + | +LL | S::late_implicit::<'static>(S, &0, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:15:31 + | +LL | fn late_implicit(self, _: &u8, _: &u8) {} + | ^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:52:24 + | +LL | S::late_implicit::<'static, 'static>(S, &0, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:15:31 + | +LL | fn late_implicit(self, _: &u8, _: &u8) {} + | ^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:54:24 + | +LL | S::late_implicit::<'static, 'static, 'static>(S, &0, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:15:31 + | +LL | fn late_implicit(self, _: &u8, _: &u8) {} + | ^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:57:30 + | +LL | S::late_implicit_early::<'static, 'static>(S, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:18:41 + | +LL | fn late_implicit_early<'b>(self, _: &u8) -> &'b u8 { loop {} } + | ^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:59:30 + | +LL | S::late_implicit_early::<'static, 'static, 'static>(S, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:18:41 + | +LL | fn late_implicit_early<'b>(self, _: &u8) -> &'b u8 { loop {} } + | ^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:62:35 + | +LL | S::late_implicit_self_early::<'static, 'static>(&S); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:19:37 + | +LL | fn late_implicit_self_early<'b>(&self) -> &'b u8 { loop {} } + | ^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:64:35 + | +LL | S::late_implicit_self_early::<'static, 'static, 'static>(&S); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:19:37 + | +LL | fn late_implicit_self_early<'b>(&self) -> &'b u8 { loop {} } + | ^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:67:28 + | +LL | S::late_unused_early::<'static, 'static>(S); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:20:26 + | +LL | fn late_unused_early<'a, 'b>(self) -> &'b u8 { loop {} } + | ^^ + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args.rs:69:28 + | +LL | S::late_unused_early::<'static, 'static, 'static>(S); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args.rs:20:26 + | +LL | fn late_unused_early<'a, 'b>(self) -> &'b u8 { loop {} } + | ^^ + +error[E0090]: too few lifetime parameters provided: expected 2 lifetime parameters, found 1 lifetime parameter + --> $DIR/method-call-lifetime-args.rs:73:5 + | +LL | S::early::<'static>(S); + | ^^^^^^^^^^^^^^^^^^^ expected 2 lifetime parameters + +error[E0088]: too many lifetime parameters provided: expected at most 2 lifetime parameters, found 3 lifetime parameters + --> $DIR/method-call-lifetime-args.rs:75:34 + | +LL | S::early::<'static, 'static, 'static>(S); + | ^^^^^^^ expected 2 lifetime parameters + +error: aborting due to 18 previous errors + +Some errors occurred: E0088, E0090. +For more information about an error, try `rustc --explain E0088`. diff --git a/src/test/compile-fail/method-call-type-binding.rs b/src/test/ui/compile-fail-migration/method-call-type-binding.rs index 6c0793ee78f..6c0793ee78f 100644 --- a/src/test/compile-fail/method-call-type-binding.rs +++ b/src/test/ui/compile-fail-migration/method-call-type-binding.rs diff --git a/src/test/ui/compile-fail-migration/method-call-type-binding.stderr b/src/test/ui/compile-fail-migration/method-call-type-binding.stderr new file mode 100644 index 00000000000..aafc84804b5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-call-type-binding.stderr @@ -0,0 +1,9 @@ +error[E0229]: associated type bindings are not allowed here + --> $DIR/method-call-type-binding.rs:12:15 + | +LL | 0.clone::<T = u8>(); //~ ERROR associated type bindings are not allowed here + | ^^^^^^ associated type not allowed here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0229`. diff --git a/src/test/compile-fail/method-macro-backtrace.rs b/src/test/ui/compile-fail-migration/method-macro-backtrace.rs index f3c227849dc..f3c227849dc 100644 --- a/src/test/compile-fail/method-macro-backtrace.rs +++ b/src/test/ui/compile-fail-migration/method-macro-backtrace.rs diff --git a/src/test/ui/compile-fail-migration/method-macro-backtrace.stderr b/src/test/ui/compile-fail-migration/method-macro-backtrace.stderr new file mode 100644 index 00000000000..28f46dba1cc --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-macro-backtrace.stderr @@ -0,0 +1,11 @@ +error[E0201]: duplicate definitions with name `bar`: + --> $DIR/method-macro-backtrace.rs:32:5 + | +LL | fn bar(&self) { } + | ----------------- previous definition of `bar` here +LL | fn bar(&self) { } //~ ERROR duplicate definitions + | ^^^^^^^^^^^^^^^^^ duplicate definition + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0201`. diff --git a/src/test/compile-fail/method-path-in-pattern.rs b/src/test/ui/compile-fail-migration/method-path-in-pattern.rs index 671a518073c..671a518073c 100644 --- a/src/test/compile-fail/method-path-in-pattern.rs +++ b/src/test/ui/compile-fail-migration/method-path-in-pattern.rs diff --git a/src/test/ui/compile-fail-migration/method-path-in-pattern.stderr b/src/test/ui/compile-fail-migration/method-path-in-pattern.stderr new file mode 100644 index 00000000000..1fae336c79c --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-path-in-pattern.stderr @@ -0,0 +1,21 @@ +error[E0533]: expected unit struct/variant or constant, found method `<Foo>::bar` + --> $DIR/method-path-in-pattern.rs:25:9 + | +LL | Foo::bar => {} + | ^^^^^^^^ + +error[E0533]: expected unit struct/variant or constant, found method `<Foo>::bar` + --> $DIR/method-path-in-pattern.rs:29:9 + | +LL | <Foo>::bar => {} + | ^^^^^^^^^^ + +error[E0533]: expected unit struct/variant or constant, found method `<Foo>::trait_bar` + --> $DIR/method-path-in-pattern.rs:33:9 + | +LL | <Foo>::trait_bar => {} + | ^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0533`. diff --git a/src/test/compile-fail/method-resolvable-path-in-pattern.rs b/src/test/ui/compile-fail-migration/method-resolvable-path-in-pattern.rs index 4d8959466b9..4d8959466b9 100644 --- a/src/test/compile-fail/method-resolvable-path-in-pattern.rs +++ b/src/test/ui/compile-fail-migration/method-resolvable-path-in-pattern.rs diff --git a/src/test/ui/compile-fail-migration/method-resolvable-path-in-pattern.stderr b/src/test/ui/compile-fail-migration/method-resolvable-path-in-pattern.stderr new file mode 100644 index 00000000000..c86367dac08 --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-resolvable-path-in-pattern.stderr @@ -0,0 +1,9 @@ +error[E0532]: expected unit struct/variant or constant, found method `MyTrait::trait_bar` + --> $DIR/method-resolvable-path-in-pattern.rs:21:9 + | +LL | <Foo as MyTrait>::trait_bar => {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a unit struct/variant or constant + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/compile-fail/method-self-arg-1.rs b/src/test/ui/compile-fail-migration/method-self-arg-1.rs index 4c8800878f0..4c8800878f0 100644 --- a/src/test/compile-fail/method-self-arg-1.rs +++ b/src/test/ui/compile-fail-migration/method-self-arg-1.rs diff --git a/src/test/ui/compile-fail-migration/method-self-arg-1.stderr b/src/test/ui/compile-fail-migration/method-self-arg-1.stderr new file mode 100644 index 00000000000..4a5ac2b5aed --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-self-arg-1.stderr @@ -0,0 +1,24 @@ +error[E0308]: mismatched types + --> $DIR/method-self-arg-1.rs:21:14 + | +LL | Foo::bar(x); //~ ERROR mismatched types + | ^ + | | + | expected &Foo, found struct `Foo` + | help: consider borrowing here: `&x` + | + = note: expected type `&Foo` + found type `Foo` + +error[E0308]: mismatched types + --> $DIR/method-self-arg-1.rs:25:14 + | +LL | Foo::bar(&42); //~ ERROR mismatched types + | ^^^ expected struct `Foo`, found integral variable + | + = note: expected type `&Foo` + found type `&{integer}` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/method-self-arg-2.rs b/src/test/ui/compile-fail-migration/method-self-arg-2.rs index dd5b2004145..dd5b2004145 100644 --- a/src/test/compile-fail/method-self-arg-2.rs +++ b/src/test/ui/compile-fail-migration/method-self-arg-2.rs diff --git a/src/test/ui/compile-fail-migration/method-self-arg-2.stderr b/src/test/ui/compile-fail-migration/method-self-arg-2.stderr new file mode 100644 index 00000000000..d4e049d7f6e --- /dev/null +++ b/src/test/ui/compile-fail-migration/method-self-arg-2.stderr @@ -0,0 +1,25 @@ +error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable + --> $DIR/method-self-arg-2.rs:23:15 + | +LL | let y = &mut x; + | - mutable borrow occurs here +LL | Foo::bar(&x); //~ERROR cannot borrow `x` + | ^ immutable borrow occurs here +... +LL | } + | - mutable borrow ends here + +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/method-self-arg-2.rs:27:19 + | +LL | let y = &mut x; + | - first mutable borrow occurs here +LL | Foo::baz(&mut x); //~ERROR cannot borrow `x` + | ^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error: aborting due to 2 previous errors + +Some errors occurred: E0499, E0502. +For more information about an error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/minus-string.rs b/src/test/ui/compile-fail-migration/minus-string.rs index 1ba30c67a03..1ba30c67a03 100644 --- a/src/test/compile-fail/minus-string.rs +++ b/src/test/ui/compile-fail-migration/minus-string.rs diff --git a/src/test/ui/compile-fail-migration/minus-string.stderr b/src/test/ui/compile-fail-migration/minus-string.stderr new file mode 100644 index 00000000000..cbbb11ae33a --- /dev/null +++ b/src/test/ui/compile-fail-migration/minus-string.stderr @@ -0,0 +1,11 @@ +error[E0600]: cannot apply unary operator `-` to type `std::string::String` + --> $DIR/minus-string.rs:13:13 + | +LL | fn main() { -"foo".to_string(); } + | ^^^^^^^^^^^^^^^^^^ cannot apply unary operator `-` + | + = note: an implementation of `std::ops::Neg` might be missing for `std::string::String` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0600`. diff --git a/src/test/compile-fail/mir-dataflow/README.md b/src/test/ui/compile-fail-migration/mir-dataflow/README.md index a3ab14b23c7..a3ab14b23c7 100644 --- a/src/test/compile-fail/mir-dataflow/README.md +++ b/src/test/ui/compile-fail-migration/mir-dataflow/README.md diff --git a/src/test/compile-fail/mir-dataflow/def-inits-1.rs b/src/test/ui/compile-fail-migration/mir-dataflow/def-inits-1.rs index f5f0ede6864..f5f0ede6864 100644 --- a/src/test/compile-fail/mir-dataflow/def-inits-1.rs +++ b/src/test/ui/compile-fail-migration/mir-dataflow/def-inits-1.rs diff --git a/src/test/ui/compile-fail-migration/mir-dataflow/def-inits-1.stderr b/src/test/ui/compile-fail-migration/mir-dataflow/def-inits-1.stderr new file mode 100644 index 00000000000..84d3c66ac33 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mir-dataflow/def-inits-1.stderr @@ -0,0 +1,28 @@ +error: rustc_peek: bit not set + --> $DIR/def-inits-1.rs:25:14 + | +LL | unsafe { rustc_peek(&ret); } //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^^^ + +error: rustc_peek: bit not set + --> $DIR/def-inits-1.rs:41:14 + | +LL | unsafe { rustc_peek(&z); } //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: rustc_peek: bit not set + --> $DIR/def-inits-1.rs:44:14 + | +LL | unsafe { rustc_peek(&y); } //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: rustc_peek: bit not set + --> $DIR/def-inits-1.rs:52:14 + | +LL | unsafe { rustc_peek(&x); } //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: stop_after_dataflow ended compilation + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/mir-dataflow/inits-1.rs b/src/test/ui/compile-fail-migration/mir-dataflow/inits-1.rs index 595f01f7c94..595f01f7c94 100644 --- a/src/test/compile-fail/mir-dataflow/inits-1.rs +++ b/src/test/ui/compile-fail-migration/mir-dataflow/inits-1.rs diff --git a/src/test/ui/compile-fail-migration/mir-dataflow/inits-1.stderr b/src/test/ui/compile-fail-migration/mir-dataflow/inits-1.stderr new file mode 100644 index 00000000000..c39c9c8efba --- /dev/null +++ b/src/test/ui/compile-fail-migration/mir-dataflow/inits-1.stderr @@ -0,0 +1,22 @@ +error: rustc_peek: bit not set + --> $DIR/inits-1.rs:25:14 + | +LL | unsafe { rustc_peek(&ret); } //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^^^ + +error: rustc_peek: bit not set + --> $DIR/inits-1.rs:45:14 + | +LL | unsafe { rustc_peek(&y); } //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: rustc_peek: bit not set + --> $DIR/inits-1.rs:53:14 + | +LL | unsafe { rustc_peek(&x); } //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: stop_after_dataflow ended compilation + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/mir-dataflow/uninits-1.rs b/src/test/ui/compile-fail-migration/mir-dataflow/uninits-1.rs index bb10c03254e..bb10c03254e 100644 --- a/src/test/compile-fail/mir-dataflow/uninits-1.rs +++ b/src/test/ui/compile-fail-migration/mir-dataflow/uninits-1.rs diff --git a/src/test/ui/compile-fail-migration/mir-dataflow/uninits-1.stderr b/src/test/ui/compile-fail-migration/mir-dataflow/uninits-1.stderr new file mode 100644 index 00000000000..c76012404ef --- /dev/null +++ b/src/test/ui/compile-fail-migration/mir-dataflow/uninits-1.stderr @@ -0,0 +1,34 @@ +error: rustc_peek: bit not set + --> $DIR/uninits-1.rs:29:14 + | +LL | unsafe { rustc_peek(&x) }; //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: rustc_peek: bit not set + --> $DIR/uninits-1.rs:30:14 + | +LL | unsafe { rustc_peek(&y) }; //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: rustc_peek: bit not set + --> $DIR/uninits-1.rs:31:14 + | +LL | unsafe { rustc_peek(&z) }; //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: rustc_peek: bit not set + --> $DIR/uninits-1.rs:47:14 + | +LL | unsafe { rustc_peek(&x); } //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: rustc_peek: bit not set + --> $DIR/uninits-1.rs:55:14 + | +LL | unsafe { rustc_peek(&ret); } //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^^^ + +error: stop_after_dataflow ended compilation + +error: aborting due to 6 previous errors + diff --git a/src/test/compile-fail/mir-dataflow/uninits-2.rs b/src/test/ui/compile-fail-migration/mir-dataflow/uninits-2.rs index 9854ea779b3..9854ea779b3 100644 --- a/src/test/compile-fail/mir-dataflow/uninits-2.rs +++ b/src/test/ui/compile-fail-migration/mir-dataflow/uninits-2.rs diff --git a/src/test/ui/compile-fail-migration/mir-dataflow/uninits-2.stderr b/src/test/ui/compile-fail-migration/mir-dataflow/uninits-2.stderr new file mode 100644 index 00000000000..8ed735111bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/mir-dataflow/uninits-2.stderr @@ -0,0 +1,10 @@ +error: rustc_peek: bit not set + --> $DIR/uninits-2.rs:25:14 + | +LL | unsafe { rustc_peek(&x) }; //~ ERROR rustc_peek: bit not set + | ^^^^^^^^^^^^^^ + +error: stop_after_dataflow ended compilation + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/mir-unpretty.rs b/src/test/ui/compile-fail-migration/mir-unpretty.rs index fa936502157..fa936502157 100644 --- a/src/test/compile-fail/mir-unpretty.rs +++ b/src/test/ui/compile-fail-migration/mir-unpretty.rs diff --git a/src/test/ui/compile-fail-migration/mir-unpretty.stderr b/src/test/ui/compile-fail-migration/mir-unpretty.stderr new file mode 100644 index 00000000000..5a53b69ebbb --- /dev/null +++ b/src/test/ui/compile-fail-migration/mir-unpretty.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/mir-unpretty.rs:14:17 + | +LL | let x: () = 0; //~ ERROR: mismatched types + | ^ expected (), found integral variable + | + = note: expected type `()` + found type `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/missing-derivable-attr.rs b/src/test/ui/compile-fail-migration/missing-derivable-attr.rs index 7eee51e4076..7eee51e4076 100644 --- a/src/test/compile-fail/missing-derivable-attr.rs +++ b/src/test/ui/compile-fail-migration/missing-derivable-attr.rs diff --git a/src/test/ui/compile-fail-migration/missing-derivable-attr.stderr b/src/test/ui/compile-fail-migration/missing-derivable-attr.stderr new file mode 100644 index 00000000000..cccba2f5f3f --- /dev/null +++ b/src/test/ui/compile-fail-migration/missing-derivable-attr.stderr @@ -0,0 +1,12 @@ +error[E0046]: not all trait items implemented, missing: `eq` + --> $DIR/missing-derivable-attr.rs:23:1 + | +LL | fn eq(&self, other: &Self) -> bool; + | ----------------------------------- `eq` from trait +... +LL | impl MyEq for A {} //~ ERROR not all trait items implemented, missing: `eq` + | ^^^^^^^^^^^^^^^ missing `eq` in implementation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0046`. diff --git a/src/test/compile-fail/missing-macro-use.rs b/src/test/ui/compile-fail-migration/missing-macro-use.rs index bfe49ea0009..bfe49ea0009 100644 --- a/src/test/compile-fail/missing-macro-use.rs +++ b/src/test/ui/compile-fail-migration/missing-macro-use.rs diff --git a/src/test/ui/compile-fail-migration/missing-macro-use.stderr b/src/test/ui/compile-fail-migration/missing-macro-use.stderr new file mode 100644 index 00000000000..6986b4d5733 --- /dev/null +++ b/src/test/ui/compile-fail-migration/missing-macro-use.stderr @@ -0,0 +1,8 @@ +error: cannot find macro `macro_two!` in this scope + --> $DIR/missing-macro-use.rs:16:5 + | +LL | macro_two!(); + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/missing-main.rs b/src/test/ui/compile-fail-migration/missing-main.rs index 2788a5c2d58..2788a5c2d58 100644 --- a/src/test/compile-fail/missing-main.rs +++ b/src/test/ui/compile-fail-migration/missing-main.rs diff --git a/src/test/ui/compile-fail-migration/missing-main.stderr b/src/test/ui/compile-fail-migration/missing-main.stderr new file mode 100644 index 00000000000..34b03ada3d2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/missing-main.stderr @@ -0,0 +1,7 @@ +error[E0601]: `main` function not found in crate `missing_main` + | + = note: consider adding a `main` function to `$DIR/missing-main.rs` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/compile-fail/missing-return.rs b/src/test/ui/compile-fail-migration/missing-return.rs index efd0c827a35..efd0c827a35 100644 --- a/src/test/compile-fail/missing-return.rs +++ b/src/test/ui/compile-fail-migration/missing-return.rs diff --git a/src/test/ui/compile-fail-migration/missing-return.stderr b/src/test/ui/compile-fail-migration/missing-return.stderr new file mode 100644 index 00000000000..d12a5832877 --- /dev/null +++ b/src/test/ui/compile-fail-migration/missing-return.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/missing-return.rs:13:17 + | +LL | fn f() -> isize { } + | ^^^ expected isize, found () + | + = note: expected type `isize` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/missing-semicolon-warning.rs b/src/test/ui/compile-fail-migration/missing-semicolon-warning.rs index bbc958b87a5..bbc958b87a5 100644 --- a/src/test/compile-fail/missing-semicolon-warning.rs +++ b/src/test/ui/compile-fail-migration/missing-semicolon-warning.rs diff --git a/src/test/ui/compile-fail-migration/missing-semicolon-warning.stderr b/src/test/ui/compile-fail-migration/missing-semicolon-warning.stderr new file mode 100644 index 00000000000..72319a257d8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/missing-semicolon-warning.stderr @@ -0,0 +1,30 @@ +warning: expected `;`, found `let` + --> $DIR/missing-semicolon-warning.rs:16:12 + | +LL | $( let x = $e1 )*; //~ WARN expected `;` + | ^^^ +... +LL | fn main() { m!(0, 0; 0, 0); } //~ ERROR compilation successful + | --------------- in this macro invocation + | + = note: This was erroneously allowed and will become a hard error in a future release + +warning: expected `;`, found `println` + --> $DIR/missing-semicolon-warning.rs:17:12 + | +LL | $( println!("{}", $e2) )*; //~ WARN expected `;` + | ^^^^^^^ +... +LL | fn main() { m!(0, 0; 0, 0); } //~ ERROR compilation successful + | --------------- in this macro invocation + | + = note: This was erroneously allowed and will become a hard error in a future release + +error: compilation successful + --> $DIR/missing-semicolon-warning.rs:22:1 + | +LL | fn main() { m!(0, 0; 0, 0); } //~ ERROR compilation successful + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/missing-stability.rs b/src/test/ui/compile-fail-migration/missing-stability.rs index 1922efb5e19..1922efb5e19 100644 --- a/src/test/compile-fail/missing-stability.rs +++ b/src/test/ui/compile-fail-migration/missing-stability.rs diff --git a/src/test/ui/compile-fail-migration/missing-stability.stderr b/src/test/ui/compile-fail-migration/missing-stability.stderr new file mode 100644 index 00000000000..6e2802e43c5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/missing-stability.stderr @@ -0,0 +1,17 @@ +error: This node does not have a stability attribute + --> $DIR/missing-stability.rs:18:1 + | +LL | / pub fn unmarked() { +LL | | //~^ ERROR This node does not have a stability attribute +LL | | () +LL | | } + | |_^ + +error: This node does not have a stability attribute + --> $DIR/missing-stability.rs:32:5 + | +LL | pub fn unmarked() {} + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/missing_debug_impls.rs b/src/test/ui/compile-fail-migration/missing_debug_impls.rs index ddc9081e33b..ddc9081e33b 100644 --- a/src/test/compile-fail/missing_debug_impls.rs +++ b/src/test/ui/compile-fail-migration/missing_debug_impls.rs diff --git a/src/test/ui/compile-fail-migration/missing_debug_impls.stderr b/src/test/ui/compile-fail-migration/missing_debug_impls.stderr new file mode 100644 index 00000000000..4b4c05f79f0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/missing_debug_impls.stderr @@ -0,0 +1,20 @@ +error: type does not implement `fmt::Debug`; consider adding #[derive(Debug)] or a manual implementation + --> $DIR/missing_debug_impls.rs:17:1 + | +LL | pub enum A {} //~ ERROR type does not implement `fmt::Debug` + | ^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/missing_debug_impls.rs:12:9 + | +LL | #![deny(missing_debug_implementations)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type does not implement `fmt::Debug`; consider adding #[derive(Debug)] or a manual implementation + --> $DIR/missing_debug_impls.rs:30:1 + | +LL | pub struct Foo; //~ ERROR type does not implement `fmt::Debug` + | ^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/mod_file_aux.rs b/src/test/ui/compile-fail-migration/mod_file_aux.rs index b7470811f60..b7470811f60 100644 --- a/src/test/compile-fail/mod_file_aux.rs +++ b/src/test/ui/compile-fail-migration/mod_file_aux.rs diff --git a/src/test/compile-fail/mod_file_correct_spans.rs b/src/test/ui/compile-fail-migration/mod_file_correct_spans.rs index 52837479869..52837479869 100644 --- a/src/test/compile-fail/mod_file_correct_spans.rs +++ b/src/test/ui/compile-fail-migration/mod_file_correct_spans.rs diff --git a/src/test/ui/compile-fail-migration/mod_file_correct_spans.stderr b/src/test/ui/compile-fail-migration/mod_file_correct_spans.stderr new file mode 100644 index 00000000000..6f5e4cc51eb --- /dev/null +++ b/src/test/ui/compile-fail-migration/mod_file_correct_spans.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find function `bar` in module `mod_file_aux` + --> $DIR/mod_file_correct_spans.rs:16:27 + | +LL | assert!(mod_file_aux::bar() == 10); + | ^^^ not found in `mod_file_aux` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/mod_file_disambig.rs b/src/test/ui/compile-fail-migration/mod_file_disambig.rs index 27c253234be..27c253234be 100644 --- a/src/test/compile-fail/mod_file_disambig.rs +++ b/src/test/ui/compile-fail-migration/mod_file_disambig.rs diff --git a/src/test/ui/compile-fail-migration/mod_file_disambig.stderr b/src/test/ui/compile-fail-migration/mod_file_disambig.stderr new file mode 100644 index 00000000000..16a013ebfdb --- /dev/null +++ b/src/test/ui/compile-fail-migration/mod_file_disambig.stderr @@ -0,0 +1,11 @@ +error[E0584]: file for module `mod_file_disambig_aux` found at both mod_file_disambig_aux.rs and mod_file_disambig_aux/mod.rs + --> $DIR/mod_file_disambig.rs:13:5 + | +LL | mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: delete or rename one of them to remove the ambiguity + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0584`. diff --git a/src/test/compile-fail/mod_file_disambig_aux.rs b/src/test/ui/compile-fail-migration/mod_file_disambig_aux.rs index f617b293463..f617b293463 100644 --- a/src/test/compile-fail/mod_file_disambig_aux.rs +++ b/src/test/ui/compile-fail-migration/mod_file_disambig_aux.rs diff --git a/src/test/compile-fail/mod_file_disambig_aux/mod.rs b/src/test/ui/compile-fail-migration/mod_file_disambig_aux/mod.rs index f617b293463..f617b293463 100644 --- a/src/test/compile-fail/mod_file_disambig_aux/mod.rs +++ b/src/test/ui/compile-fail-migration/mod_file_disambig_aux/mod.rs diff --git a/src/test/compile-fail/module-macro_use-arguments.rs b/src/test/ui/compile-fail-migration/module-macro_use-arguments.rs index 6d3038b4820..6d3038b4820 100644 --- a/src/test/compile-fail/module-macro_use-arguments.rs +++ b/src/test/ui/compile-fail-migration/module-macro_use-arguments.rs diff --git a/src/test/ui/compile-fail-migration/module-macro_use-arguments.stderr b/src/test/ui/compile-fail-migration/module-macro_use-arguments.stderr new file mode 100644 index 00000000000..c61288776dd --- /dev/null +++ b/src/test/ui/compile-fail-migration/module-macro_use-arguments.stderr @@ -0,0 +1,8 @@ +error: arguments to macro_use are not allowed here + --> $DIR/module-macro_use-arguments.rs:11:1 + | +LL | #[macro_use(foo, bar)] //~ ERROR arguments to macro_use are not allowed here + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/move-guard-same-consts.rs b/src/test/ui/compile-fail-migration/move-guard-same-consts.rs index 05fe48e0199..05fe48e0199 100644 --- a/src/test/compile-fail/move-guard-same-consts.rs +++ b/src/test/ui/compile-fail-migration/move-guard-same-consts.rs diff --git a/src/test/ui/compile-fail-migration/move-guard-same-consts.stderr b/src/test/ui/compile-fail-migration/move-guard-same-consts.stderr new file mode 100644 index 00000000000..71f90ee7e54 --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-guard-same-consts.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `x` + --> $DIR/move-guard-same-consts.rs:30:24 + | +LL | (1, 2) if take(x) => (), + | - value moved here +LL | (1, 2) if take(x) => (), //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/move-in-guard-1.rs b/src/test/ui/compile-fail-migration/move-in-guard-1.rs index 068bfa3cd7c..068bfa3cd7c 100644 --- a/src/test/compile-fail/move-in-guard-1.rs +++ b/src/test/ui/compile-fail-migration/move-in-guard-1.rs diff --git a/src/test/ui/compile-fail-migration/move-in-guard-1.stderr b/src/test/ui/compile-fail-migration/move-in-guard-1.stderr new file mode 100644 index 00000000000..5dd46a61176 --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-in-guard-1.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `x` + --> $DIR/move-in-guard-1.rs:20:24 + | +LL | (1, _) if take(x) => (), + | - value moved here +LL | (_, 2) if take(x) => (), //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/move-in-guard-2.rs b/src/test/ui/compile-fail-migration/move-in-guard-2.rs index 984963b2f83..984963b2f83 100644 --- a/src/test/compile-fail/move-in-guard-2.rs +++ b/src/test/ui/compile-fail-migration/move-in-guard-2.rs diff --git a/src/test/ui/compile-fail-migration/move-in-guard-2.stderr b/src/test/ui/compile-fail-migration/move-in-guard-2.stderr new file mode 100644 index 00000000000..a12d9e98b1b --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-in-guard-2.stderr @@ -0,0 +1,11 @@ +error[E0382]: use of moved value: `x` + --> $DIR/move-in-guard-2.rs:20:24 + | +LL | (_, 2) if take(x) => (), //~ ERROR use of moved value: `x` + | ^ value moved here in previous iteration of loop + | + = note: move occurs because `x` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/move-into-dead-array-1.nll.stderr b/src/test/ui/compile-fail-migration/move-into-dead-array-1.nll.stderr new file mode 100644 index 00000000000..42f43d3f661 --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-into-dead-array-1.nll.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `a` + --> $DIR/move-into-dead-array-1.rs:24:5 + | +LL | a[i] = d(); //~ ERROR use of possibly uninitialized variable: `a` + | ^^^^ use of possibly uninitialized `a` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/compile-fail/move-into-dead-array-1.rs b/src/test/ui/compile-fail-migration/move-into-dead-array-1.rs index 61ccb694fd2..61ccb694fd2 100644 --- a/src/test/compile-fail/move-into-dead-array-1.rs +++ b/src/test/ui/compile-fail-migration/move-into-dead-array-1.rs diff --git a/src/test/ui/compile-fail-migration/move-into-dead-array-1.stderr b/src/test/ui/compile-fail-migration/move-into-dead-array-1.stderr new file mode 100644 index 00000000000..ac18565f194 --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-into-dead-array-1.stderr @@ -0,0 +1,9 @@ +error[E0381]: use of possibly uninitialized variable: `a` + --> $DIR/move-into-dead-array-1.rs:24:5 + | +LL | a[i] = d(); //~ ERROR use of possibly uninitialized variable: `a` + | ^^^^^^^^^^ use of possibly uninitialized `a` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0381`. diff --git a/src/test/ui/compile-fail-migration/move-into-dead-array-2.nll.stderr b/src/test/ui/compile-fail-migration/move-into-dead-array-2.nll.stderr new file mode 100644 index 00000000000..cc6cc4211c0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-into-dead-array-2.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `a` + --> $DIR/move-into-dead-array-2.rs:24:5 + | +LL | drop(a); + | - value moved here +LL | a[i] = d(); //~ ERROR use of moved value: `a` + | ^^^^ value used here after move + | + = note: move occurs because `a` has type `[D; 4]`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/move-into-dead-array-2.rs b/src/test/ui/compile-fail-migration/move-into-dead-array-2.rs index d484837c001..d484837c001 100644 --- a/src/test/compile-fail/move-into-dead-array-2.rs +++ b/src/test/ui/compile-fail-migration/move-into-dead-array-2.rs diff --git a/src/test/ui/compile-fail-migration/move-into-dead-array-2.stderr b/src/test/ui/compile-fail-migration/move-into-dead-array-2.stderr new file mode 100644 index 00000000000..0d999e67f98 --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-into-dead-array-2.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `a` + --> $DIR/move-into-dead-array-2.rs:24:5 + | +LL | drop(a); + | - value moved here +LL | a[i] = d(); //~ ERROR use of moved value: `a` + | ^^^^^^^^^^ value used here after move + | + = note: move occurs because `a` has type `[D; 4]`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/move-out-of-array-1.rs b/src/test/ui/compile-fail-migration/move-out-of-array-1.rs index 796b13538b2..796b13538b2 100644 --- a/src/test/compile-fail/move-out-of-array-1.rs +++ b/src/test/ui/compile-fail-migration/move-out-of-array-1.rs diff --git a/src/test/ui/compile-fail-migration/move-out-of-array-1.stderr b/src/test/ui/compile-fail-migration/move-out-of-array-1.stderr new file mode 100644 index 00000000000..d015505a46b --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-out-of-array-1.stderr @@ -0,0 +1,9 @@ +error[E0508]: cannot move out of type `[D; 4]`, a non-copy array + --> $DIR/move-out-of-array-1.rs:27:5 + | +LL | a[i] //~ ERROR cannot move out of type `[D; 4]`, a non-copy array + | ^^^^ cannot move out of here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/ui/compile-fail-migration/move-out-of-slice-1.nll.stderr b/src/test/ui/compile-fail-migration/move-out-of-slice-1.nll.stderr new file mode 100644 index 00000000000..b061b6a7963 --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-out-of-slice-1.nll.stderr @@ -0,0 +1,14 @@ +error[E0508]: cannot move out of type `[A]`, a non-copy slice + --> $DIR/move-out-of-slice-1.rs:17:11 + | +LL | match a { + | ^ cannot move out of here +LL | box [a] => {}, //~ ERROR cannot move out of type `[A]`, a non-copy slice + | - + | | + | data moved here + | help: to prevent move, use ref or ref mut: `ref a` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/compile-fail/move-out-of-slice-1.rs b/src/test/ui/compile-fail-migration/move-out-of-slice-1.rs index 5efbef549dd..5efbef549dd 100644 --- a/src/test/compile-fail/move-out-of-slice-1.rs +++ b/src/test/ui/compile-fail-migration/move-out-of-slice-1.rs diff --git a/src/test/ui/compile-fail-migration/move-out-of-slice-1.stderr b/src/test/ui/compile-fail-migration/move-out-of-slice-1.stderr new file mode 100644 index 00000000000..87e68140774 --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-out-of-slice-1.stderr @@ -0,0 +1,12 @@ +error[E0508]: cannot move out of type `[A]`, a non-copy slice + --> $DIR/move-out-of-slice-1.rs:18:13 + | +LL | box [a] => {}, //~ ERROR cannot move out of type `[A]`, a non-copy slice + | ^-^ + | || + | |hint: to prevent move, use `ref a` or `ref mut a` + | cannot move out of here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0508`. diff --git a/src/test/ui/compile-fail-migration/move-out-of-tuple-field.nll.stderr b/src/test/ui/compile-fail-migration/move-out-of-tuple-field.nll.stderr new file mode 100644 index 00000000000..e18db1b48a1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-out-of-tuple-field.nll.stderr @@ -0,0 +1,23 @@ +error[E0382]: use of moved value: `x.0` + --> $DIR/move-out-of-tuple-field.rs:18:13 + | +LL | let y = x.0; + | --- value moved here +LL | let z = x.0; //~ ERROR use of moved value: `x.0` + | ^^^ value used here after move + | + = note: move occurs because `x.0` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.0` + --> $DIR/move-out-of-tuple-field.rs:22:13 + | +LL | let y = x.0; + | --- value moved here +LL | let z = x.0; //~ ERROR use of moved value: `x.0` + | ^^^ value used here after move + | + = note: move occurs because `x.0` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/move-out-of-tuple-field.rs b/src/test/ui/compile-fail-migration/move-out-of-tuple-field.rs index b7393666719..b7393666719 100644 --- a/src/test/compile-fail/move-out-of-tuple-field.rs +++ b/src/test/ui/compile-fail-migration/move-out-of-tuple-field.rs diff --git a/src/test/ui/compile-fail-migration/move-out-of-tuple-field.stderr b/src/test/ui/compile-fail-migration/move-out-of-tuple-field.stderr new file mode 100644 index 00000000000..1e8acf5a64b --- /dev/null +++ b/src/test/ui/compile-fail-migration/move-out-of-tuple-field.stderr @@ -0,0 +1,23 @@ +error[E0382]: use of moved value: `x.0` + --> $DIR/move-out-of-tuple-field.rs:18:9 + | +LL | let y = x.0; + | - value moved here +LL | let z = x.0; //~ ERROR use of moved value: `x.0` + | ^ value used here after move + | + = note: move occurs because `x.0` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x.0` + --> $DIR/move-out-of-tuple-field.rs:22:9 + | +LL | let y = x.0; + | - value moved here +LL | let z = x.0; //~ ERROR use of moved value: `x.0` + | ^ value used here after move + | + = note: move occurs because `x.0` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-access-to-field.nll.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-access-to-field.nll.stderr new file mode 100644 index 00000000000..39c7f0633e3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-access-to-field.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-access-to-field.rs:21:12 + | +LL | consume(x.into_iter().next().unwrap()); + | - value moved here +LL | touch(&x[0]); //~ ERROR use of moved value: `x` + | ^ value borrowed here after move + | + = note: move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/moves-based-on-type-access-to-field.rs b/src/test/ui/compile-fail-migration/moves-based-on-type-access-to-field.rs index 63fb4ff02a4..63fb4ff02a4 100644 --- a/src/test/compile-fail/moves-based-on-type-access-to-field.rs +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-access-to-field.rs diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-access-to-field.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-access-to-field.stderr new file mode 100644 index 00000000000..81546511e03 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-access-to-field.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-access-to-field.rs:21:12 + | +LL | consume(x.into_iter().next().unwrap()); + | - value moved here +LL | touch(&x[0]); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-capture-clause-bad.nll.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-capture-clause-bad.nll.stderr new file mode 100644 index 00000000000..0081fa67b9d --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-capture-clause-bad.nll.stderr @@ -0,0 +1,16 @@ +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-capture-clause-bad.rs:18:20 + | +LL | thread::spawn(move|| { + | ------ value moved into closure here +LL | println!("{}", x); + | - variable moved due to use in closure +LL | }); +LL | println!("{}", x); //~ ERROR use of moved value + | ^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs b/src/test/ui/compile-fail-migration/moves-based-on-type-capture-clause-bad.rs index 32fa773ec80..32fa773ec80 100644 --- a/src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-capture-clause-bad.rs diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-capture-clause-bad.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-capture-clause-bad.stderr new file mode 100644 index 00000000000..54b25678819 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-capture-clause-bad.stderr @@ -0,0 +1,14 @@ +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-capture-clause-bad.rs:18:20 + | +LL | thread::spawn(move|| { + | ------ value moved (into closure) here +... +LL | println!("{}", x); //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-cyclic-types-issue-4821.nll.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-cyclic-types-issue-4821.nll.stderr new file mode 100644 index 00000000000..50b51c6f397 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-cyclic-types-issue-4821.nll.stderr @@ -0,0 +1,14 @@ +error[E0382]: use of moved value: `node` + --> $DIR/moves-based-on-type-cyclic-types-issue-4821.rs:23:13 + | +LL | Some(right) => consume(right), + | ----- value moved here +... +LL | consume(node) + r //~ ERROR use of partially moved value: `node` + | ^^^^ value used here after move + | + = note: move occurs because value has type `std::boxed::Box<List>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs b/src/test/ui/compile-fail-migration/moves-based-on-type-cyclic-types-issue-4821.rs index 0c4aae8cfad..0c4aae8cfad 100644 --- a/src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-cyclic-types-issue-4821.rs diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-cyclic-types-issue-4821.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-cyclic-types-issue-4821.stderr new file mode 100644 index 00000000000..421d25721e4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-cyclic-types-issue-4821.stderr @@ -0,0 +1,14 @@ +error[E0382]: use of partially moved value: `node` + --> $DIR/moves-based-on-type-cyclic-types-issue-4821.rs:23:13 + | +LL | Some(right) => consume(right), + | ----- value moved here +... +LL | consume(node) + r //~ ERROR use of partially moved value: `node` + | ^^^^ value used here after move + | + = note: move occurs because the value has type `std::boxed::Box<List>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-distribute-copy-over-paren.nll.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-distribute-copy-over-paren.nll.stderr new file mode 100644 index 00000000000..82420730644 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-distribute-copy-over-paren.nll.stderr @@ -0,0 +1,25 @@ +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:21:11 + | +LL | let _y = Foo { f:x }; + | - value moved here +LL | //~^ NOTE value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:30:11 + | +LL | let _y = Foo { f:(((x))) }; + | ------- value moved here +LL | //~^ NOTE value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/moves-based-on-type-distribute-copy-over-paren.rs b/src/test/ui/compile-fail-migration/moves-based-on-type-distribute-copy-over-paren.rs index 5329dcaaaf4..5329dcaaaf4 100644 --- a/src/test/compile-fail/moves-based-on-type-distribute-copy-over-paren.rs +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-distribute-copy-over-paren.rs diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-distribute-copy-over-paren.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-distribute-copy-over-paren.stderr new file mode 100644 index 00000000000..8c40b4db4f7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-distribute-copy-over-paren.stderr @@ -0,0 +1,25 @@ +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:21:12 + | +LL | let _y = Foo { f:x }; + | - value moved here +LL | //~^ NOTE value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-distribute-copy-over-paren.rs:30:12 + | +LL | let _y = Foo { f:(((x))) }; + | ------- value moved here +LL | //~^ NOTE value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-exprs.nll.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-exprs.nll.stderr new file mode 100644 index 00000000000..aa248dab85c --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-exprs.nll.stderr @@ -0,0 +1,118 @@ +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:22:11 + | +LL | let _y = Foo { f:x }; + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:28:11 + | +LL | let _y = (x, 3); + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:45:11 + | +LL | x + | - value moved here +... +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `y` + --> $DIR/moves-based-on-type-exprs.rs:46:11 + | +LL | y + | - value moved here +... +LL | touch(&y); //~ ERROR use of moved value: `y` + | ^^ value borrowed here after move + | + = note: move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:56:11 + | +LL | true => x, + | - value moved here +... +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `y` + --> $DIR/moves-based-on-type-exprs.rs:57:11 + | +LL | false => y + | - value moved here +... +LL | touch(&y); //~ ERROR use of moved value: `y` + | ^^ value borrowed here after move + | + = note: move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:68:11 + | +LL | _ if guard(x) => 10, + | - value moved here +... +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:75:11 + | +LL | let _y = [x]; + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:81:11 + | +LL | let _y = vec![x]; + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:87:11 + | +LL | let _y = x.into_iter().next().unwrap(); + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:93:11 + | +LL | let _y = [x.into_iter().next().unwrap(); 1]; + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^^ value borrowed here after move + | + = note: move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/moves-based-on-type-exprs.rs b/src/test/ui/compile-fail-migration/moves-based-on-type-exprs.rs index 194f278259b..194f278259b 100644 --- a/src/test/compile-fail/moves-based-on-type-exprs.rs +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-exprs.rs diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-exprs.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-exprs.stderr new file mode 100644 index 00000000000..003ae017b58 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-exprs.stderr @@ -0,0 +1,118 @@ +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:22:12 + | +LL | let _y = Foo { f:x }; + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:28:12 + | +LL | let _y = (x, 3); + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:45:12 + | +LL | x + | - value moved here +... +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `y` + --> $DIR/moves-based-on-type-exprs.rs:46:12 + | +LL | y + | - value moved here +... +LL | touch(&y); //~ ERROR use of moved value: `y` + | ^ value used here after move + | + = note: move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:56:12 + | +LL | true => x, + | - value moved here +... +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `y` + --> $DIR/moves-based-on-type-exprs.rs:57:12 + | +LL | false => y + | - value moved here +... +LL | touch(&y); //~ ERROR use of moved value: `y` + | ^ value used here after move + | + = note: move occurs because `y` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:68:12 + | +LL | _ if guard(x) => 10, + | - value moved here +... +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:75:12 + | +LL | let _y = [x]; + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:81:12 + | +LL | let _y = vec![x]; + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:87:12 + | +LL | let _y = x.into_iter().next().unwrap(); + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/moves-based-on-type-exprs.rs:93:12 + | +LL | let _y = [x.into_iter().next().unwrap(); 1]; + | - value moved here +LL | touch(&x); //~ ERROR use of moved value: `x` + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<std::string::String>`, which does not implement the `Copy` trait + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr new file mode 100644 index 00000000000..4f2220b0de3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of captured variable in an `Fn` closure + --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:28 + | +LL | let _f = to_fn(|| test(i)); //~ ERROR cannot move out + | ^ cannot move out of captured variable in an `Fn` closure + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs b/src/test/ui/compile-fail-migration/moves-based-on-type-move-out-of-closure-env-issue-1965.rs index 4251be36ab4..4251be36ab4 100644 --- a/src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-move-out-of-closure-env-issue-1965.rs diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr new file mode 100644 index 00000000000..43de9016a7d --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr @@ -0,0 +1,11 @@ +error[E0507]: cannot move out of captured outer variable in an `Fn` closure + --> $DIR/moves-based-on-type-move-out-of-closure-env-issue-1965.rs:21:28 + | +LL | let i = box 3; + | - captured outer variable +LL | let _f = to_fn(|| test(i)); //~ ERROR cannot move out + | ^ cannot move out of captured outer variable in an `Fn` closure + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-no-recursive-stack-closure.nll.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-no-recursive-stack-closure.nll.stderr new file mode 100644 index 00000000000..e23a6beb87e --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-no-recursive-stack-closure.nll.stderr @@ -0,0 +1,24 @@ +error[E0499]: cannot borrow `*f` as mutable more than once at a time + --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:30:27 + | +LL | (f.c)(f, true); + | ------^------- + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + | borrow later used here + +error[E0382]: borrow of moved value: `f` + --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:42:5 + | +LL | let mut r = R {c: Box::new(f)}; + | - value moved here +LL | f(&mut r, false) //~ ERROR use of moved value + | ^ value borrowed here after move + | + = note: move occurs because `f` has type `F`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +Some errors occurred: E0382, E0499. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs b/src/test/ui/compile-fail-migration/moves-based-on-type-no-recursive-stack-closure.rs index d5296065999..d5296065999 100644 --- a/src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-no-recursive-stack-closure.rs diff --git a/src/test/ui/compile-fail-migration/moves-based-on-type-no-recursive-stack-closure.stderr b/src/test/ui/compile-fail-migration/moves-based-on-type-no-recursive-stack-closure.stderr new file mode 100644 index 00000000000..65cea57f0ed --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-based-on-type-no-recursive-stack-closure.stderr @@ -0,0 +1,23 @@ +error[E0499]: cannot borrow `*f` as mutable more than once at a time + --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:30:27 + | +LL | (f.c)(f, true); + | ----- ^ - first borrow ends here + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + +error[E0382]: use of moved value: `f` + --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:42:5 + | +LL | let mut r = R {c: Box::new(f)}; + | - value moved here +LL | f(&mut r, false) //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `f` has type `F`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +Some errors occurred: E0382, E0499. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/moves-sru-moved-field.nll.stderr b/src/test/ui/compile-fail-migration/moves-sru-moved-field.nll.stderr new file mode 100644 index 00000000000..d1a528c50a1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-sru-moved-field.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `f.moved` + --> $DIR/moves-sru-moved-field.rs:30:14 + | +LL | let _b = Foo {noncopyable: g, ..f}; + | ------------------------- value moved here +LL | let _c = Foo {noncopyable: h, ..f}; //~ ERROR use of moved value: `f.moved` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ value used here after move + | + = note: move occurs because `f.moved` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/moves-sru-moved-field.rs b/src/test/ui/compile-fail-migration/moves-sru-moved-field.rs index 15977fbeb73..15977fbeb73 100644 --- a/src/test/compile-fail/moves-sru-moved-field.rs +++ b/src/test/ui/compile-fail-migration/moves-sru-moved-field.rs diff --git a/src/test/ui/compile-fail-migration/moves-sru-moved-field.stderr b/src/test/ui/compile-fail-migration/moves-sru-moved-field.stderr new file mode 100644 index 00000000000..878dd7ba830 --- /dev/null +++ b/src/test/ui/compile-fail-migration/moves-sru-moved-field.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `f.moved` + --> $DIR/moves-sru-moved-field.rs:30:37 + | +LL | let _b = Foo {noncopyable: g, ..f}; + | - value moved here +LL | let _c = Foo {noncopyable: h, ..f}; //~ ERROR use of moved value: `f.moved` + | ^ value used here after move + | + = note: move occurs because `f.moved` has type `std::boxed::Box<isize>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/multiple-main-2.rs b/src/test/ui/compile-fail-migration/multiple-main-2.rs index d9c232d7dac..d9c232d7dac 100644 --- a/src/test/compile-fail/multiple-main-2.rs +++ b/src/test/ui/compile-fail-migration/multiple-main-2.rs diff --git a/src/test/ui/compile-fail-migration/multiple-main-2.stderr b/src/test/ui/compile-fail-migration/multiple-main-2.stderr new file mode 100644 index 00000000000..e63bbc5cc43 --- /dev/null +++ b/src/test/ui/compile-fail-migration/multiple-main-2.stderr @@ -0,0 +1,14 @@ +error[E0137]: multiple functions with a #[main] attribute + --> $DIR/multiple-main-2.rs:18:1 + | +LL | / fn bar() { +LL | | } + | |_- first #[main] function +... +LL | / fn foo() { //~ ERROR multiple functions with a #[main] attribute +LL | | } + | |_^ additional #[main] function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0137`. diff --git a/src/test/compile-fail/multiple-main-3.rs b/src/test/ui/compile-fail-migration/multiple-main-3.rs index 866a59e7a4f..866a59e7a4f 100644 --- a/src/test/compile-fail/multiple-main-3.rs +++ b/src/test/ui/compile-fail-migration/multiple-main-3.rs diff --git a/src/test/ui/compile-fail-migration/multiple-main-3.stderr b/src/test/ui/compile-fail-migration/multiple-main-3.stderr new file mode 100644 index 00000000000..d489e34b875 --- /dev/null +++ b/src/test/ui/compile-fail-migration/multiple-main-3.stderr @@ -0,0 +1,14 @@ +error[E0137]: multiple functions with a #[main] attribute + --> $DIR/multiple-main-3.rs:19:5 + | +LL | / fn main1() { +LL | | } + | |_- first #[main] function +... +LL | / fn main2() { //~ ERROR multiple functions with a #[main] attribute +LL | | } + | |_____^ additional #[main] function + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0137`. diff --git a/src/test/compile-fail/multiple-plugin-registrars.rs b/src/test/ui/compile-fail-migration/multiple-plugin-registrars.rs index f5ebf84b8e0..f5ebf84b8e0 100644 --- a/src/test/compile-fail/multiple-plugin-registrars.rs +++ b/src/test/ui/compile-fail-migration/multiple-plugin-registrars.rs diff --git a/src/test/ui/compile-fail-migration/multiple-plugin-registrars.stderr b/src/test/ui/compile-fail-migration/multiple-plugin-registrars.stderr new file mode 100644 index 00000000000..f1370df0f8b --- /dev/null +++ b/src/test/ui/compile-fail-migration/multiple-plugin-registrars.stderr @@ -0,0 +1,15 @@ +error: multiple plugin registration functions found + | +note: one is here + --> $DIR/multiple-plugin-registrars.rs:17:1 + | +LL | pub fn one() {} + | ^^^^^^^^^^^^^^^ +note: one is here + --> $DIR/multiple-plugin-registrars.rs:20:1 + | +LL | pub fn two() {} + | ^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/mut-cant-alias.rs b/src/test/ui/compile-fail-migration/mut-cant-alias.rs index 99d7258477a..99d7258477a 100644 --- a/src/test/compile-fail/mut-cant-alias.rs +++ b/src/test/ui/compile-fail-migration/mut-cant-alias.rs diff --git a/src/test/ui/compile-fail-migration/mut-cant-alias.stderr b/src/test/ui/compile-fail-migration/mut-cant-alias.stderr new file mode 100644 index 00000000000..d8f23e64c31 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mut-cant-alias.stderr @@ -0,0 +1,13 @@ +error[E0499]: cannot borrow `b` as mutable more than once at a time + --> $DIR/mut-cant-alias.rs:17:20 + | +LL | let b1 = &mut *b; + | - first mutable borrow occurs here +LL | let b2 = &mut *b; //~ ERROR cannot borrow + | ^ second mutable borrow occurs here +LL | } + | - first borrow ends here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/mut-cross-borrowing.rs b/src/test/ui/compile-fail-migration/mut-cross-borrowing.rs index 73982fa2811..73982fa2811 100644 --- a/src/test/compile-fail/mut-cross-borrowing.rs +++ b/src/test/ui/compile-fail-migration/mut-cross-borrowing.rs diff --git a/src/test/ui/compile-fail-migration/mut-cross-borrowing.stderr b/src/test/ui/compile-fail-migration/mut-cross-borrowing.stderr new file mode 100644 index 00000000000..be32f235be3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mut-cross-borrowing.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/mut-cross-borrowing.rs:17:7 + | +LL | f(x) //~ ERROR mismatched types + | ^ + | | + | expected &mut isize, found struct `std::boxed::Box` + | help: consider mutably borrowing here: `&mut x` + | + = note: expected type `&mut isize` + found type `std::boxed::Box<{integer}>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.ast.nll.stderr b/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.ast.nll.stderr new file mode 100644 index 00000000000..0df303eed77 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.ast.nll.stderr @@ -0,0 +1,26 @@ +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/mut-pattern-internal-mutability.rs:18:5 + | +LL | let &mut x = foo; + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^ cannot assign twice to immutable variable + +error[E0506]: cannot assign to `*foo` because it is borrowed + --> $DIR/mut-pattern-internal-mutability.rs:27:5 + | +LL | let &mut ref x = foo; + | ----- borrow of `*foo` occurs here +LL | *foo += 1; //[ast]~ ERROR cannot assign to `*foo` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `*foo` occurs here +LL | //[mir]~^ ERROR cannot assign to `*foo` because it is borrowed +LL | drop(x); + | - borrow later used here + +error: aborting due to 2 previous errors + +Some errors occurred: E0384, E0506. +For more information about an error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.ast.stderr b/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.ast.stderr new file mode 100644 index 00000000000..47a33e320bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.ast.stderr @@ -0,0 +1,20 @@ +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/mut-pattern-internal-mutability.rs:18:5 + | +LL | let &mut x = foo; + | - first assignment to `x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^ cannot assign twice to immutable variable + +error[E0506]: cannot assign to `*foo` because it is borrowed + --> $DIR/mut-pattern-internal-mutability.rs:27:5 + | +LL | let &mut ref x = foo; + | ----- borrow of `*foo` occurs here +LL | *foo += 1; //[ast]~ ERROR cannot assign to `*foo` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `*foo` occurs here + +error: aborting due to 2 previous errors + +Some errors occurred: E0384, E0506. +For more information about an error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.mir.stderr b/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.mir.stderr new file mode 100644 index 00000000000..0df303eed77 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.mir.stderr @@ -0,0 +1,26 @@ +error[E0384]: cannot assign twice to immutable variable `x` + --> $DIR/mut-pattern-internal-mutability.rs:18:5 + | +LL | let &mut x = foo; + | - + | | + | first assignment to `x` + | consider changing this to `mut x` +LL | x += 1; //[ast]~ ERROR cannot assign twice to immutable variable + | ^^^^^^ cannot assign twice to immutable variable + +error[E0506]: cannot assign to `*foo` because it is borrowed + --> $DIR/mut-pattern-internal-mutability.rs:27:5 + | +LL | let &mut ref x = foo; + | ----- borrow of `*foo` occurs here +LL | *foo += 1; //[ast]~ ERROR cannot assign to `*foo` because it is borrowed + | ^^^^^^^^^ assignment to borrowed `*foo` occurs here +LL | //[mir]~^ ERROR cannot assign to `*foo` because it is borrowed +LL | drop(x); + | - borrow later used here + +error: aborting due to 2 previous errors + +Some errors occurred: E0384, E0506. +For more information about an error, try `rustc --explain E0384`. diff --git a/src/test/compile-fail/mut-pattern-internal-mutability.rs b/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.rs index a05ee64937e..a05ee64937e 100644 --- a/src/test/compile-fail/mut-pattern-internal-mutability.rs +++ b/src/test/ui/compile-fail-migration/mut-pattern-internal-mutability.rs diff --git a/src/test/compile-fail/mut-pattern-mismatched.rs b/src/test/ui/compile-fail-migration/mut-pattern-mismatched.rs index 7685a5c0808..7685a5c0808 100644 --- a/src/test/compile-fail/mut-pattern-mismatched.rs +++ b/src/test/ui/compile-fail-migration/mut-pattern-mismatched.rs diff --git a/src/test/ui/compile-fail-migration/mut-pattern-mismatched.stderr b/src/test/ui/compile-fail-migration/mut-pattern-mismatched.stderr new file mode 100644 index 00000000000..20bd804addc --- /dev/null +++ b/src/test/ui/compile-fail-migration/mut-pattern-mismatched.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/mut-pattern-mismatched.rs:16:10 + | +LL | let &_ //~ ERROR mismatched types + | ^^ types differ in mutability + | + = note: expected type `&mut {integer}` + found type `&_` + +error[E0308]: mismatched types + --> $DIR/mut-pattern-mismatched.rs:25:9 + | +LL | let &mut _ //~ ERROR mismatched types + | ^^^^^^ types differ in mutability + | + = note: expected type `&{integer}` + found type `&mut _` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/mut-suggestion.nll.stderr b/src/test/ui/compile-fail-migration/mut-suggestion.nll.stderr new file mode 100644 index 00000000000..39a1e93d619 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mut-suggestion.nll.stderr @@ -0,0 +1,21 @@ +error[E0596]: cannot borrow `arg` as mutable, as it is not declared as mutable + --> $DIR/mut-suggestion.rs:21:5 + | +LL | fn func(arg: S) { + | --- help: consider changing this to be mutable: `mut arg` +LL | //~^ consider changing this to `mut arg` +LL | arg.mutate(); + | ^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `local` as mutable, as it is not declared as mutable + --> $DIR/mut-suggestion.rs:29:5 + | +LL | let local = S; + | ----- help: consider changing this to be mutable: `mut local` +LL | //~^ consider changing this to `mut local` +LL | local.mutate(); + | ^^^^^ cannot borrow as mutable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/mut-suggestion.rs b/src/test/ui/compile-fail-migration/mut-suggestion.rs index 0015c8e5c00..0015c8e5c00 100644 --- a/src/test/compile-fail/mut-suggestion.rs +++ b/src/test/ui/compile-fail-migration/mut-suggestion.rs diff --git a/src/test/ui/compile-fail-migration/mut-suggestion.stderr b/src/test/ui/compile-fail-migration/mut-suggestion.stderr new file mode 100644 index 00000000000..4aa964903f5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mut-suggestion.stderr @@ -0,0 +1,21 @@ +error[E0596]: cannot borrow immutable argument `arg` as mutable + --> $DIR/mut-suggestion.rs:21:5 + | +LL | fn func(arg: S) { + | --- consider changing this to `mut arg` +LL | //~^ consider changing this to `mut arg` +LL | arg.mutate(); + | ^^^ cannot borrow mutably + +error[E0596]: cannot borrow immutable local variable `local` as mutable + --> $DIR/mut-suggestion.rs:29:5 + | +LL | let local = S; + | ----- consider changing this to `mut local` +LL | //~^ consider changing this to `mut local` +LL | local.mutate(); + | ^^^^^ cannot borrow mutably + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/mutable-class-fields-2.nll.stderr b/src/test/ui/compile-fail-migration/mutable-class-fields-2.nll.stderr new file mode 100644 index 00000000000..3433f9f0b21 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mutable-class-fields-2.nll.stderr @@ -0,0 +1,11 @@ +error[E0594]: cannot assign to `self.how_hungry` which is behind a `&` reference + --> $DIR/mutable-class-fields-2.rs:19:5 + | +LL | pub fn eat(&self) { + | ----- help: consider changing this to be a mutable reference: `&mut self` +LL | self.how_hungry -= 5; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/mutable-class-fields-2.rs b/src/test/ui/compile-fail-migration/mutable-class-fields-2.rs index 46af3a862c2..46af3a862c2 100644 --- a/src/test/compile-fail/mutable-class-fields-2.rs +++ b/src/test/ui/compile-fail-migration/mutable-class-fields-2.rs diff --git a/src/test/ui/compile-fail-migration/mutable-class-fields-2.stderr b/src/test/ui/compile-fail-migration/mutable-class-fields-2.stderr new file mode 100644 index 00000000000..aa588d8acaf --- /dev/null +++ b/src/test/ui/compile-fail-migration/mutable-class-fields-2.stderr @@ -0,0 +1,11 @@ +error[E0594]: cannot assign to field `self.how_hungry` of immutable binding + --> $DIR/mutable-class-fields-2.rs:19:5 + | +LL | pub fn eat(&self) { + | ----- use `&mut self` here to make mutable +LL | self.how_hungry -= 5; //~ ERROR cannot assign + | ^^^^^^^^^^^^^^^^^^^^ cannot mutably borrow field of immutable binding + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/mutable-class-fields.ast.nll.stderr b/src/test/ui/compile-fail-migration/mutable-class-fields.ast.nll.stderr new file mode 100644 index 00000000000..1d1e58de587 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mutable-class-fields.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0384]: cannot assign twice to immutable variable `nyan` + --> $DIR/mutable-class-fields.rs:28:3 + | +LL | let nyan : cat = cat(52, 99); + | ---- + | | + | first assignment to `nyan` + | consider changing this to `mut nyan` +LL | nyan.how_hungry = 0; //[ast]~ ERROR cannot assign + | ^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/ui/compile-fail-migration/mutable-class-fields.ast.stderr b/src/test/ui/compile-fail-migration/mutable-class-fields.ast.stderr new file mode 100644 index 00000000000..0a4d3a0e968 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mutable-class-fields.ast.stderr @@ -0,0 +1,11 @@ +error[E0594]: cannot assign to field `nyan.how_hungry` of immutable binding + --> $DIR/mutable-class-fields.rs:28:3 + | +LL | let nyan : cat = cat(52, 99); + | ---- consider changing this to `mut nyan` +LL | nyan.how_hungry = 0; //[ast]~ ERROR cannot assign + | ^^^^^^^^^^^^^^^^^^^ cannot mutably borrow field of immutable binding + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/mutable-class-fields.mir.stderr b/src/test/ui/compile-fail-migration/mutable-class-fields.mir.stderr new file mode 100644 index 00000000000..1d1e58de587 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mutable-class-fields.mir.stderr @@ -0,0 +1,14 @@ +error[E0384]: cannot assign twice to immutable variable `nyan` + --> $DIR/mutable-class-fields.rs:28:3 + | +LL | let nyan : cat = cat(52, 99); + | ---- + | | + | first assignment to `nyan` + | consider changing this to `mut nyan` +LL | nyan.how_hungry = 0; //[ast]~ ERROR cannot assign + | ^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0384`. diff --git a/src/test/compile-fail/mutable-class-fields.rs b/src/test/ui/compile-fail-migration/mutable-class-fields.rs index f138ae93f71..f138ae93f71 100644 --- a/src/test/compile-fail/mutable-class-fields.rs +++ b/src/test/ui/compile-fail-migration/mutable-class-fields.rs diff --git a/src/test/compile-fail/mutable-enum-indirect.rs b/src/test/ui/compile-fail-migration/mutable-enum-indirect.rs index 9107745b0e9..9107745b0e9 100644 --- a/src/test/compile-fail/mutable-enum-indirect.rs +++ b/src/test/ui/compile-fail-migration/mutable-enum-indirect.rs diff --git a/src/test/ui/compile-fail-migration/mutable-enum-indirect.stderr b/src/test/ui/compile-fail-migration/mutable-enum-indirect.stderr new file mode 100644 index 00000000000..1ad4b6a1517 --- /dev/null +++ b/src/test/ui/compile-fail-migration/mutable-enum-indirect.stderr @@ -0,0 +1,18 @@ +error[E0277]: `NoSync` cannot be shared between threads safely + --> $DIR/mutable-enum-indirect.rs:27:5 + | +LL | bar(&x); + | ^^^ `NoSync` cannot be shared between threads safely + | + = help: within `&Foo`, the trait `std::marker::Sync` is not implemented for `NoSync` + = note: required because it appears within the type `Foo` + = note: required because it appears within the type `&Foo` +note: required by `bar` + --> $DIR/mutable-enum-indirect.rs:23:1 + | +LL | fn bar<T: Sync>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/mutexguard-sync.rs b/src/test/ui/compile-fail-migration/mutexguard-sync.rs index 2d4b50eb7b2..2d4b50eb7b2 100644 --- a/src/test/compile-fail/mutexguard-sync.rs +++ b/src/test/ui/compile-fail-migration/mutexguard-sync.rs diff --git a/src/test/ui/compile-fail-migration/mutexguard-sync.stderr b/src/test/ui/compile-fail-migration/mutexguard-sync.stderr new file mode 100644 index 00000000000..709829e484b --- /dev/null +++ b/src/test/ui/compile-fail-migration/mutexguard-sync.stderr @@ -0,0 +1,17 @@ +error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely + --> $DIR/mutexguard-sync.rs:21:5 + | +LL | test_sync(guard); + | ^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>` + = note: required because of the requirements on the impl of `std::marker::Sync` for `std::sync::MutexGuard<'_, std::cell::Cell<i32>>` +note: required by `test_sync` + --> $DIR/mutexguard-sync.rs:15:1 + | +LL | fn test_sync<T: Sync>(_t: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/namespace-mix.rs b/src/test/ui/compile-fail-migration/namespace-mix.rs index c1c724fc431..c1c724fc431 100644 --- a/src/test/compile-fail/namespace-mix.rs +++ b/src/test/ui/compile-fail-migration/namespace-mix.rs diff --git a/src/test/ui/compile-fail-migration/namespace-mix.stderr b/src/test/ui/compile-fail-migration/namespace-mix.stderr new file mode 100644 index 00000000000..6d72b6044ae --- /dev/null +++ b/src/test/ui/compile-fail-migration/namespace-mix.stderr @@ -0,0 +1,594 @@ +error[E0423]: expected value, found type alias `m1::S` + --> $DIR/namespace-mix.rs:44:11 + | +LL | check(m1::S); //~ ERROR expected value, found type alias `m1::S` + | ^^^^- + | | + | did you mean `TS`? + | + = note: can't use a type alias as a constructor +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use m2::S; + | +LL | use namespace_mix::xm2::S; + | + +error[E0423]: expected value, found type alias `xm1::S` + --> $DIR/namespace-mix.rs:50:11 + | +LL | check(xm1::S); //~ ERROR expected value, found type alias `xm1::S` + | ^^^^^- + | | + | did you mean `TS`? + | + = note: can't use a type alias as a constructor +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use m2::S; + | +LL | use namespace_mix::xm2::S; + | + +error[E0423]: expected value, found struct variant `m7::V` + --> $DIR/namespace-mix.rs:110:11 + | +LL | check(m7::V); //~ ERROR expected value, found struct variant `m7::V` + | ^^^^- + | | | + | | did you mean `TV`? + | did you mean `m7::V { /* fields */ }`? +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use m8::V; + | +LL | use namespace_mix::xm8::V; + | + +error[E0423]: expected value, found struct variant `xm7::V` + --> $DIR/namespace-mix.rs:116:11 + | +LL | check(xm7::V); //~ ERROR expected value, found struct variant `xm7::V` + | ^^^^^- + | | | + | | did you mean `TV`? + | did you mean `xm7::V { /* fields */ }`? +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use m8::V; + | +LL | use namespace_mix::xm8::V; + | + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:43:5 + | +LL | check(m1::S{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::S: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:45:5 + | +LL | check(m2::S{}); //~ ERROR c::S + | ^^^^^ the trait `Impossible` is not implemented for `c::S` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:46:5 + | +LL | check(m2::S); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:49:5 + | +LL | check(xm1::S{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::S: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:51:5 + | +LL | check(xm2::S{}); //~ ERROR c::S + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::S` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:52:5 + | +LL | check(xm2::S); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:65:5 + | +LL | check(m3::TS{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `fn() -> c::TS {c::TS::{{constructor}}}: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:66:5 + | +LL | check(m3::TS); //~ ERROR c::TS + | ^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS::{{constructor}}}` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::TS: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:67:5 + | +LL | check(m4::TS{}); //~ ERROR c::TS + | ^^^^^ the trait `Impossible` is not implemented for `c::TS` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:68:5 + | +LL | check(m4::TS); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:71:5 + | +LL | check(xm3::TS{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::TS::{{constructor}}}: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:72:5 + | +LL | check(xm3::TS); //~ ERROR c::TS + | ^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS::{{constructor}}}` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::TS: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:73:5 + | +LL | check(xm4::TS{}); //~ ERROR c::TS + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::TS` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:74:5 + | +LL | check(xm4::TS); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:87:5 + | +LL | check(m5::US{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::US: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:88:5 + | +LL | check(m5::US); //~ ERROR c::US + | ^^^^^ the trait `Impossible` is not implemented for `c::US` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::US: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:89:5 + | +LL | check(m6::US{}); //~ ERROR c::US + | ^^^^^ the trait `Impossible` is not implemented for `c::US` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:90:5 + | +LL | check(m6::US); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:93:5 + | +LL | check(xm5::US{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:94:5 + | +LL | check(xm5::US); //~ ERROR c::US + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:95:5 + | +LL | check(xm6::US{}); //~ ERROR c::US + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:96:5 + | +LL | check(xm6::US); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:109:5 + | +LL | check(m7::V{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::E: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:111:5 + | +LL | check(m8::V{}); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `c::E` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:112:5 + | +LL | check(m8::V); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:115:5 + | +LL | check(xm7::V{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:117:5 + | +LL | check(xm8::V{}); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:118:5 + | +LL | check(xm8::V); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:131:5 + | +LL | check(m9::TV{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `fn() -> c::E {c::E::TV}: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:132:5 + | +LL | check(m9::TV); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `fn() -> c::E {c::E::TV}` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::E: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:133:5 + | +LL | check(mA::TV{}); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `c::E` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:134:5 + | +LL | check(mA::TV); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:137:5 + | +LL | check(xm9::TV{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `fn() -> namespace_mix::c::E {namespace_mix::c::E::TV}: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:138:5 + | +LL | check(xm9::TV); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::E {namespace_mix::c::E::TV}` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:139:5 + | +LL | check(xmA::TV{}); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:140:5 + | +LL | check(xmA::TV); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:153:5 + | +LL | check(mB::UV{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::E: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:154:5 + | +LL | check(mB::UV); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `c::E` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::E: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:155:5 + | +LL | check(mC::UV{}); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `c::E` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:156:5 + | +LL | check(mC::UV); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:159:5 + | +LL | check(xmB::UV{}); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:160:5 + | +LL | check(xmB::UV); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:161:5 + | +LL | check(xmC::UV{}); //~ ERROR c::E + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisfied + --> $DIR/namespace-mix.rs:162:5 + | +LL | check(xmC::UV); //~ ERROR c::Item + | ^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` + | +note: required by `check` + --> $DIR/namespace-mix.rs:31:1 + | +LL | fn check<T: Impossible>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 48 previous errors + +Some errors occurred: E0277, E0423. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/namespaced-enum-glob-import-no-impls-xcrate.rs b/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls-xcrate.rs index 67800f8de4e..67800f8de4e 100644 --- a/src/test/compile-fail/namespaced-enum-glob-import-no-impls-xcrate.rs +++ b/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls-xcrate.rs diff --git a/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls-xcrate.stderr b/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls-xcrate.stderr new file mode 100644 index 00000000000..47ecb1248b2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls-xcrate.stderr @@ -0,0 +1,27 @@ +error[E0425]: cannot find function `foo` in this scope + --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:21:5 + | +LL | foo(); //~ ERROR cannot find function `foo` in this scope + | ^^^ not found in this scope + +error[E0425]: cannot find function `foo` in module `m` + --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:22:8 + | +LL | m::foo(); //~ ERROR cannot find function `foo` in module `m` + | ^^^ not found in `m` + +error[E0425]: cannot find function `bar` in this scope + --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:23:5 + | +LL | bar(); //~ ERROR cannot find function `bar` in this scope + | ^^^ not found in this scope + +error[E0425]: cannot find function `bar` in module `m` + --> $DIR/namespaced-enum-glob-import-no-impls-xcrate.rs:24:8 + | +LL | m::bar(); //~ ERROR cannot find function `bar` in module `m` + | ^^^ not found in `m` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/namespaced-enum-glob-import-no-impls.rs b/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls.rs index d5e659c236e..d5e659c236e 100644 --- a/src/test/compile-fail/namespaced-enum-glob-import-no-impls.rs +++ b/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls.rs diff --git a/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls.stderr b/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls.stderr new file mode 100644 index 00000000000..916801df2e8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/namespaced-enum-glob-import-no-impls.stderr @@ -0,0 +1,27 @@ +error[E0425]: cannot find function `foo` in this scope + --> $DIR/namespaced-enum-glob-import-no-impls.rs:31:5 + | +LL | foo(); //~ ERROR cannot find function `foo` in this scope + | ^^^ not found in this scope + +error[E0425]: cannot find function `foo` in module `m` + --> $DIR/namespaced-enum-glob-import-no-impls.rs:32:8 + | +LL | m::foo(); //~ ERROR cannot find function `foo` in module `m` + | ^^^ not found in `m` + +error[E0425]: cannot find function `bar` in this scope + --> $DIR/namespaced-enum-glob-import-no-impls.rs:33:5 + | +LL | bar(); //~ ERROR cannot find function `bar` in this scope + | ^^^ not found in this scope + +error[E0425]: cannot find function `bar` in module `m` + --> $DIR/namespaced-enum-glob-import-no-impls.rs:34:8 + | +LL | m::bar(); //~ ERROR cannot find function `bar` in module `m` + | ^^^ not found in `m` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/nested-cfg-attrs.rs b/src/test/ui/compile-fail-migration/nested-cfg-attrs.rs index f0c41ff7854..f0c41ff7854 100644 --- a/src/test/compile-fail/nested-cfg-attrs.rs +++ b/src/test/ui/compile-fail-migration/nested-cfg-attrs.rs diff --git a/src/test/ui/compile-fail-migration/nested-cfg-attrs.stderr b/src/test/ui/compile-fail-migration/nested-cfg-attrs.stderr new file mode 100644 index 00000000000..5501dc8c6ad --- /dev/null +++ b/src/test/ui/compile-fail-migration/nested-cfg-attrs.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find function `f` in this scope + --> $DIR/nested-cfg-attrs.rs:14:13 + | +LL | fn main() { f() } //~ ERROR cannot find function `f` in this scope + | ^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/nested-ty-params.rs b/src/test/ui/compile-fail-migration/nested-ty-params.rs index aac37289bb7..aac37289bb7 100644 --- a/src/test/compile-fail/nested-ty-params.rs +++ b/src/test/ui/compile-fail-migration/nested-ty-params.rs diff --git a/src/test/ui/compile-fail-migration/nested-ty-params.stderr b/src/test/ui/compile-fail-migration/nested-ty-params.stderr new file mode 100644 index 00000000000..93b934f610f --- /dev/null +++ b/src/test/ui/compile-fail-migration/nested-ty-params.stderr @@ -0,0 +1,28 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/nested-ty-params.rs:13:16 + | +LL | fn hd<U>(v: Vec<U> ) -> U { + | - type variable from outer function +LL | fn hd1(w: [U]) -> U { return w[0]; } + | --- ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `hd1<U>` + +error[E0401]: can't use type parameters from outer function + --> $DIR/nested-ty-params.rs:13:23 + | +LL | fn hd<U>(v: Vec<U> ) -> U { + | - type variable from outer function +LL | fn hd1(w: [U]) -> U { return w[0]; } + | --- ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `hd1<U>` + +error[E0601]: `main` function not found in crate `nested_ty_params` + | + = note: consider adding a `main` function to `$DIR/nested-ty-params.rs` + +error: aborting due to 3 previous errors + +Some errors occurred: E0401, E0601. +For more information about an error, try `rustc --explain E0401`. diff --git a/src/test/compile-fail/never-assign-dead-code.rs b/src/test/ui/compile-fail-migration/never-assign-dead-code.rs index 0fb75b535c6..0fb75b535c6 100644 --- a/src/test/compile-fail/never-assign-dead-code.rs +++ b/src/test/ui/compile-fail-migration/never-assign-dead-code.rs diff --git a/src/test/ui/compile-fail-migration/never-assign-dead-code.stderr b/src/test/ui/compile-fail-migration/never-assign-dead-code.stderr new file mode 100644 index 00000000000..7c7126c93c6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/never-assign-dead-code.stderr @@ -0,0 +1,44 @@ +warning: unreachable statement + --> $DIR/never-assign-dead-code.rs:20:5 + | +LL | drop(x); //~ WARN unreachable + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/never-assign-dead-code.rs:15:9 + | +LL | #![warn(unused)] + | ^^^^^^ + = note: #[warn(unreachable_code)] implied by #[warn(unused)] + +warning: unreachable expression + --> $DIR/never-assign-dead-code.rs:20:5 + | +LL | drop(x); //~ WARN unreachable + | ^^^^^^^ + +warning: unused variable: `x` + --> $DIR/never-assign-dead-code.rs:19:9 + | +LL | let x: ! = panic!("aah"); //~ WARN unused + | ^ help: consider using `_x` instead + | +note: lint level defined here + --> $DIR/never-assign-dead-code.rs:15:9 + | +LL | #![warn(unused)] + | ^^^^^^ + = note: #[warn(unused_variables)] implied by #[warn(unused)] + +error: compilation successful + --> $DIR/never-assign-dead-code.rs:18:1 + | +LL | / fn main() { //~ ERROR: compilation successful +LL | | let x: ! = panic!("aah"); //~ WARN unused +LL | | drop(x); //~ WARN unreachable +LL | | //~^ WARN unreachable +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/never-assign-wrong-type.rs b/src/test/ui/compile-fail-migration/never-assign-wrong-type.rs index c0dd2cab749..c0dd2cab749 100644 --- a/src/test/compile-fail/never-assign-wrong-type.rs +++ b/src/test/ui/compile-fail-migration/never-assign-wrong-type.rs diff --git a/src/test/ui/compile-fail-migration/never-assign-wrong-type.stderr b/src/test/ui/compile-fail-migration/never-assign-wrong-type.stderr new file mode 100644 index 00000000000..41afe88b384 --- /dev/null +++ b/src/test/ui/compile-fail-migration/never-assign-wrong-type.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/never-assign-wrong-type.rs:17:16 + | +LL | let x: ! = "hello"; //~ ERROR mismatched types + | ^^^^^^^ expected !, found reference + | + = note: expected type `!` + found type `&'static str` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/never_transmute_never.rs b/src/test/ui/compile-fail-migration/never_transmute_never.rs index cbcc47f60c3..cbcc47f60c3 100644 --- a/src/test/compile-fail/never_transmute_never.rs +++ b/src/test/ui/compile-fail-migration/never_transmute_never.rs diff --git a/src/test/compile-fail/nll/constant-thread-locals-issue-47053.rs b/src/test/ui/compile-fail-migration/nll/constant-thread-locals-issue-47053.rs index 7b1dd9265af..7b1dd9265af 100644 --- a/src/test/compile-fail/nll/constant-thread-locals-issue-47053.rs +++ b/src/test/ui/compile-fail-migration/nll/constant-thread-locals-issue-47053.rs diff --git a/src/test/ui/compile-fail-migration/nll/constant-thread-locals-issue-47053.stderr b/src/test/ui/compile-fail-migration/nll/constant-thread-locals-issue-47053.stderr new file mode 100644 index 00000000000..3aa95fcad01 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/constant-thread-locals-issue-47053.stderr @@ -0,0 +1,9 @@ +error[E0594]: cannot assign to immutable static item `FOO` + --> $DIR/constant-thread-locals-issue-47053.rs:20:5 + | +LL | FOO = 6; //~ ERROR cannot assign to immutable static item `FOO` [E0594] + | ^^^^^^^ cannot assign + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/nll/do-not-ignore-lifetime-bounds-in-copy.rs b/src/test/ui/compile-fail-migration/nll/do-not-ignore-lifetime-bounds-in-copy.rs index 2a4295fd90a..2a4295fd90a 100644 --- a/src/test/compile-fail/nll/do-not-ignore-lifetime-bounds-in-copy.rs +++ b/src/test/ui/compile-fail-migration/nll/do-not-ignore-lifetime-bounds-in-copy.rs diff --git a/src/test/ui/compile-fail-migration/nll/do-not-ignore-lifetime-bounds-in-copy.stderr b/src/test/ui/compile-fail-migration/nll/do-not-ignore-lifetime-bounds-in-copy.stderr new file mode 100644 index 00000000000..edf32d3d223 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/do-not-ignore-lifetime-bounds-in-copy.stderr @@ -0,0 +1,14 @@ +error[E0597]: `s` does not live long enough + --> $DIR/do-not-ignore-lifetime-bounds-in-copy.rs:20:17 + | +LL | let a = Foo(&s); //~ ERROR `s` does not live long enough [E0597] + | ^^ borrowed value does not live long enough +... +LL | } + | - `s` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/nll/loan_ends_mid_block_pair.rs b/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_pair.rs index 97126e98cbf..97126e98cbf 100644 --- a/src/test/compile-fail/nll/loan_ends_mid_block_pair.rs +++ b/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_pair.rs diff --git a/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_pair.stderr b/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_pair.stderr new file mode 100644 index 00000000000..9afae71edbe --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_pair.stderr @@ -0,0 +1,93 @@ +error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) + --> $DIR/loan_ends_mid_block_pair.rs:25:5 + | +LL | let c = &mut data.0; + | ------ borrow of `data.0` occurs here +LL | capitalize(c); +LL | data.0 = 'e'; + | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here + +error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) + --> $DIR/loan_ends_mid_block_pair.rs:28:5 + | +LL | let c = &mut data.0; + | ------ borrow of `data.0` occurs here +... +LL | data.0 = 'f'; + | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here + +error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) + --> $DIR/loan_ends_mid_block_pair.rs:31:5 + | +LL | let c = &mut data.0; + | ------ borrow of `data.0` occurs here +... +LL | data.0 = 'g'; + | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here + +error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) + --> $DIR/loan_ends_mid_block_pair.rs:41:5 + | +LL | let c = &mut data.0; + | ------ borrow of `data.0` occurs here +LL | capitalize(c); +LL | data.0 = 'e'; + | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here + +error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) + --> $DIR/loan_ends_mid_block_pair.rs:43:5 + | +LL | let c = &mut data.0; + | ------ borrow of `data.0` occurs here +... +LL | data.0 = 'f'; + | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here + +error[E0506]: cannot assign to `data.0` because it is borrowed (Ast) + --> $DIR/loan_ends_mid_block_pair.rs:45:5 + | +LL | let c = &mut data.0; + | ------ borrow of `data.0` occurs here +... +LL | data.0 = 'g'; + | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here + +error[E0506]: cannot assign to `data.0` because it is borrowed (Mir) + --> $DIR/loan_ends_mid_block_pair.rs:25:5 + | +LL | let c = &mut data.0; + | ----------- borrow of `data.0` occurs here +LL | capitalize(c); +LL | data.0 = 'e'; + | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here +... +LL | capitalize(c); + | - borrow later used here + +error[E0506]: cannot assign to `data.0` because it is borrowed (Mir) + --> $DIR/loan_ends_mid_block_pair.rs:28:5 + | +LL | let c = &mut data.0; + | ----------- borrow of `data.0` occurs here +... +LL | data.0 = 'f'; + | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here +... +LL | capitalize(c); + | - borrow later used here + +error[E0506]: cannot assign to `data.0` because it is borrowed (Mir) + --> $DIR/loan_ends_mid_block_pair.rs:31:5 + | +LL | let c = &mut data.0; + | ----------- borrow of `data.0` occurs here +... +LL | data.0 = 'g'; + | ^^^^^^^^^^^^ assignment to borrowed `data.0` occurs here +... +LL | capitalize(c); + | - borrow later used here + +error: aborting due to 9 previous errors + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/nll/loan_ends_mid_block_vec.rs b/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_vec.rs index b5357d0ee82..b5357d0ee82 100644 --- a/src/test/compile-fail/nll/loan_ends_mid_block_vec.rs +++ b/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_vec.rs diff --git a/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_vec.stderr b/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_vec.stderr new file mode 100644 index 00000000000..4c739cfe978 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/loan_ends_mid_block_vec.stderr @@ -0,0 +1,111 @@ +error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) + --> $DIR/loan_ends_mid_block_vec.rs:24:5 + | +LL | let slice = &mut data; + | ---- first mutable borrow occurs here +LL | capitalize(slice); +LL | data.push('d'); + | ^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) + --> $DIR/loan_ends_mid_block_vec.rs:27:5 + | +LL | let slice = &mut data; + | ---- first mutable borrow occurs here +... +LL | data.push('e'); + | ^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) + --> $DIR/loan_ends_mid_block_vec.rs:30:5 + | +LL | let slice = &mut data; + | ---- first mutable borrow occurs here +... +LL | data.push('f'); + | ^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) + --> $DIR/loan_ends_mid_block_vec.rs:40:5 + | +LL | let slice = &mut data; + | ---- first mutable borrow occurs here +LL | capitalize(slice); +LL | data.push('d'); + | ^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) + --> $DIR/loan_ends_mid_block_vec.rs:42:5 + | +LL | let slice = &mut data; + | ---- first mutable borrow occurs here +... +LL | data.push('e'); + | ^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `data` as mutable more than once at a time (Ast) + --> $DIR/loan_ends_mid_block_vec.rs:44:5 + | +LL | let slice = &mut data; + | ---- first mutable borrow occurs here +... +LL | data.push('f'); + | ^^^^ second mutable borrow occurs here +LL | //~^ ERROR (Ast) [E0499] +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `data` as mutable more than once at a time (Mir) + --> $DIR/loan_ends_mid_block_vec.rs:24:5 + | +LL | let slice = &mut data; + | --------- first mutable borrow occurs here +LL | capitalize(slice); +LL | data.push('d'); + | ^^^^ second mutable borrow occurs here +... +LL | capitalize(slice); + | ----- borrow later used here + +error[E0499]: cannot borrow `data` as mutable more than once at a time (Mir) + --> $DIR/loan_ends_mid_block_vec.rs:27:5 + | +LL | let slice = &mut data; + | --------- first mutable borrow occurs here +... +LL | data.push('e'); + | ^^^^ second mutable borrow occurs here +... +LL | capitalize(slice); + | ----- borrow later used here + +error[E0499]: cannot borrow `data` as mutable more than once at a time (Mir) + --> $DIR/loan_ends_mid_block_vec.rs:30:5 + | +LL | let slice = &mut data; + | --------- first mutable borrow occurs here +... +LL | data.push('f'); + | ^^^^ second mutable borrow occurs here +... +LL | capitalize(slice); + | ----- borrow later used here + +error: aborting due to 9 previous errors + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.ast.nll.stderr b/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.ast.nll.stderr new file mode 100644 index 00000000000..54b1fcbd5bb --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.ast.nll.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/match-guards-always-borrow.rs:23:13 + | +LL | (|| { let bar = foo; bar.take() })(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.ast.stderr b/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.ast.stderr new file mode 100644 index 00000000000..d6186d7561a --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.ast.stderr @@ -0,0 +1,12 @@ +error: compilation successful + --> $DIR/match-guards-always-borrow.rs:57:1 + | +LL | / fn main() { //[ast]~ ERROR compilation successful +LL | | should_reject_destructive_mutate_in_guard(); +LL | | allow_mutate_in_arm_body(); +LL | | allow_move_into_arm_body(); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.mir.stderr b/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.mir.stderr new file mode 100644 index 00000000000..54b1fcbd5bb --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.mir.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/match-guards-always-borrow.rs:23:13 + | +LL | (|| { let bar = foo; bar.take() })(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/nll/match-guards-always-borrow.rs b/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.rs index 98553144627..98553144627 100644 --- a/src/test/compile-fail/nll/match-guards-always-borrow.rs +++ b/src/test/ui/compile-fail-migration/nll/match-guards-always-borrow.rs diff --git a/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.ast.nll.stderr b/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.ast.nll.stderr new file mode 100644 index 00000000000..caa3173d746 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.ast.nll.stderr @@ -0,0 +1,14 @@ +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/reference-carried-through-struct-field.rs:21:5 + | +LL | let wrapper = Wrap { w: &mut x }; + | ------ borrow of `x` occurs here +LL | x += 1; //[ast]~ ERROR cannot assign to `x` because it is borrowed [E0506] + | ^^^^^^ use of borrowed `x` +LL | //[mir]~^ ERROR cannot use `x` because it was mutably borrowed [E0503] +LL | *wrapper.w += 1; + | --------------- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.ast.stderr b/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.ast.stderr new file mode 100644 index 00000000000..c1022d66070 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.ast.stderr @@ -0,0 +1,11 @@ +error[E0506]: cannot assign to `x` because it is borrowed + --> $DIR/reference-carried-through-struct-field.rs:21:5 + | +LL | let wrapper = Wrap { w: &mut x }; + | - borrow of `x` occurs here +LL | x += 1; //[ast]~ ERROR cannot assign to `x` because it is borrowed [E0506] + | ^^^^^^ assignment to borrowed `x` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.mir.stderr b/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.mir.stderr new file mode 100644 index 00000000000..caa3173d746 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.mir.stderr @@ -0,0 +1,14 @@ +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/reference-carried-through-struct-field.rs:21:5 + | +LL | let wrapper = Wrap { w: &mut x }; + | ------ borrow of `x` occurs here +LL | x += 1; //[ast]~ ERROR cannot assign to `x` because it is borrowed [E0506] + | ^^^^^^ use of borrowed `x` +LL | //[mir]~^ ERROR cannot use `x` because it was mutably borrowed [E0503] +LL | *wrapper.w += 1; + | --------------- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/compile-fail/nll/reference-carried-through-struct-field.rs b/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.rs index 589a3daa38d..589a3daa38d 100644 --- a/src/test/compile-fail/nll/reference-carried-through-struct-field.rs +++ b/src/test/ui/compile-fail-migration/nll/reference-carried-through-struct-field.rs diff --git a/src/test/ui/compile-fail-migration/nll/region-ends-after-if-condition.nll.stderr b/src/test/ui/compile-fail-migration/nll/region-ends-after-if-condition.nll.stderr new file mode 100644 index 00000000000..fa3a5e0c0d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/region-ends-after-if-condition.nll.stderr @@ -0,0 +1,39 @@ +error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Ast) + --> $DIR/region-ends-after-if-condition.rs:29:9 + | +LL | let value = &my_struct.field; + | --------------- immutable borrow occurs here +LL | if value.is_empty() { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^ mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Ast) + --> $DIR/region-ends-after-if-condition.rs:39:9 + | +LL | let value = &my_struct.field; + | --------------- immutable borrow occurs here +LL | if value.is_empty() { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^ mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Mir) + --> $DIR/region-ends-after-if-condition.rs:39:9 + | +LL | let value = &my_struct.field; + | ---------------- immutable borrow occurs here +LL | if value.is_empty() { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here +... +LL | drop(value); + | ----- borrow later used here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/nll/region-ends-after-if-condition.rs b/src/test/ui/compile-fail-migration/nll/region-ends-after-if-condition.rs index e1c47a6bbff..e1c47a6bbff 100644 --- a/src/test/compile-fail/nll/region-ends-after-if-condition.rs +++ b/src/test/ui/compile-fail-migration/nll/region-ends-after-if-condition.rs diff --git a/src/test/ui/compile-fail-migration/nll/region-ends-after-if-condition.stderr b/src/test/ui/compile-fail-migration/nll/region-ends-after-if-condition.stderr new file mode 100644 index 00000000000..d966c62c85f --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/region-ends-after-if-condition.stderr @@ -0,0 +1,39 @@ +error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Ast) + --> $DIR/region-ends-after-if-condition.rs:29:9 + | +LL | let value = &my_struct.field; + | --------------- immutable borrow occurs here +LL | if value.is_empty() { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^ mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Ast) + --> $DIR/region-ends-after-if-condition.rs:39:9 + | +LL | let value = &my_struct.field; + | --------------- immutable borrow occurs here +LL | if value.is_empty() { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^ mutable borrow occurs here +... +LL | } + | - immutable borrow ends here + +error[E0502]: cannot borrow `my_struct.field` as mutable because it is also borrowed as immutable (Mir) + --> $DIR/region-ends-after-if-condition.rs:39:9 + | +LL | let value = &my_struct.field; + | ---------------- immutable borrow occurs here +LL | if value.is_empty() { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^ mutable borrow occurs here +... +LL | drop(value); + | ----- borrow later used here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/nll/return_from_loop.rs b/src/test/ui/compile-fail-migration/nll/return_from_loop.rs index 13f1ca6431b..13f1ca6431b 100644 --- a/src/test/compile-fail/nll/return_from_loop.rs +++ b/src/test/ui/compile-fail-migration/nll/return_from_loop.rs diff --git a/src/test/ui/compile-fail-migration/nll/return_from_loop.stderr b/src/test/ui/compile-fail-migration/nll/return_from_loop.stderr new file mode 100644 index 00000000000..7130aa64dab --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/return_from_loop.stderr @@ -0,0 +1,39 @@ +error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time (Ast) + --> $DIR/return_from_loop.rs:32:9 + | +LL | let value = &mut my_struct.field; + | --------------- first mutable borrow occurs here +LL | loop { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time (Ast) + --> $DIR/return_from_loop.rs:45:9 + | +LL | let value = &mut my_struct.field; + | --------------- first mutable borrow occurs here +LL | loop { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^ second mutable borrow occurs here +... +LL | } + | - first borrow ends here + +error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time (Mir) + --> $DIR/return_from_loop.rs:32:9 + | +LL | let value = &mut my_struct.field; + | -------------------- first mutable borrow occurs here +LL | loop { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^ second mutable borrow occurs here +... +LL | value.len(); + | ----- borrow later used here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/nll/unused-mut-issue-50343.rs b/src/test/ui/compile-fail-migration/nll/unused-mut-issue-50343.rs index e9110b8114b..e9110b8114b 100644 --- a/src/test/compile-fail/nll/unused-mut-issue-50343.rs +++ b/src/test/ui/compile-fail-migration/nll/unused-mut-issue-50343.rs diff --git a/src/test/ui/compile-fail-migration/nll/unused-mut-issue-50343.stderr b/src/test/ui/compile-fail-migration/nll/unused-mut-issue-50343.stderr new file mode 100644 index 00000000000..bfc67e213ec --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/unused-mut-issue-50343.stderr @@ -0,0 +1,16 @@ +error: variable does not need to be mutable + --> $DIR/unused-mut-issue-50343.rs:15:33 + | +LL | vec![(42, 22)].iter().map(|(mut x, _y)| ()).count(); + | ----^ + | | + | help: remove this `mut` + | +note: lint level defined here + --> $DIR/unused-mut-issue-50343.rs:12:9 + | +LL | #![deny(unused_mut)] + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/nll/where_clauses_in_functions.rs b/src/test/ui/compile-fail-migration/nll/where_clauses_in_functions.rs index 0efdd19df3c..0efdd19df3c 100644 --- a/src/test/compile-fail/nll/where_clauses_in_functions.rs +++ b/src/test/ui/compile-fail-migration/nll/where_clauses_in_functions.rs diff --git a/src/test/ui/compile-fail-migration/nll/where_clauses_in_functions.stderr b/src/test/ui/compile-fail-migration/nll/where_clauses_in_functions.stderr new file mode 100644 index 00000000000..3d5dd4beb04 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/where_clauses_in_functions.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/where_clauses_in_functions.rs:23:5 + | +LL | foo(x, y) + | ^^^ + +error: unsatisfied lifetime constraints + --> $DIR/where_clauses_in_functions.rs:23:5 + | +LL | fn bar<'a, 'b>(x: &'a u32, y: &'b u32) -> (&'a u32, &'b u32) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | foo(x, y) + | ^^^^^^^^^ argument requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/nll/where_clauses_in_structs.rs b/src/test/ui/compile-fail-migration/nll/where_clauses_in_structs.rs index 92e7db86173..92e7db86173 100644 --- a/src/test/compile-fail/nll/where_clauses_in_structs.rs +++ b/src/test/ui/compile-fail-migration/nll/where_clauses_in_structs.rs diff --git a/src/test/ui/compile-fail-migration/nll/where_clauses_in_structs.stderr b/src/test/ui/compile-fail-migration/nll/where_clauses_in_structs.stderr new file mode 100644 index 00000000000..c7ad9879b29 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nll/where_clauses_in_structs.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/where_clauses_in_structs.rs:23:5 + | +LL | Foo { x, y }; + | ^^^ + +error: unsatisfied lifetime constraints + --> $DIR/where_clauses_in_structs.rs:23:11 + | +LL | fn bar<'a, 'b>(x: Cell<&'a u32>, y: Cell<&'b u32>) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | Foo { x, y }; + | ^ requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/no-capture-arc.nll.stderr b/src/test/ui/compile-fail-migration/no-capture-arc.nll.stderr new file mode 100644 index 00000000000..a58d5ad6fa7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-capture-arc.nll.stderr @@ -0,0 +1,29 @@ +error[E0382]: borrow of moved value: `arc_v` + --> $DIR/no-capture-arc.rs:24:18 + | +LL | thread::spawn(move|| { + | ------ value moved into closure here +LL | assert_eq!((*arc_v)[3], 4); + | ----- variable moved due to use in closure +... +LL | assert_eq!((*arc_v)[2], 3); + | ^^^^^ value borrowed here after move + | + = note: move occurs because `arc_v` has type `std::sync::Arc<std::vec::Vec<i32>>`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `arc_v` + --> $DIR/no-capture-arc.rs:26:23 + | +LL | thread::spawn(move|| { + | ------ value moved into closure here +LL | assert_eq!((*arc_v)[3], 4); + | ----- variable moved due to use in closure +... +LL | println!("{:?}", *arc_v); + | ^^^^^ value borrowed here after move + | + = note: move occurs because `arc_v` has type `std::sync::Arc<std::vec::Vec<i32>>`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/no-capture-arc.rs b/src/test/ui/compile-fail-migration/no-capture-arc.rs index 5e1d22bf63b..5e1d22bf63b 100644 --- a/src/test/compile-fail/no-capture-arc.rs +++ b/src/test/ui/compile-fail-migration/no-capture-arc.rs diff --git a/src/test/ui/compile-fail-migration/no-capture-arc.stderr b/src/test/ui/compile-fail-migration/no-capture-arc.stderr new file mode 100644 index 00000000000..d6801d7e6e1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-capture-arc.stderr @@ -0,0 +1,25 @@ +error[E0382]: use of moved value: `arc_v` + --> $DIR/no-capture-arc.rs:24:18 + | +LL | thread::spawn(move|| { + | ------ value moved (into closure) here +... +LL | assert_eq!((*arc_v)[2], 3); + | ^^^^^ value used here after move + | + = note: move occurs because `arc_v` has type `std::sync::Arc<std::vec::Vec<i32>>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `arc_v` + --> $DIR/no-capture-arc.rs:26:23 + | +LL | thread::spawn(move|| { + | ------ value moved (into closure) here +... +LL | println!("{:?}", *arc_v); + | ^^^^^ value used here after move + | + = note: move occurs because `arc_v` has type `std::sync::Arc<std::vec::Vec<i32>>`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/no-implicit-prelude-nested.rs b/src/test/ui/compile-fail-migration/no-implicit-prelude-nested.rs index c64839ad0de..c64839ad0de 100644 --- a/src/test/compile-fail/no-implicit-prelude-nested.rs +++ b/src/test/ui/compile-fail-migration/no-implicit-prelude-nested.rs diff --git a/src/test/ui/compile-fail-migration/no-implicit-prelude-nested.stderr b/src/test/ui/compile-fail-migration/no-implicit-prelude-nested.stderr new file mode 100644 index 00000000000..dd0666a6fd4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-implicit-prelude-nested.stderr @@ -0,0 +1,196 @@ +error[E0405]: cannot find trait `Add` in this scope + --> $DIR/no-implicit-prelude-nested.rs:21:14 + | +LL | impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope + | ^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use std::ops::Add; + | + +error[E0405]: cannot find trait `Clone` in this scope + --> $DIR/no-implicit-prelude-nested.rs:22:14 + | +LL | impl Clone for Test {} //~ ERROR cannot find trait `Clone` in this scope + | ^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::clone::Clone; + | +LL | use std::prelude::v1::Clone; + | + +error[E0405]: cannot find trait `Iterator` in this scope + --> $DIR/no-implicit-prelude-nested.rs:23:14 + | +LL | impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope + | ^^^^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::iter::Iterator; + | +LL | use std::prelude::v1::Iterator; + | + +error[E0405]: cannot find trait `ToString` in this scope + --> $DIR/no-implicit-prelude-nested.rs:24:14 + | +LL | impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope + | ^^^^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::prelude::v1::ToString; + | +LL | use std::string::ToString; + | + +error[E0405]: cannot find trait `Writer` in this scope + --> $DIR/no-implicit-prelude-nested.rs:25:14 + | +LL | impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope + | ^^^^^^ not found in this scope + +error[E0425]: cannot find function `drop` in this scope + --> $DIR/no-implicit-prelude-nested.rs:28:13 + | +LL | drop(2) //~ ERROR cannot find function `drop` in this scope + | ^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::mem::drop; + | +LL | use std::prelude::v1::drop; + | + +error[E0405]: cannot find trait `Add` in this scope + --> $DIR/no-implicit-prelude-nested.rs:33:10 + | +LL | impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope + | ^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use std::ops::Add; + | + +error[E0405]: cannot find trait `Clone` in this scope + --> $DIR/no-implicit-prelude-nested.rs:34:10 + | +LL | impl Clone for Test {} //~ ERROR cannot find trait `Clone` in this scope + | ^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::clone::Clone; + | +LL | use std::prelude::v1::Clone; + | + +error[E0405]: cannot find trait `Iterator` in this scope + --> $DIR/no-implicit-prelude-nested.rs:35:10 + | +LL | impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope + | ^^^^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::iter::Iterator; + | +LL | use std::prelude::v1::Iterator; + | + +error[E0405]: cannot find trait `ToString` in this scope + --> $DIR/no-implicit-prelude-nested.rs:36:10 + | +LL | impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope + | ^^^^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::prelude::v1::ToString; + | +LL | use std::string::ToString; + | + +error[E0405]: cannot find trait `Writer` in this scope + --> $DIR/no-implicit-prelude-nested.rs:37:10 + | +LL | impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope + | ^^^^^^ not found in this scope + +error[E0425]: cannot find function `drop` in this scope + --> $DIR/no-implicit-prelude-nested.rs:40:9 + | +LL | drop(2) //~ ERROR cannot find function `drop` in this scope + | ^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::mem::drop; + | +LL | use std::prelude::v1::drop; + | + +error[E0405]: cannot find trait `Add` in this scope + --> $DIR/no-implicit-prelude-nested.rs:48:14 + | +LL | impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope + | ^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use std::ops::Add; + | + +error[E0405]: cannot find trait `Clone` in this scope + --> $DIR/no-implicit-prelude-nested.rs:49:14 + | +LL | impl Clone for Test {} //~ ERROR cannot find trait `Clone` in this scope + | ^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::clone::Clone; + | +LL | use std::prelude::v1::Clone; + | + +error[E0405]: cannot find trait `Iterator` in this scope + --> $DIR/no-implicit-prelude-nested.rs:50:14 + | +LL | impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope + | ^^^^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::iter::Iterator; + | +LL | use std::prelude::v1::Iterator; + | + +error[E0405]: cannot find trait `ToString` in this scope + --> $DIR/no-implicit-prelude-nested.rs:51:14 + | +LL | impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope + | ^^^^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::prelude::v1::ToString; + | +LL | use std::string::ToString; + | + +error[E0405]: cannot find trait `Writer` in this scope + --> $DIR/no-implicit-prelude-nested.rs:52:14 + | +LL | impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope + | ^^^^^^ not found in this scope + +error[E0425]: cannot find function `drop` in this scope + --> $DIR/no-implicit-prelude-nested.rs:55:13 + | +LL | drop(2) //~ ERROR cannot find function `drop` in this scope + | ^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::mem::drop; + | +LL | use std::prelude::v1::drop; + | + +error: aborting due to 18 previous errors + +Some errors occurred: E0405, E0425. +For more information about an error, try `rustc --explain E0405`. diff --git a/src/test/compile-fail/no-implicit-prelude.rs b/src/test/ui/compile-fail-migration/no-implicit-prelude.rs index 0e39d9ebdc1..0e39d9ebdc1 100644 --- a/src/test/compile-fail/no-implicit-prelude.rs +++ b/src/test/ui/compile-fail-migration/no-implicit-prelude.rs diff --git a/src/test/ui/compile-fail-migration/no-implicit-prelude.stderr b/src/test/ui/compile-fail-migration/no-implicit-prelude.stderr new file mode 100644 index 00000000000..ae1098585b7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-implicit-prelude.stderr @@ -0,0 +1,68 @@ +error[E0405]: cannot find trait `Add` in this scope + --> $DIR/no-implicit-prelude.rs:20:6 + | +LL | impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope + | ^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use std::ops::Add; + | + +error[E0405]: cannot find trait `Clone` in this scope + --> $DIR/no-implicit-prelude.rs:21:6 + | +LL | impl Clone for Test {} //~ ERROR cannot find trait `Clone` in this scope + | ^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::clone::Clone; + | +LL | use std::prelude::v1::Clone; + | + +error[E0405]: cannot find trait `Iterator` in this scope + --> $DIR/no-implicit-prelude.rs:22:6 + | +LL | impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope + | ^^^^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::iter::Iterator; + | +LL | use std::prelude::v1::Iterator; + | + +error[E0405]: cannot find trait `ToString` in this scope + --> $DIR/no-implicit-prelude.rs:23:6 + | +LL | impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope + | ^^^^^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::prelude::v1::ToString; + | +LL | use std::string::ToString; + | + +error[E0405]: cannot find trait `Writer` in this scope + --> $DIR/no-implicit-prelude.rs:24:6 + | +LL | impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope + | ^^^^^^ not found in this scope + +error[E0425]: cannot find function `drop` in this scope + --> $DIR/no-implicit-prelude.rs:27:5 + | +LL | drop(2) //~ ERROR cannot find function `drop` in this scope + | ^^^^ not found in this scope +help: possible candidates are found in other modules, you can import them into scope + | +LL | use std::mem::drop; + | +LL | use std::prelude::v1::drop; + | + +error: aborting due to 6 previous errors + +Some errors occurred: E0405, E0425. +For more information about an error, try `rustc --explain E0405`. diff --git a/src/test/compile-fail/no-link.rs b/src/test/ui/compile-fail-migration/no-link.rs index f74ff55e2c0..f74ff55e2c0 100644 --- a/src/test/compile-fail/no-link.rs +++ b/src/test/ui/compile-fail-migration/no-link.rs diff --git a/src/test/ui/compile-fail-migration/no-link.stderr b/src/test/ui/compile-fail-migration/no-link.stderr new file mode 100644 index 00000000000..3af7968f640 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-link.stderr @@ -0,0 +1,15 @@ +warning: proc macro crates and `#[no_link]` crates have no effect without `#[macro_use]` + --> $DIR/no-link.rs:14:1 + | +LL | extern crate empty_struct; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0425]: cannot find value `XEmpty1` in module `empty_struct` + --> $DIR/no-link.rs:18:19 + | +LL | empty_struct::XEmpty1; //~ ERROR cannot find value `XEmpty1` in module `empty_struct` + | ^^^^^^^ not found in `empty_struct` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/no-patterns-in-args-2.rs b/src/test/ui/compile-fail-migration/no-patterns-in-args-2.rs index 4d2412c34a5..4d2412c34a5 100644 --- a/src/test/compile-fail/no-patterns-in-args-2.rs +++ b/src/test/ui/compile-fail-migration/no-patterns-in-args-2.rs diff --git a/src/test/ui/compile-fail-migration/no-patterns-in-args-2.stderr b/src/test/ui/compile-fail-migration/no-patterns-in-args-2.stderr new file mode 100644 index 00000000000..11476169c7d --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-patterns-in-args-2.stderr @@ -0,0 +1,23 @@ +error[E0642]: patterns aren't allowed in methods without bodies + --> $DIR/no-patterns-in-args-2.rs:16:11 + | +LL | fn f2(&arg: u8); //~ ERROR patterns aren't allowed in methods without bodies + | ^^^^ + +error: patterns aren't allowed in methods without bodies + --> $DIR/no-patterns-in-args-2.rs:14:11 + | +LL | fn f1(mut arg: u8); //~ ERROR patterns aren't allowed in methods without bodies + | ^^^^^^^ + | +note: lint level defined here + --> $DIR/no-patterns-in-args-2.rs:11:9 + | +LL | #![deny(patterns_in_fns_without_body)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #35203 <https://github.com/rust-lang/rust/issues/35203> + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0642`. diff --git a/src/test/compile-fail/no-patterns-in-args-macro.rs b/src/test/ui/compile-fail-migration/no-patterns-in-args-macro.rs index f85ce8f57ea..f85ce8f57ea 100644 --- a/src/test/compile-fail/no-patterns-in-args-macro.rs +++ b/src/test/ui/compile-fail-migration/no-patterns-in-args-macro.rs diff --git a/src/test/ui/compile-fail-migration/no-patterns-in-args-macro.stderr b/src/test/ui/compile-fail-migration/no-patterns-in-args-macro.stderr new file mode 100644 index 00000000000..57af3178439 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-patterns-in-args-macro.stderr @@ -0,0 +1,22 @@ +error[E0642]: patterns aren't allowed in methods without bodies + --> $DIR/no-patterns-in-args-macro.rs:30:8 + | +LL | m!((bad, pat)); + | ^^^^^^^^^^ + +error[E0561]: patterns aren't allowed in function pointer types + --> $DIR/no-patterns-in-args-macro.rs:30:8 + | +LL | m!((bad, pat)); + | ^^^^^^^^^^ + +error[E0130]: patterns aren't allowed in foreign function declarations + --> $DIR/no-patterns-in-args-macro.rs:30:8 + | +LL | m!((bad, pat)); + | ^^^^^^^^^^ pattern not allowed in foreign function + +error: aborting due to 3 previous errors + +Some errors occurred: E0130, E0561, E0642. +For more information about an error, try `rustc --explain E0130`. diff --git a/src/test/ui/compile-fail-migration/no-reuse-move-arc.nll.stderr b/src/test/ui/compile-fail-migration/no-reuse-move-arc.nll.stderr new file mode 100644 index 00000000000..902affc8046 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-reuse-move-arc.nll.stderr @@ -0,0 +1,29 @@ +error[E0382]: borrow of moved value: `arc_v` + --> $DIR/no-reuse-move-arc.rs:22:18 + | +LL | thread::spawn(move|| { + | ------ value moved into closure here +LL | assert_eq!((*arc_v)[3], 4); + | ----- variable moved due to use in closure +... +LL | assert_eq!((*arc_v)[2], 3); //~ ERROR use of moved value: `arc_v` + | ^^^^^ value borrowed here after move + | + = note: move occurs because `arc_v` has type `std::sync::Arc<std::vec::Vec<i32>>`, which does not implement the `Copy` trait + +error[E0382]: borrow of moved value: `arc_v` + --> $DIR/no-reuse-move-arc.rs:24:23 + | +LL | thread::spawn(move|| { + | ------ value moved into closure here +LL | assert_eq!((*arc_v)[3], 4); + | ----- variable moved due to use in closure +... +LL | println!("{:?}", *arc_v); //~ ERROR use of moved value: `arc_v` + | ^^^^^ value borrowed here after move + | + = note: move occurs because `arc_v` has type `std::sync::Arc<std::vec::Vec<i32>>`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/no-reuse-move-arc.rs b/src/test/ui/compile-fail-migration/no-reuse-move-arc.rs index 76c8a444320..76c8a444320 100644 --- a/src/test/compile-fail/no-reuse-move-arc.rs +++ b/src/test/ui/compile-fail-migration/no-reuse-move-arc.rs diff --git a/src/test/ui/compile-fail-migration/no-reuse-move-arc.stderr b/src/test/ui/compile-fail-migration/no-reuse-move-arc.stderr new file mode 100644 index 00000000000..91cba6e76ef --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-reuse-move-arc.stderr @@ -0,0 +1,25 @@ +error[E0382]: use of moved value: `arc_v` + --> $DIR/no-reuse-move-arc.rs:22:18 + | +LL | thread::spawn(move|| { + | ------ value moved (into closure) here +... +LL | assert_eq!((*arc_v)[2], 3); //~ ERROR use of moved value: `arc_v` + | ^^^^^ value used here after move + | + = note: move occurs because `arc_v` has type `std::sync::Arc<std::vec::Vec<i32>>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `arc_v` + --> $DIR/no-reuse-move-arc.rs:24:23 + | +LL | thread::spawn(move|| { + | ------ value moved (into closure) here +... +LL | println!("{:?}", *arc_v); //~ ERROR use of moved value: `arc_v` + | ^^^^^ value used here after move + | + = note: move occurs because `arc_v` has type `std::sync::Arc<std::vec::Vec<i32>>`, which does not implement the `Copy` trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/ui/compile-fail-migration/no-send-res-ports.rs index 6825963c486..6825963c486 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/ui/compile-fail-migration/no-send-res-ports.rs diff --git a/src/test/ui/compile-fail-migration/no-send-res-ports.stderr b/src/test/ui/compile-fail-migration/no-send-res-ports.stderr new file mode 100644 index 00000000000..936b95413ce --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-send-res-ports.stderr @@ -0,0 +1,15 @@ +error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely + --> $DIR/no-send-res-ports.rs:35:5 + | +LL | thread::spawn(move|| { + | ^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely + | + = help: within `[closure@$DIR/no-send-res-ports.rs:35:19: 39:6 x:main::foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>` + = note: required because it appears within the type `Port<()>` + = note: required because it appears within the type `main::foo` + = note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:35:19: 39:6 x:main::foo]` + = note: required by `std::thread::spawn` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/no-std-inject.rs b/src/test/ui/compile-fail-migration/no-std-inject.rs index 49064853d21..49064853d21 100644 --- a/src/test/compile-fail/no-std-inject.rs +++ b/src/test/ui/compile-fail-migration/no-std-inject.rs diff --git a/src/test/ui/compile-fail-migration/no-std-inject.stderr b/src/test/ui/compile-fail-migration/no-std-inject.stderr new file mode 100644 index 00000000000..c1ea823a9bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-std-inject.stderr @@ -0,0 +1,15 @@ +error[E0259]: the name `core` is defined multiple times + --> $DIR/no-std-inject.rs:14:1 + | +LL | extern crate core; //~ ERROR: the name `core` is defined multiple times + | ^^^^^^^^^^^^^^^^^^ `core` reimported here + | + = note: `core` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | extern crate core as other_core; //~ ERROR: the name `core` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0259`. diff --git a/src/test/compile-fail/no-type-for-node-ice.rs b/src/test/ui/compile-fail-migration/no-type-for-node-ice.rs index f049f69e4bb..f049f69e4bb 100644 --- a/src/test/compile-fail/no-type-for-node-ice.rs +++ b/src/test/ui/compile-fail-migration/no-type-for-node-ice.rs diff --git a/src/test/ui/compile-fail-migration/no-type-for-node-ice.stderr b/src/test/ui/compile-fail-migration/no-type-for-node-ice.stderr new file mode 100644 index 00000000000..c9de7d28af0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-type-for-node-ice.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `homura` on type `&'static str` + --> $DIR/no-type-for-node-ice.rs:14:8 + | +LL | "".homura[""]; //~ no field `homura` on type `&'static str` + | ^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/compile-fail/no-warn-on-field-replace-issue-34101.rs b/src/test/ui/compile-fail-migration/no-warn-on-field-replace-issue-34101.rs index 2940b891534..2940b891534 100644 --- a/src/test/compile-fail/no-warn-on-field-replace-issue-34101.rs +++ b/src/test/ui/compile-fail-migration/no-warn-on-field-replace-issue-34101.rs diff --git a/src/test/ui/compile-fail-migration/no-warn-on-field-replace-issue-34101.stderr b/src/test/ui/compile-fail-migration/no-warn-on-field-replace-issue-34101.stderr new file mode 100644 index 00000000000..91a90266e5e --- /dev/null +++ b/src/test/ui/compile-fail-migration/no-warn-on-field-replace-issue-34101.stderr @@ -0,0 +1,11 @@ +error: compilation successful + --> $DIR/no-warn-on-field-replace-issue-34101.rs:53:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | inline(); +LL | | outline(); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/no_crate_type.rs b/src/test/ui/compile-fail-migration/no_crate_type.rs index b2cc5cae697..b2cc5cae697 100644 --- a/src/test/compile-fail/no_crate_type.rs +++ b/src/test/ui/compile-fail-migration/no_crate_type.rs diff --git a/src/test/ui/compile-fail-migration/no_crate_type.stderr b/src/test/ui/compile-fail-migration/no_crate_type.stderr new file mode 100644 index 00000000000..87f83f2d8df --- /dev/null +++ b/src/test/ui/compile-fail-migration/no_crate_type.stderr @@ -0,0 +1,10 @@ +error: `crate_type` requires a value + --> $DIR/no_crate_type.rs:12:1 + | +LL | #![crate_type] //~ ERROR `crate_type` requires a value + | ^^^^^^^^^^^^^^ + | + = note: for example: `#![crate_type="lib"]` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/no_owned_box_lang_item.rs b/src/test/ui/compile-fail-migration/no_owned_box_lang_item.rs index 1c2bf1573dc..1c2bf1573dc 100644 --- a/src/test/compile-fail/no_owned_box_lang_item.rs +++ b/src/test/ui/compile-fail-migration/no_owned_box_lang_item.rs diff --git a/src/test/ui/compile-fail-migration/no_owned_box_lang_item.stderr b/src/test/ui/compile-fail-migration/no_owned_box_lang_item.stderr new file mode 100644 index 00000000000..c55c246b5e1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no_owned_box_lang_item.stderr @@ -0,0 +1,4 @@ +error: requires `owned_box` lang_item + +error: aborting due to previous error + diff --git a/src/test/compile-fail/no_send-enum.rs b/src/test/ui/compile-fail-migration/no_send-enum.rs index 83f19ed19ef..83f19ed19ef 100644 --- a/src/test/compile-fail/no_send-enum.rs +++ b/src/test/ui/compile-fail-migration/no_send-enum.rs diff --git a/src/test/ui/compile-fail-migration/no_send-enum.stderr b/src/test/ui/compile-fail-migration/no_send-enum.stderr new file mode 100644 index 00000000000..4d53c5f3013 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no_send-enum.stderr @@ -0,0 +1,17 @@ +error[E0277]: `NoSend` cannot be sent between threads safely + --> $DIR/no_send-enum.rs:26:5 + | +LL | bar(x); + | ^^^ `NoSend` cannot be sent between threads safely + | + = help: within `Foo`, the trait `std::marker::Send` is not implemented for `NoSend` + = note: required because it appears within the type `Foo` +note: required by `bar` + --> $DIR/no_send-enum.rs:22:1 + | +LL | fn bar<T: Send>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/no_send-rc.rs b/src/test/ui/compile-fail-migration/no_send-rc.rs index d3616d14422..d3616d14422 100644 --- a/src/test/compile-fail/no_send-rc.rs +++ b/src/test/ui/compile-fail-migration/no_send-rc.rs diff --git a/src/test/ui/compile-fail-migration/no_send-rc.stderr b/src/test/ui/compile-fail-migration/no_send-rc.stderr new file mode 100644 index 00000000000..a0dce6c817c --- /dev/null +++ b/src/test/ui/compile-fail-migration/no_send-rc.stderr @@ -0,0 +1,16 @@ +error[E0277]: `std::rc::Rc<{integer}>` cannot be sent between threads safely + --> $DIR/no_send-rc.rs:17:5 + | +LL | bar(x); + | ^^^ `std::rc::Rc<{integer}>` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `std::rc::Rc<{integer}>` +note: required by `bar` + --> $DIR/no_send-rc.rs:13:1 + | +LL | fn bar<T: Send>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/no_send-struct.rs b/src/test/ui/compile-fail-migration/no_send-struct.rs index d38d993e7e8..d38d993e7e8 100644 --- a/src/test/compile-fail/no_send-struct.rs +++ b/src/test/ui/compile-fail-migration/no_send-struct.rs diff --git a/src/test/ui/compile-fail-migration/no_send-struct.stderr b/src/test/ui/compile-fail-migration/no_send-struct.stderr new file mode 100644 index 00000000000..dc7b5ec67f2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no_send-struct.stderr @@ -0,0 +1,16 @@ +error[E0277]: `Foo` cannot be sent between threads safely + --> $DIR/no_send-struct.rs:25:5 + | +LL | bar(x); + | ^^^ `Foo` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `Foo` +note: required by `bar` + --> $DIR/no_send-struct.rs:21:1 + | +LL | fn bar<T: Send>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/no_share-enum.rs b/src/test/ui/compile-fail-migration/no_share-enum.rs index 77a7012b3b0..77a7012b3b0 100644 --- a/src/test/compile-fail/no_share-enum.rs +++ b/src/test/ui/compile-fail-migration/no_share-enum.rs diff --git a/src/test/ui/compile-fail-migration/no_share-enum.stderr b/src/test/ui/compile-fail-migration/no_share-enum.stderr new file mode 100644 index 00000000000..57b889158d0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no_share-enum.stderr @@ -0,0 +1,17 @@ +error[E0277]: `NoSync` cannot be shared between threads safely + --> $DIR/no_share-enum.rs:24:5 + | +LL | bar(x); + | ^^^ `NoSync` cannot be shared between threads safely + | + = help: within `Foo`, the trait `std::marker::Sync` is not implemented for `NoSync` + = note: required because it appears within the type `Foo` +note: required by `bar` + --> $DIR/no_share-enum.rs:20:1 + | +LL | fn bar<T: Sync>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/no_share-struct.rs b/src/test/ui/compile-fail-migration/no_share-struct.rs index 34e43e9f2aa..34e43e9f2aa 100644 --- a/src/test/compile-fail/no_share-struct.rs +++ b/src/test/ui/compile-fail-migration/no_share-struct.rs diff --git a/src/test/ui/compile-fail-migration/no_share-struct.stderr b/src/test/ui/compile-fail-migration/no_share-struct.stderr new file mode 100644 index 00000000000..66291db5e53 --- /dev/null +++ b/src/test/ui/compile-fail-migration/no_share-struct.stderr @@ -0,0 +1,16 @@ +error[E0277]: `Foo` cannot be shared between threads safely + --> $DIR/no_share-struct.rs:22:5 + | +LL | bar(x); + | ^^^ `Foo` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `Foo` +note: required by `bar` + --> $DIR/no_share-struct.rs:18:1 + | +LL | fn bar<T: Sync>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/noexporttypeexe.rs b/src/test/ui/compile-fail-migration/noexporttypeexe.rs index c950ef5b680..c950ef5b680 100644 --- a/src/test/compile-fail/noexporttypeexe.rs +++ b/src/test/ui/compile-fail-migration/noexporttypeexe.rs diff --git a/src/test/ui/compile-fail-migration/noexporttypeexe.stderr b/src/test/ui/compile-fail-migration/noexporttypeexe.stderr new file mode 100644 index 00000000000..1671b3eae49 --- /dev/null +++ b/src/test/ui/compile-fail-migration/noexporttypeexe.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/noexporttypeexe.rs:20:18 + | +LL | let x: isize = noexporttypelib::foo(); + | ^^^^^^^^^^^^^^^^^^^^^^ expected isize, found enum `std::option::Option` + | + = note: expected type `isize` + found type `std::option::Option<isize>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/nolink-with-link-args.nll.stderr b/src/test/ui/compile-fail-migration/nolink-with-link-args.nll.stderr new file mode 100644 index 00000000000..df666db753d --- /dev/null +++ b/src/test/ui/compile-fail-migration/nolink-with-link-args.nll.stderr @@ -0,0 +1,9 @@ +error: linking with `ld` failed: exit code: 1 + | + = note: "ld" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/nolink-with-link-args.nll/a.nolink_with_link_args0-317d481089b8c8fe83113de504472633.rs.rcgu.o" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/nolink-with-link-args.nll/a.nolink_with_link_args1-317d481089b8c8fe83113de504472633.rs.rcgu.o" "-o" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/nolink-with-link-args.nll/a" "--gc-sections" "-pie" "-zrelro" "-znow" "-O1" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/nolink-with-link-args.nll/auxiliary" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--start-group" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lstd-e05e3c08f9f6faf5" "--end-group" "-Bstatic" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-ce73107aecc35a63.rlib" "-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" "-Wl,-rpath,$ORIGIN/../../../../stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-rpath,/home/david/projects/rust/workdirs/rust1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--enable-new-dtags" "aFdEfSeVEEE" + = note: ld: unrecognized option '-Wl,-rpath,$ORIGIN/../../../../stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib' + ld: use the --help option for usage information + + +error: aborting due to previous error + diff --git a/src/test/compile-fail/nolink-with-link-args.rs b/src/test/ui/compile-fail-migration/nolink-with-link-args.rs index 6dfd74f541e..6dfd74f541e 100644 --- a/src/test/compile-fail/nolink-with-link-args.rs +++ b/src/test/ui/compile-fail-migration/nolink-with-link-args.rs diff --git a/src/test/ui/compile-fail-migration/nolink-with-link-args.stderr b/src/test/ui/compile-fail-migration/nolink-with-link-args.stderr new file mode 100644 index 00000000000..4c62e556a39 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nolink-with-link-args.stderr @@ -0,0 +1,9 @@ +error: linking with `ld` failed: exit code: 1 + | + = note: "ld" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/nolink-with-link-args/a.nolink_with_link_args0-317d481089b8c8fe83113de504472633.rs.rcgu.o" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/nolink-with-link-args/a.nolink_with_link_args1-317d481089b8c8fe83113de504472633.rs.rcgu.o" "-o" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/nolink-with-link-args/a" "--gc-sections" "-pie" "-zrelro" "-znow" "-O1" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/test/ui/compile-fail-migration/nolink-with-link-args/auxiliary" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--start-group" "-L" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-lstd-e05e3c08f9f6faf5" "--end-group" "-Bstatic" "/home/david/projects/rust/workdirs/rust1/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-ce73107aecc35a63.rlib" "-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil" "-Wl,-rpath,$ORIGIN/../../../../stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-rpath,/home/david/projects/rust/workdirs/rust1/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--enable-new-dtags" "aFdEfSeVEEE" + = note: ld: unrecognized option '-Wl,-rpath,$ORIGIN/../../../../stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib' + ld: use the --help option for usage information + + +error: aborting due to previous error + diff --git a/src/test/compile-fail/non-constant-in-const-path.rs b/src/test/ui/compile-fail-migration/non-constant-in-const-path.rs index 1aae25105a8..1aae25105a8 100644 --- a/src/test/compile-fail/non-constant-in-const-path.rs +++ b/src/test/ui/compile-fail-migration/non-constant-in-const-path.rs diff --git a/src/test/ui/compile-fail-migration/non-constant-in-const-path.stderr b/src/test/ui/compile-fail-migration/non-constant-in-const-path.stderr new file mode 100644 index 00000000000..91ef9fd81e8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/non-constant-in-const-path.stderr @@ -0,0 +1,9 @@ +error[E0080]: runtime values cannot be referenced in patterns + --> $DIR/non-constant-in-const-path.rs:14:15 + | +LL | 0 ..= x => {} + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/compile-fail/non-copyable-void.rs b/src/test/ui/compile-fail-migration/non-copyable-void.rs index 63e5f963754..63e5f963754 100644 --- a/src/test/compile-fail/non-copyable-void.rs +++ b/src/test/ui/compile-fail-migration/non-copyable-void.rs diff --git a/src/test/ui/compile-fail-migration/non-copyable-void.stderr b/src/test/ui/compile-fail-migration/non-copyable-void.stderr new file mode 100644 index 00000000000..b5c83ec2289 --- /dev/null +++ b/src/test/ui/compile-fail-migration/non-copyable-void.stderr @@ -0,0 +1,9 @@ +error[E0599]: no method named `clone` found for type `libc::c_void` in the current scope + --> $DIR/non-copyable-void.rs:21:23 + | +LL | let _z = (*y).clone(); + | ^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/non-exhaustive-match-nested.rs b/src/test/ui/compile-fail-migration/non-exhaustive-match-nested.rs index 1d524217a12..1d524217a12 100644 --- a/src/test/compile-fail/non-exhaustive-match-nested.rs +++ b/src/test/ui/compile-fail-migration/non-exhaustive-match-nested.rs diff --git a/src/test/ui/compile-fail-migration/non-exhaustive-match-nested.stderr b/src/test/ui/compile-fail-migration/non-exhaustive-match-nested.stderr new file mode 100644 index 00000000000..6fb9788139f --- /dev/null +++ b/src/test/ui/compile-fail-migration/non-exhaustive-match-nested.stderr @@ -0,0 +1,15 @@ +error[E0004]: non-exhaustive patterns: `(Some(&[]), Err(_))` not covered + --> $DIR/non-exhaustive-match-nested.rs:17:11 + | +LL | match (l1, l2) { //~ ERROR non-exhaustive patterns: `(Some(&[]), Err(_))` not covered + | ^^^^^^^^ pattern `(Some(&[]), Err(_))` not covered + +error[E0004]: non-exhaustive patterns: `a(c)` not covered + --> $DIR/non-exhaustive-match-nested.rs:27:11 + | +LL | match x { //~ ERROR non-exhaustive patterns: `a(c)` not covered + | ^ pattern `a(c)` not covered + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/non-exhaustive-match.rs b/src/test/ui/compile-fail-migration/non-exhaustive-match.rs index 13b62429f46..13b62429f46 100644 --- a/src/test/compile-fail/non-exhaustive-match.rs +++ b/src/test/ui/compile-fail-migration/non-exhaustive-match.rs diff --git a/src/test/ui/compile-fail-migration/non-exhaustive-match.stderr b/src/test/ui/compile-fail-migration/non-exhaustive-match.stderr new file mode 100644 index 00000000000..f48a0bc15eb --- /dev/null +++ b/src/test/ui/compile-fail-migration/non-exhaustive-match.stderr @@ -0,0 +1,51 @@ +error[E0004]: non-exhaustive patterns: `a` not covered + --> $DIR/non-exhaustive-match.rs:18:11 + | +LL | match x { t::b => { } } //~ ERROR non-exhaustive patterns: `a` not covered + | ^ pattern `a` not covered + +error[E0004]: non-exhaustive patterns: `false` not covered + --> $DIR/non-exhaustive-match.rs:19:11 + | +LL | match true { //~ ERROR non-exhaustive patterns: `false` not covered + | ^^^^ pattern `false` not covered + +error[E0004]: non-exhaustive patterns: `Some(_)` not covered + --> $DIR/non-exhaustive-match.rs:22:11 + | +LL | match Some(10) { //~ ERROR non-exhaustive patterns: `Some(_)` not covered + | ^^^^^^^^ pattern `Some(_)` not covered + +error[E0004]: non-exhaustive patterns: `(_, _, _)` not covered + --> $DIR/non-exhaustive-match.rs:25:11 + | +LL | match (2, 3, 4) { //~ ERROR non-exhaustive patterns: `(_, _, _)` not covered + | ^^^^^^^^^ pattern `(_, _, _)` not covered + +error[E0004]: non-exhaustive patterns: `(a, a)` not covered + --> $DIR/non-exhaustive-match.rs:28:11 + | +LL | match (t::a, t::a) { //~ ERROR non-exhaustive patterns: `(a, a)` not covered + | ^^^^^^^^^^^^ pattern `(a, a)` not covered + +error[E0004]: non-exhaustive patterns: `b` not covered + --> $DIR/non-exhaustive-match.rs:32:11 + | +LL | match t::a { //~ ERROR non-exhaustive patterns: `b` not covered + | ^^^^ pattern `b` not covered + +error[E0004]: non-exhaustive patterns: `[]` not covered + --> $DIR/non-exhaustive-match.rs:43:11 + | +LL | match *vec { //~ ERROR non-exhaustive patterns: `[]` not covered + | ^^^^ pattern `[]` not covered + +error[E0004]: non-exhaustive patterns: `[_, _, _, _]` not covered + --> $DIR/non-exhaustive-match.rs:56:11 + | +LL | match *vec { //~ ERROR non-exhaustive patterns: `[_, _, _, _]` not covered + | ^^^^ pattern `[_, _, _, _]` not covered + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/non-interger-atomic.rs b/src/test/ui/compile-fail-migration/non-interger-atomic.rs index 2a6e148ca79..2a6e148ca79 100644 --- a/src/test/compile-fail/non-interger-atomic.rs +++ b/src/test/ui/compile-fail-migration/non-interger-atomic.rs diff --git a/src/test/ui/compile-fail-migration/non-interger-atomic.stderr b/src/test/ui/compile-fail-migration/non-interger-atomic.stderr new file mode 100644 index 00000000000..8cb114dd42c --- /dev/null +++ b/src/test/ui/compile-fail-migration/non-interger-atomic.stderr @@ -0,0 +1,99 @@ +error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer type, found `bool` + --> $DIR/non-interger-atomic.rs:23:5 + | +LL | intrinsics::atomic_load(p); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer type, found `bool` + --> $DIR/non-interger-atomic.rs:28:5 + | +LL | intrinsics::atomic_store(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer type, found `bool` + --> $DIR/non-interger-atomic.rs:33:5 + | +LL | intrinsics::atomic_xchg(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer type, found `bool` + --> $DIR/non-interger-atomic.rs:38:5 + | +LL | intrinsics::atomic_cxchg(p, v, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer type, found `Foo` + --> $DIR/non-interger-atomic.rs:43:5 + | +LL | intrinsics::atomic_load(p); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer type, found `Foo` + --> $DIR/non-interger-atomic.rs:48:5 + | +LL | intrinsics::atomic_store(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer type, found `Foo` + --> $DIR/non-interger-atomic.rs:53:5 + | +LL | intrinsics::atomic_xchg(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer type, found `Foo` + --> $DIR/non-interger-atomic.rs:58:5 + | +LL | intrinsics::atomic_cxchg(p, v, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer type, found `&dyn std::ops::Fn()` + --> $DIR/non-interger-atomic.rs:63:5 + | +LL | intrinsics::atomic_load(p); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer type, found `&dyn std::ops::Fn()` + --> $DIR/non-interger-atomic.rs:68:5 + | +LL | intrinsics::atomic_store(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer type, found `&dyn std::ops::Fn()` + --> $DIR/non-interger-atomic.rs:73:5 + | +LL | intrinsics::atomic_xchg(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer type, found `&dyn std::ops::Fn()` + --> $DIR/non-interger-atomic.rs:78:5 + | +LL | intrinsics::atomic_cxchg(p, v, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_load` intrinsic: expected basic integer type, found `[u8; 100]` + --> $DIR/non-interger-atomic.rs:83:5 + | +LL | intrinsics::atomic_load(p); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_store` intrinsic: expected basic integer type, found `[u8; 100]` + --> $DIR/non-interger-atomic.rs:88:5 + | +LL | intrinsics::atomic_store(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer type, found `[u8; 100]` + --> $DIR/non-interger-atomic.rs:93:5 + | +LL | intrinsics::atomic_xchg(p, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer type, found `[u8; 100]` + --> $DIR/non-interger-atomic.rs:98:5 + | +LL | intrinsics::atomic_cxchg(p, v, v); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 16 previous errors + +For more information about this error, try `rustc --explain E0511`. diff --git a/src/test/compile-fail/noncopyable-class.rs b/src/test/ui/compile-fail-migration/noncopyable-class.rs index f5712b0c957..f5712b0c957 100644 --- a/src/test/compile-fail/noncopyable-class.rs +++ b/src/test/ui/compile-fail-migration/noncopyable-class.rs diff --git a/src/test/ui/compile-fail-migration/noncopyable-class.stderr b/src/test/ui/compile-fail-migration/noncopyable-class.stderr new file mode 100644 index 00000000000..49ad30e56af --- /dev/null +++ b/src/test/ui/compile-fail-migration/noncopyable-class.stderr @@ -0,0 +1,16 @@ +error[E0599]: no method named `clone` found for type `foo` in the current scope + --> $DIR/noncopyable-class.rs:44:16 + | +LL | struct foo { + | ---------- method `clone` not found for this +... +LL | let _y = x.clone(); //~ ERROR no method named `clone` found + | ^^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `clone`, perhaps you need to implement it: + candidate #1: `std::clone::Clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/nonscalar-cast.rs b/src/test/ui/compile-fail-migration/nonscalar-cast.rs index 0abbc05eef0..0abbc05eef0 100644 --- a/src/test/compile-fail/nonscalar-cast.rs +++ b/src/test/ui/compile-fail-migration/nonscalar-cast.rs diff --git a/src/test/ui/compile-fail-migration/nonscalar-cast.stderr b/src/test/ui/compile-fail-migration/nonscalar-cast.stderr new file mode 100644 index 00000000000..d66ccd08f55 --- /dev/null +++ b/src/test/ui/compile-fail-migration/nonscalar-cast.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `foo` as `isize` + --> $DIR/nonscalar-cast.rs:17:20 + | +LL | println!("{}", foo{ x: 1 } as isize); //~ non-primitive cast: `foo` as `isize` [E0605] + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/compile-fail/not-clone-closure.rs b/src/test/ui/compile-fail-migration/not-clone-closure.rs index 967cb3610ca..967cb3610ca 100644 --- a/src/test/compile-fail/not-clone-closure.rs +++ b/src/test/ui/compile-fail-migration/not-clone-closure.rs diff --git a/src/test/ui/compile-fail-migration/not-clone-closure.stderr b/src/test/ui/compile-fail-migration/not-clone-closure.stderr new file mode 100644 index 00000000000..eda9b1c495e --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-clone-closure.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `S: std::clone::Clone` is not satisfied in `[closure@$DIR/not-clone-closure.rs:17:17: 19:6 a:S]` + --> $DIR/not-clone-closure.rs:21:23 + | +LL | let hello = hello.clone(); //~ ERROR the trait bound `S: std::clone::Clone` is not satisfied + | ^^^^^ within `[closure@$DIR/not-clone-closure.rs:17:17: 19:6 a:S]`, the trait `std::clone::Clone` is not implemented for `S` + | + = note: required because it appears within the type `[closure@$DIR/not-clone-closure.rs:17:17: 19:6 a:S]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/not-copy-closure.nll.stderr b/src/test/ui/compile-fail-migration/not-copy-closure.nll.stderr new file mode 100644 index 00000000000..b278df5e4b4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-copy-closure.nll.stderr @@ -0,0 +1,11 @@ +error[E0382]: use of moved value: `hello` + --> $DIR/not-copy-closure.rs:20:13 + | +LL | let b = hello; + | ----- value moved here +LL | let c = hello; //~ ERROR use of moved value: `hello` [E0382] + | ^^^^^ value used here after move + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/not-copy-closure.rs b/src/test/ui/compile-fail-migration/not-copy-closure.rs index 10567c5c961..10567c5c961 100644 --- a/src/test/compile-fail/not-copy-closure.rs +++ b/src/test/ui/compile-fail-migration/not-copy-closure.rs diff --git a/src/test/ui/compile-fail-migration/not-copy-closure.stderr b/src/test/ui/compile-fail-migration/not-copy-closure.stderr new file mode 100644 index 00000000000..7193a3ed027 --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-copy-closure.stderr @@ -0,0 +1,17 @@ +error[E0382]: use of moved value: `hello` + --> $DIR/not-copy-closure.rs:20:9 + | +LL | let b = hello; + | - value moved here +LL | let c = hello; //~ ERROR use of moved value: `hello` [E0382] + | ^ value used here after move + | +note: closure cannot be invoked more than once because it moves the variable `a` out of its environment + --> $DIR/not-copy-closure.rs:16:9 + | +LL | a += 1; + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/not-panic-safe-2.rs b/src/test/ui/compile-fail-migration/not-panic-safe-2.rs index 5490acf4bd6..5490acf4bd6 100644 --- a/src/test/compile-fail/not-panic-safe-2.rs +++ b/src/test/ui/compile-fail-migration/not-panic-safe-2.rs diff --git a/src/test/ui/compile-fail-migration/not-panic-safe-2.stderr b/src/test/ui/compile-fail-migration/not-panic-safe-2.stderr new file mode 100644 index 00000000000..19408623ea3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-panic-safe-2.stderr @@ -0,0 +1,34 @@ +error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + --> $DIR/not-panic-safe-2.rs:20:5 + | +LL | assert::<Rc<RefCell<i32>>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>` + = note: required because it appears within the type `std::cell::RefCell<i32>` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `std::rc::Rc<std::cell::RefCell<i32>>` +note: required by `assert` + --> $DIR/not-panic-safe-2.rs:17:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the type `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + --> $DIR/not-panic-safe-2.rs:20:5 + | +LL | assert::<Rc<RefCell<i32>>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<isize>` + = note: required because it appears within the type `std::cell::Cell<isize>` + = note: required because it appears within the type `std::cell::RefCell<i32>` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `std::rc::Rc<std::cell::RefCell<i32>>` +note: required by `assert` + --> $DIR/not-panic-safe-2.rs:17:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/not-panic-safe-3.rs b/src/test/ui/compile-fail-migration/not-panic-safe-3.rs index 0fac395a115..0fac395a115 100644 --- a/src/test/compile-fail/not-panic-safe-3.rs +++ b/src/test/ui/compile-fail-migration/not-panic-safe-3.rs diff --git a/src/test/ui/compile-fail-migration/not-panic-safe-3.stderr b/src/test/ui/compile-fail-migration/not-panic-safe-3.stderr new file mode 100644 index 00000000000..a353c82c687 --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-panic-safe-3.stderr @@ -0,0 +1,34 @@ +error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + --> $DIR/not-panic-safe-3.rs:20:5 + | +LL | assert::<Arc<RefCell<i32>>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>` + = note: required because it appears within the type `std::cell::RefCell<i32>` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `std::sync::Arc<std::cell::RefCell<i32>>` +note: required by `assert` + --> $DIR/not-panic-safe-3.rs:17:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the type `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + --> $DIR/not-panic-safe-3.rs:20:5 + | +LL | assert::<Arc<RefCell<i32>>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<isize>` + = note: required because it appears within the type `std::cell::Cell<isize>` + = note: required because it appears within the type `std::cell::RefCell<i32>` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `std::sync::Arc<std::cell::RefCell<i32>>` +note: required by `assert` + --> $DIR/not-panic-safe-3.rs:17:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/not-panic-safe-4.rs b/src/test/ui/compile-fail-migration/not-panic-safe-4.rs index bf0392018b5..bf0392018b5 100644 --- a/src/test/compile-fail/not-panic-safe-4.rs +++ b/src/test/ui/compile-fail-migration/not-panic-safe-4.rs diff --git a/src/test/ui/compile-fail-migration/not-panic-safe-4.stderr b/src/test/ui/compile-fail-migration/not-panic-safe-4.stderr new file mode 100644 index 00000000000..27d3defe123 --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-panic-safe-4.stderr @@ -0,0 +1,34 @@ +error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + --> $DIR/not-panic-safe-4.rs:19:5 + | +LL | assert::<&RefCell<i32>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>` + = note: required because it appears within the type `std::cell::RefCell<i32>` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&std::cell::RefCell<i32>` +note: required by `assert` + --> $DIR/not-panic-safe-4.rs:16:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the type `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + --> $DIR/not-panic-safe-4.rs:19:5 + | +LL | assert::<&RefCell<i32>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<isize>` + = note: required because it appears within the type `std::cell::Cell<isize>` + = note: required because it appears within the type `std::cell::RefCell<i32>` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&std::cell::RefCell<i32>` +note: required by `assert` + --> $DIR/not-panic-safe-4.rs:16:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/not-panic-safe-5.rs b/src/test/ui/compile-fail-migration/not-panic-safe-5.rs index 627a0fe78cf..627a0fe78cf 100644 --- a/src/test/compile-fail/not-panic-safe-5.rs +++ b/src/test/ui/compile-fail-migration/not-panic-safe-5.rs diff --git a/src/test/ui/compile-fail-migration/not-panic-safe-5.stderr b/src/test/ui/compile-fail-migration/not-panic-safe-5.stderr new file mode 100644 index 00000000000..ba3b3fadb6a --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-panic-safe-5.stderr @@ -0,0 +1,17 @@ +error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + --> $DIR/not-panic-safe-5.rs:19:5 + | +LL | assert::<*const UnsafeCell<i32>>(); //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `*const std::cell::UnsafeCell<i32>` +note: required by `assert` + --> $DIR/not-panic-safe-5.rs:16:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/not-panic-safe-6.rs b/src/test/ui/compile-fail-migration/not-panic-safe-6.rs index 950f0a0b53a..950f0a0b53a 100644 --- a/src/test/compile-fail/not-panic-safe-6.rs +++ b/src/test/ui/compile-fail-migration/not-panic-safe-6.rs diff --git a/src/test/ui/compile-fail-migration/not-panic-safe-6.stderr b/src/test/ui/compile-fail-migration/not-panic-safe-6.stderr new file mode 100644 index 00000000000..da6c2a58294 --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-panic-safe-6.stderr @@ -0,0 +1,34 @@ +error[E0277]: the type `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + --> $DIR/not-panic-safe-6.rs:19:5 + | +LL | assert::<*mut RefCell<i32>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<i32>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<i32>` + = note: required because it appears within the type `std::cell::RefCell<i32>` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `*mut std::cell::RefCell<i32>` +note: required by `assert` + --> $DIR/not-panic-safe-6.rs:16:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the type `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + --> $DIR/not-panic-safe-6.rs:19:5 + | +LL | assert::<*mut RefCell<i32>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<isize>` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell<i32>`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell<isize>` + = note: required because it appears within the type `std::cell::Cell<isize>` + = note: required because it appears within the type `std::cell::RefCell<i32>` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `*mut std::cell::RefCell<i32>` +note: required by `assert` + --> $DIR/not-panic-safe-6.rs:16:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/not-panic-safe.rs b/src/test/ui/compile-fail-migration/not-panic-safe.rs index 0ebf3d3fed7..0ebf3d3fed7 100644 --- a/src/test/compile-fail/not-panic-safe.rs +++ b/src/test/ui/compile-fail-migration/not-panic-safe.rs diff --git a/src/test/ui/compile-fail-migration/not-panic-safe.stderr b/src/test/ui/compile-fail-migration/not-panic-safe.stderr new file mode 100644 index 00000000000..f349b5d2e26 --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-panic-safe.stderr @@ -0,0 +1,16 @@ +error[E0277]: the type `&mut i32` may not be safely transferred across an unwind boundary + --> $DIR/not-panic-safe.rs:19:5 + | +LL | assert::<&mut i32>(); + | ^^^^^^^^^^^^^^^^^^ `&mut i32` may not be safely transferred across an unwind boundary + | + = help: the trait `std::panic::UnwindSafe` is not implemented for `&mut i32` +note: required by `assert` + --> $DIR/not-panic-safe.rs:16:1 + | +LL | fn assert<T: UnwindSafe + ?Sized>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/not-sync.rs b/src/test/ui/compile-fail-migration/not-sync.rs index a383244f415..a383244f415 100644 --- a/src/test/compile-fail/not-sync.rs +++ b/src/test/ui/compile-fail-migration/not-sync.rs diff --git a/src/test/ui/compile-fail-migration/not-sync.stderr b/src/test/ui/compile-fail-migration/not-sync.stderr new file mode 100644 index 00000000000..026fd5dd713 --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-sync.stderr @@ -0,0 +1,81 @@ +error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely + --> $DIR/not-sync.rs:18:5 + | +LL | test::<Cell<i32>>(); + | ^^^^^^^^^^^^^^^^^ `std::cell::Cell<i32>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::Cell<i32>` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test<T: Sync>() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::cell::RefCell<i32>` cannot be shared between threads safely + --> $DIR/not-sync.rs:20:5 + | +LL | test::<RefCell<i32>>(); + | ^^^^^^^^^^^^^^^^^^^^ `std::cell::RefCell<i32>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::RefCell<i32>` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test<T: Sync>() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::rc::Rc<i32>` cannot be shared between threads safely + --> $DIR/not-sync.rs:23:5 + | +LL | test::<Rc<i32>>(); + | ^^^^^^^^^^^^^^^ `std::rc::Rc<i32>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::rc::Rc<i32>` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test<T: Sync>() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::rc::Weak<i32>` cannot be shared between threads safely + --> $DIR/not-sync.rs:25:5 + | +LL | test::<Weak<i32>>(); + | ^^^^^^^^^^^^^^^^^ `std::rc::Weak<i32>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::rc::Weak<i32>` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test<T: Sync>() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::sync::mpsc::Receiver<i32>` cannot be shared between threads safely + --> $DIR/not-sync.rs:28:5 + | +LL | test::<Receiver<i32>>(); + | ^^^^^^^^^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<i32>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<i32>` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test<T: Sync>() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::sync::mpsc::Sender<i32>` cannot be shared between threads safely + --> $DIR/not-sync.rs:30:5 + | +LL | test::<Sender<i32>>(); + | ^^^^^^^^^^^^^^^^^^^ `std::sync::mpsc::Sender<i32>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<i32>` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test<T: Sync>() {} + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/not-utf8.bin b/src/test/ui/compile-fail-migration/not-utf8.bin index 4148e5b88fe..4148e5b88fe 100644 --- a/src/test/compile-fail/not-utf8.bin +++ b/src/test/ui/compile-fail-migration/not-utf8.bin Binary files differdiff --git a/src/test/compile-fail/not-utf8.rs b/src/test/ui/compile-fail-migration/not-utf8.rs index 5331062d9b6..5331062d9b6 100644 --- a/src/test/compile-fail/not-utf8.rs +++ b/src/test/ui/compile-fail-migration/not-utf8.rs diff --git a/src/test/ui/compile-fail-migration/not-utf8.stderr b/src/test/ui/compile-fail-migration/not-utf8.stderr new file mode 100644 index 00000000000..28c23f4f348 --- /dev/null +++ b/src/test/ui/compile-fail-migration/not-utf8.stderr @@ -0,0 +1,8 @@ +error: couldn't read "$DIR/not-utf8.bin": stream did not contain valid UTF-8 + --> $DIR/not-utf8.rs:14:5 + | +LL | include!("not-utf8.bin") + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/object-does-not-impl-trait.rs b/src/test/ui/compile-fail-migration/object-does-not-impl-trait.rs index 30f8d5e2f45..30f8d5e2f45 100644 --- a/src/test/compile-fail/object-does-not-impl-trait.rs +++ b/src/test/ui/compile-fail-migration/object-does-not-impl-trait.rs diff --git a/src/test/ui/compile-fail-migration/object-does-not-impl-trait.stderr b/src/test/ui/compile-fail-migration/object-does-not-impl-trait.stderr new file mode 100644 index 00000000000..a1ebdf3e666 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-does-not-impl-trait.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `std::boxed::Box<dyn Foo>: Foo` is not satisfied + --> $DIR/object-does-not-impl-trait.rs:16:31 + | +LL | fn take_object(f: Box<Foo>) { take_foo(f); } + | ^^^^^^^^ the trait `Foo` is not implemented for `std::boxed::Box<dyn Foo>` + | +note: required by `take_foo` + --> $DIR/object-does-not-impl-trait.rs:15:1 + | +LL | fn take_foo<F:Foo>(f: F) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/object-lifetime-default-ambiguous.rs b/src/test/ui/compile-fail-migration/object-lifetime-default-ambiguous.rs index 3df83d91999..3df83d91999 100644 --- a/src/test/compile-fail/object-lifetime-default-ambiguous.rs +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-ambiguous.rs diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-ambiguous.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-ambiguous.stderr new file mode 100644 index 00000000000..cb603f2c472 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-ambiguous.stderr @@ -0,0 +1,21 @@ +error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound + --> $DIR/object-lifetime-default-ambiguous.rs:33:27 + | +LL | fn a<'a,'b>(t: Ref2<'a,'b,Test>) { + | ^^^^ + +error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound + --> $DIR/object-lifetime-default-ambiguous.rs:37:14 + | +LL | fn b(t: Ref2<Test>) { + | ^^^^ + +error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound + --> $DIR/object-lifetime-default-ambiguous.rs:53:15 + | +LL | fn f(t: &Ref2<Test>) { + | ^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0228`. diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-elision.nll.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-elision.nll.stderr new file mode 100644 index 00000000000..509d35a9433 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-elision.nll.stderr @@ -0,0 +1,24 @@ +warning: not reporting region error due to nll + --> $DIR/object-lifetime-default-elision.rs:81:5 + | +LL | ss + | ^^ + +error: unsatisfied lifetime constraints + --> $DIR/object-lifetime-default-elision.rs:64:53 + | +LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait { + | __________--_--______________________________________^ + | | | | + | | | lifetime `'b` defined here + | | lifetime `'a` defined here +LL | | // Under old rules, the fully elaborated types of input/output were: +LL | | // +LL | | // for<'a,'b,'c>fn(&'a (SomeTrait+'c)) -> &'b (SomeTrait+'a) +... | +LL | | //~| ERROR cannot infer +LL | | } + | |_^ return requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/object-lifetime-default-elision.rs b/src/test/ui/compile-fail-migration/object-lifetime-default-elision.rs index e37b6a2bb9c..e37b6a2bb9c 100644 --- a/src/test/compile-fail/object-lifetime-default-elision.rs +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-elision.rs diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-elision.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-elision.stderr new file mode 100644 index 00000000000..45e7d8451f7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-elision.stderr @@ -0,0 +1,53 @@ +error[E0495]: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements + --> $DIR/object-lifetime-default-elision.rs:81:5 + | +LL | ss + | ^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 64:10... + --> $DIR/object-lifetime-default-elision.rs:64:10 + | +LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait { + | ^^ +note: ...so that the type `(dyn SomeTrait + 'a)` is not borrowed for too long + --> $DIR/object-lifetime-default-elision.rs:81:5 + | +LL | ss + | ^^ +note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 64:13... + --> $DIR/object-lifetime-default-elision.rs:64:13 + | +LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait { + | ^^ + = note: ...so that the expression is assignable: + expected &'b (dyn SomeTrait + 'b) + found &dyn SomeTrait + +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/object-lifetime-default-elision.rs:81:5 + | +LL | ss + | ^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 64:10... + --> $DIR/object-lifetime-default-elision.rs:64:10 + | +LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait { + | ^^ +note: ...so that the declared lifetime parameter bounds are satisfied + --> $DIR/object-lifetime-default-elision.rs:81:5 + | +LL | ss + | ^^ +note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 64:13... + --> $DIR/object-lifetime-default-elision.rs:64:13 + | +LL | fn load3<'a,'b>(ss: &'a SomeTrait) -> &'b SomeTrait { + | ^^ + = note: ...so that the expression is assignable: + expected &'b (dyn SomeTrait + 'b) + found &dyn SomeTrait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-from-box-error.nll.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-from-box-error.nll.stderr new file mode 100644 index 00000000000..5cfced1a72f --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-from-box-error.nll.stderr @@ -0,0 +1,45 @@ +warning: not reporting region error due to nll + --> $DIR/object-lifetime-default-from-box-error.rs:28:5 + | +LL | ss.r //~ ERROR explicit lifetime required in the type of `ss` [E0621] + | ^^^^ + +warning: not reporting region error due to nll + --> $DIR/object-lifetime-default-from-box-error.rs:41:12 + | +LL | ss.r = b; //~ ERROR 41:12: 41:13: explicit lifetime required in the type of `ss` [E0621] + | ^ + +error[E0621]: explicit lifetime required in the type of `ss` + --> $DIR/object-lifetime-default-from-box-error.rs:24:48 + | +LL | fn load(ss: &mut SomeStruct) -> Box<SomeTrait> { + | _____________---------------____________________^ + | | | + | | help: add explicit lifetime `'static` to the type of `ss`: `&mut SomeStruct<'static>` +LL | | // `Box<SomeTrait>` defaults to a `'static` bound, so this return +LL | | // is illegal. +LL | | +LL | | ss.r //~ ERROR explicit lifetime required in the type of `ss` [E0621] +LL | | } + | |_^ lifetime `'static` required + +error[E0507]: cannot move out of borrowed content + --> $DIR/object-lifetime-default-from-box-error.rs:28:5 + | +LL | ss.r //~ ERROR explicit lifetime required in the type of `ss` [E0621] + | ^^^^ cannot move out of borrowed content + +error[E0621]: explicit lifetime required in the type of `ss` + --> $DIR/object-lifetime-default-from-box-error.rs:41:5 + | +LL | fn store1<'b>(ss: &mut SomeStruct, b: Box<SomeTrait+'b>) { + | --------------- help: add explicit lifetime `'b` to the type of `ss`: `&mut SomeStruct<'b>` +... +LL | ss.r = b; //~ ERROR 41:12: 41:13: explicit lifetime required in the type of `ss` [E0621] + | ^^^^ lifetime `'b` required + +error: aborting due to 3 previous errors + +Some errors occurred: E0507, E0621. +For more information about an error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/object-lifetime-default-from-box-error.rs b/src/test/ui/compile-fail-migration/object-lifetime-default-from-box-error.rs index b253612bc32..b253612bc32 100644 --- a/src/test/compile-fail/object-lifetime-default-from-box-error.rs +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-from-box-error.rs diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-from-box-error.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-from-box-error.stderr new file mode 100644 index 00000000000..9972930c13e --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-from-box-error.stderr @@ -0,0 +1,21 @@ +error[E0621]: explicit lifetime required in the type of `ss` + --> $DIR/object-lifetime-default-from-box-error.rs:28:5 + | +LL | fn load(ss: &mut SomeStruct) -> Box<SomeTrait> { + | --------------- help: add explicit lifetime `'static` to the type of `ss`: `&mut SomeStruct<'static>` +... +LL | ss.r //~ ERROR explicit lifetime required in the type of `ss` [E0621] + | ^^^^ lifetime `'static` required + +error[E0621]: explicit lifetime required in the type of `ss` + --> $DIR/object-lifetime-default-from-box-error.rs:41:12 + | +LL | fn store1<'b>(ss: &mut SomeStruct, b: Box<SomeTrait+'b>) { + | --------------- help: add explicit lifetime `'b` to the type of `ss`: `&mut SomeStruct<'b>` +... +LL | ss.r = b; //~ ERROR 41:12: 41:13: explicit lifetime required in the type of `ss` [E0621] + | ^ lifetime `'b` required + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-box-error.nll.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-box-error.nll.stderr new file mode 100644 index 00000000000..42bcdf2bd8c --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-box-error.nll.stderr @@ -0,0 +1,16 @@ +warning: not reporting region error due to nll + --> $DIR/object-lifetime-default-from-rptr-box-error.rs:25:12 + | +LL | ss.t = t; //~ ERROR mismatched types + | ^ + +error: borrowed data escapes outside of function + --> $DIR/object-lifetime-default-from-rptr-box-error.rs:25:5 + | +LL | fn c<'a>(t: &'a Box<Test+'a>, mut ss: SomeStruct<'a>) { + | - `t` is a reference that is only valid in the function body +LL | ss.t = t; //~ ERROR mismatched types + | ^^^^^^^^ `t` escapes the function body here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/object-lifetime-default-from-rptr-box-error.rs b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-box-error.rs index 98301ef1a0a..98301ef1a0a 100644 --- a/src/test/compile-fail/object-lifetime-default-from-rptr-box-error.rs +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-box-error.rs diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-box-error.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-box-error.stderr new file mode 100644 index 00000000000..a59d8090baf --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-box-error.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/object-lifetime-default-from-rptr-box-error.rs:25:12 + | +LL | ss.t = t; //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `&'a std::boxed::Box<(dyn Test + 'static)>` + found type `&'a std::boxed::Box<(dyn Test + 'a)>` +note: the lifetime 'a as defined on the function body at 24:6... + --> $DIR/object-lifetime-default-from-rptr-box-error.rs:24:6 + | +LL | fn c<'a>(t: &'a Box<Test+'a>, mut ss: SomeStruct<'a>) { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-struct-error.nll.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-struct-error.nll.stderr new file mode 100644 index 00000000000..73b419d5113 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-struct-error.nll.stderr @@ -0,0 +1,16 @@ +warning: not reporting region error due to nll + --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:31:12 + | +LL | ss.t = t; //~ ERROR mismatched types + | ^ + +error: borrowed data escapes outside of function + --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:31:5 + | +LL | fn c<'a>(t: &'a MyBox<Test+'a>, mut ss: SomeStruct<'a>) { + | - `t` is a reference that is only valid in the function body +LL | ss.t = t; //~ ERROR mismatched types + | ^^^^^^^^ `t` escapes the function body here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/object-lifetime-default-from-rptr-struct-error.rs b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-struct-error.rs index 836e4fa1142..836e4fa1142 100644 --- a/src/test/compile-fail/object-lifetime-default-from-rptr-struct-error.rs +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-struct-error.rs diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-struct-error.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-struct-error.stderr new file mode 100644 index 00000000000..beda4df5295 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-from-rptr-struct-error.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:31:12 + | +LL | ss.t = t; //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `&'a MyBox<(dyn Test + 'static)>` + found type `&'a MyBox<(dyn Test + 'a)>` +note: the lifetime 'a as defined on the function body at 30:6... + --> $DIR/object-lifetime-default-from-rptr-struct-error.rs:30:6 + | +LL | fn c<'a>(t: &'a MyBox<Test+'a>, mut ss: SomeStruct<'a>) { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-mybox.nll.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-mybox.nll.stderr new file mode 100644 index 00000000000..f76a03d078b --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-mybox.nll.stderr @@ -0,0 +1,33 @@ +warning: not reporting region error due to nll + --> $DIR/object-lifetime-default-mybox.rs:37:5 + | +LL | a //~ ERROR lifetime mismatch + | ^ + +warning: not reporting region error due to nll + --> $DIR/object-lifetime-default-mybox.rs:41:11 + | +LL | load0(ss) //~ ERROR mismatched types + | ^^ + +error: unsatisfied lifetime constraints + --> $DIR/object-lifetime-default-mybox.rs:37:5 + | +LL | fn load1<'a,'b>(a: &'a MyBox<SomeTrait>, + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +... +LL | a //~ ERROR lifetime mismatch + | ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` + +error: borrowed data escapes outside of function + --> $DIR/object-lifetime-default-mybox.rs:41:5 + | +LL | fn load2<'a>(ss: &MyBox<SomeTrait+'a>) -> MyBox<SomeTrait+'a> { + | -- `ss` is a reference that is only valid in the function body +LL | load0(ss) //~ ERROR mismatched types + | ^^^^^^^^^ `ss` escapes the function body here + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/object-lifetime-default-mybox.rs b/src/test/ui/compile-fail-migration/object-lifetime-default-mybox.rs index 54657e76e97..54657e76e97 100644 --- a/src/test/compile-fail/object-lifetime-default-mybox.rs +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-mybox.rs diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default-mybox.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default-mybox.stderr new file mode 100644 index 00000000000..ec003693617 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default-mybox.stderr @@ -0,0 +1,31 @@ +error[E0623]: lifetime mismatch + --> $DIR/object-lifetime-default-mybox.rs:37:5 + | +LL | fn load1<'a,'b>(a: &'a MyBox<SomeTrait>, + | -------------------- this parameter and the return type are declared with different lifetimes... +LL | b: &'b MyBox<SomeTrait>) +LL | -> &'b MyBox<SomeTrait> + | -------------------- +LL | { +LL | a //~ ERROR lifetime mismatch + | ^ ...but data from `a` is returned here + +error[E0308]: mismatched types + --> $DIR/object-lifetime-default-mybox.rs:41:11 + | +LL | load0(ss) //~ ERROR mismatched types + | ^^ lifetime mismatch + | + = note: expected type `&MyBox<(dyn SomeTrait + 'static)>` + found type `&MyBox<(dyn SomeTrait + 'a)>` +note: the lifetime 'a as defined on the function body at 40:10... + --> $DIR/object-lifetime-default-mybox.rs:40:10 + | +LL | fn load2<'a>(ss: &MyBox<SomeTrait+'a>) -> MyBox<SomeTrait+'a> { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to 2 previous errors + +Some errors occurred: E0308, E0623. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/object-lifetime-default.rs b/src/test/ui/compile-fail-migration/object-lifetime-default.rs index 104e10f3207..104e10f3207 100644 --- a/src/test/compile-fail/object-lifetime-default.rs +++ b/src/test/ui/compile-fail-migration/object-lifetime-default.rs diff --git a/src/test/ui/compile-fail-migration/object-lifetime-default.stderr b/src/test/ui/compile-fail-migration/object-lifetime-default.stderr new file mode 100644 index 00000000000..a7ff6cfd772 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-lifetime-default.stderr @@ -0,0 +1,44 @@ +error: BaseDefault + --> $DIR/object-lifetime-default.rs:14:1 + | +LL | struct A<T>(T); //~ ERROR BaseDefault + | ^^^^^^^^^^^^^^^ + +error: BaseDefault + --> $DIR/object-lifetime-default.rs:17:1 + | +LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: 'a + --> $DIR/object-lifetime-default.rs:20:1 + | +LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: Ambiguous + --> $DIR/object-lifetime-default.rs:23:1 + | +LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T); //~ ERROR Ambiguous + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: 'b + --> $DIR/object-lifetime-default.rs:26:1 + | +LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: 'a,'b + --> $DIR/object-lifetime-default.rs:29:1 + | +LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: 'a,Ambiguous + --> $DIR/object-lifetime-default.rs:32:1 + | +LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 7 previous errors + diff --git a/src/test/compile-fail/object-pointer-types.rs b/src/test/ui/compile-fail-migration/object-pointer-types.rs index 98c14cee942..98c14cee942 100644 --- a/src/test/compile-fail/object-pointer-types.rs +++ b/src/test/ui/compile-fail-migration/object-pointer-types.rs diff --git a/src/test/ui/compile-fail-migration/object-pointer-types.stderr b/src/test/ui/compile-fail-migration/object-pointer-types.stderr new file mode 100644 index 00000000000..5d8679b8aa5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-pointer-types.stderr @@ -0,0 +1,29 @@ +error[E0599]: no method named `owned` found for type `&dyn Foo` in the current scope + --> $DIR/object-pointer-types.rs:22:7 + | +LL | x.owned(); //~ ERROR no method named `owned` found + | ^^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `owned`, perhaps you need to implement it: + candidate #1: `Foo` + +error[E0599]: no method named `owned` found for type `&mut dyn Foo` in the current scope + --> $DIR/object-pointer-types.rs:28:7 + | +LL | x.owned(); //~ ERROR no method named `owned` found + | ^^^^^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `owned`, perhaps you need to implement it: + candidate #1: `Foo` + +error[E0599]: no method named `managed` found for type `std::boxed::Box<(dyn Foo + 'static)>` in the current scope + --> $DIR/object-pointer-types.rs:34:7 + | +LL | x.managed(); //~ ERROR no method named `managed` found + | ^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/compile-fail-migration/object-safety-by-value-self-use.nll.stderr b/src/test/ui/compile-fail-migration/object-safety-by-value-self-use.nll.stderr new file mode 100644 index 00000000000..cf0ee588263 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-safety-by-value-self-use.nll.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type dyn Bar: the size of dyn Bar cannot be statically determined + --> $DIR/object-safety-by-value-self-use.rs:25:5 + | +LL | t.bar() //~ ERROR cannot move a value of type (dyn Bar + 'static) + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/compile-fail/object-safety-by-value-self-use.rs b/src/test/ui/compile-fail-migration/object-safety-by-value-self-use.rs index e575bbb6cea..e575bbb6cea 100644 --- a/src/test/compile-fail/object-safety-by-value-self-use.rs +++ b/src/test/ui/compile-fail-migration/object-safety-by-value-self-use.rs diff --git a/src/test/ui/compile-fail-migration/object-safety-by-value-self-use.stderr b/src/test/ui/compile-fail-migration/object-safety-by-value-self-use.stderr new file mode 100644 index 00000000000..015284657af --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-safety-by-value-self-use.stderr @@ -0,0 +1,9 @@ +error[E0161]: cannot move a value of type (dyn Bar + 'static): the size of (dyn Bar + 'static) cannot be statically determined + --> $DIR/object-safety-by-value-self-use.rs:25:5 + | +LL | t.bar() //~ ERROR cannot move a value of type (dyn Bar + 'static) + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0161`. diff --git a/src/test/compile-fail/object-safety-by-value-self.rs b/src/test/ui/compile-fail-migration/object-safety-by-value-self.rs index 5a8772d6142..5a8772d6142 100644 --- a/src/test/compile-fail/object-safety-by-value-self.rs +++ b/src/test/ui/compile-fail-migration/object-safety-by-value-self.rs diff --git a/src/test/ui/compile-fail-migration/object-safety-by-value-self.stderr b/src/test/ui/compile-fail-migration/object-safety-by-value-self.stderr new file mode 100644 index 00000000000..61259641c0e --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-safety-by-value-self.stderr @@ -0,0 +1,9 @@ +error: compilation successful + --> $DIR/object-safety-by-value-self.rs:55:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/object-safety-issue-22040.rs b/src/test/ui/compile-fail-migration/object-safety-issue-22040.rs index 06d2441d3c0..06d2441d3c0 100644 --- a/src/test/compile-fail/object-safety-issue-22040.rs +++ b/src/test/ui/compile-fail-migration/object-safety-issue-22040.rs diff --git a/src/test/ui/compile-fail-migration/object-safety-issue-22040.stderr b/src/test/ui/compile-fail-migration/object-safety-issue-22040.stderr new file mode 100644 index 00000000000..b718e92fc47 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-safety-issue-22040.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait `Expr` cannot be made into an object + --> $DIR/object-safety-issue-22040.rs:22:23 + | +LL | elements: Vec<Box<Expr+ 'x>>, + | ^^^^^^^^ the trait `Expr` cannot be made into an object + | + = note: the trait cannot use `Self` as a type parameter in the supertraits or where-clauses + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/object-safety-no-static.rs b/src/test/ui/compile-fail-migration/object-safety-no-static.rs index dd1d5af3f4a..dd1d5af3f4a 100644 --- a/src/test/compile-fail/object-safety-no-static.rs +++ b/src/test/ui/compile-fail-migration/object-safety-no-static.rs diff --git a/src/test/ui/compile-fail-migration/object-safety-no-static.stderr b/src/test/ui/compile-fail-migration/object-safety-no-static.stderr new file mode 100644 index 00000000000..f17d2907148 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-safety-no-static.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait `Foo` cannot be made into an object + --> $DIR/object-safety-no-static.rs:18:1 + | +LL | fn foo_implicit<T:Foo+'static>(b: Box<T>) -> Box<Foo+'static> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object + | + = note: method `foo` has no receiver + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/object-safety-phantom-fn.rs b/src/test/ui/compile-fail-migration/object-safety-phantom-fn.rs index 518c45ac9df..518c45ac9df 100644 --- a/src/test/compile-fail/object-safety-phantom-fn.rs +++ b/src/test/ui/compile-fail-migration/object-safety-phantom-fn.rs diff --git a/src/test/ui/compile-fail-migration/object-safety-phantom-fn.stderr b/src/test/ui/compile-fail-migration/object-safety-phantom-fn.stderr new file mode 100644 index 00000000000..645867f4606 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-safety-phantom-fn.stderr @@ -0,0 +1,9 @@ +error: compilation successful + --> $DIR/object-safety-phantom-fn.rs:31:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/object-safety-sized-2.rs b/src/test/ui/compile-fail-migration/object-safety-sized-2.rs index 3e1942d5a01..3e1942d5a01 100644 --- a/src/test/compile-fail/object-safety-sized-2.rs +++ b/src/test/ui/compile-fail-migration/object-safety-sized-2.rs diff --git a/src/test/ui/compile-fail-migration/object-safety-sized-2.stderr b/src/test/ui/compile-fail-migration/object-safety-sized-2.stderr new file mode 100644 index 00000000000..1e179b662b9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/object-safety-sized-2.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait `Bar` cannot be made into an object + --> $DIR/object-safety-sized-2.rs:20:1 + | +LL | fn make_bar<T:Bar>(t: &T) -> &Bar { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object + | + = note: the trait cannot require that `Self : Sized` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/occurs-check-2.rs b/src/test/ui/compile-fail-migration/occurs-check-2.rs index 5d162fe944e..5d162fe944e 100644 --- a/src/test/compile-fail/occurs-check-2.rs +++ b/src/test/ui/compile-fail-migration/occurs-check-2.rs diff --git a/src/test/ui/compile-fail-migration/occurs-check-2.stderr b/src/test/ui/compile-fail-migration/occurs-check-2.stderr new file mode 100644 index 00000000000..547491c395b --- /dev/null +++ b/src/test/ui/compile-fail-migration/occurs-check-2.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/occurs-check-2.rs:17:9 + | +LL | f = box g; + | ^^^^^ + | | + | cyclic type of infinite size + | help: try using a conversion method: `box g.to_string()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/occurs-check-3.rs b/src/test/ui/compile-fail-migration/occurs-check-3.rs index ba7688e8524..ba7688e8524 100644 --- a/src/test/compile-fail/occurs-check-3.rs +++ b/src/test/ui/compile-fail-migration/occurs-check-3.rs diff --git a/src/test/ui/compile-fail-migration/occurs-check-3.stderr b/src/test/ui/compile-fail-migration/occurs-check-3.stderr new file mode 100644 index 00000000000..1483d41d723 --- /dev/null +++ b/src/test/ui/compile-fail-migration/occurs-check-3.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/occurs-check-3.rs:14:24 + | +LL | fn main() { let c; c = clam::a(c); match c { clam::a::<isize>(_) => { } } } + | ^^^^^^^^^^ cyclic type of infinite size + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/occurs-check.rs b/src/test/ui/compile-fail-migration/occurs-check.rs index 2c784365ea9..2c784365ea9 100644 --- a/src/test/compile-fail/occurs-check.rs +++ b/src/test/ui/compile-fail-migration/occurs-check.rs diff --git a/src/test/ui/compile-fail-migration/occurs-check.stderr b/src/test/ui/compile-fail-migration/occurs-check.stderr new file mode 100644 index 00000000000..c6994d0c537 --- /dev/null +++ b/src/test/ui/compile-fail-migration/occurs-check.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/occurs-check.rs:15:9 + | +LL | f = box f; + | ^^^^^ + | | + | cyclic type of infinite size + | help: try using a conversion method: `box f.to_string()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/old-suffixes-are-really-forbidden.rs b/src/test/ui/compile-fail-migration/old-suffixes-are-really-forbidden.rs index 9a71dc98014..9a71dc98014 100644 --- a/src/test/compile-fail/old-suffixes-are-really-forbidden.rs +++ b/src/test/ui/compile-fail-migration/old-suffixes-are-really-forbidden.rs diff --git a/src/test/ui/compile-fail-migration/old-suffixes-are-really-forbidden.stderr b/src/test/ui/compile-fail-migration/old-suffixes-are-really-forbidden.stderr new file mode 100644 index 00000000000..d580a18f46b --- /dev/null +++ b/src/test/ui/compile-fail-migration/old-suffixes-are-really-forbidden.stderr @@ -0,0 +1,18 @@ +error: invalid suffix `is` for numeric literal + --> $DIR/old-suffixes-are-really-forbidden.rs:12:13 + | +LL | let a = 1_is; //~ ERROR invalid suffix + | ^^^^ + | + = help: the suffix must be one of the integral types (`u32`, `isize`, etc) + +error: invalid suffix `us` for numeric literal + --> $DIR/old-suffixes-are-really-forbidden.rs:13:13 + | +LL | let b = 2_us; //~ ERROR invalid suffix + | ^^^^ + | + = help: the suffix must be one of the integral types (`u32`, `isize`, etc) + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/once-cant-call-twice-on-heap.rs b/src/test/ui/compile-fail-migration/once-cant-call-twice-on-heap.rs index 6441f308f29..6441f308f29 100644 --- a/src/test/compile-fail/once-cant-call-twice-on-heap.rs +++ b/src/test/ui/compile-fail-migration/once-cant-call-twice-on-heap.rs diff --git a/src/test/ui/compile-fail-migration/once-cant-call-twice-on-heap.stderr b/src/test/ui/compile-fail-migration/once-cant-call-twice-on-heap.stderr new file mode 100644 index 00000000000..81a501f5680 --- /dev/null +++ b/src/test/ui/compile-fail-migration/once-cant-call-twice-on-heap.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `blk` + --> $DIR/once-cant-call-twice-on-heap.rs:19:5 + | +LL | blk(); + | --- value moved here +LL | blk(); //~ ERROR use of moved value + | ^^^ value used here after move + | + = note: move occurs because `blk` has type `F`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/opt-in-copy.rs b/src/test/ui/compile-fail-migration/opt-in-copy.rs index bc18b52a0c1..bc18b52a0c1 100644 --- a/src/test/compile-fail/opt-in-copy.rs +++ b/src/test/ui/compile-fail-migration/opt-in-copy.rs diff --git a/src/test/ui/compile-fail-migration/opt-in-copy.stderr b/src/test/ui/compile-fail-migration/opt-in-copy.stderr new file mode 100644 index 00000000000..c6440804be6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/opt-in-copy.stderr @@ -0,0 +1,21 @@ +error[E0204]: the trait `Copy` may not be implemented for this type + --> $DIR/opt-in-copy.rs:17:6 + | +LL | but_i_cant: CantCopyThis, + | ------------------------ this field does not implement `Copy` +... +LL | impl Copy for IWantToCopyThis {} + | ^^^^ + +error[E0204]: the trait `Copy` may not be implemented for this type + --> $DIR/opt-in-copy.rs:29:6 + | +LL | ButICant(CantCopyThisEither), + | ------------------ this field does not implement `Copy` +... +LL | impl Copy for IWantToCopyThisToo {} + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0204`. diff --git a/src/test/compile-fail/or-patter-mismatch.rs b/src/test/ui/compile-fail-migration/or-patter-mismatch.rs index 59508d6ac95..59508d6ac95 100644 --- a/src/test/compile-fail/or-patter-mismatch.rs +++ b/src/test/ui/compile-fail-migration/or-patter-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/or-patter-mismatch.stderr b/src/test/ui/compile-fail-migration/or-patter-mismatch.stderr new file mode 100644 index 00000000000..8bf4d2e5332 --- /dev/null +++ b/src/test/ui/compile-fail-migration/or-patter-mismatch.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/or-patter-mismatch.rs:15:68 + | +LL | fn main() { match blah::a(1, 1, 2) { blah::a(_, x, y) | blah::b(x, y) => { } } } + | ^ expected usize, found isize + | + = note: expected type `usize` + found type `isize` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/orphan-check-diagnostics.rs b/src/test/ui/compile-fail-migration/orphan-check-diagnostics.rs index 8201565c331..8201565c331 100644 --- a/src/test/compile-fail/orphan-check-diagnostics.rs +++ b/src/test/ui/compile-fail-migration/orphan-check-diagnostics.rs diff --git a/src/test/ui/compile-fail-migration/orphan-check-diagnostics.stderr b/src/test/ui/compile-fail-migration/orphan-check-diagnostics.stderr new file mode 100644 index 00000000000..dc134dd8d6f --- /dev/null +++ b/src/test/ui/compile-fail-migration/orphan-check-diagnostics.stderr @@ -0,0 +1,11 @@ +error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g. `MyStruct<T>`) + --> $DIR/orphan-check-diagnostics.rs:20:1 + | +LL | impl<T> RemoteTrait for T where T: LocalTrait {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type + | + = note: only traits defined in the current crate can be implemented for a type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0210`. diff --git a/src/test/compile-fail/osx-frameworks.rs b/src/test/ui/compile-fail-migration/osx-frameworks.rs index 026ef3c95f6..026ef3c95f6 100644 --- a/src/test/compile-fail/osx-frameworks.rs +++ b/src/test/ui/compile-fail-migration/osx-frameworks.rs diff --git a/src/test/ui/compile-fail-migration/osx-frameworks.stderr b/src/test/ui/compile-fail-migration/osx-frameworks.stderr new file mode 100644 index 00000000000..cdc2357c36c --- /dev/null +++ b/src/test/ui/compile-fail-migration/osx-frameworks.stderr @@ -0,0 +1,9 @@ +error[E0455]: native frameworks are only available on macOS targets + --> $DIR/osx-frameworks.rs:13:1 + | +LL | #[link(name = "foo", kind = "framework")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0455`. diff --git a/src/test/compile-fail/out-of-order-shadowing.rs b/src/test/ui/compile-fail-migration/out-of-order-shadowing.rs index 1fafaf85112..1fafaf85112 100644 --- a/src/test/compile-fail/out-of-order-shadowing.rs +++ b/src/test/ui/compile-fail-migration/out-of-order-shadowing.rs diff --git a/src/test/ui/compile-fail-migration/out-of-order-shadowing.stderr b/src/test/ui/compile-fail-migration/out-of-order-shadowing.stderr new file mode 100644 index 00000000000..78e32e23ff6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/out-of-order-shadowing.stderr @@ -0,0 +1,11 @@ +error: `bar` is already in scope + --> $DIR/out-of-order-shadowing.rs:15:1 + | +LL | define_macro!(bar); + | ^^^^^^^^^^^^^^^^^^^ + | + = note: macro-expanded `macro_rules!`s may not shadow existing macros (see RFC 1560) + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + diff --git a/src/test/compile-fail/output-type-mismatch.rs b/src/test/ui/compile-fail-migration/output-type-mismatch.rs index 158e99ac200..158e99ac200 100644 --- a/src/test/compile-fail/output-type-mismatch.rs +++ b/src/test/ui/compile-fail-migration/output-type-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/output-type-mismatch.stderr b/src/test/ui/compile-fail-migration/output-type-mismatch.stderr new file mode 100644 index 00000000000..e869dfa78a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/output-type-mismatch.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/output-type-mismatch.rs:15:31 + | +LL | fn main() { let i: isize; i = f(); } + | ^^^ expected isize, found () + | + = note: expected type `isize` + found type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/overlap-marker-trait.rs b/src/test/ui/compile-fail-migration/overlap-marker-trait.rs index a649ae25f34..a649ae25f34 100644 --- a/src/test/compile-fail/overlap-marker-trait.rs +++ b/src/test/ui/compile-fail-migration/overlap-marker-trait.rs diff --git a/src/test/ui/compile-fail-migration/overlap-marker-trait.stderr b/src/test/ui/compile-fail-migration/overlap-marker-trait.stderr new file mode 100644 index 00000000000..d739dfc59d2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/overlap-marker-trait.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `NotDebugOrDisplay: Marker` is not satisfied + --> $DIR/overlap-marker-trait.rs:40:5 + | +LL | is_marker::<NotDebugOrDisplay>(); //~ ERROR + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Marker` is not implemented for `NotDebugOrDisplay` + | +note: required by `is_marker` + --> $DIR/overlap-marker-trait.rs:28:1 + | +LL | fn is_marker<T: Marker>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/overloaded-calls-nontuple.rs b/src/test/ui/compile-fail-migration/overloaded-calls-nontuple.rs index 7113224664b..7113224664b 100644 --- a/src/test/compile-fail/overloaded-calls-nontuple.rs +++ b/src/test/ui/compile-fail-migration/overloaded-calls-nontuple.rs diff --git a/src/test/ui/compile-fail-migration/overloaded-calls-nontuple.stderr b/src/test/ui/compile-fail-migration/overloaded-calls-nontuple.stderr new file mode 100644 index 00000000000..78b86889553 --- /dev/null +++ b/src/test/ui/compile-fail-migration/overloaded-calls-nontuple.stderr @@ -0,0 +1,9 @@ +error[E0059]: cannot use call notation; the first type parameter for the function trait is neither a tuple nor unit + --> $DIR/overloaded-calls-nontuple.rs:36:10 + | +LL | drop(s(3)) //~ ERROR cannot use call notation + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0059`. diff --git a/src/test/compile-fail/packed-struct-generic-transmute.rs b/src/test/ui/compile-fail-migration/packed-struct-generic-transmute.rs index c96184d5988..c96184d5988 100644 --- a/src/test/compile-fail/packed-struct-generic-transmute.rs +++ b/src/test/ui/compile-fail-migration/packed-struct-generic-transmute.rs diff --git a/src/test/ui/compile-fail-migration/packed-struct-generic-transmute.stderr b/src/test/ui/compile-fail-migration/packed-struct-generic-transmute.stderr new file mode 100644 index 00000000000..397b1ddba71 --- /dev/null +++ b/src/test/ui/compile-fail-migration/packed-struct-generic-transmute.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/packed-struct-generic-transmute.rs:34:38 + | +LL | let oof: Oof<[u8; 5], i32> = mem::transmute(foo); + | ^^^^^^^^^^^^^^ + | + = note: source type: Foo<[u8; 5], i32> (72 bits) + = note: target type: Oof<[u8; 5], i32> (96 bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/compile-fail/packed-struct-transmute.rs b/src/test/ui/compile-fail-migration/packed-struct-transmute.rs index abb02dd39e6..abb02dd39e6 100644 --- a/src/test/compile-fail/packed-struct-transmute.rs +++ b/src/test/ui/compile-fail-migration/packed-struct-transmute.rs diff --git a/src/test/ui/compile-fail-migration/packed-struct-transmute.stderr b/src/test/ui/compile-fail-migration/packed-struct-transmute.stderr new file mode 100644 index 00000000000..6158dea524e --- /dev/null +++ b/src/test/ui/compile-fail-migration/packed-struct-transmute.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/packed-struct-transmute.rs:35:24 + | +LL | let oof: Oof = mem::transmute(foo); + | ^^^^^^^^^^^^^^ + | + = note: source type: Foo (72 bits) + = note: target type: Oof (128 bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/compile-fail/panic-implementation-bad-signature-1.rs b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-1.rs index fec11fdbd7b..fec11fdbd7b 100644 --- a/src/test/compile-fail/panic-implementation-bad-signature-1.rs +++ b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-1.rs diff --git a/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-1.stderr b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-1.stderr new file mode 100644 index 00000000000..0e020fbc78b --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-1.stderr @@ -0,0 +1,14 @@ +error: return type should be `!` + --> $DIR/panic-implementation-bad-signature-1.rs:22:6 + | +LL | ) -> () //~ ERROR return type should be `!` + | ^^ + +error: argument should be `&PanicInfo` + --> $DIR/panic-implementation-bad-signature-1.rs:21:11 + | +LL | info: PanicInfo, //~ ERROR argument should be `&PanicInfo` + | ^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/panic-implementation-bad-signature-2.rs b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-2.rs index 2a628c05699..2a628c05699 100644 --- a/src/test/compile-fail/panic-implementation-bad-signature-2.rs +++ b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-2.rs diff --git a/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-2.stderr b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-2.stderr new file mode 100644 index 00000000000..71ed1efdcf2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-2.stderr @@ -0,0 +1,8 @@ +error: argument should be `&PanicInfo` + --> $DIR/panic-implementation-bad-signature-2.rs:21:11 + | +LL | info: &'static PanicInfo, //~ ERROR argument should be `&PanicInfo` + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-implementation-bad-signature-3.rs b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-3.rs index 29337025b70..29337025b70 100644 --- a/src/test/compile-fail/panic-implementation-bad-signature-3.rs +++ b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-3.rs diff --git a/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-3.stderr b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-3.stderr new file mode 100644 index 00000000000..3fd29bcd3e9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-3.stderr @@ -0,0 +1,10 @@ +error: function should have one argument + --> $DIR/panic-implementation-bad-signature-3.rs:20:1 + | +LL | / fn panic() -> ! { //~ ERROR function should have one argument +LL | | loop {} +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-implementation-bad-signature-4.rs b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-4.rs index d5f942ba2d6..d5f942ba2d6 100644 --- a/src/test/compile-fail/panic-implementation-bad-signature-4.rs +++ b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-4.rs diff --git a/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-4.stderr b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-4.stderr new file mode 100644 index 00000000000..362be2fc3b9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-implementation-bad-signature-4.stderr @@ -0,0 +1,11 @@ +error: `#[panic_implementation]` function should have no type parameters + --> $DIR/panic-implementation-bad-signature-4.rs:20:1 + | +LL | / fn panic<T>(pi: &PanicInfo) -> ! { +LL | | //~^ ERROR `#[panic_implementation]` function should have no type parameters +LL | | loop {} +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-implementation-duplicate.rs b/src/test/ui/compile-fail-migration/panic-implementation-duplicate.rs index 017113af409..017113af409 100644 --- a/src/test/compile-fail/panic-implementation-duplicate.rs +++ b/src/test/ui/compile-fail-migration/panic-implementation-duplicate.rs diff --git a/src/test/ui/compile-fail-migration/panic-implementation-duplicate.stderr b/src/test/ui/compile-fail-migration/panic-implementation-duplicate.stderr new file mode 100644 index 00000000000..d553c02379c --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-implementation-duplicate.stderr @@ -0,0 +1,19 @@ +error[E0152]: duplicate lang item found: `panic_impl`. + --> $DIR/panic-implementation-duplicate.rs:26:1 + | +LL | / fn panic2(info: &PanicInfo) -> ! { //~ ERROR duplicate lang item found: `panic_impl`. +LL | | loop {} +LL | | } + | |_^ + | +note: first defined here. + --> $DIR/panic-implementation-duplicate.rs:21:1 + | +LL | / fn panic(info: &PanicInfo) -> ! { +LL | | loop {} +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0152`. diff --git a/src/test/compile-fail/panic-implementation-missing.rs b/src/test/ui/compile-fail-migration/panic-implementation-missing.rs index b11081a3e3b..b11081a3e3b 100644 --- a/src/test/compile-fail/panic-implementation-missing.rs +++ b/src/test/ui/compile-fail-migration/panic-implementation-missing.rs diff --git a/src/test/ui/compile-fail-migration/panic-implementation-missing.stderr b/src/test/ui/compile-fail-migration/panic-implementation-missing.stderr new file mode 100644 index 00000000000..e813338dcc0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-implementation-missing.stderr @@ -0,0 +1,4 @@ +error: `#[panic_implementation]` function required, but not found + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-implementation-requires-panic-info.rs b/src/test/ui/compile-fail-migration/panic-implementation-requires-panic-info.rs index 597f44d9832..597f44d9832 100644 --- a/src/test/compile-fail/panic-implementation-requires-panic-info.rs +++ b/src/test/ui/compile-fail-migration/panic-implementation-requires-panic-info.rs diff --git a/src/test/ui/compile-fail-migration/panic-implementation-requires-panic-info.stderr b/src/test/ui/compile-fail-migration/panic-implementation-requires-panic-info.stderr new file mode 100644 index 00000000000..2bae12efbde --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-implementation-requires-panic-info.stderr @@ -0,0 +1,4 @@ +error: language item required, but not found: `panic_info` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-implementation-std.rs b/src/test/ui/compile-fail-migration/panic-implementation-std.rs index f25cd3605c1..f25cd3605c1 100644 --- a/src/test/compile-fail/panic-implementation-std.rs +++ b/src/test/ui/compile-fail-migration/panic-implementation-std.rs diff --git a/src/test/ui/compile-fail-migration/panic-implementation-std.stderr b/src/test/ui/compile-fail-migration/panic-implementation-std.stderr new file mode 100644 index 00000000000..5016d502cee --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-implementation-std.stderr @@ -0,0 +1,13 @@ +error[E0152]: duplicate lang item found: `panic_impl`. + --> $DIR/panic-implementation-std.rs:18:1 + | +LL | / fn panic(info: PanicInfo) -> ! { +LL | | loop {} +LL | | } + | |_^ + | + = note: first defined in crate `std`. + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0152`. diff --git a/src/test/compile-fail/panic-implementation-twice.rs b/src/test/ui/compile-fail-migration/panic-implementation-twice.rs index 78dc545c036..78dc545c036 100644 --- a/src/test/compile-fail/panic-implementation-twice.rs +++ b/src/test/ui/compile-fail-migration/panic-implementation-twice.rs diff --git a/src/test/ui/compile-fail-migration/panic-implementation-twice.stderr b/src/test/ui/compile-fail-migration/panic-implementation-twice.stderr new file mode 100644 index 00000000000..3cb6ebeb59a --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-implementation-twice.stderr @@ -0,0 +1,14 @@ +error[E0152]: duplicate lang item found: `panic_impl`. + --> $DIR/panic-implementation-twice.rs:23:1 + | +LL | / fn panic(info: &PanicInfo) -> ! { +LL | | //~^ error duplicate lang item found: `panic_impl` +LL | | loop {} +LL | | } + | |_^ + | + = note: first defined in crate `some_panic_impl`. + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0152`. diff --git a/src/test/compile-fail/panic-runtime/abort-link-to-unwind-dylib.rs b/src/test/ui/compile-fail-migration/panic-runtime/abort-link-to-unwind-dylib.rs index f392ccd7676..f392ccd7676 100644 --- a/src/test/compile-fail/panic-runtime/abort-link-to-unwind-dylib.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/abort-link-to-unwind-dylib.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/abort-link-to-unwind-dylib.stderr b/src/test/ui/compile-fail-migration/panic-runtime/abort-link-to-unwind-dylib.stderr new file mode 100644 index 00000000000..704b81ae1ce --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/abort-link-to-unwind-dylib.stderr @@ -0,0 +1,4 @@ +error: the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-runtime/auxiliary/depends.rs b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/depends.rs index b90dec9281b..b90dec9281b 100644 --- a/src/test/compile-fail/panic-runtime/auxiliary/depends.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/depends.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/needs-panic-runtime.rs b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/needs-panic-runtime.rs index d6c21fecf6b..d6c21fecf6b 100644 --- a/src/test/compile-fail/panic-runtime/auxiliary/needs-panic-runtime.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/needs-panic-runtime.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-abort.rs b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/panic-runtime-abort.rs index 3b74156b6b0..3b74156b6b0 100644 --- a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-abort.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/panic-runtime-abort.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-lang-items.rs b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/panic-runtime-lang-items.rs index d9848a554ab..d9848a554ab 100644 --- a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-lang-items.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/panic-runtime-lang-items.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-unwind.rs b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/panic-runtime-unwind.rs index 4bb36839d98..4bb36839d98 100644 --- a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-unwind.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/panic-runtime-unwind.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-unwind2.rs b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/panic-runtime-unwind2.rs index 4bb36839d98..4bb36839d98 100644 --- a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-unwind2.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/panic-runtime-unwind2.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/wants-panic-runtime-abort.rs b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/wants-panic-runtime-abort.rs index e1902e44a60..e1902e44a60 100644 --- a/src/test/compile-fail/panic-runtime/auxiliary/wants-panic-runtime-abort.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/wants-panic-runtime-abort.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs index 2183338b249..2183338b249 100644 --- a/src/test/compile-fail/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs diff --git a/src/test/compile-fail/panic-runtime/bad-panic-flag1.rs b/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag1.rs index f067b6b8349..f067b6b8349 100644 --- a/src/test/compile-fail/panic-runtime/bad-panic-flag1.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag1.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag1.stderr b/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag1.stderr new file mode 100644 index 00000000000..3a65419c98f --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag1.stderr @@ -0,0 +1,2 @@ +error: incorrect value `foo` for codegen option `panic` - either `panic` or `abort` was expected + diff --git a/src/test/compile-fail/panic-runtime/bad-panic-flag2.rs b/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag2.rs index 0ecf65f080f..0ecf65f080f 100644 --- a/src/test/compile-fail/panic-runtime/bad-panic-flag2.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag2.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag2.stderr b/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag2.stderr new file mode 100644 index 00000000000..8d919e55c90 --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/bad-panic-flag2.stderr @@ -0,0 +1,2 @@ +error: codegen option `panic` requires either `panic` or `abort` (C panic=<value>) + diff --git a/src/test/compile-fail/panic-runtime/libtest-unwinds.rs b/src/test/ui/compile-fail-migration/panic-runtime/libtest-unwinds.rs index 71751034c39..71751034c39 100644 --- a/src/test/compile-fail/panic-runtime/libtest-unwinds.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/libtest-unwinds.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/libtest-unwinds.stderr b/src/test/ui/compile-fail-migration/panic-runtime/libtest-unwinds.stderr new file mode 100644 index 00000000000..704b81ae1ce --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/libtest-unwinds.stderr @@ -0,0 +1,4 @@ +error: the linked panic runtime `panic_unwind` is not compiled with this crate's panic strategy `abort` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-runtime/needs-gate.rs b/src/test/ui/compile-fail-migration/panic-runtime/needs-gate.rs index 1b3b978c408..1b3b978c408 100644 --- a/src/test/compile-fail/panic-runtime/needs-gate.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/needs-gate.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/needs-gate.stderr b/src/test/ui/compile-fail-migration/panic-runtime/needs-gate.stderr new file mode 100644 index 00000000000..aa2b97556dc --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/needs-gate.stderr @@ -0,0 +1,19 @@ +error[E0658]: the `#[panic_runtime]` attribute is an experimental feature (see issue #32837) + --> $DIR/needs-gate.rs:14:1 + | +LL | #![panic_runtime] //~ ERROR: is an experimental feature + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(panic_runtime)] to the crate attributes to enable + +error[E0658]: the `#[needs_panic_runtime]` attribute is an experimental feature (see issue #32837) + --> $DIR/needs-gate.rs:15:1 + | +LL | #![needs_panic_runtime] //~ ERROR: is an experimental feature + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(needs_panic_runtime)] to the crate attributes to enable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/panic-runtime/runtime-depend-on-needs-runtime.rs b/src/test/ui/compile-fail-migration/panic-runtime/runtime-depend-on-needs-runtime.rs index 7cfdacbd983..7cfdacbd983 100644 --- a/src/test/compile-fail/panic-runtime/runtime-depend-on-needs-runtime.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/runtime-depend-on-needs-runtime.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/runtime-depend-on-needs-runtime.stderr b/src/test/ui/compile-fail-migration/panic-runtime/runtime-depend-on-needs-runtime.stderr new file mode 100644 index 00000000000..0e68c9b806d --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/runtime-depend-on-needs-runtime.stderr @@ -0,0 +1,9 @@ +error: the crate `depends` cannot depend on a crate that needs a panic runtime, but it depends on `needs_panic_runtime` + +error[E0601]: `main` function not found in crate `runtime_depend_on_needs_runtime` + | + = note: consider adding a `main` function to `$DIR/runtime-depend-on-needs-runtime.rs` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/compile-fail/panic-runtime/transitive-link-a-bunch.rs b/src/test/ui/compile-fail-migration/panic-runtime/transitive-link-a-bunch.rs index f886aac9a10..f886aac9a10 100644 --- a/src/test/compile-fail/panic-runtime/transitive-link-a-bunch.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/transitive-link-a-bunch.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/transitive-link-a-bunch.stderr b/src/test/ui/compile-fail-migration/panic-runtime/transitive-link-a-bunch.stderr new file mode 100644 index 00000000000..4af754c81f9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/transitive-link-a-bunch.stderr @@ -0,0 +1,10 @@ +error: cannot link together two panic runtimes: panic_runtime_unwind and panic_runtime_abort + +error: the linked panic runtime `panic_runtime_abort` is not compiled with this crate's panic strategy `unwind` + +error: the crate `wants_panic_runtime_abort` is compiled with the panic strategy `abort` which is incompatible with this crate's strategy of `unwind` + +error: the crate `panic_runtime_abort` is compiled with the panic strategy `abort` which is incompatible with this crate's strategy of `unwind` + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/panic-runtime/two-panic-runtimes.rs b/src/test/ui/compile-fail-migration/panic-runtime/two-panic-runtimes.rs index 0fe0da2fa2c..0fe0da2fa2c 100644 --- a/src/test/compile-fail/panic-runtime/two-panic-runtimes.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/two-panic-runtimes.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/two-panic-runtimes.stderr b/src/test/ui/compile-fail-migration/panic-runtime/two-panic-runtimes.stderr new file mode 100644 index 00000000000..0c81a103049 --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/two-panic-runtimes.stderr @@ -0,0 +1,4 @@ +error: cannot link together two panic runtimes: panic_runtime_unwind and panic_runtime_unwind2 + +error: aborting due to previous error + diff --git a/src/test/compile-fail/panic-runtime/want-abort-got-unwind.rs b/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind.rs index b178006411b..b178006411b 100644 --- a/src/test/compile-fail/panic-runtime/want-abort-got-unwind.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind.stderr b/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind.stderr new file mode 100644 index 00000000000..69064b75ac5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind.stderr @@ -0,0 +1,6 @@ +error: cannot link together two panic runtimes: panic_unwind and panic_runtime_unwind + +error: the linked panic runtime `panic_runtime_unwind` is not compiled with this crate's panic strategy `abort` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/panic-runtime/want-abort-got-unwind2.rs b/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind2.rs index de8e010c3cb..de8e010c3cb 100644 --- a/src/test/compile-fail/panic-runtime/want-abort-got-unwind2.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind2.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind2.stderr b/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind2.stderr new file mode 100644 index 00000000000..69064b75ac5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/want-abort-got-unwind2.stderr @@ -0,0 +1,6 @@ +error: cannot link together two panic runtimes: panic_unwind and panic_runtime_unwind + +error: the linked panic runtime `panic_runtime_unwind` is not compiled with this crate's panic strategy `abort` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/panic-runtime/want-unwind-got-abort.rs b/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort.rs index dda92d9a560..dda92d9a560 100644 --- a/src/test/compile-fail/panic-runtime/want-unwind-got-abort.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort.stderr b/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort.stderr new file mode 100644 index 00000000000..d4fd2cca81f --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort.stderr @@ -0,0 +1,6 @@ +error: the linked panic runtime `panic_runtime_abort` is not compiled with this crate's panic strategy `unwind` + +error: the crate `panic_runtime_abort` is compiled with the panic strategy `abort` which is incompatible with this crate's strategy of `unwind` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/panic-runtime/want-unwind-got-abort2.rs b/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort2.rs index 49f719057d2..49f719057d2 100644 --- a/src/test/compile-fail/panic-runtime/want-unwind-got-abort2.rs +++ b/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort2.rs diff --git a/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort2.stderr b/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort2.stderr new file mode 100644 index 00000000000..364a27a24eb --- /dev/null +++ b/src/test/ui/compile-fail-migration/panic-runtime/want-unwind-got-abort2.stderr @@ -0,0 +1,8 @@ +error: the linked panic runtime `panic_runtime_abort` is not compiled with this crate's panic strategy `unwind` + +error: the crate `wants_panic_runtime_abort` is compiled with the panic strategy `abort` which is incompatible with this crate's strategy of `unwind` + +error: the crate `panic_runtime_abort` is compiled with the panic strategy `abort` which is incompatible with this crate's strategy of `unwind` + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/panic_implementation-closures.rs b/src/test/ui/compile-fail-migration/panic_implementation-closures.rs index 4fa9a639928..4fa9a639928 100644 --- a/src/test/compile-fail/panic_implementation-closures.rs +++ b/src/test/ui/compile-fail-migration/panic_implementation-closures.rs diff --git a/src/test/compile-fail/paren-span.rs b/src/test/ui/compile-fail-migration/paren-span.rs index 8ed5050f3de..8ed5050f3de 100644 --- a/src/test/compile-fail/paren-span.rs +++ b/src/test/ui/compile-fail-migration/paren-span.rs diff --git a/src/test/ui/compile-fail-migration/paren-span.stderr b/src/test/ui/compile-fail-migration/paren-span.stderr new file mode 100644 index 00000000000..df6881a1af3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/paren-span.stderr @@ -0,0 +1,9 @@ +error[E0616]: field `x` of struct `m::S` is private + --> $DIR/paren-span.rs:29:12 + | +LL | paren!(s.x); //~ ERROR field `x` of struct `m::S` is private + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0616`. diff --git a/src/test/compile-fail/parse-error-correct.rs b/src/test/ui/compile-fail-migration/parse-error-correct.rs index bc7c333723d..bc7c333723d 100644 --- a/src/test/compile-fail/parse-error-correct.rs +++ b/src/test/ui/compile-fail-migration/parse-error-correct.rs diff --git a/src/test/ui/compile-fail-migration/parse-error-correct.stderr b/src/test/ui/compile-fail-migration/parse-error-correct.stderr new file mode 100644 index 00000000000..3eb0b19a6aa --- /dev/null +++ b/src/test/ui/compile-fail-migration/parse-error-correct.stderr @@ -0,0 +1,31 @@ +error: unexpected token: `;` + --> $DIR/parse-error-correct.rs:18:15 + | +LL | let x = y.; //~ ERROR unexpected token + | ^ + +error: unexpected token: `(` + --> $DIR/parse-error-correct.rs:19:15 + | +LL | let x = y.(); //~ ERROR unexpected token + | ^ + +error[E0618]: expected function, found `{integer}` + --> $DIR/parse-error-correct.rs:19:13 + | +LL | let y = 42; + | - `{integer}` defined here +LL | let x = y.; //~ ERROR unexpected token +LL | let x = y.(); //~ ERROR unexpected token + | ^^^^ not a function + +error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields + --> $DIR/parse-error-correct.rs:21:15 + | +LL | let x = y.foo; //~ ERROR `{integer}` is a primitive type and therefore doesn't have fields [E061 + | ^^^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0610, E0618. +For more information about an error, try `rustc --explain E0610`. diff --git a/src/test/compile-fail/parser-recovery-1.rs b/src/test/ui/compile-fail-migration/parser-recovery-1.rs index 9fb4d6facdd..9fb4d6facdd 100644 --- a/src/test/compile-fail/parser-recovery-1.rs +++ b/src/test/ui/compile-fail-migration/parser-recovery-1.rs diff --git a/src/test/ui/compile-fail-migration/parser-recovery-1.stderr b/src/test/ui/compile-fail-migration/parser-recovery-1.stderr new file mode 100644 index 00000000000..bf4070682fb --- /dev/null +++ b/src/test/ui/compile-fail-migration/parser-recovery-1.stderr @@ -0,0 +1,38 @@ +error: this file contains an un-closed delimiter + --> $DIR/parser-recovery-1.rs:24:55 + | +LL | } //~ ERROR this file contains an un-closed delimiter + | ^ + | +help: did you mean to close this delimiter? + --> $DIR/parser-recovery-1.rs:15:11 + | +LL | trait Foo { + | ^ + +error: unexpected token: `;` + --> $DIR/parser-recovery-1.rs:22:15 + | +LL | let x = y.; //~ ERROR unexpected token + | ^ + +error[E0425]: cannot find function `foo` in this scope + --> $DIR/parser-recovery-1.rs:17:17 + | +LL | let x = foo(); //~ ERROR cannot find function `foo` in this scope + | ^^^ not found in this scope + +error[E0425]: cannot find value `y` in this scope + --> $DIR/parser-recovery-1.rs:22:13 + | +LL | let x = y.; //~ ERROR unexpected token + | ^ not found in this scope + +error[E0601]: `main` function not found in crate `parser_recovery_1` + | + = note: consider adding a `main` function to `$DIR/parser-recovery-1.rs` + +error: aborting due to 5 previous errors + +Some errors occurred: E0425, E0601. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/parser-recovery-2.rs b/src/test/ui/compile-fail-migration/parser-recovery-2.rs index 03b1a9b876f..03b1a9b876f 100644 --- a/src/test/compile-fail/parser-recovery-2.rs +++ b/src/test/ui/compile-fail-migration/parser-recovery-2.rs diff --git a/src/test/ui/compile-fail-migration/parser-recovery-2.stderr b/src/test/ui/compile-fail-migration/parser-recovery-2.stderr new file mode 100644 index 00000000000..7b520607352 --- /dev/null +++ b/src/test/ui/compile-fail-migration/parser-recovery-2.stderr @@ -0,0 +1,33 @@ +error: incorrect close delimiter: `)` + --> $DIR/parser-recovery-2.rs:18:5 + | +LL | ) //~ ERROR incorrect close delimiter: `)` + | ^ + | +note: unclosed delimiter + --> $DIR/parser-recovery-2.rs:16:14 + | +LL | fn bar() { + | ^ + +error: unexpected token: `;` + --> $DIR/parser-recovery-2.rs:22:15 + | +LL | let x = y.; //~ ERROR unexpected token + | ^ + +error[E0425]: cannot find function `foo` in this scope + --> $DIR/parser-recovery-2.rs:17:17 + | +LL | let x = foo(); //~ ERROR cannot find function `foo` in this scope + | ^^^ not found in this scope + +error[E0425]: cannot find value `y` in this scope + --> $DIR/parser-recovery-2.rs:22:13 + | +LL | let x = y.; //~ ERROR unexpected token + | ^ not found in this scope + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/pat-shadow-in-nested-binding.rs b/src/test/ui/compile-fail-migration/pat-shadow-in-nested-binding.rs index 3dbe08f1908..3dbe08f1908 100644 --- a/src/test/compile-fail/pat-shadow-in-nested-binding.rs +++ b/src/test/ui/compile-fail-migration/pat-shadow-in-nested-binding.rs diff --git a/src/test/ui/compile-fail-migration/pat-shadow-in-nested-binding.stderr b/src/test/ui/compile-fail-migration/pat-shadow-in-nested-binding.stderr new file mode 100644 index 00000000000..9dd6a318e98 --- /dev/null +++ b/src/test/ui/compile-fail-migration/pat-shadow-in-nested-binding.stderr @@ -0,0 +1,12 @@ +error[E0530]: let bindings cannot shadow tuple structs + --> $DIR/pat-shadow-in-nested-binding.rs:14:10 + | +LL | struct foo(usize); + | ------------------ a tuple struct `foo` is defined here +... +LL | let (foo, _) = (2, 3); //~ ERROR let bindings cannot shadow tuple structs + | ^^^ cannot be named the same as a tuple struct + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0530`. diff --git a/src/test/compile-fail/pat-tuple-bad-type.rs b/src/test/ui/compile-fail-migration/pat-tuple-bad-type.rs index 251e7b47dcc..251e7b47dcc 100644 --- a/src/test/compile-fail/pat-tuple-bad-type.rs +++ b/src/test/ui/compile-fail-migration/pat-tuple-bad-type.rs diff --git a/src/test/ui/compile-fail-migration/pat-tuple-bad-type.stderr b/src/test/ui/compile-fail-migration/pat-tuple-bad-type.stderr new file mode 100644 index 00000000000..d4f80550b3e --- /dev/null +++ b/src/test/ui/compile-fail-migration/pat-tuple-bad-type.stderr @@ -0,0 +1,24 @@ +error[E0282]: type annotations needed + --> $DIR/pat-tuple-bad-type.rs:15:9 + | +LL | let x; + | - consider giving `x` a type +... +LL | (..) => {} //~ ERROR type annotations needed + | ^^^^ cannot infer type + | + = note: type must be known at this point + +error[E0308]: mismatched types + --> $DIR/pat-tuple-bad-type.rs:20:9 + | +LL | (..) => {} //~ ERROR mismatched types + | ^^^^ expected u8, found () + | + = note: expected type `u8` + found type `()` + +error: aborting due to 2 previous errors + +Some errors occurred: E0282, E0308. +For more information about an error, try `rustc --explain E0282`. diff --git a/src/test/compile-fail/pat-tuple-overfield.rs b/src/test/ui/compile-fail-migration/pat-tuple-overfield.rs index 851fa5c5be6..851fa5c5be6 100644 --- a/src/test/compile-fail/pat-tuple-overfield.rs +++ b/src/test/ui/compile-fail-migration/pat-tuple-overfield.rs diff --git a/src/test/ui/compile-fail-migration/pat-tuple-overfield.stderr b/src/test/ui/compile-fail-migration/pat-tuple-overfield.stderr new file mode 100644 index 00000000000..2802b42f313 --- /dev/null +++ b/src/test/ui/compile-fail-migration/pat-tuple-overfield.stderr @@ -0,0 +1,34 @@ +error[E0308]: mismatched types + --> $DIR/pat-tuple-overfield.rs:15:9 + | +LL | (1, 2, 3, 4) => {} //~ ERROR mismatched types + | ^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements + | + = note: expected type `({integer}, {integer}, {integer})` + found type `(_, _, _, _)` + +error[E0308]: mismatched types + --> $DIR/pat-tuple-overfield.rs:16:9 + | +LL | (1, 2, .., 3, 4) => {} //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements + | + = note: expected type `({integer}, {integer}, {integer})` + found type `(_, _, _, _)` + +error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields + --> $DIR/pat-tuple-overfield.rs:20:9 + | +LL | S(1, 2, 3, 4) => {} + | ^^^^^^^^^^^^^ expected 3 fields, found 4 + +error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields + --> $DIR/pat-tuple-overfield.rs:22:9 + | +LL | S(1, 2, .., 3, 4) => {} + | ^^^^^^^^^^^^^^^^^ expected 3 fields, found 4 + +error: aborting due to 4 previous errors + +Some errors occurred: E0023, E0308. +For more information about an error, try `rustc --explain E0023`. diff --git a/src/test/compile-fail/patkind-litrange-no-expr.rs b/src/test/ui/compile-fail-migration/patkind-litrange-no-expr.rs index 8fef98f815f..8fef98f815f 100644 --- a/src/test/compile-fail/patkind-litrange-no-expr.rs +++ b/src/test/ui/compile-fail-migration/patkind-litrange-no-expr.rs diff --git a/src/test/ui/compile-fail-migration/patkind-litrange-no-expr.stderr b/src/test/ui/compile-fail-migration/patkind-litrange-no-expr.stderr new file mode 100644 index 00000000000..f22870fb029 --- /dev/null +++ b/src/test/ui/compile-fail-migration/patkind-litrange-no-expr.stderr @@ -0,0 +1,18 @@ +error: arbitrary expressions aren't allowed in patterns + --> $DIR/patkind-litrange-no-expr.rs:30:13 + | +LL | Arith = 1 + 1, //~ ERROR arbitrary expressions aren't allowed in patterns + | ^^^^^ + +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/patkind-litrange-no-expr.rs:30:13 + | +LL | Arith = 1 + 1, //~ ERROR arbitrary expressions aren't allowed in patterns + | ^^^^^ ranges require char or numeric types + | + = note: start type: {integer} + = note: end type: {integer} + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0029`. diff --git a/src/test/compile-fail/pattern-binding-disambiguation.rs b/src/test/ui/compile-fail-migration/pattern-binding-disambiguation.rs index c740f6bb47c..c740f6bb47c 100644 --- a/src/test/compile-fail/pattern-binding-disambiguation.rs +++ b/src/test/ui/compile-fail-migration/pattern-binding-disambiguation.rs diff --git a/src/test/ui/compile-fail-migration/pattern-binding-disambiguation.stderr b/src/test/ui/compile-fail-migration/pattern-binding-disambiguation.stderr new file mode 100644 index 00000000000..7acdb07e10d --- /dev/null +++ b/src/test/ui/compile-fail-migration/pattern-binding-disambiguation.stderr @@ -0,0 +1,75 @@ +error[E0530]: match bindings cannot shadow tuple structs + --> $DIR/pattern-binding-disambiguation.rs:34:9 + | +LL | struct TupleStruct(); + | --------------------- a tuple struct `TupleStruct` is defined here +... +LL | TupleStruct => {} //~ ERROR match bindings cannot shadow tuple structs + | ^^^^^^^^^^^ cannot be named the same as a tuple struct + +error[E0530]: match bindings cannot shadow tuple variants + --> $DIR/pattern-binding-disambiguation.rs:43:9 + | +LL | use E::*; + | ---- a tuple variant `TupleVariant` is imported here +... +LL | TupleVariant => {} //~ ERROR match bindings cannot shadow tuple variants + | ^^^^^^^^^^^^ cannot be named the same as a tuple variant + +error[E0530]: match bindings cannot shadow struct variants + --> $DIR/pattern-binding-disambiguation.rs:46:9 + | +LL | use E::*; + | ---- a struct variant `BracedVariant` is imported here +... +LL | BracedVariant => {} //~ ERROR match bindings cannot shadow struct variants + | ^^^^^^^^^^^^^ cannot be named the same as a struct variant + +error[E0530]: match bindings cannot shadow statics + --> $DIR/pattern-binding-disambiguation.rs:52:9 + | +LL | static STATIC: () = (); + | ----------------------- a static `STATIC` is defined here +... +LL | STATIC => {} //~ ERROR match bindings cannot shadow statics + | ^^^^^^ cannot be named the same as a static + +error[E0530]: let bindings cannot shadow tuple structs + --> $DIR/pattern-binding-disambiguation.rs:59:9 + | +LL | struct TupleStruct(); + | --------------------- a tuple struct `TupleStruct` is defined here +... +LL | let TupleStruct = doesnt_matter; //~ ERROR let bindings cannot shadow tuple structs + | ^^^^^^^^^^^ cannot be named the same as a tuple struct + +error[E0530]: let bindings cannot shadow tuple variants + --> $DIR/pattern-binding-disambiguation.rs:62:9 + | +LL | use E::*; + | ---- a tuple variant `TupleVariant` is imported here +... +LL | let TupleVariant = doesnt_matter; //~ ERROR let bindings cannot shadow tuple variants + | ^^^^^^^^^^^^ cannot be named the same as a tuple variant + +error[E0530]: let bindings cannot shadow struct variants + --> $DIR/pattern-binding-disambiguation.rs:63:9 + | +LL | use E::*; + | ---- a struct variant `BracedVariant` is imported here +... +LL | let BracedVariant = doesnt_matter; //~ ERROR let bindings cannot shadow struct variants + | ^^^^^^^^^^^^^ cannot be named the same as a struct variant + +error[E0530]: let bindings cannot shadow statics + --> $DIR/pattern-binding-disambiguation.rs:65:9 + | +LL | static STATIC: () = (); + | ----------------------- a static `STATIC` is defined here +... +LL | let STATIC = doesnt_matter; //~ ERROR let bindings cannot shadow statics + | ^^^^^^ cannot be named the same as a static + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0530`. diff --git a/src/test/compile-fail/pattern-bindings-after-at.rs b/src/test/ui/compile-fail-migration/pattern-bindings-after-at.rs index da2a97b0ca8..da2a97b0ca8 100644 --- a/src/test/compile-fail/pattern-bindings-after-at.rs +++ b/src/test/ui/compile-fail-migration/pattern-bindings-after-at.rs diff --git a/src/test/ui/compile-fail-migration/pattern-bindings-after-at.stderr b/src/test/ui/compile-fail-migration/pattern-bindings-after-at.stderr new file mode 100644 index 00000000000..8c715001baa --- /dev/null +++ b/src/test/ui/compile-fail-migration/pattern-bindings-after-at.stderr @@ -0,0 +1,9 @@ +error[E0303]: pattern bindings are not allowed after an `@` + --> $DIR/pattern-bindings-after-at.rs:18:31 + | +LL | ref mut z @ &mut Some(ref a) => { + | ^^^^^ not allowed after `@` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0303`. diff --git a/src/test/compile-fail/pattern-error-continue.rs b/src/test/ui/compile-fail-migration/pattern-error-continue.rs index e63b84594aa..e63b84594aa 100644 --- a/src/test/compile-fail/pattern-error-continue.rs +++ b/src/test/ui/compile-fail-migration/pattern-error-continue.rs diff --git a/src/test/ui/compile-fail-migration/pattern-error-continue.stderr b/src/test/ui/compile-fail-migration/pattern-error-continue.stderr new file mode 100644 index 00000000000..b24366c48bc --- /dev/null +++ b/src/test/ui/compile-fail-migration/pattern-error-continue.stderr @@ -0,0 +1,39 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `E` + --> $DIR/pattern-error-continue.rs:45:9 + | +LL | E::V => {} //~ ERROR failed to resolve. Use of undeclared type or module `E` + | ^ Use of undeclared type or module `E` + +error[E0532]: expected tuple struct/variant, found unit variant `A::D` + --> $DIR/pattern-error-continue.rs:28:9 + | +LL | A::D(_) => (), //~ ERROR expected tuple struct/variant, found unit variant `A::D` + | ^^^- + | | + | did you mean `B`? + +error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields + --> $DIR/pattern-error-continue.rs:27:9 + | +LL | A::B(_, _, _) => (), //~ ERROR this pattern has 3 fields, but + | ^^^^^^^^^^^^^ expected 2 fields, found 3 + +error[E0308]: mismatched types + --> $DIR/pattern-error-continue.rs:32:9 + | +LL | S { .. } => (), + | ^^^^^^^^ expected char, found struct `S` + | + = note: expected type `char` + found type `S` + +error[E0308]: mismatched types + --> $DIR/pattern-error-continue.rs:40:7 + | +LL | f(true); + | ^^^^ expected char, found bool + +error: aborting due to 5 previous errors + +Some errors occurred: E0023, E0308, E0433, E0532. +For more information about an error, try `rustc --explain E0023`. diff --git a/src/test/compile-fail/pattern-ident-path-generics.rs b/src/test/ui/compile-fail-migration/pattern-ident-path-generics.rs index 0b7886842b4..0b7886842b4 100644 --- a/src/test/compile-fail/pattern-ident-path-generics.rs +++ b/src/test/ui/compile-fail-migration/pattern-ident-path-generics.rs diff --git a/src/test/ui/compile-fail-migration/pattern-ident-path-generics.stderr b/src/test/ui/compile-fail-migration/pattern-ident-path-generics.stderr new file mode 100644 index 00000000000..cd205956571 --- /dev/null +++ b/src/test/ui/compile-fail-migration/pattern-ident-path-generics.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/pattern-ident-path-generics.rs:13:9 + | +LL | None::<isize> => {} //~ ERROR mismatched types + | ^^^^^^^^^^^^^ expected &str, found isize + | + = note: expected type `std::option::Option<&str>` + found type `std::option::Option<isize>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/pattern-tyvar-2.rs b/src/test/ui/compile-fail-migration/pattern-tyvar-2.rs index cd4a98835c8..cd4a98835c8 100644 --- a/src/test/compile-fail/pattern-tyvar-2.rs +++ b/src/test/ui/compile-fail-migration/pattern-tyvar-2.rs diff --git a/src/test/ui/compile-fail-migration/pattern-tyvar-2.stderr b/src/test/ui/compile-fail-migration/pattern-tyvar-2.stderr new file mode 100644 index 00000000000..fd7ab84cc56 --- /dev/null +++ b/src/test/ui/compile-fail-migration/pattern-tyvar-2.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `*` cannot be applied to type `std::vec::Vec<isize>` + --> $DIR/pattern-tyvar-2.rs:14:69 + | +LL | fn foo(t: bar) -> isize { match t { bar::t1(_, Some(x)) => { return x * 3; } _ => { panic!(); } } } + | ^^^^^ + | + = note: an implementation of `std::ops::Mul` might be missing for `std::vec::Vec<isize>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/pattern-tyvar.rs b/src/test/ui/compile-fail-migration/pattern-tyvar.rs index be8d3e027e7..be8d3e027e7 100644 --- a/src/test/compile-fail/pattern-tyvar.rs +++ b/src/test/ui/compile-fail-migration/pattern-tyvar.rs diff --git a/src/test/ui/compile-fail-migration/pattern-tyvar.stderr b/src/test/ui/compile-fail-migration/pattern-tyvar.stderr new file mode 100644 index 00000000000..55e09e02a1d --- /dev/null +++ b/src/test/ui/compile-fail-migration/pattern-tyvar.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/pattern-tyvar.rs:17:18 + | +LL | bar::t1(_, Some::<isize>(x)) => { + | ^^^^^^^^^^^^^^^^ expected struct `std::vec::Vec`, found isize + | + = note: expected type `std::option::Option<std::vec::Vec<isize>>` + found type `std::option::Option<isize>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/phantom-oibit.rs b/src/test/ui/compile-fail-migration/phantom-oibit.rs index 51e7d5da98f..51e7d5da98f 100644 --- a/src/test/compile-fail/phantom-oibit.rs +++ b/src/test/ui/compile-fail-migration/phantom-oibit.rs diff --git a/src/test/ui/compile-fail-migration/phantom-oibit.stderr b/src/test/ui/compile-fail-migration/phantom-oibit.stderr new file mode 100644 index 00000000000..5156ba94cef --- /dev/null +++ b/src/test/ui/compile-fail-migration/phantom-oibit.stderr @@ -0,0 +1,38 @@ +error[E0277]: `T` cannot be shared between threads safely + --> $DIR/phantom-oibit.rs:31:5 + | +LL | is_zen(x) + | ^^^^^^ `T` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `T` + = help: consider adding a `where T: std::marker::Sync` bound + = note: required because of the requirements on the impl of `Zen` for `&T` + = note: required because it appears within the type `std::marker::PhantomData<&T>` + = note: required because it appears within the type `Guard<'_, T>` +note: required by `is_zen` + --> $DIR/phantom-oibit.rs:28:1 + | +LL | fn is_zen<T: Zen>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `T` cannot be shared between threads safely + --> $DIR/phantom-oibit.rs:36:5 + | +LL | is_zen(x) + | ^^^^^^ `T` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `T` + = help: consider adding a `where T: std::marker::Sync` bound + = note: required because of the requirements on the impl of `Zen` for `&T` + = note: required because it appears within the type `std::marker::PhantomData<&T>` + = note: required because it appears within the type `Guard<'_, T>` + = note: required because it appears within the type `Nested<Guard<'_, T>>` +note: required by `is_zen` + --> $DIR/phantom-oibit.rs:28:1 + | +LL | fn is_zen<T: Zen>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/platform-intrinsic-params.rs b/src/test/ui/compile-fail-migration/platform-intrinsic-params.rs index e8a9031dba8..e8a9031dba8 100644 --- a/src/test/compile-fail/platform-intrinsic-params.rs +++ b/src/test/ui/compile-fail-migration/platform-intrinsic-params.rs diff --git a/src/test/ui/compile-fail-migration/platform-intrinsic-params.stderr b/src/test/ui/compile-fail-migration/platform-intrinsic-params.stderr new file mode 100644 index 00000000000..e41de9fe02d --- /dev/null +++ b/src/test/ui/compile-fail-migration/platform-intrinsic-params.stderr @@ -0,0 +1,9 @@ +error[E0444]: platform-specific intrinsic has invalid number of arguments: found 0, expected 1 + --> $DIR/platform-intrinsic-params.rs:13:5 + | +LL | fn x86_mm_movemask_ps() -> i32; //~ERROR found 0, expected 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0444`. diff --git a/src/test/compile-fail/pptypedef.rs b/src/test/ui/compile-fail-migration/pptypedef.rs index 7ece52e7537..7ece52e7537 100644 --- a/src/test/compile-fail/pptypedef.rs +++ b/src/test/ui/compile-fail-migration/pptypedef.rs diff --git a/src/test/ui/compile-fail-migration/pptypedef.stderr b/src/test/ui/compile-fail-migration/pptypedef.stderr new file mode 100644 index 00000000000..bde48d86ba5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/pptypedef.stderr @@ -0,0 +1,15 @@ +error[E0308]: mismatched types + --> $DIR/pptypedef.rs:14:37 + | +LL | let_in(3u32, |i| { assert!(i == 3i32); }); + | ^^^^ expected u32, found i32 + +error[E0308]: mismatched types + --> $DIR/pptypedef.rs:18:37 + | +LL | let_in(3i32, |i| { assert!(i == 3u32); }); + | ^^^^ expected i32, found u32 + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/prim-with-args.rs b/src/test/ui/compile-fail-migration/prim-with-args.rs index cc0b74dc82a..cc0b74dc82a 100644 --- a/src/test/compile-fail/prim-with-args.rs +++ b/src/test/ui/compile-fail-migration/prim-with-args.rs diff --git a/src/test/ui/compile-fail-migration/prim-with-args.stderr b/src/test/ui/compile-fail-migration/prim-with-args.stderr new file mode 100644 index 00000000000..bfe7256f8a2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/prim-with-args.stderr @@ -0,0 +1,136 @@ +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:13:14 + | +LL | let x: isize<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:14:11 + | +LL | let x: i8<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:15:12 + | +LL | let x: i16<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:16:12 + | +LL | let x: i32<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:17:12 + | +LL | let x: i64<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:18:14 + | +LL | let x: usize<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:19:11 + | +LL | let x: u8<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:20:12 + | +LL | let x: u16<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:21:12 + | +LL | let x: u32<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:22:12 + | +LL | let x: u64<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/prim-with-args.rs:23:13 + | +LL | let x: char<isize>; //~ ERROR type parameters are not allowed on this type + | ^^^^^ type parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:25:14 + | +LL | let x: isize<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:26:11 + | +LL | let x: i8<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:27:12 + | +LL | let x: i16<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:28:12 + | +LL | let x: i32<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:29:12 + | +LL | let x: i64<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:30:14 + | +LL | let x: usize<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:31:11 + | +LL | let x: u8<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:32:12 + | +LL | let x: u16<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:33:12 + | +LL | let x: u32<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:34:12 + | +LL | let x: u64<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error[E0110]: lifetime parameters are not allowed on this type + --> $DIR/prim-with-args.rs:35:13 + | +LL | let x: char<'static>; //~ ERROR lifetime parameters are not allowed on this type + | ^^^^^^^ lifetime parameter not allowed + +error: aborting due to 22 previous errors + +Some errors occurred: E0109, E0110. +For more information about an error, try `rustc --explain E0109`. diff --git a/src/test/compile-fail/priv-in-bad-locations.rs b/src/test/ui/compile-fail-migration/priv-in-bad-locations.rs index 8901d8c08e5..8901d8c08e5 100644 --- a/src/test/compile-fail/priv-in-bad-locations.rs +++ b/src/test/ui/compile-fail-migration/priv-in-bad-locations.rs diff --git a/src/test/ui/compile-fail-migration/priv-in-bad-locations.stderr b/src/test/ui/compile-fail-migration/priv-in-bad-locations.stderr new file mode 100644 index 00000000000..e395a2243df --- /dev/null +++ b/src/test/ui/compile-fail-migration/priv-in-bad-locations.stderr @@ -0,0 +1,31 @@ +error[E0449]: unnecessary visibility qualifier + --> $DIR/priv-in-bad-locations.rs:11:1 + | +LL | pub extern { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + | + = note: place qualifiers on individual foreign items instead + +error[E0449]: unnecessary visibility qualifier + --> $DIR/priv-in-bad-locations.rs:21:1 + | +LL | pub impl B {} //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + | + = note: place qualifiers on individual impl items instead + +error[E0449]: unnecessary visibility qualifier + --> $DIR/priv-in-bad-locations.rs:23:1 + | +LL | pub impl A for B { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/priv-in-bad-locations.rs:24:5 + | +LL | pub fn foo(&self) {} //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0449`. diff --git a/src/test/compile-fail/privacy-in-paths.rs b/src/test/ui/compile-fail-migration/privacy-in-paths.rs index 0a8689ea6d6..0a8689ea6d6 100644 --- a/src/test/compile-fail/privacy-in-paths.rs +++ b/src/test/ui/compile-fail-migration/privacy-in-paths.rs diff --git a/src/test/ui/compile-fail-migration/privacy-in-paths.stderr b/src/test/ui/compile-fail-migration/privacy-in-paths.stderr new file mode 100644 index 00000000000..f0aa3d36479 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy-in-paths.stderr @@ -0,0 +1,21 @@ +error[E0603]: module `bar` is private + --> $DIR/privacy-in-paths.rs:34:9 + | +LL | ::foo::bar::baz::f(); //~ERROR module `bar` is private + | ^^^^^^^^^^^^^^^^^^ + +error[E0603]: module `bar` is private + --> $DIR/privacy-in-paths.rs:35:9 + | +LL | ::foo::bar::S::f(); //~ERROR module `bar` is private + | ^^^^^^^^^^^^^^^^ + +error[E0603]: trait `T` is private + --> $DIR/privacy-in-paths.rs:36:9 + | +LL | <() as ::foo::T>::Assoc::f(); //~ERROR trait `T` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/privacy-ns1.rs b/src/test/ui/compile-fail-migration/privacy-ns1.rs index e7e522f99d4..e7e522f99d4 100644 --- a/src/test/compile-fail/privacy-ns1.rs +++ b/src/test/ui/compile-fail-migration/privacy-ns1.rs diff --git a/src/test/ui/compile-fail-migration/privacy-ns1.stderr b/src/test/ui/compile-fail-migration/privacy-ns1.stderr new file mode 100644 index 00000000000..503cfbfaa2d --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy-ns1.stderr @@ -0,0 +1,60 @@ +error[E0423]: expected function, found trait `Bar` + --> $DIR/privacy-ns1.rs:30:5 + | +LL | Bar(); //~ ERROR expected function, found trait `Bar` + | ^^^ did you mean `Baz`? +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use foo1::Bar; + | +LL | use foo2::Bar; + | +LL | use foo3::Bar; + | + +error[E0573]: expected type, found function `Bar` + --> $DIR/privacy-ns1.rs:45:17 + | +LL | let _x: Box<Bar>; //~ ERROR expected type, found function `Bar` + | ^^^ did you mean `Baz`? +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use foo1::Bar; + | +LL | use foo2::Bar; + | +LL | use foo3::Bar; + | + +error[E0425]: cannot find function `Bar` in this scope + --> $DIR/privacy-ns1.rs:60:5 + | +LL | Bar(); //~ ERROR cannot find function `Bar` in this scope + | ^^^ did you mean `Baz`? +help: possible candidates are found in other modules, you can import them into scope + | +LL | use foo1::Bar; + | +LL | use foo2::Bar; + | +LL | use foo3::Bar; + | + +error[E0412]: cannot find type `Bar` in this scope + --> $DIR/privacy-ns1.rs:61:17 + | +LL | let _x: Box<Bar>; //~ ERROR cannot find type `Bar` in this scope + | ^^^ did you mean `Baz`? +help: possible candidates are found in other modules, you can import them into scope + | +LL | use foo1::Bar; + | +LL | use foo2::Bar; + | +LL | use foo3::Bar; + | + +error: aborting due to 4 previous errors + +Some errors occurred: E0412, E0423, E0425, E0573. +For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/compile-fail/privacy-ns2.rs b/src/test/ui/compile-fail-migration/privacy-ns2.rs index ec9396b5e7b..ec9396b5e7b 100644 --- a/src/test/compile-fail/privacy-ns2.rs +++ b/src/test/ui/compile-fail-migration/privacy-ns2.rs diff --git a/src/test/ui/compile-fail-migration/privacy-ns2.stderr b/src/test/ui/compile-fail-migration/privacy-ns2.stderr new file mode 100644 index 00000000000..0cd341d9a58 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy-ns2.stderr @@ -0,0 +1,78 @@ +error[E0423]: expected function, found trait `Bar` + --> $DIR/privacy-ns2.rs:30:5 + | +LL | Bar(); //~ ERROR expected function, found trait `Bar` + | ^^^ not a function +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use foo1::Bar; + | +LL | use foo2::Bar; + | +LL | use foo3::Bar; + | + +error[E0423]: expected function, found trait `Bar` + --> $DIR/privacy-ns2.rs:36:5 + | +LL | Bar(); //~ ERROR expected function, found trait `Bar` + | ^^^ did you mean `Baz`? +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use foo1::Bar; + | +LL | use foo2::Bar; + | +LL | use foo3::Bar; + | + +error[E0573]: expected type, found function `Bar` + --> $DIR/privacy-ns2.rs:51:18 + | +LL | let _x : Box<Bar>; //~ ERROR expected type, found function `Bar` + | ^^^ not a type +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use foo1::Bar; + | +LL | use foo2::Bar; + | +LL | use foo3::Bar; + | + +error[E0573]: expected type, found function `Bar` + --> $DIR/privacy-ns2.rs:57:17 + | +LL | let _x: Box<Bar>; //~ ERROR expected type, found function `Bar` + | ^^^ did you mean `Baz`? +help: possible better candidates are found in other modules, you can import them into scope + | +LL | use foo1::Bar; + | +LL | use foo2::Bar; + | +LL | use foo3::Bar; + | + +error[E0603]: trait `Bar` is private + --> $DIR/privacy-ns2.rs:70:9 + | +LL | use foo3::Bar; //~ ERROR `Bar` is private + | ^^^^^^^^^ + +error[E0603]: trait `Bar` is private + --> $DIR/privacy-ns2.rs:74:9 + | +LL | use foo3::Bar; //~ ERROR `Bar` is private + | ^^^^^^^^^ + +error[E0603]: trait `Bar` is private + --> $DIR/privacy-ns2.rs:81:16 + | +LL | use foo3::{Bar,Baz}; //~ ERROR `Bar` is private + | ^^^ + +error: aborting due to 7 previous errors + +Some errors occurred: E0423, E0573, E0603. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/compile-fail/privacy-sanity.rs b/src/test/ui/compile-fail-migration/privacy-sanity.rs index f245b7cef29..f245b7cef29 100644 --- a/src/test/compile-fail/privacy-sanity.rs +++ b/src/test/ui/compile-fail-migration/privacy-sanity.rs diff --git a/src/test/ui/compile-fail-migration/privacy-sanity.stderr b/src/test/ui/compile-fail-migration/privacy-sanity.stderr new file mode 100644 index 00000000000..fbfa15f8cb0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy-sanity.stderr @@ -0,0 +1,123 @@ +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:23:1 + | +LL | pub impl Tr for S { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:24:5 + | +LL | pub fn f() {} //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:25:5 + | +LL | pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:26:5 + | +LL | pub type T = u8; //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:28:1 + | +LL | pub impl S { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + | + = note: place qualifiers on individual impl items instead + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:33:1 + | +LL | pub extern "C" { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + | + = note: place qualifiers on individual foreign items instead + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:49:5 + | +LL | pub impl Tr for S { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:50:9 + | +LL | pub fn f() {} //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:51:9 + | +LL | pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:52:9 + | +LL | pub type T = u8; //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:54:5 + | +LL | pub impl S { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + | + = note: place qualifiers on individual impl items instead + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:59:5 + | +LL | pub extern "C" { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + | + = note: place qualifiers on individual foreign items instead + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:78:5 + | +LL | pub impl Tr for S { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:79:9 + | +LL | pub fn f() {} //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:80:9 + | +LL | pub const C: u8 = 0; //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:81:9 + | +LL | pub type T = u8; //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:83:5 + | +LL | pub impl S { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + | + = note: place qualifiers on individual impl items instead + +error[E0449]: unnecessary visibility qualifier + --> $DIR/privacy-sanity.rs:88:5 + | +LL | pub extern "C" { //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + | + = note: place qualifiers on individual foreign items instead + +error: aborting due to 18 previous errors + +For more information about this error, try `rustc --explain E0449`. diff --git a/src/test/compile-fail/privacy-ufcs.rs b/src/test/ui/compile-fail-migration/privacy-ufcs.rs index 28c1a003e39..28c1a003e39 100644 --- a/src/test/compile-fail/privacy-ufcs.rs +++ b/src/test/ui/compile-fail-migration/privacy-ufcs.rs diff --git a/src/test/ui/compile-fail-migration/privacy-ufcs.stderr b/src/test/ui/compile-fail-migration/privacy-ufcs.stderr new file mode 100644 index 00000000000..2030e2e0f1b --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy-ufcs.stderr @@ -0,0 +1,9 @@ +error[E0603]: trait `Bar` is private + --> $DIR/privacy-ufcs.rs:22:5 + | +LL | <i32 as ::foo::Bar>::baz(); //~ERROR trait `Bar` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/privacy/associated-item-privacy-inherent.rs b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-inherent.rs index 63cb6e82c25..63cb6e82c25 100644 --- a/src/test/compile-fail/privacy/associated-item-privacy-inherent.rs +++ b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-inherent.rs diff --git a/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-inherent.stderr b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-inherent.stderr new file mode 100644 index 00000000000..391e5bbb4c0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-inherent.stderr @@ -0,0 +1,191 @@ +error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private + --> $DIR/associated-item-privacy-inherent.rs:23:21 + | +LL | let value = Pub::method; + | ^^^^^^^^^^^ +... +LL | priv_nominal::mac!(); + | --------------------- in this macro invocation + +error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private + --> $DIR/associated-item-privacy-inherent.rs:25:9 + | +LL | value; + | ^^^^^ +... +LL | priv_nominal::mac!(); + | --------------------- in this macro invocation + +error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is private + --> $DIR/associated-item-privacy-inherent.rs:27:13 + | +LL | Pub.method(); + | ^^^^^^ +... +LL | priv_nominal::mac!(); + | --------------------- in this macro invocation + +error: associated constant `CONST` is private + --> $DIR/associated-item-privacy-inherent.rs:29:9 + | +LL | Pub::CONST; + | ^^^^^^^^^^ +... +LL | priv_nominal::mac!(); + | --------------------- in this macro invocation + +error: type `priv_signature::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:47:21 + | +LL | let value = Pub::method; + | ^^^^^^^^^^^ +... +LL | priv_signature::mac!(); + | ----------------------- in this macro invocation + +error: type `priv_signature::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:49:9 + | +LL | value; + | ^^^^^ +... +LL | priv_signature::mac!(); + | ----------------------- in this macro invocation + +error: type `priv_signature::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:51:13 + | +LL | Pub.method(loop {}); + | ^^^^^^ +... +LL | priv_signature::mac!(); + | ----------------------- in this macro invocation + +error: type `priv_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:67:21 + | +LL | let value = Pub::method::<Priv>; + | ^^^^^^^^^^^^^^^^^^^ +... +LL | priv_substs::mac!(); + | -------------------- in this macro invocation + +error: type `priv_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:69:9 + | +LL | value; + | ^^^^^ +... +LL | priv_substs::mac!(); + | -------------------- in this macro invocation + +error: type `priv_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:71:9 + | +LL | Pub.method::<Priv>(); + | ^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_substs::mac!(); + | -------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:90:21 + | +LL | let value = <Pub>::method; + | ^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:92:9 + | +LL | value; + | ^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:94:21 + | +LL | let value = Pub::method; + | ^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:96:9 + | +LL | value; + | ^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:98:21 + | +LL | let value = <Pub>::static_method; + | ^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:100:9 + | +LL | value; + | ^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:102:21 + | +LL | let value = Pub::static_method; + | ^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:104:9 + | +LL | value; + | ^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:106:19 + | +LL | Pub(Priv).method(); + | ^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:109:10 + | +LL | <Pub>::CONST; + | ^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-inherent.rs:111:9 + | +LL | Pub::CONST; + | ^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: aborting due to 21 previous errors + diff --git a/src/test/compile-fail/privacy/associated-item-privacy-trait.rs b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-trait.rs index bdc0c680a92..bdc0c680a92 100644 --- a/src/test/compile-fail/privacy/associated-item-privacy-trait.rs +++ b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-trait.rs diff --git a/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-trait.stderr b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-trait.stderr new file mode 100644 index 00000000000..5aac27346f3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-trait.stderr @@ -0,0 +1,317 @@ +error: type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as priv_trait::PrivTr>::method}` is private + --> $DIR/associated-item-privacy-trait.rs:27:21 + | +LL | let value = <Pub as PrivTr>::method; + | ^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as priv_trait::PrivTr>::method}` is private + --> $DIR/associated-item-privacy-trait.rs:29:9 + | +LL | value; + | ^^^^^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: type `for<'r> fn(&'r Self) {<Self as priv_trait::PrivTr>::method}` is private + --> $DIR/associated-item-privacy-trait.rs:31:13 + | +LL | Pub.method(); + | ^^^^^^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: associated constant `PrivTr::CONST` is private + --> $DIR/associated-item-privacy-trait.rs:33:9 + | +LL | <Pub as PrivTr>::CONST; + | ^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: trait `priv_trait::PrivTr` is private + --> $DIR/associated-item-privacy-trait.rs:35:13 + | +LL | let _: <Pub as PrivTr>::AssocTy; + | ^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: trait `priv_trait::PrivTr` is private + --> $DIR/associated-item-privacy-trait.rs:35:16 + | +LL | let _: <Pub as PrivTr>::AssocTy; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: trait `priv_trait::PrivTr` is private + --> $DIR/associated-item-privacy-trait.rs:38:34 + | +LL | pub type InSignatureTy = <Pub as PrivTr>::AssocTy; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: trait `priv_trait::PrivTr` is private + --> $DIR/associated-item-privacy-trait.rs:40:34 + | +LL | pub trait InSignatureTr: PrivTr {} + | ^^^^^^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: trait `priv_trait::PrivTr` is private + --> $DIR/associated-item-privacy-trait.rs:42:14 + | +LL | impl PrivTr for u8 {} + | ^^^^^^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: type `priv_signature::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:59:21 + | +LL | let value = <Pub as PubTr>::method; + | ^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_signature::mac!(); + | ----------------------- in this macro invocation + +error: type `priv_signature::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:61:9 + | +LL | value; + | ^^^^^ +... +LL | priv_signature::mac!(); + | ----------------------- in this macro invocation + +error: type `priv_signature::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:63:13 + | +LL | Pub.method(loop {}); + | ^^^^^^ +... +LL | priv_signature::mac!(); + | ----------------------- in this macro invocation + +error: type `priv_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:80:21 + | +LL | let value = <Pub as PubTr>::method::<Priv>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_substs::mac!(); + | -------------------- in this macro invocation + +error: type `priv_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:82:9 + | +LL | value; + | ^^^^^ +... +LL | priv_substs::mac!(); + | -------------------- in this macro invocation + +error: type `priv_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:84:9 + | +LL | Pub.method::<Priv>(); + | ^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_substs::mac!(); + | -------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:104:21 + | +LL | let value = <Pub as PubTr>::method; + | ^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:106:9 + | +LL | value; + | ^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:108:21 + | +LL | let value = <Pub as PubTr<_>>::method; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:110:9 + | +LL | value; + | ^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:112:9 + | +LL | Pub.method(); + | ^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:115:21 + | +LL | let value = <Priv as PubTr<_>>::method; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:117:9 + | +LL | value; + | ^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:119:9 + | +LL | Priv.method(); + | ^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:122:9 + | +LL | <Pub as PubTr>::CONST; + | ^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:124:9 + | +LL | <Pub as PubTr<_>>::CONST; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:126:9 + | +LL | <Priv as PubTr<_>>::CONST; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:129:13 + | +LL | let _: <Pub as PubTr>::AssocTy; + | ^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:129:16 + | +LL | let _: <Pub as PubTr>::AssocTy; + | ^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:132:13 + | +LL | let _: <Pub as PubTr<_>>::AssocTy; + | ^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:132:16 + | +LL | let _: <Pub as PubTr<_>>::AssocTy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:135:13 + | +LL | let _: <Priv as PubTr<_>>::AssocTy; + | ^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:135:16 + | +LL | let _: <Priv as PubTr<_>>::AssocTy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:139:35 + | +LL | pub type InSignatureTy1 = <Pub as PubTr>::AssocTy; + | ^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:141:35 + | +LL | pub type InSignatureTy2 = <Priv as PubTr<Pub>>::AssocTy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-trait.rs:143:14 + | +LL | impl PubTr for u8 {} + | ^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: aborting due to 35 previous errors + diff --git a/src/test/compile-fail/privacy/associated-item-privacy-type-binding.rs b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-type-binding.rs index 6019369aa2e..6019369aa2e 100644 --- a/src/test/compile-fail/privacy/associated-item-privacy-type-binding.rs +++ b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-type-binding.rs diff --git a/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-type-binding.stderr b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-type-binding.stderr new file mode 100644 index 00000000000..e762dc62853 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/associated-item-privacy-type-binding.stderr @@ -0,0 +1,146 @@ +error: type `(dyn priv_trait::PubTr<AssocTy=u8> + '<empty>)` is private + --> $DIR/associated-item-privacy-type-binding.rs:21:13 + | +LL | let _: Box<PubTr<AssocTy = u8>>; + | ^ +... +LL | priv_trait::mac1!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PubTr<AssocTy=u8> + '<empty>)` is private + --> $DIR/associated-item-privacy-type-binding.rs:21:16 + | +LL | let _: Box<PubTr<AssocTy = u8>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac1!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PubTr<AssocTy=u8> + 'static)` is private + --> $DIR/associated-item-privacy-type-binding.rs:24:31 + | +LL | type InSignatureTy2 = Box<PubTr<AssocTy = u8>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac1!(); + | -------------------- in this macro invocation + +error: trait `priv_trait::PrivTr` is private + --> $DIR/associated-item-privacy-type-binding.rs:26:31 + | +LL | trait InSignatureTr2: PubTr<AssocTy = u8> {} + | ^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac1!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PrivTr<AssocTy=u8> + '<empty>)` is private + --> $DIR/associated-item-privacy-type-binding.rs:30:13 + | +LL | let _: Box<PrivTr<AssocTy = u8>>; + | ^ +... +LL | priv_trait::mac2!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PrivTr<AssocTy=u8> + '<empty>)` is private + --> $DIR/associated-item-privacy-type-binding.rs:30:16 + | +LL | let _: Box<PrivTr<AssocTy = u8>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac2!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PrivTr<AssocTy=u8> + 'static)` is private + --> $DIR/associated-item-privacy-type-binding.rs:33:31 + | +LL | type InSignatureTy1 = Box<PrivTr<AssocTy = u8>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac2!(); + | -------------------- in this macro invocation + +error: trait `priv_trait::PrivTr` is private + --> $DIR/associated-item-privacy-type-binding.rs:35:31 + | +LL | trait InSignatureTr1: PrivTr<AssocTy = u8> {} + | ^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac2!(); + | -------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-type-binding.rs:54:13 + | +LL | let _: Box<PubTrWithParam<AssocTy = u8>>; + | ^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-type-binding.rs:54:16 + | +LL | let _: Box<PubTrWithParam<AssocTy = u8>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-type-binding.rs:57:13 + | +LL | let _: Box<PubTr<AssocTy = u8>>; + | ^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-type-binding.rs:57:16 + | +LL | let _: Box<PubTr<AssocTy = u8>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-type-binding.rs:60:35 + | +LL | pub type InSignatureTy1 = Box<PubTrWithParam<AssocTy = u8>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-type-binding.rs:62:35 + | +LL | pub type InSignatureTy2 = Box<PubTr<AssocTy = u8>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-type-binding.rs:64:31 + | +LL | trait InSignatureTr1: PubTrWithParam<AssocTy = u8> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: type `priv_parent_substs::Priv` is private + --> $DIR/associated-item-privacy-type-binding.rs:66:31 + | +LL | trait InSignatureTr2: PubTr<AssocTy = u8> {} + | ^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: aborting due to 16 previous errors + diff --git a/src/test/compile-fail/privacy/legacy-ctor-visibility.rs b/src/test/ui/compile-fail-migration/privacy/legacy-ctor-visibility.rs index 95144916fd7..95144916fd7 100644 --- a/src/test/compile-fail/privacy/legacy-ctor-visibility.rs +++ b/src/test/ui/compile-fail-migration/privacy/legacy-ctor-visibility.rs diff --git a/src/test/ui/compile-fail-migration/privacy/legacy-ctor-visibility.stderr b/src/test/ui/compile-fail-migration/privacy/legacy-ctor-visibility.stderr new file mode 100644 index 00000000000..7652d65a3a4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/legacy-ctor-visibility.stderr @@ -0,0 +1,12 @@ +error: private struct constructors are not usable through re-exports in outer modules + --> $DIR/legacy-ctor-visibility.rs:23:13 + | +LL | S(10); + | ^ + | + = note: #[deny(legacy_constructor_visibility)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #39207 <https://github.com/rust-lang/rust/issues/39207> + +error: aborting due to previous error + diff --git a/src/test/compile-fail/privacy/restricted/auxiliary/pub_restricted.rs b/src/test/ui/compile-fail-migration/privacy/restricted/auxiliary/pub_restricted.rs index c4ab96c8456..c4ab96c8456 100644 --- a/src/test/compile-fail/privacy/restricted/auxiliary/pub_restricted.rs +++ b/src/test/ui/compile-fail-migration/privacy/restricted/auxiliary/pub_restricted.rs diff --git a/src/test/compile-fail/privacy/restricted/lookup-ignores-private.rs b/src/test/ui/compile-fail-migration/privacy/restricted/lookup-ignores-private.rs index abd71b9c90b..abd71b9c90b 100644 --- a/src/test/compile-fail/privacy/restricted/lookup-ignores-private.rs +++ b/src/test/ui/compile-fail-migration/privacy/restricted/lookup-ignores-private.rs diff --git a/src/test/ui/compile-fail-migration/privacy/restricted/lookup-ignores-private.stderr b/src/test/ui/compile-fail-migration/privacy/restricted/lookup-ignores-private.stderr new file mode 100644 index 00000000000..7fc53e8c324 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/restricted/lookup-ignores-private.stderr @@ -0,0 +1,12 @@ +error: compilation successful + --> $DIR/lookup-ignores-private.rs:40:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | let s = foo::S::default(); +LL | | let _: bool = s.x; +LL | | let _: bool = s.f(); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/privacy/restricted/private-in-public.rs b/src/test/ui/compile-fail-migration/privacy/restricted/private-in-public.rs index 4d3f5377797..4d3f5377797 100644 --- a/src/test/compile-fail/privacy/restricted/private-in-public.rs +++ b/src/test/ui/compile-fail-migration/privacy/restricted/private-in-public.rs diff --git a/src/test/ui/compile-fail-migration/privacy/restricted/private-in-public.stderr b/src/test/ui/compile-fail-migration/privacy/restricted/private-in-public.stderr new file mode 100644 index 00000000000..e0d3abdc213 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/restricted/private-in-public.stderr @@ -0,0 +1,21 @@ +error[E0446]: private type `foo::Priv` in public interface + --> $DIR/private-in-public.rs:18:9 + | +LL | struct Priv; + | - `foo::Priv` declared as private +... +LL | pub(crate) fn g(_: Priv) {} //~ ERROR E0446 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `foo::Priv` in public interface + --> $DIR/private-in-public.rs:19:9 + | +LL | struct Priv; + | - `foo::Priv` declared as private +... +LL | crate fn h(_: Priv) {} //~ ERROR E0446 + | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0446`. diff --git a/src/test/compile-fail/privacy/restricted/struct-literal-field.rs b/src/test/ui/compile-fail-migration/privacy/restricted/struct-literal-field.rs index 21d90dfea4b..21d90dfea4b 100644 --- a/src/test/compile-fail/privacy/restricted/struct-literal-field.rs +++ b/src/test/ui/compile-fail-migration/privacy/restricted/struct-literal-field.rs diff --git a/src/test/ui/compile-fail-migration/privacy/restricted/struct-literal-field.stderr b/src/test/ui/compile-fail-migration/privacy/restricted/struct-literal-field.stderr new file mode 100644 index 00000000000..6d668c8767a --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/restricted/struct-literal-field.stderr @@ -0,0 +1,9 @@ +error[E0451]: field `x` of struct `foo::bar::S` is private + --> $DIR/struct-literal-field.rs:28:9 + | +LL | S { x: 0 }; //~ ERROR private + | ^^^^ field `x` is private + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0451`. diff --git a/src/test/compile-fail/privacy/restricted/test.rs b/src/test/ui/compile-fail-migration/privacy/restricted/test.rs index 8c1d609e244..8c1d609e244 100644 --- a/src/test/compile-fail/privacy/restricted/test.rs +++ b/src/test/ui/compile-fail-migration/privacy/restricted/test.rs diff --git a/src/test/ui/compile-fail-migration/privacy/restricted/test.stderr b/src/test/ui/compile-fail-migration/privacy/restricted/test.stderr new file mode 100644 index 00000000000..67a95c35590 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/restricted/test.stderr @@ -0,0 +1,82 @@ +error[E0433]: failed to resolve. Maybe a missing `extern crate bad;`? + --> $DIR/test.rs:60:12 + | +LL | pub(in bad::path) mod m1 {} //~ ERROR failed to resolve. Maybe a missing `extern crate bad;`? + | ^^^ Maybe a missing `extern crate bad;`? + +error: visibilities can only be restricted to ancestor modules + --> $DIR/test.rs:61:12 + | +LL | pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules + | ^^^ + +error[E0364]: `f` is private, and cannot be re-exported + --> $DIR/test.rs:31:24 + | +LL | pub(super) use foo::bar::f as g; //~ ERROR cannot be re-exported + | ^^^^^^^^^^^^^^^^ + | +note: consider marking `f` as `pub` in the imported module + --> $DIR/test.rs:31:24 + | +LL | pub(super) use foo::bar::f as g; //~ ERROR cannot be re-exported + | ^^^^^^^^^^^^^^^^ + +error[E0603]: struct `Crate` is private + --> $DIR/test.rs:48:9 + | +LL | use pub_restricted::Crate; //~ ERROR private + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: function `f` is private + --> $DIR/test.rs:40:9 + | +LL | use foo::bar::f; //~ ERROR private + | ^^^^^^^^^^^ + +error[E0616]: field `x` of struct `foo::bar::S` is private + --> $DIR/test.rs:41:5 + | +LL | S::default().x; //~ ERROR private + | ^^^^^^^^^^^^^^ + +error[E0624]: method `f` is private + --> $DIR/test.rs:42:18 + | +LL | S::default().f(); //~ ERROR private + | ^ + +error[E0624]: method `g` is private + --> $DIR/test.rs:43:5 + | +LL | S::g(); //~ ERROR private + | ^^^^ + +error[E0616]: field `y` of struct `pub_restricted::Universe` is private + --> $DIR/test.rs:52:13 + | +LL | let _ = u.y; //~ ERROR private + | ^^^ + +error[E0616]: field `z` of struct `pub_restricted::Universe` is private + --> $DIR/test.rs:53:13 + | +LL | let _ = u.z; //~ ERROR private + | ^^^ + +error[E0624]: method `g` is private + --> $DIR/test.rs:55:7 + | +LL | u.g(); //~ ERROR private + | ^ + +error[E0624]: method `h` is private + --> $DIR/test.rs:56:7 + | +LL | u.h(); //~ ERROR private + | ^ + +error: aborting due to 12 previous errors + +Some errors occurred: E0364, E0433, E0603, E0616, E0624. +For more information about an error, try `rustc --explain E0364`. diff --git a/src/test/compile-fail/privacy/union-field-privacy-1.rs b/src/test/ui/compile-fail-migration/privacy/union-field-privacy-1.rs index eeebb1b737a..eeebb1b737a 100644 --- a/src/test/compile-fail/privacy/union-field-privacy-1.rs +++ b/src/test/ui/compile-fail-migration/privacy/union-field-privacy-1.rs diff --git a/src/test/ui/compile-fail-migration/privacy/union-field-privacy-1.stderr b/src/test/ui/compile-fail-migration/privacy/union-field-privacy-1.stderr new file mode 100644 index 00000000000..c93760a1b89 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/union-field-privacy-1.stderr @@ -0,0 +1,15 @@ +error[E0451]: field `c` of union `m::U` is private + --> $DIR/union-field-privacy-1.rs:22:20 + | +LL | let u = m::U { c: 0 }; //~ ERROR field `c` of union `m::U` is private + | ^^^^ field `c` is private + +error[E0451]: field `c` of union `m::U` is private + --> $DIR/union-field-privacy-1.rs:26:16 + | +LL | let m::U { c } = u; //~ ERROR field `c` of union `m::U` is private + | ^ field `c` is private + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0451`. diff --git a/src/test/compile-fail/privacy/union-field-privacy-2.rs b/src/test/ui/compile-fail-migration/privacy/union-field-privacy-2.rs index d6bb765202d..d6bb765202d 100644 --- a/src/test/compile-fail/privacy/union-field-privacy-2.rs +++ b/src/test/ui/compile-fail-migration/privacy/union-field-privacy-2.rs diff --git a/src/test/ui/compile-fail-migration/privacy/union-field-privacy-2.stderr b/src/test/ui/compile-fail-migration/privacy/union-field-privacy-2.stderr new file mode 100644 index 00000000000..cc12483a653 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy/union-field-privacy-2.stderr @@ -0,0 +1,9 @@ +error[E0616]: field `c` of struct `m::U` is private + --> $DIR/union-field-privacy-2.rs:24:13 + | +LL | let c = u.c; //~ ERROR field `c` of struct `m::U` is private + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0616`. diff --git a/src/test/compile-fail/privacy1.rs b/src/test/ui/compile-fail-migration/privacy1.rs index afe8c2fda3d..afe8c2fda3d 100644 --- a/src/test/compile-fail/privacy1.rs +++ b/src/test/ui/compile-fail-migration/privacy1.rs diff --git a/src/test/ui/compile-fail-migration/privacy1.stderr b/src/test/ui/compile-fail-migration/privacy1.stderr new file mode 100644 index 00000000000..344f990699f --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy1.stderr @@ -0,0 +1,112 @@ +error[E0603]: module `baz` is private + --> $DIR/privacy1.rs:128:24 + | +LL | use bar::baz::{foo, bar}; + | ^^^ + +error[E0603]: module `baz` is private + --> $DIR/privacy1.rs:128:29 + | +LL | use bar::baz::{foo, bar}; + | ^^^ + +error[E0603]: module `baz` is private + --> $DIR/privacy1.rs:137:13 + | +LL | use bar::baz; + | ^^^^^^^^ + +error[E0603]: module `i` is private + --> $DIR/privacy1.rs:161:9 + | +LL | use self::foo::i::A; //~ ERROR: module `i` is private + | ^^^^^^^^^^^^^^^ + +error[E0603]: module `baz` is private + --> $DIR/privacy1.rs:100:9 + | +LL | ::bar::baz::A::foo(); //~ ERROR: module `baz` is private + | ^^^^^^^^^^^^^^^^^^ + +error[E0603]: module `baz` is private + --> $DIR/privacy1.rs:101:9 + | +LL | ::bar::baz::A::bar(); //~ ERROR: module `baz` is private + | ^^^^^^^^^^^^^^^^^^ + +error[E0603]: module `baz` is private + --> $DIR/privacy1.rs:103:9 + | +LL | ::bar::baz::A.foo2(); //~ ERROR: module `baz` is private + | ^^^^^^^^^^^^^ + +error[E0603]: module `baz` is private + --> $DIR/privacy1.rs:104:9 + | +LL | ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private + | ^^^^^^^^^^^^^ + +error[E0603]: trait `B` is private + --> $DIR/privacy1.rs:108:9 + | +LL | ::bar::B::foo(); //~ ERROR: trait `B` is private + | ^^^^^^^^^^^^^ + +error[E0603]: function `epriv` is private + --> $DIR/privacy1.rs:114:13 + | +LL | ::bar::epriv(); //~ ERROR: function `epriv` is private + | ^^^^^^^^^^^^ + +error[E0603]: module `baz` is private + --> $DIR/privacy1.rs:123:9 + | +LL | ::bar::baz::foo(); //~ ERROR: module `baz` is private + | ^^^^^^^^^^^^^^^ + +error[E0603]: module `baz` is private + --> $DIR/privacy1.rs:124:9 + | +LL | ::bar::baz::bar(); //~ ERROR: module `baz` is private + | ^^^^^^^^^^^^^^^ + +error[E0603]: trait `B` is private + --> $DIR/privacy1.rs:153:10 + | +LL | impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } } + | ^^^^^^^^ + +error[E0624]: method `bar` is private + --> $DIR/privacy1.rs:73:9 + | +LL | self::baz::A::bar(); //~ ERROR: method `bar` is private + | ^^^^^^^^^^^^^^^^^ + +error[E0624]: method `bar` is private + --> $DIR/privacy1.rs:91:5 + | +LL | bar::A::bar(); //~ ERROR: method `bar` is private + | ^^^^^^^^^^^ + +error[E0624]: method `bar` is private + --> $DIR/privacy1.rs:98:9 + | +LL | ::bar::A::bar(); //~ ERROR: method `bar` is private + | ^^^^^^^^^^^^^ + +error[E0624]: method `bar` is private + --> $DIR/privacy1.rs:101:9 + | +LL | ::bar::baz::A::bar(); //~ ERROR: module `baz` is private + | ^^^^^^^^^^^^^^^^^^ + +error[E0624]: method `bar2` is private + --> $DIR/privacy1.rs:104:23 + | +LL | ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private + | ^^^^ + +error: aborting due to 18 previous errors + +Some errors occurred: E0603, E0624. +For more information about an error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/privacy2.rs b/src/test/ui/compile-fail-migration/privacy2.rs index 113dd287940..113dd287940 100644 --- a/src/test/compile-fail/privacy2.rs +++ b/src/test/ui/compile-fail-migration/privacy2.rs diff --git a/src/test/ui/compile-fail-migration/privacy2.stderr b/src/test/ui/compile-fail-migration/privacy2.stderr new file mode 100644 index 00000000000..ec5567b25e4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy2.stderr @@ -0,0 +1,18 @@ +error[E0432]: unresolved import `bar::foo` + --> $DIR/privacy2.rs:27:9 + | +LL | use bar::foo; + | ^^^^^^^^ no `foo` in `bar` + +error[E0603]: function `foo` is private + --> $DIR/privacy2.rs:33:9 + | +LL | use bar::glob::foo; + | ^^^^^^^^^^^^^^ + +error: requires `sized` lang_item + +error: aborting due to 3 previous errors + +Some errors occurred: E0432, E0603. +For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/privacy3.rs b/src/test/ui/compile-fail-migration/privacy3.rs index b841717bd11..b841717bd11 100644 --- a/src/test/compile-fail/privacy3.rs +++ b/src/test/ui/compile-fail-migration/privacy3.rs diff --git a/src/test/ui/compile-fail-migration/privacy3.stderr b/src/test/ui/compile-fail-migration/privacy3.stderr new file mode 100644 index 00000000000..11c71616d90 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy3.stderr @@ -0,0 +1,11 @@ +error[E0432]: unresolved import `bar::gpriv` + --> $DIR/privacy3.rs:28:9 + | +LL | use bar::gpriv; + | ^^^^^^^^^^ no `gpriv` in `bar` + +error: requires `sized` lang_item + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/privacy4.rs b/src/test/ui/compile-fail-migration/privacy4.rs index d9f76744284..d9f76744284 100644 --- a/src/test/compile-fail/privacy4.rs +++ b/src/test/ui/compile-fail-migration/privacy4.rs diff --git a/src/test/ui/compile-fail-migration/privacy4.stderr b/src/test/ui/compile-fail-migration/privacy4.stderr new file mode 100644 index 00000000000..811f5d5942a --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy4.stderr @@ -0,0 +1,9 @@ +error[E0603]: module `glob` is private + --> $DIR/privacy4.rs:31:9 + | +LL | use bar::glob::gpriv; //~ ERROR: module `glob` is private + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/privacy5.rs b/src/test/ui/compile-fail-migration/privacy5.rs index 599c1f87160..599c1f87160 100644 --- a/src/test/compile-fail/privacy5.rs +++ b/src/test/ui/compile-fail-migration/privacy5.rs diff --git a/src/test/ui/compile-fail-migration/privacy5.stderr b/src/test/ui/compile-fail-migration/privacy5.stderr new file mode 100644 index 00000000000..bcb63151362 --- /dev/null +++ b/src/test/ui/compile-fail-migration/privacy5.stderr @@ -0,0 +1,291 @@ +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:61:13 + | +LL | let a = a::A(()); //~ ERROR tuple struct `A` is private + | ^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:62:13 + | +LL | let b = a::B(2); //~ ERROR tuple struct `B` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:63:13 + | +LL | let c = a::C(2, 3); //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:66:9 + | +LL | let a::A(()) = a; //~ ERROR tuple struct `A` is private + | ^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:67:9 + | +LL | let a::A(_) = a; //~ ERROR tuple struct `A` is private + | ^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:68:15 + | +LL | match a { a::A(()) => {} } //~ ERROR tuple struct `A` is private + | ^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:69:15 + | +LL | match a { a::A(_) => {} } //~ ERROR tuple struct `A` is private + | ^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:71:9 + | +LL | let a::B(_) = b; //~ ERROR tuple struct `B` is private + | ^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:72:9 + | +LL | let a::B(_b) = b; //~ ERROR tuple struct `B` is private + | ^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:73:15 + | +LL | match b { a::B(_) => {} } //~ ERROR tuple struct `B` is private + | ^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:74:15 + | +LL | match b { a::B(_b) => {} } //~ ERROR tuple struct `B` is private + | ^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:75:15 + | +LL | match b { a::B(1) => {} a::B(_) => {} } //~ ERROR tuple struct `B` is private + | ^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:75:29 + | +LL | match b { a::B(1) => {} a::B(_) => {} } //~ ERROR tuple struct `B` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:78:9 + | +LL | let a::C(_, _) = c; //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:79:9 + | +LL | let a::C(_a, _) = c; //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:80:9 + | +LL | let a::C(_, _b) = c; //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:81:9 + | +LL | let a::C(_a, _b) = c; //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:82:15 + | +LL | match c { a::C(_, _) => {} } //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:83:15 + | +LL | match c { a::C(_a, _) => {} } //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:84:15 + | +LL | match c { a::C(_, _b) => {} } //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:85:15 + | +LL | match c { a::C(_a, _b) => {} } //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:93:14 + | +LL | let a2 = a::A; //~ ERROR tuple struct `A` is private + | ^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:94:14 + | +LL | let b2 = a::B; //~ ERROR tuple struct `B` is private + | ^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:95:14 + | +LL | let c2 = a::C; //~ ERROR tuple struct `C` is private + | ^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:100:13 + | +LL | let a = other::A(()); //~ ERROR tuple struct `A` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:101:13 + | +LL | let b = other::B(2); //~ ERROR tuple struct `B` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:102:13 + | +LL | let c = other::C(2, 3); //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:105:9 + | +LL | let other::A(()) = a; //~ ERROR tuple struct `A` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:106:9 + | +LL | let other::A(_) = a; //~ ERROR tuple struct `A` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:107:15 + | +LL | match a { other::A(()) => {} } //~ ERROR tuple struct `A` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:108:15 + | +LL | match a { other::A(_) => {} } //~ ERROR tuple struct `A` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:110:9 + | +LL | let other::B(_) = b; //~ ERROR tuple struct `B` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:111:9 + | +LL | let other::B(_b) = b; //~ ERROR tuple struct `B` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:112:15 + | +LL | match b { other::B(_) => {} } //~ ERROR tuple struct `B` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:113:15 + | +LL | match b { other::B(_b) => {} } //~ ERROR tuple struct `B` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:114:15 + | +LL | match b { other::B(1) => {} other::B(_) => {} } //~ ERROR tuple struct `B` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:114:33 + | +LL | match b { other::B(1) => {} other::B(_) => {} } //~ ERROR tuple struct `B` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:117:9 + | +LL | let other::C(_, _) = c; //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:118:9 + | +LL | let other::C(_a, _) = c; //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:119:9 + | +LL | let other::C(_, _b) = c; //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:120:9 + | +LL | let other::C(_a, _b) = c; //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:121:15 + | +LL | match c { other::C(_, _) => {} } //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:122:15 + | +LL | match c { other::C(_a, _) => {} } //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:123:15 + | +LL | match c { other::C(_, _b) => {} } //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:124:15 + | +LL | match c { other::C(_a, _b) => {} } //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `A` is private + --> $DIR/privacy5.rs:132:14 + | +LL | let a2 = other::A; //~ ERROR tuple struct `A` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `B` is private + --> $DIR/privacy5.rs:133:14 + | +LL | let b2 = other::B; //~ ERROR tuple struct `B` is private + | ^^^^^^^^ + +error[E0603]: tuple struct `C` is private + --> $DIR/privacy5.rs:134:14 + | +LL | let c2 = other::C; //~ ERROR tuple struct `C` is private + | ^^^^^^^^ + +error: aborting due to 48 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/private-impl-method.rs b/src/test/ui/compile-fail-migration/private-impl-method.rs index e04380f12ac..e04380f12ac 100644 --- a/src/test/compile-fail/private-impl-method.rs +++ b/src/test/ui/compile-fail-migration/private-impl-method.rs diff --git a/src/test/ui/compile-fail-migration/private-impl-method.stderr b/src/test/ui/compile-fail-migration/private-impl-method.stderr new file mode 100644 index 00000000000..0e36c7003ee --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-impl-method.stderr @@ -0,0 +1,9 @@ +error[E0624]: method `foo` is private + --> $DIR/private-impl-method.rs:30:7 + | +LL | s.foo(); //~ ERROR method `foo` is private + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0624`. diff --git a/src/test/compile-fail/private-in-public-assoc-ty.rs b/src/test/ui/compile-fail-migration/private-in-public-assoc-ty.rs index 59dee256642..59dee256642 100644 --- a/src/test/compile-fail/private-in-public-assoc-ty.rs +++ b/src/test/ui/compile-fail-migration/private-in-public-assoc-ty.rs diff --git a/src/test/ui/compile-fail-migration/private-in-public-assoc-ty.stderr b/src/test/ui/compile-fail-migration/private-in-public-assoc-ty.stderr new file mode 100644 index 00000000000..a95547bc507 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-in-public-assoc-ty.stderr @@ -0,0 +1,52 @@ +warning: private trait `m::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-assoc-ty.rs:25:5 + | +LL | / pub trait PubTr { +LL | | //~^ WARN private trait `m::PrivTr` in public interface +LL | | //~| WARN this was previously accepted +LL | | //~| WARN private type `m::Priv` in public interface +... | +LL | | //~^ ERROR private type `m::Priv` in public interface +LL | | } + | |_____^ + | + = note: #[warn(private_in_public)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +warning: private type `m::Priv` in public interface (error E0446) + --> $DIR/private-in-public-assoc-ty.rs:25:5 + | +LL | / pub trait PubTr { +LL | | //~^ WARN private trait `m::PrivTr` in public interface +LL | | //~| WARN this was previously accepted +LL | | //~| WARN private type `m::Priv` in public interface +... | +LL | | //~^ ERROR private type `m::Priv` in public interface +LL | | } + | |_____^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error[E0446]: private type `m::Priv` in public interface + --> $DIR/private-in-public-assoc-ty.rs:34:9 + | +LL | struct Priv; + | - `m::Priv` declared as private +... +LL | type Alias4 = Priv; + | ^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `m::Priv` in public interface + --> $DIR/private-in-public-assoc-ty.rs:38:9 + | +LL | struct Priv; + | - `m::Priv` declared as private +... +LL | type Alias1 = Priv; + | ^^^^^^^^^^^^^^^^^^^ can't leak private type + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0446`. diff --git a/src/test/compile-fail/private-in-public-ill-formed.rs b/src/test/ui/compile-fail-migration/private-in-public-ill-formed.rs index 480406054ad..480406054ad 100644 --- a/src/test/compile-fail/private-in-public-ill-formed.rs +++ b/src/test/ui/compile-fail-migration/private-in-public-ill-formed.rs diff --git a/src/test/ui/compile-fail-migration/private-in-public-ill-formed.stderr b/src/test/ui/compile-fail-migration/private-in-public-ill-formed.stderr new file mode 100644 index 00000000000..649f5fc2fca --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-in-public-ill-formed.stderr @@ -0,0 +1,19 @@ +error[E0118]: no base type found for inherent implementation + --> $DIR/private-in-public-ill-formed.rs:24:10 + | +LL | impl <Priv as PrivTr>::AssocAlias { //~ ERROR no base type found for inherent implementation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl requires a base type + | + = note: either implement a trait on it or create a newtype to wrap it instead + +error[E0118]: no base type found for inherent implementation + --> $DIR/private-in-public-ill-formed.rs:40:10 + | +LL | impl <Priv as PrivTr>::AssocAlias { //~ ERROR no base type found for inherent implementation + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl requires a base type + | + = note: either implement a trait on it or create a newtype to wrap it instead + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0118`. diff --git a/src/test/compile-fail/private-in-public-lint.rs b/src/test/ui/compile-fail-migration/private-in-public-lint.rs index fd92300cd15..fd92300cd15 100644 --- a/src/test/compile-fail/private-in-public-lint.rs +++ b/src/test/ui/compile-fail-migration/private-in-public-lint.rs diff --git a/src/test/ui/compile-fail-migration/private-in-public-lint.stderr b/src/test/ui/compile-fail-migration/private-in-public-lint.stderr new file mode 100644 index 00000000000..202cb342d8c --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-in-public-lint.stderr @@ -0,0 +1,21 @@ +error[E0446]: private type `m1::Priv` in public interface + --> $DIR/private-in-public-lint.rs:16:9 + | +LL | struct Priv; + | - `m1::Priv` declared as private +... +LL | pub fn f() -> Priv {Priv} //~ ERROR private type `m1::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `m2::Priv` in public interface + --> $DIR/private-in-public-lint.rs:25:9 + | +LL | struct Priv; + | - `m2::Priv` declared as private +... +LL | pub fn f() -> Priv {Priv} //~ ERROR private type `m2::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0446`. diff --git a/src/test/compile-fail/private-in-public-warn.rs b/src/test/ui/compile-fail-migration/private-in-public-warn.rs index 6eeb14638e7..6eeb14638e7 100644 --- a/src/test/compile-fail/private-in-public-warn.rs +++ b/src/test/ui/compile-fail-migration/private-in-public-warn.rs diff --git a/src/test/ui/compile-fail-migration/private-in-public-warn.stderr b/src/test/ui/compile-fail-migration/private-in-public-warn.stderr new file mode 100644 index 00000000000..04e743a5b0e --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-in-public-warn.stderr @@ -0,0 +1,329 @@ +error: private type `types::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:25:5 + | +LL | pub type Alias = Priv; //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/private-in-public-warn.rs:15:9 + | +LL | #![deny(private_in_public)] + | ^^^^^^^^^^^^^^^^^ + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `types::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:28:12 + | +LL | V1(Priv), //~ ERROR private type `types::Priv` in public interface + | ^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `types::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:30:14 + | +LL | V2 { field: Priv }, //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `types::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:34:9 + | +LL | const C: Priv = Priv; //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public-warn.rs:36:9 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | type Alias = Priv; //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^ can't leak private type + +error: private type `types::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:37:9 + | +LL | fn f1(arg: Priv) {} //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `types::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:39:9 + | +LL | fn f2() -> Priv { panic!() } //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `types::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:43:9 + | +LL | pub static ES: Priv; //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `types::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:45:9 + | +LL | pub fn ef1(arg: Priv); //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `types::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:47:9 + | +LL | pub fn ef2() -> Priv; //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public-warn.rs:51:9 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | type Alias = Priv; //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^ can't leak private type + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:60:5 + | +LL | pub type Alias<T: PrivTr> = T; //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:62:5 + | +LL | pub trait Tr1: PrivTr {} //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:64:5 + | +LL | pub trait Tr2<T: PrivTr> {} //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:66:5 + | +LL | / pub trait Tr3 { +LL | | //~^ ERROR private trait `traits::PrivTr` in public interface +LL | | //~| WARNING hard error +LL | | type Alias: PrivTr; +LL | | fn f<T: PrivTr>(arg: T) {} //~ ERROR private trait `traits::PrivTr` in public interface +LL | | //~^ WARNING hard error +LL | | } + | |_____^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:70:9 + | +LL | fn f<T: PrivTr>(arg: T) {} //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:73:5 + | +LL | impl<T: PrivTr> Pub<T> {} //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:75:5 + | +LL | impl<T: PrivTr> PubTr for Pub<T> {} //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:84:5 + | +LL | pub type Alias<T> where T: PrivTr = T; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:87:5 + | +LL | pub trait Tr2<T> where T: PrivTr {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:91:9 + | +LL | fn f<T>(arg: T) where T: PrivTr {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:95:5 + | +LL | impl<T> Pub<T> where T: PrivTr {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:98:5 + | +LL | impl<T> PubTr for Pub<T> where T: PrivTr {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `generics::PrivTr<generics::Pub>` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:109:5 + | +LL | pub trait Tr1: PrivTr<Pub> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `generics::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:112:5 + | +LL | pub trait Tr2: PubTr<Priv> {} //~ ERROR private type `generics::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `generics::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:114:5 + | +LL | pub trait Tr3: PubTr<[Priv; 1]> {} //~ ERROR private type `generics::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `generics::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:116:5 + | +LL | pub trait Tr4: PubTr<Pub<Priv>> {} //~ ERROR private type `generics::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error[E0446]: private type `impls::Priv` in public interface + --> $DIR/private-in-public-warn.rs:143:9 + | +LL | struct Priv; + | - `impls::Priv` declared as private +... +LL | type Alias = Priv; //~ ERROR private type `impls::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^ can't leak private type + +error: private type `aliases_pub::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:214:9 + | +LL | pub fn f(arg: Priv) {} //~ ERROR private type `aliases_pub::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error[E0446]: private type `aliases_pub::Priv` in public interface + --> $DIR/private-in-public-warn.rs:218:9 + | +LL | struct Priv; + | - `aliases_pub::Priv` declared as private +... +LL | type Check = Priv; //~ ERROR private type `aliases_pub::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `aliases_pub::Priv` in public interface + --> $DIR/private-in-public-warn.rs:221:9 + | +LL | struct Priv; + | - `aliases_pub::Priv` declared as private +... +LL | type Check = Priv; //~ ERROR private type `aliases_pub::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `aliases_pub::Priv` in public interface + --> $DIR/private-in-public-warn.rs:224:9 + | +LL | struct Priv; + | - `aliases_pub::Priv` declared as private +... +LL | type Check = Priv; //~ ERROR private type `aliases_pub::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^ can't leak private type + +error: private trait `aliases_priv::PrivTr1` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:248:5 + | +LL | pub trait Tr1: PrivUseAliasTr {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private type `aliases_priv::Priv2` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:251:5 + | +LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: private trait `aliases_priv::PrivTr1<aliases_priv::Priv2>` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:251:5 + | +LL | pub trait Tr2: PrivUseAliasTr<PrivAlias> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: aborting due to 35 previous errors + +For more information about this error, try `rustc --explain E0446`. diff --git a/src/test/compile-fail/private-in-public.rs b/src/test/ui/compile-fail-migration/private-in-public.rs index b865e391d29..b865e391d29 100644 --- a/src/test/compile-fail/private-in-public.rs +++ b/src/test/ui/compile-fail-migration/private-in-public.rs diff --git a/src/test/ui/compile-fail-migration/private-in-public.stderr b/src/test/ui/compile-fail-migration/private-in-public.stderr new file mode 100644 index 00000000000..586327fbf26 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-in-public.stderr @@ -0,0 +1,268 @@ +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public.rs:23:5 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | pub const C: Priv = Priv; //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public.rs:24:5 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | pub static S: Priv = Priv; //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public.rs:25:5 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | pub fn f1(arg: Priv) {} //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public.rs:26:5 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | pub fn f2() -> Priv { panic!() } //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public.rs:27:19 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | pub struct S1(pub Priv); //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^ can't leak private type + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public.rs:28:21 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | pub struct S2 { pub field: Priv } //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public.rs:30:9 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | pub const C: Priv = Priv; //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public.rs:31:9 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | pub fn f1(arg: Priv) {} //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `types::Priv` in public interface + --> $DIR/private-in-public.rs:32:9 + | +LL | struct Priv; + | - `types::Priv` declared as private +... +LL | pub fn f2() -> Priv { panic!() } //~ ERROR private type `types::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0445]: private trait `traits::PrivTr` in public interface + --> $DIR/private-in-public.rs:41:5 + | +LL | pub enum E<T: PrivTr> { V(T) } //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + +error[E0445]: private trait `traits::PrivTr` in public interface + --> $DIR/private-in-public.rs:42:5 + | +LL | pub fn f<T: PrivTr>(arg: T) {} //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + +error[E0445]: private trait `traits::PrivTr` in public interface + --> $DIR/private-in-public.rs:43:5 + | +LL | pub struct S1<T: PrivTr>(T); //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + +error[E0445]: private trait `traits::PrivTr` in public interface + --> $DIR/private-in-public.rs:44:5 + | +LL | / impl<T: PrivTr> Pub<T> { //~ ERROR private trait `traits::PrivTr` in public interface +LL | | pub fn f<U: PrivTr>(arg: U) {} //~ ERROR private trait `traits::PrivTr` in public interface +LL | | } + | |_____^ can't leak private trait + +error[E0445]: private trait `traits::PrivTr` in public interface + --> $DIR/private-in-public.rs:45:9 + | +LL | pub fn f<U: PrivTr>(arg: U) {} //~ ERROR private trait `traits::PrivTr` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + +error[E0445]: private trait `traits_where::PrivTr` in public interface + --> $DIR/private-in-public.rs:54:5 + | +LL | pub enum E<T> where T: PrivTr { V(T) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + +error[E0445]: private trait `traits_where::PrivTr` in public interface + --> $DIR/private-in-public.rs:56:5 + | +LL | pub fn f<T>(arg: T) where T: PrivTr {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + +error[E0445]: private trait `traits_where::PrivTr` in public interface + --> $DIR/private-in-public.rs:58:5 + | +LL | pub struct S1<T>(T) where T: PrivTr; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + +error[E0445]: private trait `traits_where::PrivTr` in public interface + --> $DIR/private-in-public.rs:60:5 + | +LL | / impl<T> Pub<T> where T: PrivTr { +LL | | //~^ ERROR private trait `traits_where::PrivTr` in public interface +LL | | pub fn f<U>(arg: U) where U: PrivTr {} +LL | | //~^ ERROR private trait `traits_where::PrivTr` in public interface +LL | | } + | |_____^ can't leak private trait + +error[E0445]: private trait `traits_where::PrivTr` in public interface + --> $DIR/private-in-public.rs:62:9 + | +LL | pub fn f<U>(arg: U) where U: PrivTr {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private trait + +error[E0446]: private type `generics::Priv` in public interface + --> $DIR/private-in-public.rs:73:5 + | +LL | struct Priv<T = u8>(T); + | - `generics::Priv` declared as private +... +LL | pub fn f1(arg: [Priv; 1]) {} //~ ERROR private type `generics::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `generics::Priv` in public interface + --> $DIR/private-in-public.rs:74:5 + | +LL | struct Priv<T = u8>(T); + | - `generics::Priv` declared as private +... +LL | pub fn f2(arg: Pub<Priv>) {} //~ ERROR private type `generics::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `generics::Priv<generics::Pub>` in public interface + --> $DIR/private-in-public.rs:75:5 + | +LL | struct Priv<T = u8>(T); + | - `generics::Priv<generics::Pub>` declared as private +... +LL | pub fn f3(arg: Priv<Pub>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `impls::Priv` in public interface + --> $DIR/private-in-public.rs:90:9 + | +LL | struct Priv; + | - `impls::Priv` declared as private +... +LL | pub fn f(arg: Priv) {} //~ ERROR private type `impls::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `<aliases_pub::Priv as aliases_pub::PrivTr>::Assoc` in public interface + --> $DIR/private-in-public.rs:114:5 + | +LL | trait PrivTr { + | - `<aliases_pub::Priv as aliases_pub::PrivTr>::Assoc` declared as private +... +LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `aliases_pub::Priv` in public interface + --> $DIR/private-in-public.rs:114:5 + | +LL | struct Priv; + | - `aliases_pub::Priv` declared as private +... +LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `aliases_pub::Priv` in public interface + --> $DIR/private-in-public.rs:119:9 + | +LL | struct Priv; + | - `aliases_pub::Priv` declared as private +... +LL | pub fn f(arg: Priv) {} //~ ERROR private type `aliases_pub::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `aliases_priv::Priv1` in public interface + --> $DIR/private-in-public.rs:141:5 + | +LL | struct Priv1; + | - `aliases_priv::Priv1` declared as private +... +LL | pub fn f1(arg: PrivUseAlias) {} //~ ERROR private type `aliases_priv::Priv1` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `aliases_priv::Priv2` in public interface + --> $DIR/private-in-public.rs:142:5 + | +LL | struct Priv2; + | - `aliases_priv::Priv2` declared as private +... +LL | pub fn f2(arg: PrivAlias) {} //~ ERROR private type `aliases_priv::Priv2` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `<aliases_priv::Priv as aliases_priv::PrivTr>::Assoc` in public interface + --> $DIR/private-in-public.rs:143:5 + | +LL | trait PrivTr { + | - `<aliases_priv::Priv as aliases_priv::PrivTr>::Assoc` declared as private +... +LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `aliases_priv::Priv` in public interface + --> $DIR/private-in-public.rs:143:5 + | +LL | struct Priv; + | - `aliases_priv::Priv` declared as private +... +LL | pub fn f3(arg: <Priv as PrivTr>::Assoc) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `aliases_params::Priv` in public interface + --> $DIR/private-in-public.rs:153:5 + | +LL | struct Priv; + | - `aliases_params::Priv` declared as private +... +LL | pub fn f2(arg: PrivAliasGeneric) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `aliases_params::Priv` in public interface + --> $DIR/private-in-public.rs:155:5 + | +LL | struct Priv; + | - `aliases_params::Priv` declared as private +... +LL | pub fn f3(arg: Result<u8>) {} //~ ERROR private type `aliases_params::Priv` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error: aborting due to 32 previous errors + +Some errors occurred: E0445, E0446. +For more information about an error, try `rustc --explain E0445`. diff --git a/src/test/compile-fail/private-inferred-type-1.rs b/src/test/ui/compile-fail-migration/private-inferred-type-1.rs index ba8b3d1810a..ba8b3d1810a 100644 --- a/src/test/compile-fail/private-inferred-type-1.rs +++ b/src/test/ui/compile-fail-migration/private-inferred-type-1.rs diff --git a/src/test/ui/compile-fail-migration/private-inferred-type-1.stderr b/src/test/ui/compile-fail-migration/private-inferred-type-1.stderr new file mode 100644 index 00000000000..4036152c27f --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-inferred-type-1.stderr @@ -0,0 +1,14 @@ +error: type `m::Priv` is private + --> $DIR/private-inferred-type-1.rs:26:5 + | +LL | [].arr0_secret(); //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type-1.rs:27:5 + | +LL | None.ty_param_secret(); //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/private-inferred-type-2.rs b/src/test/ui/compile-fail-migration/private-inferred-type-2.rs index e981f125750..e981f125750 100644 --- a/src/test/compile-fail/private-inferred-type-2.rs +++ b/src/test/ui/compile-fail-migration/private-inferred-type-2.rs diff --git a/src/test/ui/compile-fail-migration/private-inferred-type-2.stderr b/src/test/ui/compile-fail-migration/private-inferred-type-2.stderr new file mode 100644 index 00000000000..0559473e361 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-inferred-type-2.stderr @@ -0,0 +1,20 @@ +error: type `m::Priv` is private + --> $DIR/private-inferred-type-2.rs:26:5 + | +LL | m::Pub::get_priv; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type-2.rs:27:5 + | +LL | m::Pub::static_method; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^ + +error: type `ext::Priv` is private + --> $DIR/private-inferred-type-2.rs:28:5 + | +LL | ext::Pub::static_method; //~ ERROR type `ext::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/private-inferred-type-3.rs b/src/test/ui/compile-fail-migration/private-inferred-type-3.rs index 0c393f02323..0c393f02323 100644 --- a/src/test/compile-fail/private-inferred-type-3.rs +++ b/src/test/ui/compile-fail-migration/private-inferred-type-3.rs diff --git a/src/test/ui/compile-fail-migration/private-inferred-type-3.stderr b/src/test/ui/compile-fail-migration/private-inferred-type-3.stderr new file mode 100644 index 00000000000..3c37a7ee1e8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-inferred-type-3.stderr @@ -0,0 +1,58 @@ +error: type `fn() {ext::priv_fn}` is private + --> $DIR/private-inferred-type-3.rs:26:5 + | +LL | ext::m!(); + | ^^^^^^^^^^ + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: static `PRIV_STATIC` is private + --> $DIR/private-inferred-type-3.rs:26:5 + | +LL | ext::m!(); + | ^^^^^^^^^^ + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: type `ext::PrivEnum` is private + --> $DIR/private-inferred-type-3.rs:26:5 + | +LL | ext::m!(); + | ^^^^^^^^^^ + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: type `fn() {<u8 as ext::PrivTrait>::method}` is private + --> $DIR/private-inferred-type-3.rs:26:5 + | +LL | ext::m!(); + | ^^^^^^^^^^ + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct::{{constructor}}}` is private + --> $DIR/private-inferred-type-3.rs:26:5 + | +LL | ext::m!(); + | ^^^^^^^^^^ + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: type `fn(u8) -> ext::PubTupleStruct {ext::PubTupleStruct::{{constructor}}}` is private + --> $DIR/private-inferred-type-3.rs:26:5 + | +LL | ext::m!(); + | ^^^^^^^^^^ + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: type `for<'r> fn(&'r ext::Pub<u8>) {<ext::Pub<u8>>::priv_method}` is private + --> $DIR/private-inferred-type-3.rs:26:5 + | +LL | ext::m!(); + | ^^^^^^^^^^ + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to 7 previous errors + diff --git a/src/test/compile-fail/private-inferred-type.rs b/src/test/ui/compile-fail-migration/private-inferred-type.rs index 3ca8b1eb2ed..3ca8b1eb2ed 100644 --- a/src/test/compile-fail/private-inferred-type.rs +++ b/src/test/ui/compile-fail-migration/private-inferred-type.rs diff --git a/src/test/ui/compile-fail-migration/private-inferred-type.stderr b/src/test/ui/compile-fail-migration/private-inferred-type.stderr new file mode 100644 index 00000000000..abbe43fe384 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-inferred-type.stderr @@ -0,0 +1,225 @@ +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:107:9 + | +LL | let _: m::Alias; //~ ERROR type `m::Priv` is private + | ^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:107:12 + | +LL | let _: m::Alias; //~ ERROR type `m::Priv` is private + | ^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:109:13 + | +LL | let _: <m::Alias as m::TraitWithAssocTy>::AssocTy; //~ ERROR type `m::Priv` is private + | ^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:110:5 + | +LL | m::Alias {}; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:111:5 + | +LL | m::Pub { 0: m::Alias {} }; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:113:5 + | +LL | m::Pub::static_method; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:114:5 + | +LL | m::Pub::INHERENT_ASSOC_CONST; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:115:5 + | +LL | m::Pub(0u8).method_with_substs::<m::Alias>(); //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:116:17 + | +LL | m::Pub(0u8).method_with_priv_params(loop{}); //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:117:5 + | +LL | <m::Alias as m::TraitWithAssocConst>::TRAIT_ASSOC_CONST; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:118:6 + | +LL | <m::Pub<m::Alias>>::INHERENT_ASSOC_CONST; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:119:5 + | +LL | <m::Pub<m::Alias>>::INHERENT_ASSOC_CONST_GENERIC_SELF; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:120:5 + | +LL | <m::Pub<m::Alias>>::static_method_generic_self; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:122:5 + | +LL | u8::pub_method; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^ + +error: type `adjust::S2` is private + --> $DIR/private-inferred-type.rs:124:5 + | +LL | adjust::S1.method_s3(); //~ ERROR type `adjust::S2` is private + | ^^^^^^^^^^ + +error: type `fn() {m::priv_fn}` is private + --> $DIR/private-inferred-type.rs:49:9 + | +LL | priv_fn; //~ ERROR type `fn() {m::priv_fn}` is private + | ^^^^^^^ +... +LL | m::m!(); + | -------- in this macro invocation + +error: type `m::PrivEnum` is private + --> $DIR/private-inferred-type.rs:51:9 + | +LL | PrivEnum::Variant; //~ ERROR type `m::PrivEnum` is private + | ^^^^^^^^^^^^^^^^^ +... +LL | m::m!(); + | -------- in this macro invocation + +error: type `fn() {<u8 as m::PrivTrait>::method}` is private + --> $DIR/private-inferred-type.rs:53:9 + | +LL | <u8 as PrivTrait>::method; //~ ERROR type `fn() {<u8 as m::PrivTrait>::method}` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | m::m!(); + | -------- in this macro invocation + +error: type `fn(u8) -> m::PrivTupleStruct {m::PrivTupleStruct::{{constructor}}}` is private + --> $DIR/private-inferred-type.rs:55:9 + | +LL | PrivTupleStruct; + | ^^^^^^^^^^^^^^^ +... +LL | m::m!(); + | -------- in this macro invocation + +error: type `fn(u8) -> m::PubTupleStruct {m::PubTupleStruct::{{constructor}}}` is private + --> $DIR/private-inferred-type.rs:57:9 + | +LL | PubTupleStruct; + | ^^^^^^^^^^^^^^ +... +LL | m::m!(); + | -------- in this macro invocation + +error: type `for<'r> fn(&'r m::Pub<u8>) {<m::Pub<u8>>::priv_method}` is private + --> $DIR/private-inferred-type.rs:59:18 + | +LL | Pub(0u8).priv_method(); + | ^^^^^^^^^^^ +... +LL | m::m!(); + | -------- in this macro invocation + +error: trait `m::Trait` is private + --> $DIR/private-inferred-type.rs:128:5 + | +LL | m::leak_anon1(); //~ ERROR trait `m::Trait` is private + | ^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:129:5 + | +LL | m::leak_anon2(); //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:130:5 + | +LL | m::leak_anon3(); //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^ + +error: type `(dyn m::Trait + 'static)` is private + --> $DIR/private-inferred-type.rs:132:5 + | +LL | m::leak_dyn1(); //~ ERROR type `(dyn m::Trait + 'static)` is private + | ^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:133:5 + | +LL | m::leak_dyn2(); //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:134:5 + | +LL | m::leak_dyn3(); //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:137:13 + | +LL | let a = m::Alias {}; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:138:17 + | +LL | let mut b = a; //~ ERROR type `m::Priv` is private + | ^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:139:9 + | +LL | b = a; //~ ERROR type `m::Priv` is private + | ^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:140:11 + | +LL | match a { //~ ERROR type `m::Priv` is private + | ^ + +error[E0446]: private type `m::Priv` in public interface + --> $DIR/private-inferred-type.rs:71:36 + | +LL | struct Priv; + | - `m::Priv` declared as private +... +LL | impl TraitWithAssocTy for u8 { type AssocTy = Priv; } + | ^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error[E0446]: private type `adjust::S2` in public interface + --> $DIR/private-inferred-type.rs:93:9 + | +LL | struct S2; + | - `adjust::S2` declared as private +... +LL | type Target = S2Alias; //~ ERROR private type `adjust::S2` in public interface + | ^^^^^^^^^^^^^^^^^^^^^^ can't leak private type + +error: aborting due to 33 previous errors + +For more information about this error, try `rustc --explain E0446`. diff --git a/src/test/compile-fail/private-item-simple.rs b/src/test/ui/compile-fail-migration/private-item-simple.rs index 2b9e32b8f58..2b9e32b8f58 100644 --- a/src/test/compile-fail/private-item-simple.rs +++ b/src/test/ui/compile-fail-migration/private-item-simple.rs diff --git a/src/test/ui/compile-fail-migration/private-item-simple.stderr b/src/test/ui/compile-fail-migration/private-item-simple.stderr new file mode 100644 index 00000000000..811b026eab9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-item-simple.stderr @@ -0,0 +1,9 @@ +error[E0603]: function `f` is private + --> $DIR/private-item-simple.rs:16:5 + | +LL | a::f(); //~ ERROR function `f` is private + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/private-method-cross-crate.rs b/src/test/ui/compile-fail-migration/private-method-cross-crate.rs index 68059baa385..68059baa385 100644 --- a/src/test/compile-fail/private-method-cross-crate.rs +++ b/src/test/ui/compile-fail-migration/private-method-cross-crate.rs diff --git a/src/test/ui/compile-fail-migration/private-method-cross-crate.stderr b/src/test/ui/compile-fail-migration/private-method-cross-crate.stderr new file mode 100644 index 00000000000..27d398c0166 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-method-cross-crate.stderr @@ -0,0 +1,9 @@ +error[E0624]: method `nap` is private + --> $DIR/private-method-cross-crate.rs:17:8 + | +LL | nyan.nap(); //~ ERROR method `nap` is private + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0624`. diff --git a/src/test/compile-fail/private-method-inherited.rs b/src/test/ui/compile-fail-migration/private-method-inherited.rs index c6419991b11..c6419991b11 100644 --- a/src/test/compile-fail/private-method-inherited.rs +++ b/src/test/ui/compile-fail-migration/private-method-inherited.rs diff --git a/src/test/ui/compile-fail-migration/private-method-inherited.stderr b/src/test/ui/compile-fail-migration/private-method-inherited.stderr new file mode 100644 index 00000000000..3f10750e46f --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-method-inherited.stderr @@ -0,0 +1,9 @@ +error[E0624]: method `f` is private + --> $DIR/private-method-inherited.rs:23:7 + | +LL | x.f(); //~ ERROR method `f` is private + | ^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0624`. diff --git a/src/test/compile-fail/private-method.rs b/src/test/ui/compile-fail-migration/private-method.rs index 16510c2c8c9..16510c2c8c9 100644 --- a/src/test/compile-fail/private-method.rs +++ b/src/test/ui/compile-fail-migration/private-method.rs diff --git a/src/test/ui/compile-fail-migration/private-method.stderr b/src/test/ui/compile-fail-migration/private-method.stderr new file mode 100644 index 00000000000..fce03d35e39 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-method.stderr @@ -0,0 +1,9 @@ +error[E0624]: method `nap` is private + --> $DIR/private-method.rs:34:8 + | +LL | nyan.nap(); + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0624`. diff --git a/src/test/compile-fail/private-struct-field-cross-crate.rs b/src/test/ui/compile-fail-migration/private-struct-field-cross-crate.rs index 067c17668c6..067c17668c6 100644 --- a/src/test/compile-fail/private-struct-field-cross-crate.rs +++ b/src/test/ui/compile-fail-migration/private-struct-field-cross-crate.rs diff --git a/src/test/ui/compile-fail-migration/private-struct-field-cross-crate.stderr b/src/test/ui/compile-fail-migration/private-struct-field-cross-crate.stderr new file mode 100644 index 00000000000..b9401baf0d0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-struct-field-cross-crate.stderr @@ -0,0 +1,9 @@ +error[E0616]: field `meows` of struct `cci_class::kitties::cat` is private + --> $DIR/private-struct-field-cross-crate.rs:17:14 + | +LL | assert_eq!(nyan.meows, 52); + | ^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0616`. diff --git a/src/test/compile-fail/private-struct-field-ctor.rs b/src/test/ui/compile-fail-migration/private-struct-field-ctor.rs index 0a0f2d490a8..0a0f2d490a8 100644 --- a/src/test/compile-fail/private-struct-field-ctor.rs +++ b/src/test/ui/compile-fail-migration/private-struct-field-ctor.rs diff --git a/src/test/ui/compile-fail-migration/private-struct-field-ctor.stderr b/src/test/ui/compile-fail-migration/private-struct-field-ctor.stderr new file mode 100644 index 00000000000..711d265c559 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-struct-field-ctor.stderr @@ -0,0 +1,9 @@ +error[E0451]: field `x` of struct `a::Foo` is private + --> $DIR/private-struct-field-ctor.rs:18:22 + | +LL | let s = a::Foo { x: 1 }; //~ ERROR field `x` of struct `a::Foo` is private + | ^^^^ field `x` is private + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0451`. diff --git a/src/test/compile-fail/private-struct-field-pattern.rs b/src/test/ui/compile-fail-migration/private-struct-field-pattern.rs index e9dd6cd1d74..e9dd6cd1d74 100644 --- a/src/test/compile-fail/private-struct-field-pattern.rs +++ b/src/test/ui/compile-fail-migration/private-struct-field-pattern.rs diff --git a/src/test/ui/compile-fail-migration/private-struct-field-pattern.stderr b/src/test/ui/compile-fail-migration/private-struct-field-pattern.stderr new file mode 100644 index 00000000000..bc09a2a6daf --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-struct-field-pattern.stderr @@ -0,0 +1,9 @@ +error[E0451]: field `x` of struct `a::Foo` is private + --> $DIR/private-struct-field-pattern.rs:25:15 + | +LL | Foo { x: _ } => {} //~ ERROR field `x` of struct `a::Foo` is private + | ^^^^ field `x` is private + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0451`. diff --git a/src/test/compile-fail/private-struct-field.rs b/src/test/ui/compile-fail-migration/private-struct-field.rs index 1423117dc81..1423117dc81 100644 --- a/src/test/compile-fail/private-struct-field.rs +++ b/src/test/ui/compile-fail-migration/private-struct-field.rs diff --git a/src/test/ui/compile-fail-migration/private-struct-field.stderr b/src/test/ui/compile-fail-migration/private-struct-field.stderr new file mode 100644 index 00000000000..db16e1ba1fc --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-struct-field.stderr @@ -0,0 +1,9 @@ +error[E0616]: field `meows` of struct `cat::Cat` is private + --> $DIR/private-struct-field.rs:23:16 + | +LL | assert_eq!(nyan.meows, 52); //~ ERROR field `meows` of struct `cat::Cat` is private + | ^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0616`. diff --git a/src/test/compile-fail/private-type-in-interface.rs b/src/test/ui/compile-fail-migration/private-type-in-interface.rs index 4235b4be271..4235b4be271 100644 --- a/src/test/compile-fail/private-type-in-interface.rs +++ b/src/test/ui/compile-fail-migration/private-type-in-interface.rs diff --git a/src/test/ui/compile-fail-migration/private-type-in-interface.stderr b/src/test/ui/compile-fail-migration/private-type-in-interface.stderr new file mode 100644 index 00000000000..5b12ed5e5f4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-type-in-interface.stderr @@ -0,0 +1,68 @@ +error: type `m::Priv` is private + --> $DIR/private-type-in-interface.rs:25:9 + | +LL | fn f(_: m::Alias) {} //~ ERROR type `m::Priv` is private + | ^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-type-in-interface.rs:25:6 + | +LL | fn f(_: m::Alias) {} //~ ERROR type `m::Priv` is private + | ^ + +error: type `ext::Priv` is private + --> $DIR/private-type-in-interface.rs:27:13 + | +LL | fn f_ext(_: ext::Alias) {} //~ ERROR type `ext::Priv` is private + | ^^^^^^^^^^ + +error: type `ext::Priv` is private + --> $DIR/private-type-in-interface.rs:27:10 + | +LL | fn f_ext(_: ext::Alias) {} //~ ERROR type `ext::Priv` is private + | ^ + +error: type `m::Priv` is private + --> $DIR/private-type-in-interface.rs:31:6 + | +LL | impl m::Alias {} //~ ERROR type `m::Priv` is private + | ^^^^^^^^ + +error: type `ext::Priv` is private + --> $DIR/private-type-in-interface.rs:32:14 + | +LL | impl Tr1 for ext::Alias {} //~ ERROR type `ext::Priv` is private + | ^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-type-in-interface.rs:33:10 + | +LL | type A = <m::Alias as m::Trait>::X; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-type-in-interface.rs:37:11 + | +LL | fn g() -> impl Tr2<m::Alias> { 0 } //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-type-in-interface.rs:37:16 + | +LL | fn g() -> impl Tr2<m::Alias> { 0 } //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^ + +error: type `ext::Priv` is private + --> $DIR/private-type-in-interface.rs:39:15 + | +LL | fn g_ext() -> impl Tr2<ext::Alias> { 0 } //~ ERROR type `ext::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^ + +error: type `ext::Priv` is private + --> $DIR/private-type-in-interface.rs:39:20 + | +LL | fn g_ext() -> impl Tr2<ext::Alias> { 0 } //~ ERROR type `ext::Priv` is private + | ^^^^^^^^^^^^^^^ + +error: aborting due to 11 previous errors + diff --git a/src/test/compile-fail/private-variant-reexport.rs b/src/test/ui/compile-fail-migration/private-variant-reexport.rs index 5d770f88155..5d770f88155 100644 --- a/src/test/compile-fail/private-variant-reexport.rs +++ b/src/test/ui/compile-fail-migration/private-variant-reexport.rs diff --git a/src/test/ui/compile-fail-migration/private-variant-reexport.stderr b/src/test/ui/compile-fail-migration/private-variant-reexport.stderr new file mode 100644 index 00000000000..11e13ab9ba8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/private-variant-reexport.stderr @@ -0,0 +1,29 @@ +error: variant `V` is private and cannot be re-exported + --> $DIR/private-variant-reexport.rs:12:13 + | +LL | pub use ::E::V; //~ ERROR variant `V` is private and cannot be re-exported + | ^^^^^^ +... +LL | enum E { V } + | ------ help: consider making the enum public: `pub enum E` + +error: variant `V` is private and cannot be re-exported + --> $DIR/private-variant-reexport.rs:16:19 + | +LL | pub use ::E::{V}; //~ ERROR variant `V` is private and cannot be re-exported + | ^ + +error: variant `V` is private and cannot be re-exported + --> $DIR/private-variant-reexport.rs:20:22 + | +LL | pub use ::E::V::{self}; //~ ERROR variant `V` is private and cannot be re-exported + | ^^^^ + +error: enum is private and its variants cannot be re-exported + --> $DIR/private-variant-reexport.rs:24:13 + | +LL | pub use ::E::*; //~ ERROR enum is private and its variants cannot be re-exported + | ^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/ptr-coercion.rs b/src/test/ui/compile-fail-migration/ptr-coercion.rs index 1390c9507c1..1390c9507c1 100644 --- a/src/test/compile-fail/ptr-coercion.rs +++ b/src/test/ui/compile-fail-migration/ptr-coercion.rs diff --git a/src/test/ui/compile-fail-migration/ptr-coercion.stderr b/src/test/ui/compile-fail-migration/ptr-coercion.stderr new file mode 100644 index 00000000000..c5ed80db1a8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/ptr-coercion.stderr @@ -0,0 +1,30 @@ +error[E0308]: mismatched types + --> $DIR/ptr-coercion.rs:17:25 + | +LL | let x: *mut isize = x; //~ ERROR mismatched types + | ^ types differ in mutability + | + = note: expected type `*mut isize` + found type `*const isize` + +error[E0308]: mismatched types + --> $DIR/ptr-coercion.rs:23:25 + | +LL | let x: *mut isize = &42; //~ ERROR mismatched types + | ^^^ types differ in mutability + | + = note: expected type `*mut isize` + found type `&isize` + +error[E0308]: mismatched types + --> $DIR/ptr-coercion.rs:29:25 + | +LL | let x: *mut isize = x; //~ ERROR mismatched types + | ^ types differ in mutability + | + = note: expected type `*mut isize` + found type `*const isize` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/pub-reexport-priv-extern-crate.rs b/src/test/ui/compile-fail-migration/pub-reexport-priv-extern-crate.rs index 2e71e007e9e..2e71e007e9e 100644 --- a/src/test/compile-fail/pub-reexport-priv-extern-crate.rs +++ b/src/test/ui/compile-fail-migration/pub-reexport-priv-extern-crate.rs diff --git a/src/test/ui/compile-fail-migration/pub-reexport-priv-extern-crate.stderr b/src/test/ui/compile-fail-migration/pub-reexport-priv-extern-crate.stderr new file mode 100644 index 00000000000..d298542bd5d --- /dev/null +++ b/src/test/ui/compile-fail-migration/pub-reexport-priv-extern-crate.stderr @@ -0,0 +1,30 @@ +error: extern crate `core` is private, and cannot be re-exported (error E0365), consider declaring with `pub` + --> $DIR/pub-reexport-priv-extern-crate.rs:14:9 + | +LL | pub use core as reexported_core; //~ ERROR `core` is private, and cannot be re-exported + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: #[deny(pub_use_of_private_extern_crate)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: extern crate `core` is private, and cannot be re-exported (error E0365), consider declaring with `pub` + --> $DIR/pub-reexport-priv-extern-crate.rs:22:9 + | +LL | use foo1::core; //~ ERROR `core` is private, and cannot be re-exported + | ^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: extern crate `core` is private, and cannot be re-exported (error E0365), consider declaring with `pub` + --> $DIR/pub-reexport-priv-extern-crate.rs:30:13 + | +LL | pub use foo2::bar::core; //~ ERROR `core` is private, and cannot be re-exported + | ^^^^^^^^^^^^^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #34537 <https://github.com/rust-lang/rust/issues/34537> + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/qualified-path-params.rs b/src/test/ui/compile-fail-migration/qualified-path-params.rs index 018a3b2ae32..018a3b2ae32 100644 --- a/src/test/compile-fail/qualified-path-params.rs +++ b/src/test/ui/compile-fail-migration/qualified-path-params.rs diff --git a/src/test/ui/compile-fail-migration/qualified-path-params.stderr b/src/test/ui/compile-fail-migration/qualified-path-params.stderr new file mode 100644 index 00000000000..e76c373eec5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/qualified-path-params.stderr @@ -0,0 +1,19 @@ +error[E0533]: expected unit struct/variant or constant, found method `<<S as Tr>::A>::f<u8>` + --> $DIR/qualified-path-params.rs:30:9 + | +LL | <S as Tr>::A::f::<u8> => {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/qualified-path-params.rs:32:15 + | +LL | 0 ..= <S as Tr>::A::f::<u8> => {} //~ ERROR only char and numeric types are allowed in range + | ^^^^^^^^^^^^^^^^^^^^^ ranges require char or numeric types + | + = note: start type: {integer} + = note: end type: fn() {S::f::<u8>} + +error: aborting due to 2 previous errors + +Some errors occurred: E0029, E0533. +For more information about an error, try `rustc --explain E0029`. diff --git a/src/test/compile-fail/question-mark-type-infer.rs b/src/test/ui/compile-fail-migration/question-mark-type-infer.rs index e15c9af41e0..e15c9af41e0 100644 --- a/src/test/compile-fail/question-mark-type-infer.rs +++ b/src/test/ui/compile-fail-migration/question-mark-type-infer.rs diff --git a/src/test/ui/compile-fail-migration/question-mark-type-infer.stderr b/src/test/ui/compile-fail-migration/question-mark-type-infer.stderr new file mode 100644 index 00000000000..53848ed0727 --- /dev/null +++ b/src/test/ui/compile-fail-migration/question-mark-type-infer.stderr @@ -0,0 +1,9 @@ +error[E0284]: type annotations required: cannot resolve `<_ as std::ops::Try>::Ok == _` + --> $DIR/question-mark-type-infer.rs:22:5 + | +LL | l.iter().map(f).collect()? //~ ERROR type annotations required: cannot resolve + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0284`. diff --git a/src/test/compile-fail/quote-with-interpolated.rs b/src/test/ui/compile-fail-migration/quote-with-interpolated.rs index 1fafb1c7a1b..1fafb1c7a1b 100644 --- a/src/test/compile-fail/quote-with-interpolated.rs +++ b/src/test/ui/compile-fail-migration/quote-with-interpolated.rs diff --git a/src/test/ui/compile-fail-migration/quote-with-interpolated.stderr b/src/test/ui/compile-fail-migration/quote-with-interpolated.stderr new file mode 100644 index 00000000000..10b3fc0a9ae --- /dev/null +++ b/src/test/ui/compile-fail-migration/quote-with-interpolated.stderr @@ -0,0 +1,11 @@ +error: quote! with interpolated token + --> $DIR/quote-with-interpolated.rs:15:29 + | +LL | quote_expr!(cx, $bar) //~ ERROR quote! with interpolated token + | ^^^^ +... +LL | foo!(bar); + | ---------- in this macro invocation + +error: aborting due to previous error + diff --git a/src/test/compile-fail/range-1.rs b/src/test/ui/compile-fail-migration/range-1.rs index 59c78052e15..59c78052e15 100644 --- a/src/test/compile-fail/range-1.rs +++ b/src/test/ui/compile-fail-migration/range-1.rs diff --git a/src/test/ui/compile-fail-migration/range-1.stderr b/src/test/ui/compile-fail-migration/range-1.stderr new file mode 100644 index 00000000000..7225c931fae --- /dev/null +++ b/src/test/ui/compile-fail-migration/range-1.stderr @@ -0,0 +1,28 @@ +error[E0308]: mismatched types + --> $DIR/range-1.rs:15:19 + | +LL | let _ = 0u32..10i32; + | ^^^^^ expected u32, found i32 + +error[E0277]: the trait bound `bool: std::iter::Step` is not satisfied + --> $DIR/range-1.rs:19:14 + | +LL | for i in false..true {} + | ^^^^^^^^^^^ the trait `std::iter::Step` is not implemented for `bool` + | + = note: required because of the requirements on the impl of `std::iter::Iterator` for `std::ops::Range<bool>` + +error[E0277]: the size for values of type `[{integer}]` cannot be known at compilation time + --> $DIR/range-1.rs:24:17 + | +LL | let range = *arr..; + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `[{integer}]` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required by `std::ops::RangeFrom` + +error: aborting due to 3 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/range_traits-1.rs b/src/test/ui/compile-fail-migration/range_traits-1.rs index 78d3702b449..78d3702b449 100644 --- a/src/test/compile-fail/range_traits-1.rs +++ b/src/test/ui/compile-fail-migration/range_traits-1.rs diff --git a/src/test/ui/compile-fail-migration/range_traits-1.stderr b/src/test/ui/compile-fail-migration/range_traits-1.stderr new file mode 100644 index 00000000000..ee72dfe13d4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/range_traits-1.stderr @@ -0,0 +1,105 @@ +error[E0277]: can't compare `std::ops::Range<usize>` with `std::ops::Range<usize>` + --> $DIR/range_traits-1.rs:15:5 + | +LL | a: Range<usize>, + | ^^^^^^^^^^^^^^^ no implementation for `std::ops::Range<usize> < std::ops::Range<usize>` and `std::ops::Range<usize> > std::ops::Range<usize>` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::Range<usize>` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: can't compare `std::ops::RangeTo<usize>` with `std::ops::RangeTo<usize>` + --> $DIR/range_traits-1.rs:18:5 + | +LL | b: RangeTo<usize>, + | ^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeTo<usize> < std::ops::RangeTo<usize>` and `std::ops::RangeTo<usize> > std::ops::RangeTo<usize>` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeTo<usize>` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: can't compare `std::ops::RangeFrom<usize>` with `std::ops::RangeFrom<usize>` + --> $DIR/range_traits-1.rs:21:5 + | +LL | c: RangeFrom<usize>, + | ^^^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeFrom<usize> < std::ops::RangeFrom<usize>` and `std::ops::RangeFrom<usize> > std::ops::RangeFrom<usize>` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFrom<usize>` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: can't compare `std::ops::RangeFull` with `std::ops::RangeFull` + --> $DIR/range_traits-1.rs:24:5 + | +LL | d: RangeFull, + | ^^^^^^^^^^^^ no implementation for `std::ops::RangeFull < std::ops::RangeFull` and `std::ops::RangeFull > std::ops::RangeFull` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFull` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: can't compare `std::ops::RangeInclusive<usize>` with `std::ops::RangeInclusive<usize>` + --> $DIR/range_traits-1.rs:27:5 + | +LL | e: RangeInclusive<usize>, + | ^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeInclusive<usize> < std::ops::RangeInclusive<usize>` and `std::ops::RangeInclusive<usize> > std::ops::RangeInclusive<usize>` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeInclusive<usize>` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: can't compare `std::ops::RangeToInclusive<usize>` with `std::ops::RangeToInclusive<usize>` + --> $DIR/range_traits-1.rs:30:5 + | +LL | f: RangeToInclusive<usize>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeToInclusive<usize> < std::ops::RangeToInclusive<usize>` and `std::ops::RangeToInclusive<usize> > std::ops::RangeToInclusive<usize>` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeToInclusive<usize>` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: the trait bound `std::ops::Range<usize>: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:15:5 + | +LL | a: Range<usize>, + | ^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::Range<usize>` + | + = note: required by `std::cmp::Ord::cmp` + +error[E0277]: the trait bound `std::ops::RangeTo<usize>: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:18:5 + | +LL | b: RangeTo<usize>, + | ^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeTo<usize>` + | + = note: required by `std::cmp::Ord::cmp` + +error[E0277]: the trait bound `std::ops::RangeFrom<usize>: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:21:5 + | +LL | c: RangeFrom<usize>, + | ^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeFrom<usize>` + | + = note: required by `std::cmp::Ord::cmp` + +error[E0277]: the trait bound `std::ops::RangeFull: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:24:5 + | +LL | d: RangeFull, + | ^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeFull` + | + = note: required by `std::cmp::Ord::cmp` + +error[E0277]: the trait bound `std::ops::RangeInclusive<usize>: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:27:5 + | +LL | e: RangeInclusive<usize>, + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeInclusive<usize>` + | + = note: required by `std::cmp::Ord::cmp` + +error[E0277]: the trait bound `std::ops::RangeToInclusive<usize>: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:30:5 + | +LL | f: RangeToInclusive<usize>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeToInclusive<usize>` + | + = note: required by `std::cmp::Ord::cmp` + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/range_traits-2.rs b/src/test/ui/compile-fail-migration/range_traits-2.rs index 64fcd25f538..64fcd25f538 100644 --- a/src/test/compile-fail/range_traits-2.rs +++ b/src/test/ui/compile-fail-migration/range_traits-2.rs diff --git a/src/test/ui/compile-fail-migration/range_traits-2.stderr b/src/test/ui/compile-fail-migration/range_traits-2.stderr new file mode 100644 index 00000000000..0151ede2164 --- /dev/null +++ b/src/test/ui/compile-fail-migration/range_traits-2.stderr @@ -0,0 +1,11 @@ +error[E0204]: the trait `Copy` may not be implemented for this type + --> $DIR/range_traits-2.rs:13:10 + | +LL | #[derive(Copy, Clone)] //~ ERROR Copy + | ^^^^ +LL | struct R(Range<usize>); + | ------------ this field does not implement `Copy` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0204`. diff --git a/src/test/compile-fail/range_traits-3.rs b/src/test/ui/compile-fail-migration/range_traits-3.rs index d26b7956ae8..d26b7956ae8 100644 --- a/src/test/compile-fail/range_traits-3.rs +++ b/src/test/ui/compile-fail-migration/range_traits-3.rs diff --git a/src/test/ui/compile-fail-migration/range_traits-3.stderr b/src/test/ui/compile-fail-migration/range_traits-3.stderr new file mode 100644 index 00000000000..a625fda2bc2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/range_traits-3.stderr @@ -0,0 +1,11 @@ +error[E0204]: the trait `Copy` may not be implemented for this type + --> $DIR/range_traits-3.rs:13:10 + | +LL | #[derive(Copy, Clone)] //~ ERROR Copy + | ^^^^ +LL | struct R(RangeFrom<usize>); + | ---------------- this field does not implement `Copy` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0204`. diff --git a/src/test/compile-fail/range_traits-4.rs b/src/test/ui/compile-fail-migration/range_traits-4.rs index 630969bdbdf..630969bdbdf 100644 --- a/src/test/compile-fail/range_traits-4.rs +++ b/src/test/ui/compile-fail-migration/range_traits-4.rs diff --git a/src/test/ui/compile-fail-migration/range_traits-4.stderr b/src/test/ui/compile-fail-migration/range_traits-4.stderr new file mode 100644 index 00000000000..cf8ae671ffc --- /dev/null +++ b/src/test/ui/compile-fail-migration/range_traits-4.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/range_traits-4.rs:19:1 + | +LL | fn main() {} //~ ERROR success + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/range_traits-5.rs b/src/test/ui/compile-fail-migration/range_traits-5.rs index 5963c4a9496..5963c4a9496 100644 --- a/src/test/compile-fail/range_traits-5.rs +++ b/src/test/ui/compile-fail-migration/range_traits-5.rs diff --git a/src/test/ui/compile-fail-migration/range_traits-5.stderr b/src/test/ui/compile-fail-migration/range_traits-5.stderr new file mode 100644 index 00000000000..eadb3a08ba0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/range_traits-5.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/range_traits-5.rs:19:1 + | +LL | fn main() {} //~ ERROR success + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/range_traits-6.rs b/src/test/ui/compile-fail-migration/range_traits-6.rs index f9510b5061c..f9510b5061c 100644 --- a/src/test/compile-fail/range_traits-6.rs +++ b/src/test/ui/compile-fail-migration/range_traits-6.rs diff --git a/src/test/ui/compile-fail-migration/range_traits-6.stderr b/src/test/ui/compile-fail-migration/range_traits-6.stderr new file mode 100644 index 00000000000..9470540cc5f --- /dev/null +++ b/src/test/ui/compile-fail-migration/range_traits-6.stderr @@ -0,0 +1,11 @@ +error[E0204]: the trait `Copy` may not be implemented for this type + --> $DIR/range_traits-6.rs:13:10 + | +LL | #[derive(Copy, Clone)] //~ ERROR Copy + | ^^^^ +LL | struct R(RangeInclusive<usize>); + | --------------------- this field does not implement `Copy` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0204`. diff --git a/src/test/compile-fail/range_traits-7.rs b/src/test/ui/compile-fail-migration/range_traits-7.rs index 871b55b85cf..871b55b85cf 100644 --- a/src/test/compile-fail/range_traits-7.rs +++ b/src/test/ui/compile-fail-migration/range_traits-7.rs diff --git a/src/test/ui/compile-fail-migration/range_traits-7.stderr b/src/test/ui/compile-fail-migration/range_traits-7.stderr new file mode 100644 index 00000000000..516667a11cd --- /dev/null +++ b/src/test/ui/compile-fail-migration/range_traits-7.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/range_traits-7.rs:19:1 + | +LL | fn main() {} //~ ERROR success + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/recursion.rs b/src/test/ui/compile-fail-migration/recursion.rs index 3221ae46296..3221ae46296 100644 --- a/src/test/compile-fail/recursion.rs +++ b/src/test/ui/compile-fail-migration/recursion.rs diff --git a/src/test/ui/compile-fail-migration/recursion.stderr b/src/test/ui/compile-fail-migration/recursion.stderr new file mode 100644 index 00000000000..5953e5c4087 --- /dev/null +++ b/src/test/ui/compile-fail-migration/recursion.stderr @@ -0,0 +1,14 @@ +error: reached the recursion limit while instantiating `test::<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Cons<Nil>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/recursion.rs:22:1 + | +LL | / fn test<T:Dot> (n:isize, i:isize, first:T, second:T) ->isize { //~ ERROR recursion limit +LL | | match n { 0 => {first.dot(second)} +LL | | // FIXME(#4287) Error message should be here. It should be +LL | | // a type error to instantiate `test` at a type other than T. +LL | | _ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})} +LL | | } +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/recursive-enum.rs b/src/test/ui/compile-fail-migration/recursive-enum.rs index 555755cdb96..555755cdb96 100644 --- a/src/test/compile-fail/recursive-enum.rs +++ b/src/test/ui/compile-fail-migration/recursive-enum.rs diff --git a/src/test/ui/compile-fail-migration/recursive-enum.stderr b/src/test/ui/compile-fail-migration/recursive-enum.stderr new file mode 100644 index 00000000000..c06058b2b59 --- /dev/null +++ b/src/test/ui/compile-fail-migration/recursive-enum.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `list` has infinite size + --> $DIR/recursive-enum.rs:11:1 + | +LL | enum list<T> { cons(T, list<T>), nil } + | ^^^^^^^^^^^^ ------- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `list` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/compile-fail/recursive-reexports.rs b/src/test/ui/compile-fail-migration/recursive-reexports.rs index b57b73325c0..b57b73325c0 100644 --- a/src/test/compile-fail/recursive-reexports.rs +++ b/src/test/ui/compile-fail-migration/recursive-reexports.rs diff --git a/src/test/ui/compile-fail-migration/recursive-reexports.stderr b/src/test/ui/compile-fail-migration/recursive-reexports.stderr new file mode 100644 index 00000000000..e6b8647a981 --- /dev/null +++ b/src/test/ui/compile-fail-migration/recursive-reexports.stderr @@ -0,0 +1,9 @@ +error[E0412]: cannot find type `S` in module `recursive_reexports` + --> $DIR/recursive-reexports.rs:15:32 + | +LL | fn f() -> recursive_reexports::S {} //~ ERROR cannot find type `S` in module `recursive_reexports` + | ^ not found in `recursive_reexports` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0412`. diff --git a/src/test/compile-fail/recursive-static-definition.rs b/src/test/ui/compile-fail-migration/recursive-static-definition.rs index 62c1859e09d..62c1859e09d 100644 --- a/src/test/compile-fail/recursive-static-definition.rs +++ b/src/test/ui/compile-fail-migration/recursive-static-definition.rs diff --git a/src/test/ui/compile-fail-migration/recursive-static-definition.stderr b/src/test/ui/compile-fail-migration/recursive-static-definition.stderr new file mode 100644 index 00000000000..2ab93bfd685 --- /dev/null +++ b/src/test/ui/compile-fail-migration/recursive-static-definition.stderr @@ -0,0 +1,11 @@ +error[E0391]: cycle detected when const-evaluating `FOO` + --> $DIR/recursive-static-definition.rs:11:23 + | +LL | pub static FOO: u32 = FOO; + | ^^^ + | + = note: ...which again requires const-evaluating `FOO`, completing the cycle + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/compile-fail/recursive-types-are-not-uninhabited.rs b/src/test/ui/compile-fail-migration/recursive-types-are-not-uninhabited.rs index fa936697072..fa936697072 100644 --- a/src/test/compile-fail/recursive-types-are-not-uninhabited.rs +++ b/src/test/ui/compile-fail-migration/recursive-types-are-not-uninhabited.rs diff --git a/src/test/ui/compile-fail-migration/recursive-types-are-not-uninhabited.stderr b/src/test/ui/compile-fail-migration/recursive-types-are-not-uninhabited.stderr new file mode 100644 index 00000000000..c4d40412760 --- /dev/null +++ b/src/test/ui/compile-fail-migration/recursive-types-are-not-uninhabited.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in local binding: `Err(_)` not covered + --> $DIR/recursive-types-are-not-uninhabited.rs:16:9 + | +LL | let Ok(x) = res; + | ^^^^^ pattern `Err(_)` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/ui/compile-fail-migration/ref-suggestion.nll.stderr b/src/test/ui/compile-fail-migration/ref-suggestion.nll.stderr new file mode 100644 index 00000000000..3fbd497c7ae --- /dev/null +++ b/src/test/ui/compile-fail-migration/ref-suggestion.nll.stderr @@ -0,0 +1,34 @@ +error[E0382]: use of moved value: `x` + --> $DIR/ref-suggestion.rs:14:5 + | +LL | let y = x; + | - value moved here +LL | x; //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/ref-suggestion.rs:18:5 + | +LL | let mut y = x; + | - value moved here +LL | x; //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/ref-suggestion.rs:26:5 + | +LL | (Some(y), ()) => {}, + | - value moved here +... +LL | x; //~ ERROR use of partially moved value + | ^ value used here after move + | + = note: move occurs because value has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/ref-suggestion.rs b/src/test/ui/compile-fail-migration/ref-suggestion.rs index 0a0867195d9..0a0867195d9 100644 --- a/src/test/compile-fail/ref-suggestion.rs +++ b/src/test/ui/compile-fail-migration/ref-suggestion.rs diff --git a/src/test/ui/compile-fail-migration/ref-suggestion.stderr b/src/test/ui/compile-fail-migration/ref-suggestion.stderr new file mode 100644 index 00000000000..63ee203ed24 --- /dev/null +++ b/src/test/ui/compile-fail-migration/ref-suggestion.stderr @@ -0,0 +1,34 @@ +error[E0382]: use of moved value: `x` + --> $DIR/ref-suggestion.rs:14:5 + | +LL | let y = x; + | - value moved here +LL | x; //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `x` + --> $DIR/ref-suggestion.rs:18:5 + | +LL | let mut y = x; + | ----- value moved here +LL | x; //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait + +error[E0382]: use of partially moved value: `x` + --> $DIR/ref-suggestion.rs:26:5 + | +LL | (Some(y), ()) => {}, + | - value moved here +... +LL | x; //~ ERROR use of partially moved value + | ^ value used here after move + | + = note: move occurs because the value has type `std::vec::Vec<i32>`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/refutable-pattern-errors.rs b/src/test/ui/compile-fail-migration/refutable-pattern-errors.rs index 7b4009481ab..7b4009481ab 100644 --- a/src/test/compile-fail/refutable-pattern-errors.rs +++ b/src/test/ui/compile-fail-migration/refutable-pattern-errors.rs diff --git a/src/test/ui/compile-fail-migration/refutable-pattern-errors.stderr b/src/test/ui/compile-fail-migration/refutable-pattern-errors.stderr new file mode 100644 index 00000000000..c2d5fe001fc --- /dev/null +++ b/src/test/ui/compile-fail-migration/refutable-pattern-errors.stderr @@ -0,0 +1,15 @@ +error[E0005]: refutable pattern in function argument: `(_, _)` not covered + --> $DIR/refutable-pattern-errors.rs:12:9 + | +LL | fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) { } + | ^^^^^^^^^^^^^^^^^^^^^ pattern `(_, _)` not covered + +error[E0005]: refutable pattern in local binding: `(_, _)` not covered + --> $DIR/refutable-pattern-errors.rs:16:9 + | +LL | let (1, (Some(1), 2..=3)) = (1, (None, 2)); + | ^^^^^^^^^^^^^^^^^^^^^ pattern `(_, _)` not covered + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/compile-fail/refutable-pattern-in-fn-arg.rs b/src/test/ui/compile-fail-migration/refutable-pattern-in-fn-arg.rs index be42f0f0ed8..be42f0f0ed8 100644 --- a/src/test/compile-fail/refutable-pattern-in-fn-arg.rs +++ b/src/test/ui/compile-fail-migration/refutable-pattern-in-fn-arg.rs diff --git a/src/test/ui/compile-fail-migration/refutable-pattern-in-fn-arg.stderr b/src/test/ui/compile-fail-migration/refutable-pattern-in-fn-arg.stderr new file mode 100644 index 00000000000..e03532667f5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/refutable-pattern-in-fn-arg.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in function argument: `_` not covered + --> $DIR/refutable-pattern-in-fn-arg.rs:12:14 + | +LL | let f = |3: isize| println!("hello"); + | ^ pattern `_` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.ast.nll.stderr b/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.ast.nll.stderr new file mode 100644 index 00000000000..5f386e58fac --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.ast.nll.stderr @@ -0,0 +1,25 @@ +error[E0597]: `x` does not live long enough + --> $DIR/region-borrow-params-issue-29793-big.rs:81:43 + | +LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`) + | --------- ^ borrowed value does not live long enough + | | + | value captured here +... +LL | }); + | - `x` dropped here while still borrowed + +error[E0597]: `y` does not live long enough + --> $DIR/region-borrow-params-issue-29793-big.rs:81:54 + | +LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`) + | --------- ^ borrowed value does not live long enough + | | + | value captured here +... +LL | }); + | - `y` dropped here while still borrowed + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.ast.stderr b/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.ast.stderr new file mode 100644 index 00000000000..23dc39db129 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.ast.stderr @@ -0,0 +1,29 @@ +error[E0597]: `x` does not live long enough + --> $DIR/region-borrow-params-issue-29793-big.rs:81:43 + | +LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`) + | --------- ^ borrowed value does not live long enough + | | + | capture occurs here +... +LL | }); + | - borrowed value dropped before borrower + | + = note: values in a scope are dropped in the opposite order they are created + +error[E0597]: `y` does not live long enough + --> $DIR/region-borrow-params-issue-29793-big.rs:81:54 + | +LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`) + | --------- ^ borrowed value does not live long enough + | | + | capture occurs here +... +LL | }); + | - borrowed value dropped before borrower + | + = note: values in a scope are dropped in the opposite order they are created + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.mir.stderr b/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.mir.stderr new file mode 100644 index 00000000000..5f386e58fac --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.mir.stderr @@ -0,0 +1,25 @@ +error[E0597]: `x` does not live long enough + --> $DIR/region-borrow-params-issue-29793-big.rs:81:43 + | +LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`) + | --------- ^ borrowed value does not live long enough + | | + | value captured here +... +LL | }); + | - `x` dropped here while still borrowed + +error[E0597]: `y` does not live long enough + --> $DIR/region-borrow-params-issue-29793-big.rs:81:54 + | +LL | WrapB::new().set(|t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`) + | --------- ^ borrowed value does not live long enough + | | + | value captured here +... +LL | }); + | - `y` dropped here while still borrowed + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/region-borrow-params-issue-29793-big.rs b/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.rs index 642e90f6de8..642e90f6de8 100644 --- a/src/test/compile-fail/region-borrow-params-issue-29793-big.rs +++ b/src/test/ui/compile-fail-migration/region-borrow-params-issue-29793-big.rs diff --git a/src/test/compile-fail/region-bound-extra-bound-in-inherent-impl.rs b/src/test/ui/compile-fail-migration/region-bound-extra-bound-in-inherent-impl.rs index c1df057b396..c1df057b396 100644 --- a/src/test/compile-fail/region-bound-extra-bound-in-inherent-impl.rs +++ b/src/test/ui/compile-fail-migration/region-bound-extra-bound-in-inherent-impl.rs diff --git a/src/test/ui/compile-fail-migration/region-bound-extra-bound-in-inherent-impl.stderr b/src/test/ui/compile-fail-migration/region-bound-extra-bound-in-inherent-impl.stderr new file mode 100644 index 00000000000..585ccf465d8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-bound-extra-bound-in-inherent-impl.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/region-bound-extra-bound-in-inherent-impl.rs:26:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/region-bound-on-closure-outlives-call.nll.stderr b/src/test/ui/compile-fail-migration/region-bound-on-closure-outlives-call.nll.stderr new file mode 100644 index 00000000000..da6ebaaefad --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-bound-on-closure-outlives-call.nll.stderr @@ -0,0 +1,14 @@ +error[E0505]: cannot move out of `f` because it is borrowed + --> $DIR/region-bound-on-closure-outlives-call.rs:12:25 + | +LL | (|x| f(x))(call_rec(f)) //~ ERROR cannot move out of `f` + | --------------------^-- + | || | | + | || | move out of `f` occurs here + | || borrow occurs due to use in closure + | |borrow of `f` occurs here + | borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/region-bound-on-closure-outlives-call.rs b/src/test/ui/compile-fail-migration/region-bound-on-closure-outlives-call.rs index b73c283fa51..b73c283fa51 100644 --- a/src/test/compile-fail/region-bound-on-closure-outlives-call.rs +++ b/src/test/ui/compile-fail-migration/region-bound-on-closure-outlives-call.rs diff --git a/src/test/ui/compile-fail-migration/region-bound-on-closure-outlives-call.stderr b/src/test/ui/compile-fail-migration/region-bound-on-closure-outlives-call.stderr new file mode 100644 index 00000000000..7adf68ee9b6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-bound-on-closure-outlives-call.stderr @@ -0,0 +1,11 @@ +error[E0505]: cannot move out of `f` because it is borrowed + --> $DIR/region-bound-on-closure-outlives-call.rs:12:25 + | +LL | (|x| f(x))(call_rec(f)) //~ ERROR cannot move out of `f` + | --- ^ move out of `f` occurs here + | | + | borrow of `f` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/region-bound-same-bounds-in-trait-and-impl.rs b/src/test/ui/compile-fail-migration/region-bound-same-bounds-in-trait-and-impl.rs index 3115e5a9a43..3115e5a9a43 100644 --- a/src/test/compile-fail/region-bound-same-bounds-in-trait-and-impl.rs +++ b/src/test/ui/compile-fail-migration/region-bound-same-bounds-in-trait-and-impl.rs diff --git a/src/test/ui/compile-fail-migration/region-bound-same-bounds-in-trait-and-impl.stderr b/src/test/ui/compile-fail-migration/region-bound-same-bounds-in-trait-and-impl.stderr new file mode 100644 index 00000000000..ce9dd59bbf5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-bound-same-bounds-in-trait-and-impl.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/region-bound-same-bounds-in-trait-and-impl.rs:27:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/region-bounds-on-objects-and-type-parameters.rs b/src/test/ui/compile-fail-migration/region-bounds-on-objects-and-type-parameters.rs index fd8d5ff9e7e..fd8d5ff9e7e 100644 --- a/src/test/compile-fail/region-bounds-on-objects-and-type-parameters.rs +++ b/src/test/ui/compile-fail-migration/region-bounds-on-objects-and-type-parameters.rs diff --git a/src/test/ui/compile-fail-migration/region-bounds-on-objects-and-type-parameters.stderr b/src/test/ui/compile-fail-migration/region-bounds-on-objects-and-type-parameters.stderr new file mode 100644 index 00000000000..7d1a836c674 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-bounds-on-objects-and-type-parameters.stderr @@ -0,0 +1,35 @@ +error[E0226]: only a single explicit lifetime bound is permitted + --> $DIR/region-bounds-on-objects-and-type-parameters.rs:31:22 + | +LL | z: Box<Is<'a>+'b+'c>, + | ^^ + +error[E0478]: lifetime bound not satisfied + --> $DIR/region-bounds-on-objects-and-type-parameters.rs:31:5 + | +LL | z: Box<Is<'a>+'b+'c>, + | ^^^^^^^^^^^^^^^^^^^^ + | +note: lifetime parameter instantiated with the lifetime 'b as defined on the struct at 21:15 + --> $DIR/region-bounds-on-objects-and-type-parameters.rs:21:15 + | +LL | struct Foo<'a,'b,'c> { //~ ERROR parameter `'c` is never used + | ^^ +note: but lifetime parameter must outlive the lifetime 'a as defined on the struct at 21:12 + --> $DIR/region-bounds-on-objects-and-type-parameters.rs:21:12 + | +LL | struct Foo<'a,'b,'c> { //~ ERROR parameter `'c` is never used + | ^^ + +error[E0392]: parameter `'c` is never used + --> $DIR/region-bounds-on-objects-and-type-parameters.rs:21:18 + | +LL | struct Foo<'a,'b,'c> { //~ ERROR parameter `'c` is never used + | ^^ unused type parameter + | + = help: consider removing `'c` or using a marker such as `std::marker::PhantomData` + +error: aborting due to 3 previous errors + +Some errors occurred: E0226, E0392, E0478. +For more information about an error, try `rustc --explain E0226`. diff --git a/src/test/ui/compile-fail-migration/region-invariant-static-error-reporting.nll.stderr b/src/test/ui/compile-fail-migration/region-invariant-static-error-reporting.nll.stderr new file mode 100644 index 00000000000..9fc12ae05b4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-invariant-static-error-reporting.nll.stderr @@ -0,0 +1,22 @@ +warning: not reporting region error due to nll + --> $DIR/region-invariant-static-error-reporting.rs:24:15 + | +LL | let bad = if x.is_some() { + | _______________^ +LL | | x.unwrap() +LL | | } else { +LL | | mk_static() +LL | | }; + | |_____^ + +error: borrowed data escapes outside of function + --> $DIR/region-invariant-static-error-reporting.rs:25:9 + | +LL | fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) { + | - `x` is a reference that is only valid in the function body +LL | let bad = if x.is_some() { +LL | x.unwrap() + | ^^^^^^^^^^ `x` escapes the function body here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/region-invariant-static-error-reporting.rs b/src/test/ui/compile-fail-migration/region-invariant-static-error-reporting.rs index 646ae8183a2..646ae8183a2 100644 --- a/src/test/compile-fail/region-invariant-static-error-reporting.rs +++ b/src/test/ui/compile-fail-migration/region-invariant-static-error-reporting.rs diff --git a/src/test/ui/compile-fail-migration/region-invariant-static-error-reporting.stderr b/src/test/ui/compile-fail-migration/region-invariant-static-error-reporting.stderr new file mode 100644 index 00000000000..a1f65561d3e --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-invariant-static-error-reporting.stderr @@ -0,0 +1,23 @@ +error[E0308]: if and else have incompatible types + --> $DIR/region-invariant-static-error-reporting.rs:24:15 + | +LL | let bad = if x.is_some() { + | _______________^ +LL | | x.unwrap() +LL | | } else { +LL | | mk_static() +LL | | }; + | |_____^ lifetime mismatch + | + = note: expected type `Invariant<'a>` + found type `Invariant<'static>` +note: the lifetime 'a as defined on the function body at 23:10... + --> $DIR/region-invariant-static-error-reporting.rs:23:10 + | +LL | fn unify<'a>(x: Option<Invariant<'a>>, f: fn(Invariant<'a>)) { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/region-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/compile-fail-migration/region-lifetime-bounds-on-fns-where-clause.nll.stderr new file mode 100644 index 00000000000..91243478313 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-lifetime-bounds-on-fns-where-clause.nll.stderr @@ -0,0 +1,24 @@ +warning: not reporting region error due to nll + --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:18:10 + | +LL | *x = *y; //~ ERROR E0623 + | ^^ + +warning: not reporting region error due to nll + --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:24:5 + | +LL | a(x, y); //~ ERROR 24:7: 24:8: lifetime mismatch [E0623] + | ^ + +error[E0308]: mismatched types + --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:30:43 + | +LL | let _: fn(&mut &isize, &mut &isize) = a; //~ ERROR mismatched types + | ^ expected concrete lifetime, found bound lifetime parameter + | + = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` + found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/region-lifetime-bounds-on-fns-where-clause.rs b/src/test/ui/compile-fail-migration/region-lifetime-bounds-on-fns-where-clause.rs index e3d96f52e81..e3d96f52e81 100644 --- a/src/test/compile-fail/region-lifetime-bounds-on-fns-where-clause.rs +++ b/src/test/ui/compile-fail-migration/region-lifetime-bounds-on-fns-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/region-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/compile-fail-migration/region-lifetime-bounds-on-fns-where-clause.stderr new file mode 100644 index 00000000000..0ca7ee8d8a5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-lifetime-bounds-on-fns-where-clause.stderr @@ -0,0 +1,31 @@ +error[E0623]: lifetime mismatch + --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:18:10 + | +LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) { + | --------- --------- these two types are declared with different lifetimes... +LL | // Illegal now because there is no `'b:'a` declaration. +LL | *x = *y; //~ ERROR E0623 + | ^^ ...but data from `y` flows into `x` here + +error[E0623]: lifetime mismatch + --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:24:7 + | +LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) { + | --------- --------- these two types are declared with different lifetimes... +... +LL | a(x, y); //~ ERROR 24:7: 24:8: lifetime mismatch [E0623] + | ^ ...but data from `y` flows into `x` here + +error[E0308]: mismatched types + --> $DIR/region-lifetime-bounds-on-fns-where-clause.rs:30:43 + | +LL | let _: fn(&mut &isize, &mut &isize) = a; //~ ERROR mismatched types + | ^ expected concrete lifetime, found bound lifetime parameter + | + = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` + found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + +error: aborting due to 3 previous errors + +Some errors occurred: E0308, E0623. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/compile-fail-migration/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr new file mode 100644 index 00000000000..655b199fc65 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr @@ -0,0 +1,30 @@ +warning: not reporting region error due to nll + --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:19:10 + | +LL | *x = *y; //~ ERROR E0623 + | ^^ + +warning: not reporting region error due to nll + --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:20:10 + | +LL | *z = *y; //~ ERROR E0623 + | ^^ + +warning: not reporting region error due to nll + --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:26:5 + | +LL | a(x, y, z); //~ ERROR 26:7: 26:8: lifetime mismatch [E0623] + | ^ + +error[E0308]: mismatched types + --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:32:56 + | +LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; //~ ERROR mismatched types + | ^ expected concrete lifetime, found bound lifetime parameter + | + = note: expected type `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)` + found type `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/region-multiple-lifetime-bounds-on-fns-where-clause.rs b/src/test/ui/compile-fail-migration/region-multiple-lifetime-bounds-on-fns-where-clause.rs index d8d12444ddd..d8d12444ddd 100644 --- a/src/test/compile-fail/region-multiple-lifetime-bounds-on-fns-where-clause.rs +++ b/src/test/ui/compile-fail-migration/region-multiple-lifetime-bounds-on-fns-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/region-multiple-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/compile-fail-migration/region-multiple-lifetime-bounds-on-fns-where-clause.stderr new file mode 100644 index 00000000000..26e24b2ed16 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-multiple-lifetime-bounds-on-fns-where-clause.stderr @@ -0,0 +1,42 @@ +error[E0623]: lifetime mismatch + --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:19:10 + | +LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { + | --------- --------- these two types are declared with different lifetimes... +LL | // Illegal now because there is no `'b:'a` declaration. +LL | *x = *y; //~ ERROR E0623 + | ^^ ...but data from `y` flows into `x` here + +error[E0623]: lifetime mismatch + --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:20:10 + | +LL | fn b<'a, 'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { + | --------- --------- + | | + | these two types are declared with different lifetimes... +... +LL | *z = *y; //~ ERROR E0623 + | ^^ ...but data from `y` flows into `z` here + +error[E0623]: lifetime mismatch + --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:26:7 + | +LL | fn c<'a,'b, 'c>(x: &mut &'a isize, y: &mut &'b isize, z: &mut &'c isize) { + | --------- --------- these two types are declared with different lifetimes... +... +LL | a(x, y, z); //~ ERROR 26:7: 26:8: lifetime mismatch [E0623] + | ^ ...but data from `y` flows into `x` here + +error[E0308]: mismatched types + --> $DIR/region-multiple-lifetime-bounds-on-fns-where-clause.rs:32:56 + | +LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; //~ ERROR mismatched types + | ^ expected concrete lifetime, found bound lifetime parameter + | + = note: expected type `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)` + found type `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}` + +error: aborting due to 4 previous errors + +Some errors occurred: E0308, E0623. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/region-object-lifetime-1.rs b/src/test/ui/compile-fail-migration/region-object-lifetime-1.rs index 1e615be9d6a..1e615be9d6a 100644 --- a/src/test/compile-fail/region-object-lifetime-1.rs +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-1.rs diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-1.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-1.stderr new file mode 100644 index 00000000000..39deed32c76 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-1.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/region-object-lifetime-1.rs:28:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-2.nll.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-2.nll.stderr new file mode 100644 index 00000000000..4395fee02c4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-2.nll.stderr @@ -0,0 +1,16 @@ +warning: not reporting region error due to nll + --> $DIR/region-object-lifetime-2.rs:20:7 + | +LL | x.borrowed() //~ ERROR cannot infer + | ^^^^^^^^ + +error: borrowed data escapes outside of function + --> $DIR/region-object-lifetime-2.rs:20:5 + | +LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () { + | - `x` is a reference that is only valid in the function body +LL | x.borrowed() //~ ERROR cannot infer + | ^^^^^^^^^^^^ `x` escapes the function body here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/region-object-lifetime-2.rs b/src/test/ui/compile-fail-migration/region-object-lifetime-2.rs index e011b8f5697..e011b8f5697 100644 --- a/src/test/compile-fail/region-object-lifetime-2.rs +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-2.rs diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-2.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-2.stderr new file mode 100644 index 00000000000..e396680f99b --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-2.stderr @@ -0,0 +1,30 @@ +error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements + --> $DIR/region-object-lifetime-2.rs:20:7 + | +LL | x.borrowed() //~ ERROR cannot infer + | ^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 19:42... + --> $DIR/region-object-lifetime-2.rs:19:42 + | +LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () { + | ^^ +note: ...so that the type `(dyn Foo + 'a)` is not borrowed for too long + --> $DIR/region-object-lifetime-2.rs:20:5 + | +LL | x.borrowed() //~ ERROR cannot infer + | ^ +note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 19:45... + --> $DIR/region-object-lifetime-2.rs:19:45 + | +LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a Foo) -> &'b () { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/region-object-lifetime-2.rs:20:5 + | +LL | x.borrowed() //~ ERROR cannot infer + | ^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/compile-fail/region-object-lifetime-3.rs b/src/test/ui/compile-fail-migration/region-object-lifetime-3.rs index 84dd97643a1..84dd97643a1 100644 --- a/src/test/compile-fail/region-object-lifetime-3.rs +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-3.rs diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-3.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-3.stderr new file mode 100644 index 00000000000..9431e8f5291 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-3.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/region-object-lifetime-3.rs:28:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-4.nll.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-4.nll.stderr new file mode 100644 index 00000000000..7bae6ccb37c --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-4.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/region-object-lifetime-4.rs:22:7 + | +LL | x.borrowed() //~ ERROR cannot infer + | ^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/region-object-lifetime-4.rs:22:5 + | +LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (Foo+'b)) -> &'b () { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | x.borrowed() //~ ERROR cannot infer + | ^^^^^^^^^^^^ argument requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/region-object-lifetime-4.rs b/src/test/ui/compile-fail-migration/region-object-lifetime-4.rs index 0a68e7f1076..0a68e7f1076 100644 --- a/src/test/compile-fail/region-object-lifetime-4.rs +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-4.rs diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-4.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-4.stderr new file mode 100644 index 00000000000..ef62afbef3b --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-4.stderr @@ -0,0 +1,30 @@ +error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements + --> $DIR/region-object-lifetime-4.rs:22:7 + | +LL | x.borrowed() //~ ERROR cannot infer + | ^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 21:41... + --> $DIR/region-object-lifetime-4.rs:21:41 + | +LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (Foo+'b)) -> &'b () { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/region-object-lifetime-4.rs:22:5 + | +LL | x.borrowed() //~ ERROR cannot infer + | ^ +note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 21:44... + --> $DIR/region-object-lifetime-4.rs:21:44 + | +LL | fn borrowed_receiver_related_lifetimes2<'a,'b>(x: &'a (Foo+'b)) -> &'b () { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/region-object-lifetime-4.rs:22:5 + | +LL | x.borrowed() //~ ERROR cannot infer + | ^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-5.nll.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-5.nll.stderr new file mode 100644 index 00000000000..3bfa5ec3941 --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-5.nll.stderr @@ -0,0 +1,13 @@ +error[E0597]: `*x` does not live long enough + --> $DIR/region-object-lifetime-5.rs:21:5 + | +LL | x.borrowed() //~ ERROR `*x` does not live long enough + | ^ borrowed value does not live long enough +LL | } + | - `*x` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/region-object-lifetime-5.rs b/src/test/ui/compile-fail-migration/region-object-lifetime-5.rs index 26aad0e33b1..26aad0e33b1 100644 --- a/src/test/compile-fail/region-object-lifetime-5.rs +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-5.rs diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-5.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-5.stderr new file mode 100644 index 00000000000..2dbdacfacdc --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-5.stderr @@ -0,0 +1,13 @@ +error[E0597]: `*x` does not live long enough + --> $DIR/region-object-lifetime-5.rs:21:5 + | +LL | x.borrowed() //~ ERROR `*x` does not live long enough + | ^ borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-in-coercion.nll.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-in-coercion.nll.stderr new file mode 100644 index 00000000000..87a0a3267ef --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-in-coercion.nll.stderr @@ -0,0 +1,74 @@ +warning: not reporting region error due to nll + --> $DIR/region-object-lifetime-in-coercion.rs:18:42 + | +LL | let x: Box<Foo + 'static> = Box::new(v); + | ^ + +warning: not reporting region error due to nll + --> $DIR/region-object-lifetime-in-coercion.rs:24:14 + | +LL | Box::new(v) + | ^ + +warning: not reporting region error due to nll + --> $DIR/region-object-lifetime-in-coercion.rs:31:14 + | +LL | Box::new(v) + | ^ + +warning: not reporting region error due to nll + --> $DIR/region-object-lifetime-in-coercion.rs:36:14 + | +LL | Box::new(v) + | ^ + +error[E0621]: explicit lifetime required in the type of `v` + --> $DIR/region-object-lifetime-in-coercion.rs:18:33 + | +LL | fn a(v: &[u8]) -> Box<Foo + 'static> { + | ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]` +LL | let x: Box<Foo + 'static> = Box::new(v); + | ^^^^^^^^^^^ lifetime `'static` required + +error[E0621]: explicit lifetime required in the type of `v` + --> $DIR/region-object-lifetime-in-coercion.rs:23:38 + | +LL | fn b(v: &[u8]) -> Box<Foo + 'static> { + | _________-----________________________^ + | | | + | | help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]` +LL | | Box::new(v) +LL | | //~^ ERROR explicit lifetime required in the type of `v` [E0621] +LL | | } + | |_^ lifetime `'static` required + +error[E0621]: explicit lifetime required in the type of `v` + --> $DIR/region-object-lifetime-in-coercion.rs:28:28 + | +LL | fn c(v: &[u8]) -> Box<Foo> { + | _________-----______________^ + | | | + | | help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]` +LL | | // same as previous case due to RFC 599 +LL | | +LL | | Box::new(v) +LL | | //~^ ERROR explicit lifetime required in the type of `v` [E0621] +LL | | } + | |_^ lifetime `'static` required + +error: unsatisfied lifetime constraints + --> $DIR/region-object-lifetime-in-coercion.rs:35:41 + | +LL | fn d<'a,'b>(v: &'a [u8]) -> Box<Foo+'b> { + | ______--_--______________________________^ + | | | | + | | | lifetime `'b` defined here + | | lifetime `'a` defined here +LL | | Box::new(v) +LL | | //~^ ERROR cannot infer an appropriate lifetime due to conflicting +LL | | } + | |_^ return requires that `'a` must outlive `'b` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/compile-fail/region-object-lifetime-in-coercion.rs b/src/test/ui/compile-fail-migration/region-object-lifetime-in-coercion.rs index 5bf397ab383..5bf397ab383 100644 --- a/src/test/compile-fail/region-object-lifetime-in-coercion.rs +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-in-coercion.rs diff --git a/src/test/ui/compile-fail-migration/region-object-lifetime-in-coercion.stderr b/src/test/ui/compile-fail-migration/region-object-lifetime-in-coercion.stderr new file mode 100644 index 00000000000..ac8c4d3a16a --- /dev/null +++ b/src/test/ui/compile-fail-migration/region-object-lifetime-in-coercion.stderr @@ -0,0 +1,52 @@ +error[E0621]: explicit lifetime required in the type of `v` + --> $DIR/region-object-lifetime-in-coercion.rs:18:33 + | +LL | fn a(v: &[u8]) -> Box<Foo + 'static> { + | ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]` +LL | let x: Box<Foo + 'static> = Box::new(v); + | ^^^^^^^^^^^ lifetime `'static` required + +error[E0621]: explicit lifetime required in the type of `v` + --> $DIR/region-object-lifetime-in-coercion.rs:24:5 + | +LL | fn b(v: &[u8]) -> Box<Foo + 'static> { + | ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]` +LL | Box::new(v) + | ^^^^^^^^^^^ lifetime `'static` required + +error[E0621]: explicit lifetime required in the type of `v` + --> $DIR/region-object-lifetime-in-coercion.rs:31:5 + | +LL | fn c(v: &[u8]) -> Box<Foo> { + | ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]` +... +LL | Box::new(v) + | ^^^^^^^^^^^ lifetime `'static` required + +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/region-object-lifetime-in-coercion.rs:36:14 + | +LL | Box::new(v) + | ^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 35:6... + --> $DIR/region-object-lifetime-in-coercion.rs:35:6 + | +LL | fn d<'a,'b>(v: &'a [u8]) -> Box<Foo+'b> { + | ^^ + = note: ...so that the expression is assignable: + expected &[u8] + found &'a [u8] +note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 35:9... + --> $DIR/region-object-lifetime-in-coercion.rs:35:9 + | +LL | fn d<'a,'b>(v: &'a [u8]) -> Box<Foo+'b> { + | ^^ + = note: ...so that the expression is assignable: + expected std::boxed::Box<(dyn Foo + 'b)> + found std::boxed::Box<dyn Foo> + +error: aborting due to 4 previous errors + +Some errors occurred: E0495, E0621. +For more information about an error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-addr-of-arg.nll.stderr b/src/test/ui/compile-fail-migration/regions-addr-of-arg.nll.stderr new file mode 100644 index 00000000000..9bfc80c9459 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-addr-of-arg.nll.stderr @@ -0,0 +1,27 @@ +error[E0597]: `a` does not live long enough + --> $DIR/regions-addr-of-arg.rs:15:30 + | +LL | let _p: &'static isize = &a; //~ ERROR `a` does not live long enough + | ^^ borrowed value does not live long enough +LL | } + | - `a` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `a` does not live long enough + --> $DIR/regions-addr-of-arg.rs:23:5 + | +LL | &a //~ ERROR `a` does not live long enough + | ^^ borrowed value does not live long enough +LL | } + | - `a` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 22:8... + --> $DIR/regions-addr-of-arg.rs:22:8 + | +LL | fn zed<'a>(a: isize) -> &'a isize { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-addr-of-arg.rs b/src/test/ui/compile-fail-migration/regions-addr-of-arg.rs index c54b4aaace5..c54b4aaace5 100644 --- a/src/test/compile-fail/regions-addr-of-arg.rs +++ b/src/test/ui/compile-fail-migration/regions-addr-of-arg.rs diff --git a/src/test/ui/compile-fail-migration/regions-addr-of-arg.stderr b/src/test/ui/compile-fail-migration/regions-addr-of-arg.stderr new file mode 100644 index 00000000000..9158a4ac7a7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-addr-of-arg.stderr @@ -0,0 +1,27 @@ +error[E0597]: `a` does not live long enough + --> $DIR/regions-addr-of-arg.rs:15:31 + | +LL | let _p: &'static isize = &a; //~ ERROR `a` does not live long enough + | ^ borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `a` does not live long enough + --> $DIR/regions-addr-of-arg.rs:23:6 + | +LL | &a //~ ERROR `a` does not live long enough + | ^ borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 22:8... + --> $DIR/regions-addr-of-arg.rs:22:8 + | +LL | fn zed<'a>(a: isize) -> &'a isize { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-addr-of-self.nll.stderr b/src/test/ui/compile-fail-migration/regions-addr-of-self.nll.stderr new file mode 100644 index 00000000000..cad1384f198 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-addr-of-self.nll.stderr @@ -0,0 +1,16 @@ +warning: not reporting region error due to nll + --> $DIR/regions-addr-of-self.rs:17:37 + | +LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-addr-of-self.rs:17:37 + | +LL | pub fn chase_cat(&mut self) { + | - let's call the lifetime of this reference `'1` +LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^^^^^^^^ requires that `'1` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-addr-of-self.rs b/src/test/ui/compile-fail-migration/regions-addr-of-self.rs index 04ee0526403..04ee0526403 100644 --- a/src/test/compile-fail/regions-addr-of-self.rs +++ b/src/test/ui/compile-fail-migration/regions-addr-of-self.rs diff --git a/src/test/ui/compile-fail-migration/regions-addr-of-self.stderr b/src/test/ui/compile-fail-migration/regions-addr-of-self.stderr new file mode 100644 index 00000000000..387aeeb8a5b --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-addr-of-self.stderr @@ -0,0 +1,29 @@ +error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements + --> $DIR/regions-addr-of-self.rs:17:37 + | +LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 16:5... + --> $DIR/regions-addr-of-self.rs:16:5 + | +LL | / pub fn chase_cat(&mut self) { +LL | | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer +LL | | *p += 1; +LL | | } + | |_____^ +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-addr-of-self.rs:17:37 + | +LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^^^^^^^^ + = note: but, the lifetime must be valid for the static lifetime... +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-addr-of-self.rs:17:37 + | +LL | let p: &'static mut usize = &mut self.cats_chased; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-addr-of-upvar-self.nll.stderr b/src/test/ui/compile-fail-migration/regions-addr-of-upvar-self.nll.stderr new file mode 100644 index 00000000000..733ac7a06ae --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-addr-of-upvar-self.nll.stderr @@ -0,0 +1,41 @@ +warning: not reporting region error due to nll + --> $DIR/regions-addr-of-upvar-self.rs:20:41 + | +LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-addr-of-upvar-self.rs:20:41 + | +LL | let _f = || { + | __________________- +LL | | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer + | | ^^^^^^^^^^^^^^ requires that `'1` must outlive `'static` +LL | | *p = 3; +LL | | }; + | |_________- lifetime `'1` represents the closure body + +error: unsatisfied lifetime constraints + --> $DIR/regions-addr-of-upvar-self.rs:19:13 + | +LL | pub fn chase_cat(&mut self) { + | - let's call the lifetime of this reference `'1` +LL | let _f = || { + | ^^ requires that `'1` must outlive `'static` + +error[E0597]: `self` does not live long enough + --> $DIR/regions-addr-of-upvar-self.rs:20:46 + | +LL | let _f = || { + | -- value captured here +LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer + | ^^^^ borrowed value does not live long enough +... +LL | } + | - `self` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-addr-of-upvar-self.rs b/src/test/ui/compile-fail-migration/regions-addr-of-upvar-self.rs index 28491f1155c..28491f1155c 100644 --- a/src/test/compile-fail/regions-addr-of-upvar-self.rs +++ b/src/test/ui/compile-fail-migration/regions-addr-of-upvar-self.rs diff --git a/src/test/ui/compile-fail-migration/regions-addr-of-upvar-self.stderr b/src/test/ui/compile-fail-migration/regions-addr-of-upvar-self.stderr new file mode 100644 index 00000000000..35e721288cd --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-addr-of-upvar-self.stderr @@ -0,0 +1,26 @@ +error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements + --> $DIR/regions-addr-of-upvar-self.rs:20:41 + | +LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime as defined on the body at 19:18... + --> $DIR/regions-addr-of-upvar-self.rs:19:18 + | +LL | let _f = || { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-addr-of-upvar-self.rs:20:41 + | +LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^ + = note: but, the lifetime must be valid for the static lifetime... +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-addr-of-upvar-self.rs:20:41 + | +LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-adjusted-lvalue-op.nll.stderr b/src/test/ui/compile-fail-migration/regions-adjusted-lvalue-op.nll.stderr new file mode 100644 index 00000000000..f342155c8b1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-adjusted-lvalue-op.nll.stderr @@ -0,0 +1,23 @@ +error[E0502]: cannot borrow `v` as immutable because it is also borrowed as mutable + --> $DIR/regions-adjusted-lvalue-op.rs:24:16 + | +LL | v[0].oh_no(&v); //~ ERROR cannot borrow `v` as immutable because + | -----------^^- + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + | borrow later used here + +error[E0502]: cannot borrow `v` as immutable because it is also borrowed as mutable + --> $DIR/regions-adjusted-lvalue-op.rs:25:16 + | +LL | (*v).oh_no(&v); //~ ERROR cannot borrow `v` as immutable because + | -----------^^- + | | | | + | | | immutable borrow occurs here + | | mutable borrow occurs here + | borrow later used here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/regions-adjusted-lvalue-op.rs b/src/test/ui/compile-fail-migration/regions-adjusted-lvalue-op.rs index bb02d6d8bba..bb02d6d8bba 100644 --- a/src/test/compile-fail/regions-adjusted-lvalue-op.rs +++ b/src/test/ui/compile-fail-migration/regions-adjusted-lvalue-op.rs diff --git a/src/test/ui/compile-fail-migration/regions-adjusted-lvalue-op.stderr b/src/test/ui/compile-fail-migration/regions-adjusted-lvalue-op.stderr new file mode 100644 index 00000000000..95228d9ccbb --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-adjusted-lvalue-op.stderr @@ -0,0 +1,21 @@ +error[E0502]: cannot borrow `v` as immutable because it is also borrowed as mutable + --> $DIR/regions-adjusted-lvalue-op.rs:24:17 + | +LL | v[0].oh_no(&v); //~ ERROR cannot borrow `v` as immutable because + | - ^- mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error[E0502]: cannot borrow `v` as immutable because it is also borrowed as mutable + --> $DIR/regions-adjusted-lvalue-op.rs:25:17 + | +LL | (*v).oh_no(&v); //~ ERROR cannot borrow `v` as immutable because + | - ^- mutable borrow ends here + | | | + | | immutable borrow occurs here + | mutable borrow occurs here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0502`. diff --git a/src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs b/src/test/ui/compile-fail-migration/regions-assoc-type-in-supertrait-outlives-container.rs index f2ff877cd82..f2ff877cd82 100644 --- a/src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs +++ b/src/test/ui/compile-fail-migration/regions-assoc-type-in-supertrait-outlives-container.rs diff --git a/src/test/ui/compile-fail-migration/regions-assoc-type-in-supertrait-outlives-container.stderr b/src/test/ui/compile-fail-migration/regions-assoc-type-in-supertrait-outlives-container.stderr new file mode 100644 index 00000000000..3bfc6d3682c --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-assoc-type-in-supertrait-outlives-container.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references + --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:50:12 + | +LL | let _: &'a WithAssoc<TheType<'b>> = loop { }; //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 44:15 + --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:44:15 + | +LL | fn with_assoc<'a,'b>() { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 44:18 + --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:44:18 + | +LL | fn with_assoc<'a,'b>() { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-assoc-type-region-bound-in-trait-not-met.rs b/src/test/ui/compile-fail-migration/regions-assoc-type-region-bound-in-trait-not-met.rs index f921eccef1f..f921eccef1f 100644 --- a/src/test/compile-fail/regions-assoc-type-region-bound-in-trait-not-met.rs +++ b/src/test/ui/compile-fail-migration/regions-assoc-type-region-bound-in-trait-not-met.rs diff --git a/src/test/ui/compile-fail-migration/regions-assoc-type-region-bound-in-trait-not-met.stderr b/src/test/ui/compile-fail-migration/regions-assoc-type-region-bound-in-trait-not-met.stderr new file mode 100644 index 00000000000..2261e92166e --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-assoc-type-region-bound-in-trait-not-met.stderr @@ -0,0 +1,49 @@ +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:24:10 + | +LL | impl<'a> Foo<'static> for &'a i32 { + | ^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 24:6... + --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:24:6 + | +LL | impl<'a> Foo<'static> for &'a i32 { + | ^^ + = note: ...so that the types are compatible: + expected Foo<'static> + found Foo<'static> + = note: but, the lifetime must be valid for the static lifetime... +note: ...so that the type `&i32` will meet its required lifetime bounds + --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:24:10 + | +LL | impl<'a> Foo<'static> for &'a i32 { + | ^^^^^^^^^^^^ + +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:29:13 + | +LL | impl<'a,'b> Foo<'b> for &'a i64 { + | ^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 29:6... + --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:29:6 + | +LL | impl<'a,'b> Foo<'b> for &'a i64 { + | ^^ + = note: ...so that the types are compatible: + expected Foo<'b> + found Foo<'_> +note: but, the lifetime must be valid for the lifetime 'b as defined on the impl at 29:9... + --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:29:9 + | +LL | impl<'a,'b> Foo<'b> for &'a i64 { + | ^^ +note: ...so that the type `&i32` will meet its required lifetime bounds + --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:29:13 + | +LL | impl<'a,'b> Foo<'b> for &'a i64 { + | ^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/compile-fail/regions-assoc-type-static-bound-in-trait-not-met.rs b/src/test/ui/compile-fail-migration/regions-assoc-type-static-bound-in-trait-not-met.rs index 1cf83b8ac58..1cf83b8ac58 100644 --- a/src/test/compile-fail/regions-assoc-type-static-bound-in-trait-not-met.rs +++ b/src/test/ui/compile-fail-migration/regions-assoc-type-static-bound-in-trait-not-met.rs diff --git a/src/test/ui/compile-fail-migration/regions-assoc-type-static-bound-in-trait-not-met.stderr b/src/test/ui/compile-fail-migration/regions-assoc-type-static-bound-in-trait-not-met.stderr new file mode 100644 index 00000000000..a7ae685c3a4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-assoc-type-static-bound-in-trait-not-met.stderr @@ -0,0 +1,24 @@ +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:19:10 + | +LL | impl<'a> Foo for &'a i32 { + | ^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 19:6... + --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:19:6 + | +LL | impl<'a> Foo for &'a i32 { + | ^^ + = note: ...so that the types are compatible: + expected Foo + found Foo + = note: but, the lifetime must be valid for the static lifetime... +note: ...so that the type `&i32` will meet its required lifetime bounds + --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:19:10 + | +LL | impl<'a> Foo for &'a i32 { + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/compile-fail/regions-bounded-by-trait-requiring-static.rs b/src/test/ui/compile-fail-migration/regions-bounded-by-trait-requiring-static.rs index 19c50d57e1b..19c50d57e1b 100644 --- a/src/test/compile-fail/regions-bounded-by-trait-requiring-static.rs +++ b/src/test/ui/compile-fail-migration/regions-bounded-by-trait-requiring-static.rs diff --git a/src/test/ui/compile-fail-migration/regions-bounded-by-trait-requiring-static.stderr b/src/test/ui/compile-fail-migration/regions-bounded-by-trait-requiring-static.stderr new file mode 100644 index 00000000000..82fa271ca4e --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-bounded-by-trait-requiring-static.stderr @@ -0,0 +1,51 @@ +error[E0477]: the type `&'a isize` does not fulfill the required lifetime + --> $DIR/regions-bounded-by-trait-requiring-static.rs:32:5 + | +LL | assert_send::<&'a isize>(); //~ ERROR does not fulfill the required lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime + +error[E0477]: the type `&'a str` does not fulfill the required lifetime + --> $DIR/regions-bounded-by-trait-requiring-static.rs:36:5 + | +LL | assert_send::<&'a str>(); //~ ERROR does not fulfill the required lifetime + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime + +error[E0477]: the type `&'a [isize]` does not fulfill the required lifetime + --> $DIR/regions-bounded-by-trait-requiring-static.rs:40:5 + | +LL | assert_send::<&'a [isize]>(); //~ ERROR does not fulfill the required lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime + +error[E0477]: the type `std::boxed::Box<&'a isize>` does not fulfill the required lifetime + --> $DIR/regions-bounded-by-trait-requiring-static.rs:54:5 + | +LL | assert_send::<Box<&'a isize>>(); //~ ERROR does not fulfill the required lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime + +error[E0477]: the type `*const &'a isize` does not fulfill the required lifetime + --> $DIR/regions-bounded-by-trait-requiring-static.rs:65:5 + | +LL | assert_send::<*const &'a isize>(); //~ ERROR does not fulfill the required lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime + +error[E0477]: the type `*mut &'a isize` does not fulfill the required lifetime + --> $DIR/regions-bounded-by-trait-requiring-static.rs:69:5 + | +LL | assert_send::<*mut &'a isize>(); //~ ERROR does not fulfill the required lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-cross-crate.nll.stderr b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-cross-crate.nll.stderr new file mode 100644 index 00000000000..553eedec398 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-cross-crate.nll.stderr @@ -0,0 +1,19 @@ +warning: not reporting region error due to nll + --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:30:7 + | +LL | a.bigger_region(b) //~ ERROR 30:7: 30:20: lifetime mismatch [E0623] + | ^^^^^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:30:5 + | +LL | fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) { + | -- -- lifetime `'y` defined here + | | + | lifetime `'x` defined here +LL | // Here the value provided for 'y is 'y, and hence 'y:'x does not hold. +LL | a.bigger_region(b) //~ ERROR 30:7: 30:20: lifetime mismatch [E0623] + | ^^^^^^^^^^^^^^^^^^ argument requires that `'y` must outlive `'x` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-bounded-method-type-parameters-cross-crate.rs b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-cross-crate.rs index 24e4c5fbd91..24e4c5fbd91 100644 --- a/src/test/compile-fail/regions-bounded-method-type-parameters-cross-crate.rs +++ b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-cross-crate.rs diff --git a/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-cross-crate.stderr b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-cross-crate.stderr new file mode 100644 index 00000000000..898629d8ab9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-cross-crate.stderr @@ -0,0 +1,12 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-bounded-method-type-parameters-cross-crate.rs:30:7 + | +LL | fn call_bigger_region<'x, 'y>(a: Inv<'x>, b: Inv<'y>) { + | ------- ------- these two types are declared with different lifetimes... +LL | // Here the value provided for 'y is 'y, and hence 'y:'x does not hold. +LL | a.bigger_region(b) //~ ERROR 30:7: 30:20: lifetime mismatch [E0623] + | ^^^^^^^^^^^^^ ...but data from `b` flows into `a` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-trait-bound.nll.stderr b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-trait-bound.nll.stderr new file mode 100644 index 00000000000..adcf4921e53 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-trait-bound.nll.stderr @@ -0,0 +1,19 @@ +warning: not reporting region error due to nll + --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:30:7 + | +LL | f.method(b); //~ ERROR 30:7: 30:13: lifetime mismatch [E0623] + | ^^^^^^ + +error: borrowed data escapes outside of function + --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:30:5 + | +LL | fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) { + | - - `b` is a reference that is only valid in the function body + | | + | `a` is declared here, outside of the function body +LL | // Here the value provided for 'y is 'b, and hence 'b:'a does not hold. +LL | f.method(b); //~ ERROR 30:7: 30:13: lifetime mismatch [E0623] + | ^^^^^^^^^^^ `b` escapes the function body here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-bounded-method-type-parameters-trait-bound.rs b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-trait-bound.rs index 3e9d2aa6c3b..3e9d2aa6c3b 100644 --- a/src/test/compile-fail/regions-bounded-method-type-parameters-trait-bound.rs +++ b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-trait-bound.rs diff --git a/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-trait-bound.stderr b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-trait-bound.stderr new file mode 100644 index 00000000000..f9f9c38b1b6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters-trait-bound.stderr @@ -0,0 +1,12 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:30:7 + | +LL | fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) { + | ------- ------- these two types are declared with different lifetimes... +LL | // Here the value provided for 'y is 'b, and hence 'b:'a does not hold. +LL | f.method(b); //~ ERROR 30:7: 30:13: lifetime mismatch [E0623] + | ^^^^^^ ...but data from `b` flows into `a` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/regions-bounded-method-type-parameters.rs b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters.rs index da4e8231a23..da4e8231a23 100644 --- a/src/test/compile-fail/regions-bounded-method-type-parameters.rs +++ b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters.rs diff --git a/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters.stderr b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters.stderr new file mode 100644 index 00000000000..8649ca9281f --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-bounded-method-type-parameters.stderr @@ -0,0 +1,11 @@ +error[E0477]: the type `&'a isize` does not fulfill the required lifetime + --> $DIR/regions-bounded-method-type-parameters.rs:22:9 + | +LL | Foo.some_method::<&'a isize>(); + | ^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0477`. diff --git a/src/test/ui/compile-fail-migration/regions-bounds.nll.stderr b/src/test/ui/compile-fail-migration/regions-bounds.nll.stderr new file mode 100644 index 00000000000..4d4a30a88c6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-bounds.nll.stderr @@ -0,0 +1,34 @@ +warning: not reporting region error due to nll + --> $DIR/regions-bounds.rs:19:12 + | +LL | return e; //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/regions-bounds.rs:23:12 + | +LL | return e; //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-bounds.rs:19:12 + | +LL | fn a_fn1<'a,'b>(e: an_enum<'a>) -> an_enum<'b> { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | return e; //~ ERROR mismatched types + | ^ return requires that `'a` must outlive `'b` + +error: unsatisfied lifetime constraints + --> $DIR/regions-bounds.rs:23:12 + | +LL | fn a_fn3<'a,'b>(e: a_class<'a>) -> a_class<'b> { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | return e; //~ ERROR mismatched types + | ^ return requires that `'a` must outlive `'b` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/regions-bounds.rs b/src/test/ui/compile-fail-migration/regions-bounds.rs index 5ce80be98d9..5ce80be98d9 100644 --- a/src/test/compile-fail/regions-bounds.rs +++ b/src/test/ui/compile-fail-migration/regions-bounds.rs diff --git a/src/test/ui/compile-fail-migration/regions-bounds.stderr b/src/test/ui/compile-fail-migration/regions-bounds.stderr new file mode 100644 index 00000000000..7d5a47c0df3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-bounds.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/regions-bounds.rs:19:12 + | +LL | return e; //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `an_enum<'b>` + found type `an_enum<'a>` +note: the lifetime 'a as defined on the function body at 18:10... + --> $DIR/regions-bounds.rs:18:10 + | +LL | fn a_fn1<'a,'b>(e: an_enum<'a>) -> an_enum<'b> { + | ^^ +note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 18:13 + --> $DIR/regions-bounds.rs:18:13 + | +LL | fn a_fn1<'a,'b>(e: an_enum<'a>) -> an_enum<'b> { + | ^^ + +error[E0308]: mismatched types + --> $DIR/regions-bounds.rs:23:12 + | +LL | return e; //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `a_class<'b>` + found type `a_class<'a>` +note: the lifetime 'a as defined on the function body at 22:10... + --> $DIR/regions-bounds.rs:22:10 + | +LL | fn a_fn3<'a,'b>(e: a_class<'a>) -> a_class<'b> { + | ^^ +note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 22:13 + --> $DIR/regions-bounds.rs:22:13 + | +LL | fn a_fn3<'a,'b>(e: a_class<'a>) -> a_class<'b> { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/regions-close-associated-type-into-object.nll.stderr b/src/test/ui/compile-fail-migration/regions-close-associated-type-into-object.nll.stderr new file mode 100644 index 00000000000..5bec650a41d --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-associated-type-into-object.nll.stderr @@ -0,0 +1,60 @@ +warning: not reporting region error due to nll + --> $DIR/regions-close-associated-type-into-object.rs:25:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-associated-type-into-object.rs:32:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-associated-type-into-object.rs:38:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-associated-type-into-object.rs:45:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +error[E0310]: the associated type `<T as Iter>::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:25:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`... + +error[E0310]: the associated type `<T as Iter>::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:32:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`... + +error[E0309]: the associated type `<T as Iter>::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:38:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`... + +error[E0309]: the associated type `<T as Iter>::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:45:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`... + +error: aborting due to 4 previous errors + +Some errors occurred: E0309, E0310. +For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/regions-close-associated-type-into-object.rs b/src/test/ui/compile-fail-migration/regions-close-associated-type-into-object.rs index 6b88abfca6c..6b88abfca6c 100644 --- a/src/test/compile-fail/regions-close-associated-type-into-object.rs +++ b/src/test/ui/compile-fail-migration/regions-close-associated-type-into-object.rs diff --git a/src/test/ui/compile-fail-migration/regions-close-associated-type-into-object.stderr b/src/test/ui/compile-fail-migration/regions-close-associated-type-into-object.stderr new file mode 100644 index 00000000000..9d56de4c152 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-associated-type-into-object.stderr @@ -0,0 +1,56 @@ +error[E0310]: the associated type `<T as Iter>::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:25:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`... +note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds + --> $DIR/regions-close-associated-type-into-object.rs:25:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +error[E0310]: the associated type `<T as Iter>::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:32:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`... +note: ...so that the type `std::boxed::Box<<T as Iter>::Item>` will meet its required lifetime bounds + --> $DIR/regions-close-associated-type-into-object.rs:32:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +error[E0309]: the associated type `<T as Iter>::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:38:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`... +note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds + --> $DIR/regions-close-associated-type-into-object.rs:38:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +error[E0309]: the associated type `<T as Iter>::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:45:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`... +note: ...so that the type `std::boxed::Box<<T as Iter>::Item>` will meet its required lifetime bounds + --> $DIR/regions-close-associated-type-into-object.rs:45:5 + | +LL | Box::new(item) //~ ERROR associated type `<T as Iter>::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0309, E0310. +For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-1.nll.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-1.nll.stderr new file mode 100644 index 00000000000..84e486872a7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-1.nll.stderr @@ -0,0 +1,13 @@ +error[E0597]: `*v` does not live long enough + --> $DIR/regions-close-object-into-object-1.rs:22:11 + | +LL | box B(&*v) as Box<X> //~ ERROR `*v` does not live long enough + | ^^^ borrowed value does not live long enough +LL | } + | - `*v` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-close-object-into-object-1.rs b/src/test/ui/compile-fail-migration/regions-close-object-into-object-1.rs index 5d9818d624b..5d9818d624b 100644 --- a/src/test/compile-fail/regions-close-object-into-object-1.rs +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-1.rs diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-1.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-1.stderr new file mode 100644 index 00000000000..bd05a63c398 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-1.stderr @@ -0,0 +1,13 @@ +error[E0597]: `*v` does not live long enough + --> $DIR/regions-close-object-into-object-1.rs:22:12 + | +LL | box B(&*v) as Box<X> //~ ERROR `*v` does not live long enough + | ^^ borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-2.nll.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-2.nll.stderr new file mode 100644 index 00000000000..5258dbe793a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-2.nll.stderr @@ -0,0 +1,30 @@ +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-2.rs:20:11 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-close-object-into-object-2.rs:19:57 + | +LL | fn g<'a, T: 'static>(v: Box<A<T>+'a>) -> Box<X+'static> { + | ______--_________________________________________________^ + | | | + | | lifetime `'a` defined here +LL | | box B(&*v) as Box<X> //~ ERROR cannot infer +LL | | } + | |_^ return requires that `'a` must outlive `'static` + +error[E0597]: `*v` does not live long enough + --> $DIR/regions-close-object-into-object-2.rs:20:11 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^ borrowed value does not live long enough +LL | } + | - `*v` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-close-object-into-object-2.rs b/src/test/ui/compile-fail-migration/regions-close-object-into-object-2.rs index 6cef9956655..6cef9956655 100644 --- a/src/test/compile-fail/regions-close-object-into-object-2.rs +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-2.rs diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-2.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-2.stderr new file mode 100644 index 00000000000..b2e44cd2c77 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-2.stderr @@ -0,0 +1,24 @@ +error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements + --> $DIR/regions-close-object-into-object-2.rs:20:11 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 19:6... + --> $DIR/regions-close-object-into-object-2.rs:19:6 + | +LL | fn g<'a, T: 'static>(v: Box<A<T>+'a>) -> Box<X+'static> { + | ^^ +note: ...so that the type `(dyn A<T> + 'a)` is not borrowed for too long + --> $DIR/regions-close-object-into-object-2.rs:20:11 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^ + = note: but, the lifetime must be valid for the static lifetime... + = note: ...so that the expression is assignable: + expected std::boxed::Box<(dyn X + 'static)> + found std::boxed::Box<dyn X> + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-3.nll.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-3.nll.stderr new file mode 100644 index 00000000000..62504ab8d80 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-3.nll.stderr @@ -0,0 +1,13 @@ +error[E0597]: `*v` does not live long enough + --> $DIR/regions-close-object-into-object-3.rs:21:11 + | +LL | box B(&*v) as Box<X> //~ ERROR `*v` does not live long enough + | ^^^ borrowed value does not live long enough +LL | } + | - `*v` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-close-object-into-object-3.rs b/src/test/ui/compile-fail-migration/regions-close-object-into-object-3.rs index 3004245b15a..3004245b15a 100644 --- a/src/test/compile-fail/regions-close-object-into-object-3.rs +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-3.rs diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-3.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-3.stderr new file mode 100644 index 00000000000..9e412e50da9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-3.stderr @@ -0,0 +1,13 @@ +error[E0597]: `*v` does not live long enough + --> $DIR/regions-close-object-into-object-3.rs:21:12 + | +LL | box B(&*v) as Box<X> //~ ERROR `*v` does not live long enough + | ^^ borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-4.nll.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-4.nll.stderr new file mode 100644 index 00000000000..62146778f68 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-4.nll.stderr @@ -0,0 +1,71 @@ +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-4.rs:20:5 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-4.rs:20:11 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-4.rs:20:9 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-4.rs:20:9 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-4.rs:20:5 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-close-object-into-object-4.rs:19:51 + | +LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> { + | ______--___________________________________________^ + | | | + | | lifetime `'a` defined here +LL | | box B(&*v) as Box<X> //~ ERROR cannot infer +LL | | } + | |_^ return requires that `'a` must outlive `'static` + +error[E0310]: the parameter type `U` may not live long enough + --> $DIR/regions-close-object-into-object-4.rs:20:5 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `U: 'static`... + +error[E0310]: the parameter type `U` may not live long enough + --> $DIR/regions-close-object-into-object-4.rs:20:9 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^^^^ + | + = help: consider adding an explicit lifetime bound `U: 'static`... + +error[E0597]: `*v` does not live long enough + --> $DIR/regions-close-object-into-object-4.rs:20:11 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^ borrowed value does not live long enough +LL | } + | - `*v` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 4 previous errors + +Some errors occurred: E0310, E0597. +For more information about an error, try `rustc --explain E0310`. diff --git a/src/test/compile-fail/regions-close-object-into-object-4.rs b/src/test/ui/compile-fail-migration/regions-close-object-into-object-4.rs index bc5b7b7cf78..bc5b7b7cf78 100644 --- a/src/test/compile-fail/regions-close-object-into-object-4.rs +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-4.rs diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-4.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-4.stderr new file mode 100644 index 00000000000..15e53f1b54d --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-4.stderr @@ -0,0 +1,24 @@ +error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements + --> $DIR/regions-close-object-into-object-4.rs:20:11 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 19:6... + --> $DIR/regions-close-object-into-object-4.rs:19:6 + | +LL | fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> { + | ^^ +note: ...so that the type `(dyn A<U> + 'a)` is not borrowed for too long + --> $DIR/regions-close-object-into-object-4.rs:20:11 + | +LL | box B(&*v) as Box<X> //~ ERROR cannot infer + | ^^^ + = note: but, the lifetime must be valid for the static lifetime... + = note: ...so that the expression is assignable: + expected std::boxed::Box<(dyn X + 'static)> + found std::boxed::Box<dyn X> + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-5.nll.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-5.nll.stderr new file mode 100644 index 00000000000..d7f9253d0b4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-5.nll.stderr @@ -0,0 +1,61 @@ +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-5.rs:27:5 + | +LL | box B(&*v) as Box<X> + | ^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-5.rs:27:11 + | +LL | box B(&*v) as Box<X> + | ^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | box B(&*v) as Box<X> + | ^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | box B(&*v) as Box<X> + | ^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-5.rs:27:5 + | +LL | box B(&*v) as Box<X> + | ^^^^^^^^^^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-object-into-object-5.rs:27:5 + | +LL | box B(&*v) as Box<X> + | ^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | box B(&*v) as Box<X> + | ^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + +error[E0597]: `*v` does not live long enough + --> $DIR/regions-close-object-into-object-5.rs:27:11 + | +LL | box B(&*v) as Box<X> + | ^^^ borrowed value does not live long enough +... +LL | } + | - `*v` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 3 previous errors + +Some errors occurred: E0310, E0597. +For more information about an error, try `rustc --explain E0310`. diff --git a/src/test/compile-fail/regions-close-object-into-object-5.rs b/src/test/ui/compile-fail-migration/regions-close-object-into-object-5.rs index 6cbe5234ce0..6cbe5234ce0 100644 --- a/src/test/compile-fail/regions-close-object-into-object-5.rs +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-5.rs diff --git a/src/test/ui/compile-fail-migration/regions-close-object-into-object-5.stderr b/src/test/ui/compile-fail-migration/regions-close-object-into-object-5.stderr new file mode 100644 index 00000000000..2c3cc603e04 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-object-into-object-5.stderr @@ -0,0 +1,93 @@ +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-object-into-object-5.rs:27:5 + | +LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box<X> + | ^^^^^^^^^^ + | +note: ...so that the type `B<'_, T>` will meet its required lifetime bounds + --> $DIR/regions-close-object-into-object-5.rs:27:5 + | +LL | box B(&*v) as Box<X> + | ^^^^^^^^^^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-object-into-object-5.rs:27:5 + | +LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box<X> + | ^^^^^^^^^^^^^^^^^^^^ + | +note: ...so that it can be closed over into an object + --> $DIR/regions-close-object-into-object-5.rs:27:5 + | +LL | box B(&*v) as Box<X> + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box<X> + | ^ + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | box B(&*v) as Box<X> + | ^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box<X> + | ^^^^^^ + | +note: ...so that the reference type `&dyn A<T>` does not outlive the data it points at + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | box B(&*v) as Box<X> + | ^^^^^^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box<X> + | ^^^^^^ + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | box B(&*v) as Box<X> + | ^^^^^^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-object-into-object-5.rs:27:11 + | +LL | fn f<'a, T, U>(v: Box<A<T>+'static>) -> Box<X+'static> { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box<X> + | ^^^ + | +note: ...so that the type `(dyn A<T> + 'static)` is not borrowed for too long + --> $DIR/regions-close-object-into-object-5.rs:27:11 + | +LL | box B(&*v) as Box<X> + | ^^^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-1.nll.stderr b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-1.nll.stderr new file mode 100644 index 00000000000..ff74d46b011 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-1.nll.stderr @@ -0,0 +1,44 @@ +warning: not reporting region error due to nll + --> $DIR/regions-close-over-type-parameter-1.rs:20:5 + | +LL | box v as Box<SomeTrait+'static> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-over-type-parameter-1.rs:20:5 + | +LL | box v as Box<SomeTrait+'static> + | ^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-over-type-parameter-1.rs:30:5 + | +LL | box v as Box<SomeTrait+'b> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-over-type-parameter-1.rs:30:5 + | +LL | box v as Box<SomeTrait+'b> + | ^^^^^ + +error[E0310]: the parameter type `A` may not live long enough + --> $DIR/regions-close-over-type-parameter-1.rs:20:5 + | +LL | box v as Box<SomeTrait+'static> + | ^^^^^ + | + = help: consider adding an explicit lifetime bound `A: 'static`... + +error[E0309]: the parameter type `A` may not live long enough + --> $DIR/regions-close-over-type-parameter-1.rs:30:5 + | +LL | box v as Box<SomeTrait+'b> + | ^^^^^ + | + = help: consider adding an explicit lifetime bound `A: 'b`... + +error: aborting due to 2 previous errors + +Some errors occurred: E0309, E0310. +For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/regions-close-over-type-parameter-1.rs b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-1.rs index b70ec59420d..b70ec59420d 100644 --- a/src/test/compile-fail/regions-close-over-type-parameter-1.rs +++ b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-1.rs diff --git a/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-1.stderr b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-1.stderr new file mode 100644 index 00000000000..9158cf26838 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-1.stderr @@ -0,0 +1,60 @@ +error[E0310]: the parameter type `A` may not live long enough + --> $DIR/regions-close-over-type-parameter-1.rs:20:5 + | +LL | fn make_object1<A:SomeTrait>(v: A) -> Box<SomeTrait+'static> { + | -- help: consider adding an explicit lifetime bound `A: 'static`... +LL | box v as Box<SomeTrait+'static> + | ^^^^^ + | +note: ...so that the type `A` will meet its required lifetime bounds + --> $DIR/regions-close-over-type-parameter-1.rs:20:5 + | +LL | box v as Box<SomeTrait+'static> + | ^^^^^ + +error[E0310]: the parameter type `A` may not live long enough + --> $DIR/regions-close-over-type-parameter-1.rs:20:5 + | +LL | fn make_object1<A:SomeTrait>(v: A) -> Box<SomeTrait+'static> { + | -- help: consider adding an explicit lifetime bound `A: 'static`... +LL | box v as Box<SomeTrait+'static> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: ...so that it can be closed over into an object + --> $DIR/regions-close-over-type-parameter-1.rs:20:5 + | +LL | box v as Box<SomeTrait+'static> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0309]: the parameter type `A` may not live long enough + --> $DIR/regions-close-over-type-parameter-1.rs:30:5 + | +LL | fn make_object3<'a,'b,A:SomeTrait+'a>(v: A) -> Box<SomeTrait+'b> { + | -- help: consider adding an explicit lifetime bound `A: 'b`... +LL | box v as Box<SomeTrait+'b> + | ^^^^^ + | +note: ...so that the type `A` will meet its required lifetime bounds + --> $DIR/regions-close-over-type-parameter-1.rs:30:5 + | +LL | box v as Box<SomeTrait+'b> + | ^^^^^ + +error[E0309]: the parameter type `A` may not live long enough + --> $DIR/regions-close-over-type-parameter-1.rs:30:5 + | +LL | fn make_object3<'a,'b,A:SomeTrait+'a>(v: A) -> Box<SomeTrait+'b> { + | -- help: consider adding an explicit lifetime bound `A: 'b`... +LL | box v as Box<SomeTrait+'b> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: ...so that it can be closed over into an object + --> $DIR/regions-close-over-type-parameter-1.rs:30:5 + | +LL | box v as Box<SomeTrait+'b> + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0309, E0310. +For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-multiple.nll.stderr b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-multiple.nll.stderr new file mode 100644 index 00000000000..9e0dd9da0e4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-multiple.nll.stderr @@ -0,0 +1,17 @@ +warning: not reporting region error due to nll + --> $DIR/regions-close-over-type-parameter-multiple.rs:30:5 + | +LL | box v as Box<SomeTrait+'a> //~ ERROR cannot infer an appropriate lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0309]: the parameter type `A` may not live long enough + --> $DIR/regions-close-over-type-parameter-multiple.rs:30:5 + | +LL | box v as Box<SomeTrait+'a> //~ ERROR cannot infer an appropriate lifetime + | ^^^^^ + | + = help: consider adding an explicit lifetime bound `A: 'c`... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-multiple.rs index ad6c5a31bbb..ad6c5a31bbb 100644 --- a/src/test/compile-fail/regions-close-over-type-parameter-multiple.rs +++ b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-multiple.rs diff --git a/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-multiple.stderr b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-multiple.stderr new file mode 100644 index 00000000000..f85041e8ced --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-over-type-parameter-multiple.stderr @@ -0,0 +1,28 @@ +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/regions-close-over-type-parameter-multiple.rs:30:5 + | +LL | box v as Box<SomeTrait+'a> //~ ERROR cannot infer an appropriate lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 28:20... + --> $DIR/regions-close-over-type-parameter-multiple.rs:28:20 + | +LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<SomeTrait+'c> { + | ^^ +note: ...so that the declared lifetime parameter bounds are satisfied + --> $DIR/regions-close-over-type-parameter-multiple.rs:30:5 + | +LL | box v as Box<SomeTrait+'a> //~ ERROR cannot infer an appropriate lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: but, the lifetime must be valid for the lifetime 'c as defined on the function body at 28:26... + --> $DIR/regions-close-over-type-parameter-multiple.rs:28:26 + | +LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<SomeTrait+'c> { + | ^^ + = note: ...so that the expression is assignable: + expected std::boxed::Box<(dyn SomeTrait + 'c)> + found std::boxed::Box<dyn SomeTrait> + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-close-param-into-object.nll.stderr b/src/test/ui/compile-fail-migration/regions-close-param-into-object.nll.stderr new file mode 100644 index 00000000000..260a4067e10 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-param-into-object.nll.stderr @@ -0,0 +1,60 @@ +warning: not reporting region error due to nll + --> $DIR/regions-close-param-into-object.rs:16:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-param-into-object.rs:22:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-param-into-object.rs:28:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-param-into-object.rs:34:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-param-into-object.rs:16:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-param-into-object.rs:22:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'static`... + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-close-param-into-object.rs:28:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'a`... + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-close-param-into-object.rs:34:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `T: 'a`... + +error: aborting due to 4 previous errors + +Some errors occurred: E0309, E0310. +For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/regions-close-param-into-object.rs b/src/test/ui/compile-fail-migration/regions-close-param-into-object.rs index c9063405bd7..c9063405bd7 100644 --- a/src/test/compile-fail/regions-close-param-into-object.rs +++ b/src/test/ui/compile-fail-migration/regions-close-param-into-object.rs diff --git a/src/test/ui/compile-fail-migration/regions-close-param-into-object.stderr b/src/test/ui/compile-fail-migration/regions-close-param-into-object.stderr new file mode 100644 index 00000000000..72ed7ac9448 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-close-param-into-object.stderr @@ -0,0 +1,64 @@ +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-param-into-object.rs:16:5 + | +LL | fn p1<T>(v: T) -> Box<X+'static> + | - help: consider adding an explicit lifetime bound `T: 'static`... +... +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/regions-close-param-into-object.rs:16:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/regions-close-param-into-object.rs:22:5 + | +LL | fn p2<T>(v: Box<T>) -> Box<X+'static> + | - help: consider adding an explicit lifetime bound `T: 'static`... +... +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + | +note: ...so that the type `std::boxed::Box<T>` will meet its required lifetime bounds + --> $DIR/regions-close-param-into-object.rs:22:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-close-param-into-object.rs:28:5 + | +LL | fn p3<'a,T>(v: T) -> Box<X+'a> + | - help: consider adding an explicit lifetime bound `T: 'a`... +... +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/regions-close-param-into-object.rs:28:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-close-param-into-object.rs:34:5 + | +LL | fn p4<'a,T>(v: Box<T>) -> Box<X+'a> + | - help: consider adding an explicit lifetime bound `T: 'a`... +... +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + | +note: ...so that the type `std::boxed::Box<T>` will meet its required lifetime bounds + --> $DIR/regions-close-param-into-object.rs:34:5 + | +LL | Box::new(v) //~ ERROR parameter type `T` may not live long enough + | ^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0309, E0310. +For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/ui/compile-fail-migration/regions-creating-enums.nll.stderr b/src/test/ui/compile-fail-migration/regions-creating-enums.nll.stderr new file mode 100644 index 00000000000..58dff9c6c37 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-creating-enums.nll.stderr @@ -0,0 +1,31 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-creating-enums.rs:33:17 + | +LL | return &ast::num((*f)(x)); //~ ERROR borrowed value does not live long enough + | ^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 30:13... + --> $DIR/regions-creating-enums.rs:30:13 + | +LL | fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(usize) -> usize { + | ^^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-creating-enums.rs:38:17 + | +LL | return &ast::add(m_x, m_y); //~ ERROR borrowed value does not live long enough + | ^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 30:13... + --> $DIR/regions-creating-enums.rs:30:13 + | +LL | fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(usize) -> usize { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-creating-enums.rs b/src/test/ui/compile-fail-migration/regions-creating-enums.rs index ad2dc28afef..ad2dc28afef 100644 --- a/src/test/compile-fail/regions-creating-enums.rs +++ b/src/test/ui/compile-fail-migration/regions-creating-enums.rs diff --git a/src/test/ui/compile-fail-migration/regions-creating-enums.stderr b/src/test/ui/compile-fail-migration/regions-creating-enums.stderr new file mode 100644 index 00000000000..7b0847739d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-creating-enums.stderr @@ -0,0 +1,33 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-creating-enums.rs:33:17 + | +LL | return &ast::num((*f)(x)); //~ ERROR borrowed value does not live long enough + | ^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 30:13... + --> $DIR/regions-creating-enums.rs:30:13 + | +LL | fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(usize) -> usize { + | ^^ + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-creating-enums.rs:38:17 + | +LL | return &ast::add(m_x, m_y); //~ ERROR borrowed value does not live long enough + | ^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 30:13... + --> $DIR/regions-creating-enums.rs:30:13 + | +LL | fn map_nums<'a,'b, F>(x: &ast, f: &mut F) -> &'a ast<'b> where F: FnMut(usize) -> usize { + | ^^ + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-creating-enums3.nll.stderr b/src/test/ui/compile-fail-migration/regions-creating-enums3.nll.stderr new file mode 100644 index 00000000000..9b327100667 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-creating-enums3.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-creating-enums3.rs:17:5 + | +LL | ast::add(x, y) //~ ERROR 17:5: 17:19: lifetime mismatch [E0623] + | ^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-creating-enums3.rs:17:14 + | +LL | fn mk_add_bad1<'a,'b>(x: &'a ast<'a>, y: &'b ast<'b>) -> ast<'a> { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | ast::add(x, y) //~ ERROR 17:5: 17:19: lifetime mismatch [E0623] + | ^ requires that `'b` must outlive `'a` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-creating-enums3.rs b/src/test/ui/compile-fail-migration/regions-creating-enums3.rs index dcc579d26c1..dcc579d26c1 100644 --- a/src/test/compile-fail/regions-creating-enums3.rs +++ b/src/test/ui/compile-fail-migration/regions-creating-enums3.rs diff --git a/src/test/ui/compile-fail-migration/regions-creating-enums3.stderr b/src/test/ui/compile-fail-migration/regions-creating-enums3.stderr new file mode 100644 index 00000000000..b2cca9a3c62 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-creating-enums3.stderr @@ -0,0 +1,13 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-creating-enums3.rs:17:5 + | +LL | fn mk_add_bad1<'a,'b>(x: &'a ast<'a>, y: &'b ast<'b>) -> ast<'a> { + | ----------- ------- + | | + | this parameter and the return type are declared with different lifetimes... +LL | ast::add(x, y) //~ ERROR 17:5: 17:19: lifetime mismatch [E0623] + | ^^^^^^^^^^^^^^ ...but data from `y` is returned here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/regions-creating-enums4.nll.stderr b/src/test/ui/compile-fail-migration/regions-creating-enums4.nll.stderr new file mode 100644 index 00000000000..6a3554b41a7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-creating-enums4.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-creating-enums4.rs:17:5 + | +LL | ast::add(x, y) //~ ERROR cannot infer + | ^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-creating-enums4.rs:17:14 + | +LL | fn mk_add_bad2<'a,'b>(x: &'a ast<'a>, y: &'a ast<'a>, z: &ast) -> ast<'b> { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | ast::add(x, y) //~ ERROR cannot infer + | ^ requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-creating-enums4.rs b/src/test/ui/compile-fail-migration/regions-creating-enums4.rs index 5dc9b370f32..5dc9b370f32 100644 --- a/src/test/compile-fail/regions-creating-enums4.rs +++ b/src/test/ui/compile-fail-migration/regions-creating-enums4.rs diff --git a/src/test/ui/compile-fail-migration/regions-creating-enums4.stderr b/src/test/ui/compile-fail-migration/regions-creating-enums4.stderr new file mode 100644 index 00000000000..729dc2f107a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-creating-enums4.stderr @@ -0,0 +1,26 @@ +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/regions-creating-enums4.rs:17:5 + | +LL | ast::add(x, y) //~ ERROR cannot infer + | ^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 16:16... + --> $DIR/regions-creating-enums4.rs:16:16 + | +LL | fn mk_add_bad2<'a,'b>(x: &'a ast<'a>, y: &'a ast<'a>, z: &ast) -> ast<'b> { + | ^^ + = note: ...so that the expression is assignable: + expected &ast<'_> + found &ast<'a> +note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 16:19... + --> $DIR/regions-creating-enums4.rs:16:19 + | +LL | fn mk_add_bad2<'a,'b>(x: &'a ast<'a>, y: &'a ast<'a>, z: &ast) -> ast<'b> { + | ^^ + = note: ...so that the expression is assignable: + expected ast<'b> + found ast<'_> + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-early-bound-error-method.nll.stderr b/src/test/ui/compile-fail-migration/regions-early-bound-error-method.nll.stderr new file mode 100644 index 00000000000..0319d63d596 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-early-bound-error-method.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-early-bound-error-method.rs:30:9 + | +LL | g2.get() + | ^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-early-bound-error-method.rs:30:9 + | +LL | impl<'a> Box<'a> { + | -- lifetime `'a` defined here +LL | fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize { + | -- lifetime `'b` defined here +LL | g2.get() + | ^^^^^^^^ argument requires that `'b` must outlive `'a` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-early-bound-error-method.rs b/src/test/ui/compile-fail-migration/regions-early-bound-error-method.rs index eaf9a750570..eaf9a750570 100644 --- a/src/test/compile-fail/regions-early-bound-error-method.rs +++ b/src/test/ui/compile-fail-migration/regions-early-bound-error-method.rs diff --git a/src/test/ui/compile-fail-migration/regions-early-bound-error-method.stderr b/src/test/ui/compile-fail-migration/regions-early-bound-error-method.stderr new file mode 100644 index 00000000000..6c542ef5ddf --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-early-bound-error-method.stderr @@ -0,0 +1,20 @@ +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/regions-early-bound-error-method.rs:30:9 + | +LL | g2.get() + | ^^^^^^^^ + | +note: ...the reference is valid for the lifetime 'a as defined on the impl at 28:6... + --> $DIR/regions-early-bound-error-method.rs:28:6 + | +LL | impl<'a> Box<'a> { + | ^^ +note: ...but the borrowed content is only valid for the lifetime 'b as defined on the method body at 29:11 + --> $DIR/regions-early-bound-error-method.rs:29:11 + | +LL | fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/compile-fail-migration/regions-early-bound-error.nll.stderr b/src/test/ui/compile-fail-migration/regions-early-bound-error.nll.stderr new file mode 100644 index 00000000000..b19de2201f7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-early-bound-error.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-early-bound-error.rs:29:5 + | +LL | g1.get() + | ^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-early-bound-error.rs:29:5 + | +LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | g1.get() + | ^^^^^^^^ argument requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-early-bound-error.rs b/src/test/ui/compile-fail-migration/regions-early-bound-error.rs index 90a33950047..90a33950047 100644 --- a/src/test/compile-fail/regions-early-bound-error.rs +++ b/src/test/ui/compile-fail-migration/regions-early-bound-error.rs diff --git a/src/test/ui/compile-fail-migration/regions-early-bound-error.stderr b/src/test/ui/compile-fail-migration/regions-early-bound-error.stderr new file mode 100644 index 00000000000..579a7c91e43 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-early-bound-error.stderr @@ -0,0 +1,20 @@ +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/regions-early-bound-error.rs:29:5 + | +LL | g1.get() + | ^^^^^^^^ + | +note: ...the reference is valid for the lifetime 'b as defined on the function body at 28:11... + --> $DIR/regions-early-bound-error.rs:28:11 + | +LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize { + | ^^ +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 28:8 + --> $DIR/regions-early-bound-error.rs:28:8 + | +LL | fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/compile-fail/regions-enum-not-wf.rs b/src/test/ui/compile-fail-migration/regions-enum-not-wf.rs index e21f92bc9b8..e21f92bc9b8 100644 --- a/src/test/compile-fail/regions-enum-not-wf.rs +++ b/src/test/ui/compile-fail-migration/regions-enum-not-wf.rs diff --git a/src/test/ui/compile-fail-migration/regions-enum-not-wf.stderr b/src/test/ui/compile-fail-migration/regions-enum-not-wf.stderr new file mode 100644 index 00000000000..381a8aada5a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-enum-not-wf.stderr @@ -0,0 +1,64 @@ +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-enum-not-wf.rs:16:18 + | +LL | enum Ref1<'a, T> { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | Ref1Variant1(&'a T) //~ ERROR the parameter type `T` may not live long enough + | ^^^^^ + | +note: ...so that the reference type `&'a T` does not outlive the data it points at + --> $DIR/regions-enum-not-wf.rs:16:18 + | +LL | Ref1Variant1(&'a T) //~ ERROR the parameter type `T` may not live long enough + | ^^^^^ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-enum-not-wf.rs:21:25 + | +LL | enum Ref2<'a, T> { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | Ref2Variant1, +LL | Ref2Variant2(isize, &'a T), //~ ERROR the parameter type `T` may not live long enough + | ^^^^^ + | +note: ...so that the reference type `&'a T` does not outlive the data it points at + --> $DIR/regions-enum-not-wf.rs:21:25 + | +LL | Ref2Variant2(isize, &'a T), //~ ERROR the parameter type `T` may not live long enough + | ^^^^^ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-enum-not-wf.rs:29:32 + | +LL | enum RefIndirect<'a, T> { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | RefIndirectVariant1(isize, RefOk<'a,T>) + | ^^^^^^^^^^^ + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/regions-enum-not-wf.rs:29:32 + | +LL | RefIndirectVariant1(isize, RefOk<'a,T>) + | ^^^^^^^^^^^ + +error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references + --> $DIR/regions-enum-not-wf.rs:34:23 + | +LL | RefDoubleVariant1(&'a &'b T) + | ^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the enum at 33:16 + --> $DIR/regions-enum-not-wf.rs:33:16 + | +LL | enum RefDouble<'a, 'b, T> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 33:20 + --> $DIR/regions-enum-not-wf.rs:33:20 + | +LL | enum RefDouble<'a, 'b, T> { + | ^^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0309, E0491. +For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/ui/compile-fail-migration/regions-escape-method.nll.stderr b/src/test/ui/compile-fail-migration/regions-escape-method.nll.stderr new file mode 100644 index 00000000000..d0811206e4a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-escape-method.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-escape-method.rs:25:13 + | +LL | s.f(|p| p) //~ ERROR cannot infer + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-escape-method.rs:25:13 + | +LL | s.f(|p| p) //~ ERROR cannot infer + | ----^ + | || | + | || return requires that `'1` must outlive `'2` + | |has type `&'1 i32` + | lifetime `'2` appears in return type + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-escape-method.rs b/src/test/ui/compile-fail-migration/regions-escape-method.rs index e3771cfebba..e3771cfebba 100644 --- a/src/test/compile-fail/regions-escape-method.rs +++ b/src/test/ui/compile-fail-migration/regions-escape-method.rs diff --git a/src/test/ui/compile-fail-migration/regions-escape-method.stderr b/src/test/ui/compile-fail-migration/regions-escape-method.stderr new file mode 100644 index 00000000000..fb0bf845f3b --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-escape-method.stderr @@ -0,0 +1,28 @@ +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/regions-escape-method.rs:25:13 + | +LL | s.f(|p| p) //~ ERROR cannot infer + | ^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 25:9... + --> $DIR/regions-escape-method.rs:25:9 + | +LL | s.f(|p| p) //~ ERROR cannot infer + | ^^^^^ + = note: ...so that the expression is assignable: + expected &i32 + found &i32 +note: but, the lifetime must be valid for the method call at 25:5... + --> $DIR/regions-escape-method.rs:25:5 + | +LL | s.f(|p| p) //~ ERROR cannot infer + | ^^^^^^^^^^ +note: ...so that a type/lifetime parameter is in scope here + --> $DIR/regions-escape-method.rs:25:5 + | +LL | s.f(|p| p) //~ ERROR cannot infer + | ^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-escape-via-trait-or-not.nll.stderr b/src/test/ui/compile-fail-migration/regions-escape-via-trait-or-not.nll.stderr new file mode 100644 index 00000000000..7ff49fd413c --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-escape-via-trait-or-not.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-escape-via-trait-or-not.rs:28:14 + | +LL | with(|o| o) //~ ERROR cannot infer + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-escape-via-trait-or-not.rs:28:14 + | +LL | with(|o| o) //~ ERROR cannot infer + | ----^ + | || | + | || return requires that `'1` must outlive `'2` + | |has type `&'1 isize` + | lifetime `'2` appears in return type + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-escape-via-trait-or-not.rs b/src/test/ui/compile-fail-migration/regions-escape-via-trait-or-not.rs index a4363b00e1c..a4363b00e1c 100644 --- a/src/test/compile-fail/regions-escape-via-trait-or-not.rs +++ b/src/test/ui/compile-fail-migration/regions-escape-via-trait-or-not.rs diff --git a/src/test/ui/compile-fail-migration/regions-escape-via-trait-or-not.stderr b/src/test/ui/compile-fail-migration/regions-escape-via-trait-or-not.stderr new file mode 100644 index 00000000000..60bd14ba4d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-escape-via-trait-or-not.stderr @@ -0,0 +1,28 @@ +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/regions-escape-via-trait-or-not.rs:28:14 + | +LL | with(|o| o) //~ ERROR cannot infer + | ^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 28:10... + --> $DIR/regions-escape-via-trait-or-not.rs:28:10 + | +LL | with(|o| o) //~ ERROR cannot infer + | ^^^^^ + = note: ...so that the expression is assignable: + expected &isize + found &isize +note: but, the lifetime must be valid for the expression at 28:5... + --> $DIR/regions-escape-via-trait-or-not.rs:28:5 + | +LL | with(|o| o) //~ ERROR cannot infer + | ^^^^ +note: ...so type `fn([closure@$DIR/regions-escape-via-trait-or-not.rs:28:10: 28:15]) -> isize {with::<&isize, [closure@$DIR/regions-escape-via-trait-or-not.rs:28:10: 28:15]>}` of expression is valid during the expression + --> $DIR/regions-escape-via-trait-or-not.rs:28:5 + | +LL | with(|o| o) //~ ERROR cannot infer + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/compile-fail/regions-fn-subtyping-return-static.rs b/src/test/ui/compile-fail-migration/regions-fn-subtyping-return-static.rs index 6be65a5e359..6be65a5e359 100644 --- a/src/test/compile-fail/regions-fn-subtyping-return-static.rs +++ b/src/test/ui/compile-fail-migration/regions-fn-subtyping-return-static.rs diff --git a/src/test/ui/compile-fail-migration/regions-fn-subtyping-return-static.stderr b/src/test/ui/compile-fail-migration/regions-fn-subtyping-return-static.stderr new file mode 100644 index 00000000000..6d487666c6f --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-fn-subtyping-return-static.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/regions-fn-subtyping-return-static.rs:51:12 + | +LL | want_F(bar); //~ ERROR E0308 + | ^^^ expected concrete lifetime, found bound lifetime parameter 'cx + | + = note: expected type `for<'cx> fn(&'cx S) -> &'cx S` + found type `for<'a> fn(&'a S) -> &S {bar::<'_>}` + +error[E0308]: mismatched types + --> $DIR/regions-fn-subtyping-return-static.rs:59:12 + | +LL | want_G(baz); + | ^^^ expected concrete lifetime, found bound lifetime parameter 'cx + | + = note: expected type `for<'cx> fn(&'cx S) -> &'static S` + found type `for<'r> fn(&'r S) -> &'r S {baz}` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/regions-free-region-ordering-callee-4.rs b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee-4.rs index bd31d1a5a90..bd31d1a5a90 100644 --- a/src/test/compile-fail/regions-free-region-ordering-callee-4.rs +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee-4.rs diff --git a/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee-4.stderr b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee-4.stderr new file mode 100644 index 00000000000..70970a9cf3b --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee-4.stderr @@ -0,0 +1,24 @@ +error[E0491]: in type `&'a &'b usize`, reference has a longer lifetime than the data it references + --> $DIR/regions-free-region-ordering-callee-4.rs:15:1 + | +LL | / fn ordering4<'a, 'b, F>(a: &'a usize, b: &'b usize, x: F) where F: FnOnce(&'a &'b usize) { +LL | | //~^ ERROR reference has a longer lifetime than the data it references +LL | | // Do not infer ordering from closure argument types. +LL | | let z: Option<&'a &'b usize> = None; +LL | | } + | |_^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 15:14 + --> $DIR/regions-free-region-ordering-callee-4.rs:15:14 + | +LL | fn ordering4<'a, 'b, F>(a: &'a usize, b: &'b usize, x: F) where F: FnOnce(&'a &'b usize) { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 15:18 + --> $DIR/regions-free-region-ordering-callee-4.rs:15:18 + | +LL | fn ordering4<'a, 'b, F>(a: &'a usize, b: &'b usize, x: F) where F: FnOnce(&'a &'b usize) { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee.nll.stderr b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee.nll.stderr new file mode 100644 index 00000000000..25f2e1a5657 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee.nll.stderr @@ -0,0 +1,36 @@ +warning: not reporting region error due to nll + --> $DIR/regions-free-region-ordering-callee.rs:23:5 + | +LL | &*y //~ ERROR 23:5: 23:8: lifetime mismatch [E0623] + | ^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-free-region-ordering-callee.rs:28:24 + | +LL | let z: &'b usize = &*x; + | ^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-free-region-ordering-callee.rs:23:5 + | +LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | // However, it is not safe to assume that 'b <= 'a +LL | &*y //~ ERROR 23:5: 23:8: lifetime mismatch [E0623] + | ^^^ requires that `'a` must outlive `'b` + +error: unsatisfied lifetime constraints + --> $DIR/regions-free-region-ordering-callee.rs:28:24 + | +LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | // Do not infer an ordering from the return value. +LL | let z: &'b usize = &*x; + | ^^^ requires that `'a` must outlive `'b` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/regions-free-region-ordering-callee.rs b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee.rs index 073a4f79b05..073a4f79b05 100644 --- a/src/test/compile-fail/regions-free-region-ordering-callee.rs +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee.rs diff --git a/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee.stderr b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee.stderr new file mode 100644 index 00000000000..13d94f91c6d --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-callee.stderr @@ -0,0 +1,25 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-free-region-ordering-callee.rs:23:5 + | +LL | fn ordering2<'a, 'b>(x: &'a &'b usize, y: &'a usize) -> &'b usize { + | ------------- --------- + | | + | this parameter and the return type are declared with different lifetimes... +LL | // However, it is not safe to assume that 'b <= 'a +LL | &*y //~ ERROR 23:5: 23:8: lifetime mismatch [E0623] + | ^^^ ...but data from `x` is returned here + +error[E0623]: lifetime mismatch + --> $DIR/regions-free-region-ordering-callee.rs:28:24 + | +LL | fn ordering3<'a, 'b>(x: &'a usize, y: &'b usize) -> &'a &'b usize { + | --------- ------------- + | | + | this parameter and the return type are declared with different lifetimes... +LL | // Do not infer an ordering from the return value. +LL | let z: &'b usize = &*x; + | ^^^ ...but data from `x` is returned here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/regions-free-region-ordering-caller.rs b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller.rs index 66b16744cc7..66b16744cc7 100644 --- a/src/test/compile-fail/regions-free-region-ordering-caller.rs +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller.rs diff --git a/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller.stderr b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller.stderr new file mode 100644 index 00000000000..a3645995b5e --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller.stderr @@ -0,0 +1,32 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-free-region-ordering-caller.rs:18:12 + | +LL | fn call2<'a, 'b>(a: &'a usize, b: &'b usize) { + | --------- --------- + | | + | these two types are declared with different lifetimes... +LL | let z: Option<&'b &'a usize> = None;//~ ERROR E0623 + | ^^^^^^^^^^^^^^^^^^^^^ ...but data from `a` flows into `b` here + +error[E0623]: lifetime mismatch + --> $DIR/regions-free-region-ordering-caller.rs:23:12 + | +LL | fn call3<'a, 'b>(a: &'a usize, b: &'b usize) { + | --------- --------- + | | + | these two types are declared with different lifetimes... +LL | let y: Paramd<'a> = Paramd { x: a }; +LL | let z: Option<&'b Paramd<'a>> = None;//~ ERROR E0623 + | ^^^^^^^^^^^^^^^^^^^^^^ ...but data from `a` flows into `b` here + +error[E0623]: lifetime mismatch + --> $DIR/regions-free-region-ordering-caller.rs:27:12 + | +LL | fn call4<'a, 'b>(a: &'a usize, b: &'b usize) { + | --------- --------- these two types are declared with different lifetimes... +LL | let z: Option<&'a &'b usize> = None;//~ ERROR E0623 + | ^^^^^^^^^^^^^^^^^^^^^ ...but data from `b` flows into `a` here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller1.nll.stderr b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller1.nll.stderr new file mode 100644 index 00000000000..acf7a033ade --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller1.nll.stderr @@ -0,0 +1,18 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-free-region-ordering-caller1.rs:19:27 + | +LL | let z: &'a & usize = &(&y); + | ^^^^ temporary value does not live long enough +... +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 15:10... + --> $DIR/regions-free-region-ordering-caller1.rs:15:10 + | +LL | fn call1<'a>(x: &'a usize) { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-free-region-ordering-caller1.rs b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller1.rs index b29518ccdab..b29518ccdab 100644 --- a/src/test/compile-fail/regions-free-region-ordering-caller1.rs +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller1.rs diff --git a/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller1.stderr b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller1.stderr new file mode 100644 index 00000000000..c0dff6ec384 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-caller1.stderr @@ -0,0 +1,33 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-free-region-ordering-caller1.rs:19:27 + | +LL | let z: &'a & usize = &(&y); + | ^^^^ temporary value does not live long enough +... +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 15:10... + --> $DIR/regions-free-region-ordering-caller1.rs:15:10 + | +LL | fn call1<'a>(x: &'a usize) { + | ^^ + +error[E0597]: `y` does not live long enough + --> $DIR/regions-free-region-ordering-caller1.rs:19:29 + | +LL | let z: &'a & usize = &(&y); + | ^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 15:10... + --> $DIR/regions-free-region-ordering-caller1.rs:15:10 + | +LL | fn call1<'a>(x: &'a usize) { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-free-region-ordering-incorrect.nll.stderr b/src/test/ui/compile-fail-migration/regions-free-region-ordering-incorrect.nll.stderr new file mode 100644 index 00000000000..34fcd91b319 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-incorrect.nll.stderr @@ -0,0 +1,21 @@ +warning: not reporting region error due to nll + --> $DIR/regions-free-region-ordering-incorrect.rs:27:15 + | +LL | None => &self.val //~ ERROR cannot infer + | ^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-free-region-ordering-incorrect.rs:25:5 + | +LL | impl<'b, T> Node<'b, T> { + | -- lifetime `'b` defined here +LL | fn get<'a>(&'a self) -> &'b T { + | -- lifetime `'a` defined here +LL | / match self.next { +LL | | Some(ref next) => next.get(), +LL | | None => &self.val //~ ERROR cannot infer +LL | | } + | |_____^ requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-free-region-ordering-incorrect.rs b/src/test/ui/compile-fail-migration/regions-free-region-ordering-incorrect.rs index 9cb61c24922..9cb61c24922 100644 --- a/src/test/compile-fail/regions-free-region-ordering-incorrect.rs +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-incorrect.rs diff --git a/src/test/ui/compile-fail-migration/regions-free-region-ordering-incorrect.stderr b/src/test/ui/compile-fail-migration/regions-free-region-ordering-incorrect.stderr new file mode 100644 index 00000000000..3dce04e2452 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-free-region-ordering-incorrect.stderr @@ -0,0 +1,33 @@ +error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements + --> $DIR/regions-free-region-ordering-incorrect.rs:27:15 + | +LL | None => &self.val //~ ERROR cannot infer + | ^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the method body at 24:10... + --> $DIR/regions-free-region-ordering-incorrect.rs:24:10 + | +LL | fn get<'a>(&'a self) -> &'b T { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-free-region-ordering-incorrect.rs:27:15 + | +LL | None => &self.val //~ ERROR cannot infer + | ^^^^^^^^^ +note: but, the lifetime must be valid for the lifetime 'b as defined on the impl at 23:6... + --> $DIR/regions-free-region-ordering-incorrect.rs:23:6 + | +LL | impl<'b, T> Node<'b, T> { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-free-region-ordering-incorrect.rs:25:5 + | +LL | / match self.next { +LL | | Some(ref next) => next.get(), +LL | | None => &self.val //~ ERROR cannot infer +LL | | } + | |_____^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-glb-free-free.nll.stderr b/src/test/ui/compile-fail-migration/regions-glb-free-free.nll.stderr new file mode 100644 index 00000000000..93e8bd75bdb --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-glb-free-free.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-glb-free-free.rs:25:13 + | +LL | Flag { //~ ERROR 25:13: 30:14: explicit lifetime required in the type of `s` [E0621] + | ^^^^ + +error[E0621]: explicit lifetime required in the type of `s` + --> $DIR/regions-glb-free-free.rs:26:23 + | +LL | pub fn set_desc(self, s: &str) -> Flag<'a> { + | ---- help: add explicit lifetime `'a` to the type of `s`: `&'a str` +LL | Flag { //~ ERROR 25:13: 30:14: explicit lifetime required in the type of `s` [E0621] +LL | name: self.name, + | ^^^^^^^^^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/compile-fail/regions-glb-free-free.rs b/src/test/ui/compile-fail-migration/regions-glb-free-free.rs index 843c5f512f8..843c5f512f8 100644 --- a/src/test/compile-fail/regions-glb-free-free.rs +++ b/src/test/ui/compile-fail-migration/regions-glb-free-free.rs diff --git a/src/test/ui/compile-fail-migration/regions-glb-free-free.stderr b/src/test/ui/compile-fail-migration/regions-glb-free-free.stderr new file mode 100644 index 00000000000..48c95a88654 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-glb-free-free.stderr @@ -0,0 +1,16 @@ +error[E0621]: explicit lifetime required in the type of `s` + --> $DIR/regions-glb-free-free.rs:25:13 + | +LL | pub fn set_desc(self, s: &str) -> Flag<'a> { + | ---- help: add explicit lifetime `'a` to the type of `s`: `&'a str` +LL | / Flag { //~ ERROR 25:13: 30:14: explicit lifetime required in the type of `s` [E0621] +LL | | name: self.name, +LL | | desc: s, +LL | | max_count: self.max_count, +LL | | value: self.value +LL | | } + | |_____________^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/compile-fail/regions-implied-bounds-projection-gap-1.rs b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-1.rs index 65594ab8f2e..65594ab8f2e 100644 --- a/src/test/compile-fail/regions-implied-bounds-projection-gap-1.rs +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-1.rs diff --git a/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-1.stderr b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-1.stderr new file mode 100644 index 00000000000..41ae515bb9a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-1.stderr @@ -0,0 +1,18 @@ +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-implied-bounds-projection-gap-1.rs:26:10 + | +LL | fn func<'x, T:Trait1<'x>>(t: &'x T::Foo) + | -- help: consider adding an explicit lifetime bound `T: 'x`... +LL | { +LL | wf::<&'x T>(); + | ^^^^^ + | +note: ...so that the reference type `&'x T` does not outlive the data it points at + --> $DIR/regions-implied-bounds-projection-gap-1.rs:26:10 + | +LL | wf::<&'x T>(); + | ^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/regions-implied-bounds-projection-gap-2.rs b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-2.rs index b3037a1e187..b3037a1e187 100644 --- a/src/test/compile-fail/regions-implied-bounds-projection-gap-2.rs +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-2.rs diff --git a/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-2.stderr b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-2.stderr new file mode 100644 index 00000000000..7a38797e469 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-2.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/regions-implied-bounds-projection-gap-2.rs:33:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-implied-bounds-projection-gap-3.rs b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-3.rs index a2e6de21376..a2e6de21376 100644 --- a/src/test/compile-fail/regions-implied-bounds-projection-gap-3.rs +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-3.rs diff --git a/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-3.stderr b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-3.stderr new file mode 100644 index 00000000000..1a12697a474 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-3.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/regions-implied-bounds-projection-gap-3.rs:33:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-implied-bounds-projection-gap-4.rs b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-4.rs index b8582f8c26b..b8582f8c26b 100644 --- a/src/test/compile-fail/regions-implied-bounds-projection-gap-4.rs +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-4.rs diff --git a/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-4.stderr b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-4.stderr new file mode 100644 index 00000000000..85b1702e2a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-4.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/regions-implied-bounds-projection-gap-4.rs:33:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-implied-bounds-projection-gap-hr-1.rs b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-hr-1.rs index fd186d16559..fd186d16559 100644 --- a/src/test/compile-fail/regions-implied-bounds-projection-gap-hr-1.rs +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-hr-1.rs diff --git a/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-hr-1.stderr b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-hr-1.stderr new file mode 100644 index 00000000000..172a3cdeade --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-implied-bounds-projection-gap-hr-1.stderr @@ -0,0 +1,23 @@ +error[E0491]: in type `&'x (dyn for<'z> Trait1<<T as Trait2<'y, 'z>>::Foo> + 'x)`, reference has a longer lifetime than the data it references + --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:31:1 + | +LL | / fn callee<'x, 'y, T>(t: &'x for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >) +LL | | //~^ ERROR reference has a longer lifetime than the data it references +LL | | { +LL | | } + | |_^ + | +note: the pointer is valid for the lifetime 'x as defined on the function body at 31:11 + --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:31:11 + | +LL | fn callee<'x, 'y, T>(t: &'x for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >) + | ^^ +note: but the referenced data is only valid for the lifetime 'y as defined on the function body at 31:15 + --> $DIR/regions-implied-bounds-projection-gap-hr-1.rs:31:15 + | +LL | fn callee<'x, 'y, T>(t: &'x for<'z> Trait1< <T as Trait2<'y, 'z>>::Foo >) + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-in-enums-anon.rs b/src/test/ui/compile-fail-migration/regions-in-enums-anon.rs index 305bf88c4d5..305bf88c4d5 100644 --- a/src/test/compile-fail/regions-in-enums-anon.rs +++ b/src/test/ui/compile-fail-migration/regions-in-enums-anon.rs diff --git a/src/test/ui/compile-fail-migration/regions-in-enums-anon.stderr b/src/test/ui/compile-fail-migration/regions-in-enums-anon.stderr new file mode 100644 index 00000000000..f5630f84aed --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-in-enums-anon.stderr @@ -0,0 +1,9 @@ +error[E0106]: missing lifetime specifier + --> $DIR/regions-in-enums-anon.rs:14:9 + | +LL | Bar(&isize) //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/compile-fail/regions-in-enums.rs b/src/test/ui/compile-fail-migration/regions-in-enums.rs index 613a90dda67..613a90dda67 100644 --- a/src/test/compile-fail/regions-in-enums.rs +++ b/src/test/ui/compile-fail-migration/regions-in-enums.rs diff --git a/src/test/ui/compile-fail-migration/regions-in-enums.stderr b/src/test/ui/compile-fail-migration/regions-in-enums.stderr new file mode 100644 index 00000000000..cdc0b6ca122 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-in-enums.stderr @@ -0,0 +1,15 @@ +error[E0261]: use of undeclared lifetime name `'foo` + --> $DIR/regions-in-enums.rs:23:9 + | +LL | X5(&'foo usize) //~ ERROR use of undeclared lifetime name `'foo` + | ^^^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-in-enums.rs:27:9 + | +LL | X6(&'a usize) //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0261`. diff --git a/src/test/compile-fail/regions-in-structs-anon.rs b/src/test/ui/compile-fail-migration/regions-in-structs-anon.rs index b85928b1b9f..b85928b1b9f 100644 --- a/src/test/compile-fail/regions-in-structs-anon.rs +++ b/src/test/ui/compile-fail-migration/regions-in-structs-anon.rs diff --git a/src/test/ui/compile-fail-migration/regions-in-structs-anon.stderr b/src/test/ui/compile-fail-migration/regions-in-structs-anon.stderr new file mode 100644 index 00000000000..ecfac87c6c0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-in-structs-anon.stderr @@ -0,0 +1,9 @@ +error[E0106]: missing lifetime specifier + --> $DIR/regions-in-structs-anon.rs:14:8 + | +LL | x: &isize //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/compile-fail/regions-in-structs.rs b/src/test/ui/compile-fail-migration/regions-in-structs.rs index c231d3a913e..c231d3a913e 100644 --- a/src/test/compile-fail/regions-in-structs.rs +++ b/src/test/ui/compile-fail-migration/regions-in-structs.rs diff --git a/src/test/ui/compile-fail-migration/regions-in-structs.stderr b/src/test/ui/compile-fail-migration/regions-in-structs.stderr new file mode 100644 index 00000000000..679a219fbb1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-in-structs.stderr @@ -0,0 +1,15 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-in-structs.rs:20:9 + | +LL | a: &'a isize, //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-in-structs.rs:21:9 + | +LL | b: &'a isize, //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0261`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-at-fn-not-param.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-at-fn-not-param.nll.stderr new file mode 100644 index 00000000000..6bc3dafea51 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-at-fn-not-param.nll.stderr @@ -0,0 +1,17 @@ +warning: not reporting region error due to nll + --> $DIR/regions-infer-at-fn-not-param.rs:23:57 + | +LL | fn take1<'a>(p: parameterized1) -> parameterized1<'a> { p } + | ^ + +error[E0621]: explicit lifetime required in the type of `p` + --> $DIR/regions-infer-at-fn-not-param.rs:23:57 + | +LL | fn take1<'a>(p: parameterized1) -> parameterized1<'a> { p } + | -------------- ^ lifetime `'a` required + | | + | help: add explicit lifetime `'a` to the type of `p`: `parameterized1<'a>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/compile-fail/regions-infer-at-fn-not-param.rs b/src/test/ui/compile-fail-migration/regions-infer-at-fn-not-param.rs index ec73bf90b6e..ec73bf90b6e 100644 --- a/src/test/compile-fail/regions-infer-at-fn-not-param.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-at-fn-not-param.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-at-fn-not-param.stderr b/src/test/ui/compile-fail-migration/regions-infer-at-fn-not-param.stderr new file mode 100644 index 00000000000..f129ffae23a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-at-fn-not-param.stderr @@ -0,0 +1,11 @@ +error[E0621]: explicit lifetime required in the type of `p` + --> $DIR/regions-infer-at-fn-not-param.rs:23:57 + | +LL | fn take1<'a>(p: parameterized1) -> parameterized1<'a> { p } + | -------------- ^ lifetime `'a` required + | | + | help: add explicit lifetime `'a` to the type of `p`: `parameterized1<'a>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-borrow-scope-too-big.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-borrow-scope-too-big.nll.stderr new file mode 100644 index 00000000000..28bf252bc95 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-borrow-scope-too-big.nll.stderr @@ -0,0 +1,18 @@ +error[E0597]: `*p` does not live long enough + --> $DIR/regions-infer-borrow-scope-too-big.rs:22:22 + | +LL | let xc = x_coord(&*p); //~ ERROR `*p` does not live long enough + | ^^^ borrowed value does not live long enough +... +LL | } + | - `*p` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:8... + --> $DIR/regions-infer-borrow-scope-too-big.rs:21:8 + | +LL | fn foo<'a>(p: Box<point>) -> &'a isize { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-infer-borrow-scope-too-big.rs b/src/test/ui/compile-fail-migration/regions-infer-borrow-scope-too-big.rs index 2628e6a1ce2..2628e6a1ce2 100644 --- a/src/test/compile-fail/regions-infer-borrow-scope-too-big.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-borrow-scope-too-big.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-borrow-scope-too-big.stderr b/src/test/ui/compile-fail-migration/regions-infer-borrow-scope-too-big.stderr new file mode 100644 index 00000000000..4c4a9b91958 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-borrow-scope-too-big.stderr @@ -0,0 +1,18 @@ +error[E0597]: `*p` does not live long enough + --> $DIR/regions-infer-borrow-scope-too-big.rs:22:23 + | +LL | let xc = x_coord(&*p); //~ ERROR `*p` does not live long enough + | ^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 21:8... + --> $DIR/regions-infer-borrow-scope-too-big.rs:21:8 + | +LL | fn foo<'a>(p: Box<point>) -> &'a isize { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait-self.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait-self.nll.stderr new file mode 100644 index 00000000000..c71bd17ac78 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait-self.nll.stderr @@ -0,0 +1,17 @@ +warning: not reporting region error due to nll + --> $DIR/regions-infer-bound-from-trait-self.rs:56:9 + | +LL | check_bound(x, self) + | ^^^^^^^^^^^ + +error[E0309]: the parameter type `Self` may not live long enough + --> $DIR/regions-infer-bound-from-trait-self.rs:56:9 + | +LL | check_bound(x, self) + | ^^^^^^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `Self: 'a`... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/regions-infer-bound-from-trait-self.rs b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait-self.rs index 23b8ebfe54b..23b8ebfe54b 100644 --- a/src/test/compile-fail/regions-infer-bound-from-trait-self.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait-self.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait-self.stderr b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait-self.stderr new file mode 100644 index 00000000000..7b30f9a58f5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait-self.stderr @@ -0,0 +1,16 @@ +error[E0309]: the parameter type `Self` may not live long enough + --> $DIR/regions-infer-bound-from-trait-self.rs:56:9 + | +LL | check_bound(x, self) + | ^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `Self: 'a`... +note: ...so that the type `Self` will meet its required lifetime bounds + --> $DIR/regions-infer-bound-from-trait-self.rs:56:9 + | +LL | check_bound(x, self) + | ^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait.nll.stderr new file mode 100644 index 00000000000..25f69031507 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait.nll.stderr @@ -0,0 +1,31 @@ +warning: not reporting region error due to nll + --> $DIR/regions-infer-bound-from-trait.rs:43:5 + | +LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough + | ^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-infer-bound-from-trait.rs:47:5 + | +LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough + | ^^^^^^^^^^^ + +error[E0309]: the parameter type `A` may not live long enough + --> $DIR/regions-infer-bound-from-trait.rs:43:5 + | +LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough + | ^^^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `A: 'a`... + +error[E0309]: the parameter type `A` may not live long enough + --> $DIR/regions-infer-bound-from-trait.rs:47:5 + | +LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough + | ^^^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `A: 'a`... + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/regions-infer-bound-from-trait.rs b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait.rs index f7a91054766..f7a91054766 100644 --- a/src/test/compile-fail/regions-infer-bound-from-trait.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait.stderr b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait.stderr new file mode 100644 index 00000000000..4c89f4bd8a8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-bound-from-trait.stderr @@ -0,0 +1,31 @@ +error[E0309]: the parameter type `A` may not live long enough + --> $DIR/regions-infer-bound-from-trait.rs:43:5 + | +LL | fn bar1<'a,A>(x: Inv<'a>, a: A) { + | - help: consider adding an explicit lifetime bound `A: 'a`... +LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough + | ^^^^^^^^^^^ + | +note: ...so that the type `A` will meet its required lifetime bounds + --> $DIR/regions-infer-bound-from-trait.rs:43:5 + | +LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough + | ^^^^^^^^^^^ + +error[E0309]: the parameter type `A` may not live long enough + --> $DIR/regions-infer-bound-from-trait.rs:47:5 + | +LL | fn bar2<'a,'b,A:Is<'b>>(x: Inv<'a>, y: Inv<'b>, a: A) { + | -- help: consider adding an explicit lifetime bound `A: 'a`... +LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough + | ^^^^^^^^^^^ + | +note: ...so that the type `A` will meet its required lifetime bounds + --> $DIR/regions-infer-bound-from-trait.rs:47:5 + | +LL | check_bound(x, a) //~ ERROR parameter type `A` may not live long enough + | ^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-call-3.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-call-3.nll.stderr new file mode 100644 index 00000000000..c8665fe6a11 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-call-3.nll.stderr @@ -0,0 +1,16 @@ +warning: not reporting region error due to nll + --> $DIR/regions-infer-call-3.rs:18:24 + | +LL | let z = with(|y| { select(x, y) }); + | ^^^^^^^^^^^^ + +error: borrowed data escapes outside of closure + --> $DIR/regions-infer-call-3.rs:18:24 + | +LL | let z = with(|y| { select(x, y) }); + | - ^^^^^^^^^^^^ `y` escapes the closure body here + | | + | `y` is a reference that is only valid in the closure body + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-infer-call-3.rs b/src/test/ui/compile-fail-migration/regions-infer-call-3.rs index 95783a420b6..95783a420b6 100644 --- a/src/test/compile-fail/regions-infer-call-3.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-call-3.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-call-3.stderr b/src/test/ui/compile-fail-migration/regions-infer-call-3.stderr new file mode 100644 index 00000000000..d42e5bfc7dd --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-call-3.stderr @@ -0,0 +1,30 @@ +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'r in function call due to conflicting requirements + --> $DIR/regions-infer-call-3.rs:18:24 + | +LL | let z = with(|y| { select(x, y) }); + | ^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 18:18... + --> $DIR/regions-infer-call-3.rs:18:18 + | +LL | let z = with(|y| { select(x, y) }); + | ^^^^^^^^^^^^^^^^^^^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-infer-call-3.rs:18:34 + | +LL | let z = with(|y| { select(x, y) }); + | ^ +note: but, the lifetime must be valid for the call at 18:13... + --> $DIR/regions-infer-call-3.rs:18:13 + | +LL | let z = with(|y| { select(x, y) }); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...so type `&isize` of expression is valid during the expression + --> $DIR/regions-infer-call-3.rs:18:13 + | +LL | let z = with(|y| { select(x, y) }); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs b/src/test/ui/compile-fail-migration/regions-infer-contravariance-due-to-decl.rs index 6e1c765724b..6e1c765724b 100644 --- a/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-contravariance-due-to-decl.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-contravariance-due-to-decl.stderr b/src/test/ui/compile-fail-migration/regions-infer-contravariance-due-to-decl.stderr new file mode 100644 index 00000000000..10cc253397f --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-contravariance-due-to-decl.stderr @@ -0,0 +1,15 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-infer-contravariance-due-to-decl.rs:35:35 + | +LL | fn use_<'short,'long>(c: Contravariant<'short>, + | --------------------- these two types are declared with different lifetimes... +LL | s: &'short isize, +LL | l: &'long isize, + | ------------ +... +LL | let _: Contravariant<'long> = c; //~ ERROR E0623 + | ^ ...but data from `c` flows into `l` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs b/src/test/ui/compile-fail-migration/regions-infer-covariance-due-to-decl.rs index 1ab8ba4439b..1ab8ba4439b 100644 --- a/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-covariance-due-to-decl.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-covariance-due-to-decl.stderr b/src/test/ui/compile-fail-migration/regions-infer-covariance-due-to-decl.stderr new file mode 100644 index 00000000000..fd853629f37 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-covariance-due-to-decl.stderr @@ -0,0 +1,14 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-infer-covariance-due-to-decl.rs:32:32 + | +LL | fn use_<'short,'long>(c: Covariant<'long>, + | ---------------- +LL | s: &'short isize, + | ------------- these two types are declared with different lifetimes... +... +LL | let _: Covariant<'short> = c; //~ ERROR E0623 + | ^ ...but data from `s` flows into `c` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-decl.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-decl.nll.stderr new file mode 100644 index 00000000000..86a7e1f2c48 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-decl.nll.stderr @@ -0,0 +1,16 @@ +warning: not reporting region error due to nll + --> $DIR/regions-infer-invariance-due-to-decl.rs:22:5 + | +LL | b_isize //~ ERROR mismatched types + | ^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-infer-invariance-due-to-decl.rs:22:5 + | +LL | fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> { + | -- lifetime `'r` defined here +LL | b_isize //~ ERROR mismatched types + | ^^^^^^^ return requires that `'r` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-decl.rs index 8c191fbd5bb..8c191fbd5bb 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-decl.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-decl.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-decl.stderr b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-decl.stderr new file mode 100644 index 00000000000..edd37b1622a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-decl.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/regions-infer-invariance-due-to-decl.rs:22:5 + | +LL | b_isize //~ ERROR mismatched types + | ^^^^^^^ lifetime mismatch + | + = note: expected type `invariant<'static>` + found type `invariant<'r>` +note: the lifetime 'r as defined on the function body at 21:23... + --> $DIR/regions-infer-invariance-due-to-decl.rs:21:23 + | +LL | fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-3.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-3.nll.stderr new file mode 100644 index 00000000000..a021239af1e --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-3.nll.stderr @@ -0,0 +1,16 @@ +warning: not reporting region error due to nll + --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:21:5 + | +LL | b_isize //~ ERROR mismatched types + | ^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:21:5 + | +LL | fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> { + | -- lifetime `'r` defined here +LL | b_isize //~ ERROR mismatched types + | ^^^^^^^ return requires that `'r` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-3.rs index f280e4d978e..f280e4d978e 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-3.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-3.stderr b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-3.stderr new file mode 100644 index 00000000000..3a807b755af --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-3.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:21:5 + | +LL | b_isize //~ ERROR mismatched types + | ^^^^^^^ lifetime mismatch + | + = note: expected type `invariant<'static>` + found type `invariant<'r>` +note: the lifetime 'r as defined on the function body at 20:23... + --> $DIR/regions-infer-invariance-due-to-mutability-3.rs:20:23 + | +LL | fn to_longer_lifetime<'r>(b_isize: invariant<'r>) -> invariant<'static> { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-4.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-4.nll.stderr new file mode 100644 index 00000000000..20e0e730c02 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-4.nll.stderr @@ -0,0 +1,16 @@ +warning: not reporting region error due to nll + --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:21:5 + | +LL | b_isize //~ ERROR mismatched types + | ^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:21:5 + | +LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { + | -- lifetime `'r` defined here +LL | b_isize //~ ERROR mismatched types + | ^^^^^^^ return requires that `'r` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-4.rs index 87b5efbfadd..87b5efbfadd 100644 --- a/src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-4.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-4.stderr b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-4.stderr new file mode 100644 index 00000000000..fb47433ba17 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-invariance-due-to-mutability-4.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:21:5 + | +LL | b_isize //~ ERROR mismatched types + | ^^^^^^^ lifetime mismatch + | + = note: expected type `Invariant<'static>` + found type `Invariant<'r>` +note: the lifetime 'r as defined on the function body at 20:23... + --> $DIR/regions-infer-invariance-due-to-mutability-4.rs:20:23 + | +LL | fn to_longer_lifetime<'r>(b_isize: Invariant<'r>) -> Invariant<'static> { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-not-param.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-not-param.nll.stderr new file mode 100644 index 00000000000..deeca293a1a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-not-param.nll.stderr @@ -0,0 +1,38 @@ +warning: not reporting region error due to nll + --> $DIR/regions-infer-not-param.rs:25:54 + | +LL | fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/regions-infer-not-param.rs:29:63 + | +LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-infer-not-param.rs:25:54 + | +LL | fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched types + | -- -- lifetime `'b` defined here ^ return requires that `'a` must outlive `'b` + | | + | lifetime `'a` defined here + +error: unsatisfied lifetime constraints + --> $DIR/regions-infer-not-param.rs:29:63 + | +LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types + | -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` + | | + | lifetime `'a` defined here + +error: unsatisfied lifetime constraints + --> $DIR/regions-infer-not-param.rs:29:63 + | +LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types + | -- -- lifetime `'b` defined here ^ return requires that `'a` must outlive `'b` + | | + | lifetime `'a` defined here + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/regions-infer-not-param.rs b/src/test/ui/compile-fail-migration/regions-infer-not-param.rs index 131b7170951..131b7170951 100644 --- a/src/test/compile-fail/regions-infer-not-param.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-not-param.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-not-param.stderr b/src/test/ui/compile-fail-migration/regions-infer-not-param.stderr new file mode 100644 index 00000000000..2a029518953 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-not-param.stderr @@ -0,0 +1,60 @@ +error[E0308]: mismatched types + --> $DIR/regions-infer-not-param.rs:25:54 + | +LL | fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `direct<'b>` + found type `direct<'a>` +note: the lifetime 'a as defined on the function body at 25:16... + --> $DIR/regions-infer-not-param.rs:25:16 + | +LL | fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched types + | ^^ +note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 25:19 + --> $DIR/regions-infer-not-param.rs:25:19 + | +LL | fn take_direct<'a,'b>(p: direct<'a>) -> direct<'b> { p } //~ ERROR mismatched types + | ^^ + +error[E0308]: mismatched types + --> $DIR/regions-infer-not-param.rs:29:63 + | +LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `indirect2<'b>` + found type `indirect2<'a>` +note: the lifetime 'a as defined on the function body at 29:19... + --> $DIR/regions-infer-not-param.rs:29:19 + | +LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types + | ^^ +note: ...does not necessarily outlive the lifetime 'b as defined on the function body at 29:22 + --> $DIR/regions-infer-not-param.rs:29:22 + | +LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types + | ^^ + +error[E0308]: mismatched types + --> $DIR/regions-infer-not-param.rs:29:63 + | +LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `indirect2<'b>` + found type `indirect2<'a>` +note: the lifetime 'b as defined on the function body at 29:22... + --> $DIR/regions-infer-not-param.rs:29:22 + | +LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types + | ^^ +note: ...does not necessarily outlive the lifetime 'a as defined on the function body at 29:19 + --> $DIR/regions-infer-not-param.rs:29:19 + | +LL | fn take_indirect2<'a,'b>(p: indirect2<'a>) -> indirect2<'b> { p } //~ ERROR mismatched types + | ^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-paramd-indirect.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-paramd-indirect.nll.stderr new file mode 100644 index 00000000000..01ae2910bd5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-paramd-indirect.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-infer-paramd-indirect.rs:33:18 + | +LL | self.f = b; + | ^ + +error: borrowed data escapes outside of function + --> $DIR/regions-infer-paramd-indirect.rs:33:9 + | +LL | fn set_f_bad(&mut self, b: Box<b>) { + | --------- - `b` is a reference that is only valid in the function body + | | + | `self` is declared here, outside of the function body +LL | self.f = b; + | ^^^^^^ `b` escapes the function body here + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-infer-paramd-indirect.rs b/src/test/ui/compile-fail-migration/regions-infer-paramd-indirect.rs index c559992c865..c559992c865 100644 --- a/src/test/compile-fail/regions-infer-paramd-indirect.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-paramd-indirect.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-paramd-indirect.stderr b/src/test/ui/compile-fail-migration/regions-infer-paramd-indirect.stderr new file mode 100644 index 00000000000..602f30957f1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-paramd-indirect.stderr @@ -0,0 +1,28 @@ +error[E0308]: mismatched types + --> $DIR/regions-infer-paramd-indirect.rs:33:18 + | +LL | self.f = b; + | ^ lifetime mismatch + | + = note: expected type `std::boxed::Box<std::boxed::Box<&'a isize>>` + found type `std::boxed::Box<std::boxed::Box<&isize>>` +note: the anonymous lifetime #2 defined on the method body at 32:5... + --> $DIR/regions-infer-paramd-indirect.rs:32:5 + | +LL | / fn set_f_bad(&mut self, b: Box<b>) { +LL | | self.f = b; +LL | | //~^ ERROR mismatched types +LL | | //~| expected type `std::boxed::Box<std::boxed::Box<&'a isize>>` +LL | | //~| found type `std::boxed::Box<std::boxed::Box<&isize>>` +LL | | //~| lifetime mismatch +LL | | } + | |_____^ +note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 27:6 + --> $DIR/regions-infer-paramd-indirect.rs:27:6 + | +LL | impl<'a> set_f<'a> for c<'a> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/regions-infer-proc-static-upvar.nll.stderr b/src/test/ui/compile-fail-migration/regions-infer-proc-static-upvar.nll.stderr new file mode 100644 index 00000000000..fa358a9cc45 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-proc-static-upvar.nll.stderr @@ -0,0 +1,14 @@ +error[E0597]: `x` does not live long enough + --> $DIR/regions-infer-proc-static-upvar.rs:20:13 + | +LL | let y = &x; //~ ERROR `x` does not live long enough + | ^^ borrowed value does not live long enough +... +LL | } + | - `x` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-infer-proc-static-upvar.rs b/src/test/ui/compile-fail-migration/regions-infer-proc-static-upvar.rs index ee5d5cad0a3..ee5d5cad0a3 100644 --- a/src/test/compile-fail/regions-infer-proc-static-upvar.rs +++ b/src/test/ui/compile-fail-migration/regions-infer-proc-static-upvar.rs diff --git a/src/test/ui/compile-fail-migration/regions-infer-proc-static-upvar.stderr b/src/test/ui/compile-fail-migration/regions-infer-proc-static-upvar.stderr new file mode 100644 index 00000000000..93fe45ed300 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-infer-proc-static-upvar.stderr @@ -0,0 +1,14 @@ +error[E0597]: `x` does not live long enough + --> $DIR/regions-infer-proc-static-upvar.rs:20:14 + | +LL | let y = &x; //~ ERROR `x` does not live long enough + | ^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-lifetime-bounds-on-fns.nll.stderr b/src/test/ui/compile-fail-migration/regions-lifetime-bounds-on-fns.nll.stderr new file mode 100644 index 00000000000..01f0cfa4a71 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-lifetime-bounds-on-fns.nll.stderr @@ -0,0 +1,24 @@ +warning: not reporting region error due to nll + --> $DIR/regions-lifetime-bounds-on-fns.rs:18:10 + | +LL | *x = *y; //~ ERROR E0623 + | ^^ + +warning: not reporting region error due to nll + --> $DIR/regions-lifetime-bounds-on-fns.rs:24:5 + | +LL | a(x, y); //~ ERROR 24:7: 24:8: lifetime mismatch [E0623] + | ^ + +error[E0308]: mismatched types + --> $DIR/regions-lifetime-bounds-on-fns.rs:30:43 + | +LL | let _: fn(&mut &isize, &mut &isize) = a; //~ ERROR mismatched types + | ^ expected concrete lifetime, found bound lifetime parameter + | + = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` + found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/regions-lifetime-bounds-on-fns.rs b/src/test/ui/compile-fail-migration/regions-lifetime-bounds-on-fns.rs index 5955619ea92..5955619ea92 100644 --- a/src/test/compile-fail/regions-lifetime-bounds-on-fns.rs +++ b/src/test/ui/compile-fail-migration/regions-lifetime-bounds-on-fns.rs diff --git a/src/test/ui/compile-fail-migration/regions-lifetime-bounds-on-fns.stderr b/src/test/ui/compile-fail-migration/regions-lifetime-bounds-on-fns.stderr new file mode 100644 index 00000000000..1b600ef905f --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-lifetime-bounds-on-fns.stderr @@ -0,0 +1,31 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-lifetime-bounds-on-fns.rs:18:10 + | +LL | fn b<'a, 'b>(x: &mut &'a isize, y: &mut &'b isize) { + | --------- --------- these two types are declared with different lifetimes... +LL | // Illegal now because there is no `'b:'a` declaration. +LL | *x = *y; //~ ERROR E0623 + | ^^ ...but data from `y` flows into `x` here + +error[E0623]: lifetime mismatch + --> $DIR/regions-lifetime-bounds-on-fns.rs:24:7 + | +LL | fn c<'a,'b>(x: &mut &'a isize, y: &mut &'b isize) { + | --------- --------- these two types are declared with different lifetimes... +... +LL | a(x, y); //~ ERROR 24:7: 24:8: lifetime mismatch [E0623] + | ^ ...but data from `y` flows into `x` here + +error[E0308]: mismatched types + --> $DIR/regions-lifetime-bounds-on-fns.rs:30:43 + | +LL | let _: fn(&mut &isize, &mut &isize) = a; //~ ERROR mismatched types + | ^ expected concrete lifetime, found bound lifetime parameter + | + = note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` + found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` + +error: aborting due to 3 previous errors + +Some errors occurred: E0308, E0623. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/regions-lifetime-of-struct-or-enum-variant.rs b/src/test/ui/compile-fail-migration/regions-lifetime-of-struct-or-enum-variant.rs index 46c486c63a3..46c486c63a3 100644 --- a/src/test/compile-fail/regions-lifetime-of-struct-or-enum-variant.rs +++ b/src/test/ui/compile-fail-migration/regions-lifetime-of-struct-or-enum-variant.rs diff --git a/src/test/ui/compile-fail-migration/regions-lifetime-of-struct-or-enum-variant.stderr b/src/test/ui/compile-fail-migration/regions-lifetime-of-struct-or-enum-variant.stderr new file mode 100644 index 00000000000..390173ed749 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-lifetime-of-struct-or-enum-variant.stderr @@ -0,0 +1,33 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:24:20 + | +LL | let testValue = &id(Test); + | ^^^^^^^^ temporary value does not live long enough +... +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 23:19... + --> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:23:19 + | +LL | fn structLifetime<'a>() -> &'a Test { + | ^^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:30:20 + | +LL | let testValue = &id(MyEnum::Variant1); + | ^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough +... +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 29:20... + --> $DIR/regions-lifetime-of-struct-or-enum-variant.rs:29:20 + | +LL | fn variantLifetime<'a>() -> &'a MyEnum { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-name-duplicated.rs b/src/test/ui/compile-fail-migration/regions-name-duplicated.rs index b4b9cfd75cb..b4b9cfd75cb 100644 --- a/src/test/compile-fail/regions-name-duplicated.rs +++ b/src/test/ui/compile-fail-migration/regions-name-duplicated.rs diff --git a/src/test/ui/compile-fail-migration/regions-name-duplicated.stderr b/src/test/ui/compile-fail-migration/regions-name-duplicated.stderr new file mode 100644 index 00000000000..ad945d54ad1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-name-duplicated.stderr @@ -0,0 +1,11 @@ +error[E0263]: lifetime name `'a` declared twice in the same scope + --> $DIR/regions-name-duplicated.rs:11:16 + | +LL | struct Foo<'a, 'a> { //~ ERROR lifetime name `'a` declared twice + | -- ^^ declared twice + | | + | previous declaration here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0263`. diff --git a/src/test/compile-fail/regions-name-static.rs b/src/test/ui/compile-fail-migration/regions-name-static.rs index 69d63f3820c..69d63f3820c 100644 --- a/src/test/compile-fail/regions-name-static.rs +++ b/src/test/ui/compile-fail-migration/regions-name-static.rs diff --git a/src/test/ui/compile-fail-migration/regions-name-static.stderr b/src/test/ui/compile-fail-migration/regions-name-static.stderr new file mode 100644 index 00000000000..48077d61c45 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-name-static.stderr @@ -0,0 +1,9 @@ +error[E0262]: invalid lifetime parameter name: `'static` + --> $DIR/regions-name-static.rs:11:12 + | +LL | struct Foo<'static> { //~ ERROR invalid lifetime parameter name: `'static` + | ^^^^^^^ 'static is a reserved lifetime name + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0262`. diff --git a/src/test/compile-fail/regions-name-undeclared.rs b/src/test/ui/compile-fail-migration/regions-name-undeclared.rs index a61d3094933..a61d3094933 100644 --- a/src/test/compile-fail/regions-name-undeclared.rs +++ b/src/test/ui/compile-fail-migration/regions-name-undeclared.rs diff --git a/src/test/ui/compile-fail-migration/regions-name-undeclared.stderr b/src/test/ui/compile-fail-migration/regions-name-undeclared.stderr new file mode 100644 index 00000000000..62fc5f5c7f7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-name-undeclared.stderr @@ -0,0 +1,69 @@ +error[E0261]: use of undeclared lifetime name `'b` + --> $DIR/regions-name-undeclared.rs:25:24 + | +LL | fn m4(&self, arg: &'b isize) { } //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'b` + --> $DIR/regions-name-undeclared.rs:26:12 + | +LL | fn m5(&'b self) { } //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'b` + --> $DIR/regions-name-undeclared.rs:27:27 + | +LL | fn m6(&self, arg: Foo<'b>) { } //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-name-undeclared.rs:35:22 + | +LL | type X = Option<&'a isize>; //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-name-undeclared.rs:37:13 + | +LL | E1(&'a isize) //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-name-undeclared.rs:40:13 + | +LL | f: &'a isize //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-name-undeclared.rs:42:14 + | +LL | fn f(a: &'a isize) { } //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-name-undeclared.rs:50:17 + | +LL | fn fn_types(a: &'a isize, //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'b` + --> $DIR/regions-name-undeclared.rs:52:36 + | +LL | &'b isize, //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'b` + --> $DIR/regions-name-undeclared.rs:55:36 + | +LL | &'b isize)>, //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-name-undeclared.rs:56:17 + | +LL | c: &'a isize) //~ ERROR undeclared lifetime + | ^^ undeclared lifetime + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0261`. diff --git a/src/test/ui/compile-fail-migration/regions-nested-fns.nll.stderr b/src/test/ui/compile-fail-migration/regions-nested-fns.nll.stderr new file mode 100644 index 00000000000..d90015b1b21 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-nested-fns.nll.stderr @@ -0,0 +1,60 @@ +warning: not reporting region error due to nll + --> $DIR/regions-nested-fns.rs:24:27 + | +LL | if false { return x; } //~ ERROR E0312 + | ^ + +warning: not reporting region error due to nll + --> $DIR/regions-nested-fns.rs:15:18 + | +LL | let mut ay = &y; //~ ERROR E0495 + | ^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-nested-fns.rs:20:9 + | +LL | let mut ay = &y; //~ ERROR E0495 + | ------ lifetime `'2` appears in the type of `ay` +LL | +LL | ignore::<Box<for<'z> FnMut(&'z isize)>>(Box::new(|z| { + | - has type `&'1 isize` +... +LL | ay = z; + | ^^^^^^ requires that `'1` must outlive `'2` + +error: unsatisfied lifetime constraints + --> $DIR/regions-nested-fns.rs:14:9 + | +LL | fn nested<'x>(x: &'x isize) { + | -- lifetime `'x` defined here +LL | let y = 3; + | ^ requires that `'x` must outlive `'static` + +error[E0597]: `y` does not live long enough + --> $DIR/regions-nested-fns.rs:15:18 + | +LL | let mut ay = &y; //~ ERROR E0495 + | ^^ borrowed value does not live long enough +... +LL | } + | - `y` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: `y` does not live long enough + --> $DIR/regions-nested-fns.rs:19:15 + | +LL | ignore::<Box<for<'z> FnMut(&'z isize)>>(Box::new(|z| { + | --- value captured here +LL | ay = x; +LL | ay = &y; + | ^ borrowed value does not live long enough +... +LL | } + | - `y` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-nested-fns.rs b/src/test/ui/compile-fail-migration/regions-nested-fns.rs index 010b7d17688..010b7d17688 100644 --- a/src/test/compile-fail/regions-nested-fns.rs +++ b/src/test/ui/compile-fail-migration/regions-nested-fns.rs diff --git a/src/test/ui/compile-fail-migration/regions-nested-fns.stderr b/src/test/ui/compile-fail-migration/regions-nested-fns.stderr new file mode 100644 index 00000000000..93004b4c3bf --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-nested-fns.stderr @@ -0,0 +1,61 @@ +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/regions-nested-fns.rs:15:18 + | +LL | let mut ay = &y; //~ ERROR E0495 + | ^^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 17:54... + --> $DIR/regions-nested-fns.rs:17:54 + | +LL | ignore::<Box<for<'z> FnMut(&'z isize)>>(Box::new(|z| { + | ______________________________________________________^ +LL | | ay = x; +LL | | ay = &y; +LL | | ay = z; +LL | | })); + | |_____^ +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-nested-fns.rs:20:14 + | +LL | ay = z; + | ^ +note: but, the lifetime must be valid for the anonymous lifetime #2 defined on the body at 23:68... + --> $DIR/regions-nested-fns.rs:23:68 + | +LL | ignore::< Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { + | ____________________________________________________________________^ +LL | | if false { return x; } //~ ERROR E0312 +LL | | if false { return ay; } +LL | | return z; +LL | | })); + | |_____^ + = note: ...so that the types are compatible: + expected &isize + found &isize + +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/regions-nested-fns.rs:24:27 + | +LL | if false { return x; } //~ ERROR E0312 + | ^ + | +note: ...the reference is valid for the anonymous lifetime #2 defined on the body at 23:68... + --> $DIR/regions-nested-fns.rs:23:68 + | +LL | ignore::< Box<for<'z> FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { + | ____________________________________________________________________^ +LL | | if false { return x; } //~ ERROR E0312 +LL | | if false { return ay; } +LL | | return z; +LL | | })); + | |_____^ +note: ...but the borrowed content is only valid for the lifetime 'x as defined on the function body at 13:11 + --> $DIR/regions-nested-fns.rs:13:11 + | +LL | fn nested<'x>(x: &'x isize) { + | ^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0312, E0495. +For more information about an error, try `rustc --explain E0312`. diff --git a/src/test/compile-fail/regions-normalize-in-where-clause-list.rs b/src/test/ui/compile-fail-migration/regions-normalize-in-where-clause-list.rs index 68642598ed2..68642598ed2 100644 --- a/src/test/compile-fail/regions-normalize-in-where-clause-list.rs +++ b/src/test/ui/compile-fail-migration/regions-normalize-in-where-clause-list.rs diff --git a/src/test/ui/compile-fail-migration/regions-normalize-in-where-clause-list.stderr b/src/test/ui/compile-fail-migration/regions-normalize-in-where-clause-list.stderr new file mode 100644 index 00000000000..ec153f111d6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-normalize-in-where-clause-list.stderr @@ -0,0 +1,26 @@ +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/regions-normalize-in-where-clause-list.rs:32:1 + | +LL | / fn bar<'a, 'b>() //~ ERROR cannot infer +LL | | where <() as Project<'a, 'b>>::Item : Eq +LL | | { +LL | | } + | |_^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 32:8... + --> $DIR/regions-normalize-in-where-clause-list.rs:32:8 + | +LL | fn bar<'a, 'b>() //~ ERROR cannot infer + | ^^ +note: ...but the lifetime must also be valid for the lifetime 'b as defined on the function body at 32:12... + --> $DIR/regions-normalize-in-where-clause-list.rs:32:12 + | +LL | fn bar<'a, 'b>() //~ ERROR cannot infer + | ^^ + = note: ...so that the types are compatible: + expected Project<'a, 'b> + found Project<'_, '_> + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/compile-fail/regions-outlives-nominal-type-enum-region-rev.rs b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region-rev.rs index db25a0698fe..db25a0698fe 100644 --- a/src/test/compile-fail/regions-outlives-nominal-type-enum-region-rev.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region-rev.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region-rev.stderr b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region-rev.stderr new file mode 100644 index 00000000000..5084097e30d --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region-rev.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a rev_variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-nominal-type-enum-region-rev.rs:24:11 + | +LL | V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14 + --> $DIR/regions-outlives-nominal-type-enum-region-rev.rs:23:14 + | +LL | enum Bar<'a,'b> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17 + --> $DIR/regions-outlives-nominal-type-enum-region-rev.rs:23:17 + | +LL | enum Bar<'a,'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-nominal-type-enum-region.rs b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region.rs index 403757042d2..403757042d2 100644 --- a/src/test/compile-fail/regions-outlives-nominal-type-enum-region.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region.stderr b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region.stderr new file mode 100644 index 00000000000..ce187eddfa9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-region.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-nominal-type-enum-region.rs:24:11 + | +LL | V(&'a Foo<'b>) //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14 + --> $DIR/regions-outlives-nominal-type-enum-region.rs:23:14 + | +LL | enum Bar<'a,'b> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17 + --> $DIR/regions-outlives-nominal-type-enum-region.rs:23:17 + | +LL | enum Bar<'a,'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-nominal-type-enum-type-rev.rs b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type-rev.rs index cc294651db7..cc294651db7 100644 --- a/src/test/compile-fail/regions-outlives-nominal-type-enum-type-rev.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type-rev.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type-rev.stderr b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type-rev.stderr new file mode 100644 index 00000000000..8636b89b71a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type-rev.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a rev_variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-nominal-type-enum-type-rev.rs:24:11 + | +LL | V(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14 + --> $DIR/regions-outlives-nominal-type-enum-type-rev.rs:23:14 + | +LL | enum Bar<'a,'b> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17 + --> $DIR/regions-outlives-nominal-type-enum-type-rev.rs:23:17 + | +LL | enum Bar<'a,'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-nominal-type-enum-type.rs b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type.rs index e269767cc16..e269767cc16 100644 --- a/src/test/compile-fail/regions-outlives-nominal-type-enum-type.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type.stderr b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type.stderr new file mode 100644 index 00000000000..c209547e20c --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-enum-type.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-nominal-type-enum-type.rs:24:11 + | +LL | F(&'a Foo<&'b i32>) //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the enum at 23:14 + --> $DIR/regions-outlives-nominal-type-enum-type.rs:23:14 + | +LL | enum Bar<'a,'b> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the enum at 23:17 + --> $DIR/regions-outlives-nominal-type-enum-type.rs:23:17 + | +LL | enum Bar<'a,'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-nominal-type-struct-region-rev.rs b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region-rev.rs index c7e6ace8b92..c7e6ace8b92 100644 --- a/src/test/compile-fail/regions-outlives-nominal-type-struct-region-rev.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region-rev.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region-rev.stderr b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region-rev.stderr new file mode 100644 index 00000000000..48980bdf832 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region-rev.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a rev_variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-nominal-type-struct-region-rev.rs:24:9 + | +LL | f: &'a Foo<'b> //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16 + --> $DIR/regions-outlives-nominal-type-struct-region-rev.rs:23:16 + | +LL | struct Bar<'a,'b> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19 + --> $DIR/regions-outlives-nominal-type-struct-region-rev.rs:23:19 + | +LL | struct Bar<'a,'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-nominal-type-struct-region.rs b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region.rs index 2fe6444c33a..2fe6444c33a 100644 --- a/src/test/compile-fail/regions-outlives-nominal-type-struct-region.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region.stderr b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region.stderr new file mode 100644 index 00000000000..e2b328886b3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-region.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a variant_struct_region::Foo<'b>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-nominal-type-struct-region.rs:24:9 + | +LL | f: &'a Foo<'b> //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16 + --> $DIR/regions-outlives-nominal-type-struct-region.rs:23:16 + | +LL | struct Bar<'a,'b> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19 + --> $DIR/regions-outlives-nominal-type-struct-region.rs:23:19 + | +LL | struct Bar<'a,'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-nominal-type-struct-type-rev.rs b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type-rev.rs index c4b631bce98..c4b631bce98 100644 --- a/src/test/compile-fail/regions-outlives-nominal-type-struct-type-rev.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type-rev.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type-rev.stderr b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type-rev.stderr new file mode 100644 index 00000000000..2bf04ffa64a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type-rev.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a rev_variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-nominal-type-struct-type-rev.rs:24:9 + | +LL | f: &'a Foo<&'b i32> //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16 + --> $DIR/regions-outlives-nominal-type-struct-type-rev.rs:23:16 + | +LL | struct Bar<'a,'b> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19 + --> $DIR/regions-outlives-nominal-type-struct-type-rev.rs:23:19 + | +LL | struct Bar<'a,'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-nominal-type-struct-type.rs b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type.rs index 1c9489444a6..1c9489444a6 100644 --- a/src/test/compile-fail/regions-outlives-nominal-type-struct-type.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type.stderr b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type.stderr new file mode 100644 index 00000000000..af9f1d3722a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-nominal-type-struct-type.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a variant_struct_type::Foo<&'b i32>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-nominal-type-struct-type.rs:24:9 + | +LL | f: &'a Foo<&'b i32> //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the struct at 23:16 + --> $DIR/regions-outlives-nominal-type-struct-type.rs:23:16 + | +LL | struct Bar<'a,'b> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 23:19 + --> $DIR/regions-outlives-nominal-type-struct-type.rs:23:19 + | +LL | struct Bar<'a,'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/ui/compile-fail-migration/regions-outlives-projection-container-hrtb.nll.stderr b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-hrtb.nll.stderr new file mode 100644 index 00000000000..db1508a8c8b --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-hrtb.nll.stderr @@ -0,0 +1,21 @@ +warning: not reporting region error due to nll + --> $DIR/regions-outlives-projection-container-hrtb.rs:42:12 + | +LL | let _: &'a WithHrAssoc<TheType<'b>> = loop { }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-outlives-projection-container-hrtb.rs:63:12 + | +LL | let _: &'a WithHrAssocSub<TheType<'b>> = loop { }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: compilation successful + --> $DIR/regions-outlives-projection-container-hrtb.rs:68:1 + | +LL | / fn main() { +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-outlives-projection-container-hrtb.rs b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-hrtb.rs index ec0631a881a..ec0631a881a 100644 --- a/src/test/compile-fail/regions-outlives-projection-container-hrtb.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-hrtb.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-projection-container-hrtb.stderr b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-hrtb.stderr new file mode 100644 index 00000000000..32c9359b684 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-hrtb.stderr @@ -0,0 +1,37 @@ +error[E0491]: in type `&'a WithHrAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container-hrtb.rs:42:12 + | +LL | let _: &'a WithHrAssoc<TheType<'b>> = loop { }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 39:15 + --> $DIR/regions-outlives-projection-container-hrtb.rs:39:15 + | +LL | fn with_assoc<'a,'b>() { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 39:18 + --> $DIR/regions-outlives-projection-container-hrtb.rs:39:18 + | +LL | fn with_assoc<'a,'b>() { + | ^^ + +error[E0491]: in type `&'a WithHrAssocSub<TheType<'b>>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container-hrtb.rs:63:12 + | +LL | let _: &'a WithHrAssocSub<TheType<'b>> = loop { }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 59:19 + --> $DIR/regions-outlives-projection-container-hrtb.rs:59:19 + | +LL | fn with_assoc_sub<'a,'b>() { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 59:22 + --> $DIR/regions-outlives-projection-container-hrtb.rs:59:22 + | +LL | fn with_assoc_sub<'a,'b>() { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-projection-container-wc.rs b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-wc.rs index 71606ba812f..71606ba812f 100644 --- a/src/test/compile-fail/regions-outlives-projection-container-wc.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-wc.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-projection-container-wc.stderr b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-wc.stderr new file mode 100644 index 00000000000..f0c1c0b3fc2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-container-wc.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container-wc.rs:44:12 + | +LL | let _: &'a WithAssoc<TheType<'b>> = loop { }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 38:15 + --> $DIR/regions-outlives-projection-container-wc.rs:38:15 + | +LL | fn with_assoc<'a,'b>() { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 38:18 + --> $DIR/regions-outlives-projection-container-wc.rs:38:18 + | +LL | fn with_assoc<'a,'b>() { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-projection-container.rs b/src/test/ui/compile-fail-migration/regions-outlives-projection-container.rs index 957e56fe510..957e56fe510 100644 --- a/src/test/compile-fail/regions-outlives-projection-container.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-container.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-projection-container.stderr b/src/test/ui/compile-fail-migration/regions-outlives-projection-container.stderr new file mode 100644 index 00000000000..ac8d84aa8fe --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-container.stderr @@ -0,0 +1,71 @@ +error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container.rs:48:12 + | +LL | let _: &'a WithAssoc<TheType<'b>> = loop { }; //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 42:15 + --> $DIR/regions-outlives-projection-container.rs:42:15 + | +LL | fn with_assoc<'a,'b>() { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 42:18 + --> $DIR/regions-outlives-projection-container.rs:42:18 + | +LL | fn with_assoc<'a,'b>() { + | ^^ + +error[E0491]: in type `&'a WithoutAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container.rs:65:12 + | +LL | let _: &'a WithoutAssoc<TheType<'b>> = loop { }; //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 61:18 + --> $DIR/regions-outlives-projection-container.rs:61:18 + | +LL | fn without_assoc<'a,'b>() { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 61:21 + --> $DIR/regions-outlives-projection-container.rs:61:21 + | +LL | fn without_assoc<'a,'b>() { + | ^^ + +error[E0491]: in type `&'a WithAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container.rs:73:12 + | +LL | call::<&'a WithAssoc<TheType<'b>>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 68:20 + --> $DIR/regions-outlives-projection-container.rs:68:20 + | +LL | fn call_with_assoc<'a,'b>() { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 68:23 + --> $DIR/regions-outlives-projection-container.rs:68:23 + | +LL | fn call_with_assoc<'a,'b>() { + | ^^ + +error[E0491]: in type `&'a WithoutAssoc<TheType<'b>>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container.rs:80:12 + | +LL | call::<&'a WithoutAssoc<TheType<'b>>>(); //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 77:23 + --> $DIR/regions-outlives-projection-container.rs:77:23 + | +LL | fn call_without_assoc<'a,'b>() { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the function body at 77:26 + --> $DIR/regions-outlives-projection-container.rs:77:26 + | +LL | fn call_without_assoc<'a,'b>() { + | ^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0491`. diff --git a/src/test/compile-fail/regions-outlives-projection-hrtype.rs b/src/test/ui/compile-fail-migration/regions-outlives-projection-hrtype.rs index 2d271b7be73..2d271b7be73 100644 --- a/src/test/compile-fail/regions-outlives-projection-hrtype.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-hrtype.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-projection-hrtype.stderr b/src/test/ui/compile-fail-migration/regions-outlives-projection-hrtype.stderr new file mode 100644 index 00000000000..ba4e318957e --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-hrtype.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/regions-outlives-projection-hrtype.rs:36:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-outlives-projection-trait-def.rs b/src/test/ui/compile-fail-migration/regions-outlives-projection-trait-def.rs index 04682a77297..04682a77297 100644 --- a/src/test/compile-fail/regions-outlives-projection-trait-def.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-trait-def.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-projection-trait-def.stderr b/src/test/ui/compile-fail-migration/regions-outlives-projection-trait-def.stderr new file mode 100644 index 00000000000..0a4cbe64d46 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-projection-trait-def.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/regions-outlives-projection-trait-def.rs:31:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-outlives-scalar.rs b/src/test/ui/compile-fail-migration/regions-outlives-scalar.rs index 94f7a350cf7..94f7a350cf7 100644 --- a/src/test/compile-fail/regions-outlives-scalar.rs +++ b/src/test/ui/compile-fail-migration/regions-outlives-scalar.rs diff --git a/src/test/ui/compile-fail-migration/regions-outlives-scalar.stderr b/src/test/ui/compile-fail-migration/regions-outlives-scalar.stderr new file mode 100644 index 00000000000..d754bdd6032 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-outlives-scalar.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/regions-outlives-scalar.rs:23:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19552.nll.stderr b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19552.nll.stderr new file mode 100644 index 00000000000..c39d007312f --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19552.nll.stderr @@ -0,0 +1,14 @@ +error[E0597]: `line` does not live long enough + --> $DIR/regions-pattern-typing-issue-19552.rs:15:14 + | +LL | match [&*line] { //~ ERROR `line` does not live long enough + | ^^^^ borrowed value does not live long enough +... +LL | } + | - `line` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-pattern-typing-issue-19552.rs b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19552.rs index 3401dd1becd..3401dd1becd 100644 --- a/src/test/compile-fail/regions-pattern-typing-issue-19552.rs +++ b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19552.rs diff --git a/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19552.stderr b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19552.stderr new file mode 100644 index 00000000000..cefedefa243 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19552.stderr @@ -0,0 +1,14 @@ +error[E0597]: `line` does not live long enough + --> $DIR/regions-pattern-typing-issue-19552.rs:15:14 + | +LL | match [&*line] { //~ ERROR `line` does not live long enough + | ^^^^ borrowed value does not live long enough +... +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.ast.nll.stderr b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.ast.nll.stderr new file mode 100644 index 00000000000..2acac5d5cf8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.ast.nll.stderr @@ -0,0 +1,15 @@ +error[E0506]: cannot assign to `a1` because it is borrowed + --> $DIR/regions-pattern-typing-issue-19997.rs:20:13 + | +LL | match (&a1,) { + | --- borrow of `a1` occurs here +LL | (&ref b0,) => { +LL | a1 = &f; //[ast]~ ERROR cannot assign + | ^^^^^^^ assignment to borrowed `a1` occurs here +LL | //[mir]~^ ERROR cannot assign to `a1` because it is borrowed +LL | drop(b0); + | -- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.ast.stderr b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.ast.stderr new file mode 100644 index 00000000000..c26a0369740 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.ast.stderr @@ -0,0 +1,12 @@ +error[E0506]: cannot assign to `a1` because it is borrowed + --> $DIR/regions-pattern-typing-issue-19997.rs:20:13 + | +LL | match (&a1,) { + | -- borrow of `a1` occurs here +LL | (&ref b0,) => { +LL | a1 = &f; //[ast]~ ERROR cannot assign + | ^^^^^^^ assignment to borrowed `a1` occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.mir.stderr b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.mir.stderr new file mode 100644 index 00000000000..2acac5d5cf8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.mir.stderr @@ -0,0 +1,15 @@ +error[E0506]: cannot assign to `a1` because it is borrowed + --> $DIR/regions-pattern-typing-issue-19997.rs:20:13 + | +LL | match (&a1,) { + | --- borrow of `a1` occurs here +LL | (&ref b0,) => { +LL | a1 = &f; //[ast]~ ERROR cannot assign + | ^^^^^^^ assignment to borrowed `a1` occurs here +LL | //[mir]~^ ERROR cannot assign to `a1` because it is borrowed +LL | drop(b0); + | -- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/regions-pattern-typing-issue-19997.rs b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.rs index 1f23dcbb725..1f23dcbb725 100644 --- a/src/test/compile-fail/regions-pattern-typing-issue-19997.rs +++ b/src/test/ui/compile-fail-migration/regions-pattern-typing-issue-19997.rs diff --git a/src/test/ui/compile-fail-migration/regions-proc-bound-capture.nll.stderr b/src/test/ui/compile-fail-migration/regions-proc-bound-capture.nll.stderr new file mode 100644 index 00000000000..00728aa4783 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-proc-bound-capture.nll.stderr @@ -0,0 +1,21 @@ +warning: not reporting region error due to nll + --> $DIR/regions-proc-bound-capture.rs:19:14 + | +LL | Box::new(move|| { *x }) //~ ERROR explicit lifetime required in the type of `x` [E0621] + | ^^^^^^^^^^^^^ + +error[E0621]: explicit lifetime required in the type of `x` + --> $DIR/regions-proc-bound-capture.rs:17:62 + | +LL | fn static_proc(x: &isize) -> Box<FnMut()->(isize) + 'static> { + | ___________________------_____________________________________^ + | | | + | | help: add explicit lifetime `'static` to the type of `x`: `&'static isize` +LL | | // This is illegal, because the region bound on `proc` is 'static. +LL | | Box::new(move|| { *x }) //~ ERROR explicit lifetime required in the type of `x` [E0621] +LL | | } + | |_^ lifetime `'static` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/compile-fail/regions-proc-bound-capture.rs b/src/test/ui/compile-fail-migration/regions-proc-bound-capture.rs index dd7b2bf9635..dd7b2bf9635 100644 --- a/src/test/compile-fail/regions-proc-bound-capture.rs +++ b/src/test/ui/compile-fail-migration/regions-proc-bound-capture.rs diff --git a/src/test/ui/compile-fail-migration/regions-proc-bound-capture.stderr b/src/test/ui/compile-fail-migration/regions-proc-bound-capture.stderr new file mode 100644 index 00000000000..b38543bdc43 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-proc-bound-capture.stderr @@ -0,0 +1,12 @@ +error[E0621]: explicit lifetime required in the type of `x` + --> $DIR/regions-proc-bound-capture.rs:19:5 + | +LL | fn static_proc(x: &isize) -> Box<FnMut()->(isize) + 'static> { + | ------ help: add explicit lifetime `'static` to the type of `x`: `&'static isize` +LL | // This is illegal, because the region bound on `proc` is 'static. +LL | Box::new(move|| { *x }) //~ ERROR explicit lifetime required in the type of `x` [E0621] + | ^^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr new file mode 100644 index 00000000000..761fa6f32ff --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr @@ -0,0 +1,20 @@ +warning: not reporting region error due to nll + --> $DIR/regions-reborrow-from-shorter-mut-ref-mut-ref.rs:14:5 + | +LL | &mut ***p //~ ERROR 14:5: 14:14: lifetime mismatch [E0623] + | ^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-reborrow-from-shorter-mut-ref-mut-ref.rs:13:85 + | +LL | fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b mut isize { + | ______________________--__--_________________________________________________________^ + | | | | + | | | lifetime `'b` defined here + | | lifetime `'a` defined here +LL | | &mut ***p //~ ERROR 14:5: 14:14: lifetime mismatch [E0623] +LL | | } + | |_^ requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-reborrow-from-shorter-mut-ref-mut-ref.rs b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref-mut-ref.rs index f6f1a189e5e..f6f1a189e5e 100644 --- a/src/test/compile-fail/regions-reborrow-from-shorter-mut-ref-mut-ref.rs +++ b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref-mut-ref.rs diff --git a/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr new file mode 100644 index 00000000000..cddb60a4337 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr @@ -0,0 +1,13 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-reborrow-from-shorter-mut-ref-mut-ref.rs:14:5 + | +LL | fn copy_borrowed_ptr<'a, 'b, 'c>(p: &'a mut &'b mut &'c mut isize) -> &'b mut isize { + | ----------------------------- ------------- + | | + | this parameter and the return type are declared with different lifetimes... +LL | &mut ***p //~ ERROR 14:5: 14:14: lifetime mismatch [E0623] + | ^^^^^^^^^ ...but data from `p` is returned here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref.nll.stderr b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref.nll.stderr new file mode 100644 index 00000000000..c3eb6fd9097 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref.nll.stderr @@ -0,0 +1,20 @@ +warning: not reporting region error due to nll + --> $DIR/regions-reborrow-from-shorter-mut-ref.rs:16:5 + | +LL | &mut **p //~ ERROR 16:5: 16:13: lifetime mismatch [E0623] + | ^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-reborrow-from-shorter-mut-ref.rs:15:73 + | +LL | fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize { + | ______________________--__--_____________________________________________^ + | | | | + | | | lifetime `'b` defined here + | | lifetime `'a` defined here +LL | | &mut **p //~ ERROR 16:5: 16:13: lifetime mismatch [E0623] +LL | | } + | |_^ requires that `'a` must outlive `'b` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-reborrow-from-shorter-mut-ref.rs b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref.rs index 7270b477d2d..7270b477d2d 100644 --- a/src/test/compile-fail/regions-reborrow-from-shorter-mut-ref.rs +++ b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref.rs diff --git a/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref.stderr b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref.stderr new file mode 100644 index 00000000000..9f8d0168ede --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-reborrow-from-shorter-mut-ref.stderr @@ -0,0 +1,13 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-reborrow-from-shorter-mut-ref.rs:16:5 + | +LL | fn copy_borrowed_ptr<'a, 'b>(p: &'a mut &'b mut isize) -> &'b mut isize { + | --------------------- ------------- + | | + | this parameter and the return type are declared with different lifetimes... +LL | &mut **p //~ ERROR 16:5: 16:13: lifetime mismatch [E0623] + | ^^^^^^^^ ...but data from `p` is returned here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/regions-ref-in-fn-arg.nll.stderr b/src/test/ui/compile-fail-migration/regions-ref-in-fn-arg.nll.stderr new file mode 100644 index 00000000000..87fe858769d --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-ref-in-fn-arg.nll.stderr @@ -0,0 +1,22 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-ref-in-fn-arg.rs:14:13 + | +LL | fn arg_item(box ref x: Box<isize>) -> &'static isize { + | ^^^^^^^^^ temporary value does not live long enough +LL | x //~^ ERROR borrowed value does not live long enough +LL | } + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-ref-in-fn-arg.rs:21:11 + | +LL | with(|box ref x| x) //~ ERROR borrowed value does not live long enough + | ^^^^^^^^^ - temporary value only lives until here + | | + | temporary value does not live long enough + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-ref-in-fn-arg.rs b/src/test/ui/compile-fail-migration/regions-ref-in-fn-arg.rs index bc8060e3915..bc8060e3915 100644 --- a/src/test/compile-fail/regions-ref-in-fn-arg.rs +++ b/src/test/ui/compile-fail-migration/regions-ref-in-fn-arg.rs diff --git a/src/test/ui/compile-fail-migration/regions-ref-in-fn-arg.stderr b/src/test/ui/compile-fail-migration/regions-ref-in-fn-arg.stderr new file mode 100644 index 00000000000..0250f6e26fe --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-ref-in-fn-arg.stderr @@ -0,0 +1,24 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-ref-in-fn-arg.rs:14:17 + | +LL | fn arg_item(box ref x: Box<isize>) -> &'static isize { + | ^^^^^ borrowed value does not live long enough +LL | x //~^ ERROR borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-ref-in-fn-arg.rs:21:15 + | +LL | with(|box ref x| x) //~ ERROR borrowed value does not live long enough + | ^^^^^ - borrowed value only lives until here + | | + | borrowed value does not live long enough + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-ret-borrowed-1.nll.stderr b/src/test/ui/compile-fail-migration/regions-ret-borrowed-1.nll.stderr new file mode 100644 index 00000000000..ae53ab692bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-ret-borrowed-1.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-ret-borrowed-1.rs:20:14 + | +LL | with(|o| o) + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-ret-borrowed-1.rs:20:14 + | +LL | with(|o| o) + | ----^ + | || | + | || return requires that `'1` must outlive `'2` + | |has type `&'1 isize` + | lifetime `'2` appears in return type + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-ret-borrowed-1.rs b/src/test/ui/compile-fail-migration/regions-ret-borrowed-1.rs index b8cebe66518..b8cebe66518 100644 --- a/src/test/compile-fail/regions-ret-borrowed-1.rs +++ b/src/test/ui/compile-fail-migration/regions-ret-borrowed-1.rs diff --git a/src/test/ui/compile-fail-migration/regions-ret-borrowed-1.stderr b/src/test/ui/compile-fail-migration/regions-ret-borrowed-1.stderr new file mode 100644 index 00000000000..ac886bcbc7c --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-ret-borrowed-1.stderr @@ -0,0 +1,28 @@ +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/regions-ret-borrowed-1.rs:20:14 + | +LL | with(|o| o) + | ^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 20:10... + --> $DIR/regions-ret-borrowed-1.rs:20:10 + | +LL | with(|o| o) + | ^^^^^ + = note: ...so that the expression is assignable: + expected &isize + found &isize +note: but, the lifetime must be valid for the lifetime 'a as defined on the function body at 19:14... + --> $DIR/regions-ret-borrowed-1.rs:19:14 + | +LL | fn return_it<'a>() -> &'a isize { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-ret-borrowed-1.rs:20:5 + | +LL | with(|o| o) + | ^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-ret-borrowed.nll.stderr b/src/test/ui/compile-fail-migration/regions-ret-borrowed.nll.stderr new file mode 100644 index 00000000000..8d782b19723 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-ret-borrowed.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-ret-borrowed.rs:23:14 + | +LL | with(|o| o) + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-ret-borrowed.rs:23:14 + | +LL | with(|o| o) + | ----^ + | || | + | || return requires that `'1` must outlive `'2` + | |has type `&'1 isize` + | lifetime `'2` appears in return type + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-ret-borrowed.rs b/src/test/ui/compile-fail-migration/regions-ret-borrowed.rs index 40909ddd4ad..40909ddd4ad 100644 --- a/src/test/compile-fail/regions-ret-borrowed.rs +++ b/src/test/ui/compile-fail-migration/regions-ret-borrowed.rs diff --git a/src/test/ui/compile-fail-migration/regions-ret-borrowed.stderr b/src/test/ui/compile-fail-migration/regions-ret-borrowed.stderr new file mode 100644 index 00000000000..36c4ce7e174 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-ret-borrowed.stderr @@ -0,0 +1,28 @@ +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/regions-ret-borrowed.rs:23:14 + | +LL | with(|o| o) + | ^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 23:10... + --> $DIR/regions-ret-borrowed.rs:23:10 + | +LL | with(|o| o) + | ^^^^^ + = note: ...so that the expression is assignable: + expected &isize + found &isize +note: but, the lifetime must be valid for the lifetime 'a as defined on the function body at 22:14... + --> $DIR/regions-ret-borrowed.rs:22:14 + | +LL | fn return_it<'a>() -> &'a isize { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/regions-ret-borrowed.rs:23:5 + | +LL | with(|o| o) + | ^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/compile-fail-migration/regions-ret.nll.stderr b/src/test/ui/compile-fail-migration/regions-ret.nll.stderr new file mode 100644 index 00000000000..cacc119d410 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-ret.nll.stderr @@ -0,0 +1,19 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-ret.rs:14:13 + | +LL | return &id(3); //~ ERROR borrowed value does not live long enough + | ^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 13:1... + --> $DIR/regions-ret.rs:13:1 + | +LL | / fn f(_x: &isize) -> &isize { +LL | | return &id(3); //~ ERROR borrowed value does not live long enough +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-ret.rs b/src/test/ui/compile-fail-migration/regions-ret.rs index c7cd3ced98d..c7cd3ced98d 100644 --- a/src/test/compile-fail/regions-ret.rs +++ b/src/test/ui/compile-fail-migration/regions-ret.rs diff --git a/src/test/ui/compile-fail-migration/regions-ret.stderr b/src/test/ui/compile-fail-migration/regions-ret.stderr new file mode 100644 index 00000000000..84515a9b44c --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-ret.stderr @@ -0,0 +1,20 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-ret.rs:14:13 + | +LL | return &id(3); //~ ERROR borrowed value does not live long enough + | ^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 13:1... + --> $DIR/regions-ret.rs:13:1 + | +LL | / fn f(_x: &isize) -> &isize { +LL | | return &id(3); //~ ERROR borrowed value does not live long enough +LL | | } + | |_^ + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-return-ref-to-upvar-issue-17403.nll.stderr b/src/test/ui/compile-fail-migration/regions-return-ref-to-upvar-issue-17403.nll.stderr new file mode 100644 index 00000000000..e3b981a1bf6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-return-ref-to-upvar-issue-17403.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/regions-return-ref-to-upvar-issue-17403.rs:17:24 + | +LL | let mut f = || &mut x; //~ ERROR cannot infer + | ^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-return-ref-to-upvar-issue-17403.rs:17:24 + | +LL | let mut f = || &mut x; //~ ERROR cannot infer + | ---^^^^^^ + | | | + | | return requires that `'1` must outlive `'2` + | lifetime `'1` represents the closure body + | lifetime `'2` appears in return type + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs b/src/test/ui/compile-fail-migration/regions-return-ref-to-upvar-issue-17403.rs index 99e5cc03153..99e5cc03153 100644 --- a/src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs +++ b/src/test/ui/compile-fail-migration/regions-return-ref-to-upvar-issue-17403.rs diff --git a/src/test/ui/compile-fail-migration/regions-return-ref-to-upvar-issue-17403.stderr b/src/test/ui/compile-fail-migration/regions-return-ref-to-upvar-issue-17403.stderr new file mode 100644 index 00000000000..c841c9605bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-return-ref-to-upvar-issue-17403.stderr @@ -0,0 +1,30 @@ +error[E0495]: cannot infer an appropriate lifetime for borrow expression due to conflicting requirements + --> $DIR/regions-return-ref-to-upvar-issue-17403.rs:17:24 + | +LL | let mut f = || &mut x; //~ ERROR cannot infer + | ^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime as defined on the body at 17:21... + --> $DIR/regions-return-ref-to-upvar-issue-17403.rs:17:21 + | +LL | let mut f = || &mut x; //~ ERROR cannot infer + | ^^^^^^^^^ +note: ...so that closure can access `x` + --> $DIR/regions-return-ref-to-upvar-issue-17403.rs:17:24 + | +LL | let mut f = || &mut x; //~ ERROR cannot infer + | ^^^^^^ +note: but, the lifetime must be valid for the call at 19:17... + --> $DIR/regions-return-ref-to-upvar-issue-17403.rs:19:17 + | +LL | let y = f(); + | ^^^ +note: ...so type `&mut i32` of expression is valid during the expression + --> $DIR/regions-return-ref-to-upvar-issue-17403.rs:19:17 + | +LL | let y = f(); + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/compile-fail/regions-return-stack-allocated-vec.rs b/src/test/ui/compile-fail-migration/regions-return-stack-allocated-vec.rs index b5d4e07d04b..b5d4e07d04b 100644 --- a/src/test/compile-fail/regions-return-stack-allocated-vec.rs +++ b/src/test/ui/compile-fail-migration/regions-return-stack-allocated-vec.rs diff --git a/src/test/ui/compile-fail-migration/regions-return-stack-allocated-vec.stderr b/src/test/ui/compile-fail-migration/regions-return-stack-allocated-vec.stderr new file mode 100644 index 00000000000..77c1d177acb --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-return-stack-allocated-vec.stderr @@ -0,0 +1,13 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-return-stack-allocated-vec.rs:14:6 + | +LL | &[x] //~ ERROR borrowed value does not live long enough + | ^^^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-static-bound.ll.nll.stderr b/src/test/ui/compile-fail-migration/regions-static-bound.ll.nll.stderr new file mode 100644 index 00000000000..aaae14fede6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-static-bound.ll.nll.stderr @@ -0,0 +1,46 @@ +warning: not reporting region error due to nll + --> $DIR/regions-static-bound.rs:19:5 + | +LL | t //[ll]~ ERROR E0312 + | ^ + +warning: not reporting region error due to nll + --> $DIR/regions-static-bound.rs:25:5 + | +LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621] + | ^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-static-bound.rs:28:5 + | +LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621] + | ^^^^^^^^^^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-static-bound.rs:19:5 + | +LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { + | -- lifetime `'a` defined here +LL | t //[ll]~ ERROR E0312 + | ^ return requires that `'a` must outlive `'static` + +error[E0621]: explicit lifetime required in the type of `u` + --> $DIR/regions-static-bound.rs:25:5 + | +LL | fn error(u: &(), v: &()) { + | --- help: add explicit lifetime `'static` to the type of `u`: `&'static ()` +LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621] + | ^^^^^^^^^^^^^ lifetime `'static` required + +error[E0621]: explicit lifetime required in the type of `v` + --> $DIR/regions-static-bound.rs:28:5 + | +LL | fn error(u: &(), v: &()) { + | --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()` +... +LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621] + | ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/ui/compile-fail-migration/regions-static-bound.ll.stderr b/src/test/ui/compile-fail-migration/regions-static-bound.ll.stderr new file mode 100644 index 00000000000..4a11677765d --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-static-bound.ll.stderr @@ -0,0 +1,34 @@ +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/regions-static-bound.rs:19:5 + | +LL | t //[ll]~ ERROR E0312 + | ^ + | + = note: ...the reference is valid for the static lifetime... +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 18:24 + --> $DIR/regions-static-bound.rs:18:24 + | +LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { + | ^^ + +error[E0621]: explicit lifetime required in the type of `u` + --> $DIR/regions-static-bound.rs:25:5 + | +LL | fn error(u: &(), v: &()) { + | --- help: add explicit lifetime `'static` to the type of `u`: `&'static ()` +LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621] + | ^^^^^^^^^ lifetime `'static` required + +error[E0621]: explicit lifetime required in the type of `v` + --> $DIR/regions-static-bound.rs:28:5 + | +LL | fn error(u: &(), v: &()) { + | --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()` +... +LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621] + | ^^^^^^^^^^^^^^^^^^ lifetime `'static` required + +error: aborting due to 3 previous errors + +Some errors occurred: E0312, E0621. +For more information about an error, try `rustc --explain E0312`. diff --git a/src/test/ui/compile-fail-migration/regions-static-bound.nll.stderr b/src/test/ui/compile-fail-migration/regions-static-bound.nll.stderr new file mode 100644 index 00000000000..aaae14fede6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-static-bound.nll.stderr @@ -0,0 +1,46 @@ +warning: not reporting region error due to nll + --> $DIR/regions-static-bound.rs:19:5 + | +LL | t //[ll]~ ERROR E0312 + | ^ + +warning: not reporting region error due to nll + --> $DIR/regions-static-bound.rs:25:5 + | +LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621] + | ^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-static-bound.rs:28:5 + | +LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621] + | ^^^^^^^^^^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-static-bound.rs:19:5 + | +LL | fn static_id_wrong_way<'a>(t: &'a ()) -> &'static () where 'static: 'a { + | -- lifetime `'a` defined here +LL | t //[ll]~ ERROR E0312 + | ^ return requires that `'a` must outlive `'static` + +error[E0621]: explicit lifetime required in the type of `u` + --> $DIR/regions-static-bound.rs:25:5 + | +LL | fn error(u: &(), v: &()) { + | --- help: add explicit lifetime `'static` to the type of `u`: `&'static ()` +LL | static_id(&u); //[ll]~ ERROR explicit lifetime required in the type of `u` [E0621] + | ^^^^^^^^^^^^^ lifetime `'static` required + +error[E0621]: explicit lifetime required in the type of `v` + --> $DIR/regions-static-bound.rs:28:5 + | +LL | fn error(u: &(), v: &()) { + | --- help: add explicit lifetime `'static` to the type of `v`: `&'static ()` +... +LL | static_id_indirect(&v); //[ll]~ ERROR explicit lifetime required in the type of `v` [E0621] + | ^^^^^^^^^^^^^^^^^^^^^^ lifetime `'static` required + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/compile-fail/regions-static-bound.rs b/src/test/ui/compile-fail-migration/regions-static-bound.rs index 0a37df4f0c7..0a37df4f0c7 100644 --- a/src/test/compile-fail/regions-static-bound.rs +++ b/src/test/ui/compile-fail-migration/regions-static-bound.rs diff --git a/src/test/ui/compile-fail-migration/regions-steal-closure.nll.stderr b/src/test/ui/compile-fail-migration/regions-steal-closure.nll.stderr new file mode 100644 index 00000000000..ed70e38362d --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-steal-closure.nll.stderr @@ -0,0 +1,15 @@ +error[E0597]: `i` does not live long enough + --> $DIR/regions-steal-closure.rs:24:28 + | +LL | box_it(Box::new(|| i += 1)) //~ ERROR `i` does not live long enough + | -- ^ borrowed value does not live long enough + | | + | value captured here +LL | }; + | - `i` dropped here while still borrowed +LL | cl_box.cl.call_mut(()); + | --------- borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-steal-closure.rs b/src/test/ui/compile-fail-migration/regions-steal-closure.rs index 7ca63b9896f..7ca63b9896f 100644 --- a/src/test/compile-fail/regions-steal-closure.rs +++ b/src/test/ui/compile-fail-migration/regions-steal-closure.rs diff --git a/src/test/ui/compile-fail-migration/regions-steal-closure.stderr b/src/test/ui/compile-fail-migration/regions-steal-closure.stderr new file mode 100644 index 00000000000..44843d19e92 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-steal-closure.stderr @@ -0,0 +1,16 @@ +error[E0597]: `i` does not live long enough + --> $DIR/regions-steal-closure.rs:24:28 + | +LL | box_it(Box::new(|| i += 1)) //~ ERROR `i` does not live long enough + | -- ^ borrowed value does not live long enough + | | + | capture occurs here +LL | }; + | - borrowed value only lives until here +LL | cl_box.cl.call_mut(()); +LL | } + | - borrowed value needs to live until here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/compile-fail-migration/regions-struct-not-wf.lexical.stderr b/src/test/ui/compile-fail-migration/regions-struct-not-wf.lexical.stderr new file mode 100644 index 00000000000..9433b8b1952 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-struct-not-wf.lexical.stderr @@ -0,0 +1,49 @@ +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-struct-not-wf.rs:19:5 + | +LL | struct Ref<'a, T> { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | field: &'a T + | ^^^^^^^^^^^^ + | +note: ...so that the reference type `&'a T` does not outlive the data it points at + --> $DIR/regions-struct-not-wf.rs:19:5 + | +LL | field: &'a T + | ^^^^^^^^^^^^ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-struct-not-wf.rs:29:5 + | +LL | struct RefIndirect<'a, T> { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | field: RefOk<'a, T> + | ^^^^^^^^^^^^^^^^^^^ + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/regions-struct-not-wf.rs:29:5 + | +LL | field: RefOk<'a, T> + | ^^^^^^^^^^^^^^^^^^^ + +error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references + --> $DIR/regions-struct-not-wf.rs:35:5 + | +LL | field: &'a &'b T + | ^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the struct at 34:18 + --> $DIR/regions-struct-not-wf.rs:34:18 + | +LL | struct DoubleRef<'a, 'b, T> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 34:22 + --> $DIR/regions-struct-not-wf.rs:34:22 + | +LL | struct DoubleRef<'a, 'b, T> { + | ^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0309, E0491. +For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/ui/compile-fail-migration/regions-struct-not-wf.nll.stderr b/src/test/ui/compile-fail-migration/regions-struct-not-wf.nll.stderr new file mode 100644 index 00000000000..9433b8b1952 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-struct-not-wf.nll.stderr @@ -0,0 +1,49 @@ +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-struct-not-wf.rs:19:5 + | +LL | struct Ref<'a, T> { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | field: &'a T + | ^^^^^^^^^^^^ + | +note: ...so that the reference type `&'a T` does not outlive the data it points at + --> $DIR/regions-struct-not-wf.rs:19:5 + | +LL | field: &'a T + | ^^^^^^^^^^^^ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/regions-struct-not-wf.rs:29:5 + | +LL | struct RefIndirect<'a, T> { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | field: RefOk<'a, T> + | ^^^^^^^^^^^^^^^^^^^ + | +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/regions-struct-not-wf.rs:29:5 + | +LL | field: RefOk<'a, T> + | ^^^^^^^^^^^^^^^^^^^ + +error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references + --> $DIR/regions-struct-not-wf.rs:35:5 + | +LL | field: &'a &'b T + | ^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the struct at 34:18 + --> $DIR/regions-struct-not-wf.rs:34:18 + | +LL | struct DoubleRef<'a, 'b, T> { + | ^^ +note: but the referenced data is only valid for the lifetime 'b as defined on the struct at 34:22 + --> $DIR/regions-struct-not-wf.rs:34:22 + | +LL | struct DoubleRef<'a, 'b, T> { + | ^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0309, E0491. +For more information about an error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/regions-struct-not-wf.rs b/src/test/ui/compile-fail-migration/regions-struct-not-wf.rs index 9106f1f0ba6..9106f1f0ba6 100644 --- a/src/test/compile-fail/regions-struct-not-wf.rs +++ b/src/test/ui/compile-fail-migration/regions-struct-not-wf.rs diff --git a/src/test/compile-fail/regions-trait-1.rs b/src/test/ui/compile-fail-migration/regions-trait-1.rs index 9cd08656b62..9cd08656b62 100644 --- a/src/test/compile-fail/regions-trait-1.rs +++ b/src/test/ui/compile-fail-migration/regions-trait-1.rs diff --git a/src/test/ui/compile-fail-migration/regions-trait-1.stderr b/src/test/ui/compile-fail-migration/regions-trait-1.stderr new file mode 100644 index 00000000000..dbc47a55950 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-trait-1.stderr @@ -0,0 +1,24 @@ +error[E0308]: method not compatible with trait + --> $DIR/regions-trait-1.rs:26:5 + | +LL | fn get_ctxt(&self) -> &'a ctxt { //~ ERROR method not compatible with trait + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `fn(&has_ctxt<'a>) -> &ctxt` + found type `fn(&has_ctxt<'a>) -> &'a ctxt` +note: the lifetime 'a as defined on the impl at 22:6... + --> $DIR/regions-trait-1.rs:22:6 + | +LL | impl<'a> get_ctxt for has_ctxt<'a> { + | ^^ +note: ...does not necessarily outlive the anonymous lifetime #1 defined on the method body at 26:5 + --> $DIR/regions-trait-1.rs:26:5 + | +LL | / fn get_ctxt(&self) -> &'a ctxt { //~ ERROR method not compatible with trait +LL | | self.c +LL | | } + | |_____^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/regions-trait-object-subtyping.nll.stderr b/src/test/ui/compile-fail-migration/regions-trait-object-subtyping.nll.stderr new file mode 100644 index 00000000000..3d884f6fc5f --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-trait-object-subtyping.nll.stderr @@ -0,0 +1,39 @@ +warning: not reporting region error due to nll + --> $DIR/regions-trait-object-subtyping.rs:25:5 + | +LL | x //~ ERROR lifetime bound not satisfied + | ^ + +warning: not reporting region error due to nll + --> $DIR/regions-trait-object-subtyping.rs:32:5 + | +LL | x //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/regions-trait-object-subtyping.rs:23:51 + | +LL | fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy { + | _________--_--_____________________________________^ + | | | | + | | | lifetime `'b` defined here + | | lifetime `'a` defined here +LL | | // Without knowing 'a:'b, we can't coerce +LL | | x //~ ERROR lifetime bound not satisfied +LL | | //~^ ERROR cannot infer an appropriate lifetime +LL | | } + | |_^ return requires that `'a` must outlive `'b` + +error: unsatisfied lifetime constraints + --> $DIR/regions-trait-object-subtyping.rs:32:5 + | +LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut Dummy>) -> Wrapper<&'b mut Dummy> { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | // We can't coerce because it is packed in `Wrapper` +LL | x //~ ERROR mismatched types + | ^ return requires that `'b` must outlive `'a` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/regions-trait-object-subtyping.rs b/src/test/ui/compile-fail-migration/regions-trait-object-subtyping.rs index 948fb7e1ef6..948fb7e1ef6 100644 --- a/src/test/compile-fail/regions-trait-object-subtyping.rs +++ b/src/test/ui/compile-fail-migration/regions-trait-object-subtyping.rs diff --git a/src/test/ui/compile-fail-migration/regions-trait-object-subtyping.stderr b/src/test/ui/compile-fail-migration/regions-trait-object-subtyping.stderr new file mode 100644 index 00000000000..1b078855efd --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-trait-object-subtyping.stderr @@ -0,0 +1,65 @@ +error[E0478]: lifetime bound not satisfied + --> $DIR/regions-trait-object-subtyping.rs:25:5 + | +LL | x //~ ERROR lifetime bound not satisfied + | ^ + | +note: lifetime parameter instantiated with the lifetime 'a as defined on the function body at 23:9 + --> $DIR/regions-trait-object-subtyping.rs:23:9 + | +LL | fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy { + | ^^ +note: but lifetime parameter must outlive the lifetime 'b as defined on the function body at 23:12 + --> $DIR/regions-trait-object-subtyping.rs:23:12 + | +LL | fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy { + | ^^ + +error[E0495]: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements + --> $DIR/regions-trait-object-subtyping.rs:25:5 + | +LL | x //~ ERROR lifetime bound not satisfied + | ^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 23:9... + --> $DIR/regions-trait-object-subtyping.rs:23:9 + | +LL | fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy { + | ^^ +note: ...so that the type `(dyn Dummy + 'a)` is not borrowed for too long + --> $DIR/regions-trait-object-subtyping.rs:25:5 + | +LL | x //~ ERROR lifetime bound not satisfied + | ^ +note: but, the lifetime must be valid for the lifetime 'b as defined on the function body at 23:12... + --> $DIR/regions-trait-object-subtyping.rs:23:12 + | +LL | fn foo3<'a,'b>(x: &'a mut Dummy) -> &'b mut Dummy { + | ^^ + = note: ...so that the expression is assignable: + expected &'b mut (dyn Dummy + 'b) + found &mut (dyn Dummy + 'b) + +error[E0308]: mismatched types + --> $DIR/regions-trait-object-subtyping.rs:32:5 + | +LL | x //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `Wrapper<&'b mut (dyn Dummy + 'b)>` + found type `Wrapper<&'a mut (dyn Dummy + 'a)>` +note: the lifetime 'b as defined on the function body at 30:15... + --> $DIR/regions-trait-object-subtyping.rs:30:15 + | +LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut Dummy>) -> Wrapper<&'b mut Dummy> { + | ^^ +note: ...does not necessarily outlive the lifetime 'a as defined on the function body at 30:9 + --> $DIR/regions-trait-object-subtyping.rs:30:9 + | +LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut Dummy>) -> Wrapper<&'b mut Dummy> { + | ^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0308, E0478, E0495. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/regions-trait-variance.nll.stderr b/src/test/ui/compile-fail-migration/regions-trait-variance.nll.stderr new file mode 100644 index 00000000000..c610394c51b --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-trait-variance.nll.stderr @@ -0,0 +1,18 @@ +error[E0597]: `*b` does not live long enough + --> $DIR/regions-trait-variance.rs:47:18 + | +LL | let bb: &B = &*b; //~ ERROR `*b` does not live long enough + | ^^^ borrowed value does not live long enough +LL | make_a(bb) +LL | } + | - `*b` dropped here while still borrowed + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 43:16... + --> $DIR/regions-trait-variance.rs:43:16 + | +LL | fn make_make_a<'a>() -> A<'a> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-trait-variance.rs b/src/test/ui/compile-fail-migration/regions-trait-variance.rs index 9ba4ef4e358..9ba4ef4e358 100644 --- a/src/test/compile-fail/regions-trait-variance.rs +++ b/src/test/ui/compile-fail-migration/regions-trait-variance.rs diff --git a/src/test/ui/compile-fail-migration/regions-trait-variance.stderr b/src/test/ui/compile-fail-migration/regions-trait-variance.stderr new file mode 100644 index 00000000000..cd48d6bf8af --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-trait-variance.stderr @@ -0,0 +1,18 @@ +error[E0597]: `*b` does not live long enough + --> $DIR/regions-trait-variance.rs:47:19 + | +LL | let bb: &B = &*b; //~ ERROR `*b` does not live long enough + | ^^ borrowed value does not live long enough +LL | make_a(bb) +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the lifetime 'a as defined on the function body at 43:16... + --> $DIR/regions-trait-variance.rs:43:16 + | +LL | fn make_make_a<'a>() -> A<'a> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-undeclared.rs b/src/test/ui/compile-fail-migration/regions-undeclared.rs index 31908751580..31908751580 100644 --- a/src/test/compile-fail/regions-undeclared.rs +++ b/src/test/ui/compile-fail-migration/regions-undeclared.rs diff --git a/src/test/ui/compile-fail-migration/regions-undeclared.stderr b/src/test/ui/compile-fail-migration/regions-undeclared.stderr new file mode 100644 index 00000000000..9870f328abe --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-undeclared.stderr @@ -0,0 +1,33 @@ +error[E0261]: use of undeclared lifetime name `'blk` + --> $DIR/regions-undeclared.rs:11:14 + | +LL | static c_x: &'blk isize = &22; //~ ERROR use of undeclared lifetime name `'blk` + | ^^^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-undeclared.rs:14:10 + | +LL | Foo(&'a isize), //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-undeclared.rs:15:10 + | +LL | Bar(&'a isize), //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-undeclared.rs:18:15 + | +LL | fn fnDecl(x: &'a isize, //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/regions-undeclared.rs:19:15 + | +LL | y: &'a isize) //~ ERROR use of undeclared lifetime name `'a` + | ^^ undeclared lifetime + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0261`. diff --git a/src/test/ui/compile-fail-migration/regions-var-type-out-of-scope.nll.stderr b/src/test/ui/compile-fail-migration/regions-var-type-out-of-scope.nll.stderr new file mode 100644 index 00000000000..54b1a6fa970 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-var-type-out-of-scope.nll.stderr @@ -0,0 +1,15 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-var-type-out-of-scope.rs:19:14 + | +LL | x = &id(3); //~ ERROR borrowed value does not live long enough + | ^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough +LL | assert_eq!(*x, 3); + | ------------------ borrow later used here + | + = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-var-type-out-of-scope.rs b/src/test/ui/compile-fail-migration/regions-var-type-out-of-scope.rs index 031091c4523..031091c4523 100644 --- a/src/test/compile-fail/regions-var-type-out-of-scope.rs +++ b/src/test/ui/compile-fail-migration/regions-var-type-out-of-scope.rs diff --git a/src/test/ui/compile-fail-migration/regions-var-type-out-of-scope.stderr b/src/test/ui/compile-fail-migration/regions-var-type-out-of-scope.stderr new file mode 100644 index 00000000000..92a6451c3bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-var-type-out-of-scope.stderr @@ -0,0 +1,16 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/regions-var-type-out-of-scope.rs:19:14 + | +LL | x = &id(3); //~ ERROR borrowed value does not live long enough + | ^^^^^- temporary value dropped here while still borrowed + | | + | temporary value does not live long enough +... +LL | } + | - temporary value needs to live until here + | + = note: consider using a `let` binding to increase its lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/regions-variance-contravariant-use-covariant-in-second-position.rs b/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant-in-second-position.rs index 1dfebd54ec3..1dfebd54ec3 100644 --- a/src/test/compile-fail/regions-variance-contravariant-use-covariant-in-second-position.rs +++ b/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant-in-second-position.rs diff --git a/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant-in-second-position.stderr b/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant-in-second-position.stderr new file mode 100644 index 00000000000..45105e8714c --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant-in-second-position.stderr @@ -0,0 +1,14 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-variance-contravariant-use-covariant-in-second-position.rs:35:30 + | +LL | fn use_<'short,'long>(c: S<'long, 'short>, + | ---------------- + | | + | this type is declared with multiple lifetimes... +... +LL | let _: S<'long, 'long> = c; //~ ERROR E0623 + | ^ ...but data with one lifetime flows into the other here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/regions-variance-contravariant-use-covariant.rs b/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant.rs index caf6a86fc0b..caf6a86fc0b 100644 --- a/src/test/compile-fail/regions-variance-contravariant-use-covariant.rs +++ b/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant.rs diff --git a/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant.stderr b/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant.stderr new file mode 100644 index 00000000000..c883691c348 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-variance-contravariant-use-covariant.stderr @@ -0,0 +1,15 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-variance-contravariant-use-covariant.rs:33:35 + | +LL | fn use_<'short,'long>(c: Contravariant<'short>, + | --------------------- these two types are declared with different lifetimes... +LL | s: &'short isize, +LL | l: &'long isize, + | ------------ +... +LL | let _: Contravariant<'long> = c; //~ ERROR E0623 + | ^ ...but data from `c` flows into `l` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/regions-variance-covariant-use-contravariant.rs b/src/test/ui/compile-fail-migration/regions-variance-covariant-use-contravariant.rs index 60dc3d94a2e..60dc3d94a2e 100644 --- a/src/test/compile-fail/regions-variance-covariant-use-contravariant.rs +++ b/src/test/ui/compile-fail-migration/regions-variance-covariant-use-contravariant.rs diff --git a/src/test/ui/compile-fail-migration/regions-variance-covariant-use-contravariant.stderr b/src/test/ui/compile-fail-migration/regions-variance-covariant-use-contravariant.stderr new file mode 100644 index 00000000000..a448d26f81b --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-variance-covariant-use-contravariant.stderr @@ -0,0 +1,14 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-variance-covariant-use-contravariant.rs:33:32 + | +LL | fn use_<'short,'long>(c: Covariant<'long>, + | ---------------- +LL | s: &'short isize, + | ------------- these two types are declared with different lifetimes... +... +LL | let _: Covariant<'short> = c; //~ ERROR E0623 + | ^ ...but data from `s` flows into `c` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/regions-variance-invariant-use-contravariant.rs b/src/test/ui/compile-fail-migration/regions-variance-invariant-use-contravariant.rs index 96478fa5909..96478fa5909 100644 --- a/src/test/compile-fail/regions-variance-invariant-use-contravariant.rs +++ b/src/test/ui/compile-fail-migration/regions-variance-invariant-use-contravariant.rs diff --git a/src/test/ui/compile-fail-migration/regions-variance-invariant-use-contravariant.stderr b/src/test/ui/compile-fail-migration/regions-variance-invariant-use-contravariant.stderr new file mode 100644 index 00000000000..1b0cd8e646a --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-variance-invariant-use-contravariant.stderr @@ -0,0 +1,14 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-variance-invariant-use-contravariant.rs:30:32 + | +LL | fn use_<'short,'long>(c: Invariant<'long>, + | ---------------- +LL | s: &'short isize, + | ------------- these two types are declared with different lifetimes... +... +LL | let _: Invariant<'short> = c; //~ ERROR E0623 + | ^ ...but data from `s` flows into `c` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/regions-variance-invariant-use-covariant.rs b/src/test/ui/compile-fail-migration/regions-variance-invariant-use-covariant.rs index bd944a8b52c..bd944a8b52c 100644 --- a/src/test/compile-fail/regions-variance-invariant-use-covariant.rs +++ b/src/test/ui/compile-fail-migration/regions-variance-invariant-use-covariant.rs diff --git a/src/test/ui/compile-fail-migration/regions-variance-invariant-use-covariant.stderr b/src/test/ui/compile-fail-migration/regions-variance-invariant-use-covariant.stderr new file mode 100644 index 00000000000..34111120a08 --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-variance-invariant-use-covariant.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/regions-variance-invariant-use-covariant.rs:27:33 + | +LL | let _: Invariant<'static> = c; //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `Invariant<'static>` + found type `Invariant<'b>` +note: the lifetime 'b as defined on the function body at 21:9... + --> $DIR/regions-variance-invariant-use-covariant.rs:21:9 + | +LL | fn use_<'b>(c: Invariant<'b>) { + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/regions-wf-trait-object.rs b/src/test/ui/compile-fail-migration/regions-wf-trait-object.rs index 39b8482cfa3..39b8482cfa3 100644 --- a/src/test/compile-fail/regions-wf-trait-object.rs +++ b/src/test/ui/compile-fail-migration/regions-wf-trait-object.rs diff --git a/src/test/ui/compile-fail-migration/regions-wf-trait-object.stderr b/src/test/ui/compile-fail-migration/regions-wf-trait-object.stderr new file mode 100644 index 00000000000..caaa902abbe --- /dev/null +++ b/src/test/ui/compile-fail-migration/regions-wf-trait-object.stderr @@ -0,0 +1,20 @@ +error[E0478]: lifetime bound not satisfied + --> $DIR/regions-wf-trait-object.rs:17:5 + | +LL | x: Box<TheTrait<'a>+'b> //~ ERROR E0478 + | ^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lifetime parameter instantiated with the lifetime 'b as defined on the struct at 16:15 + --> $DIR/regions-wf-trait-object.rs:16:15 + | +LL | struct Foo<'a,'b> { + | ^^ +note: but lifetime parameter must outlive the lifetime 'a as defined on the struct at 16:12 + --> $DIR/regions-wf-trait-object.rs:16:12 + | +LL | struct Foo<'a,'b> { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0478`. diff --git a/src/test/compile-fail/reject-specialized-drops-8142.rs b/src/test/ui/compile-fail-migration/reject-specialized-drops-8142.rs index 1ea956bbd54..1ea956bbd54 100644 --- a/src/test/compile-fail/reject-specialized-drops-8142.rs +++ b/src/test/ui/compile-fail-migration/reject-specialized-drops-8142.rs diff --git a/src/test/ui/compile-fail-migration/reject-specialized-drops-8142.stderr b/src/test/ui/compile-fail-migration/reject-specialized-drops-8142.stderr new file mode 100644 index 00000000000..c0f1525a761 --- /dev/null +++ b/src/test/ui/compile-fail-migration/reject-specialized-drops-8142.stderr @@ -0,0 +1,115 @@ +error[E0367]: The requirement `'adds_bnd : 'al` is added only by the Drop impl. + --> $DIR/reject-specialized-drops-8142.rs:29:1 + | +LL | / impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT +LL | | //~^ ERROR The requirement `'adds_bnd : 'al` is added only by the Drop impl. +LL | | fn drop(&mut self) { } } + | |____________________________^ + | +note: The same requirement must be part of the struct/enum definition + --> $DIR/reject-specialized-drops-8142.rs:15:1 + | +LL | struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0367]: The requirement `'adds_bnd : 'al` is added only by the Drop impl. + --> $DIR/reject-specialized-drops-8142.rs:33:1 + | +LL | / impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT +LL | | //~^ ERROR The requirement `'adds_bnd : 'al` is added only by the Drop impl. +LL | | fn drop(&mut self) { } } + | |____________________________^ + | +note: The same requirement must be part of the struct/enum definition + --> $DIR/reject-specialized-drops-8142.rs:16:1 + | +LL | struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/reject-specialized-drops-8142.rs:39:1 + | +LL | impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `N<'n>` + found type `N<'static>` +note: the lifetime 'n as defined on the struct at 18:10... + --> $DIR/reject-specialized-drops-8142.rs:18:10 + | +LL | struct N<'n> { x: &'n i8 } + | ^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0366]: Implementations of Drop cannot be specialized + --> $DIR/reject-specialized-drops-8142.rs:46:1 + | +LL | impl Drop for P<i8> { fn drop(&mut self) { } } // REJECT + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: Use same sequence of generic type and region parameters that is on the struct/enum definition + --> $DIR/reject-specialized-drops-8142.rs:20:1 + | +LL | struct P<Tp> { x: *const Tp } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0367]: The requirement `Adds_bnd: Bound` is added only by the Drop impl. + --> $DIR/reject-specialized-drops-8142.rs:49:1 + | +LL | impl<Adds_bnd:Bound> Drop for Q<Adds_bnd> { fn drop(&mut self) { } } // REJECT + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: The same requirement must be part of the struct/enum definition + --> $DIR/reject-specialized-drops-8142.rs:21:1 + | +LL | struct Q<Tq> { x: *const Tq } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0367]: The requirement `Adds_rbnd : 'rbnd` is added only by the Drop impl. + --> $DIR/reject-specialized-drops-8142.rs:52:1 + | +LL | impl<'rbnd,Adds_rbnd:'rbnd> Drop for R<Adds_rbnd> { fn drop(&mut self) { } } // REJECT + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: The same requirement must be part of the struct/enum definition + --> $DIR/reject-specialized-drops-8142.rs:22:1 + | +LL | struct R<Tr> { x: *const Tr } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0366]: Implementations of Drop cannot be specialized + --> $DIR/reject-specialized-drops-8142.rs:61:1 + | +LL | impl<One> Drop for V<One,One> { fn drop(&mut self) { } } // REJECT + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: Use same sequence of generic type and region parameters that is on the struct/enum definition + --> $DIR/reject-specialized-drops-8142.rs:26:1 + | +LL | struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'lw` due to conflicting requirements + --> $DIR/reject-specialized-drops-8142.rs:64:1 + | +LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'l1 as defined on the struct at 27:10... + --> $DIR/reject-specialized-drops-8142.rs:27:10 + | +LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 } + | ^^^ +note: ...but the lifetime must also be valid for the lifetime 'l2 as defined on the struct at 27:15... + --> $DIR/reject-specialized-drops-8142.rs:27:15 + | +LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 } + | ^^^ + = note: ...so that the types are compatible: + expected W<'l1, 'l2> + found W<'_, '_> + +error: aborting due to 8 previous errors + +Some errors occurred: E0308, E0366, E0367, E0495. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/repeat-to-run-dtor-twice.rs b/src/test/ui/compile-fail-migration/repeat-to-run-dtor-twice.rs index 88441594a7e..88441594a7e 100644 --- a/src/test/compile-fail/repeat-to-run-dtor-twice.rs +++ b/src/test/ui/compile-fail-migration/repeat-to-run-dtor-twice.rs diff --git a/src/test/ui/compile-fail-migration/repeat-to-run-dtor-twice.stderr b/src/test/ui/compile-fail-migration/repeat-to-run-dtor-twice.stderr new file mode 100644 index 00000000000..408c28af10e --- /dev/null +++ b/src/test/ui/compile-fail-migration/repeat-to-run-dtor-twice.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `Foo: std::marker::Copy` is not satisfied + --> $DIR/repeat-to-run-dtor-twice.rs:27:13 + | +LL | let _ = [ a; 5 ]; + | ^^^^^^^^ the trait `std::marker::Copy` is not implemented for `Foo` + | + = note: the `Copy` trait is required because the repeated element will be copied + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/repeat_count.rs b/src/test/ui/compile-fail-migration/repeat_count.rs index a716f3e29d4..a716f3e29d4 100644 --- a/src/test/compile-fail/repeat_count.rs +++ b/src/test/ui/compile-fail-migration/repeat_count.rs diff --git a/src/test/ui/compile-fail-migration/repeat_count.stderr b/src/test/ui/compile-fail-migration/repeat_count.stderr new file mode 100644 index 00000000000..4852023ec8b --- /dev/null +++ b/src/test/ui/compile-fail-migration/repeat_count.stderr @@ -0,0 +1,64 @@ +error[E0435]: attempt to use a non-constant value in a constant + --> $DIR/repeat_count.rs:15:17 + | +LL | let a = [0; n]; + | ^ non-constant value + +error[E0308]: mismatched types + --> $DIR/repeat_count.rs:17:17 + | +LL | let b = [0; ()]; + | ^^ expected usize, found () + | + = note: expected type `usize` + found type `()` + +error[E0308]: mismatched types + --> $DIR/repeat_count.rs:22:17 + | +LL | let c = [0; true]; + | ^^^^ expected usize, found bool + +error[E0308]: mismatched types + --> $DIR/repeat_count.rs:25:17 + | +LL | let d = [0; 0.5]; + | ^^^ expected usize, found floating-point variable + | + = note: expected type `usize` + found type `{float}` + +error[E0308]: mismatched types + --> $DIR/repeat_count.rs:30:17 + | +LL | let e = [0; "foo"]; + | ^^^^^ expected usize, found reference + | + = note: expected type `usize` + found type `&'static str` + +error[E0308]: mismatched types + --> $DIR/repeat_count.rs:35:17 + | +LL | let f = [0; -4_isize]; + | ^^^^^^^^ expected usize, found isize + +error[E0308]: mismatched types + --> $DIR/repeat_count.rs:38:23 + | +LL | let f = [0_usize; -1_isize]; + | ^^^^^^^^ expected usize, found isize + +error[E0308]: mismatched types + --> $DIR/repeat_count.rs:44:17 + | +LL | let g = [0; G { g: () }]; + | ^^^^^^^^^^^ expected usize, found struct `main::G` + | + = note: expected type `usize` + found type `main::G` + +error: aborting due to 8 previous errors + +Some errors occurred: E0308, E0435. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/repr-align.rs b/src/test/ui/compile-fail-migration/repr-align.rs index 9b0408de2a4..9b0408de2a4 100644 --- a/src/test/compile-fail/repr-align.rs +++ b/src/test/ui/compile-fail-migration/repr-align.rs diff --git a/src/test/ui/compile-fail-migration/repr-align.stderr b/src/test/ui/compile-fail-migration/repr-align.stderr new file mode 100644 index 00000000000..2195789bd69 --- /dev/null +++ b/src/test/ui/compile-fail-migration/repr-align.stderr @@ -0,0 +1,21 @@ +error[E0589]: invalid `repr(align)` attribute: not an unsuffixed integer + --> $DIR/repr-align.rs:12:8 + | +LL | #[repr(align(16.0))] //~ ERROR: invalid `repr(align)` attribute: not an unsuffixed integer + | ^^^^^^^^^^^ + +error[E0589]: invalid `repr(align)` attribute: not a power of two + --> $DIR/repr-align.rs:15:8 + | +LL | #[repr(align(15))] //~ ERROR: invalid `repr(align)` attribute: not a power of two + | ^^^^^^^^^ + +error[E0589]: invalid `repr(align)` attribute: larger than 2^29 + --> $DIR/repr-align.rs:18:8 + | +LL | #[repr(align(4294967296))] //~ ERROR: invalid `repr(align)` attribute: larger than 2^29 + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0589`. diff --git a/src/test/compile-fail/repr-packed-contains-align.rs b/src/test/ui/compile-fail-migration/repr-packed-contains-align.rs index 27890333a51..27890333a51 100644 --- a/src/test/compile-fail/repr-packed-contains-align.rs +++ b/src/test/ui/compile-fail-migration/repr-packed-contains-align.rs diff --git a/src/test/ui/compile-fail-migration/repr-packed-contains-align.stderr b/src/test/ui/compile-fail-migration/repr-packed-contains-align.stderr new file mode 100644 index 00000000000..4558cf2e104 --- /dev/null +++ b/src/test/ui/compile-fail-migration/repr-packed-contains-align.stderr @@ -0,0 +1,59 @@ +error[E0588]: packed type cannot transitively contain a `[repr(align)]` type + --> $DIR/repr-packed-contains-align.rs:28:1 + | +LL | struct SC(SA); //~ ERROR: packed type cannot transitively contain a `[repr(align)]` type + | ^^^^^^^^^^^^^^ + +error[E0588]: packed type cannot transitively contain a `[repr(align)]` type + --> $DIR/repr-packed-contains-align.rs:31:1 + | +LL | struct SD(SB); //~ ERROR: packed type cannot transitively contain a `[repr(align)]` type + | ^^^^^^^^^^^^^^ + +error[E0588]: packed type cannot transitively contain a `[repr(align)]` type + --> $DIR/repr-packed-contains-align.rs:34:1 + | +LL | struct SE(UA); //~ ERROR: packed type cannot transitively contain a `[repr(align)]` type + | ^^^^^^^^^^^^^^ + +error[E0588]: packed type cannot transitively contain a `[repr(align)]` type + --> $DIR/repr-packed-contains-align.rs:37:1 + | +LL | struct SF(UB); //~ ERROR: packed type cannot transitively contain a `[repr(align)]` type + | ^^^^^^^^^^^^^^ + +error[E0588]: packed type cannot transitively contain a `[repr(align)]` type + --> $DIR/repr-packed-contains-align.rs:40:1 + | +LL | / union UC { //~ ERROR: packed type cannot transitively contain a `[repr(align)]` type +LL | | a: UA +LL | | } + | |_^ + +error[E0588]: packed type cannot transitively contain a `[repr(align)]` type + --> $DIR/repr-packed-contains-align.rs:45:1 + | +LL | / union UD { //~ ERROR: packed type cannot transitively contain a `[repr(align)]` type +LL | | n: UB +LL | | } + | |_^ + +error[E0588]: packed type cannot transitively contain a `[repr(align)]` type + --> $DIR/repr-packed-contains-align.rs:50:1 + | +LL | / union UE { //~ ERROR: packed type cannot transitively contain a `[repr(align)]` type +LL | | a: SA +LL | | } + | |_^ + +error[E0588]: packed type cannot transitively contain a `[repr(align)]` type + --> $DIR/repr-packed-contains-align.rs:55:1 + | +LL | / union UF { //~ ERROR: packed type cannot transitively contain a `[repr(align)]` type +LL | | n: SB +LL | | } + | |_^ + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0588`. diff --git a/src/test/compile-fail/repr-transparent-other-items.rs b/src/test/ui/compile-fail-migration/repr-transparent-other-items.rs index 685d62dc3a9..685d62dc3a9 100644 --- a/src/test/compile-fail/repr-transparent-other-items.rs +++ b/src/test/ui/compile-fail-migration/repr-transparent-other-items.rs diff --git a/src/test/ui/compile-fail-migration/repr-transparent-other-items.stderr b/src/test/ui/compile-fail-migration/repr-transparent-other-items.stderr new file mode 100644 index 00000000000..e5889cf53e5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/repr-transparent-other-items.stderr @@ -0,0 +1,73 @@ +error[E0601]: `main` function not found in crate `repr_transparent_other_items` + | + = note: consider adding a `main` function to `$DIR/repr-transparent-other-items.rs` + +error[E0517]: attribute should be applied to struct + --> $DIR/repr-transparent-other-items.rs:13:8 + | +LL | #[repr(transparent)] //~ ERROR unsupported representation for zero-variant enum + | ^^^^^^^^^^^ +LL | enum Void {} //~| ERROR should be applied to struct + | ------------ not a struct + +error[E0517]: attribute should be applied to struct + --> $DIR/repr-transparent-other-items.rs:16:8 + | +LL | #[repr(transparent)] //~ ERROR should be applied to struct + | ^^^^^^^^^^^ +LL | / enum FieldlessEnum { +LL | | Foo, +LL | | Bar, +LL | | } + | |_- not a struct + +error[E0517]: attribute should be applied to struct + --> $DIR/repr-transparent-other-items.rs:22:8 + | +LL | #[repr(transparent)] //~ ERROR should be applied to struct + | ^^^^^^^^^^^ +LL | / enum Enum { +LL | | Foo(String), +LL | | Bar(u32), +LL | | } + | |_- not a struct + +error[E0517]: attribute should be applied to struct + --> $DIR/repr-transparent-other-items.rs:28:8 + | +LL | #[repr(transparent)] //~ ERROR should be applied to struct + | ^^^^^^^^^^^ +LL | / union Foo { +LL | | u: u32, +LL | | s: i32 +LL | | } + | |_- not a struct + +error[E0517]: attribute should be applied to struct + --> $DIR/repr-transparent-other-items.rs:34:8 + | +LL | #[repr(transparent)] //~ ERROR should be applied to struct + | ^^^^^^^^^^^ +LL | fn cant_repr_this() {} + | ---------------------- not a struct + +error[E0517]: attribute should be applied to struct + --> $DIR/repr-transparent-other-items.rs:37:8 + | +LL | #[repr(transparent)] //~ ERROR should be applied to struct + | ^^^^^^^^^^^ +LL | static CANT_REPR_THIS: u32 = 0; + | ------------------------------- not a struct + +error[E0084]: unsupported representation for zero-variant enum + --> $DIR/repr-transparent-other-items.rs:13:1 + | +LL | #[repr(transparent)] //~ ERROR unsupported representation for zero-variant enum + | ^^^^^^^^^^^^^^^^^^^^ +LL | enum Void {} //~| ERROR should be applied to struct + | ------------ zero-variant enum + +error: aborting due to 8 previous errors + +Some errors occurred: E0084, E0517, E0601. +For more information about an error, try `rustc --explain E0084`. diff --git a/src/test/compile-fail/repr-transparent-other-reprs.rs b/src/test/ui/compile-fail-migration/repr-transparent-other-reprs.rs index a391c0ae1f8..a391c0ae1f8 100644 --- a/src/test/compile-fail/repr-transparent-other-reprs.rs +++ b/src/test/ui/compile-fail-migration/repr-transparent-other-reprs.rs diff --git a/src/test/ui/compile-fail-migration/repr-transparent-other-reprs.stderr b/src/test/ui/compile-fail-migration/repr-transparent-other-reprs.stderr new file mode 100644 index 00000000000..40f41c474db --- /dev/null +++ b/src/test/ui/compile-fail-migration/repr-transparent-other-reprs.stderr @@ -0,0 +1,34 @@ +error[E0601]: `main` function not found in crate `repr_transparent_other_reprs` + | + = note: consider adding a `main` function to `$DIR/repr-transparent-other-reprs.rs` + +error[E0692]: transparent struct cannot have other repr hints + --> $DIR/repr-transparent-other-reprs.rs:15:8 + | +LL | #[repr(transparent, C)] //~ ERROR cannot have other repr + | ^^^^^^^^^^^ ^ + +error[E0692]: transparent struct cannot have other repr hints + --> $DIR/repr-transparent-other-reprs.rs:20:8 + | +LL | #[repr(transparent, packed)] //~ ERROR cannot have other repr + | ^^^^^^^^^^^ ^^^^^^ + +error[E0692]: transparent struct cannot have other repr hints + --> $DIR/repr-transparent-other-reprs.rs:23:8 + | +LL | #[repr(transparent, align(2))] //~ ERROR cannot have other repr + | ^^^^^^^^^^^ ^^^^^^^^ + +error[E0692]: transparent struct cannot have other repr hints + --> $DIR/repr-transparent-other-reprs.rs:26:8 + | +LL | #[repr(transparent)] //~ ERROR cannot have other repr + | ^^^^^^^^^^^ +LL | #[repr(C)] + | ^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0601, E0692. +For more information about an error, try `rustc --explain E0601`. diff --git a/src/test/compile-fail/repr-transparent.rs b/src/test/ui/compile-fail-migration/repr-transparent.rs index 4d8ec4cdb40..4d8ec4cdb40 100644 --- a/src/test/compile-fail/repr-transparent.rs +++ b/src/test/ui/compile-fail-migration/repr-transparent.rs diff --git a/src/test/ui/compile-fail-migration/repr-transparent.stderr b/src/test/ui/compile-fail-migration/repr-transparent.stderr new file mode 100644 index 00000000000..0f620880fa9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/repr-transparent.stderr @@ -0,0 +1,76 @@ +error[E0601]: `main` function not found in crate `repr_transparent` + | + = note: consider adding a `main` function to `$DIR/repr-transparent.rs` + +error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0 + --> $DIR/repr-transparent.rs:21:1 + | +LL | struct NoFields; //~ ERROR needs exactly one non-zero-sized field + | ^^^^^^^^^^^^^^^^ + | + = note: non-zero-sized field + +error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0 + --> $DIR/repr-transparent.rs:24:1 + | +LL | struct ContainsOnlyZst(()); //~ ERROR needs exactly one non-zero-sized field + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: non-zero-sized field + +error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0 + --> $DIR/repr-transparent.rs:27:1 + | +LL | struct ContainsOnlyZstArray([bool; 0]); //~ ERROR needs exactly one non-zero-sized field + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: non-zero-sized field + +error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 0 + --> $DIR/repr-transparent.rs:30:1 + | +LL | struct ContainsMultipleZst(PhantomData<*const i32>, NoFields); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: non-zero-sized field + +error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 2 + --> $DIR/repr-transparent.rs:34:1 + | +LL | struct MultipleNonZst(u8, u8); //~ ERROR needs exactly one non-zero-sized field + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: non-zero-sized field + --> $DIR/repr-transparent.rs:34:23 + | +LL | struct MultipleNonZst(u8, u8); //~ ERROR needs exactly one non-zero-sized field + | ^^ ^^ + +error[E0690]: transparent struct needs exactly one non-zero-sized field, but has 2 + --> $DIR/repr-transparent.rs:40:1 + | +LL | pub struct StructWithProjection(f32, <f32 as Mirror>::It); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: non-zero-sized field + --> $DIR/repr-transparent.rs:40:33 + | +LL | pub struct StructWithProjection(f32, <f32 as Mirror>::It); + | ^^^ ^^^^^^^^^^^^^^^^^^^ + +error[E0691]: zero-sized field in transparent struct has alignment larger than 1 + --> $DIR/repr-transparent.rs:44:32 + | +LL | struct NontrivialAlignZst(u32, [u16; 0]); //~ ERROR alignment larger than 1 + | ^^^^^^^^ + +error[E0691]: zero-sized field in transparent struct has alignment larger than 1 + --> $DIR/repr-transparent.rs:50:24 + | +LL | struct GenericAlign<T>(ZstAlign32<T>, u32); //~ ERROR alignment larger than 1 + | ^^^^^^^^^^^^^ + +error: aborting due to 9 previous errors + +Some errors occurred: E0601, E0690, E0691. +For more information about an error, try `rustc --explain E0601`. diff --git a/src/test/compile-fail/required-lang-item.rs b/src/test/ui/compile-fail-migration/required-lang-item.rs index ce40702b3dc..ce40702b3dc 100644 --- a/src/test/compile-fail/required-lang-item.rs +++ b/src/test/ui/compile-fail-migration/required-lang-item.rs diff --git a/src/test/ui/compile-fail-migration/required-lang-item.stderr b/src/test/ui/compile-fail-migration/required-lang-item.stderr new file mode 100644 index 00000000000..83764a91ac7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/required-lang-item.stderr @@ -0,0 +1,4 @@ +error: requires `start` lang_item + +error: aborting due to previous error + diff --git a/src/test/compile-fail/reserved-attr-on-macro.rs b/src/test/ui/compile-fail-migration/reserved-attr-on-macro.rs index db8f82a70e1..db8f82a70e1 100644 --- a/src/test/compile-fail/reserved-attr-on-macro.rs +++ b/src/test/ui/compile-fail-migration/reserved-attr-on-macro.rs diff --git a/src/test/ui/compile-fail-migration/reserved-attr-on-macro.stderr b/src/test/ui/compile-fail-migration/reserved-attr-on-macro.stderr new file mode 100644 index 00000000000..e8bfcc04f48 --- /dev/null +++ b/src/test/ui/compile-fail-migration/reserved-attr-on-macro.stderr @@ -0,0 +1,11 @@ +error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics (see issue #29642) + --> $DIR/reserved-attr-on-macro.rs:11:1 + | +LL | #[rustc_attribute_should_be_reserved] //~ ERROR attributes with the prefix `rustc_` are reserved + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(rustc_attrs)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/reserved-become.rs b/src/test/ui/compile-fail-migration/reserved-become.rs index bcda61e363d..bcda61e363d 100644 --- a/src/test/compile-fail/reserved-become.rs +++ b/src/test/ui/compile-fail-migration/reserved-become.rs diff --git a/src/test/ui/compile-fail-migration/reserved-become.stderr b/src/test/ui/compile-fail-migration/reserved-become.stderr new file mode 100644 index 00000000000..fa9a9601208 --- /dev/null +++ b/src/test/ui/compile-fail-migration/reserved-become.stderr @@ -0,0 +1,8 @@ +error: expected pattern, found reserved keyword `become` + --> $DIR/reserved-become.rs:12:9 + | +LL | let become = 0; + | ^^^^^^ expected pattern + +error: aborting due to previous error + diff --git a/src/test/compile-fail/resolve-bad-import-prefix.rs b/src/test/ui/compile-fail-migration/resolve-bad-import-prefix.rs index 370782fc7d9..370782fc7d9 100644 --- a/src/test/compile-fail/resolve-bad-import-prefix.rs +++ b/src/test/ui/compile-fail-migration/resolve-bad-import-prefix.rs diff --git a/src/test/ui/compile-fail-migration/resolve-bad-import-prefix.stderr b/src/test/ui/compile-fail-migration/resolve-bad-import-prefix.stderr new file mode 100644 index 00000000000..76d0c035335 --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-bad-import-prefix.stderr @@ -0,0 +1,24 @@ +error[E0577]: expected module or enum, found struct `S` + --> $DIR/resolve-bad-import-prefix.rs:20:5 + | +LL | use S::{}; //~ ERROR expected module or enum, found struct `S` + | -^^^^ + | | + | did you mean `E`? + +error[E0577]: expected module or enum, found trait `Tr` + --> $DIR/resolve-bad-import-prefix.rs:21:5 + | +LL | use Tr::{}; //~ ERROR expected module or enum, found trait `Tr` + | ^^^^^^ not a module or enum + +error[E0578]: cannot find module or enum `Nonexistent` in the crate root + --> $DIR/resolve-bad-import-prefix.rs:22:5 + | +LL | use Nonexistent::{}; //~ ERROR cannot find module or enum `Nonexistent` in the crate root + | ^^^^^^^^^^^ not found in the crate root + +error: aborting due to 3 previous errors + +Some errors occurred: E0577, E0578. +For more information about an error, try `rustc --explain E0577`. diff --git a/src/test/compile-fail/resolve-bad-visibility.rs b/src/test/ui/compile-fail-migration/resolve-bad-visibility.rs index 420a45a2147..420a45a2147 100644 --- a/src/test/compile-fail/resolve-bad-visibility.rs +++ b/src/test/ui/compile-fail-migration/resolve-bad-visibility.rs diff --git a/src/test/ui/compile-fail-migration/resolve-bad-visibility.stderr b/src/test/ui/compile-fail-migration/resolve-bad-visibility.stderr new file mode 100644 index 00000000000..aa4817163e3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-bad-visibility.stderr @@ -0,0 +1,34 @@ +error: visibilities can only be restricted to ancestor modules + --> $DIR/resolve-bad-visibility.rs:16:8 + | +LL | pub(in std::vec) struct F; //~ ERROR visibilities can only be restricted to ancestor modules + | ^^^^^^^^ + +error[E0577]: expected module, found enum `E` + --> $DIR/resolve-bad-visibility.rs:14:8 + | +LL | pub(in E) struct S; //~ ERROR expected module, found enum `E` + | ^ not a module + +error[E0577]: expected module, found trait `Tr` + --> $DIR/resolve-bad-visibility.rs:15:8 + | +LL | pub(in Tr) struct Z; //~ ERROR expected module, found trait `Tr` + | ^^ not a module + +error[E0578]: cannot find module `nonexistent` in the crate root + --> $DIR/resolve-bad-visibility.rs:17:8 + | +LL | pub(in nonexistent) struct G; //~ ERROR cannot find module `nonexistent` in the crate root + | ^^^^^^^^^^^ not found in the crate root + +error[E0578]: cannot find module `too_soon` in the crate root + --> $DIR/resolve-bad-visibility.rs:18:8 + | +LL | pub(in too_soon) struct H; //~ ERROR cannot find module `too_soon` in the crate root + | ^^^^^^^^ not found in the crate root + +error: aborting due to 5 previous errors + +Some errors occurred: E0577, E0578. +For more information about an error, try `rustc --explain E0577`. diff --git a/src/test/compile-fail/resolve-conflict-extern-crate-vs-extern-crate.rs b/src/test/ui/compile-fail-migration/resolve-conflict-extern-crate-vs-extern-crate.rs index 6a04a2c3704..6a04a2c3704 100644 --- a/src/test/compile-fail/resolve-conflict-extern-crate-vs-extern-crate.rs +++ b/src/test/ui/compile-fail-migration/resolve-conflict-extern-crate-vs-extern-crate.rs diff --git a/src/test/ui/compile-fail-migration/resolve-conflict-extern-crate-vs-extern-crate.stderr b/src/test/ui/compile-fail-migration/resolve-conflict-extern-crate-vs-extern-crate.stderr new file mode 100644 index 00000000000..5f21b4413e7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-conflict-extern-crate-vs-extern-crate.stderr @@ -0,0 +1,15 @@ +error[E0259]: the name `std` is defined multiple times + --> $DIR/resolve-conflict-extern-crate-vs-extern-crate.rs:12:1 + | +LL | extern crate std; + | ^^^^^^^^^^^^^^^^^ `std` reimported here + | + = note: `std` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | extern crate std as other_std; + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0259`. diff --git a/src/test/compile-fail/resolve-conflict-import-vs-extern-crate.rs b/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-extern-crate.rs index 91cf1d35954..91cf1d35954 100644 --- a/src/test/compile-fail/resolve-conflict-import-vs-extern-crate.rs +++ b/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-extern-crate.rs diff --git a/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-extern-crate.stderr b/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-extern-crate.stderr new file mode 100644 index 00000000000..9978e75af30 --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-extern-crate.stderr @@ -0,0 +1,15 @@ +error[E0254]: the name `std` is defined multiple times + --> $DIR/resolve-conflict-import-vs-extern-crate.rs:11:5 + | +LL | use std::slice as std; //~ ERROR the name `std` is defined multiple times + | ^^^^^^^^^^^^^^^^^ `std` reimported here + | + = note: `std` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | use std::slice as std as other_std; //~ ERROR the name `std` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0254`. diff --git a/src/test/compile-fail/resolve-conflict-import-vs-import.rs b/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-import.rs index 8db9023310e..8db9023310e 100644 --- a/src/test/compile-fail/resolve-conflict-import-vs-import.rs +++ b/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-import.rs diff --git a/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-import.stderr b/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-import.stderr new file mode 100644 index 00000000000..80ccb9aa2b3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-conflict-import-vs-import.stderr @@ -0,0 +1,17 @@ +error[E0252]: the name `transmute` is defined multiple times + --> $DIR/resolve-conflict-import-vs-import.rs:12:5 + | +LL | use std::mem::transmute; + | ------------------- previous import of the value `transmute` here +LL | use std::mem::transmute; + | ^^^^^^^^^^^^^^^^^^^ `transmute` reimported here + | + = note: `transmute` must be defined only once in the value namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | use std::mem::transmute as other_transmute; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0252`. diff --git a/src/test/compile-fail/resolve-conflict-item-vs-extern-crate.rs b/src/test/ui/compile-fail-migration/resolve-conflict-item-vs-extern-crate.rs index b50a60d39c8..b50a60d39c8 100644 --- a/src/test/compile-fail/resolve-conflict-item-vs-extern-crate.rs +++ b/src/test/ui/compile-fail-migration/resolve-conflict-item-vs-extern-crate.rs diff --git a/src/test/ui/compile-fail-migration/resolve-conflict-item-vs-extern-crate.stderr b/src/test/ui/compile-fail-migration/resolve-conflict-item-vs-extern-crate.stderr new file mode 100644 index 00000000000..d9ad248c013 --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-conflict-item-vs-extern-crate.stderr @@ -0,0 +1,15 @@ +error[E0260]: the name `std` is defined multiple times + --> $DIR/resolve-conflict-item-vs-extern-crate.rs:12:1 + | +LL | mod std {} //~ ERROR the name `std` is defined multiple times + | ^^^^^^^ `std` redefined here + | + = note: `std` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | as other_std// Copyright 2014 The Rust Project Developers. See the COPYRIGHT + | ^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0260`. diff --git a/src/test/compile-fail/resolve-conflict-type-vs-import.rs b/src/test/ui/compile-fail-migration/resolve-conflict-type-vs-import.rs index bbb6ee622b1..bbb6ee622b1 100644 --- a/src/test/compile-fail/resolve-conflict-type-vs-import.rs +++ b/src/test/ui/compile-fail-migration/resolve-conflict-type-vs-import.rs diff --git a/src/test/ui/compile-fail-migration/resolve-conflict-type-vs-import.stderr b/src/test/ui/compile-fail-migration/resolve-conflict-type-vs-import.stderr new file mode 100644 index 00000000000..1e8df8f8ea7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-conflict-type-vs-import.stderr @@ -0,0 +1,18 @@ +error[E0255]: the name `Iter` is defined multiple times + --> $DIR/resolve-conflict-type-vs-import.rs:13:1 + | +LL | use std::slice::Iter; + | ---------------- previous import of the type `Iter` here +LL | +LL | struct Iter; + | ^^^^^^^^^^^^ `Iter` redefined here + | + = note: `Iter` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | use std::slice::Iter as OtherIter; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0255`. diff --git a/src/test/compile-fail/resolve-inconsistent-binding-mode.rs b/src/test/ui/compile-fail-migration/resolve-inconsistent-binding-mode.rs index 63d33a9e5fa..63d33a9e5fa 100644 --- a/src/test/compile-fail/resolve-inconsistent-binding-mode.rs +++ b/src/test/ui/compile-fail-migration/resolve-inconsistent-binding-mode.rs diff --git a/src/test/ui/compile-fail-migration/resolve-inconsistent-binding-mode.stderr b/src/test/ui/compile-fail-migration/resolve-inconsistent-binding-mode.stderr new file mode 100644 index 00000000000..e36eea26fcf --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-inconsistent-binding-mode.stderr @@ -0,0 +1,53 @@ +error[E0409]: variable `i` is bound in inconsistent ways within the same match arm + --> $DIR/resolve-inconsistent-binding-mode.rs:17:32 + | +LL | opts::a(ref i) | opts::b(i) => {} + | - ^ bound in different ways + | | + | first binding + +error[E0409]: variable `i` is bound in inconsistent ways within the same match arm + --> $DIR/resolve-inconsistent-binding-mode.rs:26:32 + | +LL | opts::a(ref i) | opts::b(i) => {} + | - ^ bound in different ways + | | + | first binding + +error[E0409]: variable `i` is bound in inconsistent ways within the same match arm + --> $DIR/resolve-inconsistent-binding-mode.rs:35:40 + | +LL | opts::a(ref mut i) | opts::b(ref i) => {} + | - first binding ^ bound in different ways + +error[E0308]: mismatched types + --> $DIR/resolve-inconsistent-binding-mode.rs:17:32 + | +LL | opts::a(ref i) | opts::b(i) => {} + | ^ expected &isize, found isize + | + = note: expected type `&isize` + found type `isize` + +error[E0308]: mismatched types + --> $DIR/resolve-inconsistent-binding-mode.rs:26:32 + | +LL | opts::a(ref i) | opts::b(i) => {} + | ^ expected &isize, found isize + | + = note: expected type `&isize` + found type `isize` + +error[E0308]: mismatched types + --> $DIR/resolve-inconsistent-binding-mode.rs:35:36 + | +LL | opts::a(ref mut i) | opts::b(ref i) => {} + | ^^^^^ types differ in mutability + | + = note: expected type `&mut isize` + found type `&isize` + +error: aborting due to 6 previous errors + +Some errors occurred: E0308, E0409. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/resolve-label.rs b/src/test/ui/compile-fail-migration/resolve-label.rs index 6695e972f33..6695e972f33 100644 --- a/src/test/compile-fail/resolve-label.rs +++ b/src/test/ui/compile-fail-migration/resolve-label.rs diff --git a/src/test/ui/compile-fail-migration/resolve-label.stderr b/src/test/ui/compile-fail-migration/resolve-label.stderr new file mode 100644 index 00000000000..a7b89752f5e --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-label.stderr @@ -0,0 +1,9 @@ +error[E0426]: use of undeclared label `'l` + --> $DIR/resolve-label.rs:15:23 + | +LL | break 'l; //~ ERROR use of undeclared label + | ^^ undeclared label `'l` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0426`. diff --git a/src/test/compile-fail/resolve-primitive-fallback.rs b/src/test/ui/compile-fail-migration/resolve-primitive-fallback.rs index c1584b0bdcd..c1584b0bdcd 100644 --- a/src/test/compile-fail/resolve-primitive-fallback.rs +++ b/src/test/ui/compile-fail-migration/resolve-primitive-fallback.rs diff --git a/src/test/ui/compile-fail-migration/resolve-primitive-fallback.stderr b/src/test/ui/compile-fail-migration/resolve-primitive-fallback.stderr new file mode 100644 index 00000000000..2d852369afc --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-primitive-fallback.stderr @@ -0,0 +1,22 @@ +error[E0423]: expected value, found builtin type `u16` + --> $DIR/resolve-primitive-fallback.rs:13:23 + | +LL | std::mem::size_of(u16); + | ^^^ not a value + +error[E0412]: cannot find type `u8` in the crate root + --> $DIR/resolve-primitive-fallback.rs:18:14 + | +LL | let _: ::u8; + | ^^ not found in the crate root + +error[E0061]: this function takes 0 parameters but 1 parameter was supplied + --> $DIR/resolve-primitive-fallback.rs:13:5 + | +LL | std::mem::size_of(u16); + | ^^^^^^^^^^^^^^^^^^^^^^ expected 0 parameters + +error: aborting due to 3 previous errors + +Some errors occurred: E0061, E0412, E0423. +For more information about an error, try `rustc --explain E0061`. diff --git a/src/test/compile-fail/resolve-self-in-impl-2.rs b/src/test/ui/compile-fail-migration/resolve-self-in-impl-2.rs index adc208a0202..adc208a0202 100644 --- a/src/test/compile-fail/resolve-self-in-impl-2.rs +++ b/src/test/ui/compile-fail-migration/resolve-self-in-impl-2.rs diff --git a/src/test/ui/compile-fail-migration/resolve-self-in-impl-2.stderr b/src/test/ui/compile-fail-migration/resolve-self-in-impl-2.stderr new file mode 100644 index 00000000000..183b9b66327 --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-self-in-impl-2.stderr @@ -0,0 +1,16 @@ +error[E0411]: expected trait, found self type `Self` + --> $DIR/resolve-self-in-impl-2.rs:14:6 + | +LL | impl Self for S {} //~ ERROR expected trait, found self type `Self` + | ^^^^ `Self` is only available in traits and impls + +error[E0405]: cannot find trait `N` in `Self` + --> $DIR/resolve-self-in-impl-2.rs:15:12 + | +LL | impl Self::N for S {} //~ ERROR cannot find trait `N` in `Self` + | ^ not found in `Self` + +error: aborting due to 2 previous errors + +Some errors occurred: E0405, E0411. +For more information about an error, try `rustc --explain E0405`. diff --git a/src/test/compile-fail/resolve-self-in-impl.rs b/src/test/ui/compile-fail-migration/resolve-self-in-impl.rs index 2a894c57b8d..2a894c57b8d 100644 --- a/src/test/compile-fail/resolve-self-in-impl.rs +++ b/src/test/ui/compile-fail-migration/resolve-self-in-impl.rs diff --git a/src/test/ui/compile-fail-migration/resolve-self-in-impl.stderr b/src/test/ui/compile-fail-migration/resolve-self-in-impl.stderr new file mode 100644 index 00000000000..3fa384808db --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-self-in-impl.stderr @@ -0,0 +1,43 @@ +error[E0391]: cycle detected when processing `<impl at $DIR/resolve-self-in-impl.rs:24:1: 24:20>` + --> $DIR/resolve-self-in-impl.rs:24:13 + | +LL | impl Tr for Self {} //~ ERROR cycle detected + | ^^^^ + | + = note: ...which again requires processing `<impl at $DIR/resolve-self-in-impl.rs:24:1: 24:20>`, completing the cycle + +error[E0391]: cycle detected when processing `<impl at $DIR/resolve-self-in-impl.rs:25:1: 25:23>` + --> $DIR/resolve-self-in-impl.rs:25:15 + | +LL | impl Tr for S<Self> {} //~ ERROR cycle detected + | ^^^^ + | + = note: ...which again requires processing `<impl at $DIR/resolve-self-in-impl.rs:25:1: 25:23>`, completing the cycle + +error[E0391]: cycle detected when processing `<impl at $DIR/resolve-self-in-impl.rs:26:1: 26:13>` + --> $DIR/resolve-self-in-impl.rs:26:6 + | +LL | impl Self {} //~ ERROR cycle detected + | ^^^^ + | + = note: ...which again requires processing `<impl at $DIR/resolve-self-in-impl.rs:26:1: 26:13>`, completing the cycle + +error[E0391]: cycle detected when processing `<impl at $DIR/resolve-self-in-impl.rs:27:1: 27:16>` + --> $DIR/resolve-self-in-impl.rs:27:8 + | +LL | impl S<Self> {} //~ ERROR cycle detected + | ^^^^ + | + = note: ...which again requires processing `<impl at $DIR/resolve-self-in-impl.rs:27:1: 27:16>`, completing the cycle + +error[E0391]: cycle detected when processing `<impl at $DIR/resolve-self-in-impl.rs:28:1: 28:26>` + --> $DIR/resolve-self-in-impl.rs:28:1 + | +LL | impl Tr<Self::A> for S {} //~ ERROR cycle detected + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: ...which again requires processing `<impl at $DIR/resolve-self-in-impl.rs:28:1: 28:26>`, completing the cycle + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0391`. diff --git a/src/test/compile-fail/resolve-type-param-in-item-in-trait.rs b/src/test/ui/compile-fail-migration/resolve-type-param-in-item-in-trait.rs index a1572b85666..a1572b85666 100644 --- a/src/test/compile-fail/resolve-type-param-in-item-in-trait.rs +++ b/src/test/ui/compile-fail-migration/resolve-type-param-in-item-in-trait.rs diff --git a/src/test/ui/compile-fail-migration/resolve-type-param-in-item-in-trait.stderr b/src/test/ui/compile-fail-migration/resolve-type-param-in-item-in-trait.stderr new file mode 100644 index 00000000000..73ee7102e6e --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-type-param-in-item-in-trait.stderr @@ -0,0 +1,45 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/resolve-type-param-in-item-in-trait.rs:18:22 + | +LL | trait TraitA<A> { + | - type variable from outer function +LL | fn outer(&self) { + | ----- try adding a local type parameter in this method instead +LL | enum Foo<B> { +LL | Variance(A) + | ^ use of type variable from outer function + +error[E0401]: can't use type parameters from outer function + --> $DIR/resolve-type-param-in-item-in-trait.rs:26:23 + | +LL | trait TraitB<A> { + | - type variable from outer function +LL | fn outer(&self) { + | ----- try adding a local type parameter in this method instead +LL | struct Foo<B>(A); + | ^ use of type variable from outer function + +error[E0401]: can't use type parameters from outer function + --> $DIR/resolve-type-param-in-item-in-trait.rs:33:28 + | +LL | trait TraitC<A> { + | - type variable from outer function +LL | fn outer(&self) { + | ----- try adding a local type parameter in this method instead +LL | struct Foo<B> { a: A } + | ^ use of type variable from outer function + +error[E0401]: can't use type parameters from outer function + --> $DIR/resolve-type-param-in-item-in-trait.rs:40:22 + | +LL | trait TraitD<A> { + | - type variable from outer function +LL | fn outer(&self) { +LL | fn foo<B>(a: A) { } + | ------ ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `foo<B, A>` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/compile-fail/resolve-unknown-trait.rs b/src/test/ui/compile-fail-migration/resolve-unknown-trait.rs index 9432e727fa5..9432e727fa5 100644 --- a/src/test/compile-fail/resolve-unknown-trait.rs +++ b/src/test/ui/compile-fail-migration/resolve-unknown-trait.rs diff --git a/src/test/ui/compile-fail-migration/resolve-unknown-trait.stderr b/src/test/ui/compile-fail-migration/resolve-unknown-trait.stderr new file mode 100644 index 00000000000..8a2d791654d --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-unknown-trait.stderr @@ -0,0 +1,26 @@ +error[E0405]: cannot find trait `SomeNonExistentTrait` in this scope + --> $DIR/resolve-unknown-trait.rs:12:18 + | +LL | trait NewTrait : SomeNonExistentTrait {} + | ^^^^^^^^^^^^^^^^^^^^ not found in this scope + +error[E0405]: cannot find trait `SomeNonExistentTrait` in this scope + --> $DIR/resolve-unknown-trait.rs:15:6 + | +LL | impl SomeNonExistentTrait for isize {} + | ^^^^^^^^^^^^^^^^^^^^ not found in this scope + +error[E0405]: cannot find trait `SomeNonExistentTrait` in this scope + --> $DIR/resolve-unknown-trait.rs:18:8 + | +LL | fn f<T:SomeNonExistentTrait>() {} + | ^^^^^^^^^^^^^^^^^^^^ not found in this scope + +error[E0601]: `main` function not found in crate `resolve_unknown_trait` + | + = note: consider adding a `main` function to `$DIR/resolve-unknown-trait.rs` + +error: aborting due to 4 previous errors + +Some errors occurred: E0405, E0601. +For more information about an error, try `rustc --explain E0405`. diff --git a/src/test/compile-fail/resolve-variant-assoc-item.rs b/src/test/ui/compile-fail-migration/resolve-variant-assoc-item.rs index 869eed5a8d7..869eed5a8d7 100644 --- a/src/test/compile-fail/resolve-variant-assoc-item.rs +++ b/src/test/ui/compile-fail-migration/resolve-variant-assoc-item.rs diff --git a/src/test/ui/compile-fail-migration/resolve-variant-assoc-item.stderr b/src/test/ui/compile-fail-migration/resolve-variant-assoc-item.stderr new file mode 100644 index 00000000000..a80a7c39249 --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve-variant-assoc-item.stderr @@ -0,0 +1,15 @@ +error[E0433]: failed to resolve. Not a module `V` + --> $DIR/resolve-variant-assoc-item.rs:15:8 + | +LL | E::V::associated_item; //~ ERROR failed to resolve. Not a module `V` + | ^ Not a module `V` + +error[E0433]: failed to resolve. Not a module `V` + --> $DIR/resolve-variant-assoc-item.rs:16:5 + | +LL | V::associated_item; //~ ERROR failed to resolve. Not a module `V` + | ^ Not a module `V` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/resolve_self_super_hint.rs b/src/test/ui/compile-fail-migration/resolve_self_super_hint.rs index a89fd802baf..a89fd802baf 100644 --- a/src/test/compile-fail/resolve_self_super_hint.rs +++ b/src/test/ui/compile-fail-migration/resolve_self_super_hint.rs diff --git a/src/test/ui/compile-fail-migration/resolve_self_super_hint.stderr b/src/test/ui/compile-fail-migration/resolve_self_super_hint.stderr new file mode 100644 index 00000000000..8538da06baf --- /dev/null +++ b/src/test/ui/compile-fail-migration/resolve_self_super_hint.stderr @@ -0,0 +1,32 @@ +error[E0432]: unresolved import `alloc` + --> $DIR/resolve_self_super_hint.rs:16:9 + | +LL | use alloc::HashMap; + | ^^^^^ Did you mean `self::alloc`? + +error[E0432]: unresolved import `alloc` + --> $DIR/resolve_self_super_hint.rs:20:13 + | +LL | use alloc::HashMap; + | ^^^^^ Did you mean `a::alloc`? + +error[E0432]: unresolved import `alloc` + --> $DIR/resolve_self_super_hint.rs:24:17 + | +LL | use alloc::HashMap; + | ^^^^^ Did you mean `a::alloc`? + +error[E0432]: unresolved import `alloc` + --> $DIR/resolve_self_super_hint.rs:28:21 + | +LL | use alloc::HashMap; + | ^^^^^ Did you mean `a::alloc`? + +error[E0601]: `main` function not found in crate `resolve_self_super_hint` + | + = note: consider adding a `main` function to `$DIR/resolve_self_super_hint.rs` + +error: aborting due to 5 previous errors + +Some errors occurred: E0432, E0601. +For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/ret-non-nil.rs b/src/test/ui/compile-fail-migration/ret-non-nil.rs index 6be98fbd827..6be98fbd827 100644 --- a/src/test/compile-fail/ret-non-nil.rs +++ b/src/test/ui/compile-fail-migration/ret-non-nil.rs diff --git a/src/test/ui/compile-fail-migration/ret-non-nil.stderr b/src/test/ui/compile-fail-migration/ret-non-nil.stderr new file mode 100644 index 00000000000..01f126bd11e --- /dev/null +++ b/src/test/ui/compile-fail-migration/ret-non-nil.stderr @@ -0,0 +1,9 @@ +error[E0069]: `return;` in a function whose return type is not `()` + --> $DIR/ret-non-nil.rs:15:19 + | +LL | fn g() -> isize { return; } + | ^^^^^^ return type is not () + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0069`. diff --git a/src/test/compile-fail/retslot-cast.rs b/src/test/ui/compile-fail-migration/retslot-cast.rs index c5e26a26744..c5e26a26744 100644 --- a/src/test/compile-fail/retslot-cast.rs +++ b/src/test/ui/compile-fail-migration/retslot-cast.rs diff --git a/src/test/ui/compile-fail-migration/retslot-cast.stderr b/src/test/ui/compile-fail-migration/retslot-cast.stderr new file mode 100644 index 00000000000..34f6e11f614 --- /dev/null +++ b/src/test/ui/compile-fail-migration/retslot-cast.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/retslot-cast.rs:24:5 + | +LL | inner(x) //~ ERROR mismatched types + | ^^^^^^^^ expected trait `std::iter::Iterator<Item=()>`, found trait `std::iter::Iterator<Item=()> + std::marker::Send` + | + = note: expected type `std::option::Option<&dyn std::iter::Iterator<Item=()>>` + found type `std::option::Option<&dyn std::iter::Iterator<Item=()> + std::marker::Send>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/return-from-diverging.rs b/src/test/ui/compile-fail-migration/return-from-diverging.rs index cec59faa918..cec59faa918 100644 --- a/src/test/compile-fail/return-from-diverging.rs +++ b/src/test/ui/compile-fail-migration/return-from-diverging.rs diff --git a/src/test/ui/compile-fail-migration/return-from-diverging.stderr b/src/test/ui/compile-fail-migration/return-from-diverging.stderr new file mode 100644 index 00000000000..d965d734327 --- /dev/null +++ b/src/test/ui/compile-fail-migration/return-from-diverging.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/return-from-diverging.rs:14:12 + | +LL | return "wow"; //~ ERROR mismatched types + | ^^^^^ expected !, found reference + | + = note: expected type `!` + found type `&'static str` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/return-unit-from-diverging.rs b/src/test/ui/compile-fail-migration/return-unit-from-diverging.rs index ae2a325b24a..ae2a325b24a 100644 --- a/src/test/compile-fail/return-unit-from-diverging.rs +++ b/src/test/ui/compile-fail-migration/return-unit-from-diverging.rs diff --git a/src/test/ui/compile-fail-migration/return-unit-from-diverging.stderr b/src/test/ui/compile-fail-migration/return-unit-from-diverging.stderr new file mode 100644 index 00000000000..38d4ca37366 --- /dev/null +++ b/src/test/ui/compile-fail-migration/return-unit-from-diverging.stderr @@ -0,0 +1,9 @@ +error[E0069]: `return;` in a function whose return type is not `()` + --> $DIR/return-unit-from-diverging.rs:15:5 + | +LL | return; //~ ERROR in a function whose return type is not + | ^^^^^^ return type is not () + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0069`. diff --git a/src/test/compile-fail/rfc-1937-termination-trait/termination-trait-main-i32.rs b/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-main-i32.rs index 49f5621de1b..49f5621de1b 100644 --- a/src/test/compile-fail/rfc-1937-termination-trait/termination-trait-main-i32.rs +++ b/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-main-i32.rs diff --git a/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-main-i32.stderr b/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-main-i32.stderr new file mode 100644 index 00000000000..6f780d1cf1d --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-main-i32.stderr @@ -0,0 +1,11 @@ +error[E0277]: `main` has invalid return type `i32` + --> $DIR/termination-trait-main-i32.rs:11:14 + | +LL | fn main() -> i32 { + | ^^^ `main` can only return types that implement `std::process::Termination` + | + = help: consider using `()`, or a `Result` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/rfc-1937-termination-trait/termination-trait-not-satisfied.rs b/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-not-satisfied.rs index b5f5472b492..b5f5472b492 100644 --- a/src/test/compile-fail/rfc-1937-termination-trait/termination-trait-not-satisfied.rs +++ b/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-not-satisfied.rs diff --git a/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr b/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr new file mode 100644 index 00000000000..e1b173725d4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr @@ -0,0 +1,11 @@ +error[E0277]: `main` has invalid return type `ReturnType` + --> $DIR/termination-trait-not-satisfied.rs:13:14 + | +LL | fn main() -> ReturnType { //~ ERROR `main` has invalid return type `ReturnType` + | ^^^^^^^^^^ `main` can only return types that implement `std::process::Termination` + | + = help: consider using `()`, or a `Result` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/auxiliary/enums.rs b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/auxiliary/enums.rs index 12d1bf9ea91..12d1bf9ea91 100644 --- a/src/test/compile-fail/rfc-2008-non-exhaustive/auxiliary/enums.rs +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/auxiliary/enums.rs diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/auxiliary/structs.rs b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/auxiliary/structs.rs index 4d083cc5315..4d083cc5315 100644 --- a/src/test/compile-fail/rfc-2008-non-exhaustive/auxiliary/structs.rs +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/auxiliary/structs.rs diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/auxiliary/variants.rs b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/auxiliary/variants.rs index d04c1073ad9..d04c1073ad9 100644 --- a/src/test/compile-fail/rfc-2008-non-exhaustive/auxiliary/variants.rs +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/auxiliary/variants.rs diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/enum.rs b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/enum.rs index 0c19210e4a0..0c19210e4a0 100644 --- a/src/test/compile-fail/rfc-2008-non-exhaustive/enum.rs +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/enum.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/enum.stderr b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/enum.stderr new file mode 100644 index 00000000000..5276746734d --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/enum.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `_` not covered + --> $DIR/enum.rs:19:11 + | +LL | match enum_unit { + | ^^^^^^^^^ pattern `_` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/invalid-attribute.rs b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/invalid-attribute.rs index df4fe1e77e9..df4fe1e77e9 100644 --- a/src/test/compile-fail/rfc-2008-non-exhaustive/invalid-attribute.rs +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/invalid-attribute.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/invalid-attribute.stderr b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/invalid-attribute.stderr new file mode 100644 index 00000000000..d75ad9ec264 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/invalid-attribute.stderr @@ -0,0 +1,34 @@ +error[E0702]: attribute should be empty + --> $DIR/invalid-attribute.rs:13:1 + | +LL | #[non_exhaustive(anything)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | //~^ ERROR attribute should be empty [E0702] +LL | struct Foo; + | ----------- not empty + +error[E0701]: attribute can only be applied to a struct or enum + --> $DIR/invalid-attribute.rs:17:1 + | +LL | #[non_exhaustive] + | ^^^^^^^^^^^^^^^^^ +LL | //~^ ERROR attribute can only be applied to a struct or enum [E0701] +LL | trait Bar { } + | ------------- not a struct or enum + +error[E0701]: attribute can only be applied to a struct or enum + --> $DIR/invalid-attribute.rs:21:1 + | +LL | #[non_exhaustive] + | ^^^^^^^^^^^^^^^^^ +LL | //~^ ERROR attribute can only be applied to a struct or enum [E0701] +LL | / union Baz { +LL | | f1: u16, +LL | | f2: u16 +LL | | } + | |_- not a struct or enum + +error: aborting due to 3 previous errors + +Some errors occurred: E0701, E0702. +For more information about an error, try `rustc --explain E0701`. diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/structs.rs b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/structs.rs index 74c9c7c61ac..74c9c7c61ac 100644 --- a/src/test/compile-fail/rfc-2008-non-exhaustive/structs.rs +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/structs.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/structs.stderr b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/structs.stderr new file mode 100644 index 00000000000..c0f7e278671 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/structs.stderr @@ -0,0 +1,64 @@ +error[E0423]: expected function, found struct `TupleStruct` + --> $DIR/structs.rs:30:14 + | +LL | let ts = TupleStruct(640, 480); + | ^^^^^^^^^^^ constructor is not visible here due to private fields + +error[E0423]: expected value, found struct `UnitStruct` + --> $DIR/structs.rs:39:14 + | +LL | let us = UnitStruct; + | ^^^^^^^^^^ constructor is not visible here due to private fields + +error[E0603]: tuple struct `TupleStruct` is private + --> $DIR/structs.rs:33:23 + | +LL | let ts_explicit = structs::TupleStruct(640, 480); + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: unit struct `UnitStruct` is private + --> $DIR/structs.rs:42:23 + | +LL | let us_explicit = structs::UnitStruct; + | ^^^^^^^^^^^^^^^^^^^ + +error[E0639]: cannot create non-exhaustive struct using struct expression + --> $DIR/structs.rs:17:14 + | +LL | let fr = FunctionalRecord { + | ______________^ +LL | | //~^ ERROR cannot create non-exhaustive struct +LL | | first_field: 1920, +LL | | second_field: 1080, +LL | | ..FunctionalRecord::default() +LL | | }; + | |_____^ + +error[E0639]: cannot create non-exhaustive struct using struct expression + --> $DIR/structs.rs:24:14 + | +LL | let ns = NormalStruct { first_field: 640, second_field: 480 }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0638]: `..` required with struct marked as non-exhaustive + --> $DIR/structs.rs:27:9 + | +LL | let NormalStruct { first_field, second_field } = ns; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0638]: `..` required with struct marked as non-exhaustive + --> $DIR/structs.rs:36:9 + | +LL | let TupleStruct { 0: first_field, 1: second_field } = ts; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0638]: `..` required with struct marked as non-exhaustive + --> $DIR/structs.rs:45:9 + | +LL | let UnitStruct { } = us; + | ^^^^^^^^^^^^^^ + +error: aborting due to 9 previous errors + +Some errors occurred: E0423, E0603, E0638, E0639. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/variants.rs b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/variants.rs index d1b65ac1f3e..d1b65ac1f3e 100644 --- a/src/test/compile-fail/rfc-2008-non-exhaustive/variants.rs +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/variants.rs diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/variants_create.rs b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/variants_create.rs index f4e4b1bb84b..f4e4b1bb84b 100644 --- a/src/test/compile-fail/rfc-2008-non-exhaustive/variants_create.rs +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/variants_create.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/variants_create.stderr b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/variants_create.stderr new file mode 100644 index 00000000000..1e4e0943a69 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2008-non-exhaustive/variants_create.stderr @@ -0,0 +1,20 @@ +error: #[non_exhaustive] is not yet supported on variants + --> $DIR/variants_create.rs:19:23 + | +LL | #[non_exhaustive] Unit, + | ^^^^ + +error: #[non_exhaustive] is not yet supported on variants + --> $DIR/variants_create.rs:21:23 + | +LL | #[non_exhaustive] Tuple(u32), + | ^^^^^^^^^^ + +error: #[non_exhaustive] is not yet supported on variants + --> $DIR/variants_create.rs:23:23 + | +LL | #[non_exhaustive] Struct { field: u32 } + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/rfc-2126-crate-paths/crate-path-non-absolute.rs b/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/crate-path-non-absolute.rs index 65f11c063ed..65f11c063ed 100644 --- a/src/test/compile-fail/rfc-2126-crate-paths/crate-path-non-absolute.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/crate-path-non-absolute.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/crate-path-non-absolute.stderr b/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/crate-path-non-absolute.stderr new file mode 100644 index 00000000000..f4d33e0b9db --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/crate-path-non-absolute.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. Could not find `crate` in `m` + --> $DIR/crate-path-non-absolute.rs:17:22 + | +LL | let s = ::m::crate::S; //~ ERROR failed to resolve + | ^^^^^ Could not find `crate` in `m` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/rfc-2126-crate-paths/keyword-crate-as-identifier.rs b/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/keyword-crate-as-identifier.rs index bdd03be4356..bdd03be4356 100644 --- a/src/test/compile-fail/rfc-2126-crate-paths/keyword-crate-as-identifier.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/keyword-crate-as-identifier.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr b/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr new file mode 100644 index 00000000000..e4d2db057f2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. `crate` in paths can only be used in start position + --> $DIR/keyword-crate-as-identifier.rs:14:9 + | +LL | let crate = 0; //~ ERROR failed to resolve. `crate` in paths can only be used in start position + | ^^^^^ `crate` in paths can only be used in start position + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs index c3da4a51872..c3da4a51872 100644 --- a/src/test/compile-fail/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs diff --git a/src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-1.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-1.rs index 826bf675bd6..826bf675bd6 100644 --- a/src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-1.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-1.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-1.stderr b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-1.stderr new file mode 100644 index 00000000000..27a69ec1b1f --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-1.stderr @@ -0,0 +1,9 @@ +error[E0463]: can't find crate for `xcrate` + --> $DIR/non-existent-1.rs:13:5 + | +LL | use xcrate::S; //~ ERROR can't find crate for `xcrate` + | ^^^^^^ can't find crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-2.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-2.rs index 053bf92f4d1..053bf92f4d1 100644 --- a/src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-2.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-2.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-2.stderr b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-2.stderr new file mode 100644 index 00000000000..eb96d5f05d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-2.stderr @@ -0,0 +1,9 @@ +error[E0463]: can't find crate for `xcrate` + --> $DIR/non-existent-2.rs:14:15 + | +LL | let s = ::xcrate::S; //~ ERROR can't find crate for `xcrate` + | ^^^^^^ can't find crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-3.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-3.rs index 1b9e5a75e83..1b9e5a75e83 100644 --- a/src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-3.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-3.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-3.stderr b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-3.stderr new file mode 100644 index 00000000000..434bde79a83 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/non-existent-3.stderr @@ -0,0 +1,9 @@ +error[E0463]: can't find crate for `ycrate` + --> $DIR/non-existent-3.rs:13:5 + | +LL | use ycrate; //~ ERROR can't find crate for `ycrate` + | ^^^^^^ can't find crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/rfc-2126-extern-absolute-paths/single-segment.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/single-segment.rs index 69fc4b4f7f8..69fc4b4f7f8 100644 --- a/src/test/compile-fail/rfc-2126-extern-absolute-paths/single-segment.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/single-segment.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/single-segment.stderr b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/single-segment.stderr new file mode 100644 index 00000000000..02363a01e3c --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-absolute-paths/single-segment.stderr @@ -0,0 +1,22 @@ +error[E0432]: unresolved import `*` + --> $DIR/single-segment.rs:16:5 + | +LL | use *; //~ ERROR unresolved import `*` + | ^ cannot glob-import all possible crates + +error[E0432]: unresolved import `crate` + --> $DIR/single-segment.rs:14:5 + | +LL | use crate; //~ ERROR unresolved import `crate` + | ^^^^^ crate root imports need to be explicitly named: `use crate as name;` + +error[E0423]: expected value, found module `xcrate` + --> $DIR/single-segment.rs:20:13 + | +LL | let s = ::xcrate; //~ ERROR expected value, found module `xcrate` + | ^^^^^^^^ not a value + +error: aborting due to 3 previous errors + +Some errors occurred: E0423, E0432. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/compile-fail/rfc-2126-extern-in-paths/auxiliary/xcrate.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/auxiliary/xcrate.rs index c3da4a51872..c3da4a51872 100644 --- a/src/test/compile-fail/rfc-2126-extern-in-paths/auxiliary/xcrate.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/auxiliary/xcrate.rs diff --git a/src/test/compile-fail/rfc-2126-extern-in-paths/non-existent-1.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-1.rs index 7eba02ed444..7eba02ed444 100644 --- a/src/test/compile-fail/rfc-2126-extern-in-paths/non-existent-1.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-1.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-1.stderr b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-1.stderr new file mode 100644 index 00000000000..c25698c395e --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-1.stderr @@ -0,0 +1,9 @@ +error[E0463]: can't find crate for `xcrate` + --> $DIR/non-existent-1.rs:13:13 + | +LL | use extern::xcrate::S; //~ ERROR can't find crate for `xcrate` + | ^^^^^^ can't find crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/rfc-2126-extern-in-paths/non-existent-2.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-2.rs index 4d09a05253e..4d09a05253e 100644 --- a/src/test/compile-fail/rfc-2126-extern-in-paths/non-existent-2.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-2.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-2.stderr b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-2.stderr new file mode 100644 index 00000000000..b7ca8890c19 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-2.stderr @@ -0,0 +1,9 @@ +error[E0463]: can't find crate for `xcrate` + --> $DIR/non-existent-2.rs:14:21 + | +LL | let s = extern::xcrate::S; //~ ERROR can't find crate for `xcrate` + | ^^^^^^ can't find crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/rfc-2126-extern-in-paths/non-existent-3.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-3.rs index 402d294b2e3..402d294b2e3 100644 --- a/src/test/compile-fail/rfc-2126-extern-in-paths/non-existent-3.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-3.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-3.stderr b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-3.stderr new file mode 100644 index 00000000000..3dc93e2a426 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/non-existent-3.stderr @@ -0,0 +1,9 @@ +error[E0463]: can't find crate for `ycrate` + --> $DIR/non-existent-3.rs:13:5 + | +LL | use extern::ycrate; //~ ERROR can't find crate for `ycrate` + | ^^^^^^^^^^^^^^ can't find crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/rfc-2126-extern-in-paths/single-segment.rs b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/single-segment.rs index 017844a0252..017844a0252 100644 --- a/src/test/compile-fail/rfc-2126-extern-in-paths/single-segment.rs +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/single-segment.rs diff --git a/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/single-segment.stderr b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/single-segment.stderr new file mode 100644 index 00000000000..362f77effde --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc-2126-extern-in-paths/single-segment.stderr @@ -0,0 +1,22 @@ +error[E0432]: unresolved import `extern::*` + --> $DIR/single-segment.rs:17:5 + | +LL | use extern::*; //~ ERROR unresolved import `extern::*` + | ^^^^^^^^^ cannot glob-import all possible crates + +error[E0432]: unresolved import `extern` + --> $DIR/single-segment.rs:15:5 + | +LL | use extern; //~ ERROR unresolved import `extern` + | ^^^^^^ no `extern` in the root + +error[E0423]: expected value, found module `extern::xcrate` + --> $DIR/single-segment.rs:21:13 + | +LL | let s = extern::xcrate; //~ ERROR expected value, found module `extern::xcrate` + | ^^^^^^^^^^^^^^ not a value + +error: aborting due to 3 previous errors + +Some errors occurred: E0423, E0432. +For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/compile-fail-migration/rfc1445/feature-gate.no_gate.stderr b/src/test/ui/compile-fail-migration/rfc1445/feature-gate.no_gate.stderr new file mode 100644 index 00000000000..1141b79c7c6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc1445/feature-gate.no_gate.stderr @@ -0,0 +1,11 @@ +error[E0658]: the semantics of constant patterns is not yet settled (see issue #31434) + --> $DIR/feature-gate.rs:23:1 + | +LL | #[structural_match] //[no_gate]~ ERROR semantics of constant patterns is not yet settled + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(structural_match)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/rfc1445/feature-gate.rs b/src/test/ui/compile-fail-migration/rfc1445/feature-gate.rs index f729220eabb..f729220eabb 100644 --- a/src/test/compile-fail/rfc1445/feature-gate.rs +++ b/src/test/ui/compile-fail-migration/rfc1445/feature-gate.rs diff --git a/src/test/ui/compile-fail-migration/rfc1445/feature-gate.with_gate.stderr b/src/test/ui/compile-fail-migration/rfc1445/feature-gate.with_gate.stderr new file mode 100644 index 00000000000..87835162c93 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc1445/feature-gate.with_gate.stderr @@ -0,0 +1,14 @@ +error: compilation successful + --> $DIR/feature-gate.rs:31:1 + | +LL | / fn main() { //[with_gate]~ ERROR compilation successful +LL | | let y = Foo { x: 1 }; +LL | | match y { +LL | | FOO => { } +LL | | _ => { } +LL | | } +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/rfc1445/match-forbidden-without-eq.rs b/src/test/ui/compile-fail-migration/rfc1445/match-forbidden-without-eq.rs index ca9af78dd99..ca9af78dd99 100644 --- a/src/test/compile-fail/rfc1445/match-forbidden-without-eq.rs +++ b/src/test/ui/compile-fail-migration/rfc1445/match-forbidden-without-eq.rs diff --git a/src/test/ui/compile-fail-migration/rfc1445/match-forbidden-without-eq.stderr b/src/test/ui/compile-fail-migration/rfc1445/match-forbidden-without-eq.stderr new file mode 100644 index 00000000000..a2cb536b212 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc1445/match-forbidden-without-eq.stderr @@ -0,0 +1,18 @@ +error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]` + --> $DIR/match-forbidden-without-eq.rs:23:9 + | +LL | FOO => { } + | ^^^ + +warning: floating-point types cannot be used in patterns + --> $DIR/match-forbidden-without-eq.rs:30:9 + | +LL | f32::INFINITY => { } + | ^^^^^^^^^^^^^ + | + = note: #[warn(illegal_floating_point_literal_pattern)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #41620 <https://github.com/rust-lang/rust/issues/41620> + +error: aborting due to previous error + diff --git a/src/test/compile-fail/rfc1445/match-requires-both-partialeq-and-eq.rs b/src/test/ui/compile-fail-migration/rfc1445/match-requires-both-partialeq-and-eq.rs index e02f9153e7e..e02f9153e7e 100644 --- a/src/test/compile-fail/rfc1445/match-requires-both-partialeq-and-eq.rs +++ b/src/test/ui/compile-fail-migration/rfc1445/match-requires-both-partialeq-and-eq.rs diff --git a/src/test/ui/compile-fail-migration/rfc1445/match-requires-both-partialeq-and-eq.stderr b/src/test/ui/compile-fail-migration/rfc1445/match-requires-both-partialeq-and-eq.stderr new file mode 100644 index 00000000000..60f3191cd27 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc1445/match-requires-both-partialeq-and-eq.stderr @@ -0,0 +1,8 @@ +error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]` + --> $DIR/match-requires-both-partialeq-and-eq.rs:27:9 + | +LL | FOO => { } + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/rfc1623.rs b/src/test/ui/compile-fail-migration/rfc1623.rs index 579fa378a1c..579fa378a1c 100644 --- a/src/test/compile-fail/rfc1623.rs +++ b/src/test/ui/compile-fail-migration/rfc1623.rs diff --git a/src/test/ui/compile-fail-migration/rfc1623.stderr b/src/test/ui/compile-fail-migration/rfc1623.stderr new file mode 100644 index 00000000000..3815558fb25 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc1623.stderr @@ -0,0 +1,19 @@ +error[E0106]: missing lifetime specifier + --> $DIR/rfc1623.rs:17:42 + | +LL | static NON_ELIDABLE_FN: &fn(&u8, &u8) -> &u8 = + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2 + +error[E0106]: missing lifetime specifier + --> $DIR/rfc1623.rs:19:39 + | +LL | &(non_elidable as fn(&u8, &u8) -> &u8); + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2 + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/compile-fail/rfc1717/missing-link-attr.rs b/src/test/ui/compile-fail-migration/rfc1717/missing-link-attr.rs index 810efdedfd6..810efdedfd6 100644 --- a/src/test/compile-fail/rfc1717/missing-link-attr.rs +++ b/src/test/ui/compile-fail-migration/rfc1717/missing-link-attr.rs diff --git a/src/test/ui/compile-fail-migration/rfc1717/missing-link-attr.stderr b/src/test/ui/compile-fail-migration/rfc1717/missing-link-attr.stderr new file mode 100644 index 00000000000..30555e80944 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc1717/missing-link-attr.stderr @@ -0,0 +1,4 @@ +error: renaming of the library `foo` was specified, however this crate contains no #[link(...)] attributes referencing this library. + +error: aborting due to previous error + diff --git a/src/test/compile-fail/rfc1717/multiple-renames.rs b/src/test/ui/compile-fail-migration/rfc1717/multiple-renames.rs index e75c1a14b24..e75c1a14b24 100644 --- a/src/test/compile-fail/rfc1717/multiple-renames.rs +++ b/src/test/ui/compile-fail-migration/rfc1717/multiple-renames.rs diff --git a/src/test/ui/compile-fail-migration/rfc1717/multiple-renames.stderr b/src/test/ui/compile-fail-migration/rfc1717/multiple-renames.stderr new file mode 100644 index 00000000000..4e5a3647fa2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc1717/multiple-renames.stderr @@ -0,0 +1,4 @@ +error: multiple renamings were specified for library `foo` . + +error: aborting due to previous error + diff --git a/src/test/compile-fail/rfc1717/rename-to-empty.rs b/src/test/ui/compile-fail-migration/rfc1717/rename-to-empty.rs index ab8c238bc27..ab8c238bc27 100644 --- a/src/test/compile-fail/rfc1717/rename-to-empty.rs +++ b/src/test/ui/compile-fail-migration/rfc1717/rename-to-empty.rs diff --git a/src/test/ui/compile-fail-migration/rfc1717/rename-to-empty.stderr b/src/test/ui/compile-fail-migration/rfc1717/rename-to-empty.stderr new file mode 100644 index 00000000000..aca839d804f --- /dev/null +++ b/src/test/ui/compile-fail-migration/rfc1717/rename-to-empty.stderr @@ -0,0 +1,4 @@ +error: an empty renaming target was specified for library `foo` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/rmeta-lib-pass.rs b/src/test/ui/compile-fail-migration/rmeta-lib-pass.rs index 2df6a659724..2df6a659724 100644 --- a/src/test/compile-fail/rmeta-lib-pass.rs +++ b/src/test/ui/compile-fail-migration/rmeta-lib-pass.rs diff --git a/src/test/compile-fail/rmeta-pass.rs b/src/test/ui/compile-fail-migration/rmeta-pass.rs index 6ee914c5e5b..6ee914c5e5b 100644 --- a/src/test/compile-fail/rmeta-pass.rs +++ b/src/test/ui/compile-fail-migration/rmeta-pass.rs diff --git a/src/test/compile-fail/rmeta-priv-warn.rs b/src/test/ui/compile-fail-migration/rmeta-priv-warn.rs index bcf869c9432..bcf869c9432 100644 --- a/src/test/compile-fail/rmeta-priv-warn.rs +++ b/src/test/ui/compile-fail-migration/rmeta-priv-warn.rs diff --git a/src/test/compile-fail/rmeta.rs b/src/test/ui/compile-fail-migration/rmeta.rs index 962fe9f66aa..962fe9f66aa 100644 --- a/src/test/compile-fail/rmeta.rs +++ b/src/test/ui/compile-fail-migration/rmeta.rs diff --git a/src/test/ui/compile-fail-migration/rmeta.stderr b/src/test/ui/compile-fail-migration/rmeta.stderr new file mode 100644 index 00000000000..fa154f81b29 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rmeta.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `Foo` in this scope + --> $DIR/rmeta.rs:17:13 + | +LL | let _ = Foo; //~ ERROR cannot find value `Foo` in this scope + | ^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/rmeta_lib.rs b/src/test/ui/compile-fail-migration/rmeta_lib.rs index a61ff05e8c8..a61ff05e8c8 100644 --- a/src/test/compile-fail/rmeta_lib.rs +++ b/src/test/ui/compile-fail-migration/rmeta_lib.rs diff --git a/src/test/ui/compile-fail-migration/rmeta_lib.stderr b/src/test/ui/compile-fail-migration/rmeta_lib.stderr new file mode 100644 index 00000000000..8a9179cca6b --- /dev/null +++ b/src/test/ui/compile-fail-migration/rmeta_lib.stderr @@ -0,0 +1,4 @@ +error: crate `rmeta_meta` required to be available in rlib format, but was not found in this form + +error: aborting due to previous error + diff --git a/src/test/compile-fail/rmeta_meta_main.rs b/src/test/ui/compile-fail-migration/rmeta_meta_main.rs index ffeb5bc3b85..ffeb5bc3b85 100644 --- a/src/test/compile-fail/rmeta_meta_main.rs +++ b/src/test/ui/compile-fail-migration/rmeta_meta_main.rs diff --git a/src/test/ui/compile-fail-migration/rmeta_meta_main.stderr b/src/test/ui/compile-fail-migration/rmeta_meta_main.stderr new file mode 100644 index 00000000000..f246a8b5f63 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rmeta_meta_main.stderr @@ -0,0 +1,9 @@ +error[E0560]: struct `rmeta_meta::Foo` has no field named `field2` + --> $DIR/rmeta_meta_main.rs:23:19 + | +LL | let _ = Foo { field2: 42 }; //~ ERROR struct `rmeta_meta::Foo` has no field named `field2` + | ^^^^^^ field does not exist - did you mean `field`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0560`. diff --git a/src/test/compile-fail/rust-unstable-column-gated.rs b/src/test/ui/compile-fail-migration/rust-unstable-column-gated.rs index abc92c86eec..abc92c86eec 100644 --- a/src/test/compile-fail/rust-unstable-column-gated.rs +++ b/src/test/ui/compile-fail-migration/rust-unstable-column-gated.rs diff --git a/src/test/ui/compile-fail-migration/rust-unstable-column-gated.stderr b/src/test/ui/compile-fail-migration/rust-unstable-column-gated.stderr new file mode 100644 index 00000000000..785fcd7af42 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rust-unstable-column-gated.stderr @@ -0,0 +1,8 @@ +error: the __rust_unstable_column macro is unstable + --> $DIR/rust-unstable-column-gated.rs:12:20 + | +LL | println!("{}", __rust_unstable_column!()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/rustc-args-required-const.rs b/src/test/ui/compile-fail-migration/rustc-args-required-const.rs index aac9299eaaf..aac9299eaaf 100644 --- a/src/test/compile-fail/rustc-args-required-const.rs +++ b/src/test/ui/compile-fail-migration/rustc-args-required-const.rs diff --git a/src/test/ui/compile-fail-migration/rustc-args-required-const.stderr b/src/test/ui/compile-fail-migration/rustc-args-required-const.stderr new file mode 100644 index 00000000000..07f2d880c82 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rustc-args-required-const.stderr @@ -0,0 +1,14 @@ +error: argument 1 is required to be a constant + --> $DIR/rustc-args-required-const.rs:33:5 + | +LL | foo(a); //~ ERROR: argument 1 is required to be a constant + | ^^^^^^ + +error: argument 2 is required to be a constant + --> $DIR/rustc-args-required-const.rs:35:5 + | +LL | bar(a, a); //~ ERROR: argument 2 is required to be a constant + | ^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/rustc-args-required-const2.rs b/src/test/ui/compile-fail-migration/rustc-args-required-const2.rs index aa63019307b..aa63019307b 100644 --- a/src/test/compile-fail/rustc-args-required-const2.rs +++ b/src/test/ui/compile-fail-migration/rustc-args-required-const2.rs diff --git a/src/test/ui/compile-fail-migration/rustc-args-required-const2.stderr b/src/test/ui/compile-fail-migration/rustc-args-required-const2.stderr new file mode 100644 index 00000000000..766f8adb0b4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/rustc-args-required-const2.stderr @@ -0,0 +1,8 @@ +error: this function can only be invoked directly, not through a function pointer + --> $DIR/rustc-args-required-const2.rs:18:13 + | +LL | let a = foo; //~ ERROR: this function can only be invoked directly + | ^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/rustc-error.rs b/src/test/ui/compile-fail-migration/rustc-error.rs index 82f32cbcd14..82f32cbcd14 100644 --- a/src/test/compile-fail/rustc-error.rs +++ b/src/test/ui/compile-fail-migration/rustc-error.rs diff --git a/src/test/ui/compile-fail-migration/rustc-error.stderr b/src/test/ui/compile-fail-migration/rustc-error.stderr new file mode 100644 index 00000000000..7456d2af51f --- /dev/null +++ b/src/test/ui/compile-fail-migration/rustc-error.stderr @@ -0,0 +1,10 @@ +error: compilation successful + --> $DIR/rustc-error.rs:14:1 + | +LL | / fn main() { +LL | | //~^ ERROR compilation successful +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/safe-extern-statics-mut.rs b/src/test/ui/compile-fail-migration/safe-extern-statics-mut.rs index 35ea6dd52c4..35ea6dd52c4 100644 --- a/src/test/compile-fail/safe-extern-statics-mut.rs +++ b/src/test/ui/compile-fail-migration/safe-extern-statics-mut.rs diff --git a/src/test/ui/compile-fail-migration/safe-extern-statics-mut.stderr b/src/test/ui/compile-fail-migration/safe-extern-statics-mut.stderr new file mode 100644 index 00000000000..f48dce65afa --- /dev/null +++ b/src/test/ui/compile-fail-migration/safe-extern-statics-mut.stderr @@ -0,0 +1,35 @@ +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/safe-extern-statics-mut.rs:21:13 + | +LL | let b = B; //~ ERROR use of mutable static is unsafe + | ^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/safe-extern-statics-mut.rs:22:14 + | +LL | let rb = &B; //~ ERROR use of mutable static is unsafe + | ^^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/safe-extern-statics-mut.rs:23:14 + | +LL | let xb = XB; //~ ERROR use of mutable static is unsafe + | ^^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/safe-extern-statics-mut.rs:24:15 + | +LL | let xrb = &XB; //~ ERROR use of mutable static is unsafe + | ^^^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/safe-extern-statics.rs b/src/test/ui/compile-fail-migration/safe-extern-statics.rs index 83aa4b3316d..83aa4b3316d 100644 --- a/src/test/compile-fail/safe-extern-statics.rs +++ b/src/test/ui/compile-fail-migration/safe-extern-statics.rs diff --git a/src/test/ui/compile-fail-migration/safe-extern-statics.stderr b/src/test/ui/compile-fail-migration/safe-extern-statics.stderr new file mode 100644 index 00000000000..657d57967bb --- /dev/null +++ b/src/test/ui/compile-fail-migration/safe-extern-statics.stderr @@ -0,0 +1,43 @@ +error: use of extern static is unsafe and requires unsafe function or block (error E0133) + --> $DIR/safe-extern-statics.rs:23:13 + | +LL | let a = A; //~ ERROR use of extern static is unsafe + | ^ + | + = note: #[deny(safe_extern_statics)] on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247> + = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior + +error: use of extern static is unsafe and requires unsafe function or block (error E0133) + --> $DIR/safe-extern-statics.rs:25:14 + | +LL | let ra = &A; //~ ERROR use of extern static is unsafe + | ^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247> + = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior + +error: use of extern static is unsafe and requires unsafe function or block (error E0133) + --> $DIR/safe-extern-statics.rs:27:14 + | +LL | let xa = XA; //~ ERROR use of extern static is unsafe + | ^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247> + = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior + +error: use of extern static is unsafe and requires unsafe function or block (error E0133) + --> $DIR/safe-extern-statics.rs:29:15 + | +LL | let xra = &XA; //~ ERROR use of extern static is unsafe + | ^^^ + | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #36247 <https://github.com/rust-lang/rust/issues/36247> + = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/self-infer.rs b/src/test/ui/compile-fail-migration/self-infer.rs index fd011318a48..fd011318a48 100644 --- a/src/test/compile-fail/self-infer.rs +++ b/src/test/ui/compile-fail-migration/self-infer.rs diff --git a/src/test/ui/compile-fail-migration/self-infer.stderr b/src/test/ui/compile-fail-migration/self-infer.stderr new file mode 100644 index 00000000000..642e0de5290 --- /dev/null +++ b/src/test/ui/compile-fail-migration/self-infer.stderr @@ -0,0 +1,15 @@ +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/self-infer.rs:14:16 + | +LL | fn f(self: _) {} //~ERROR the type placeholder `_` is not allowed within types on item sig + | ^ not allowed in type signatures + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/self-infer.rs:15:17 + | +LL | fn g(self: &_) {} //~ERROR the type placeholder `_` is not allowed within types on item sig + | ^ not allowed in type signatures + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0121`. diff --git a/src/test/compile-fail/self-vs-path-ambiguity.rs b/src/test/ui/compile-fail-migration/self-vs-path-ambiguity.rs index b2dba3bd61b..b2dba3bd61b 100644 --- a/src/test/compile-fail/self-vs-path-ambiguity.rs +++ b/src/test/ui/compile-fail-migration/self-vs-path-ambiguity.rs diff --git a/src/test/ui/compile-fail-migration/self-vs-path-ambiguity.stderr b/src/test/ui/compile-fail-migration/self-vs-path-ambiguity.stderr new file mode 100644 index 00000000000..76517433170 --- /dev/null +++ b/src/test/ui/compile-fail-migration/self-vs-path-ambiguity.stderr @@ -0,0 +1,8 @@ +error: unexpected lifetime `'a` in pattern + --> $DIR/self-vs-path-ambiguity.rs:19:11 + | +LL | fn i(&'a self::S: &S) {} //~ ERROR unexpected lifetime `'a` in pattern + | ^^ unexpected lifetime + +error: aborting due to previous error + diff --git a/src/test/compile-fail/self_type_keyword-2.rs b/src/test/ui/compile-fail-migration/self_type_keyword-2.rs index 8331ae0b307..8331ae0b307 100644 --- a/src/test/compile-fail/self_type_keyword-2.rs +++ b/src/test/ui/compile-fail-migration/self_type_keyword-2.rs diff --git a/src/test/ui/compile-fail-migration/self_type_keyword-2.stderr b/src/test/ui/compile-fail-migration/self_type_keyword-2.stderr new file mode 100644 index 00000000000..972e5bdddc6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/self_type_keyword-2.stderr @@ -0,0 +1,28 @@ +error[E0432]: unresolved import `self::Self` + --> $DIR/self_type_keyword-2.rs:11:5 + | +LL | use self::Self as Foo; //~ ERROR unresolved import `self::Self` + | ^^^^^^^^^^^^^^^^^ no `Self` in the root + +error[E0531]: cannot find unit struct/variant or constant `Self` in this scope + --> $DIR/self_type_keyword-2.rs:14:9 + | +LL | let Self = 5; + | ^^^^ not found in this scope + +error[E0531]: cannot find unit struct/variant or constant `Self` in this scope + --> $DIR/self_type_keyword-2.rs:18:9 + | +LL | Self => (), + | ^^^^ not found in this scope + +error[E0531]: cannot find unit struct/variant or constant `Self` in this scope + --> $DIR/self_type_keyword-2.rs:20:18 + | +LL | Foo { x: Self } => (), + | ^^^^ not found in this scope + +error: aborting due to 4 previous errors + +Some errors occurred: E0432, E0531. +For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/self_type_keyword.rs b/src/test/ui/compile-fail-migration/self_type_keyword.rs index 20d2e2ca9cf..20d2e2ca9cf 100644 --- a/src/test/compile-fail/self_type_keyword.rs +++ b/src/test/ui/compile-fail-migration/self_type_keyword.rs diff --git a/src/test/ui/compile-fail-migration/self_type_keyword.stderr b/src/test/ui/compile-fail-migration/self_type_keyword.stderr new file mode 100644 index 00000000000..4a7b9a6ce2c --- /dev/null +++ b/src/test/ui/compile-fail-migration/self_type_keyword.stderr @@ -0,0 +1,62 @@ +error: expected identifier, found keyword `Self` + --> $DIR/self_type_keyword.rs:14:10 + | +LL | struct Self; + | ^^^^ expected identifier, found keyword + +error: expected identifier, found keyword `Self` + --> $DIR/self_type_keyword.rs:25:13 + | +LL | ref Self => (), + | ^^^^ expected identifier, found keyword + +error: expected identifier, found keyword `Self` + --> $DIR/self_type_keyword.rs:27:13 + | +LL | mut Self => (), + | ^^^^ expected identifier, found keyword + +error: expected identifier, found keyword `Self` + --> $DIR/self_type_keyword.rs:29:17 + | +LL | ref mut Self => (), + | ^^^^ expected identifier, found keyword + +error: expected identifier, found keyword `Self` + --> $DIR/self_type_keyword.rs:33:15 + | +LL | Foo { Self } => (), + | ^^^^ expected identifier, found keyword + +error: expected identifier, found keyword `Self` + --> $DIR/self_type_keyword.rs:39:26 + | +LL | extern crate core as Self; + | ^^^^ expected identifier, found keyword + +error: expected identifier, found keyword `Self` + --> $DIR/self_type_keyword.rs:44:32 + | +LL | use std::option::Option as Self; + | ^^^^ expected identifier, found keyword + +error: expected identifier, found keyword `Self` + --> $DIR/self_type_keyword.rs:49:11 + | +LL | trait Self {} + | ^^^^ expected identifier, found keyword + +error: lifetimes cannot use keyword names + --> $DIR/self_type_keyword.rs:18:12 + | +LL | struct Bar<'Self>; + | ^^^^^ + +error: cannot find macro `Self!` in this scope + --> $DIR/self_type_keyword.rs:31:9 + | +LL | Self!() => (), + | ^^^^ + +error: aborting due to 10 previous errors + diff --git a/src/test/compile-fail/seq-args.rs b/src/test/ui/compile-fail-migration/seq-args.rs index 44b049d6561..44b049d6561 100644 --- a/src/test/compile-fail/seq-args.rs +++ b/src/test/ui/compile-fail-migration/seq-args.rs diff --git a/src/test/ui/compile-fail-migration/seq-args.stderr b/src/test/ui/compile-fail-migration/seq-args.stderr new file mode 100644 index 00000000000..dc9d0a7fc0b --- /dev/null +++ b/src/test/ui/compile-fail-migration/seq-args.stderr @@ -0,0 +1,15 @@ +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/seq-args.rs:14:9 + | +LL | impl<T> seq<T> for Vec<T> { //~ ERROR wrong number of type arguments + | ^^^^^^ expected no type arguments + +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/seq-args.rs:17:6 + | +LL | impl seq<bool> for u32 { //~ ERROR wrong number of type arguments + | ^^^^^^^^^ expected no type arguments + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0244`. diff --git a/src/test/compile-fail/shadowed-trait-methods.rs b/src/test/ui/compile-fail-migration/shadowed-trait-methods.rs index 3146017a0b4..3146017a0b4 100644 --- a/src/test/compile-fail/shadowed-trait-methods.rs +++ b/src/test/ui/compile-fail-migration/shadowed-trait-methods.rs diff --git a/src/test/ui/compile-fail-migration/shadowed-trait-methods.stderr b/src/test/ui/compile-fail-migration/shadowed-trait-methods.stderr new file mode 100644 index 00000000000..910f125a148 --- /dev/null +++ b/src/test/ui/compile-fail-migration/shadowed-trait-methods.stderr @@ -0,0 +1,15 @@ +error[E0599]: no method named `f` found for type `()` in the current scope + --> $DIR/shadowed-trait-methods.rs:23:8 + | +LL | ().f() //~ ERROR no method + | ^ + | + = help: items from traits can only be used if the trait is in scope +help: the following trait is implemented but not in scope, perhaps add a `use` for it: + | +LL | use foo::T; + | + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/shadowed-use-visibility.rs b/src/test/ui/compile-fail-migration/shadowed-use-visibility.rs index e7e57a73de0..e7e57a73de0 100644 --- a/src/test/compile-fail/shadowed-use-visibility.rs +++ b/src/test/ui/compile-fail-migration/shadowed-use-visibility.rs diff --git a/src/test/ui/compile-fail-migration/shadowed-use-visibility.stderr b/src/test/ui/compile-fail-migration/shadowed-use-visibility.stderr new file mode 100644 index 00000000000..5764ed76ef4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/shadowed-use-visibility.stderr @@ -0,0 +1,15 @@ +error[E0603]: module `bar` is private + --> $DIR/shadowed-use-visibility.rs:19:9 + | +LL | use foo::bar::f as g; //~ ERROR module `bar` is private + | ^^^^^^^^^^^^^^^^ + +error[E0603]: module `f` is private + --> $DIR/shadowed-use-visibility.rs:25:5 + | +LL | use bar::f::f; //~ ERROR module `f` is private + | ^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/shadowing-in-the-same-pattern.rs b/src/test/ui/compile-fail-migration/shadowing-in-the-same-pattern.rs index e847d332416..e847d332416 100644 --- a/src/test/compile-fail/shadowing-in-the-same-pattern.rs +++ b/src/test/ui/compile-fail-migration/shadowing-in-the-same-pattern.rs diff --git a/src/test/ui/compile-fail-migration/shadowing-in-the-same-pattern.stderr b/src/test/ui/compile-fail-migration/shadowing-in-the-same-pattern.stderr new file mode 100644 index 00000000000..46722891476 --- /dev/null +++ b/src/test/ui/compile-fail-migration/shadowing-in-the-same-pattern.stderr @@ -0,0 +1,15 @@ +error[E0416]: identifier `a` is bound more than once in the same pattern + --> $DIR/shadowing-in-the-same-pattern.rs:13:10 + | +LL | fn f((a, a): (isize, isize)) {} //~ ERROR identifier `a` is bound more than once + | ^ used in a pattern more than once + +error[E0416]: identifier `a` is bound more than once in the same pattern + --> $DIR/shadowing-in-the-same-pattern.rs:16:13 + | +LL | let (a, a) = (1, 1); //~ ERROR identifier `a` is bound more than once + | ^ used in a pattern more than once + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0416`. diff --git a/src/test/compile-fail/shift-various-bad-types.rs b/src/test/ui/compile-fail-migration/shift-various-bad-types.rs index 2d06161111e..2d06161111e 100644 --- a/src/test/compile-fail/shift-various-bad-types.rs +++ b/src/test/ui/compile-fail-migration/shift-various-bad-types.rs diff --git a/src/test/ui/compile-fail-migration/shift-various-bad-types.stderr b/src/test/ui/compile-fail-migration/shift-various-bad-types.stderr new file mode 100644 index 00000000000..7798b619cd9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/shift-various-bad-types.stderr @@ -0,0 +1,34 @@ +error[E0277]: no implementation for `{integer} >> char` + --> $DIR/shift-various-bad-types.rs:19:8 + | +LL | 22 >> p.char; + | ^^ no implementation for `{integer} >> char` + | + = help: the trait `std::ops::Shr<char>` is not implemented for `{integer}` + +error[E0277]: no implementation for `{integer} >> &str` + --> $DIR/shift-various-bad-types.rs:22:8 + | +LL | 22 >> p.str; + | ^^ no implementation for `{integer} >> &str` + | + = help: the trait `std::ops::Shr<&str>` is not implemented for `{integer}` + +error[E0277]: no implementation for `{integer} >> &Panolpy` + --> $DIR/shift-various-bad-types.rs:25:8 + | +LL | 22 >> p; + | ^^ no implementation for `{integer} >> &Panolpy` + | + = help: the trait `std::ops::Shr<&Panolpy>` is not implemented for `{integer}` + +error[E0308]: mismatched types + --> $DIR/shift-various-bad-types.rs:35:18 + | +LL | let _: i32 = 22_i64 >> 1_i32; + | ^^^^^^^^^^^^^^^ expected i32, found i64 + +error: aborting due to 4 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/should-fail-no_gate_irrefutable_if_let_pattern.rs b/src/test/ui/compile-fail-migration/should-fail-no_gate_irrefutable_if_let_pattern.rs index 8c9a24f4e72..8c9a24f4e72 100644 --- a/src/test/compile-fail/should-fail-no_gate_irrefutable_if_let_pattern.rs +++ b/src/test/ui/compile-fail-migration/should-fail-no_gate_irrefutable_if_let_pattern.rs diff --git a/src/test/ui/compile-fail-migration/should-fail-no_gate_irrefutable_if_let_pattern.stderr b/src/test/ui/compile-fail-migration/should-fail-no_gate_irrefutable_if_let_pattern.stderr new file mode 100644 index 00000000000..d8570ad4e83 --- /dev/null +++ b/src/test/ui/compile-fail-migration/should-fail-no_gate_irrefutable_if_let_pattern.stderr @@ -0,0 +1,9 @@ +error[E0162]: irrefutable if-let pattern + --> $DIR/should-fail-no_gate_irrefutable_if_let_pattern.rs:13:12 + | +LL | if let _ = 5 {} + | ^ irrefutable pattern + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0162`. diff --git a/src/test/compile-fail/should-fail-with_gate_irrefutable_pattern_deny.rs b/src/test/ui/compile-fail-migration/should-fail-with_gate_irrefutable_pattern_deny.rs index 6f95f10c0d9..6f95f10c0d9 100644 --- a/src/test/compile-fail/should-fail-with_gate_irrefutable_pattern_deny.rs +++ b/src/test/ui/compile-fail-migration/should-fail-with_gate_irrefutable_pattern_deny.rs diff --git a/src/test/ui/compile-fail-migration/should-fail-with_gate_irrefutable_pattern_deny.stderr b/src/test/ui/compile-fail-migration/should-fail-with_gate_irrefutable_pattern_deny.stderr new file mode 100644 index 00000000000..9dc0d1968e6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/should-fail-with_gate_irrefutable_pattern_deny.stderr @@ -0,0 +1,10 @@ +error: irrefutable if-let pattern + --> $DIR/should-fail-with_gate_irrefutable_pattern_deny.rs:15:5 + | +LL | if let _ = 5 {} + | ^^^^^^^^^^^^^^^ + | + = note: #[deny(irrefutable_let_patterns)] on by default + +error: aborting due to previous error + diff --git a/src/test/compile-fail/simd-intrinsic-declaration-type.rs b/src/test/ui/compile-fail-migration/simd-intrinsic-declaration-type.rs index ef1f4d6f230..ef1f4d6f230 100644 --- a/src/test/compile-fail/simd-intrinsic-declaration-type.rs +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-declaration-type.rs diff --git a/src/test/ui/compile-fail-migration/simd-intrinsic-declaration-type.stderr b/src/test/ui/compile-fail-migration/simd-intrinsic-declaration-type.stderr new file mode 100644 index 00000000000..4a8fd2d1bef --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-declaration-type.stderr @@ -0,0 +1,75 @@ +error[E0442]: intrinsic argument 1 has wrong type: found `u16`, expected `i16` + --> $DIR/simd-intrinsic-declaration-type.rs:42:9 + | +LL | fn x86_mm_adds_epi16(x: u16x8, y: u16x8) -> u16x8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic argument 2 has wrong type: found `u16`, expected `i16` + --> $DIR/simd-intrinsic-declaration-type.rs:42:9 + | +LL | fn x86_mm_adds_epi16(x: u16x8, y: u16x8) -> u16x8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic return value has wrong type: found `u16`, expected `i16` + --> $DIR/simd-intrinsic-declaration-type.rs:42:9 + | +LL | fn x86_mm_adds_epi16(x: u16x8, y: u16x8) -> u16x8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic argument 1 has wrong type: found `i16`, expected `u16` + --> $DIR/simd-intrinsic-declaration-type.rs:46:9 + | +LL | fn x86_mm_adds_epu16(x: i16x8, y: i16x8) -> i16x8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic argument 2 has wrong type: found `i16`, expected `u16` + --> $DIR/simd-intrinsic-declaration-type.rs:46:9 + | +LL | fn x86_mm_adds_epu16(x: i16x8, y: i16x8) -> i16x8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic return value has wrong type: found `i16`, expected `u16` + --> $DIR/simd-intrinsic-declaration-type.rs:46:9 + | +LL | fn x86_mm_adds_epu16(x: i16x8, y: i16x8) -> i16x8; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic argument 1 has wrong type: found vector with length 16, expected length 8 + --> $DIR/simd-intrinsic-declaration-type.rs:54:5 + | +LL | fn x86_mm_adds_epi16(x: i8x16, y: i32x4) -> i64x2; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic argument 2 has wrong type: found vector with length 4, expected length 8 + --> $DIR/simd-intrinsic-declaration-type.rs:54:5 + | +LL | fn x86_mm_adds_epi16(x: i8x16, y: i32x4) -> i64x2; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic return value has wrong type: found vector with length 2, expected length 8 + --> $DIR/simd-intrinsic-declaration-type.rs:54:5 + | +LL | fn x86_mm_adds_epi16(x: i8x16, y: i32x4) -> i64x2; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic argument 1 has wrong type: found `i32`, expected `f32` + --> $DIR/simd-intrinsic-declaration-type.rs:61:5 + | +LL | fn x86_mm_max_ps(x: i32x4, y: i32x4) -> i32x4; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic argument 2 has wrong type: found `i32`, expected `f32` + --> $DIR/simd-intrinsic-declaration-type.rs:61:5 + | +LL | fn x86_mm_max_ps(x: i32x4, y: i32x4) -> i32x4; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0442]: intrinsic return value has wrong type: found `i32`, expected `f32` + --> $DIR/simd-intrinsic-declaration-type.rs:61:5 + | +LL | fn x86_mm_max_ps(x: i32x4, y: i32x4) -> i32x4; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0442`. diff --git a/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-arithmetic.rs index ee08ca05e80..ee08ca05e80 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-arithmetic.rs diff --git a/src/test/ui/compile-fail-migration/simd-intrinsic-generic-arithmetic.stderr b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-arithmetic.stderr new file mode 100644 index 00000000000..f81fa75c56b --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-arithmetic.stderr @@ -0,0 +1,87 @@ +error[E0511]: invalid monomorphization of `simd_add` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:72:9 + | +LL | simd_add(0, 0); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_sub` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:74:9 + | +LL | simd_sub(0, 0); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_mul` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:76:9 + | +LL | simd_mul(0, 0); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_div` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:78:9 + | +LL | simd_div(0, 0); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shl` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:80:9 + | +LL | simd_shl(0, 0); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shr` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:82:9 + | +LL | simd_shr(0, 0); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_and` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:84:9 + | +LL | simd_and(0, 0); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_or` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:86:9 + | +LL | simd_or(0, 0); + | ^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_xor` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:88:9 + | +LL | simd_xor(0, 0); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shl` intrinsic: unsupported operation on `f32x4` with element `f32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:92:9 + | +LL | simd_shl(z, z); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shr` intrinsic: unsupported operation on `f32x4` with element `f32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:94:9 + | +LL | simd_shr(z, z); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_and` intrinsic: unsupported operation on `f32x4` with element `f32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:96:9 + | +LL | simd_and(z, z); + | ^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_or` intrinsic: unsupported operation on `f32x4` with element `f32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:98:9 + | +LL | simd_or(z, z); + | ^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_xor` intrinsic: unsupported operation on `f32x4` with element `f32` + --> $DIR/simd-intrinsic-generic-arithmetic.rs:100:9 + | +LL | simd_xor(z, z); + | ^^^^^^^^^^^^^^ + +error: aborting due to 14 previous errors + +For more information about this error, try `rustc --explain E0511`. diff --git a/src/test/compile-fail/simd-intrinsic-generic-cast.rs b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-cast.rs index 4999b790b13..4999b790b13 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-cast.rs +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-cast.rs diff --git a/src/test/ui/compile-fail-migration/simd-intrinsic-generic-cast.stderr b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-cast.stderr new file mode 100644 index 00000000000..6ad5ac7dbfd --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-cast.stderr @@ -0,0 +1,27 @@ +error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-cast.rs:42:9 + | +LL | simd_cast::<i32, i32>(0); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-cast.rs:44:9 + | +LL | simd_cast::<i32, i32x4>(0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected SIMD return type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-cast.rs:46:9 + | +LL | simd_cast::<i32x4, i32>(x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_cast` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i32x8` with length 8 + --> $DIR/simd-intrinsic-generic-cast.rs:48:9 + | +LL | simd_cast::<_, i32x8>(x); + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0511`. diff --git a/src/test/compile-fail/simd-intrinsic-generic-comparison.rs b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-comparison.rs index 617b03a8711..617b03a8711 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-comparison.rs +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-comparison.rs diff --git a/src/test/ui/compile-fail-migration/simd-intrinsic-generic-comparison.stderr b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-comparison.stderr new file mode 100644 index 00000000000..06eb94a4f97 --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-comparison.stderr @@ -0,0 +1,111 @@ +error[E0511]: invalid monomorphization of `simd_eq` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:36:9 + | +LL | simd_eq::<i32, i32>(0, 0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_ne` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:38:9 + | +LL | simd_ne::<i32, i32>(0, 0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_lt` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:40:9 + | +LL | simd_lt::<i32, i32>(0, 0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_le` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:42:9 + | +LL | simd_le::<i32, i32>(0, 0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_gt` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:44:9 + | +LL | simd_gt::<i32, i32>(0, 0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_ge` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:46:9 + | +LL | simd_ge::<i32, i32>(0, 0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_eq` intrinsic: expected SIMD return type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:49:9 + | +LL | simd_eq::<_, i32>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_ne` intrinsic: expected SIMD return type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:51:9 + | +LL | simd_ne::<_, i32>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_lt` intrinsic: expected SIMD return type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:53:9 + | +LL | simd_lt::<_, i32>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_le` intrinsic: expected SIMD return type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:55:9 + | +LL | simd_le::<_, i32>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_gt` intrinsic: expected SIMD return type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:57:9 + | +LL | simd_gt::<_, i32>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_ge` intrinsic: expected SIMD return type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-comparison.rs:59:9 + | +LL | simd_ge::<_, i32>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_eq` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8 + --> $DIR/simd-intrinsic-generic-comparison.rs:62:9 + | +LL | simd_eq::<_, i16x8>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_ne` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8 + --> $DIR/simd-intrinsic-generic-comparison.rs:64:9 + | +LL | simd_ne::<_, i16x8>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_lt` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8 + --> $DIR/simd-intrinsic-generic-comparison.rs:66:9 + | +LL | simd_lt::<_, i16x8>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_le` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8 + --> $DIR/simd-intrinsic-generic-comparison.rs:68:9 + | +LL | simd_le::<_, i16x8>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_gt` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8 + --> $DIR/simd-intrinsic-generic-comparison.rs:70:9 + | +LL | simd_gt::<_, i16x8>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_ge` intrinsic: expected return type with length 4 (same as input type `i32x4`), found `i16x8` with length 8 + --> $DIR/simd-intrinsic-generic-comparison.rs:72:9 + | +LL | simd_ge::<_, i16x8>(x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 18 previous errors + +For more information about this error, try `rustc --explain E0511`. diff --git a/src/test/compile-fail/simd-intrinsic-generic-elements.rs b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-elements.rs index 78f7d42e25a..78f7d42e25a 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-elements.rs +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-elements.rs diff --git a/src/test/ui/compile-fail-migration/simd-intrinsic-generic-elements.stderr b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-elements.stderr new file mode 100644 index 00000000000..5a2def2c8c7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-elements.stderr @@ -0,0 +1,93 @@ +error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-elements.rs:63:9 + | +LL | simd_insert(0, 0, 0); + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_insert` intrinsic: expected inserted type `i32` (element of input `i32x4`), found `f64` + --> $DIR/simd-intrinsic-generic-elements.rs:65:9 + | +LL | simd_insert(x, 0, 1.0); + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_extract` intrinsic: expected return type `i32` (element of input `i32x4`), found `f32` + --> $DIR/simd-intrinsic-generic-elements.rs:67:9 + | +LL | simd_extract::<_, f32>(x, 0); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-elements.rs:70:9 + | +LL | simd_shuffle2::<i32, i32>(0, 0, [0; 2]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle3` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-elements.rs:72:9 + | +LL | simd_shuffle3::<i32, i32>(0, 0, [0; 3]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-elements.rs:74:9 + | +LL | simd_shuffle4::<i32, i32>(0, 0, [0; 4]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected SIMD input type, found non-SIMD `i32` + --> $DIR/simd-intrinsic-generic-elements.rs:76:9 + | +LL | simd_shuffle8::<i32, i32>(0, 0, [0; 8]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x2` with element type `f32` + --> $DIR/simd-intrinsic-generic-elements.rs:79:9 + | +LL | simd_shuffle2::<_, f32x2>(x, x, [0; 2]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle3` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x3` with element type `f32` + --> $DIR/simd-intrinsic-generic-elements.rs:81:9 + | +LL | simd_shuffle3::<_, f32x3>(x, x, [0; 3]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x4` with element type `f32` + --> $DIR/simd-intrinsic-generic-elements.rs:83:9 + | +LL | simd_shuffle4::<_, f32x4>(x, x, [0; 4]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected return element type `i32` (element of input `i32x4`), found `f32x8` with element type `f32` + --> $DIR/simd-intrinsic-generic-elements.rs:85:9 + | +LL | simd_shuffle8::<_, f32x8>(x, x, [0; 8]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle2` intrinsic: expected return type of length 2, found `i32x8` with length 8 + --> $DIR/simd-intrinsic-generic-elements.rs:88:9 + | +LL | simd_shuffle2::<_, i32x8>(x, x, [0; 2]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle3` intrinsic: expected return type of length 3, found `i32x4` with length 4 + --> $DIR/simd-intrinsic-generic-elements.rs:90:9 + | +LL | simd_shuffle3::<_, i32x4>(x, x, [0; 3]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle4` intrinsic: expected return type of length 4, found `i32x3` with length 3 + --> $DIR/simd-intrinsic-generic-elements.rs:92:9 + | +LL | simd_shuffle4::<_, i32x3>(x, x, [0; 4]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_shuffle8` intrinsic: expected return type of length 8, found `i32x2` with length 2 + --> $DIR/simd-intrinsic-generic-elements.rs:94:9 + | +LL | simd_shuffle8::<_, i32x2>(x, x, [0; 8]); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 15 previous errors + +For more information about this error, try `rustc --explain E0511`. diff --git a/src/test/compile-fail/simd-intrinsic-generic-reduction.rs b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-reduction.rs index 725960a866b..725960a866b 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-reduction.rs +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-reduction.rs diff --git a/src/test/ui/compile-fail-migration/simd-intrinsic-generic-reduction.stderr b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-reduction.stderr new file mode 100644 index 00000000000..47b1e9dac78 --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-reduction.stderr @@ -0,0 +1,75 @@ +error[E0511]: invalid monomorphization of `simd_reduce_add_ordered` intrinsic: accumulator of simd_reduce_add_ordered is not 0.0 + --> $DIR/simd-intrinsic-generic-reduction.rs:46:9 + | +LL | simd_reduce_add_ordered(z, 2_f32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_mul_ordered` intrinsic: accumulator of simd_reduce_mul_ordered is not 1.0 + --> $DIR/simd-intrinsic-generic-reduction.rs:48:9 + | +LL | simd_reduce_mul_ordered(z, 3_f32); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_and` intrinsic: expected return type `u32` (element of input `u32x4`), found `f32` + --> $DIR/simd-intrinsic-generic-reduction.rs:51:22 + | +LL | let _: f32 = simd_reduce_and(x); + | ^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_or` intrinsic: expected return type `u32` (element of input `u32x4`), found `f32` + --> $DIR/simd-intrinsic-generic-reduction.rs:53:22 + | +LL | let _: f32 = simd_reduce_or(x); + | ^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_xor` intrinsic: expected return type `u32` (element of input `u32x4`), found `f32` + --> $DIR/simd-intrinsic-generic-reduction.rs:55:22 + | +LL | let _: f32 = simd_reduce_xor(x); + | ^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_and` intrinsic: unsupported simd_reduce_and from `f32x4` with element `f32` to `f32` + --> $DIR/simd-intrinsic-generic-reduction.rs:58:22 + | +LL | let _: f32 = simd_reduce_and(z); + | ^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_or` intrinsic: unsupported simd_reduce_or from `f32x4` with element `f32` to `f32` + --> $DIR/simd-intrinsic-generic-reduction.rs:60:22 + | +LL | let _: f32 = simd_reduce_or(z); + | ^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_xor` intrinsic: unsupported simd_reduce_xor from `f32x4` with element `f32` to `f32` + --> $DIR/simd-intrinsic-generic-reduction.rs:62:22 + | +LL | let _: f32 = simd_reduce_xor(z); + | ^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_all` intrinsic: unsupported simd_reduce_all from `f32x4` with element `f32` to `bool` + --> $DIR/simd-intrinsic-generic-reduction.rs:65:23 + | +LL | let _: bool = simd_reduce_all(z); + | ^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_any` intrinsic: unsupported simd_reduce_any from `f32x4` with element `f32` to `bool` + --> $DIR/simd-intrinsic-generic-reduction.rs:67:23 + | +LL | let _: bool = simd_reduce_any(z); + | ^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_add_ordered` intrinsic: accumulator of simd_reduce_add_ordered is not a constant + --> $DIR/simd-intrinsic-generic-reduction.rs:77:5 + | +LL | simd_reduce_add_ordered(z, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_reduce_mul_ordered` intrinsic: accumulator of simd_reduce_mul_ordered is not a constant + --> $DIR/simd-intrinsic-generic-reduction.rs:79:5 + | +LL | simd_reduce_mul_ordered(z, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0511`. diff --git a/src/test/compile-fail/simd-intrinsic-generic-select.rs b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-select.rs index d74d6815d5f..d74d6815d5f 100644 --- a/src/test/compile-fail/simd-intrinsic-generic-select.rs +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-select.rs diff --git a/src/test/ui/compile-fail-migration/simd-intrinsic-generic-select.stderr b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-select.stderr new file mode 100644 index 00000000000..61e42027039 --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-generic-select.stderr @@ -0,0 +1,21 @@ +error[E0511]: invalid monomorphization of `simd_select` intrinsic: mismatched lengths: mask length `8` != other vector length `4` + --> $DIR/simd-intrinsic-generic-select.rs:47:9 + | +LL | simd_select(m8, x, x); + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `u32`, expected `i_` + --> $DIR/simd-intrinsic-generic-select.rs:50:9 + | +LL | simd_select(x, x, x); + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `f32`, expected `i_` + --> $DIR/simd-intrinsic-generic-select.rs:53:9 + | +LL | simd_select(z, z, z); + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0511`. diff --git a/src/test/compile-fail/simd-intrinsic-single-nominal-type.rs b/src/test/ui/compile-fail-migration/simd-intrinsic-single-nominal-type.rs index 0d0bf240f72..0d0bf240f72 100644 --- a/src/test/compile-fail/simd-intrinsic-single-nominal-type.rs +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-single-nominal-type.rs diff --git a/src/test/ui/compile-fail-migration/simd-intrinsic-single-nominal-type.stderr b/src/test/ui/compile-fail-migration/simd-intrinsic-single-nominal-type.stderr new file mode 100644 index 00000000000..0692aa7275b --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-intrinsic-single-nominal-type.stderr @@ -0,0 +1,15 @@ +error[E0443]: intrinsic return value has wrong type: found `B`, expected `A` which was used for this vector type previously in this signature + --> $DIR/simd-intrinsic-single-nominal-type.rs:23:5 + | +LL | fn x86_mm_adds_epi16(x: A, y: A) -> B; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0443]: intrinsic argument 2 has wrong type: found `B`, expected `A` which was used for this vector type previously in this signature + --> $DIR/simd-intrinsic-single-nominal-type.rs:25:5 + | +LL | fn x86_mm_subs_epi16(x: A, y: B) -> A; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0443`. diff --git a/src/test/compile-fail/simd-type-generic-monomorphisation.rs b/src/test/ui/compile-fail-migration/simd-type-generic-monomorphisation.rs index 336855eb5e1..336855eb5e1 100644 --- a/src/test/compile-fail/simd-type-generic-monomorphisation.rs +++ b/src/test/ui/compile-fail-migration/simd-type-generic-monomorphisation.rs diff --git a/src/test/ui/compile-fail-migration/simd-type-generic-monomorphisation.stderr b/src/test/ui/compile-fail-migration/simd-type-generic-monomorphisation.stderr new file mode 100644 index 00000000000..2a74506e80e --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-type-generic-monomorphisation.stderr @@ -0,0 +1,4 @@ +error: monomorphising SIMD type `Simd2<X>` with a non-machine element type `X` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/simd-type.rs b/src/test/ui/compile-fail-migration/simd-type.rs index cde63aa0cd1..cde63aa0cd1 100644 --- a/src/test/compile-fail/simd-type.rs +++ b/src/test/ui/compile-fail-migration/simd-type.rs diff --git a/src/test/ui/compile-fail-migration/simd-type.stderr b/src/test/ui/compile-fail-migration/simd-type.stderr new file mode 100644 index 00000000000..5899f4aacc0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/simd-type.stderr @@ -0,0 +1,22 @@ +error[E0075]: SIMD vector cannot be empty + --> $DIR/simd-type.rs:14:1 + | +LL | struct empty; //~ ERROR SIMD vector cannot be empty + | ^^^^^^^^^^^^^ + +error[E0076]: SIMD vector should be homogeneous + --> $DIR/simd-type.rs:17:1 + | +LL | struct i64f64(i64, f64); //~ ERROR SIMD vector should be homogeneous + | ^^^^^^^^^^^^^^^^^^^^^^^^ SIMD elements must have the same type + +error[E0077]: SIMD vector element type should be machine type + --> $DIR/simd-type.rs:20:1 + | +LL | struct int4(isize, isize, isize, isize); //~ ERROR SIMD vector element type should be machine type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0075, E0076, E0077. +For more information about an error, try `rustc --explain E0075`. diff --git a/src/test/compile-fail/single-primitive-inherent-impl.rs b/src/test/ui/compile-fail-migration/single-primitive-inherent-impl.rs index 0a0f9ce4bd1..0a0f9ce4bd1 100644 --- a/src/test/compile-fail/single-primitive-inherent-impl.rs +++ b/src/test/ui/compile-fail-migration/single-primitive-inherent-impl.rs diff --git a/src/test/ui/compile-fail-migration/single-primitive-inherent-impl.stderr b/src/test/ui/compile-fail-migration/single-primitive-inherent-impl.stderr new file mode 100644 index 00000000000..b781ee866c0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/single-primitive-inherent-impl.stderr @@ -0,0 +1,19 @@ +error[E0390]: only a single inherent implementation marked with `#[lang = "str"]` is allowed for the `str` primitive + --> $DIR/single-primitive-inherent-impl.rs:21:1 + | +LL | / impl str { +LL | | //~^ error: only a single inherent implementation marked with `#[lang = "str"]` is allowed for the `str` primitive +LL | | } + | |_^ + | +help: consider using a trait to implement these methods + --> $DIR/single-primitive-inherent-impl.rs:21:1 + | +LL | / impl str { +LL | | //~^ error: only a single inherent implementation marked with `#[lang = "str"]` is allowed for the `str` primitive +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0390`. diff --git a/src/test/compile-fail/sized-cycle-note.rs b/src/test/ui/compile-fail-migration/sized-cycle-note.rs index 712b4ac22f0..712b4ac22f0 100644 --- a/src/test/compile-fail/sized-cycle-note.rs +++ b/src/test/ui/compile-fail-migration/sized-cycle-note.rs diff --git a/src/test/ui/compile-fail-migration/sized-cycle-note.stderr b/src/test/ui/compile-fail-migration/sized-cycle-note.stderr new file mode 100644 index 00000000000..96657152038 --- /dev/null +++ b/src/test/ui/compile-fail-migration/sized-cycle-note.stderr @@ -0,0 +1,23 @@ +error[E0072]: recursive type `Baz` has infinite size + --> $DIR/sized-cycle-note.rs:19:1 + | +LL | struct Baz { q: Option<Foo> } + | ^^^^^^^^^^ -------------- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Baz` representable + +error[E0072]: recursive type `Foo` has infinite size + --> $DIR/sized-cycle-note.rs:21:1 + | +LL | struct Foo { q: Option<Baz> } + | ^^^^^^^^^^ -------------- recursive without indirection + | | + | recursive type has infinite size + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Foo` representable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/compile-fail/slice-2.rs b/src/test/ui/compile-fail-migration/slice-2.rs index 44b9d94c566..44b9d94c566 100644 --- a/src/test/compile-fail/slice-2.rs +++ b/src/test/ui/compile-fail-migration/slice-2.rs diff --git a/src/test/ui/compile-fail-migration/slice-2.stderr b/src/test/ui/compile-fail-migration/slice-2.stderr new file mode 100644 index 00000000000..e0f34daf513 --- /dev/null +++ b/src/test/ui/compile-fail-migration/slice-2.stderr @@ -0,0 +1,27 @@ +error[E0608]: cannot index into a value of type `Foo` + --> $DIR/slice-2.rs:17:6 + | +LL | &x[..]; //~ ERROR cannot index into a value of type `Foo` + | ^^^^^ + +error[E0608]: cannot index into a value of type `Foo` + --> $DIR/slice-2.rs:18:6 + | +LL | &x[Foo..]; //~ ERROR cannot index into a value of type `Foo` + | ^^^^^^^^ + +error[E0608]: cannot index into a value of type `Foo` + --> $DIR/slice-2.rs:19:6 + | +LL | &x[..Foo]; //~ ERROR cannot index into a value of type `Foo` + | ^^^^^^^^ + +error[E0608]: cannot index into a value of type `Foo` + --> $DIR/slice-2.rs:20:6 + | +LL | &x[Foo..Foo]; //~ ERROR cannot index into a value of type `Foo` + | ^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0608`. diff --git a/src/test/ui/compile-fail-migration/slice-mut-2.nll.stderr b/src/test/ui/compile-fail-migration/slice-mut-2.nll.stderr new file mode 100644 index 00000000000..98d9297e112 --- /dev/null +++ b/src/test/ui/compile-fail-migration/slice-mut-2.nll.stderr @@ -0,0 +1,12 @@ +error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference + --> $DIR/slice-mut-2.rs:17:18 + | +LL | let x: &[isize] = &[1, 2, 3, 4, 5]; + | ---------------- help: consider changing this to be a mutable reference: `&mut [1, 2, 3, 4, 5]` +... +LL | let _ = &mut x[2..4]; //~ERROR cannot borrow immutable borrowed content `*x` as mutable + | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/slice-mut-2.rs b/src/test/ui/compile-fail-migration/slice-mut-2.rs index e20e968a012..e20e968a012 100644 --- a/src/test/compile-fail/slice-mut-2.rs +++ b/src/test/ui/compile-fail-migration/slice-mut-2.rs diff --git a/src/test/ui/compile-fail-migration/slice-mut-2.stderr b/src/test/ui/compile-fail-migration/slice-mut-2.stderr new file mode 100644 index 00000000000..4483c6f1a8a --- /dev/null +++ b/src/test/ui/compile-fail-migration/slice-mut-2.stderr @@ -0,0 +1,9 @@ +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable + --> $DIR/slice-mut-2.rs:17:18 + | +LL | let _ = &mut x[2..4]; //~ERROR cannot borrow immutable borrowed content `*x` as mutable + | ^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/slice-mut.rs b/src/test/ui/compile-fail-migration/slice-mut.rs index bee3704a353..bee3704a353 100644 --- a/src/test/compile-fail/slice-mut.rs +++ b/src/test/ui/compile-fail-migration/slice-mut.rs diff --git a/src/test/ui/compile-fail-migration/slice-mut.stderr b/src/test/ui/compile-fail-migration/slice-mut.stderr new file mode 100644 index 00000000000..59b70959d86 --- /dev/null +++ b/src/test/ui/compile-fail-migration/slice-mut.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/slice-mut.rs:17:22 + | +LL | let y: &mut[_] = &x[2..4]; + | ^^^^^^^^ types differ in mutability + | + = note: expected type `&mut [_]` + found type `&[isize]` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/slightly-nice-generic-literal-messages.rs b/src/test/ui/compile-fail-migration/slightly-nice-generic-literal-messages.rs index 2eba7c2e534..2eba7c2e534 100644 --- a/src/test/compile-fail/slightly-nice-generic-literal-messages.rs +++ b/src/test/ui/compile-fail-migration/slightly-nice-generic-literal-messages.rs diff --git a/src/test/ui/compile-fail-migration/slightly-nice-generic-literal-messages.stderr b/src/test/ui/compile-fail-migration/slightly-nice-generic-literal-messages.stderr new file mode 100644 index 00000000000..463eb98b4ee --- /dev/null +++ b/src/test/ui/compile-fail-migration/slightly-nice-generic-literal-messages.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/slightly-nice-generic-literal-messages.rs:17:9 + | +LL | 1 => {} + | ^ expected struct `Foo`, found integral variable + | + = note: expected type `Foo<{float}, _>` + found type `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/specialization/README.md b/src/test/ui/compile-fail-migration/specialization/README.md index f2b4bf946c5..f2b4bf946c5 100644 --- a/src/test/compile-fail/specialization/README.md +++ b/src/test/ui/compile-fail-migration/specialization/README.md diff --git a/src/test/compile-fail/specialization/defaultimpl/specialization-feature-gate-default.rs b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-feature-gate-default.rs index 5bab4c5438e..5bab4c5438e 100644 --- a/src/test/compile-fail/specialization/defaultimpl/specialization-feature-gate-default.rs +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-feature-gate-default.rs diff --git a/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-feature-gate-default.stderr b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-feature-gate-default.stderr new file mode 100644 index 00000000000..d92466967e1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-feature-gate-default.stderr @@ -0,0 +1,13 @@ +error[E0658]: specialization is unstable (see issue #31844) + --> $DIR/specialization-feature-gate-default.rs:17:1 + | +LL | / default impl<T> Foo for T { //~ ERROR specialization is unstable +LL | | fn foo(&self) {} +LL | | } + | |_^ + | + = help: add #![feature(specialization)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/specialization/defaultimpl/specialization-no-default.rs b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-no-default.rs index 2874108157d..2874108157d 100644 --- a/src/test/compile-fail/specialization/defaultimpl/specialization-no-default.rs +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-no-default.rs diff --git a/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-no-default.stderr b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-no-default.stderr new file mode 100644 index 00000000000..98f5e6d619e --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-no-default.stderr @@ -0,0 +1,70 @@ +error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:32:5 + | +LL | / impl<T> Foo for T { +LL | | fn foo(&self) {} +LL | | fn bar(&self) {} +LL | | } + | |_- parent `impl` is here +... +LL | fn foo(&self) {} //~ ERROR E0520 + | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo` + | + = note: to specialize, `foo` in the parent `impl` must be marked `default` + +error[E0520]: `bar` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:35:5 + | +LL | / impl<T> Foo for T { +LL | | fn foo(&self) {} +LL | | fn bar(&self) {} +LL | | } + | |_- parent `impl` is here +... +LL | fn bar(&self) {} //~ ERROR E0520 + | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar` + | + = note: to specialize, `bar` in the parent `impl` must be marked `default` + +error[E0520]: `T` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:51:5 + | +LL | / impl<T> Bar for T { +LL | | type T = u8; +LL | | } + | |_- parent `impl` is here +... +LL | type T = (); //~ ERROR E0520 + | ^^^^^^^^^^^^ cannot specialize default item `T` + | + = note: to specialize, `T` in the parent `impl` must be marked `default` + +error[E0520]: `baz` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:71:5 + | +LL | / impl<T: Clone> Baz for T { +LL | | fn baz(&self) {} +LL | | } + | |_- parent `impl` is here +... +LL | fn baz(&self) {} //~ ERROR E0520 + | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz` + | + = note: to specialize, `baz` in the parent `impl` must be marked `default` + +error[E0520]: `redundant` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:92:5 + | +LL | / impl<T: Clone> Redundant for T { +LL | | fn redundant(&self) {} +LL | | } + | |_- parent `impl` is here +... +LL | fn redundant(&self) {} //~ ERROR E0520 + | ^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant` + | + = note: to specialize, `redundant` in the parent `impl` must be marked `default` + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0520`. diff --git a/src/test/compile-fail/specialization/defaultimpl/specialization-trait-item-not-implemented.rs b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-item-not-implemented.rs index eacec2e40f0..eacec2e40f0 100644 --- a/src/test/compile-fail/specialization/defaultimpl/specialization-trait-item-not-implemented.rs +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-item-not-implemented.rs diff --git a/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr new file mode 100644 index 00000000000..c3c2a9840ad --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr @@ -0,0 +1,12 @@ +error[E0046]: not all trait items implemented, missing: `foo_two` + --> $DIR/specialization-trait-item-not-implemented.rs:28:1 + | +LL | fn foo_two(&self) -> &'static str; + | ---------------------------------- `foo_two` from trait +... +LL | impl Foo for MyStruct {} + | ^^^^^^^^^^^^^^^^^^^^^ missing `foo_two` in implementation + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0046`. diff --git a/src/test/compile-fail/specialization/defaultimpl/specialization-trait-not-implemented.rs b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-not-implemented.rs index 04ddf9ebb17..04ddf9ebb17 100644 --- a/src/test/compile-fail/specialization/defaultimpl/specialization-trait-not-implemented.rs +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-not-implemented.rs diff --git a/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-not-implemented.stderr b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-not-implemented.stderr new file mode 100644 index 00000000000..bc597e9f30c --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-trait-not-implemented.stderr @@ -0,0 +1,18 @@ +error[E0599]: no method named `foo_one` found for type `MyStruct` in the current scope + --> $DIR/specialization-trait-not-implemented.rs:32:29 + | +LL | struct MyStruct; + | ---------------- method `foo_one` not found for this +... +LL | println!("{}", MyStruct.foo_one()); + | ^^^^^^^ + | + = note: the method `foo_one` exists but the following trait bounds were not satisfied: + `MyStruct : Foo` + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `foo_one`, perhaps you need to implement it: + candidate #1: `Foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/specialization/defaultimpl/specialization-wfcheck.rs b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-wfcheck.rs index 445a59a373e..445a59a373e 100644 --- a/src/test/compile-fail/specialization/defaultimpl/specialization-wfcheck.rs +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-wfcheck.rs diff --git a/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-wfcheck.stderr b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-wfcheck.stderr new file mode 100644 index 00000000000..a623e9708cd --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/specialization-wfcheck.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `U: std::cmp::Eq` is not satisfied + --> $DIR/specialization-wfcheck.rs:17:17 + | +LL | default impl<U> Foo<'static, U> for () {} + | ^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `U` + | + = help: consider adding a `where U: std::cmp::Eq` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/specialization/defaultimpl/validation.rs b/src/test/ui/compile-fail-migration/specialization/defaultimpl/validation.rs index 26b8b737f34..26b8b737f34 100644 --- a/src/test/compile-fail/specialization/defaultimpl/validation.rs +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/validation.rs diff --git a/src/test/ui/compile-fail-migration/specialization/defaultimpl/validation.stderr b/src/test/ui/compile-fail-migration/specialization/defaultimpl/validation.stderr new file mode 100644 index 00000000000..54b92da7b21 --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/defaultimpl/validation.stderr @@ -0,0 +1,34 @@ +error: inherent impls cannot be default + --> $DIR/validation.rs:17:1 + | +LL | default impl S {} //~ ERROR inherent impls cannot be default + | ^^^^^^^^^^^^^^^^^ + | + = note: only trait implementations may be annotated with default + +error[E0601]: `main` function not found in crate `validation` + | + = note: consider adding a `main` function to `$DIR/validation.rs` + +error: impls of auto traits cannot be default + --> $DIR/validation.rs:19:1 + | +LL | default unsafe impl Send for S {} //~ ERROR impls of auto traits cannot be default + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: impls of auto traits cannot be default + --> $DIR/validation.rs:20:1 + | +LL | default impl !Send for Z {} //~ ERROR impls of auto traits cannot be default + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0192]: negative impls are only allowed for auto traits (e.g., `Send` and `Sync`) + --> $DIR/validation.rs:23:1 + | +LL | default impl !Tr for S {} //~ ERROR negative impls are only allowed for auto traits + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0192, E0601. +For more information about an error, try `rustc --explain E0192`. diff --git a/src/test/compile-fail/specialization/issue-52050.rs b/src/test/ui/compile-fail-migration/specialization/issue-52050.rs index 70cdb4899c4..70cdb4899c4 100644 --- a/src/test/compile-fail/specialization/issue-52050.rs +++ b/src/test/ui/compile-fail-migration/specialization/issue-52050.rs diff --git a/src/test/ui/compile-fail-migration/specialization/issue-52050.stderr b/src/test/ui/compile-fail-migration/specialization/issue-52050.stderr new file mode 100644 index 00000000000..eee571f8f46 --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/issue-52050.stderr @@ -0,0 +1,18 @@ +error[E0119]: conflicting implementations of trait `IntoPyDictPointer` for type `()`: + --> $DIR/issue-52050.rs:38:1 + | +LL | / impl<I> IntoPyDictPointer for I +LL | | where +LL | | I: Iterator, +LL | | { +LL | | } + | |_- first implementation here +LL | +LL | impl IntoPyDictPointer for () //~ ERROR conflicting implementations + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()` + | + = note: upstream crates may add new impl of trait `std::iter::Iterator` for type `()` in future versions + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/specialization/specialization-default-projection.rs b/src/test/ui/compile-fail-migration/specialization/specialization-default-projection.rs index 96cbd7a4852..96cbd7a4852 100644 --- a/src/test/compile-fail/specialization/specialization-default-projection.rs +++ b/src/test/ui/compile-fail-migration/specialization/specialization-default-projection.rs diff --git a/src/test/ui/compile-fail-migration/specialization/specialization-default-projection.stderr b/src/test/ui/compile-fail-migration/specialization/specialization-default-projection.stderr new file mode 100644 index 00000000000..38b51394711 --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/specialization-default-projection.stderr @@ -0,0 +1,29 @@ +error[E0308]: mismatched types + --> $DIR/specialization-default-projection.rs:31:5 + | +LL | fn generic<T>() -> <T as Foo>::Assoc { + | ----------------- expected `<T as Foo>::Assoc` because of return type +... +LL | () //~ ERROR mismatched types + | ^^ expected associated type, found () + | + = note: expected type `<T as Foo>::Assoc` + found type `()` + +error[E0308]: mismatched types + --> $DIR/specialization-default-projection.rs:38:5 + | +LL | fn monomorphic() -> () { + | -- expected `()` because of return type +... +LL | generic::<()>() //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^- help: try adding a semicolon: `;` + | | + | expected (), found associated type + | + = note: expected type `()` + found type `<() as Foo>::Assoc` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/specialization/specialization-default-types.rs b/src/test/ui/compile-fail-migration/specialization/specialization-default-types.rs index 18acecb4229..18acecb4229 100644 --- a/src/test/compile-fail/specialization/specialization-default-types.rs +++ b/src/test/ui/compile-fail-migration/specialization/specialization-default-types.rs diff --git a/src/test/ui/compile-fail-migration/specialization/specialization-default-types.stderr b/src/test/ui/compile-fail-migration/specialization/specialization-default-types.stderr new file mode 100644 index 00000000000..a9abc1f6ab5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/specialization-default-types.stderr @@ -0,0 +1,25 @@ +error[E0308]: mismatched types + --> $DIR/specialization-default-types.rs:25:9 + | +LL | default fn generate(self) -> Self::Output { + | ------------ expected `<T as Example>::Output` because of return type +LL | Box::new(self) //~ ERROR mismatched types + | ^^^^^^^^^^^^^^ expected associated type, found struct `std::boxed::Box` + | + = note: expected type `<T as Example>::Output` + found type `std::boxed::Box<T>` + +error[E0308]: mismatched types + --> $DIR/specialization-default-types.rs:35:5 + | +LL | fn trouble<T>(t: T) -> Box<T> { + | ------ expected `std::boxed::Box<T>` because of return type +LL | Example::generate(t) //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^ expected struct `std::boxed::Box`, found associated type + | + = note: expected type `std::boxed::Box<T>` + found type `<T as Example>::Output` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/specialization/specialization-no-default.rs b/src/test/ui/compile-fail-migration/specialization/specialization-no-default.rs index 96156168543..96156168543 100644 --- a/src/test/compile-fail/specialization/specialization-no-default.rs +++ b/src/test/ui/compile-fail-migration/specialization/specialization-no-default.rs diff --git a/src/test/ui/compile-fail-migration/specialization/specialization-no-default.stderr b/src/test/ui/compile-fail-migration/specialization/specialization-no-default.stderr new file mode 100644 index 00000000000..880c2e5d6f4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/specialization-no-default.stderr @@ -0,0 +1,70 @@ +error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:32:5 + | +LL | / impl<T> Foo for T { +LL | | fn foo(&self) {} +LL | | fn bar(&self) {} +LL | | } + | |_- parent `impl` is here +... +LL | fn foo(&self) {} //~ ERROR E0520 + | ^^^^^^^^^^^^^^^^ cannot specialize default item `foo` + | + = note: to specialize, `foo` in the parent `impl` must be marked `default` + +error[E0520]: `bar` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:35:5 + | +LL | / impl<T> Foo for T { +LL | | fn foo(&self) {} +LL | | fn bar(&self) {} +LL | | } + | |_- parent `impl` is here +... +LL | fn bar(&self) {} //~ ERROR E0520 + | ^^^^^^^^^^^^^^^^ cannot specialize default item `bar` + | + = note: to specialize, `bar` in the parent `impl` must be marked `default` + +error[E0520]: `T` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:51:5 + | +LL | / impl<T> Bar for T { +LL | | type T = u8; +LL | | } + | |_- parent `impl` is here +... +LL | type T = (); //~ ERROR E0520 + | ^^^^^^^^^^^^ cannot specialize default item `T` + | + = note: to specialize, `T` in the parent `impl` must be marked `default` + +error[E0520]: `baz` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:71:5 + | +LL | / impl<T: Clone> Baz for T { +LL | | fn baz(&self) {} +LL | | } + | |_- parent `impl` is here +... +LL | fn baz(&self) {} //~ ERROR E0520 + | ^^^^^^^^^^^^^^^^ cannot specialize default item `baz` + | + = note: to specialize, `baz` in the parent `impl` must be marked `default` + +error[E0520]: `redundant` specializes an item from a parent `impl`, but that item is not marked `default` + --> $DIR/specialization-no-default.rs:92:5 + | +LL | / impl<T: Clone> Redundant for T { +LL | | fn redundant(&self) {} +LL | | } + | |_- parent `impl` is here +... +LL | default fn redundant(&self) {} //~ ERROR E0520 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot specialize default item `redundant` + | + = note: to specialize, `redundant` in the parent `impl` must be marked `default` + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0520`. diff --git a/src/test/compile-fail/specialization/specialization-overlap-negative.rs b/src/test/ui/compile-fail-migration/specialization/specialization-overlap-negative.rs index 62a6d8d9b50..62a6d8d9b50 100644 --- a/src/test/compile-fail/specialization/specialization-overlap-negative.rs +++ b/src/test/ui/compile-fail-migration/specialization/specialization-overlap-negative.rs diff --git a/src/test/ui/compile-fail-migration/specialization/specialization-overlap-negative.stderr b/src/test/ui/compile-fail-migration/specialization/specialization-overlap-negative.stderr new file mode 100644 index 00000000000..2b85ba54e90 --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/specialization-overlap-negative.stderr @@ -0,0 +1,11 @@ +error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>`: + --> $DIR/specialization-overlap-negative.rs:19:1 + | +LL | unsafe impl<T: Clone> Send for TestType<T> {} + | ------------------------------------------ first implementation here +LL | impl<T: MyTrait> !Send for TestType<T> {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/specialization/specialization-overlap.rs b/src/test/ui/compile-fail-migration/specialization/specialization-overlap.rs index ff12a82db5b..ff12a82db5b 100644 --- a/src/test/compile-fail/specialization/specialization-overlap.rs +++ b/src/test/ui/compile-fail-migration/specialization/specialization-overlap.rs diff --git a/src/test/ui/compile-fail-migration/specialization/specialization-overlap.stderr b/src/test/ui/compile-fail-migration/specialization/specialization-overlap.stderr new file mode 100644 index 00000000000..6830b7de473 --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/specialization-overlap.stderr @@ -0,0 +1,35 @@ +error[E0119]: conflicting implementations of trait `Foo` for type `std::vec::Vec<_>`: + --> $DIR/specialization-overlap.rs:15:1 + | +LL | impl<T: Clone> Foo for T {} + | ------------------------ first implementation here +LL | impl<T> Foo for Vec<T> {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::vec::Vec<_>` + +error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`: + --> $DIR/specialization-overlap.rs:19:1 + | +LL | impl<T> Bar for (T, u8) {} + | ----------------------- first implementation here +LL | impl<T> Bar for (u8, T) {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)` + +error[E0119]: conflicting implementations of trait `Baz<u8>` for type `u8`: + --> $DIR/specialization-overlap.rs:23:1 + | +LL | impl<T> Baz<T> for u8 {} + | --------------------- first implementation here +LL | impl<T> Baz<u8> for T {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8` + +error[E0119]: conflicting implementations of trait `Qux`: + --> $DIR/specialization-overlap.rs:27:1 + | +LL | impl<T: Clone> Qux for T {} + | ------------------------ first implementation here +LL | impl<T: Eq> Qux for T {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/specialization/specialization-polarity.rs b/src/test/ui/compile-fail-migration/specialization/specialization-polarity.rs index b28a63c8293..b28a63c8293 100644 --- a/src/test/compile-fail/specialization/specialization-polarity.rs +++ b/src/test/ui/compile-fail-migration/specialization/specialization-polarity.rs diff --git a/src/test/ui/compile-fail-migration/specialization/specialization-polarity.stderr b/src/test/ui/compile-fail-migration/specialization/specialization-polarity.stderr new file mode 100644 index 00000000000..a4627305885 --- /dev/null +++ b/src/test/ui/compile-fail-migration/specialization/specialization-polarity.stderr @@ -0,0 +1,19 @@ +error[E0119]: conflicting implementations of trait `Foo` for type `u8`: + --> $DIR/specialization-polarity.rs:19:1 + | +LL | impl<T> Foo for T {} + | ----------------- first implementation here +LL | impl !Foo for u8 {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^ conflicting implementation for `u8` + +error[E0119]: conflicting implementations of trait `Bar` for type `u8`: + --> $DIR/specialization-polarity.rs:24:1 + | +LL | impl<T> !Bar for T {} + | ------------------ first implementation here +LL | impl Bar for u8 {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^ conflicting implementation for `u8` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/compile-fail/stability-attribute-issue-43027.rs b/src/test/ui/compile-fail-migration/stability-attribute-issue-43027.rs index dac50db3fd9..dac50db3fd9 100644 --- a/src/test/compile-fail/stability-attribute-issue-43027.rs +++ b/src/test/ui/compile-fail-migration/stability-attribute-issue-43027.rs diff --git a/src/test/ui/compile-fail-migration/stability-attribute-issue-43027.stderr b/src/test/ui/compile-fail-migration/stability-attribute-issue-43027.stderr new file mode 100644 index 00000000000..bdfdd9ccc87 --- /dev/null +++ b/src/test/ui/compile-fail-migration/stability-attribute-issue-43027.stderr @@ -0,0 +1,8 @@ +error: This node does not have a stability attribute + --> $DIR/stability-attribute-issue-43027.rs:15:23 + | +LL | pub struct Reverse<T>(pub T); //~ ERROR This node does not have a stability attribute + | ^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/stability-attribute-issue.rs b/src/test/ui/compile-fail-migration/stability-attribute-issue.rs index 754c6f792f9..754c6f792f9 100644 --- a/src/test/compile-fail/stability-attribute-issue.rs +++ b/src/test/ui/compile-fail-migration/stability-attribute-issue.rs diff --git a/src/test/ui/compile-fail-migration/stability-attribute-issue.stderr b/src/test/ui/compile-fail-migration/stability-attribute-issue.stderr new file mode 100644 index 00000000000..15e91926a73 --- /dev/null +++ b/src/test/ui/compile-fail-migration/stability-attribute-issue.stderr @@ -0,0 +1,19 @@ +error[E0658]: use of unstable library feature 'unstable_test_feature' (see issue #1) + --> $DIR/stability-attribute-issue.rs:20:5 + | +LL | unstable(); + | ^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error[E0658]: use of unstable library feature 'unstable_test_feature': message (see issue #2) + --> $DIR/stability-attribute-issue.rs:22:5 + | +LL | unstable_msg(); + | ^^^^^^^^^^^^ + | + = help: add #![feature(unstable_test_feature)] to the crate attributes to enable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/stability-attribute-non-staged-force-unstable.rs b/src/test/ui/compile-fail-migration/stability-attribute-non-staged-force-unstable.rs index 512fb24a0c2..512fb24a0c2 100644 --- a/src/test/compile-fail/stability-attribute-non-staged-force-unstable.rs +++ b/src/test/ui/compile-fail-migration/stability-attribute-non-staged-force-unstable.rs diff --git a/src/test/ui/compile-fail-migration/stability-attribute-non-staged-force-unstable.stderr b/src/test/ui/compile-fail-migration/stability-attribute-non-staged-force-unstable.stderr new file mode 100644 index 00000000000..479f2ff5095 --- /dev/null +++ b/src/test/ui/compile-fail-migration/stability-attribute-non-staged-force-unstable.stderr @@ -0,0 +1,20 @@ +error: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged-force-unstable.rs:13:1 + | +LL | #[unstable] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^ + +error: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged-force-unstable.rs:14:1 + | +LL | #[stable] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^ + +error: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged-force-unstable.rs:15:1 + | +LL | #[rustc_deprecated] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/stability-attribute-non-staged.rs b/src/test/ui/compile-fail-migration/stability-attribute-non-staged.rs index 35256f21f92..35256f21f92 100644 --- a/src/test/compile-fail/stability-attribute-non-staged.rs +++ b/src/test/ui/compile-fail-migration/stability-attribute-non-staged.rs diff --git a/src/test/ui/compile-fail-migration/stability-attribute-non-staged.stderr b/src/test/ui/compile-fail-migration/stability-attribute-non-staged.stderr new file mode 100644 index 00000000000..f2a9879bd10 --- /dev/null +++ b/src/test/ui/compile-fail-migration/stability-attribute-non-staged.stderr @@ -0,0 +1,20 @@ +error: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged.rs:11:1 + | +LL | #[unstable] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^ + +error: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged.rs:12:1 + | +LL | #[stable] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^ + +error: stability attributes may not be used outside of the standard library + --> $DIR/stability-attribute-non-staged.rs:13:1 + | +LL | #[rustc_deprecated] //~ ERROR: stability attributes may not be used + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/stability-attribute-sanity-2.rs b/src/test/ui/compile-fail-migration/stability-attribute-sanity-2.rs index 9c54315bfd0..9c54315bfd0 100644 --- a/src/test/compile-fail/stability-attribute-sanity-2.rs +++ b/src/test/ui/compile-fail-migration/stability-attribute-sanity-2.rs diff --git a/src/test/ui/compile-fail-migration/stability-attribute-sanity-2.stderr b/src/test/ui/compile-fail-migration/stability-attribute-sanity-2.stderr new file mode 100644 index 00000000000..a9d70e25302 --- /dev/null +++ b/src/test/ui/compile-fail-migration/stability-attribute-sanity-2.stderr @@ -0,0 +1,22 @@ +error[E0538]: multiple 'feature' items + --> $DIR/stability-attribute-sanity-2.rs:17:25 + | +LL | #[stable(feature = "a", feature = "b", since = "1.0.0")] //~ ERROR multiple 'feature' items + | ^^^^^^^^^^^^^ + +error[E0541]: unknown meta item 'sinse' + --> $DIR/stability-attribute-sanity-2.rs:20:25 + | +LL | #[stable(feature = "a", sinse = "1.0.0")] //~ ERROR unknown meta item 'sinse' + | ^^^^^^^^^^^^^^^ expected one of `since`, `note` + +error[E0545]: incorrect 'issue' + --> $DIR/stability-attribute-sanity-2.rs:23:1 + | +LL | #[unstable(feature = "a", issue = "no")] //~ ERROR incorrect 'issue' + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +Some errors occurred: E0538, E0541, E0545. +For more information about an error, try `rustc --explain E0538`. diff --git a/src/test/compile-fail/stability-attribute-sanity-3.rs b/src/test/ui/compile-fail-migration/stability-attribute-sanity-3.rs index d4821e009f2..d4821e009f2 100644 --- a/src/test/compile-fail/stability-attribute-sanity-3.rs +++ b/src/test/ui/compile-fail-migration/stability-attribute-sanity-3.rs diff --git a/src/test/ui/compile-fail-migration/stability-attribute-sanity-3.stderr b/src/test/ui/compile-fail-migration/stability-attribute-sanity-3.stderr new file mode 100644 index 00000000000..b5b5847e8e1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/stability-attribute-sanity-3.stderr @@ -0,0 +1,10 @@ +error: This node does not have a stability attribute + --> $DIR/stability-attribute-sanity-3.rs:18:1 + | +LL | / macro_rules! mac { //~ ERROR This node does not have a stability attribute +LL | | () => () +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/stability-attribute-sanity.rs b/src/test/ui/compile-fail-migration/stability-attribute-sanity.rs index 794ae1ca087..794ae1ca087 100644 --- a/src/test/compile-fail/stability-attribute-sanity.rs +++ b/src/test/ui/compile-fail-migration/stability-attribute-sanity.rs diff --git a/src/test/ui/compile-fail-migration/stability-attribute-sanity.stderr b/src/test/ui/compile-fail-migration/stability-attribute-sanity.stderr new file mode 100644 index 00000000000..f9d301f643d --- /dev/null +++ b/src/test/ui/compile-fail-migration/stability-attribute-sanity.stderr @@ -0,0 +1,142 @@ +error[E0541]: unknown meta item 'reason' + --> $DIR/stability-attribute-sanity.rs:18:42 + | +LL | #[stable(feature = "a", since = "b", reason)] //~ ERROR unknown meta item 'reason' [E0541] + | ^^^^^^ expected one of `since`, `note` + +error[E0539]: incorrect meta item + --> $DIR/stability-attribute-sanity.rs:21:29 + | +LL | #[stable(feature = "a", since)] //~ ERROR incorrect meta item [E0539] + | ^^^^^ + +error[E0539]: incorrect meta item + --> $DIR/stability-attribute-sanity.rs:24:14 + | +LL | #[stable(feature, since = "a")] //~ ERROR incorrect meta item [E0539] + | ^^^^^^^ + +error[E0539]: incorrect meta item + --> $DIR/stability-attribute-sanity.rs:27:29 + | +LL | #[stable(feature = "a", since(b))] //~ ERROR incorrect meta item [E0539] + | ^^^^^^^^ + +error[E0539]: incorrect meta item + --> $DIR/stability-attribute-sanity.rs:30:14 + | +LL | #[stable(feature(b), since = "a")] //~ ERROR incorrect meta item [E0539] + | ^^^^^^^^^^ + +error[E0548]: incorrect stability attribute type + --> $DIR/stability-attribute-sanity.rs:35:5 + | +LL | #[unstable] //~ ERROR incorrect stability attribute type [E0548] + | ^^^^^^^^^^^ + +error[E0548]: incorrect stability attribute type + --> $DIR/stability-attribute-sanity.rs:38:5 + | +LL | #[unstable = "b"] //~ ERROR incorrect stability attribute type [E0548] + | ^^^^^^^^^^^^^^^^^ + +error[E0548]: incorrect stability attribute type + --> $DIR/stability-attribute-sanity.rs:41:5 + | +LL | #[stable] //~ ERROR incorrect stability attribute type [E0548] + | ^^^^^^^^^ + +error[E0548]: incorrect stability attribute type + --> $DIR/stability-attribute-sanity.rs:44:5 + | +LL | #[stable = "a"] //~ ERROR incorrect stability attribute type [E0548] + | ^^^^^^^^^^^^^^^ + +error[E0548]: incorrect stability attribute type + --> $DIR/stability-attribute-sanity.rs:48:5 + | +LL | #[rustc_deprecated] //~ ERROR incorrect stability attribute type [E0548] + | ^^^^^^^^^^^^^^^^^^^ + +error[E0548]: incorrect stability attribute type + --> $DIR/stability-attribute-sanity.rs:52:5 + | +LL | #[rustc_deprecated = "a"] //~ ERROR incorrect stability attribute type [E0548] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0546]: missing 'feature' + --> $DIR/stability-attribute-sanity.rs:57:5 + | +LL | #[unstable(issue = "0")] //~ ERROR missing 'feature' [E0546] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0547]: missing 'issue' + --> $DIR/stability-attribute-sanity.rs:60:5 + | +LL | #[unstable(feature = "b")] //~ ERROR missing 'issue' [E0547] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0546]: missing 'feature' + --> $DIR/stability-attribute-sanity.rs:63:5 + | +LL | #[stable(since = "a")] //~ ERROR missing 'feature' [E0546] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/stability-attribute-sanity.rs:68:5 + | +LL | #[stable(feature = "a")] //~ ERROR missing 'since' [E0542] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0542]: missing 'since' + --> $DIR/stability-attribute-sanity.rs:72:5 + | +LL | #[rustc_deprecated(reason = "a")] //~ ERROR missing 'since' [E0542] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0544]: multiple stability levels + --> $DIR/stability-attribute-sanity.rs:77:1 + | +LL | #[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0544]: multiple stability levels + --> $DIR/stability-attribute-sanity.rs:81:1 + | +LL | #[unstable(feature = "b", issue = "0")] //~ ERROR multiple stability levels [E0544] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0544]: multiple stability levels + --> $DIR/stability-attribute-sanity.rs:85:1 + | +LL | #[stable(feature = "a", since = "b")] //~ ERROR multiple stability levels [E0544] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0540]: multiple rustc_deprecated attributes + --> $DIR/stability-attribute-sanity.rs:93:1 + | +LL | pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0553]: multiple rustc_const_unstable attributes + --> $DIR/stability-attribute-sanity.rs:93:1 + | +LL | pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: Invalid stability or deprecation version found + --> $DIR/stability-attribute-sanity.rs:93:1 + | +LL | pub const fn multiple4() { } //~ ERROR multiple rustc_deprecated attributes [E0540] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0549]: rustc_deprecated attribute must be paired with either stable or unstable attribute + --> $DIR/stability-attribute-sanity.rs:98:1 + | +LL | fn deprecated_without_unstable_or_stable() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 23 previous errors + +Some errors occurred: E0539, E0540, E0541, E0542, E0544, E0546, E0547, E0548, E0549... +For more information about an error, try `rustc --explain E0539`. diff --git a/src/test/compile-fail/stable-features.rs b/src/test/ui/compile-fail-migration/stable-features.rs index 32991dd6499..32991dd6499 100644 --- a/src/test/compile-fail/stable-features.rs +++ b/src/test/ui/compile-fail-migration/stable-features.rs diff --git a/src/test/ui/compile-fail-migration/stable-features.stderr b/src/test/ui/compile-fail-migration/stable-features.stderr new file mode 100644 index 00000000000..53d642c07e6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/stable-features.stderr @@ -0,0 +1,20 @@ +error: the feature `test_accepted_feature` has been stable since 1.0.0 and no longer requires an attribute to enable + --> $DIR/stable-features.rs:16:12 + | +LL | #![feature(test_accepted_feature)] + | ^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/stable-features.rs:14:9 + | +LL | #![deny(stable_features)] + | ^^^^^^^^^^^^^^^ + +error: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable + --> $DIR/stable-features.rs:19:12 + | +LL | #![feature(rust1)] + | ^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/static-closures.rs b/src/test/ui/compile-fail-migration/static-closures.rs index 8593eb5333e..8593eb5333e 100644 --- a/src/test/compile-fail/static-closures.rs +++ b/src/test/ui/compile-fail-migration/static-closures.rs diff --git a/src/test/ui/compile-fail-migration/static-closures.stderr b/src/test/ui/compile-fail-migration/static-closures.stderr new file mode 100644 index 00000000000..761d8374bcc --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-closures.stderr @@ -0,0 +1,9 @@ +error[E0697]: closures cannot be static + --> $DIR/static-closures.rs:12:5 + | +LL | static || {}; + | ^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0697`. diff --git a/src/test/compile-fail/static-drop-scope.rs b/src/test/ui/compile-fail-migration/static-drop-scope.rs index e22eb7e4484..e22eb7e4484 100644 --- a/src/test/compile-fail/static-drop-scope.rs +++ b/src/test/ui/compile-fail-migration/static-drop-scope.rs diff --git a/src/test/ui/compile-fail-migration/static-drop-scope.stderr b/src/test/ui/compile-fail-migration/static-drop-scope.stderr new file mode 100644 index 00000000000..ce158239370 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-drop-scope.stderr @@ -0,0 +1,60 @@ +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/static-drop-scope.rs:19:60 + | +LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor); + | ^^^^^^^^ statics cannot evaluate destructors + +error[E0597]: borrowed value does not live long enough + --> $DIR/static-drop-scope.rs:19:60 + | +LL | static PROMOTION_FAIL_S: Option<&'static WithDtor> = Some(&WithDtor); + | ^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | + = note: borrowed value must be valid for the static lifetime... + +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/static-drop-scope.rs:23:59 + | +LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor); + | ^^^^^^^^ constants cannot evaluate destructors + +error[E0597]: borrowed value does not live long enough + --> $DIR/static-drop-scope.rs:23:59 + | +LL | const PROMOTION_FAIL_C: Option<&'static WithDtor> = Some(&WithDtor); + | ^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | + = note: borrowed value must be valid for the static lifetime... + +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/static-drop-scope.rs:27:28 + | +LL | static EARLY_DROP_S: i32 = (WithDtor, 0).1; + | ^^^^^^^^^^^^^ statics cannot evaluate destructors + +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/static-drop-scope.rs:30:27 + | +LL | const EARLY_DROP_C: i32 = (WithDtor, 0).1; + | ^^^^^^^^^^^^^ constants cannot evaluate destructors + +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/static-drop-scope.rs:33:24 + | +LL | const fn const_drop<T>(_: T) {} + | ^ constant functions cannot evaluate destructors + +error[E0493]: destructors cannot be evaluated at compile-time + --> $DIR/static-drop-scope.rs:37:5 + | +LL | (x, ()).1 + | ^^^^^^^ constant functions cannot evaluate destructors + +error: aborting due to 8 previous errors + +Some errors occurred: E0493, E0597. +For more information about an error, try `rustc --explain E0493`. diff --git a/src/test/compile-fail/static-items-cant-move.rs b/src/test/ui/compile-fail-migration/static-items-cant-move.rs index c8fddeb1214..c8fddeb1214 100644 --- a/src/test/compile-fail/static-items-cant-move.rs +++ b/src/test/ui/compile-fail-migration/static-items-cant-move.rs diff --git a/src/test/ui/compile-fail-migration/static-items-cant-move.stderr b/src/test/ui/compile-fail-migration/static-items-cant-move.stderr new file mode 100644 index 00000000000..254710b6b2e --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-items-cant-move.stderr @@ -0,0 +1,9 @@ +error[E0507]: cannot move out of static item + --> $DIR/static-items-cant-move.rs:28:10 + | +LL | test(BAR); //~ ERROR cannot move out of static item + | ^^^ cannot move out of static item + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/static-lifetime-bound.nll.stderr b/src/test/ui/compile-fail-migration/static-lifetime-bound.nll.stderr new file mode 100644 index 00000000000..ad4d04343fe --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-lifetime-bound.nll.stderr @@ -0,0 +1,21 @@ +warning: unnecessary lifetime parameter `'a` + --> $DIR/static-lifetime-bound.rs:11:6 + | +LL | fn f<'a: 'static>(_: &'a i32) {} //~WARN unnecessary lifetime parameter `'a` + | ^^^^^^^^^^^ + | + = help: you can use the `'static` lifetime directly, in place of `'a` + +error[E0597]: `x` does not live long enough + --> $DIR/static-lifetime-bound.rs:15:7 + | +LL | f(&x); //~ERROR does not live long enough + | ^^ borrowed value does not live long enough +LL | } + | - `x` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/static-lifetime-bound.rs b/src/test/ui/compile-fail-migration/static-lifetime-bound.rs index 38534ab0a36..38534ab0a36 100644 --- a/src/test/compile-fail/static-lifetime-bound.rs +++ b/src/test/ui/compile-fail-migration/static-lifetime-bound.rs diff --git a/src/test/ui/compile-fail-migration/static-lifetime-bound.stderr b/src/test/ui/compile-fail-migration/static-lifetime-bound.stderr new file mode 100644 index 00000000000..0ee2b665cf1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-lifetime-bound.stderr @@ -0,0 +1,21 @@ +warning: unnecessary lifetime parameter `'a` + --> $DIR/static-lifetime-bound.rs:11:6 + | +LL | fn f<'a: 'static>(_: &'a i32) {} //~WARN unnecessary lifetime parameter `'a` + | ^^^^^^^^^^^ + | + = help: you can use the `'static` lifetime directly, in place of `'a` + +error[E0597]: `x` does not live long enough + --> $DIR/static-lifetime-bound.rs:15:8 + | +LL | f(&x); //~ERROR does not live long enough + | ^ borrowed value does not live long enough +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/static-method-privacy.rs b/src/test/ui/compile-fail-migration/static-method-privacy.rs index 5e175aa0fee..5e175aa0fee 100644 --- a/src/test/compile-fail/static-method-privacy.rs +++ b/src/test/ui/compile-fail-migration/static-method-privacy.rs diff --git a/src/test/ui/compile-fail-migration/static-method-privacy.stderr b/src/test/ui/compile-fail-migration/static-method-privacy.stderr new file mode 100644 index 00000000000..783b72c8ed2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-method-privacy.stderr @@ -0,0 +1,9 @@ +error[E0624]: method `new` is private + --> $DIR/static-method-privacy.rs:19:13 + | +LL | let _ = a::S::new(); //~ ERROR method `new` is private + | ^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0624`. diff --git a/src/test/compile-fail/static-mut-bad-types.rs b/src/test/ui/compile-fail-migration/static-mut-bad-types.rs index 088c8ef3ab8..088c8ef3ab8 100644 --- a/src/test/compile-fail/static-mut-bad-types.rs +++ b/src/test/ui/compile-fail-migration/static-mut-bad-types.rs diff --git a/src/test/ui/compile-fail-migration/static-mut-bad-types.stderr b/src/test/ui/compile-fail-migration/static-mut-bad-types.stderr new file mode 100644 index 00000000000..f8bee22b181 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-mut-bad-types.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/static-mut-bad-types.rs:15:13 + | +LL | a = true; //~ ERROR: mismatched types + | ^^^^ expected isize, found bool + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/static-mut-foreign-requires-unsafe.rs b/src/test/ui/compile-fail-migration/static-mut-foreign-requires-unsafe.rs index c6d744fa64d..c6d744fa64d 100644 --- a/src/test/compile-fail/static-mut-foreign-requires-unsafe.rs +++ b/src/test/ui/compile-fail-migration/static-mut-foreign-requires-unsafe.rs diff --git a/src/test/ui/compile-fail-migration/static-mut-foreign-requires-unsafe.stderr b/src/test/ui/compile-fail-migration/static-mut-foreign-requires-unsafe.stderr new file mode 100644 index 00000000000..01cbe784b45 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-mut-foreign-requires-unsafe.stderr @@ -0,0 +1,27 @@ +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/static-mut-foreign-requires-unsafe.rs:16:5 + | +LL | a += 3; //~ ERROR: requires unsafe + | ^^^^^^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/static-mut-foreign-requires-unsafe.rs:17:5 + | +LL | a = 4; //~ ERROR: requires unsafe + | ^^^^^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/static-mut-foreign-requires-unsafe.rs:18:14 + | +LL | let _b = a; //~ ERROR: requires unsafe + | ^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/static-mut-not-constant.rs b/src/test/ui/compile-fail-migration/static-mut-not-constant.rs index 7e6ced12fe6..7e6ced12fe6 100644 --- a/src/test/compile-fail/static-mut-not-constant.rs +++ b/src/test/ui/compile-fail-migration/static-mut-not-constant.rs diff --git a/src/test/ui/compile-fail-migration/static-mut-not-constant.stderr b/src/test/ui/compile-fail-migration/static-mut-not-constant.stderr new file mode 100644 index 00000000000..ad44121e763 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-mut-not-constant.stderr @@ -0,0 +1,9 @@ +error[E0010]: allocations are not allowed in statics + --> $DIR/static-mut-not-constant.rs:13:28 + | +LL | static mut a: Box<isize> = box 3; + | ^^^^^ allocation not allowed in statics + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0010`. diff --git a/src/test/compile-fail/static-mut-not-pat.rs b/src/test/ui/compile-fail-migration/static-mut-not-pat.rs index 351a47fdf39..351a47fdf39 100644 --- a/src/test/compile-fail/static-mut-not-pat.rs +++ b/src/test/ui/compile-fail-migration/static-mut-not-pat.rs diff --git a/src/test/ui/compile-fail-migration/static-mut-not-pat.stderr b/src/test/ui/compile-fail-migration/static-mut-not-pat.stderr new file mode 100644 index 00000000000..123cf7b3ac6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-mut-not-pat.stderr @@ -0,0 +1,21 @@ +error[E0530]: match bindings cannot shadow statics + --> $DIR/static-mut-not-pat.rs:23:9 + | +LL | static mut a: isize = 3; + | ------------------------ a static `a` is defined here +... +LL | a => {} //~ ERROR match bindings cannot shadow statics + | ^ cannot be named the same as a static + +error[E0530]: match bindings cannot shadow statics + --> $DIR/static-mut-not-pat.rs:46:9 + | +LL | static mut STATIC_MUT_FOO: Foo = Foo { bar: Some(Direction::West), baz: NEW_FALSE }; + | ------------------------------------------------------------------------------------ a static `STATIC_MUT_FOO` is defined here +... +LL | STATIC_MUT_FOO => (), + | ^^^^^^^^^^^^^^ cannot be named the same as a static + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0530`. diff --git a/src/test/compile-fail/static-mut-requires-unsafe.rs b/src/test/ui/compile-fail-migration/static-mut-requires-unsafe.rs index f6ad46a0527..f6ad46a0527 100644 --- a/src/test/compile-fail/static-mut-requires-unsafe.rs +++ b/src/test/ui/compile-fail-migration/static-mut-requires-unsafe.rs diff --git a/src/test/ui/compile-fail-migration/static-mut-requires-unsafe.stderr b/src/test/ui/compile-fail-migration/static-mut-requires-unsafe.stderr new file mode 100644 index 00000000000..310da8f67f3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-mut-requires-unsafe.stderr @@ -0,0 +1,27 @@ +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/static-mut-requires-unsafe.rs:14:5 + | +LL | a += 3; //~ ERROR: requires unsafe + | ^^^^^^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/static-mut-requires-unsafe.rs:15:5 + | +LL | a = 4; //~ ERROR: requires unsafe + | ^^^^^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/static-mut-requires-unsafe.rs:16:14 + | +LL | let _b = a; //~ ERROR: requires unsafe + | ^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/static-priv-by-default.rs b/src/test/ui/compile-fail-migration/static-priv-by-default.rs index 14299a9b639..14299a9b639 100644 --- a/src/test/compile-fail/static-priv-by-default.rs +++ b/src/test/ui/compile-fail-migration/static-priv-by-default.rs diff --git a/src/test/ui/compile-fail-migration/static-priv-by-default.stderr b/src/test/ui/compile-fail-migration/static-priv-by-default.stderr new file mode 100644 index 00000000000..4e47f7d8c97 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-priv-by-default.stderr @@ -0,0 +1,21 @@ +error[E0603]: static `private` is private + --> $DIR/static-priv-by-default.rs:25:9 + | +LL | foo(static_priv_by_default::private); //~ ERROR: static `private` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: static `private` is private + --> $DIR/static-priv-by-default.rs:27:9 + | +LL | foo(child::childs_child::private); //~ ERROR: static `private` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: static `private` is private + --> $DIR/static-priv-by-default.rs:33:9 + | +LL | foo(childs_child::private); //~ ERROR: static `private` is private + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/static-priv-by-default2.rs b/src/test/ui/compile-fail-migration/static-priv-by-default2.rs index 577e4f7542d..577e4f7542d 100644 --- a/src/test/compile-fail/static-priv-by-default2.rs +++ b/src/test/ui/compile-fail-migration/static-priv-by-default2.rs diff --git a/src/test/ui/compile-fail-migration/static-priv-by-default2.stderr b/src/test/ui/compile-fail-migration/static-priv-by-default2.stderr new file mode 100644 index 00000000000..0f749b0e4f3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-priv-by-default2.stderr @@ -0,0 +1,15 @@ +error[E0603]: static `private` is private + --> $DIR/static-priv-by-default2.rs:25:9 + | +LL | use child::childs_child::private; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: static `private` is private + --> $DIR/static-priv-by-default2.rs:33:9 + | +LL | use static_priv_by_default::private; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/static-reference-to-fn-1.rs b/src/test/ui/compile-fail-migration/static-reference-to-fn-1.rs index cf8ee1ecb41..cf8ee1ecb41 100644 --- a/src/test/compile-fail/static-reference-to-fn-1.rs +++ b/src/test/ui/compile-fail-migration/static-reference-to-fn-1.rs diff --git a/src/test/ui/compile-fail-migration/static-reference-to-fn-1.stderr b/src/test/ui/compile-fail-migration/static-reference-to-fn-1.stderr new file mode 100644 index 00000000000..609319f3b78 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-reference-to-fn-1.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/static-reference-to-fn-1.rs:27:15 + | +LL | func: &foo, //~ ERROR mismatched types + | ^^^^ expected fn pointer, found fn item + | + = note: expected type `&fn() -> std::option::Option<isize>` + found type `&fn() -> std::option::Option<isize> {foo}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/static-reference-to-fn-2.nll.stderr b/src/test/ui/compile-fail-migration/static-reference-to-fn-2.nll.stderr new file mode 100644 index 00000000000..9ef94189e90 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-reference-to-fn-2.nll.stderr @@ -0,0 +1,68 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/static-reference-to-fn-2.rs:28:22 + | +LL | self_.statefn = &id(state2 as StateMachineFunc); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #2 defined on the function body at 27:1... + --> $DIR/static-reference-to-fn-2.rs:27:1 + | +LL | / fn state1(self_: &mut StateMachineIter) -> Option<&'static str> { +LL | | self_.statefn = &id(state2 as StateMachineFunc); +LL | | //~^ ERROR borrowed value does not live long enough +LL | | return Some("state1"); +LL | | } + | |_^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/static-reference-to-fn-2.rs:34:22 + | +LL | self_.statefn = &id(state3 as StateMachineFunc); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #2 defined on the function body at 33:1... + --> $DIR/static-reference-to-fn-2.rs:33:1 + | +LL | / fn state2(self_: &mut StateMachineIter) -> Option<(&'static str)> { +LL | | self_.statefn = &id(state3 as StateMachineFunc); +LL | | //~^ ERROR borrowed value does not live long enough +LL | | return Some("state2"); +LL | | } + | |_^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/static-reference-to-fn-2.rs:40:22 + | +LL | self_.statefn = &id(finished as StateMachineFunc); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #2 defined on the function body at 39:1... + --> $DIR/static-reference-to-fn-2.rs:39:1 + | +LL | / fn state3(self_: &mut StateMachineIter) -> Option<(&'static str)> { +LL | | self_.statefn = &id(finished as StateMachineFunc); +LL | | //~^ ERROR borrowed value does not live long enough +LL | | return Some("state3"); +LL | | } + | |_^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/static-reference-to-fn-2.rs:51:19 + | +LL | statefn: &id(state1 as StateMachineFunc) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough +... +LL | } + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/static-reference-to-fn-2.rs b/src/test/ui/compile-fail-migration/static-reference-to-fn-2.rs index 8d9f442b81d..8d9f442b81d 100644 --- a/src/test/compile-fail/static-reference-to-fn-2.rs +++ b/src/test/ui/compile-fail-migration/static-reference-to-fn-2.rs diff --git a/src/test/ui/compile-fail-migration/static-reference-to-fn-2.stderr b/src/test/ui/compile-fail-migration/static-reference-to-fn-2.stderr new file mode 100644 index 00000000000..a01ab4cef81 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-reference-to-fn-2.stderr @@ -0,0 +1,71 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/static-reference-to-fn-2.rs:28:22 + | +LL | self_.statefn = &id(state2 as StateMachineFunc); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #2 defined on the function body at 27:1... + --> $DIR/static-reference-to-fn-2.rs:27:1 + | +LL | / fn state1(self_: &mut StateMachineIter) -> Option<&'static str> { +LL | | self_.statefn = &id(state2 as StateMachineFunc); +LL | | //~^ ERROR borrowed value does not live long enough +LL | | return Some("state1"); +LL | | } + | |_^ + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/static-reference-to-fn-2.rs:34:22 + | +LL | self_.statefn = &id(state3 as StateMachineFunc); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #2 defined on the function body at 33:1... + --> $DIR/static-reference-to-fn-2.rs:33:1 + | +LL | / fn state2(self_: &mut StateMachineIter) -> Option<(&'static str)> { +LL | | self_.statefn = &id(state3 as StateMachineFunc); +LL | | //~^ ERROR borrowed value does not live long enough +LL | | return Some("state2"); +LL | | } + | |_^ + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/static-reference-to-fn-2.rs:40:22 + | +LL | self_.statefn = &id(finished as StateMachineFunc); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- temporary value only lives until here + | | + | temporary value does not live long enough + | +note: borrowed value must be valid for the anonymous lifetime #2 defined on the function body at 39:1... + --> $DIR/static-reference-to-fn-2.rs:39:1 + | +LL | / fn state3(self_: &mut StateMachineIter) -> Option<(&'static str)> { +LL | | self_.statefn = &id(finished as StateMachineFunc); +LL | | //~^ ERROR borrowed value does not live long enough +LL | | return Some("state3"); +LL | | } + | |_^ + = note: consider using a `let` binding to increase its lifetime + +error[E0597]: borrowed value does not live long enough + --> $DIR/static-reference-to-fn-2.rs:51:19 + | +LL | statefn: &id(state1 as StateMachineFunc) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough +... +LL | } + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/static-region-bound.rs b/src/test/ui/compile-fail-migration/static-region-bound.rs index 90ed401659c..90ed401659c 100644 --- a/src/test/compile-fail/static-region-bound.rs +++ b/src/test/ui/compile-fail-migration/static-region-bound.rs diff --git a/src/test/ui/compile-fail-migration/static-region-bound.stderr b/src/test/ui/compile-fail-migration/static-region-bound.stderr new file mode 100644 index 00000000000..ee3398b96d9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-region-bound.stderr @@ -0,0 +1,14 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/static-region-bound.rs:20:14 + | +LL | let x = &id(3); //~ ERROR borrowed value does not live long enough + | ^^^^^ temporary value does not live long enough +LL | f(x); +LL | } + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/static-vec-repeat-not-constant.rs b/src/test/ui/compile-fail-migration/static-vec-repeat-not-constant.rs index a533a5bd54d..a533a5bd54d 100644 --- a/src/test/compile-fail/static-vec-repeat-not-constant.rs +++ b/src/test/ui/compile-fail-migration/static-vec-repeat-not-constant.rs diff --git a/src/test/ui/compile-fail-migration/static-vec-repeat-not-constant.stderr b/src/test/ui/compile-fail-migration/static-vec-repeat-not-constant.stderr new file mode 100644 index 00000000000..27d1b41ed0b --- /dev/null +++ b/src/test/ui/compile-fail-migration/static-vec-repeat-not-constant.stderr @@ -0,0 +1,9 @@ +error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants + --> $DIR/static-vec-repeat-not-constant.rs:13:25 + | +LL | static a: [isize; 2] = [foo(); 2]; + | ^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0015`. diff --git a/src/test/compile-fail/staticness-mismatch.rs b/src/test/ui/compile-fail-migration/staticness-mismatch.rs index 2dfc9b79ee2..2dfc9b79ee2 100644 --- a/src/test/compile-fail/staticness-mismatch.rs +++ b/src/test/ui/compile-fail-migration/staticness-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/staticness-mismatch.stderr b/src/test/ui/compile-fail-migration/staticness-mismatch.stderr new file mode 100644 index 00000000000..31c06ae8a88 --- /dev/null +++ b/src/test/ui/compile-fail-migration/staticness-mismatch.stderr @@ -0,0 +1,12 @@ +error[E0185]: method `bar` has a `&self` declaration in the impl, but not in the trait + --> $DIR/staticness-mismatch.rs:17:5 + | +LL | fn bar(); + | --------- trait method declared without `&self` +... +LL | fn bar(&self) {} + | ^^^^^^^^^^^^^ `&self` used in impl + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0185`. diff --git a/src/test/compile-fail/std-uncopyable-atomics.rs b/src/test/ui/compile-fail-migration/std-uncopyable-atomics.rs index 35877db610e..35877db610e 100644 --- a/src/test/compile-fail/std-uncopyable-atomics.rs +++ b/src/test/ui/compile-fail-migration/std-uncopyable-atomics.rs diff --git a/src/test/ui/compile-fail-migration/std-uncopyable-atomics.stderr b/src/test/ui/compile-fail-migration/std-uncopyable-atomics.stderr new file mode 100644 index 00000000000..4452bfa95d8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/std-uncopyable-atomics.stderr @@ -0,0 +1,39 @@ +error[E0507]: cannot move out of borrowed content + --> $DIR/std-uncopyable-atomics.rs:19:13 + | +LL | let x = *&x; //~ ERROR: cannot move out of borrowed content + | ^^^ + | | + | cannot move out of borrowed content + | help: consider using a reference instead: `&*&x` + +error[E0507]: cannot move out of borrowed content + --> $DIR/std-uncopyable-atomics.rs:21:13 + | +LL | let x = *&x; //~ ERROR: cannot move out of borrowed content + | ^^^ + | | + | cannot move out of borrowed content + | help: consider using a reference instead: `&*&x` + +error[E0507]: cannot move out of borrowed content + --> $DIR/std-uncopyable-atomics.rs:23:13 + | +LL | let x = *&x; //~ ERROR: cannot move out of borrowed content + | ^^^ + | | + | cannot move out of borrowed content + | help: consider using a reference instead: `&*&x` + +error[E0507]: cannot move out of borrowed content + --> $DIR/std-uncopyable-atomics.rs:25:13 + | +LL | let x = *&x; //~ ERROR: cannot move out of borrowed content + | ^^^ + | | + | cannot move out of borrowed content + | help: consider using a reference instead: `&*&x` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/stmt_expr_attrs_no_feature.rs b/src/test/ui/compile-fail-migration/stmt_expr_attrs_no_feature.rs index 896817bb858..896817bb858 100644 --- a/src/test/compile-fail/stmt_expr_attrs_no_feature.rs +++ b/src/test/ui/compile-fail-migration/stmt_expr_attrs_no_feature.rs diff --git a/src/test/ui/compile-fail-migration/stmt_expr_attrs_no_feature.stderr b/src/test/ui/compile-fail-migration/stmt_expr_attrs_no_feature.stderr new file mode 100644 index 00000000000..1168c5a8223 --- /dev/null +++ b/src/test/ui/compile-fail-migration/stmt_expr_attrs_no_feature.stderr @@ -0,0 +1,67 @@ +error[E0658]: attributes on expressions are experimental. (see issue #15701) + --> $DIR/stmt_expr_attrs_no_feature.rs:104:18 + | +LL | fn y(a: [u8; #[attr] 5]); //~ ERROR 15701 + | ^^^^^^^ + | + = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable + +error[E0658]: attributes on expressions are experimental. (see issue #15701) + --> $DIR/stmt_expr_attrs_no_feature.rs:111:19 + | +LL | const Y: u8 = #[attr] 5; //~ ERROR 15701 + | ^^^^^^^ + | + = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable + +error[E0658]: attributes on expressions are experimental. (see issue #15701) + --> $DIR/stmt_expr_attrs_no_feature.rs:117:19 + | +LL | const Y: [u8; #[attr] 5]; //~ ERROR 15701 + | ^^^^^^^ + | + = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable + +error[E0658]: attributes on expressions are experimental. (see issue #15701) + --> $DIR/stmt_expr_attrs_no_feature.rs:123:18 + | +LL | field2: [u8; #[attr] 5] //~ ERROR 15701 + | ^^^^^^^ + | + = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable + +error[E0658]: attributes on expressions are experimental. (see issue #15701) + --> $DIR/stmt_expr_attrs_no_feature.rs:128:10 + | +LL | [u8; #[attr] 5] //~ ERROR 15701 + | ^^^^^^^ + | + = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable + +error[E0658]: attributes on expressions are experimental. (see issue #15701) + --> $DIR/stmt_expr_attrs_no_feature.rs:134:14 + | +LL | [u8; #[attr] 5] //~ ERROR 15701 + | ^^^^^^^ + | + = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable + +error[E0658]: attributes on expressions are experimental. (see issue #15701) + --> $DIR/stmt_expr_attrs_no_feature.rs:139:22 + | +LL | field2: [u8; #[attr] 5] //~ ERROR 15701 + | ^^^^^^^ + | + = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable + +error[E0658]: attributes on expressions are experimental. (see issue #15701) + --> $DIR/stmt_expr_attrs_no_feature.rs:147:14 + | +LL | 6 => #[attr] (), //~ ERROR 15701 + | ^^^^^^^ + | + = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/str-idx.rs b/src/test/ui/compile-fail-migration/str-idx.rs index b5f1ffb977e..b5f1ffb977e 100644 --- a/src/test/compile-fail/str-idx.rs +++ b/src/test/ui/compile-fail-migration/str-idx.rs diff --git a/src/test/ui/compile-fail-migration/str-idx.stderr b/src/test/ui/compile-fail-migration/str-idx.stderr new file mode 100644 index 00000000000..496187c92f1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/str-idx.stderr @@ -0,0 +1,11 @@ +error[E0277]: the type `str` cannot be indexed by `{integer}` + --> $DIR/str-idx.rs:13:17 + | +LL | let c: u8 = s[4]; //~ ERROR the type `str` cannot be indexed by `{integer}` + | ^^^^ `str` cannot be indexed by `{integer}` + | + = help: the trait `std::ops::Index<{integer}>` is not implemented for `str` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/str-mut-idx.rs b/src/test/ui/compile-fail-migration/str-mut-idx.rs index 136bfaefa71..136bfaefa71 100644 --- a/src/test/compile-fail/str-mut-idx.rs +++ b/src/test/ui/compile-fail-migration/str-mut-idx.rs diff --git a/src/test/ui/compile-fail-migration/str-mut-idx.stderr b/src/test/ui/compile-fail-migration/str-mut-idx.stderr new file mode 100644 index 00000000000..a80c7e57431 --- /dev/null +++ b/src/test/ui/compile-fail-migration/str-mut-idx.stderr @@ -0,0 +1,35 @@ +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/str-mut-idx.rs:14:15 + | +LL | s[1..2] = bot(); + | ^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> +note: required by `bot` + --> $DIR/str-mut-idx.rs:11:1 + | +LL | fn bot<T>() -> T { loop {} } + | ^^^^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/str-mut-idx.rs:14:5 + | +LL | s[1..2] = bot(); + | ^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: the left-hand-side of an assignment must have a statically known size + +error[E0277]: the type `str` cannot be mutably indexed by `usize` + --> $DIR/str-mut-idx.rs:17:5 + | +LL | s[1usize] = bot(); + | ^^^^^^^^^ `str` cannot be mutably indexed by `usize` + | + = help: the trait `std::ops::IndexMut<usize>` is not implemented for `str` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/struct-base-wrong-type-2.rs b/src/test/ui/compile-fail-migration/struct-base-wrong-type-2.rs index 7e5510edb2c..7e5510edb2c 100644 --- a/src/test/compile-fail/struct-base-wrong-type-2.rs +++ b/src/test/ui/compile-fail-migration/struct-base-wrong-type-2.rs diff --git a/src/test/ui/compile-fail-migration/struct-base-wrong-type-2.stderr b/src/test/ui/compile-fail-migration/struct-base-wrong-type-2.stderr new file mode 100644 index 00000000000..aab5ed0a74a --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-base-wrong-type-2.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/struct-base-wrong-type-2.rs:21:27 + | +LL | let f = Foo { a: 2, ..b }; //~ ERROR mismatched types + | ^ expected struct `Foo`, found struct `Bar` + | + = note: expected type `Foo` + found type `Bar` + +error[E0308]: mismatched types + --> $DIR/struct-base-wrong-type-2.rs:25:34 + | +LL | let f__isize = Foo { a: 2, ..4 }; //~ ERROR mismatched types + | ^ expected struct `Foo`, found integral variable + | + = note: expected type `Foo` + found type `{integer}` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/struct-base-wrong-type.rs b/src/test/ui/compile-fail-migration/struct-base-wrong-type.rs index 3703b15d4db..3703b15d4db 100644 --- a/src/test/compile-fail/struct-base-wrong-type.rs +++ b/src/test/ui/compile-fail-migration/struct-base-wrong-type.rs diff --git a/src/test/ui/compile-fail-migration/struct-base-wrong-type.stderr b/src/test/ui/compile-fail-migration/struct-base-wrong-type.stderr new file mode 100644 index 00000000000..2c87f52ee04 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-base-wrong-type.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/struct-base-wrong-type.rs:20:33 + | +LL | static foo: Foo = Foo { a: 2, ..bar }; //~ ERROR mismatched types + | ^^^ expected struct `Foo`, found struct `Bar` + | + = note: expected type `Foo` + found type `Bar` + +error[E0308]: mismatched types + --> $DIR/struct-base-wrong-type.rs:24:35 + | +LL | static foo_i: Foo = Foo { a: 2, ..4 }; //~ ERROR mismatched types + | ^ expected struct `Foo`, found integral variable + | + = note: expected type `Foo` + found type `{integer}` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/struct-field-cfg.rs b/src/test/ui/compile-fail-migration/struct-field-cfg.rs index 974d500d9cb..974d500d9cb 100644 --- a/src/test/compile-fail/struct-field-cfg.rs +++ b/src/test/ui/compile-fail-migration/struct-field-cfg.rs diff --git a/src/test/ui/compile-fail-migration/struct-field-cfg.stderr b/src/test/ui/compile-fail-migration/struct-field-cfg.stderr new file mode 100644 index 00000000000..db4790659c3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-field-cfg.stderr @@ -0,0 +1,30 @@ +error[E0063]: missing field `present` in initializer of `Foo` + --> $DIR/struct-field-cfg.rs:17:13 + | +LL | let _ = Foo { #[cfg(any())] present: () }; + | ^^^ missing `present` + +error[E0560]: struct `Foo` has no field named `absent` + --> $DIR/struct-field-cfg.rs:20:46 + | +LL | let _ = Foo { present: (), #[cfg(all())] absent: () }; + | ^^^^^^ `Foo` does not have this field + | + = note: available fields are: `present` + +error[E0027]: pattern does not mention field `present` + --> $DIR/struct-field-cfg.rs:23:9 + | +LL | let Foo { #[cfg(any())] present: () } = foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing field `present` + +error[E0026]: struct `Foo` does not have a field named `absent` + --> $DIR/struct-field-cfg.rs:26:42 + | +LL | let Foo { present: (), #[cfg(all())] absent: () } = foo; + | ^^^^^^^^^^ struct `Foo` does not have this field + +error: aborting due to 4 previous errors + +Some errors occurred: E0026, E0027, E0063, E0560. +For more information about an error, try `rustc --explain E0026`. diff --git a/src/test/compile-fail/struct-field-privacy.rs b/src/test/ui/compile-fail-migration/struct-field-privacy.rs index f487ef62aa4..f487ef62aa4 100644 --- a/src/test/compile-fail/struct-field-privacy.rs +++ b/src/test/ui/compile-fail-migration/struct-field-privacy.rs diff --git a/src/test/ui/compile-fail-migration/struct-field-privacy.stderr b/src/test/ui/compile-fail-migration/struct-field-privacy.stderr new file mode 100644 index 00000000000..ad3ee12637a --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-field-privacy.stderr @@ -0,0 +1,33 @@ +error[E0616]: field `a` of struct `inner::A` is private + --> $DIR/struct-field-privacy.rs:33:5 + | +LL | b.a; //~ ERROR: field `a` of struct `inner::A` is private + | ^^^ + +error[E0616]: field `b` of struct `inner::B` is private + --> $DIR/struct-field-privacy.rs:36:5 + | +LL | c.b; //~ ERROR: field `b` of struct `inner::B` is private + | ^^^ + +error[E0616]: field `a` of struct `xc::A` is private + --> $DIR/struct-field-privacy.rs:38:5 + | +LL | d.a; //~ ERROR: field `a` of struct `xc::A` is private + | ^^^ + +error[E0616]: field `b` of struct `xc::B` is private + --> $DIR/struct-field-privacy.rs:42:5 + | +LL | e.b; //~ ERROR: field `b` of struct `xc::B` is private + | ^^^ + +error[E0616]: field `1` of struct `inner::Z` is private + --> $DIR/struct-field-privacy.rs:45:5 + | +LL | z.1; //~ ERROR: field `1` of struct `inner::Z` is private + | ^^^ + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0616`. diff --git a/src/test/compile-fail/struct-fields-dupe.rs b/src/test/ui/compile-fail-migration/struct-fields-dupe.rs index 578091f5e9a..578091f5e9a 100644 --- a/src/test/compile-fail/struct-fields-dupe.rs +++ b/src/test/ui/compile-fail-migration/struct-fields-dupe.rs diff --git a/src/test/ui/compile-fail-migration/struct-fields-dupe.stderr b/src/test/ui/compile-fail-migration/struct-fields-dupe.stderr new file mode 100644 index 00000000000..fa2079317e0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-fields-dupe.stderr @@ -0,0 +1,11 @@ +error[E0062]: field `foo` specified more than once + --> $DIR/struct-fields-dupe.rs:18:9 + | +LL | foo: 0, + | ------ first use of `foo` +LL | foo: 0 //~ ERROR field `foo` specified more than once + | ^^^ used more than once + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0062`. diff --git a/src/test/compile-fail/struct-fields-missing.rs b/src/test/ui/compile-fail-migration/struct-fields-missing.rs index d5ab13affaf..d5ab13affaf 100644 --- a/src/test/compile-fail/struct-fields-missing.rs +++ b/src/test/ui/compile-fail-migration/struct-fields-missing.rs diff --git a/src/test/ui/compile-fail-migration/struct-fields-missing.stderr b/src/test/ui/compile-fail-migration/struct-fields-missing.stderr new file mode 100644 index 00000000000..606288ef277 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-fields-missing.stderr @@ -0,0 +1,9 @@ +error[E0063]: missing field `bar` in initializer of `BuildData` + --> $DIR/struct-fields-missing.rs:18:15 + | +LL | let foo = BuildData { //~ ERROR missing field `bar` in initializer of `BuildData` + | ^^^^^^^^^ missing `bar` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0063`. diff --git a/src/test/compile-fail/struct-fields-shorthand-unresolved.rs b/src/test/ui/compile-fail-migration/struct-fields-shorthand-unresolved.rs index 984f337fb3d..984f337fb3d 100644 --- a/src/test/compile-fail/struct-fields-shorthand-unresolved.rs +++ b/src/test/ui/compile-fail-migration/struct-fields-shorthand-unresolved.rs diff --git a/src/test/ui/compile-fail-migration/struct-fields-shorthand-unresolved.stderr b/src/test/ui/compile-fail-migration/struct-fields-shorthand-unresolved.stderr new file mode 100644 index 00000000000..f66ac96e0b7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-fields-shorthand-unresolved.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `y` in this scope + --> $DIR/struct-fields-shorthand-unresolved.rs:20:9 + | +LL | y //~ ERROR cannot find value `y` in this scope + | ^ did you mean `x`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/struct-fields-shorthand.rs b/src/test/ui/compile-fail-migration/struct-fields-shorthand.rs index e46ae73f1a1..e46ae73f1a1 100644 --- a/src/test/compile-fail/struct-fields-shorthand.rs +++ b/src/test/ui/compile-fail-migration/struct-fields-shorthand.rs diff --git a/src/test/ui/compile-fail-migration/struct-fields-shorthand.stderr b/src/test/ui/compile-fail-migration/struct-fields-shorthand.stderr new file mode 100644 index 00000000000..a65a9c86581 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-fields-shorthand.stderr @@ -0,0 +1,11 @@ +error[E0560]: struct `Foo` has no field named `z` + --> $DIR/struct-fields-shorthand.rs:19:15 + | +LL | x, y, z //~ ERROR struct `Foo` has no field named `z` + | ^ `Foo` does not have this field + | + = note: available fields are: `x`, `y` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0560`. diff --git a/src/test/compile-fail/struct-fields-typo.rs b/src/test/ui/compile-fail-migration/struct-fields-typo.rs index 0e30c1e86e4..0e30c1e86e4 100644 --- a/src/test/compile-fail/struct-fields-typo.rs +++ b/src/test/ui/compile-fail-migration/struct-fields-typo.rs diff --git a/src/test/ui/compile-fail-migration/struct-fields-typo.stderr b/src/test/ui/compile-fail-migration/struct-fields-typo.stderr new file mode 100644 index 00000000000..9f2f97a6c09 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-fields-typo.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `baa` on type `BuildData` + --> $DIR/struct-fields-typo.rs:21:17 + | +LL | let x = foo.baa;//~ no field `baa` on type `BuildData` + | ^^^ did you mean `bar`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/compile-fail/struct-like-enum-nonexhaustive.rs b/src/test/ui/compile-fail-migration/struct-like-enum-nonexhaustive.rs index a14e43f4c94..a14e43f4c94 100644 --- a/src/test/compile-fail/struct-like-enum-nonexhaustive.rs +++ b/src/test/ui/compile-fail-migration/struct-like-enum-nonexhaustive.rs diff --git a/src/test/ui/compile-fail-migration/struct-like-enum-nonexhaustive.stderr b/src/test/ui/compile-fail-migration/struct-like-enum-nonexhaustive.stderr new file mode 100644 index 00000000000..56dbf0c93ba --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-like-enum-nonexhaustive.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `B { x: Some(_) }` not covered + --> $DIR/struct-like-enum-nonexhaustive.rs:18:11 + | +LL | match x { //~ ERROR non-exhaustive patterns + | ^ pattern `B { x: Some(_) }` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/struct-pat-derived-error.rs b/src/test/ui/compile-fail-migration/struct-pat-derived-error.rs index d3130c4e831..d3130c4e831 100644 --- a/src/test/compile-fail/struct-pat-derived-error.rs +++ b/src/test/ui/compile-fail-migration/struct-pat-derived-error.rs diff --git a/src/test/ui/compile-fail-migration/struct-pat-derived-error.stderr b/src/test/ui/compile-fail-migration/struct-pat-derived-error.stderr new file mode 100644 index 00000000000..68b71efc106 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-pat-derived-error.stderr @@ -0,0 +1,22 @@ +error[E0609]: no field `d` on type `&a` + --> $DIR/struct-pat-derived-error.rs:18:31 + | +LL | let a { x, y } = self.d; //~ ERROR no field `d` on type `&a` + | ^ + +error[E0026]: struct `a` does not have fields named `x`, `y` + --> $DIR/struct-pat-derived-error.rs:18:17 + | +LL | let a { x, y } = self.d; //~ ERROR no field `d` on type `&a` + | ^ ^ struct `a` does not have these fields + +error[E0027]: pattern does not mention fields `b`, `c` + --> $DIR/struct-pat-derived-error.rs:18:13 + | +LL | let a { x, y } = self.d; //~ ERROR no field `d` on type `&a` + | ^^^^^^^^^^ missing fields `b`, `c` + +error: aborting due to 3 previous errors + +Some errors occurred: E0026, E0027, E0609. +For more information about an error, try `rustc --explain E0026`. diff --git a/src/test/compile-fail/struct-path-alias-bounds.rs b/src/test/ui/compile-fail-migration/struct-path-alias-bounds.rs index 1b6e51e3703..1b6e51e3703 100644 --- a/src/test/compile-fail/struct-path-alias-bounds.rs +++ b/src/test/ui/compile-fail-migration/struct-path-alias-bounds.rs diff --git a/src/test/ui/compile-fail-migration/struct-path-alias-bounds.stderr b/src/test/ui/compile-fail-migration/struct-path-alias-bounds.stderr new file mode 100644 index 00000000000..f8e2fe1410f --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-path-alias-bounds.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `NoClone: std::clone::Clone` is not satisfied + --> $DIR/struct-path-alias-bounds.rs:19:13 + | +LL | let s = A { a: NoClone }; + | ^ the trait `std::clone::Clone` is not implemented for `NoClone` + | +note: required by `S` + --> $DIR/struct-path-alias-bounds.rs:13:1 + | +LL | struct S<T: Clone> { a: T } + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/struct-path-associated-type.rs b/src/test/ui/compile-fail-migration/struct-path-associated-type.rs index 660ac44ce0b..660ac44ce0b 100644 --- a/src/test/compile-fail/struct-path-associated-type.rs +++ b/src/test/ui/compile-fail-migration/struct-path-associated-type.rs diff --git a/src/test/ui/compile-fail-migration/struct-path-associated-type.stderr b/src/test/ui/compile-fail-migration/struct-path-associated-type.stderr new file mode 100644 index 00000000000..1364b2a6b0c --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-path-associated-type.stderr @@ -0,0 +1,64 @@ +error[E0071]: expected struct, variant or union type, found associated type + --> $DIR/struct-path-associated-type.rs:22:13 + | +LL | let s = T::A {}; + | ^^^^ not a struct + +error[E0109]: type parameters are not allowed on this type + --> $DIR/struct-path-associated-type.rs:24:20 + | +LL | let z = T::A::<u8> {}; + | ^^ type parameter not allowed + +error[E0071]: expected struct, variant or union type, found associated type + --> $DIR/struct-path-associated-type.rs:24:13 + | +LL | let z = T::A::<u8> {}; + | ^^^^^^^^^^ not a struct + +error[E0071]: expected struct, variant or union type, found associated type + --> $DIR/struct-path-associated-type.rs:28:9 + | +LL | T::A {} => {} + | ^^^^ not a struct + +error[E0109]: type parameters are not allowed on this type + --> $DIR/struct-path-associated-type.rs:35:20 + | +LL | let z = T::A::<u8> {}; //~ ERROR type parameters are not allowed on this type + | ^^ type parameter not allowed + +error[E0223]: ambiguous associated type + --> $DIR/struct-path-associated-type.rs:42:13 + | +LL | let s = S::A {}; //~ ERROR ambiguous associated type + | ^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<S as Trait>::A` + +error[E0109]: type parameters are not allowed on this type + --> $DIR/struct-path-associated-type.rs:43:20 + | +LL | let z = S::A::<u8> {}; //~ ERROR ambiguous associated type + | ^^ type parameter not allowed + +error[E0223]: ambiguous associated type + --> $DIR/struct-path-associated-type.rs:43:13 + | +LL | let z = S::A::<u8> {}; //~ ERROR ambiguous associated type + | ^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<S as Trait>::A` + +error[E0223]: ambiguous associated type + --> $DIR/struct-path-associated-type.rs:46:9 + | +LL | S::A {} => {} //~ ERROR ambiguous associated type + | ^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<S as Trait>::A` + +error: aborting due to 9 previous errors + +Some errors occurred: E0071, E0109, E0223. +For more information about an error, try `rustc --explain E0071`. diff --git a/src/test/compile-fail/struct-path-self.rs b/src/test/ui/compile-fail-migration/struct-path-self.rs index 067d6ac22dc..067d6ac22dc 100644 --- a/src/test/compile-fail/struct-path-self.rs +++ b/src/test/ui/compile-fail-migration/struct-path-self.rs diff --git a/src/test/ui/compile-fail-migration/struct-path-self.stderr b/src/test/ui/compile-fail-migration/struct-path-self.stderr new file mode 100644 index 00000000000..1b5506072e8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-path-self.stderr @@ -0,0 +1,40 @@ +error[E0071]: expected struct, variant or union type, found Self + --> $DIR/struct-path-self.rs:15:17 + | +LL | let s = Self {}; + | ^^^^ not a struct + +error[E0109]: type parameters are not allowed on this type + --> $DIR/struct-path-self.rs:17:24 + | +LL | let z = Self::<u8> {}; + | ^^ type parameter not allowed + +error[E0071]: expected struct, variant or union type, found Self + --> $DIR/struct-path-self.rs:17:17 + | +LL | let z = Self::<u8> {}; + | ^^^^^^^^^^ not a struct + +error[E0071]: expected struct, variant or union type, found Self + --> $DIR/struct-path-self.rs:21:13 + | +LL | Self { .. } => {} + | ^^^^ not a struct + +error[E0109]: type parameters are not allowed on this type + --> $DIR/struct-path-self.rs:30:24 + | +LL | let z = Self::<u8> {}; //~ ERROR type parameters are not allowed on this type + | ^^ type parameter not allowed + +error[E0109]: type parameters are not allowed on this type + --> $DIR/struct-path-self.rs:40:24 + | +LL | let z = Self::<u8> {}; //~ ERROR type parameters are not allowed on this type + | ^^ type parameter not allowed + +error: aborting due to 6 previous errors + +Some errors occurred: E0071, E0109. +For more information about an error, try `rustc --explain E0071`. diff --git a/src/test/compile-fail/struct-pattern-match-useless.rs b/src/test/ui/compile-fail-migration/struct-pattern-match-useless.rs index dda30141b4a..dda30141b4a 100644 --- a/src/test/compile-fail/struct-pattern-match-useless.rs +++ b/src/test/ui/compile-fail-migration/struct-pattern-match-useless.rs diff --git a/src/test/ui/compile-fail-migration/struct-pattern-match-useless.stderr b/src/test/ui/compile-fail-migration/struct-pattern-match-useless.stderr new file mode 100644 index 00000000000..60f17d1d906 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-pattern-match-useless.stderr @@ -0,0 +1,14 @@ +error: unreachable pattern + --> $DIR/struct-pattern-match-useless.rs:22:9 + | +LL | Foo { .. } => () //~ ERROR unreachable pattern + | ^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/struct-pattern-match-useless.rs:11:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/struct-variant-privacy-xc.rs b/src/test/ui/compile-fail-migration/struct-variant-privacy-xc.rs index 8507acd26ce..8507acd26ce 100644 --- a/src/test/compile-fail/struct-variant-privacy-xc.rs +++ b/src/test/ui/compile-fail-migration/struct-variant-privacy-xc.rs diff --git a/src/test/ui/compile-fail-migration/struct-variant-privacy-xc.stderr b/src/test/ui/compile-fail-migration/struct-variant-privacy-xc.stderr new file mode 100644 index 00000000000..731d23e6a97 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-variant-privacy-xc.stderr @@ -0,0 +1,15 @@ +error[E0603]: enum `Bar` is private + --> $DIR/struct-variant-privacy-xc.rs:14:9 + | +LL | fn f(b: struct_variant_privacy::Bar) { //~ ERROR enum `Bar` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: enum `Bar` is private + --> $DIR/struct-variant-privacy-xc.rs:16:9 + | +LL | struct_variant_privacy::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/struct-variant-privacy.rs b/src/test/ui/compile-fail-migration/struct-variant-privacy.rs index 7de4ca62555..7de4ca62555 100644 --- a/src/test/compile-fail/struct-variant-privacy.rs +++ b/src/test/ui/compile-fail-migration/struct-variant-privacy.rs diff --git a/src/test/ui/compile-fail-migration/struct-variant-privacy.stderr b/src/test/ui/compile-fail-migration/struct-variant-privacy.stderr new file mode 100644 index 00000000000..a82ac8ab318 --- /dev/null +++ b/src/test/ui/compile-fail-migration/struct-variant-privacy.stderr @@ -0,0 +1,15 @@ +error[E0603]: enum `Bar` is private + --> $DIR/struct-variant-privacy.rs:16:9 + | +LL | fn f(b: foo::Bar) { //~ ERROR enum `Bar` is private + | ^^^^^^^^ + +error[E0603]: enum `Bar` is private + --> $DIR/struct-variant-privacy.rs:18:9 + | +LL | foo::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private + | ^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/structure-constructor-type-mismatch.rs b/src/test/ui/compile-fail-migration/structure-constructor-type-mismatch.rs index 87fc5ba93ae..87fc5ba93ae 100644 --- a/src/test/compile-fail/structure-constructor-type-mismatch.rs +++ b/src/test/ui/compile-fail-migration/structure-constructor-type-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/structure-constructor-type-mismatch.stderr b/src/test/ui/compile-fail-migration/structure-constructor-type-mismatch.stderr new file mode 100644 index 00000000000..85de419bfc0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/structure-constructor-type-mismatch.stderr @@ -0,0 +1,115 @@ +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:27:12 + | +LL | x: 1, + | ^ expected f32, found integral variable + | + = note: expected type `f32` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:30:12 + | +LL | y: 2, + | ^ expected f32, found integral variable + | + = note: expected type `f32` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:36:12 + | +LL | x: 3, + | ^ expected f32, found integral variable + | + = note: expected type `f32` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:39:12 + | +LL | y: 4, + | ^ expected f32, found integral variable + | + = note: expected type `f32` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:45:12 + | +LL | x: 5, + | ^ expected f32, found integral variable + | + = note: expected type `f32` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:52:12 + | +LL | x: 7, + | ^ expected f32, found integral variable + | + = note: expected type `f32` + found type `{integer}` + +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/structure-constructor-type-mismatch.rs:58:15 + | +LL | let pt3 = PointF::<i32> { //~ ERROR wrong number of type arguments + | ^^^^^^^^^^^^^ expected no type arguments + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:59:12 + | +LL | x: 9, //~ ERROR mismatched types + | ^ expected f32, found integral variable + | + = note: expected type `f32` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:60:12 + | +LL | y: 10, //~ ERROR mismatched types + | ^^ expected f32, found integral variable + | + = note: expected type `f32` + found type `{integer}` + +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/structure-constructor-type-mismatch.rs:64:9 + | +LL | PointF::<u32> { .. } => {} //~ ERROR wrong number of type arguments + | ^^^^^^^^^^^^^ expected no type arguments + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:64:9 + | +LL | PointF::<u32> { .. } => {} //~ ERROR wrong number of type arguments + | ^^^^^^^^^^^^^^^^^^^^ expected integral variable, found f32 + | + = note: expected type `Point<{integer}>` + found type `Point<f32>` + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:69:9 + | +LL | PointF { .. } => {} //~ ERROR mismatched types + | ^^^^^^^^^^^^^ expected integral variable, found f32 + | + = note: expected type `Point<{integer}>` + found type `Point<f32>` + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:77:9 + | +LL | PairF::<u32> { .. } => {} //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^ expected integral variable, found f32 + | + = note: expected type `Pair<{integer}, {integer}>` + found type `Pair<f32, u32>` + +error: aborting due to 13 previous errors + +Some errors occurred: E0244, E0308. +For more information about an error, try `rustc --explain E0244`. diff --git a/src/test/ui/compile-fail-migration/substs-ppaux.normal.stderr b/src/test/ui/compile-fail-migration/substs-ppaux.normal.stderr new file mode 100644 index 00000000000..3eb15a08eae --- /dev/null +++ b/src/test/ui/compile-fail-migration/substs-ppaux.normal.stderr @@ -0,0 +1,55 @@ +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:25:17 + | +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:34:17 + | +LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:42:17 + | +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {<i8 as Foo<'static, 'static, u8>>::baz}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:50:17 + | +LL | let x: () = foo::<'static>; + | ^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {foo::<'static>}` + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/substs-ppaux.rs:58:5 + | +LL | <str as Foo<u8>>::bar; + | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for `str` +note: required by `Foo::bar` + --> $DIR/substs-ppaux.rs:16:5 + | +LL | fn bar<'a, T>() where T: 'a {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/substs-ppaux.rs b/src/test/ui/compile-fail-migration/substs-ppaux.rs index d0e9a7f4a40..d0e9a7f4a40 100644 --- a/src/test/compile-fail/substs-ppaux.rs +++ b/src/test/ui/compile-fail-migration/substs-ppaux.rs diff --git a/src/test/ui/compile-fail-migration/substs-ppaux.verbose.stderr b/src/test/ui/compile-fail-migration/substs-ppaux.verbose.stderr new file mode 100644 index 00000000000..a417c0d8970 --- /dev/null +++ b/src/test/ui/compile-fail-migration/substs-ppaux.verbose.stderr @@ -0,0 +1,55 @@ +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:25:17 + | +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::bar::<ReStatic, char>}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:34:17 + | +LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {<i8 as Foo<ReStatic, ReStatic, u32>>::bar::<ReStatic, char>}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:42:17 + | +LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {<i8 as Foo<ReStatic, ReStatic, u8>>::baz}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:50:17 + | +LL | let x: () = foo::<'static>; + | ^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {foo::<ReStatic>}` + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/substs-ppaux.rs:58:5 + | +LL | <str as Foo<u8>>::bar; + | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8>` for `str` +note: required by `Foo::bar` + --> $DIR/substs-ppaux.rs:16:5 + | +LL | fn bar<'a, T>() where T: 'a {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/suffixed-literal-meta.rs b/src/test/ui/compile-fail-migration/suffixed-literal-meta.rs index bf55b7bdcb1..bf55b7bdcb1 100644 --- a/src/test/compile-fail/suffixed-literal-meta.rs +++ b/src/test/ui/compile-fail-migration/suffixed-literal-meta.rs diff --git a/src/test/ui/compile-fail-migration/suffixed-literal-meta.stderr b/src/test/ui/compile-fail-migration/suffixed-literal-meta.stderr new file mode 100644 index 00000000000..6d88ab1df16 --- /dev/null +++ b/src/test/ui/compile-fail-migration/suffixed-literal-meta.stderr @@ -0,0 +1,98 @@ +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:13:10 + | +LL | #[path = 1usize] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:14:10 + | +LL | #[path = 1u8] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:15:10 + | +LL | #[path = 1u16] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:16:10 + | +LL | #[path = 1u32] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:17:10 + | +LL | #[path = 1u64] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:18:10 + | +LL | #[path = 1isize] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:19:10 + | +LL | #[path = 1i8] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:20:10 + | +LL | #[path = 1i16] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:21:10 + | +LL | #[path = 1i32] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:22:10 + | +LL | #[path = 1i64] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:23:10 + | +LL | #[path = 1.0f32] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: suffixed literals are not allowed in attributes + --> $DIR/suffixed-literal-meta.rs:24:10 + | +LL | #[path = 1.0f64] //~ ERROR: suffixed literals are not allowed in attributes + | ^^^^^^ + | + = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.). + +error: aborting due to 12 previous errors + diff --git a/src/test/compile-fail/super-at-top-level.rs b/src/test/ui/compile-fail-migration/super-at-top-level.rs index c607711c44f..c607711c44f 100644 --- a/src/test/compile-fail/super-at-top-level.rs +++ b/src/test/ui/compile-fail-migration/super-at-top-level.rs diff --git a/src/test/ui/compile-fail-migration/super-at-top-level.stderr b/src/test/ui/compile-fail-migration/super-at-top-level.stderr new file mode 100644 index 00000000000..b4af73055a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/super-at-top-level.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. There are too many initial `super`s. + --> $DIR/super-at-top-level.rs:11:5 + | +LL | use super::f; //~ ERROR There are too many initial `super`s + | ^^^^^ There are too many initial `super`s. + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/compile-fail/suppressed-error.rs b/src/test/ui/compile-fail-migration/suppressed-error.rs index 9a4a52ced20..9a4a52ced20 100644 --- a/src/test/compile-fail/suppressed-error.rs +++ b/src/test/ui/compile-fail-migration/suppressed-error.rs diff --git a/src/test/ui/compile-fail-migration/suppressed-error.stderr b/src/test/ui/compile-fail-migration/suppressed-error.stderr new file mode 100644 index 00000000000..d17e7cb6891 --- /dev/null +++ b/src/test/ui/compile-fail-migration/suppressed-error.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/suppressed-error.rs:12:9 + | +LL | let (x, y) = (); + | ^^^^^^ expected (), found tuple + | + = note: expected type `()` + found type `(_, _)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/symbol-names/basic.rs b/src/test/ui/compile-fail-migration/symbol-names/basic.rs index 0095774fcb8..0095774fcb8 100644 --- a/src/test/compile-fail/symbol-names/basic.rs +++ b/src/test/ui/compile-fail-migration/symbol-names/basic.rs diff --git a/src/test/ui/compile-fail-migration/symbol-names/basic.stderr b/src/test/ui/compile-fail-migration/symbol-names/basic.stderr new file mode 100644 index 00000000000..eeeb1b5e34d --- /dev/null +++ b/src/test/ui/compile-fail-migration/symbol-names/basic.stderr @@ -0,0 +1,14 @@ +error: symbol-name(_ZN5basic4main17h2138d548fb9814b6E) + --> $DIR/basic.rs:13:1 + | +LL | #[rustc_symbol_name] //~ ERROR _ZN5basic4main + | ^^^^^^^^^^^^^^^^^^^^ + +error: item-path(main) + --> $DIR/basic.rs:14:1 + | +LL | #[rustc_item_path] //~ ERROR item-path(main) + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/symbol-names/impl1.rs b/src/test/ui/compile-fail-migration/symbol-names/impl1.rs index 93fa48b880f..93fa48b880f 100644 --- a/src/test/compile-fail/symbol-names/impl1.rs +++ b/src/test/ui/compile-fail-migration/symbol-names/impl1.rs diff --git a/src/test/ui/compile-fail-migration/symbol-names/impl1.stderr b/src/test/ui/compile-fail-migration/symbol-names/impl1.stderr new file mode 100644 index 00000000000..edce6929695 --- /dev/null +++ b/src/test/ui/compile-fail-migration/symbol-names/impl1.stderr @@ -0,0 +1,26 @@ +error: symbol-name(_ZN5impl13foo3Foo3bar17h8da62e6147ff602fE) + --> $DIR/impl1.rs:18:9 + | +LL | #[rustc_symbol_name] //~ ERROR _ZN5impl13foo3Foo3bar + | ^^^^^^^^^^^^^^^^^^^^ + +error: item-path(foo::Foo::bar) + --> $DIR/impl1.rs:19:9 + | +LL | #[rustc_item_path] //~ ERROR item-path(foo::Foo::bar) + | ^^^^^^^^^^^^^^^^^^ + +error: symbol-name(_ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz17h374cb8f6185db9b4E) + --> $DIR/impl1.rs:28:9 + | +LL | #[rustc_symbol_name] //~ ERROR _ZN5impl13bar33_$LT$impl$u20$impl1..foo..Foo$GT$3baz + | ^^^^^^^^^^^^^^^^^^^^ + +error: item-path(bar::<impl foo::Foo>::baz) + --> $DIR/impl1.rs:29:9 + | +LL | #[rustc_item_path] //~ ERROR item-path(bar::<impl foo::Foo>::baz) + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/syntax-extension-minor.rs b/src/test/ui/compile-fail-migration/syntax-extension-minor.rs index 96adfea43f3..96adfea43f3 100644 --- a/src/test/compile-fail/syntax-extension-minor.rs +++ b/src/test/ui/compile-fail-migration/syntax-extension-minor.rs diff --git a/src/test/ui/compile-fail-migration/syntax-extension-minor.stderr b/src/test/ui/compile-fail-migration/syntax-extension-minor.stderr new file mode 100644 index 00000000000..7df1f303146 --- /dev/null +++ b/src/test/ui/compile-fail-migration/syntax-extension-minor.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find value `asdf_fdsa` in this scope + --> $DIR/syntax-extension-minor.rs:20:13 + | +LL | assert!(concat_idents!(asd, f_f, dsa) == "<.<".to_string()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs b/src/test/ui/compile-fail-migration/syntax-trait-polarity-feature-gate.rs index 8d5e89cc66f..8d5e89cc66f 100644 --- a/src/test/compile-fail/syntax-trait-polarity-feature-gate.rs +++ b/src/test/ui/compile-fail-migration/syntax-trait-polarity-feature-gate.rs diff --git a/src/test/ui/compile-fail-migration/syntax-trait-polarity-feature-gate.stderr b/src/test/ui/compile-fail-migration/syntax-trait-polarity-feature-gate.stderr new file mode 100644 index 00000000000..eebd018b887 --- /dev/null +++ b/src/test/ui/compile-fail-migration/syntax-trait-polarity-feature-gate.stderr @@ -0,0 +1,11 @@ +error[E0658]: negative trait bounds are not yet fully implemented; use marker types for now (see issue #13231) + --> $DIR/syntax-trait-polarity-feature-gate.rs:17:1 + | +LL | impl !Send for TestType {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(optin_builtin_traits)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/syntax-trait-polarity.rs b/src/test/ui/compile-fail-migration/syntax-trait-polarity.rs index 1a5d058cb9a..1a5d058cb9a 100644 --- a/src/test/compile-fail/syntax-trait-polarity.rs +++ b/src/test/ui/compile-fail-migration/syntax-trait-polarity.rs diff --git a/src/test/ui/compile-fail-migration/syntax-trait-polarity.stderr b/src/test/ui/compile-fail-migration/syntax-trait-polarity.stderr new file mode 100644 index 00000000000..724ac60ed91 --- /dev/null +++ b/src/test/ui/compile-fail-migration/syntax-trait-polarity.stderr @@ -0,0 +1,40 @@ +error: inherent impls cannot be negative + --> $DIR/syntax-trait-polarity.rs:17:1 + | +LL | impl !TestType {} + | ^^^^^^^^^^^^^^^^^ + +error[E0198]: negative impls cannot be unsafe + --> $DIR/syntax-trait-polarity.rs:22:1 + | +LL | unsafe impl !Send for TestType {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: inherent impls cannot be negative + --> $DIR/syntax-trait-polarity.rs:29:1 + | +LL | impl<T> !TestType2<T> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0198]: negative impls cannot be unsafe + --> $DIR/syntax-trait-polarity.rs:32:1 + | +LL | unsafe impl<T> !Send for TestType2<T> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0192]: negative impls are only allowed for auto traits (e.g., `Send` and `Sync`) + --> $DIR/syntax-trait-polarity.rs:24:1 + | +LL | impl !TestTrait for TestType {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0192]: negative impls are only allowed for auto traits (e.g., `Send` and `Sync`) + --> $DIR/syntax-trait-polarity.rs:34:1 + | +LL | impl<T> !TestTrait for TestType2<T> {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + +Some errors occurred: E0192, E0198. +For more information about an error, try `rustc --explain E0192`. diff --git a/src/test/compile-fail/synthetic-param.rs b/src/test/ui/compile-fail-migration/synthetic-param.rs index 337cae1369e..337cae1369e 100644 --- a/src/test/compile-fail/synthetic-param.rs +++ b/src/test/ui/compile-fail-migration/synthetic-param.rs diff --git a/src/test/ui/compile-fail-migration/synthetic-param.stderr b/src/test/ui/compile-fail-migration/synthetic-param.stderr new file mode 100644 index 00000000000..2711f6f8bdc --- /dev/null +++ b/src/test/ui/compile-fail-migration/synthetic-param.stderr @@ -0,0 +1,21 @@ +error[E0632]: cannot provide explicit type parameters when `impl Trait` is used in argument position. + --> $DIR/synthetic-param.rs:30:5 + | +LL | func::<u8>(42); //~ ERROR cannot provide explicit type parameters + | ^^^^^^^^^^ + +error[E0632]: cannot provide explicit type parameters when `impl Trait` is used in argument position. + --> $DIR/synthetic-param.rs:33:5 + | +LL | Foo::func::<u8>(42); //~ ERROR cannot provide explicit type parameters + | ^^^^^^^^^^^^^^^ + +error[E0632]: cannot provide explicit type parameters when `impl Trait` is used in argument position. + --> $DIR/synthetic-param.rs:36:5 + | +LL | Bar::<i8>::func::<u8>(42); //~ ERROR cannot provide explicit type parameters + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0632`. diff --git a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs b/src/test/ui/compile-fail-migration/tag-that-dare-not-speak-its-name.rs index 8f420f1ce4b..8f420f1ce4b 100644 --- a/src/test/compile-fail/tag-that-dare-not-speak-its-name.rs +++ b/src/test/ui/compile-fail-migration/tag-that-dare-not-speak-its-name.rs diff --git a/src/test/ui/compile-fail-migration/tag-that-dare-not-speak-its-name.stderr b/src/test/ui/compile-fail-migration/tag-that-dare-not-speak-its-name.stderr new file mode 100644 index 00000000000..b9580eafc33 --- /dev/null +++ b/src/test/ui/compile-fail-migration/tag-that-dare-not-speak-its-name.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/tag-that-dare-not-speak-its-name.rs:22:20 + | +LL | let x : char = last(y); + | ^^^^^^^ expected char, found enum `std::option::Option` + | + = note: expected type `char` + found type `std::option::Option<_>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/tag-type-args.rs b/src/test/ui/compile-fail-migration/tag-type-args.rs index 5785a13b006..5785a13b006 100644 --- a/src/test/compile-fail/tag-type-args.rs +++ b/src/test/ui/compile-fail-migration/tag-type-args.rs diff --git a/src/test/ui/compile-fail-migration/tag-type-args.stderr b/src/test/ui/compile-fail-migration/tag-type-args.stderr new file mode 100644 index 00000000000..1431ee9cc86 --- /dev/null +++ b/src/test/ui/compile-fail-migration/tag-type-args.stderr @@ -0,0 +1,9 @@ +error[E0243]: wrong number of type arguments: expected 1, found 0 + --> $DIR/tag-type-args.rs:15:11 + | +LL | fn foo(c: quux) { assert!((false)); } + | ^^^^ expected 1 type argument + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0243`. diff --git a/src/test/compile-fail/tag-variant-cast-non-nullary.rs b/src/test/ui/compile-fail-migration/tag-variant-cast-non-nullary.rs index 220537633ea..220537633ea 100644 --- a/src/test/compile-fail/tag-variant-cast-non-nullary.rs +++ b/src/test/ui/compile-fail-migration/tag-variant-cast-non-nullary.rs diff --git a/src/test/ui/compile-fail-migration/tag-variant-cast-non-nullary.stderr b/src/test/ui/compile-fail-migration/tag-variant-cast-non-nullary.stderr new file mode 100644 index 00000000000..1e64c74d121 --- /dev/null +++ b/src/test/ui/compile-fail-migration/tag-variant-cast-non-nullary.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `non_nullary` as `isize` + --> $DIR/tag-variant-cast-non-nullary.rs:18:15 + | +LL | let val = v as isize; //~ ERROR non-primitive cast: `non_nullary` as `isize` [E0605] + | ^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/compile-fail/tag-variant-disr-dup.rs b/src/test/ui/compile-fail-migration/tag-variant-disr-dup.rs index 5da5bb85409..5da5bb85409 100644 --- a/src/test/compile-fail/tag-variant-disr-dup.rs +++ b/src/test/ui/compile-fail-migration/tag-variant-disr-dup.rs diff --git a/src/test/ui/compile-fail-migration/tag-variant-disr-dup.stderr b/src/test/ui/compile-fail-migration/tag-variant-disr-dup.stderr new file mode 100644 index 00000000000..de5a0fac54f --- /dev/null +++ b/src/test/ui/compile-fail-migration/tag-variant-disr-dup.stderr @@ -0,0 +1,11 @@ +error[E0081]: discriminant value `0` already exists + --> $DIR/tag-variant-disr-dup.rs:20:13 + | +LL | black = 0x000000, + | -------- first use of `0` +LL | white = 0x000000, + | ^^^^^^^^ enum already has `0` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0081`. diff --git a/src/test/compile-fail/tail-typeck.rs b/src/test/ui/compile-fail-migration/tail-typeck.rs index 5c1270aa0e4..5c1270aa0e4 100644 --- a/src/test/compile-fail/tail-typeck.rs +++ b/src/test/ui/compile-fail-migration/tail-typeck.rs diff --git a/src/test/ui/compile-fail-migration/tail-typeck.stderr b/src/test/ui/compile-fail-migration/tail-typeck.stderr new file mode 100644 index 00000000000..302bd6aa2d8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/tail-typeck.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/tail-typeck.rs:13:26 + | +LL | fn f() -> isize { return g(); } + | ^^^ expected isize, found usize + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/terr-in-field.rs b/src/test/ui/compile-fail-migration/terr-in-field.rs index 4a21e133981..4a21e133981 100644 --- a/src/test/compile-fail/terr-in-field.rs +++ b/src/test/ui/compile-fail-migration/terr-in-field.rs diff --git a/src/test/ui/compile-fail-migration/terr-in-field.stderr b/src/test/ui/compile-fail-migration/terr-in-field.stderr new file mode 100644 index 00000000000..5d06eef90be --- /dev/null +++ b/src/test/ui/compile-fail-migration/terr-in-field.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/terr-in-field.rs:23:14 + | +LL | want_foo(b); //~ ERROR mismatched types + | ^ expected struct `foo`, found struct `bar` + | + = note: expected type `foo` + found type `bar` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/terr-sorts.rs b/src/test/ui/compile-fail-migration/terr-sorts.rs index fd92a26d0fc..fd92a26d0fc 100644 --- a/src/test/compile-fail/terr-sorts.rs +++ b/src/test/ui/compile-fail-migration/terr-sorts.rs diff --git a/src/test/ui/compile-fail-migration/terr-sorts.stderr b/src/test/ui/compile-fail-migration/terr-sorts.stderr new file mode 100644 index 00000000000..a16216c842e --- /dev/null +++ b/src/test/ui/compile-fail-migration/terr-sorts.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/terr-sorts.rs:21:14 + | +LL | want_foo(b); //~ ERROR mismatched types + | ^ expected struct `foo`, found struct `std::boxed::Box` + | + = note: expected type `foo` + found type `std::boxed::Box<foo>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/test-cfg.rs b/src/test/ui/compile-fail-migration/test-cfg.rs index 71cae0b6df9..71cae0b6df9 100644 --- a/src/test/compile-fail/test-cfg.rs +++ b/src/test/ui/compile-fail-migration/test-cfg.rs diff --git a/src/test/ui/compile-fail-migration/test-cfg.stderr b/src/test/ui/compile-fail-migration/test-cfg.stderr new file mode 100644 index 00000000000..1db6d5eccbe --- /dev/null +++ b/src/test/ui/compile-fail-migration/test-cfg.stderr @@ -0,0 +1,9 @@ +error[E0425]: cannot find function `foo` in this scope + --> $DIR/test-cfg.rs:17:5 + | +LL | foo(); //~ ERROR cannot find function `foo` in this scope + | ^^^ not found in this scope + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/test-warns-dead-code.rs b/src/test/ui/compile-fail-migration/test-warns-dead-code.rs index 0e25f1e965a..0e25f1e965a 100644 --- a/src/test/compile-fail/test-warns-dead-code.rs +++ b/src/test/ui/compile-fail-migration/test-warns-dead-code.rs diff --git a/src/test/ui/compile-fail-migration/test-warns-dead-code.stderr b/src/test/ui/compile-fail-migration/test-warns-dead-code.stderr new file mode 100644 index 00000000000..46ff31c65d6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/test-warns-dead-code.stderr @@ -0,0 +1,14 @@ +error: function is never used: `dead` + --> $DIR/test-warns-dead-code.rs:15:1 + | +LL | fn dead() {} //~ error: function is never used: `dead` + | ^^^^^^^^^ + | +note: lint level defined here + --> $DIR/test-warns-dead-code.rs:13:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/thread-local-in-ctfe.nll.stderr b/src/test/ui/compile-fail-migration/thread-local-in-ctfe.nll.stderr new file mode 100644 index 00000000000..6784a83cc76 --- /dev/null +++ b/src/test/ui/compile-fail-migration/thread-local-in-ctfe.nll.stderr @@ -0,0 +1,54 @@ +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:16:17 + | +LL | static B: u32 = A; + | ^ + +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:19:18 + | +LL | static C: &u32 = &A; + | ^^ + +error[E0597]: `A` does not live long enough + --> $DIR/thread-local-in-ctfe.rs:19:18 + | +LL | static C: &u32 = &A; + | ^^- `A` dropped here while still borrowed + | | + | borrowed value does not live long enough + | + = note: borrowed value must be valid for the static lifetime... + +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:22:16 + | +LL | const D: u32 = A; + | ^ + +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:25:17 + | +LL | const E: &u32 = &A; + | ^^ + +error[E0597]: `A` does not live long enough + --> $DIR/thread-local-in-ctfe.rs:25:17 + | +LL | const E: &u32 = &A; + | ^^- `A` dropped here while still borrowed + | | + | borrowed value does not live long enough + | + = note: borrowed value must be valid for the static lifetime... + +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:29:5 + | +LL | A + | ^ + +error: aborting due to 7 previous errors + +Some errors occurred: E0597, E0625. +For more information about an error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/thread-local-in-ctfe.rs b/src/test/ui/compile-fail-migration/thread-local-in-ctfe.rs index 62e26f28b06..62e26f28b06 100644 --- a/src/test/compile-fail/thread-local-in-ctfe.rs +++ b/src/test/ui/compile-fail-migration/thread-local-in-ctfe.rs diff --git a/src/test/ui/compile-fail-migration/thread-local-in-ctfe.stderr b/src/test/ui/compile-fail-migration/thread-local-in-ctfe.stderr new file mode 100644 index 00000000000..76079d9a9ee --- /dev/null +++ b/src/test/ui/compile-fail-migration/thread-local-in-ctfe.stderr @@ -0,0 +1,33 @@ +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:16:17 + | +LL | static B: u32 = A; + | ^ + +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:19:18 + | +LL | static C: &u32 = &A; + | ^^ + +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:22:16 + | +LL | const D: u32 = A; + | ^ + +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:25:17 + | +LL | const E: &u32 = &A; + | ^^ + +error[E0625]: thread-local statics cannot be accessed at compile-time + --> $DIR/thread-local-in-ctfe.rs:29:5 + | +LL | A + | ^ + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0625`. diff --git a/src/test/compile-fail/tool_lints.rs b/src/test/ui/compile-fail-migration/tool_lints.rs index ea1efab4cb6..ea1efab4cb6 100644 --- a/src/test/compile-fail/tool_lints.rs +++ b/src/test/ui/compile-fail-migration/tool_lints.rs diff --git a/src/test/ui/compile-fail-migration/tool_lints.stderr b/src/test/ui/compile-fail-migration/tool_lints.stderr new file mode 100644 index 00000000000..4ee285e5ea4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/tool_lints.stderr @@ -0,0 +1,14 @@ +error: unknown lint: `clippy` + --> $DIR/tool_lints.rs:16:9 + | +LL | #![deny(clippy)] //~ ERROR: unknown lint: `clippy` + | ^^^^^^ + | +note: lint level defined here + --> $DIR/tool_lints.rs:14:9 + | +LL | #![deny(unknown_lints)] + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/trace_macros-format.rs b/src/test/ui/compile-fail-migration/trace_macros-format.rs index 95cb17c215b..95cb17c215b 100644 --- a/src/test/compile-fail/trace_macros-format.rs +++ b/src/test/ui/compile-fail-migration/trace_macros-format.rs diff --git a/src/test/ui/compile-fail-migration/trace_macros-format.stderr b/src/test/ui/compile-fail-migration/trace_macros-format.stderr new file mode 100644 index 00000000000..8dad041e9fe --- /dev/null +++ b/src/test/ui/compile-fail-migration/trace_macros-format.stderr @@ -0,0 +1,38 @@ +error: trace_macros! accepts only `true` or `false` + --> $DIR/trace_macros-format.rs:14:5 + | +LL | trace_macros!(); //~ ERROR trace_macros! accepts only `true` or `false` + | ^^^^^^^^^^^^^^^^ + +error: trace_macros! accepts only `true` or `false` + --> $DIR/trace_macros-format.rs:15:5 + | +LL | trace_macros!(1); //~ ERROR trace_macros! accepts only `true` or `false` + | ^^^^^^^^^^^^^^^^^ + +error: trace_macros! accepts only `true` or `false` + --> $DIR/trace_macros-format.rs:16:5 + | +LL | trace_macros!(ident); //~ ERROR trace_macros! accepts only `true` or `false` + | ^^^^^^^^^^^^^^^^^^^^^ + +error: trace_macros! accepts only `true` or `false` + --> $DIR/trace_macros-format.rs:17:5 + | +LL | trace_macros!(for); //~ ERROR trace_macros! accepts only `true` or `false` + | ^^^^^^^^^^^^^^^^^^^ + +error: trace_macros! accepts only `true` or `false` + --> $DIR/trace_macros-format.rs:18:5 + | +LL | trace_macros!(true,); //~ ERROR trace_macros! accepts only `true` or `false` + | ^^^^^^^^^^^^^^^^^^^^^ + +error: trace_macros! accepts only `true` or `false` + --> $DIR/trace_macros-format.rs:19:5 + | +LL | trace_macros!(false 1); //~ ERROR trace_macros! accepts only `true` or `false` + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + diff --git a/src/test/compile-fail/trace_macros-gate.rs b/src/test/ui/compile-fail-migration/trace_macros-gate.rs index d4a7c4ed0e0..d4a7c4ed0e0 100644 --- a/src/test/compile-fail/trace_macros-gate.rs +++ b/src/test/ui/compile-fail-migration/trace_macros-gate.rs diff --git a/src/test/ui/compile-fail-migration/trace_macros-gate.stderr b/src/test/ui/compile-fail-migration/trace_macros-gate.stderr new file mode 100644 index 00000000000..ed92e1227ba --- /dev/null +++ b/src/test/ui/compile-fail-migration/trace_macros-gate.stderr @@ -0,0 +1,62 @@ +error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598) + --> $DIR/trace_macros-gate.rs:14:5 + | +LL | trace_macros!(); //~ ERROR `trace_macros` is not stable + | ^^^^^^^^^^^^^^^^ + | + = help: add #![feature(trace_macros)] to the crate attributes to enable + +error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598) + --> $DIR/trace_macros-gate.rs:15:5 + | +LL | trace_macros!(1); //~ ERROR `trace_macros` is not stable + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(trace_macros)] to the crate attributes to enable + +error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598) + --> $DIR/trace_macros-gate.rs:16:5 + | +LL | trace_macros!(ident); //~ ERROR `trace_macros` is not stable + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(trace_macros)] to the crate attributes to enable + +error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598) + --> $DIR/trace_macros-gate.rs:17:5 + | +LL | trace_macros!(for); //~ ERROR `trace_macros` is not stable + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(trace_macros)] to the crate attributes to enable + +error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598) + --> $DIR/trace_macros-gate.rs:18:5 + | +LL | trace_macros!(true,); //~ ERROR `trace_macros` is not stable + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(trace_macros)] to the crate attributes to enable + +error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598) + --> $DIR/trace_macros-gate.rs:19:5 + | +LL | trace_macros!(false 1); //~ ERROR `trace_macros` is not stable + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(trace_macros)] to the crate attributes to enable + +error[E0658]: `trace_macros` is not stable enough for use and is subject to change (see issue #29598) + --> $DIR/trace_macros-gate.rs:26:26 + | +LL | ($x: ident) => { trace_macros!($x) } //~ ERROR `trace_macros` is not stable + | ^^^^^^^^^^^^^^^^^ +... +LL | expando!(true); + | --------------- in this macro invocation + | + = help: add #![feature(trace_macros)] to the crate attributes to enable + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/trait-alias.rs b/src/test/ui/compile-fail-migration/trait-alias.rs index 7aca227a76c..7aca227a76c 100644 --- a/src/test/compile-fail/trait-alias.rs +++ b/src/test/ui/compile-fail-migration/trait-alias.rs diff --git a/src/test/ui/compile-fail-migration/trait-alias.stderr b/src/test/ui/compile-fail-migration/trait-alias.stderr new file mode 100644 index 00000000000..75fd4a9d9af --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-alias.stderr @@ -0,0 +1,44 @@ +error: type parameters on the left side of a trait alias cannot be bounded + --> $DIR/trait-alias.rs:15:14 + | +LL | trait Alias2<T: Clone = ()> = Default; + | ^ + +error: type parameters on the left side of a trait alias cannot have defaults + --> $DIR/trait-alias.rs:15:14 + | +LL | trait Alias2<T: Clone = ()> = Default; + | ^ + +error[E0573]: expected type, found trait alias `Alias1` + --> $DIR/trait-alias.rs:20:6 + | +LL | impl Alias1 { //~ERROR expected type, found trait alias + | ^^^^^^ not a type + +error[E0404]: expected trait, found trait alias `Alias1` + --> $DIR/trait-alias.rs:23:6 + | +LL | impl Alias1 for () { //~ERROR expected trait, found trait alias + | ^^^^^^ not a trait + +error[E0658]: trait aliases are not yet fully implemented (see issue #41517) + --> $DIR/trait-alias.rs:13:1 + | +LL | trait Alias1<T> = Default where T: Clone; // ok + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(trait_alias)] to the crate attributes to enable + +error[E0658]: trait aliases are not yet fully implemented (see issue #41517) + --> $DIR/trait-alias.rs:15:1 + | +LL | trait Alias2<T: Clone = ()> = Default; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(trait_alias)] to the crate attributes to enable + +error: aborting due to 6 previous errors + +Some errors occurred: E0404, E0573, E0658. +For more information about an error, try `rustc --explain E0404`. diff --git a/src/test/compile-fail/trait-as-struct-constructor.rs b/src/test/ui/compile-fail-migration/trait-as-struct-constructor.rs index 49d58580da5..49d58580da5 100644 --- a/src/test/compile-fail/trait-as-struct-constructor.rs +++ b/src/test/ui/compile-fail-migration/trait-as-struct-constructor.rs diff --git a/src/test/ui/compile-fail-migration/trait-as-struct-constructor.stderr b/src/test/ui/compile-fail-migration/trait-as-struct-constructor.stderr new file mode 100644 index 00000000000..ecb4e5d44c9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-as-struct-constructor.stderr @@ -0,0 +1,9 @@ +error[E0574]: expected struct, variant or union type, found trait `TraitNotAStruct` + --> $DIR/trait-as-struct-constructor.rs:14:5 + | +LL | TraitNotAStruct{ value: 0 }; + | ^^^^^^^^^^^^^^^ not a struct, variant or union type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs b/src/test/ui/compile-fail-migration/trait-bounds-not-on-bare-trait.rs index 9c38d8a9e2a..9c38d8a9e2a 100644 --- a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-not-on-bare-trait.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-not-on-bare-trait.stderr b/src/test/ui/compile-fail-migration/trait-bounds-not-on-bare-trait.stderr new file mode 100644 index 00000000000..31a36fdc132 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-not-on-bare-trait.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `(dyn Foo + std::marker::Send + 'static)` cannot be known at compilation time + --> $DIR/trait-bounds-not-on-bare-trait.rs:17:8 + | +LL | fn foo(_x: Foo + Send) { + | ^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `(dyn Foo + std::marker::Send + 'static)` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: all local variables must have a statically known size + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/trait-bounds-not-on-struct.rs b/src/test/ui/compile-fail-migration/trait-bounds-not-on-struct.rs index 76bbca60658..76bbca60658 100644 --- a/src/test/compile-fail/trait-bounds-not-on-struct.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-not-on-struct.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-not-on-struct.stderr b/src/test/ui/compile-fail-migration/trait-bounds-not-on-struct.stderr new file mode 100644 index 00000000000..929a1bfaa15 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-not-on-struct.stderr @@ -0,0 +1,15 @@ +error[E0404]: expected trait, found struct `Foo` + --> $DIR/trait-bounds-not-on-struct.rs:15:16 + | +LL | fn foo(_x: Box<Foo + Send>) { } //~ ERROR expected trait, found struct `Foo` + | ^^^ not a trait + +error[E0404]: expected trait, found struct `Vec` + --> $DIR/trait-bounds-not-on-struct.rs:17:21 + | +LL | type A<T> = Box<dyn Vec<T>>; //~ ERROR expected trait, found struct `Vec` + | ^^^^^^ not a trait + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0404`. diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-in-fns.rs b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-fns.rs index 6a271a7b749..6a271a7b749 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-in-fns.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-fns.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-fns.stderr b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-fns.stderr new file mode 100644 index 00000000000..6dd4d1fca86 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-fns.stderr @@ -0,0 +1,27 @@ +error[E0277]: the trait bound `u32: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:23:1 + | +LL | fn explode(x: Foo<u32>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `u32` + | +note: required by `Foo` + --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:13:1 + | +LL | struct Foo<T:Trait> { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `f32: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:26:1 + | +LL | fn kaboom(y: Bar<f32>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `f32` + | +note: required by `Bar` + --> $DIR/trait-bounds-on-structs-and-enums-in-fns.rs:17:1 + | +LL | enum Bar<T:Trait> { + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-in-impls.rs b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-impls.rs index 77abe6f7f74..77abe6f7f74 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-in-impls.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-impls.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-impls.stderr b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-impls.stderr new file mode 100644 index 00000000000..6f917706873 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-in-impls.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `u16: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-in-impls.rs:30:6 + | +LL | impl PolyTrait<Foo<u16>> for Struct { + | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `u16` + | +note: required by `Foo` + --> $DIR/trait-bounds-on-structs-and-enums-in-impls.rs:13:1 + | +LL | struct Foo<T:Trait> { + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-locals.rs index 9e680d17fb9..9e680d17fb9 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-locals.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-locals.stderr b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-locals.stderr new file mode 100644 index 00000000000..cdaa12428ae --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-locals.stderr @@ -0,0 +1,27 @@ +error[E0277]: the trait bound `usize: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-locals.rs:25:14 + | +LL | let baz: Foo<usize> = loop { }; + | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` + | +note: required by `Foo` + --> $DIR/trait-bounds-on-structs-and-enums-locals.rs:15:1 + | +LL | struct Foo<T:Trait> { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `{integer}: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-locals.rs:20:15 + | +LL | let foo = Foo { + | ^^^ the trait `Trait` is not implemented for `{integer}` + | +note: required by `Foo` + --> $DIR/trait-bounds-on-structs-and-enums-locals.rs:15:1 + | +LL | struct Foo<T:Trait> { + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-static.rs b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-static.rs index 2b59fdcae35..2b59fdcae35 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-static.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-static.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-static.stderr b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-static.stderr new file mode 100644 index 00000000000..28d4257a9fb --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-static.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `usize: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-static.rs:19:1 + | +LL | / static X: Foo<usize> = Foo { +LL | | //~^ ERROR E0277 +LL | | x: 1, +LL | | }; + | |__^ the trait `Trait` is not implemented for `usize` + | +note: required by `Foo` + --> $DIR/trait-bounds-on-structs-and-enums-static.rs:15:1 + | +LL | struct Foo<T:Trait> { + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-xc.rs b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc.rs index 975de00d02a..975de00d02a 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-xc.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc.stderr b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc.stderr new file mode 100644 index 00000000000..b798ccfc7a4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `usize: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-xc.rs:17:1 + | +LL | fn explode(x: Foo<usize>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `usize` + | + = note: required by `trait_bounds_on_structs_and_enums_xc::Foo` + +error[E0277]: the trait bound `f32: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-xc.rs:20:1 + | +LL | fn kaboom(y: Bar<f32>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `f32` + | + = note: required by `trait_bounds_on_structs_and_enums_xc::Bar` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums-xc1.rs b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc1.rs index 515684bcf42..515684bcf42 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums-xc1.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc1.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc1.stderr b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc1.stderr new file mode 100644 index 00000000000..0b0bd4f6ab1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums-xc1.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `f64: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-xc1.rs:22:14 + | +LL | let bar: Bar<f64> = return; + | ^^^^^^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `f64` + | + = note: required by `trait_bounds_on_structs_and_enums_xc::Bar` + +error[E0277]: the trait bound `{integer}: trait_bounds_on_structs_and_enums_xc::Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums-xc1.rs:18:15 + | +LL | let foo = Foo { + | ^^^ the trait `trait_bounds_on_structs_and_enums_xc::Trait` is not implemented for `{integer}` + | + = note: required by `trait_bounds_on_structs_and_enums_xc::Foo` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums.rs index 24e2418e8d4..24e2418e8d4 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums.stderr b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums.stderr new file mode 100644 index 00000000000..5686e62c8b9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-on-structs-and-enums.stderr @@ -0,0 +1,90 @@ +error[E0277]: the trait bound `T: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:23:9 + | +LL | impl<T> Foo<T> { + | ^^^^^^ the trait `Trait` is not implemented for `T` + | + = help: consider adding a `where T: Trait` bound +note: required by `Foo` + --> $DIR/trait-bounds-on-structs-and-enums.rs:13:1 + | +LL | struct Foo<T:Trait> { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `isize: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:29:5 + | +LL | a: Foo<isize>, //~ ERROR E0277 + | ^^^^^^^^^^^^^ the trait `Trait` is not implemented for `isize` + | +note: required by `Foo` + --> $DIR/trait-bounds-on-structs-and-enums.rs:13:1 + | +LL | struct Foo<T:Trait> { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `usize: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:33:10 + | +LL | Quux(Bar<usize>), //~ ERROR E0277 + | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` + | +note: required by `Bar` + --> $DIR/trait-bounds-on-structs-and-enums.rs:17:1 + | +LL | enum Bar<T:Trait> { + | ^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `U: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:37:5 + | +LL | b: Foo<U>, //~ ERROR E0277 + | ^^^^^^^^^ the trait `Trait` is not implemented for `U` + | + = help: consider adding a `where U: Trait` bound +note: required by `Foo` + --> $DIR/trait-bounds-on-structs-and-enums.rs:13:1 + | +LL | struct Foo<T:Trait> { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `V: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:41:21 + | +LL | EvenMoreBadness(Bar<V>), //~ ERROR E0277 + | ^^^^^^ the trait `Trait` is not implemented for `V` + | + = help: consider adding a `where V: Trait` bound +note: required by `Bar` + --> $DIR/trait-bounds-on-structs-and-enums.rs:17:1 + | +LL | enum Bar<T:Trait> { + | ^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `i32: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:45:5 + | +LL | Foo<i32>, //~ ERROR E0277 + | ^^^^^^^^ the trait `Trait` is not implemented for `i32` + | +note: required by `Foo` + --> $DIR/trait-bounds-on-structs-and-enums.rs:13:1 + | +LL | struct Foo<T:Trait> { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `u8: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:49:22 + | +LL | DictionaryLike { field: Bar<u8> }, //~ ERROR E0277 + | ^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `u8` + | +note: required by `Bar` + --> $DIR/trait-bounds-on-structs-and-enums.rs:17:1 + | +LL | enum Bar<T:Trait> { + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/trait-bounds-sugar.rs b/src/test/ui/compile-fail-migration/trait-bounds-sugar.rs index 0a36fcbed69..0a36fcbed69 100644 --- a/src/test/compile-fail/trait-bounds-sugar.rs +++ b/src/test/ui/compile-fail-migration/trait-bounds-sugar.rs diff --git a/src/test/ui/compile-fail-migration/trait-bounds-sugar.stderr b/src/test/ui/compile-fail-migration/trait-bounds-sugar.stderr new file mode 100644 index 00000000000..bd899e06545 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-bounds-sugar.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/trait-bounds-sugar.rs:22:7 + | +LL | a(x); //~ ERROR mismatched types + | ^ expected trait `Foo + std::marker::Send`, found trait `Foo + std::marker::Sync` + | + = note: expected type `std::boxed::Box<(dyn Foo + std::marker::Send + 'static)>` + found type `std::boxed::Box<(dyn Foo + std::marker::Sync + 'static)>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/trait-coercion-generic-bad.rs b/src/test/ui/compile-fail-migration/trait-coercion-generic-bad.rs index 3839e90ed9f..3839e90ed9f 100644 --- a/src/test/compile-fail/trait-coercion-generic-bad.rs +++ b/src/test/ui/compile-fail-migration/trait-coercion-generic-bad.rs diff --git a/src/test/ui/compile-fail-migration/trait-coercion-generic-bad.stderr b/src/test/ui/compile-fail-migration/trait-coercion-generic-bad.stderr new file mode 100644 index 00000000000..a186877e57b --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-coercion-generic-bad.stderr @@ -0,0 +1,13 @@ +error[E0277]: the trait bound `Struct: Trait<isize>` is not satisfied + --> $DIR/trait-coercion-generic-bad.rs:26:32 + | +LL | let s: Box<Trait<isize>> = Box::new(Struct { person: "Fred" }); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<isize>` is not implemented for `Struct` + | + = help: the following implementations were found: + <Struct as Trait<&'static str>> + = note: required for the cast to the object type `dyn Trait<isize>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/trait-coercion-generic-regions.nll.stderr b/src/test/ui/compile-fail-migration/trait-coercion-generic-regions.nll.stderr new file mode 100644 index 00000000000..c6a7482c29f --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-coercion-generic-regions.nll.stderr @@ -0,0 +1,14 @@ +error[E0597]: `person` does not live long enough + --> $DIR/trait-coercion-generic-regions.rs:27:24 + | +LL | let person: &str = &person; //~ ERROR `person` does not live long enough + | ^^^^^^^ borrowed value does not live long enough +LL | let s: Box<Trait<&'static str>> = Box::new(Struct { person: person }); +LL | } + | - `person` dropped here while still borrowed + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/trait-coercion-generic-regions.rs b/src/test/ui/compile-fail-migration/trait-coercion-generic-regions.rs index 18d3ded77f8..18d3ded77f8 100644 --- a/src/test/compile-fail/trait-coercion-generic-regions.rs +++ b/src/test/ui/compile-fail-migration/trait-coercion-generic-regions.rs diff --git a/src/test/ui/compile-fail-migration/trait-coercion-generic-regions.stderr b/src/test/ui/compile-fail-migration/trait-coercion-generic-regions.stderr new file mode 100644 index 00000000000..8eaf7e9c1ef --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-coercion-generic-regions.stderr @@ -0,0 +1,14 @@ +error[E0597]: `person` does not live long enough + --> $DIR/trait-coercion-generic-regions.rs:27:25 + | +LL | let person: &str = &person; //~ ERROR `person` does not live long enough + | ^^^^^^ borrowed value does not live long enough +LL | let s: Box<Trait<&'static str>> = Box::new(Struct { person: person }); +LL | } + | - borrowed value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/trait-impl-1.rs b/src/test/ui/compile-fail-migration/trait-impl-1.rs index e682d3c81e7..e682d3c81e7 100644 --- a/src/test/compile-fail/trait-impl-1.rs +++ b/src/test/ui/compile-fail-migration/trait-impl-1.rs diff --git a/src/test/ui/compile-fail-migration/trait-impl-1.stderr b/src/test/ui/compile-fail-migration/trait-impl-1.stderr new file mode 100644 index 00000000000..b8033900505 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-impl-1.stderr @@ -0,0 +1,9 @@ +error[E0599]: no method named `foo` found for type `&i32` in the current scope + --> $DIR/trait-impl-1.rs:25:7 + | +LL | x.foo(); //~ERROR: no method named `foo` found for type `&i32` in the current scope + | ^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/trait-impl-can-not-have-untraitful-items.rs b/src/test/ui/compile-fail-migration/trait-impl-can-not-have-untraitful-items.rs index cc143a6209d..cc143a6209d 100644 --- a/src/test/compile-fail/trait-impl-can-not-have-untraitful-items.rs +++ b/src/test/ui/compile-fail-migration/trait-impl-can-not-have-untraitful-items.rs diff --git a/src/test/ui/compile-fail-migration/trait-impl-can-not-have-untraitful-items.stderr b/src/test/ui/compile-fail-migration/trait-impl-can-not-have-untraitful-items.stderr new file mode 100644 index 00000000000..e23225bc124 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-impl-can-not-have-untraitful-items.stderr @@ -0,0 +1,22 @@ +error[E0438]: const `BAR` is not a member of trait `A` + --> $DIR/trait-impl-can-not-have-untraitful-items.rs:15:5 + | +LL | const BAR: () = (); //~ ERROR const `BAR` is not a member of trait `A` + | ^^^^^^^^^^^^^^^^^^^ not a member of trait `A` + +error[E0437]: type `Baz` is not a member of trait `A` + --> $DIR/trait-impl-can-not-have-untraitful-items.rs:16:5 + | +LL | type Baz = (); //~ ERROR type `Baz` is not a member of trait `A` + | ^^^^^^^^^^^^^^ not a member of trait `A` + +error[E0407]: method `foo` is not a member of trait `A` + --> $DIR/trait-impl-can-not-have-untraitful-items.rs:17:5 + | +LL | fn foo(&self) { } //~ ERROR method `foo` is not a member of trait `A` + | ^^^^^^^^^^^^^^^^^ not a member of trait `A` + +error: aborting due to 3 previous errors + +Some errors occurred: E0407, E0437, E0438. +For more information about an error, try `rustc --explain E0407`. diff --git a/src/test/compile-fail/trait-impl-different-num-params.rs b/src/test/ui/compile-fail-migration/trait-impl-different-num-params.rs index 647dd4e05fa..647dd4e05fa 100644 --- a/src/test/compile-fail/trait-impl-different-num-params.rs +++ b/src/test/ui/compile-fail-migration/trait-impl-different-num-params.rs diff --git a/src/test/ui/compile-fail-migration/trait-impl-different-num-params.stderr b/src/test/ui/compile-fail-migration/trait-impl-different-num-params.stderr new file mode 100644 index 00000000000..c3bbf99b06a --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-impl-different-num-params.stderr @@ -0,0 +1,12 @@ +error[E0050]: method `bar` has 1 parameter but the declaration in trait `foo::bar` has 2 + --> $DIR/trait-impl-different-num-params.rs:15:12 + | +LL | fn bar(&self, x: usize) -> Self; + | ----- trait requires 2 parameters +... +LL | fn bar(&self) -> isize { + | ^^^^^ expected 2 parameters, found 1 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0050`. diff --git a/src/test/compile-fail/trait-impl-for-module.rs b/src/test/ui/compile-fail-migration/trait-impl-for-module.rs index 1fe8f6294da..1fe8f6294da 100644 --- a/src/test/compile-fail/trait-impl-for-module.rs +++ b/src/test/ui/compile-fail-migration/trait-impl-for-module.rs diff --git a/src/test/ui/compile-fail-migration/trait-impl-for-module.stderr b/src/test/ui/compile-fail-migration/trait-impl-for-module.stderr new file mode 100644 index 00000000000..62ae84da99e --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-impl-for-module.stderr @@ -0,0 +1,9 @@ +error[E0573]: expected type, found module `a` + --> $DIR/trait-impl-for-module.rs:17:12 + | +LL | impl A for a { //~ ERROR expected type, found module + | ^ did you mean `A`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/compile-fail/trait-impl-method-mismatch.rs b/src/test/ui/compile-fail-migration/trait-impl-method-mismatch.rs index a05e007d6b7..a05e007d6b7 100644 --- a/src/test/compile-fail/trait-impl-method-mismatch.rs +++ b/src/test/ui/compile-fail-migration/trait-impl-method-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/trait-impl-method-mismatch.stderr b/src/test/ui/compile-fail-migration/trait-impl-method-mismatch.stderr new file mode 100644 index 00000000000..526a37f7651 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-impl-method-mismatch.stderr @@ -0,0 +1,15 @@ +error[E0053]: method `jumbo` has an incompatible type for trait + --> $DIR/trait-impl-method-mismatch.rs:18:5 + | +LL | fn jumbo(&self, x: &usize) -> usize; + | ------------------------------------ type in trait +... +LL | unsafe fn jumbo(&self, x: &usize) { *self + *x; } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected normal fn, found unsafe fn + | + = note: expected type `fn(&usize, &usize) -> usize` + found type `unsafe fn(&usize, &usize)` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/compile-fail/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs b/src/test/ui/compile-fail-migration/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs index 44c53e70f86..44c53e70f86 100644 --- a/src/test/compile-fail/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs +++ b/src/test/ui/compile-fail-migration/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs diff --git a/src/test/ui/compile-fail-migration/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr b/src/test/ui/compile-fail-migration/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr new file mode 100644 index 00000000000..6a97a4eccbb --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr @@ -0,0 +1,23 @@ +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements + --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:34:13 + | +LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { //~ ERROR cannot infer an appropriate lifetime + | ^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the impl at 34:6... + --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:34:6 + | +LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { //~ ERROR cannot infer an appropriate lifetime + | ^^ +note: ...but the lifetime must also be valid for the lifetime 'b as defined on the impl at 34:9... + --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:34:9 + | +LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { //~ ERROR cannot infer an appropriate lifetime + | ^^ + = note: ...so that the types are compatible: + expected T1<'a> + found T1<'_> + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/compile-fail/trait-item-privacy.rs b/src/test/ui/compile-fail-migration/trait-item-privacy.rs index f8e4f0d596e..f8e4f0d596e 100644 --- a/src/test/compile-fail/trait-item-privacy.rs +++ b/src/test/ui/compile-fail-migration/trait-item-privacy.rs diff --git a/src/test/ui/compile-fail-migration/trait-item-privacy.stderr b/src/test/ui/compile-fail-migration/trait-item-privacy.stderr new file mode 100644 index 00000000000..a3747bcee5d --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-item-privacy.stderr @@ -0,0 +1,176 @@ +error[E0599]: no method named `a` found for type `S` in the current scope + --> $DIR/trait-item-privacy.rs:77:7 + | +LL | struct S; + | --------- method `a` not found for this +... +LL | S.a(); //~ ERROR no method named `a` found for type `S` in the current scope + | ^ + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `a`, perhaps you need to implement it: + candidate #1: `method::A` + +error[E0599]: no method named `b` found for type `S` in the current scope + --> $DIR/trait-item-privacy.rs:78:7 + | +LL | struct S; + | --------- method `b` not found for this +... +LL | S.b(); //~ ERROR no method named `b` found for type `S` in the current scope + | ^ + | + = help: items from traits can only be used if the trait is in scope +help: the following trait is implemented but not in scope, perhaps add a `use` for it: + | +LL | use method::B; + | + +error[E0624]: method `a` is private + --> $DIR/trait-item-privacy.rs:82:7 + | +LL | c.a(); //~ ERROR method `a` is private + | ^ + +error[E0599]: no function or associated item named `a` found for type `S` in the current scope + --> $DIR/trait-item-privacy.rs:88:5 + | +LL | struct S; + | --------- function or associated item `a` not found for this +... +LL | S::a(&S); + | ^^^^ function or associated item not found in `S` + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `a`, perhaps you need to implement it: + candidate #1: `method::A` + +error[E0599]: no function or associated item named `b` found for type `S` in the current scope + --> $DIR/trait-item-privacy.rs:90:5 + | +LL | struct S; + | --------- function or associated item `b` not found for this +... +LL | S::b(&S); + | ^^^^ function or associated item not found in `S` + | + = help: items from traits can only be used if the trait is in scope +help: the following trait is implemented but not in scope, perhaps add a `use` for it: + | +LL | use method::B; + | + +error[E0624]: method `a` is private + --> $DIR/trait-item-privacy.rs:94:5 + | +LL | C::a(&S); //~ ERROR method `a` is private + | ^^^^ + +error[E0599]: no associated item named `A` found for type `S` in the current scope + --> $DIR/trait-item-privacy.rs:107:5 + | +LL | struct S; + | --------- associated item `A` not found for this +... +LL | S::A; //~ ERROR no associated item named `A` found for type `S` in the current scope + | ^^^^ associated item not found in `S` + | + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `A`, perhaps you need to implement it: + candidate #1: `assoc_const::A` + +error[E0599]: no associated item named `B` found for type `S` in the current scope + --> $DIR/trait-item-privacy.rs:108:5 + | +LL | struct S; + | --------- associated item `B` not found for this +... +LL | S::B; //~ ERROR no associated item named `B` found for type `S` in the current scope + | ^^^^ associated item not found in `S` + | + = help: items from traits can only be used if the trait is in scope +help: the following trait is implemented but not in scope, perhaps add a `use` for it: + | +LL | use assoc_const::B; + | + +error[E0624]: associated constant `A` is private + --> $DIR/trait-item-privacy.rs:111:5 + | +LL | C::A; //~ ERROR associated constant `A` is private + | ^^^^ + +error[E0277]: the trait bound `dyn assoc_const::C: assoc_const::A` is not satisfied + --> $DIR/trait-item-privacy.rs:111:5 + | +LL | C::A; //~ ERROR associated constant `A` is private + | ^^^^ the trait `assoc_const::A` is not implemented for `dyn assoc_const::C` + | +note: required by `assoc_const::A::A` + --> $DIR/trait-item-privacy.rs:35:9 + | +LL | const A: u8 = 0; + | ^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `dyn assoc_const::C: assoc_const::B` is not satisfied + --> $DIR/trait-item-privacy.rs:114:5 + | +LL | C::B; // ERROR the trait `assoc_const::C` cannot be made into an object + | ^^^^ the trait `assoc_const::B` is not implemented for `dyn assoc_const::C` + | +note: required by `assoc_const::B::B` + --> $DIR/trait-item-privacy.rs:39:9 + | +LL | const B: u8 = 0; + | ^^^^^^^^^^^^^^^^ + +error[E0038]: the trait `assoc_const::C` cannot be made into an object + --> $DIR/trait-item-privacy.rs:111:5 + | +LL | C::A; //~ ERROR associated constant `A` is private + | ^^^^ the trait `assoc_const::C` cannot be made into an object + | + = note: the trait cannot contain associated consts like `C` + = note: the trait cannot contain associated consts like `B` + = note: the trait cannot contain associated consts like `A` + +error[E0223]: ambiguous associated type + --> $DIR/trait-item-privacy.rs:127:12 + | +LL | let _: S::A; //~ ERROR ambiguous associated type + | ^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<S as Trait>::A` + +error[E0223]: ambiguous associated type + --> $DIR/trait-item-privacy.rs:128:12 + | +LL | let _: S::B; //~ ERROR ambiguous associated type + | ^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<S as Trait>::B` + +error[E0223]: ambiguous associated type + --> $DIR/trait-item-privacy.rs:129:12 + | +LL | let _: S::C; //~ ERROR ambiguous associated type + | ^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<S as Trait>::C` + +error: associated type `A` is private + --> $DIR/trait-item-privacy.rs:131:12 + | +LL | let _: T::A; //~ ERROR associated type `A` is private + | ^^^^ + +error: associated type `A` is private + --> $DIR/trait-item-privacy.rs:140:9 + | +LL | A = u8, //~ ERROR associated type `A` is private + | ^^^^^^ + +error: aborting due to 17 previous errors + +Some errors occurred: E0038, E0223, E0277, E0599, E0624. +For more information about an error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/trait-matching-lifetimes.rs b/src/test/ui/compile-fail-migration/trait-matching-lifetimes.rs index 5ab80065572..5ab80065572 100644 --- a/src/test/compile-fail/trait-matching-lifetimes.rs +++ b/src/test/ui/compile-fail-migration/trait-matching-lifetimes.rs diff --git a/src/test/ui/compile-fail-migration/trait-matching-lifetimes.stderr b/src/test/ui/compile-fail-migration/trait-matching-lifetimes.stderr new file mode 100644 index 00000000000..8f27947ff2a --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-matching-lifetimes.stderr @@ -0,0 +1,41 @@ +error[E0308]: method not compatible with trait + --> $DIR/trait-matching-lifetimes.rs:24:5 + | +LL | fn foo(x: Foo<'b,'a>) { + | ^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `fn(Foo<'a, 'b>)` + found type `fn(Foo<'b, 'a>)` +note: the lifetime 'b as defined on the impl at 23:9... + --> $DIR/trait-matching-lifetimes.rs:23:9 + | +LL | impl<'a,'b> Tr for Foo<'a,'b> { + | ^^ +note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 23:6 + --> $DIR/trait-matching-lifetimes.rs:23:6 + | +LL | impl<'a,'b> Tr for Foo<'a,'b> { + | ^^ + +error[E0308]: method not compatible with trait + --> $DIR/trait-matching-lifetimes.rs:24:5 + | +LL | fn foo(x: Foo<'b,'a>) { + | ^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `fn(Foo<'a, 'b>)` + found type `fn(Foo<'b, 'a>)` +note: the lifetime 'a as defined on the impl at 23:6... + --> $DIR/trait-matching-lifetimes.rs:23:6 + | +LL | impl<'a,'b> Tr for Foo<'a,'b> { + | ^^ +note: ...does not necessarily outlive the lifetime 'b as defined on the impl at 23:9 + --> $DIR/trait-matching-lifetimes.rs:23:9 + | +LL | impl<'a,'b> Tr for Foo<'a,'b> { + | ^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/trait-object-macro-matcher.rs b/src/test/ui/compile-fail-migration/trait-object-macro-matcher.rs index 8497a699e97..8497a699e97 100644 --- a/src/test/compile-fail/trait-object-macro-matcher.rs +++ b/src/test/ui/compile-fail-migration/trait-object-macro-matcher.rs diff --git a/src/test/ui/compile-fail-migration/trait-object-macro-matcher.stderr b/src/test/ui/compile-fail-migration/trait-object-macro-matcher.stderr new file mode 100644 index 00000000000..05511b554cc --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-object-macro-matcher.stderr @@ -0,0 +1,18 @@ +error[E0224]: at least one non-builtin trait is required for an object type + --> $DIR/trait-object-macro-matcher.rs:20:8 + | +LL | m!('static +); //~ ERROR at least one non-builtin trait is required for an object type + | ^^^^^^^^^ + +error[E0038]: the trait `std::marker::Copy` cannot be made into an object + --> $DIR/trait-object-macro-matcher.rs:18:8 + | +LL | m!(Copy + Send + 'static); //~ ERROR the trait `std::marker::Copy` cannot be made into an object + | ^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` cannot be made into an object + | + = note: the trait cannot require that `Self : Sized` + +error: aborting due to 2 previous errors + +Some errors occurred: E0038, E0224. +For more information about an error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/trait-object-safety.rs b/src/test/ui/compile-fail-migration/trait-object-safety.rs index baf239f5956..baf239f5956 100644 --- a/src/test/compile-fail/trait-object-safety.rs +++ b/src/test/ui/compile-fail-migration/trait-object-safety.rs diff --git a/src/test/ui/compile-fail-migration/trait-object-safety.stderr b/src/test/ui/compile-fail-migration/trait-object-safety.stderr new file mode 100644 index 00000000000..be0440db4da --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-object-safety.stderr @@ -0,0 +1,20 @@ +error[E0038]: the trait `Tr` cannot be made into an object + --> $DIR/trait-object-safety.rs:25:18 + | +LL | let _: &Tr = &St; //~ ERROR E0038 + | ^^^ the trait `Tr` cannot be made into an object + | + = note: method `foo` has no receiver + = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Tr>` for `&St` + +error[E0038]: the trait `Tr` cannot be made into an object + --> $DIR/trait-object-safety.rs:25:12 + | +LL | let _: &Tr = &St; //~ ERROR E0038 + | ^^^ the trait `Tr` cannot be made into an object + | + = note: method `foo` has no receiver + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/trait-object-vs-lifetime-2.rs b/src/test/ui/compile-fail-migration/trait-object-vs-lifetime-2.rs index 9801cac4714..9801cac4714 100644 --- a/src/test/compile-fail/trait-object-vs-lifetime-2.rs +++ b/src/test/ui/compile-fail-migration/trait-object-vs-lifetime-2.rs diff --git a/src/test/ui/compile-fail-migration/trait-object-vs-lifetime-2.stderr b/src/test/ui/compile-fail-migration/trait-object-vs-lifetime-2.stderr new file mode 100644 index 00000000000..db38aca2383 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-object-vs-lifetime-2.stderr @@ -0,0 +1,9 @@ +error[E0224]: at least one non-builtin trait is required for an object type + --> $DIR/trait-object-vs-lifetime-2.rs:19:5 + | +LL | 'static +: 'static + Copy, + | ^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0224`. diff --git a/src/test/compile-fail/trait-object-vs-lifetime.rs b/src/test/ui/compile-fail-migration/trait-object-vs-lifetime.rs index a70141edc29..a70141edc29 100644 --- a/src/test/compile-fail/trait-object-vs-lifetime.rs +++ b/src/test/ui/compile-fail-migration/trait-object-vs-lifetime.rs diff --git a/src/test/ui/compile-fail-migration/trait-object-vs-lifetime.stderr b/src/test/ui/compile-fail-migration/trait-object-vs-lifetime.stderr new file mode 100644 index 00000000000..d875e7d4845 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-object-vs-lifetime.stderr @@ -0,0 +1,34 @@ +error: lifetime parameters must be declared prior to type parameters + --> $DIR/trait-object-vs-lifetime.rs:26:25 + | +LL | let _: S<'static +, 'static>; + | ^^^^^^^ + +error[E0224]: at least one non-builtin trait is required for an object type + --> $DIR/trait-object-vs-lifetime.rs:21:23 + | +LL | let _: S<'static, 'static +>; + | ^^^^^^^^^ + +error[E0107]: wrong number of lifetime parameters: expected 1, found 2 + --> $DIR/trait-object-vs-lifetime.rs:23:12 + | +LL | let _: S<'static, 'static>; + | ^^^^^^^^^^^^^^^^^^^ unexpected lifetime parameter + +error[E0243]: wrong number of type arguments: expected 1, found 0 + --> $DIR/trait-object-vs-lifetime.rs:23:12 + | +LL | let _: S<'static, 'static>; + | ^^^^^^^^^^^^^^^^^^^ expected 1 type argument + +error[E0224]: at least one non-builtin trait is required for an object type + --> $DIR/trait-object-vs-lifetime.rs:26:14 + | +LL | let _: S<'static +, 'static>; + | ^^^^^^^^^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0107, E0224, E0243. +For more information about an error, try `rustc --explain E0107`. diff --git a/src/test/compile-fail/trait-or-new-type-instead.rs b/src/test/ui/compile-fail-migration/trait-or-new-type-instead.rs index b1e4d06affe..b1e4d06affe 100644 --- a/src/test/compile-fail/trait-or-new-type-instead.rs +++ b/src/test/ui/compile-fail-migration/trait-or-new-type-instead.rs diff --git a/src/test/ui/compile-fail-migration/trait-or-new-type-instead.stderr b/src/test/ui/compile-fail-migration/trait-or-new-type-instead.stderr new file mode 100644 index 00000000000..1b4d173c312 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-or-new-type-instead.stderr @@ -0,0 +1,14 @@ +error[E0116]: cannot define inherent `impl` for a type outside of the crate where the type is defined + --> $DIR/trait-or-new-type-instead.rs:11:1 + | +LL | / impl<T> Option<T> { +LL | | //~^ ERROR cannot define inherent `impl` for a type outside of the crate where the type is defined +LL | | pub fn foo(&self) { } +LL | | } + | |_^ impl for type defined outside of crate. + | + = note: define and implement a trait or new type instead + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0116`. diff --git a/src/test/compile-fail/trait-privacy.rs b/src/test/ui/compile-fail-migration/trait-privacy.rs index 5f9e8ba6c0a..5f9e8ba6c0a 100644 --- a/src/test/compile-fail/trait-privacy.rs +++ b/src/test/ui/compile-fail-migration/trait-privacy.rs diff --git a/src/test/ui/compile-fail-migration/trait-privacy.stderr b/src/test/ui/compile-fail-migration/trait-privacy.stderr new file mode 100644 index 00000000000..d38e869df8f --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-privacy.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/trait-privacy.rs:35:1 + | +LL | fn main() {} //~ ERROR compilation successful + | ^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/trait-resolution-in-overloaded-op.rs b/src/test/ui/compile-fail-migration/trait-resolution-in-overloaded-op.rs index 1f57c4cf93a..1f57c4cf93a 100644 --- a/src/test/compile-fail/trait-resolution-in-overloaded-op.rs +++ b/src/test/ui/compile-fail-migration/trait-resolution-in-overloaded-op.rs diff --git a/src/test/ui/compile-fail-migration/trait-resolution-in-overloaded-op.stderr b/src/test/ui/compile-fail-migration/trait-resolution-in-overloaded-op.stderr new file mode 100644 index 00000000000..ba20eae56c7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-resolution-in-overloaded-op.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `*` cannot be applied to type `&T` + --> $DIR/trait-resolution-in-overloaded-op.rs:18:5 + | +LL | a * b //~ ERROR binary operation `*` cannot be applied to type `&T` + | ^^^^^ + | + = note: an implementation of `std::ops::Mul` might be missing for `&T` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/trait-safety-inherent-impl.rs b/src/test/ui/compile-fail-migration/trait-safety-inherent-impl.rs index 059fdc100c9..059fdc100c9 100644 --- a/src/test/compile-fail/trait-safety-inherent-impl.rs +++ b/src/test/ui/compile-fail-migration/trait-safety-inherent-impl.rs diff --git a/src/test/ui/compile-fail-migration/trait-safety-inherent-impl.stderr b/src/test/ui/compile-fail-migration/trait-safety-inherent-impl.stderr new file mode 100644 index 00000000000..5154a591c4c --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-safety-inherent-impl.stderr @@ -0,0 +1,11 @@ +error[E0197]: inherent impls cannot be unsafe + --> $DIR/trait-safety-inherent-impl.rs:15:1 + | +LL | / unsafe impl SomeStruct { //~ ERROR inherent impls cannot be unsafe +LL | | fn foo(self) { } +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0197`. diff --git a/src/test/compile-fail/trait-safety-trait-impl-cc.rs b/src/test/ui/compile-fail-migration/trait-safety-trait-impl-cc.rs index f30c8f521bd..f30c8f521bd 100644 --- a/src/test/compile-fail/trait-safety-trait-impl-cc.rs +++ b/src/test/ui/compile-fail-migration/trait-safety-trait-impl-cc.rs diff --git a/src/test/ui/compile-fail-migration/trait-safety-trait-impl-cc.stderr b/src/test/ui/compile-fail-migration/trait-safety-trait-impl-cc.stderr new file mode 100644 index 00000000000..0611d2da02a --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-safety-trait-impl-cc.stderr @@ -0,0 +1,13 @@ +error[E0200]: the trait `lib::Foo` requires an `unsafe impl` declaration + --> $DIR/trait-safety-trait-impl-cc.rs:19:1 + | +LL | / impl lib::Foo for Bar { //~ ERROR requires an `unsafe impl` declaration +LL | | fn foo(&self) -> isize { +LL | | panic!(); +LL | | } +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0200`. diff --git a/src/test/compile-fail/trait-safety-trait-impl.rs b/src/test/ui/compile-fail-migration/trait-safety-trait-impl.rs index e846b660c2a..e846b660c2a 100644 --- a/src/test/compile-fail/trait-safety-trait-impl.rs +++ b/src/test/ui/compile-fail-migration/trait-safety-trait-impl.rs diff --git a/src/test/ui/compile-fail-migration/trait-safety-trait-impl.stderr b/src/test/ui/compile-fail-migration/trait-safety-trait-impl.stderr new file mode 100644 index 00000000000..137e9f7c043 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-safety-trait-impl.stderr @@ -0,0 +1,16 @@ +error[E0200]: the trait `UnsafeTrait` requires an `unsafe impl` declaration + --> $DIR/trait-safety-trait-impl.rs:24:1 + | +LL | impl UnsafeTrait for u16 { } //~ ERROR requires an `unsafe impl` declaration + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0199]: implementing the trait `SafeTrait` is not unsafe + --> $DIR/trait-safety-trait-impl.rs:26:1 + | +LL | unsafe impl SafeTrait for u32 { } //~ ERROR the trait `SafeTrait` is not unsafe + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0199, E0200. +For more information about an error, try `rustc --explain E0199`. diff --git a/src/test/compile-fail/trait-static-method-generic-inference.rs b/src/test/ui/compile-fail-migration/trait-static-method-generic-inference.rs index 0e357d9d4d5..0e357d9d4d5 100644 --- a/src/test/compile-fail/trait-static-method-generic-inference.rs +++ b/src/test/ui/compile-fail-migration/trait-static-method-generic-inference.rs diff --git a/src/test/ui/compile-fail-migration/trait-static-method-generic-inference.stderr b/src/test/ui/compile-fail-migration/trait-static-method-generic-inference.stderr new file mode 100644 index 00000000000..a903bd998f2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-static-method-generic-inference.stderr @@ -0,0 +1,15 @@ +error[E0283]: type annotations required: cannot resolve `_: base::HasNew<base::Foo>` + --> $DIR/trait-static-method-generic-inference.rs:34:25 + | +LL | let _f: base::Foo = base::HasNew::new(); + | ^^^^^^^^^^^^^^^^^ + | +note: required by `base::HasNew::new` + --> $DIR/trait-static-method-generic-inference.rs:18:9 + | +LL | fn new() -> T; + | ^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0283`. diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/ui/compile-fail-migration/trait-test-2.rs index b08aab6da85..b08aab6da85 100644 --- a/src/test/compile-fail/trait-test-2.rs +++ b/src/test/ui/compile-fail-migration/trait-test-2.rs diff --git a/src/test/ui/compile-fail-migration/trait-test-2.stderr b/src/test/ui/compile-fail-migration/trait-test-2.stderr new file mode 100644 index 00000000000..58e91447963 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-test-2.stderr @@ -0,0 +1,41 @@ +error[E0087]: too many type parameters provided: expected at most 0 type parameters, found 1 type parameter + --> $DIR/trait-test-2.rs:18:14 + | +LL | 10.dup::<i32>(); //~ ERROR expected at most 0 type parameters, found 1 type parameter + | ^^^ expected 0 type parameters + +error[E0087]: too many type parameters provided: expected at most 1 type parameter, found 2 type parameters + --> $DIR/trait-test-2.rs:19:20 + | +LL | 10.blah::<i32, i32>(); //~ ERROR expected at most 1 type parameter, found 2 type parameters + | ^^^ expected 1 type parameter + +error[E0277]: the trait bound `dyn bar: bar` is not satisfied + --> $DIR/trait-test-2.rs:20:26 + | +LL | (box 10 as Box<bar>).dup(); + | ^^^ the trait `bar` is not implemented for `dyn bar` + +error[E0038]: the trait `bar` cannot be made into an object + --> $DIR/trait-test-2.rs:20:16 + | +LL | (box 10 as Box<bar>).dup(); + | ^^^^^^^^ the trait `bar` cannot be made into an object + | + = note: method `dup` references the `Self` type in its arguments or return type + = note: method `blah` has generic type parameters + +error[E0038]: the trait `bar` cannot be made into an object + --> $DIR/trait-test-2.rs:20:6 + | +LL | (box 10 as Box<bar>).dup(); + | ^^^^^^ the trait `bar` cannot be made into an object + | + = note: method `dup` references the `Self` type in its arguments or return type + = note: method `blah` has generic type parameters + = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<std::boxed::Box<dyn bar>>` for `std::boxed::Box<{integer}>` + +error: aborting due to 5 previous errors + +Some errors occurred: E0038, E0087, E0277. +For more information about an error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/trait-test.rs b/src/test/ui/compile-fail-migration/trait-test.rs index d53e353d9d9..d53e353d9d9 100644 --- a/src/test/compile-fail/trait-test.rs +++ b/src/test/ui/compile-fail-migration/trait-test.rs diff --git a/src/test/ui/compile-fail-migration/trait-test.stderr b/src/test/ui/compile-fail-migration/trait-test.stderr new file mode 100644 index 00000000000..89dbb3dee87 --- /dev/null +++ b/src/test/ui/compile-fail-migration/trait-test.stderr @@ -0,0 +1,9 @@ +error[E0404]: expected trait, found builtin type `isize` + --> $DIR/trait-test.rs:13:6 + | +LL | impl isize for usize { fn foo(&self) {} } //~ ERROR trait + | ^^^^^ not a trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0404`. diff --git a/src/test/compile-fail/traits-assoc-type-in-supertrait-bad.rs b/src/test/ui/compile-fail-migration/traits-assoc-type-in-supertrait-bad.rs index 971869ba85b..971869ba85b 100644 --- a/src/test/compile-fail/traits-assoc-type-in-supertrait-bad.rs +++ b/src/test/ui/compile-fail-migration/traits-assoc-type-in-supertrait-bad.rs diff --git a/src/test/ui/compile-fail-migration/traits-assoc-type-in-supertrait-bad.stderr b/src/test/ui/compile-fail-migration/traits-assoc-type-in-supertrait-bad.stderr new file mode 100644 index 00000000000..bf5e8a77f83 --- /dev/null +++ b/src/test/ui/compile-fail-migration/traits-assoc-type-in-supertrait-bad.stderr @@ -0,0 +1,12 @@ +error[E0271]: type mismatch resolving `<std::vec::IntoIter<i32> as std::iter::Iterator>::Item == u32` + --> $DIR/traits-assoc-type-in-supertrait-bad.rs:21:6 + | +LL | impl Foo for IntoIter<i32> { //~ ERROR type mismatch + | ^^^ expected i32, found u32 + | + = note: expected type `i32` + found type `u32` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/compile-fail/traits-inductive-overflow-simultaneous.rs b/src/test/ui/compile-fail-migration/traits-inductive-overflow-simultaneous.rs index 777746a189c..777746a189c 100644 --- a/src/test/compile-fail/traits-inductive-overflow-simultaneous.rs +++ b/src/test/ui/compile-fail-migration/traits-inductive-overflow-simultaneous.rs diff --git a/src/test/ui/compile-fail-migration/traits-inductive-overflow-simultaneous.stderr b/src/test/ui/compile-fail-migration/traits-inductive-overflow-simultaneous.stderr new file mode 100644 index 00000000000..7eabb00935c --- /dev/null +++ b/src/test/ui/compile-fail-migration/traits-inductive-overflow-simultaneous.stderr @@ -0,0 +1,16 @@ +error[E0275]: overflow evaluating the requirement `{integer}: Tweedledum` + --> $DIR/traits-inductive-overflow-simultaneous.rs:28:5 + | +LL | is_ee(4); + | ^^^^^ + | + = note: required because of the requirements on the impl of `Combo` for `{integer}` +note: required by `is_ee` + --> $DIR/traits-inductive-overflow-simultaneous.rs:23:1 + | +LL | fn is_ee<T: Combo>(t: T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/compile-fail/traits-inductive-overflow-supertrait-oibit.rs b/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait-oibit.rs index 59d5dc6c58b..59d5dc6c58b 100644 --- a/src/test/compile-fail/traits-inductive-overflow-supertrait-oibit.rs +++ b/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait-oibit.rs diff --git a/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait-oibit.stderr b/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait-oibit.stderr new file mode 100644 index 00000000000..5438cc54dc6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait-oibit.stderr @@ -0,0 +1,23 @@ +error[E0568]: auto traits cannot have super traits + --> $DIR/traits-inductive-overflow-supertrait-oibit.rs:17:1 + | +LL | auto trait Magic: Copy {} //~ ERROR E0568 + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `NoClone: std::marker::Copy` is not satisfied + --> $DIR/traits-inductive-overflow-supertrait-oibit.rs:25:18 + | +LL | let (a, b) = copy(NoClone); //~ ERROR + | ^^^^ the trait `std::marker::Copy` is not implemented for `NoClone` + | + = note: required because of the requirements on the impl of `Magic` for `NoClone` +note: required by `copy` + --> $DIR/traits-inductive-overflow-supertrait-oibit.rs:19:1 + | +LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0568. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/traits-inductive-overflow-supertrait.rs b/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait.rs index c717ae9639f..c717ae9639f 100644 --- a/src/test/compile-fail/traits-inductive-overflow-supertrait.rs +++ b/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait.rs diff --git a/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait.stderr b/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait.stderr new file mode 100644 index 00000000000..6f0929d696f --- /dev/null +++ b/src/test/ui/compile-fail-migration/traits-inductive-overflow-supertrait.stderr @@ -0,0 +1,16 @@ +error[E0275]: overflow evaluating the requirement `NoClone: Magic` + --> $DIR/traits-inductive-overflow-supertrait.rs:23:18 + | +LL | let (a, b) = copy(NoClone); //~ ERROR E0275 + | ^^^^ + | + = note: required because of the requirements on the impl of `Magic` for `NoClone` +note: required by `copy` + --> $DIR/traits-inductive-overflow-supertrait.rs:17:1 + | +LL | fn copy<T: Magic>(x: T) -> (T, T) { (x, x) } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/compile-fail/traits-inductive-overflow-two-traits.rs b/src/test/ui/compile-fail-migration/traits-inductive-overflow-two-traits.rs index c622dca2b4d..c622dca2b4d 100644 --- a/src/test/compile-fail/traits-inductive-overflow-two-traits.rs +++ b/src/test/ui/compile-fail-migration/traits-inductive-overflow-two-traits.rs diff --git a/src/test/ui/compile-fail-migration/traits-inductive-overflow-two-traits.stderr b/src/test/ui/compile-fail-migration/traits-inductive-overflow-two-traits.stderr new file mode 100644 index 00000000000..900ed1b2e8b --- /dev/null +++ b/src/test/ui/compile-fail-migration/traits-inductive-overflow-two-traits.stderr @@ -0,0 +1,15 @@ +error[E0275]: overflow evaluating the requirement `*mut (): Magic` + --> $DIR/traits-inductive-overflow-two-traits.rs:29:5 + | +LL | wizard::<*mut ()>(); //~ ERROR E0275 + | ^^^^^^^^^^^^^^^^^ + | +note: required by `wizard` + --> $DIR/traits-inductive-overflow-two-traits.rs:26:1 + | +LL | fn wizard<T: Magic>() { check::<<T as Magic>::X>(); } + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0275`. diff --git a/src/test/compile-fail/traits-issue-23003-overflow.rs b/src/test/ui/compile-fail-migration/traits-issue-23003-overflow.rs index 80d2884ee60..80d2884ee60 100644 --- a/src/test/compile-fail/traits-issue-23003-overflow.rs +++ b/src/test/ui/compile-fail-migration/traits-issue-23003-overflow.rs diff --git a/src/test/ui/compile-fail-migration/traits-issue-23003-overflow.stderr b/src/test/ui/compile-fail-migration/traits-issue-23003-overflow.stderr new file mode 100644 index 00000000000..3c26e426a4e --- /dev/null +++ b/src/test/ui/compile-fail-migration/traits-issue-23003-overflow.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/traits-issue-23003-overflow.rs:39:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/traits-multidispatch-bad.rs b/src/test/ui/compile-fail-migration/traits-multidispatch-bad.rs index 392eccf0f31..392eccf0f31 100644 --- a/src/test/compile-fail/traits-multidispatch-bad.rs +++ b/src/test/ui/compile-fail-migration/traits-multidispatch-bad.rs diff --git a/src/test/ui/compile-fail-migration/traits-multidispatch-bad.stderr b/src/test/ui/compile-fail-migration/traits-multidispatch-bad.stderr new file mode 100644 index 00000000000..6068edea585 --- /dev/null +++ b/src/test/ui/compile-fail-migration/traits-multidispatch-bad.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/traits-multidispatch-bad.rs:29:17 + | +LL | test(22i32, 44i32); //~ ERROR mismatched types + | ^^^^^ expected u32, found i32 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/traits-negative-impls.rs b/src/test/ui/compile-fail-migration/traits-negative-impls.rs index a272686c535..a272686c535 100644 --- a/src/test/compile-fail/traits-negative-impls.rs +++ b/src/test/ui/compile-fail-migration/traits-negative-impls.rs diff --git a/src/test/ui/compile-fail-migration/traits-negative-impls.stderr b/src/test/ui/compile-fail-migration/traits-negative-impls.stderr new file mode 100644 index 00000000000..0d10f4863d3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/traits-negative-impls.stderr @@ -0,0 +1,101 @@ +error[E0277]: `dummy::TestType` cannot be sent between threads safely + --> $DIR/traits-negative-impls.rs:33:5 + | +LL | Outer(TestType); + | ^^^^^ `dummy::TestType` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `dummy::TestType` +note: required by `Outer` + --> $DIR/traits-negative-impls.rs:20:1 + | +LL | struct Outer<T: Send>(T); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `dummy::TestType` cannot be sent between threads safely + --> $DIR/traits-negative-impls.rs:33:5 + | +LL | Outer(TestType); + | ^^^^^^^^^^^^^^^ `dummy::TestType` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `dummy::TestType` +note: required by `Outer` + --> $DIR/traits-negative-impls.rs:20:1 + | +LL | struct Outer<T: Send>(T); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `dummy1b::TestType` cannot be sent between threads safely + --> $DIR/traits-negative-impls.rs:42:5 + | +LL | is_send(TestType); + | ^^^^^^^ `dummy1b::TestType` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `dummy1b::TestType` +note: required by `is_send` + --> $DIR/traits-negative-impls.rs:26:1 + | +LL | fn is_send<T: Send>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `dummy1c::TestType` cannot be sent between threads safely + --> $DIR/traits-negative-impls.rs:50:5 + | +LL | is_send((8, TestType)); + | ^^^^^^^ `dummy1c::TestType` cannot be sent between threads safely + | + = help: within `({integer}, dummy1c::TestType)`, the trait `std::marker::Send` is not implemented for `dummy1c::TestType` + = note: required because it appears within the type `({integer}, dummy1c::TestType)` +note: required by `is_send` + --> $DIR/traits-negative-impls.rs:26:1 + | +LL | fn is_send<T: Send>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `dummy2::TestType` cannot be sent between threads safely + --> $DIR/traits-negative-impls.rs:58:5 + | +LL | is_send(Box::new(TestType)); + | ^^^^^^^ `dummy2::TestType` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `dummy2::TestType` + = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<dummy2::TestType>` + = note: required because it appears within the type `std::boxed::Box<dummy2::TestType>` +note: required by `is_send` + --> $DIR/traits-negative-impls.rs:26:1 + | +LL | fn is_send<T: Send>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `dummy3::TestType` cannot be sent between threads safely + --> $DIR/traits-negative-impls.rs:66:5 + | +LL | is_send(Box::new(Outer2(TestType))); + | ^^^^^^^ `dummy3::TestType` cannot be sent between threads safely + | + = help: within `Outer2<dummy3::TestType>`, the trait `std::marker::Send` is not implemented for `dummy3::TestType` + = note: required because it appears within the type `Outer2<dummy3::TestType>` + = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<Outer2<dummy3::TestType>>` + = note: required because it appears within the type `std::boxed::Box<Outer2<dummy3::TestType>>` +note: required by `is_send` + --> $DIR/traits-negative-impls.rs:26:1 + | +LL | fn is_send<T: Send>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `main::TestType` cannot be sent between threads safely + --> $DIR/traits-negative-impls.rs:76:5 + | +LL | is_sync(Outer2(TestType)); + | ^^^^^^^ `main::TestType` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `main::TestType` + = note: required because of the requirements on the impl of `std::marker::Sync` for `Outer2<main::TestType>` +note: required by `is_sync` + --> $DIR/traits-negative-impls.rs:27:1 + | +LL | fn is_sync<T: Sync>(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/traits-repeated-supertrait-ambig.rs b/src/test/ui/compile-fail-migration/traits-repeated-supertrait-ambig.rs index 559871af72e..559871af72e 100644 --- a/src/test/compile-fail/traits-repeated-supertrait-ambig.rs +++ b/src/test/ui/compile-fail-migration/traits-repeated-supertrait-ambig.rs diff --git a/src/test/ui/compile-fail-migration/traits-repeated-supertrait-ambig.stderr b/src/test/ui/compile-fail-migration/traits-repeated-supertrait-ambig.stderr new file mode 100644 index 00000000000..87d3c8117d3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/traits-repeated-supertrait-ambig.stderr @@ -0,0 +1,52 @@ +error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:36:7 + | +LL | c.same_as(22) //~ ERROR `dyn CompareToInts: CompareTo<i32>` is not satisfied + | ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts` + +error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:40:7 + | +LL | c.same_as(22) //~ ERROR `C: CompareTo<i32>` is not satisfied + | ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `C` + | + = help: consider adding a `where C: CompareTo<i32>` bound + +error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:44:5 + | +LL | CompareToInts::same_as(c, 22) //~ ERROR `dyn CompareToInts: CompareTo<i32>` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `CompareTo<i32>` is not implemented for `dyn CompareToInts` + | +note: required by `CompareTo::same_as` + --> $DIR/traits-repeated-supertrait-ambig.rs:19:5 + | +LL | fn same_as(&self, t: T) -> bool; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `C: CompareTo<i32>` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:48:5 + | +LL | CompareTo::same_as(c, 22) //~ ERROR `C: CompareTo<i32>` is not satisfied + | ^^^^^^^^^^^^^^^^^^ the trait `CompareTo<i32>` is not implemented for `C` + | + = help: consider adding a `where C: CompareTo<i32>` bound +note: required by `CompareTo::same_as` + --> $DIR/traits-repeated-supertrait-ambig.rs:19:5 + | +LL | fn same_as(&self, t: T) -> bool; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `i64: CompareTo<i32>` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:52:23 + | +LL | assert_eq!(22_i64.same_as(22), true); //~ ERROR `i64: CompareTo<i32>` is not satisfied + | ^^^^^^^ the trait `CompareTo<i32>` is not implemented for `i64` + | + = help: the following implementations were found: + <i64 as CompareTo<i64>> + <i64 as CompareTo<u64>> + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/transmute-different-sizes.rs b/src/test/ui/compile-fail-migration/transmute-different-sizes.rs index 113e2ed4c80..113e2ed4c80 100644 --- a/src/test/compile-fail/transmute-different-sizes.rs +++ b/src/test/ui/compile-fail-migration/transmute-different-sizes.rs diff --git a/src/test/ui/compile-fail-migration/transmute-different-sizes.stderr b/src/test/ui/compile-fail-migration/transmute-different-sizes.stderr new file mode 100644 index 00000000000..e33e0e93fd1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/transmute-different-sizes.stderr @@ -0,0 +1,30 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-different-sizes.rs:19:17 + | +LL | let _: i8 = transmute(16i16); + | ^^^^^^^^^ + | + = note: source type: i16 (16 bits) + = note: target type: i8 (8 bits) + +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-different-sizes.rs:24:17 + | +LL | let _: i8 = transmute(x); + | ^^^^^^^^^ + | + = note: source type: &T (64 bits) + = note: target type: i8 (8 bits) + +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-different-sizes.rs:35:5 + | +LL | transmute(x) + | ^^^^^^^^^ + | + = note: source type: u16 (16 bits) + = note: target type: <T as Specializable>::Output (this type's size can vary) + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/compile-fail/transmute-fat-pointers.rs b/src/test/ui/compile-fail-migration/transmute-fat-pointers.rs index 59027fc7787..59027fc7787 100644 --- a/src/test/compile-fail/transmute-fat-pointers.rs +++ b/src/test/ui/compile-fail-migration/transmute-fat-pointers.rs diff --git a/src/test/ui/compile-fail-migration/transmute-fat-pointers.stderr b/src/test/ui/compile-fail-migration/transmute-fat-pointers.stderr new file mode 100644 index 00000000000..e5d9459e3ec --- /dev/null +++ b/src/test/ui/compile-fail-migration/transmute-fat-pointers.stderr @@ -0,0 +1,39 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-fat-pointers.rs:18:14 + | +LL | unsafe { transmute(x) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^ + | + = note: source type: &[T] (128 bits) + = note: target type: &U (pointer to U) + +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-fat-pointers.rs:22:14 + | +LL | unsafe { transmute(x) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^ + | + = note: source type: &T (pointer to T) + = note: target type: &U (pointer to U) + +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-fat-pointers.rs:34:14 + | +LL | unsafe { transmute(x) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^ + | + = note: source type: &T (pointer to T) + = note: target type: &U (64 bits) + +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-fat-pointers.rs:38:14 + | +LL | unsafe { transmute(x) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^ + | + = note: source type: &T (64 bits) + = note: target type: &U (pointer to U) + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/compile-fail/transmute-impl.rs b/src/test/ui/compile-fail-migration/transmute-impl.rs index 2f8f9e46e1a..2f8f9e46e1a 100644 --- a/src/test/compile-fail/transmute-impl.rs +++ b/src/test/ui/compile-fail-migration/transmute-impl.rs diff --git a/src/test/ui/compile-fail-migration/transmute-impl.stderr b/src/test/ui/compile-fail-migration/transmute-impl.stderr new file mode 100644 index 00000000000..f435e28976b --- /dev/null +++ b/src/test/ui/compile-fail-migration/transmute-impl.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-impl.rs:29:18 + | +LL | unsafe { transmute(x) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^ + | + = note: source type: &T (pointer to T) + = note: target type: &isize (64 bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/compile-fail/transmute-imut-to-mut.rs b/src/test/ui/compile-fail-migration/transmute-imut-to-mut.rs index 62db4c5d366..62db4c5d366 100644 --- a/src/test/compile-fail/transmute-imut-to-mut.rs +++ b/src/test/ui/compile-fail-migration/transmute-imut-to-mut.rs diff --git a/src/test/ui/compile-fail-migration/transmute-imut-to-mut.stderr b/src/test/ui/compile-fail-migration/transmute-imut-to-mut.stderr new file mode 100644 index 00000000000..4434e35af7f --- /dev/null +++ b/src/test/ui/compile-fail-migration/transmute-imut-to-mut.stderr @@ -0,0 +1,10 @@ +error: mutating transmuted &mut T from &T may cause undefined behavior, consider instead using an UnsafeCell + --> $DIR/transmute-imut-to-mut.rs:16:32 + | +LL | let _a: &mut u8 = unsafe { transmute(&1u8) }; + | ^^^^^^^^^ + | + = note: #[deny(mutable_transmutes)] on by default + +error: aborting due to previous error + diff --git a/src/test/compile-fail/trivial_casts.rs b/src/test/ui/compile-fail-migration/trivial_casts.rs index 3f2bd2ffabf..3f2bd2ffabf 100644 --- a/src/test/compile-fail/trivial_casts.rs +++ b/src/test/ui/compile-fail-migration/trivial_casts.rs diff --git a/src/test/ui/compile-fail-migration/trivial_casts.stderr b/src/test/ui/compile-fail-migration/trivial_casts.stderr new file mode 100644 index 00000000000..dc2a6a058bd --- /dev/null +++ b/src/test/ui/compile-fail-migration/trivial_casts.stderr @@ -0,0 +1,164 @@ +error: trivial numeric cast: `i32` as `i32` + --> $DIR/trivial_casts.rs:26:13 + | +LL | let _ = 42_i32 as i32; //~ ERROR trivial numeric cast: `i32` as `i32` + | ^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/trivial_casts.rs:14:24 + | +LL | #![deny(trivial_casts, trivial_numeric_casts)] + | ^^^^^^^^^^^^^^^^^^^^^ + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial numeric cast: `u8` as `u8` + --> $DIR/trivial_casts.rs:29:13 + | +LL | let _ = 42_u8 as u8; //~ ERROR trivial numeric cast: `u8` as `u8` + | ^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&u32` as `*const u32` + --> $DIR/trivial_casts.rs:34:13 + | +LL | let _ = x as *const u32; //~ERROR trivial cast: `&u32` as `*const u32` + | ^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/trivial_casts.rs:14:9 + | +LL | #![deny(trivial_casts, trivial_numeric_casts)] + | ^^^^^^^^^^^^^ + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&mut u32` as `*mut u32` + --> $DIR/trivial_casts.rs:38:13 + | +LL | let _ = x as *mut u32; //~ERROR trivial cast: `&mut u32` as `*mut u32` + | ^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&[u32; 3]` as `&[u32]` + --> $DIR/trivial_casts.rs:43:13 + | +LL | let _ = x as &[u32]; //~ERROR trivial cast: `&[u32; 3]` as `&[u32]` + | ^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&[u32; 3]` as `*const [u32]` + --> $DIR/trivial_casts.rs:44:13 + | +LL | let _ = x as *const [u32]; //~ERROR trivial cast: `&[u32; 3]` as `*const [u32]` + | ^^^^^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&mut [u32; 3]` as `&mut [u32]` + --> $DIR/trivial_casts.rs:49:13 + | +LL | let _ = x as &mut [u32]; //~ERROR trivial cast: `&mut [u32; 3]` as `&mut [u32]` + | ^^^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&mut [u32; 3]` as `*mut [u32]` + --> $DIR/trivial_casts.rs:50:13 + | +LL | let _ = x as *mut [u32]; //~ERROR trivial cast: `&mut [u32; 3]` as `*mut [u32]` + | ^^^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `std::boxed::Box<[u32; 3]>` as `std::boxed::Box<[u32]>` + --> $DIR/trivial_casts.rs:55:13 + | +LL | let _ = x as Box<[u32]>; + | ^^^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&Bar` as `&dyn Foo` + --> $DIR/trivial_casts.rs:62:13 + | +LL | let _ = x as &Foo; //~ERROR trivial cast: `&Bar` as `&dyn Foo` + | ^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&Bar` as `*const dyn Foo` + --> $DIR/trivial_casts.rs:63:13 + | +LL | let _ = x as *const Foo; //~ERROR trivial cast: `&Bar` as `*const dyn Foo` + | ^^^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&mut Bar` as `&mut dyn Foo` + --> $DIR/trivial_casts.rs:68:13 + | +LL | let _ = x as &mut Foo; //~ERROR trivial cast: `&mut Bar` as `&mut dyn Foo` + | ^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&mut Bar` as `*mut dyn Foo` + --> $DIR/trivial_casts.rs:69:13 + | +LL | let _ = x as *mut Foo; //~ERROR trivial cast: `&mut Bar` as `*mut dyn Foo` + | ^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `std::boxed::Box<Bar>` as `std::boxed::Box<dyn Foo>` + --> $DIR/trivial_casts.rs:74:13 + | +LL | let _ = x as Box<Foo>; //~ERROR `std::boxed::Box<Bar>` as `std::boxed::Box<dyn Foo>` + | ^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&fn(i32) {main::baz}` as `&dyn std::ops::Fn(i32)` + --> $DIR/trivial_casts.rs:80:13 + | +LL | let _ = &baz as &Fn(i32); //~ERROR `&fn(i32) {main::baz}` as `&dyn std::ops::Fn(i32)` + | ^^^^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&[closure@$DIR/trivial_casts.rs:82:13: 82:25]` as `&dyn std::ops::Fn(i32)` + --> $DIR/trivial_casts.rs:83:13 + | +LL | let _ = &x as &Fn(i32); //~ERROR trivial cast + | ^^^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&'a Bar` as `&'a Bar` + --> $DIR/trivial_casts.rs:89:13 + | +LL | let _ = a as &'a Bar; //~ERROR trivial cast + | ^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&'b Bar` as `&'a Bar` + --> $DIR/trivial_casts.rs:91:13 + | +LL | let _ = b as &'a Bar; //~ERROR trivial cast + | ^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: trivial cast: `&'b Bar` as `&'b Bar` + --> $DIR/trivial_casts.rs:93:13 + | +LL | let _ = b as &'b Bar; //~ERROR trivial cast + | ^^^^^^^^^^^^ + | + = help: cast can be replaced by coercion; this might require a temporary variable + +error: aborting due to 19 previous errors + diff --git a/src/test/compile-fail/tuple-arity-mismatch.rs b/src/test/ui/compile-fail-migration/tuple-arity-mismatch.rs index a71f4410294..a71f4410294 100644 --- a/src/test/compile-fail/tuple-arity-mismatch.rs +++ b/src/test/ui/compile-fail-migration/tuple-arity-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/tuple-arity-mismatch.stderr b/src/test/ui/compile-fail-migration/tuple-arity-mismatch.stderr new file mode 100644 index 00000000000..574a1f0a5c9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/tuple-arity-mismatch.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/tuple-arity-mismatch.rs:16:20 + | +LL | let y = first ((1,2.0,3)); + | ^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements + | + = note: expected type `(isize, f64)` + found type `(isize, f64, {integer})` + +error[E0308]: mismatched types + --> $DIR/tuple-arity-mismatch.rs:22:20 + | +LL | let y = first ((1,)); + | ^^^^ expected a tuple with 2 elements, found one with 1 elements + | + = note: expected type `(isize, f64)` + found type `(isize,)` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/tuple-index-not-tuple.rs b/src/test/ui/compile-fail-migration/tuple-index-not-tuple.rs index 471104d6872..471104d6872 100644 --- a/src/test/compile-fail/tuple-index-not-tuple.rs +++ b/src/test/ui/compile-fail-migration/tuple-index-not-tuple.rs diff --git a/src/test/ui/compile-fail-migration/tuple-index-not-tuple.stderr b/src/test/ui/compile-fail-migration/tuple-index-not-tuple.stderr new file mode 100644 index 00000000000..fa0d0b4172b --- /dev/null +++ b/src/test/ui/compile-fail-migration/tuple-index-not-tuple.stderr @@ -0,0 +1,15 @@ +error[E0609]: no field `0` on type `Point` + --> $DIR/tuple-index-not-tuple.rs:16:12 + | +LL | origin.0; + | ^ did you mean `x`? + +error[E0609]: no field `0` on type `Empty` + --> $DIR/tuple-index-not-tuple.rs:18:11 + | +LL | Empty.0; + | ^ unknown field + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/compile-fail/tuple-index-out-of-bounds.rs b/src/test/ui/compile-fail-migration/tuple-index-out-of-bounds.rs index 35b843676b4..35b843676b4 100644 --- a/src/test/compile-fail/tuple-index-out-of-bounds.rs +++ b/src/test/ui/compile-fail-migration/tuple-index-out-of-bounds.rs diff --git a/src/test/ui/compile-fail-migration/tuple-index-out-of-bounds.stderr b/src/test/ui/compile-fail-migration/tuple-index-out-of-bounds.stderr new file mode 100644 index 00000000000..068e83ab091 --- /dev/null +++ b/src/test/ui/compile-fail-migration/tuple-index-out-of-bounds.stderr @@ -0,0 +1,15 @@ +error[E0609]: no field `2` on type `Point` + --> $DIR/tuple-index-out-of-bounds.rs:17:12 + | +LL | origin.2; + | ^ did you mean `0`? + +error[E0609]: no field `2` on type `({integer}, {integer})` + --> $DIR/tuple-index-out-of-bounds.rs:22:11 + | +LL | tuple.2; + | ^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/compile-fail/tuple-struct-nonexhaustive.rs b/src/test/ui/compile-fail-migration/tuple-struct-nonexhaustive.rs index e4fda6dd534..e4fda6dd534 100644 --- a/src/test/compile-fail/tuple-struct-nonexhaustive.rs +++ b/src/test/ui/compile-fail-migration/tuple-struct-nonexhaustive.rs diff --git a/src/test/ui/compile-fail-migration/tuple-struct-nonexhaustive.stderr b/src/test/ui/compile-fail-migration/tuple-struct-nonexhaustive.stderr new file mode 100644 index 00000000000..ee274bedbb8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/tuple-struct-nonexhaustive.stderr @@ -0,0 +1,9 @@ +error[E0004]: non-exhaustive patterns: `Foo(_, _)` not covered + --> $DIR/tuple-struct-nonexhaustive.rs:15:11 + | +LL | match x { //~ ERROR non-exhaustive + | ^ pattern `Foo(_, _)` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/tutorial-suffix-inference-test.rs b/src/test/ui/compile-fail-migration/tutorial-suffix-inference-test.rs index dadf7eb91d8..dadf7eb91d8 100644 --- a/src/test/compile-fail/tutorial-suffix-inference-test.rs +++ b/src/test/ui/compile-fail-migration/tutorial-suffix-inference-test.rs diff --git a/src/test/ui/compile-fail-migration/tutorial-suffix-inference-test.stderr b/src/test/ui/compile-fail-migration/tutorial-suffix-inference-test.stderr new file mode 100644 index 00000000000..d315f9b87f9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/tutorial-suffix-inference-test.stderr @@ -0,0 +1,25 @@ +error[E0308]: mismatched types + --> $DIR/tutorial-suffix-inference-test.rs:19:18 + | +LL | identity_u16(x); + | ^ expected u16, found u8 +help: you can cast an `u8` to `u16`, which will zero-extend the source value + | +LL | identity_u16(x.into()); + | ^^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/tutorial-suffix-inference-test.rs:22:18 + | +LL | identity_u16(y); + | ^ expected u16, found i32 + +error[E0308]: mismatched types + --> $DIR/tutorial-suffix-inference-test.rs:31:18 + | +LL | identity_u16(a); + | ^ expected u16, found isize + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/type-arg-out-of-scope.rs b/src/test/ui/compile-fail-migration/type-arg-out-of-scope.rs index 04cd961e97f..04cd961e97f 100644 --- a/src/test/compile-fail/type-arg-out-of-scope.rs +++ b/src/test/ui/compile-fail-migration/type-arg-out-of-scope.rs diff --git a/src/test/ui/compile-fail-migration/type-arg-out-of-scope.stderr b/src/test/ui/compile-fail-migration/type-arg-out-of-scope.stderr new file mode 100644 index 00000000000..20bf303129f --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-arg-out-of-scope.stderr @@ -0,0 +1,23 @@ +error[E0401]: can't use type parameters from outer function + --> $DIR/type-arg-out-of-scope.rs:13:25 + | +LL | fn foo<T>(x: T) { + | - type variable from outer function +LL | fn bar(f: Box<FnMut(T) -> T>) { } + | --- ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `bar<T>` + +error[E0401]: can't use type parameters from outer function + --> $DIR/type-arg-out-of-scope.rs:13:31 + | +LL | fn foo<T>(x: T) { + | - type variable from outer function +LL | fn bar(f: Box<FnMut(T) -> T>) { } + | --- ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `bar<T>` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/compile-fail/type-ascription-precedence.rs b/src/test/ui/compile-fail-migration/type-ascription-precedence.rs index bb7a8bc3ddf..bb7a8bc3ddf 100644 --- a/src/test/compile-fail/type-ascription-precedence.rs +++ b/src/test/ui/compile-fail-migration/type-ascription-precedence.rs diff --git a/src/test/ui/compile-fail-migration/type-ascription-precedence.stderr b/src/test/ui/compile-fail-migration/type-ascription-precedence.stderr new file mode 100644 index 00000000000..252b5231220 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-ascription-precedence.stderr @@ -0,0 +1,72 @@ +error[E0308]: mismatched types + --> $DIR/type-ascription-precedence.rs:41:7 + | +LL | &(S: &S); //~ ERROR mismatched types + | ^ expected &S, found struct `S` + | + = note: expected type `&S` + found type `S` + +error[E0308]: mismatched types + --> $DIR/type-ascription-precedence.rs:45:7 + | +LL | *(S: Z); //~ ERROR mismatched types + | ^ expected struct `Z`, found struct `S` + | + = note: expected type `Z` + found type `S` + +error[E0614]: type `Z` cannot be dereferenced + --> $DIR/type-ascription-precedence.rs:45:5 + | +LL | *(S: Z); //~ ERROR mismatched types + | ^^^^^^^ + +error[E0308]: mismatched types + --> $DIR/type-ascription-precedence.rs:50:7 + | +LL | -(S: Z); //~ ERROR mismatched types + | ^ expected struct `Z`, found struct `S` + | + = note: expected type `Z` + found type `S` + +error[E0600]: cannot apply unary operator `-` to type `Z` + --> $DIR/type-ascription-precedence.rs:50:5 + | +LL | -(S: Z); //~ ERROR mismatched types + | ^^^^^^^ cannot apply unary operator `-` + | + = note: an implementation of `std::ops::Neg` might be missing for `Z` + +error[E0308]: mismatched types + --> $DIR/type-ascription-precedence.rs:55:5 + | +LL | (S + Z): Z; //~ ERROR mismatched types + | ^^^^^^^ expected struct `Z`, found struct `S` + | + = note: expected type `Z` + found type `S` + +error[E0308]: mismatched types + --> $DIR/type-ascription-precedence.rs:59:5 + | +LL | (S * Z): Z; //~ ERROR mismatched types + | ^^^^^^^ expected struct `Z`, found struct `S` + | + = note: expected type `Z` + found type `S` + +error[E0308]: mismatched types + --> $DIR/type-ascription-precedence.rs:63:5 + | +LL | (S .. S): S; //~ ERROR mismatched types + | ^^^^^^^^ expected struct `S`, found struct `std::ops::Range` + | + = note: expected type `S` + found type `std::ops::Range<S>` + +error: aborting due to 8 previous errors + +Some errors occurred: E0308, E0600, E0614. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/type-ascription-soundness.rs b/src/test/ui/compile-fail-migration/type-ascription-soundness.rs index 2d882e87ab8..2d882e87ab8 100644 --- a/src/test/compile-fail/type-ascription-soundness.rs +++ b/src/test/ui/compile-fail-migration/type-ascription-soundness.rs diff --git a/src/test/ui/compile-fail-migration/type-ascription-soundness.stderr b/src/test/ui/compile-fail-migration/type-ascription-soundness.stderr new file mode 100644 index 00000000000..3dcd6ff49b3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-ascription-soundness.stderr @@ -0,0 +1,39 @@ +error[E0308]: mismatched types + --> $DIR/type-ascription-soundness.rs:17:17 + | +LL | let ref x = arr: &[u8]; //~ ERROR mismatched types + | ^^^ expected slice, found array of 3 elements + | + = note: expected type `&[u8]` + found type `&[u8; 3]` + +error[E0308]: mismatched types + --> $DIR/type-ascription-soundness.rs:18:21 + | +LL | let ref mut x = arr: &[u8]; //~ ERROR mismatched types + | ^^^ expected slice, found array of 3 elements + | + = note: expected type `&[u8]` + found type `&[u8; 3]` + +error[E0308]: mismatched types + --> $DIR/type-ascription-soundness.rs:19:11 + | +LL | match arr: &[u8] { //~ ERROR mismatched types + | ^^^ expected slice, found array of 3 elements + | + = note: expected type `&[u8]` + found type `&[u8; 3]` + +error[E0308]: mismatched types + --> $DIR/type-ascription-soundness.rs:22:17 + | +LL | let _len = (arr: &[u8]).len(); //~ ERROR mismatched types + | ^^^ expected slice, found array of 3 elements + | + = note: expected type `&[u8]` + found type `&[u8; 3]` + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/type-mismatch-multiple.rs b/src/test/ui/compile-fail-migration/type-mismatch-multiple.rs index 9359c035956..9359c035956 100644 --- a/src/test/compile-fail/type-mismatch-multiple.rs +++ b/src/test/ui/compile-fail-migration/type-mismatch-multiple.rs diff --git a/src/test/ui/compile-fail-migration/type-mismatch-multiple.stderr b/src/test/ui/compile-fail-migration/type-mismatch-multiple.stderr new file mode 100644 index 00000000000..b9721a5edfa --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-mismatch-multiple.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/type-mismatch-multiple.rs:13:27 + | +LL | fn main() { let a: bool = 1; let b: i32 = true; } + | ^ expected bool, found integral variable + | + = note: expected type `bool` + found type `{integer}` + +error[E0308]: mismatched types + --> $DIR/type-mismatch-multiple.rs:13:43 + | +LL | fn main() { let a: bool = 1; let b: i32 = true; } + | ^^^^ expected i32, found bool + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/type-mismatch-same-crate-name.rs b/src/test/ui/compile-fail-migration/type-mismatch-same-crate-name.rs index 7e93f626cfc..7e93f626cfc 100644 --- a/src/test/compile-fail/type-mismatch-same-crate-name.rs +++ b/src/test/ui/compile-fail-migration/type-mismatch-same-crate-name.rs diff --git a/src/test/ui/compile-fail-migration/type-mismatch-same-crate-name.stderr b/src/test/ui/compile-fail-migration/type-mismatch-same-crate-name.stderr new file mode 100644 index 00000000000..c6860926056 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-mismatch-same-crate-name.stderr @@ -0,0 +1,31 @@ +error[E0308]: mismatched types + --> $DIR/type-mismatch-same-crate-name.rs:26:20 + | +LL | a::try_foo(foo2); + | ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo` + | + = note: expected type `main::a::Foo` (struct `main::a::Foo`) + found type `main::a::Foo` (struct `main::a::Foo`) +note: Perhaps two different versions of crate `crate_a1` are being used? + --> $DIR/type-mismatch-same-crate-name.rs:26:20 + | +LL | a::try_foo(foo2); + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/type-mismatch-same-crate-name.rs:32:20 + | +LL | a::try_bar(bar2); + | ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar` + | + = note: expected type `std::boxed::Box<(dyn main::a::Bar + 'static)>` + found type `std::boxed::Box<dyn main::a::Bar>` +note: Perhaps two different versions of crate `crate_a1` are being used? + --> $DIR/type-mismatch-same-crate-name.rs:32:20 + | +LL | a::try_bar(bar2); + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs b/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self-ppaux.rs index 08988353886..08988353886 100644 --- a/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs +++ b/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self-ppaux.rs diff --git a/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self-ppaux.stderr b/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self-ppaux.stderr new file mode 100644 index 00000000000..f02bf0533a3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self-ppaux.stderr @@ -0,0 +1,24 @@ +error[E0620]: cast to unsized type: `i32` as `dyn MyAdd<i32>` + --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:24:13 + | +LL | let y = x as MyAdd<i32>; + | ^^^^^^^^^^^^^^^ + | +help: consider using a box or reference as appropriate + --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:24:13 + | +LL | let y = x as MyAdd<i32>; + | ^ + +error[E0038]: the trait `MyAdd` cannot be made into an object + --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:24:18 + | +LL | let y = x as MyAdd<i32>; + | ^^^^^^^^^^ the trait `MyAdd` cannot be made into an object + | + = note: method `add` references the `Self` type in its arguments or return type + +error: aborting due to 2 previous errors + +Some errors occurred: E0038, E0620. +For more information about an error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/type-parameter-defaults-referencing-Self.rs b/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self.rs index 9982d485024..9982d485024 100644 --- a/src/test/compile-fail/type-parameter-defaults-referencing-Self.rs +++ b/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self.rs diff --git a/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self.stderr b/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self.stderr new file mode 100644 index 00000000000..e163253bdf9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-parameter-defaults-referencing-Self.stderr @@ -0,0 +1,11 @@ +error[E0393]: the type parameter `T` must be explicitly specified + --> $DIR/type-parameter-defaults-referencing-Self.rs:20:12 + | +LL | fn foo(x: &Foo) { } + | ^^^ missing reference to `T` + | + = note: because of the default `Self` reference, type parameters must be specified on object types + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0393`. diff --git a/src/test/compile-fail/type-parameter-names.rs b/src/test/ui/compile-fail-migration/type-parameter-names.rs index 11a2fc2665c..11a2fc2665c 100644 --- a/src/test/compile-fail/type-parameter-names.rs +++ b/src/test/ui/compile-fail-migration/type-parameter-names.rs diff --git a/src/test/ui/compile-fail-migration/type-parameter-names.stderr b/src/test/ui/compile-fail-migration/type-parameter-names.stderr new file mode 100644 index 00000000000..8e3d39357ed --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-parameter-names.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/type-parameter-names.rs:15:5 + | +LL | fn foo<Foo, Bar>(x: Foo) -> Bar { + | --- expected `Bar` because of return type +LL | x + | ^ expected type parameter, found a different type parameter + | + = note: expected type `Bar` + found type `Foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/type-params-in-different-spaces-1.rs b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-1.rs index 26eac6adde2..26eac6adde2 100644 --- a/src/test/compile-fail/type-params-in-different-spaces-1.rs +++ b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-1.rs diff --git a/src/test/ui/compile-fail-migration/type-params-in-different-spaces-1.stderr b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-1.stderr new file mode 100644 index 00000000000..31f332f6095 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-1.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/type-params-in-different-spaces-1.rs:15:17 + | +LL | *self + rhs //~ ERROR mismatched types + | ^^^ expected Self, found type parameter + | + = note: expected type `Self` + found type `T` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/type-params-in-different-spaces-2.rs b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-2.rs index 7de061eaf07..7de061eaf07 100644 --- a/src/test/compile-fail/type-params-in-different-spaces-2.rs +++ b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-2.rs diff --git a/src/test/ui/compile-fail-migration/type-params-in-different-spaces-2.stderr b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-2.stderr new file mode 100644 index 00000000000..af18185dd24 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-2.stderr @@ -0,0 +1,29 @@ +error[E0277]: the trait bound `Self: Tr<U>` is not satisfied + --> $DIR/type-params-in-different-spaces-2.rs:20:9 + | +LL | Tr::op(u) //~ ERROR E0277 + | ^^^^^^ the trait `Tr<U>` is not implemented for `Self` + | + = help: consider adding a `where Self: Tr<U>` bound +note: required by `Tr::op` + --> $DIR/type-params-in-different-spaces-2.rs:15:5 + | +LL | fn op(_: T) -> Self; + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `Self: Tr<U>` is not satisfied + --> $DIR/type-params-in-different-spaces-2.rs:26:9 + | +LL | Tr::op(u) //~ ERROR E0277 + | ^^^^^^ the trait `Tr<U>` is not implemented for `Self` + | + = help: consider adding a `where Self: Tr<U>` bound +note: required by `Tr::op` + --> $DIR/type-params-in-different-spaces-2.rs:15:5 + | +LL | fn op(_: T) -> Self; + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/type-params-in-different-spaces-3.rs b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-3.rs index 3ad1e9ab538..3ad1e9ab538 100644 --- a/src/test/compile-fail/type-params-in-different-spaces-3.rs +++ b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-3.rs diff --git a/src/test/ui/compile-fail-migration/type-params-in-different-spaces-3.stderr b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-3.stderr new file mode 100644 index 00000000000..e1b4cbb2ab3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-params-in-different-spaces-3.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/type-params-in-different-spaces-3.rs:13:9 + | +LL | fn test<X>(u: X) -> Self { + | ---- expected `Self` because of return type +LL | u //~ ERROR mismatched types + | ^ expected Self, found type parameter + | + = note: expected type `Self` + found type `X` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/type-path-err-node-types.rs b/src/test/ui/compile-fail-migration/type-path-err-node-types.rs index 7ef099d0410..7ef099d0410 100644 --- a/src/test/compile-fail/type-path-err-node-types.rs +++ b/src/test/ui/compile-fail-migration/type-path-err-node-types.rs diff --git a/src/test/ui/compile-fail-migration/type-path-err-node-types.stderr b/src/test/ui/compile-fail-migration/type-path-err-node-types.stderr new file mode 100644 index 00000000000..c28b30b5456 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-path-err-node-types.stderr @@ -0,0 +1,28 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `NonExistent` + --> $DIR/type-path-err-node-types.rs:25:5 + | +LL | NonExistent::Assoc::<u8>; //~ ERROR undeclared type or module `NonExistent` + | ^^^^^^^^^^^ Use of undeclared type or module `NonExistent` + +error[E0412]: cannot find type `Nonexistent` in this scope + --> $DIR/type-path-err-node-types.rs:17:12 + | +LL | let _: Nonexistent<u8, Assoc = u16>; //~ ERROR cannot find type `Nonexistent` in this scope + | ^^^^^^^^^^^ not found in this scope + +error[E0576]: cannot find method or associated constant `nonexistent` in trait `Tr` + --> $DIR/type-path-err-node-types.rs:21:21 + | +LL | <u8 as Tr<u8>>::nonexistent(); //~ ERROR cannot find method or associated constant `nonexistent` + | ^^^^^^^^^^^ not found in `Tr` + +error[E0425]: cannot find value `nonexistent` in this scope + --> $DIR/type-path-err-node-types.rs:29:5 + | +LL | nonexistent.nonexistent::<u8>(); //~ ERROR cannot find value `nonexistent` + | ^^^^^^^^^^^ not found in this scope + +error: aborting due to 4 previous errors + +Some errors occurred: E0412, E0425, E0433, E0576. +For more information about an error, try `rustc --explain E0412`. diff --git a/src/test/compile-fail/type-shadow.rs b/src/test/ui/compile-fail-migration/type-shadow.rs index 6d8c0fe22bd..6d8c0fe22bd 100644 --- a/src/test/compile-fail/type-shadow.rs +++ b/src/test/ui/compile-fail-migration/type-shadow.rs diff --git a/src/test/ui/compile-fail-migration/type-shadow.stderr b/src/test/ui/compile-fail-migration/type-shadow.stderr new file mode 100644 index 00000000000..29e6e4352e2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type-shadow.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/type-shadow.rs:16:20 + | +LL | let y: Y = "hello"; //~ ERROR mismatched types + | ^^^^^^^ expected isize, found reference + | + = note: expected type `isize` + found type `&'static str` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/type_length_limit.rs b/src/test/ui/compile-fail-migration/type_length_limit.rs index d283f392d76..d283f392d76 100644 --- a/src/test/compile-fail/type_length_limit.rs +++ b/src/test/ui/compile-fail-migration/type_length_limit.rs diff --git a/src/test/ui/compile-fail-migration/type_length_limit.stderr b/src/test/ui/compile-fail-migration/type_length_limit.stderr new file mode 100644 index 00000000000..910eca07594 --- /dev/null +++ b/src/test/ui/compile-fail-migration/type_length_limit.stderr @@ -0,0 +1,6 @@ +error: reached the type-length limit while instantiating `std::mem::drop::<std::option::Option<((((((G, G, G), (G, G, G), ...` + | + = note: consider adding a `#![type_length_limit="512"]` attribute to your crate + +error: aborting due to previous error + diff --git a/src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs b/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits-2.rs index fa63088d000..fa63088d000 100644 --- a/src/test/compile-fail/typeck-auto-trait-no-supertraits-2.rs +++ b/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits-2.rs diff --git a/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits-2.stderr b/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits-2.stderr new file mode 100644 index 00000000000..8fff0e2bb1c --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits-2.stderr @@ -0,0 +1,9 @@ +error[E0568]: auto traits cannot have super traits + --> $DIR/typeck-auto-trait-no-supertraits-2.rs:13:1 + | +LL | auto trait Magic : Sized where Option<Self> : Magic {} //~ ERROR E0568 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0568`. diff --git a/src/test/compile-fail/typeck-auto-trait-no-supertraits.rs b/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits.rs index c8cf96f52fc..c8cf96f52fc 100644 --- a/src/test/compile-fail/typeck-auto-trait-no-supertraits.rs +++ b/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits.rs diff --git a/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits.stderr b/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits.stderr new file mode 100644 index 00000000000..26542286807 --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-auto-trait-no-supertraits.stderr @@ -0,0 +1,9 @@ +error[E0568]: auto traits cannot have super traits + --> $DIR/typeck-auto-trait-no-supertraits.rs:37:1 + | +LL | auto trait Magic: Copy {} //~ ERROR E0568 + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0568`. diff --git a/src/test/compile-fail/typeck-cast-pointer-to-float.rs b/src/test/ui/compile-fail-migration/typeck-cast-pointer-to-float.rs index 3f8b8f49cb3..3f8b8f49cb3 100644 --- a/src/test/compile-fail/typeck-cast-pointer-to-float.rs +++ b/src/test/ui/compile-fail-migration/typeck-cast-pointer-to-float.rs diff --git a/src/test/ui/compile-fail-migration/typeck-cast-pointer-to-float.stderr b/src/test/ui/compile-fail-migration/typeck-cast-pointer-to-float.stderr new file mode 100644 index 00000000000..437675ccb06 --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-cast-pointer-to-float.stderr @@ -0,0 +1,9 @@ +error[E0606]: casting `*const i16` as `f32` is invalid + --> $DIR/typeck-cast-pointer-to-float.rs:13:5 + | +LL | ((&x) as *const i16) as f32; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0606`. diff --git a/src/test/compile-fail/typeck-default-trait-impl-assoc-type.rs b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-assoc-type.rs index f8342c333a3..f8342c333a3 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-assoc-type.rs +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-assoc-type.rs diff --git a/src/test/ui/compile-fail-migration/typeck-default-trait-impl-assoc-type.stderr b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-assoc-type.stderr new file mode 100644 index 00000000000..ad47fcdb042 --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-assoc-type.stderr @@ -0,0 +1,17 @@ +error[E0277]: `<T as Trait>::AssocType` cannot be sent between threads safely + --> $DIR/typeck-default-trait-impl-assoc-type.rs:19:5 + | +LL | is_send::<T::AssocType>(); //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^ `<T as Trait>::AssocType` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `<T as Trait>::AssocType` + = help: consider adding a `where <T as Trait>::AssocType: std::marker::Send` bound +note: required by `is_send` + --> $DIR/typeck-default-trait-impl-assoc-type.rs:22:1 + | +LL | fn is_send<T:Send>() { + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types-2.rs index 6e7c9afb674..6e7c9afb674 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types-2.rs diff --git a/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types-2.stderr b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types-2.stderr new file mode 100644 index 00000000000..a52628e233c --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types-2.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `MyS2: MyTrait` is not satisfied in `(MyS2, MyS)` + --> $DIR/typeck-default-trait-impl-constituent-types-2.rs:26:5 + | +LL | is_mytrait::<(MyS2, MyS)>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ within `(MyS2, MyS)`, the trait `MyTrait` is not implemented for `MyS2` + | + = help: the following implementations were found: + <MyS2 as MyTrait> + = note: required because it appears within the type `(MyS2, MyS)` +note: required by `is_mytrait` + --> $DIR/typeck-default-trait-impl-constituent-types-2.rs:21:1 + | +LL | fn is_mytrait<T: MyTrait>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types.rs index 4660ecf4fb4..4660ecf4fb4 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types.rs diff --git a/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types.stderr b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types.stderr new file mode 100644 index 00000000000..2e382dd05cb --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-constituent-types.stderr @@ -0,0 +1,17 @@ +error[E0277]: the trait bound `MyS2: MyTrait` is not satisfied + --> $DIR/typeck-default-trait-impl-constituent-types.rs:30:5 + | +LL | is_mytrait::<MyS2>(); + | ^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `MyS2` + | + = help: the following implementations were found: + <MyS2 as MyTrait> +note: required by `is_mytrait` + --> $DIR/typeck-default-trait-impl-constituent-types.rs:25:1 + | +LL | fn is_mytrait<T: MyTrait>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/typeck-default-trait-impl-cross-crate-coherence.rs b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-cross-crate-coherence.rs index b918b0dde47..b918b0dde47 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-cross-crate-coherence.rs +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-cross-crate-coherence.rs diff --git a/src/test/ui/compile-fail-migration/typeck-default-trait-impl-cross-crate-coherence.stderr b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-cross-crate-coherence.stderr new file mode 100644 index 00000000000..6efb7f39f3b --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-cross-crate-coherence.stderr @@ -0,0 +1,37 @@ +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:23:1 + | +LL | impl DefaultedTrait for (A,) { } //~ ERROR E0117 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:26:1 + | +LL | impl !DefaultedTrait for (B,) { } //~ ERROR E0117 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error[E0321]: cross-crate traits with a default impl, like `lib::DefaultedTrait`, can only be implemented for a struct/enum type defined in the current crate + --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:30:1 + | +LL | impl DefaultedTrait for Box<C> { } //~ ERROR E0321 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait for type in another crate + +error[E0117]: only traits defined in the current crate can be implemented for arbitrary types + --> $DIR/typeck-default-trait-impl-cross-crate-coherence.rs:31:1 + | +LL | impl DefaultedTrait for lib::Something<C> { } //~ ERROR E0117 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl doesn't use types inside crate + | + = note: the impl does not reference any types defined in this crate + = note: define and implement a trait or new type instead + +error: aborting due to 4 previous errors + +Some errors occurred: E0117, E0321. +For more information about an error, try `rustc --explain E0117`. diff --git a/src/test/compile-fail/typeck-default-trait-impl-negation-send.rs b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-send.rs index 65438e5df8e..65438e5df8e 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-negation-send.rs +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-send.rs diff --git a/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-send.stderr b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-send.stderr new file mode 100644 index 00000000000..8dc7df90355 --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-send.stderr @@ -0,0 +1,16 @@ +error[E0277]: `MyNotSendable` cannot be sent between threads safely + --> $DIR/typeck-default-trait-impl-negation-send.rs:29:5 + | +LL | is_send::<MyNotSendable>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ `MyNotSendable` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `MyNotSendable` +note: required by `is_send` + --> $DIR/typeck-default-trait-impl-negation-send.rs:25:1 + | +LL | fn is_send<T: Send>() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/typeck-default-trait-impl-negation-sync.rs b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-sync.rs index c829ba3dcc3..c829ba3dcc3 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-negation-sync.rs +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-sync.rs diff --git a/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-sync.stderr b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-sync.stderr new file mode 100644 index 00000000000..b0fe2c599be --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation-sync.stderr @@ -0,0 +1,44 @@ +error[E0277]: `MyNotSync` cannot be shared between threads safely + --> $DIR/typeck-default-trait-impl-negation-sync.rs:45:5 + | +LL | is_sync::<MyNotSync>(); + | ^^^^^^^^^^^^^^^^^^^^ `MyNotSync` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `MyNotSync` +note: required by `is_sync` + --> $DIR/typeck-default-trait-impl-negation-sync.rs:41:1 + | +LL | fn is_sync<T: Sync>() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::cell::UnsafeCell<u8>` cannot be shared between threads safely + --> $DIR/typeck-default-trait-impl-negation-sync.rs:48:5 + | +LL | is_sync::<MyTypeWUnsafe>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell<u8>` cannot be shared between threads safely + | + = help: within `MyTypeWUnsafe`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell<u8>` + = note: required because it appears within the type `MyTypeWUnsafe` +note: required by `is_sync` + --> $DIR/typeck-default-trait-impl-negation-sync.rs:41:1 + | +LL | fn is_sync<T: Sync>() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `Managed` cannot be shared between threads safely + --> $DIR/typeck-default-trait-impl-negation-sync.rs:51:5 + | +LL | is_sync::<MyTypeManaged>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ `Managed` cannot be shared between threads safely + | + = help: within `MyTypeManaged`, the trait `std::marker::Sync` is not implemented for `Managed` + = note: required because it appears within the type `MyTypeManaged` +note: required by `is_sync` + --> $DIR/typeck-default-trait-impl-negation-sync.rs:41:1 + | +LL | fn is_sync<T: Sync>() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/typeck-default-trait-impl-negation.rs b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation.rs index b28cdd8aa24..b28cdd8aa24 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-negation.rs +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation.rs diff --git a/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation.stderr b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation.stderr new file mode 100644 index 00000000000..4427955c4b2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-negation.stderr @@ -0,0 +1,31 @@ +error[E0277]: the trait bound `ThisImplsUnsafeTrait: MyTrait` is not satisfied + --> $DIR/typeck-default-trait-impl-negation.rs:31:5 + | +LL | is_my_trait::<ThisImplsUnsafeTrait>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `ThisImplsUnsafeTrait` + | + = help: the following implementations were found: + <ThisImplsUnsafeTrait as MyTrait> +note: required by `is_my_trait` + --> $DIR/typeck-default-trait-impl-negation.rs:26:1 + | +LL | fn is_my_trait<T: MyTrait>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `ThisImplsTrait: MyUnsafeTrait` is not satisfied + --> $DIR/typeck-default-trait-impl-negation.rs:34:5 + | +LL | is_my_unsafe_trait::<ThisImplsTrait>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MyUnsafeTrait` is not implemented for `ThisImplsTrait` + | + = help: the following implementations were found: + <ThisImplsTrait as MyUnsafeTrait> +note: required by `is_my_unsafe_trait` + --> $DIR/typeck-default-trait-impl-negation.rs:27:1 + | +LL | fn is_my_unsafe_trait<T: MyUnsafeTrait>() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/typeck-default-trait-impl-precedence.rs b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-precedence.rs index d63d70bad22..d63d70bad22 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-precedence.rs +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-precedence.rs diff --git a/src/test/ui/compile-fail-migration/typeck-default-trait-impl-precedence.stderr b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-precedence.stderr new file mode 100644 index 00000000000..0ab5eaaa34f --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-precedence.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `u32: Signed` is not satisfied + --> $DIR/typeck-default-trait-impl-precedence.rs:28:5 + | +LL | is_defaulted::<&'static u32>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Signed` is not implemented for `u32` + | + = note: required because of the requirements on the impl of `Defaulted` for `&'static u32` +note: required by `is_defaulted` + --> $DIR/typeck-default-trait-impl-precedence.rs:21:1 + | +LL | fn is_defaulted<T:Defaulted>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/typeck-default-trait-impl-send-param.rs b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-send-param.rs index 0c548b3bd99..0c548b3bd99 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-send-param.rs +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-send-param.rs diff --git a/src/test/ui/compile-fail-migration/typeck-default-trait-impl-send-param.stderr b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-send-param.stderr new file mode 100644 index 00000000000..82f31176f3e --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-default-trait-impl-send-param.stderr @@ -0,0 +1,17 @@ +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/typeck-default-trait-impl-send-param.rs:15:5 + | +LL | is_send::<T>() //~ ERROR E0277 + | ^^^^^^^^^^^^ `T` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `T` + = help: consider adding a `where T: std::marker::Send` bound +note: required by `is_send` + --> $DIR/typeck-default-trait-impl-send-param.rs:18:1 + | +LL | fn is_send<T:Send>() { + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/typeck-negative-impls-builtin.rs b/src/test/ui/compile-fail-migration/typeck-negative-impls-builtin.rs index d6d8fb6235d..d6d8fb6235d 100644 --- a/src/test/compile-fail/typeck-negative-impls-builtin.rs +++ b/src/test/ui/compile-fail-migration/typeck-negative-impls-builtin.rs diff --git a/src/test/ui/compile-fail-migration/typeck-negative-impls-builtin.stderr b/src/test/ui/compile-fail-migration/typeck-negative-impls-builtin.stderr new file mode 100644 index 00000000000..6ae323aedfe --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-negative-impls-builtin.stderr @@ -0,0 +1,9 @@ +error[E0192]: negative impls are only allowed for auto traits (e.g., `Send` and `Sync`) + --> $DIR/typeck-negative-impls-builtin.rs:19:1 + | +LL | impl !TestTrait for TestType {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0192`. diff --git a/src/test/compile-fail/typeck-unsafe-always-share.rs b/src/test/ui/compile-fail-migration/typeck-unsafe-always-share.rs index fcfc8574b21..fcfc8574b21 100644 --- a/src/test/compile-fail/typeck-unsafe-always-share.rs +++ b/src/test/ui/compile-fail-migration/typeck-unsafe-always-share.rs diff --git a/src/test/ui/compile-fail-migration/typeck-unsafe-always-share.stderr b/src/test/ui/compile-fail-migration/typeck-unsafe-always-share.stderr new file mode 100644 index 00000000000..57c4bdf0ad2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck-unsafe-always-share.stderr @@ -0,0 +1,56 @@ +error[E0277]: `std::cell::UnsafeCell<MySync<{integer}>>` cannot be shared between threads safely + --> $DIR/typeck-unsafe-always-share.rs:29:5 + | +LL | test(us); + | ^^^^ `std::cell::UnsafeCell<MySync<{integer}>>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell<MySync<{integer}>>` +note: required by `test` + --> $DIR/typeck-unsafe-always-share.rs:25:1 + | +LL | fn test<T: Sync>(s: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::cell::UnsafeCell<NoSync>` cannot be shared between threads safely + --> $DIR/typeck-unsafe-always-share.rs:33:5 + | +LL | test(uns); + | ^^^^ `std::cell::UnsafeCell<NoSync>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell<NoSync>` +note: required by `test` + --> $DIR/typeck-unsafe-always-share.rs:25:1 + | +LL | fn test<T: Sync>(s: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::cell::UnsafeCell<NoSync>` cannot be shared between threads safely + --> $DIR/typeck-unsafe-always-share.rs:37:5 + | +LL | test(ms); + | ^^^^ `std::cell::UnsafeCell<NoSync>` cannot be shared between threads safely + | + = help: within `MySync<NoSync>`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell<NoSync>` + = note: required because it appears within the type `MySync<NoSync>` +note: required by `test` + --> $DIR/typeck-unsafe-always-share.rs:25:1 + | +LL | fn test<T: Sync>(s: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `NoSync` cannot be shared between threads safely + --> $DIR/typeck-unsafe-always-share.rs:40:5 + | +LL | test(NoSync); + | ^^^^ `NoSync` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `NoSync` +note: required by `test` + --> $DIR/typeck-unsafe-always-share.rs:25:1 + | +LL | fn test<T: Sync>(s: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/typeck_type_placeholder_mismatch.rs b/src/test/ui/compile-fail-migration/typeck_type_placeholder_mismatch.rs index 91e3c38322e..91e3c38322e 100644 --- a/src/test/compile-fail/typeck_type_placeholder_mismatch.rs +++ b/src/test/ui/compile-fail-migration/typeck_type_placeholder_mismatch.rs diff --git a/src/test/ui/compile-fail-migration/typeck_type_placeholder_mismatch.stderr b/src/test/ui/compile-fail-migration/typeck_type_placeholder_mismatch.stderr new file mode 100644 index 00000000000..6a762353819 --- /dev/null +++ b/src/test/ui/compile-fail-migration/typeck_type_placeholder_mismatch.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/typeck_type_placeholder_mismatch.rs:23:21 + | +LL | let x: Foo<_> = Bar::<usize>(PhantomData); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar` + | + = note: expected type `Foo<_>` + found type `Bar<usize>` + +error[E0308]: mismatched types + --> $DIR/typeck_type_placeholder_mismatch.rs:32:21 + | +LL | let x: Foo<_> = Bar::<usize>(PhantomData); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar` + | + = note: expected type `Foo<_>` + found type `Bar<usize>` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/ufcs-explicit-self-bad.rs b/src/test/ui/compile-fail-migration/ufcs-explicit-self-bad.rs index a0d1f2dc331..a0d1f2dc331 100644 --- a/src/test/compile-fail/ufcs-explicit-self-bad.rs +++ b/src/test/ui/compile-fail-migration/ufcs-explicit-self-bad.rs diff --git a/src/test/ui/compile-fail-migration/ufcs-explicit-self-bad.stderr b/src/test/ui/compile-fail-migration/ufcs-explicit-self-bad.stderr new file mode 100644 index 00000000000..fce74605cad --- /dev/null +++ b/src/test/ui/compile-fail-migration/ufcs-explicit-self-bad.stderr @@ -0,0 +1,107 @@ +error[E0307]: invalid `self` type: isize + --> $DIR/ufcs-explicit-self-bad.rs:18:18 + | +LL | fn foo(self: isize, x: isize) -> isize { + | ^^^^^ + | + = note: type must be `Foo` or a type that dereferences to it + = help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>` + +error[E0307]: invalid `self` type: Bar<isize> + --> $DIR/ufcs-explicit-self-bad.rs:29:18 + | +LL | fn foo(self: Bar<isize>, x: isize) -> isize { + | ^^^^^^^^^^ + | + = note: type must be `Bar<T>` or a type that dereferences to it + = help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>` + +error[E0307]: invalid `self` type: &Bar<usize> + --> $DIR/ufcs-explicit-self-bad.rs:33:18 + | +LL | fn bar(self: &Bar<usize>, x: isize) -> isize { + | ^^^^^^^^^^^ + | + = note: type must be `Bar<T>` or a type that dereferences to it + = help: consider changing to `self`, `&self`, `&mut self`, or `self: Box<Self>` + +error[E0308]: mismatched method receiver + --> $DIR/ufcs-explicit-self-bad.rs:47:21 + | +LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver + | ^^^^^^^ lifetime mismatch + | + = note: expected type `&'a Bar<T>` + found type `&Bar<T>` +note: the anonymous lifetime #1 defined on the method body at 47:5... + --> $DIR/ufcs-explicit-self-bad.rs:47:5 + | +LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 45:6 + --> $DIR/ufcs-explicit-self-bad.rs:45:6 + | +LL | impl<'a, T> SomeTrait for &'a Bar<T> { + | ^^ + +error[E0308]: mismatched method receiver + --> $DIR/ufcs-explicit-self-bad.rs:47:21 + | +LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver + | ^^^^^^^ lifetime mismatch + | + = note: expected type `&'a Bar<T>` + found type `&Bar<T>` +note: the lifetime 'a as defined on the impl at 45:6... + --> $DIR/ufcs-explicit-self-bad.rs:45:6 + | +LL | impl<'a, T> SomeTrait for &'a Bar<T> { + | ^^ +note: ...does not necessarily outlive the anonymous lifetime #1 defined on the method body at 47:5 + --> $DIR/ufcs-explicit-self-bad.rs:47:5 + | +LL | fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched method receiver + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0308]: mismatched method receiver + --> $DIR/ufcs-explicit-self-bad.rs:49:21 + | +LL | fn dummy3(self: &&Bar<T>) {} + | ^^^^^^^^ lifetime mismatch + | + = note: expected type `&'a Bar<T>` + found type `&Bar<T>` +note: the anonymous lifetime #2 defined on the method body at 49:5... + --> $DIR/ufcs-explicit-self-bad.rs:49:5 + | +LL | fn dummy3(self: &&Bar<T>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: ...does not necessarily outlive the lifetime 'a as defined on the impl at 45:6 + --> $DIR/ufcs-explicit-self-bad.rs:45:6 + | +LL | impl<'a, T> SomeTrait for &'a Bar<T> { + | ^^ + +error[E0308]: mismatched method receiver + --> $DIR/ufcs-explicit-self-bad.rs:49:21 + | +LL | fn dummy3(self: &&Bar<T>) {} + | ^^^^^^^^ lifetime mismatch + | + = note: expected type `&'a Bar<T>` + found type `&Bar<T>` +note: the lifetime 'a as defined on the impl at 45:6... + --> $DIR/ufcs-explicit-self-bad.rs:45:6 + | +LL | impl<'a, T> SomeTrait for &'a Bar<T> { + | ^^ +note: ...does not necessarily outlive the anonymous lifetime #2 defined on the method body at 49:5 + --> $DIR/ufcs-explicit-self-bad.rs:49:5 + | +LL | fn dummy3(self: &&Bar<T>) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 7 previous errors + +Some errors occurred: E0307, E0308. +For more information about an error, try `rustc --explain E0307`. diff --git a/src/test/compile-fail/ufcs-partially-resolved.rs b/src/test/ui/compile-fail-migration/ufcs-partially-resolved.rs index f7120ddb114..f7120ddb114 100644 --- a/src/test/compile-fail/ufcs-partially-resolved.rs +++ b/src/test/ui/compile-fail-migration/ufcs-partially-resolved.rs diff --git a/src/test/ui/compile-fail-migration/ufcs-partially-resolved.stderr b/src/test/ui/compile-fail-migration/ufcs-partially-resolved.stderr new file mode 100644 index 00000000000..5de8fb158b7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/ufcs-partially-resolved.stderr @@ -0,0 +1,206 @@ +error[E0433]: failed to resolve. Not a module `Y` + --> $DIR/ufcs-partially-resolved.rs:58:22 + | +LL | let _: <u8 as E::Y>::NN; //~ ERROR failed to resolve. Not a module `Y` + | ^ Not a module `Y` + +error[E0433]: failed to resolve. Not a module `Y` + --> $DIR/ufcs-partially-resolved.rs:60:15 + | +LL | <u8 as E::Y>::NN; //~ ERROR failed to resolve. Not a module `Y` + | ^ Not a module `Y` + +error[E0576]: cannot find associated type `N` in trait `Tr` + --> $DIR/ufcs-partially-resolved.rs:29:24 + | +LL | let _: <u8 as Tr>::N; //~ ERROR cannot find associated type `N` in trait `Tr` + | ^ did you mean `Y`? + +error[E0576]: cannot find associated type `N` in enum `E` + --> $DIR/ufcs-partially-resolved.rs:30:23 + | +LL | let _: <u8 as E>::N; //~ ERROR cannot find associated type `N` in enum `E` + | ^ not found in `E` + +error[E0576]: cannot find associated type `N` in `A` + --> $DIR/ufcs-partially-resolved.rs:31:23 + | +LL | let _: <u8 as A>::N; //~ ERROR cannot find associated type `N` in `A` + | ^ not found in `A` + +error[E0576]: cannot find method or associated constant `N` in trait `Tr` + --> $DIR/ufcs-partially-resolved.rs:32:17 + | +LL | <u8 as Tr>::N; //~ ERROR cannot find method or associated constant `N` in trait `Tr` + | ^ did you mean `Y`? + +error[E0576]: cannot find method or associated constant `N` in enum `E` + --> $DIR/ufcs-partially-resolved.rs:33:16 + | +LL | <u8 as E>::N; //~ ERROR cannot find method or associated constant `N` in enum `E` + | ^ not found in `E` + +error[E0576]: cannot find method or associated constant `N` in `A` + --> $DIR/ufcs-partially-resolved.rs:34:16 + | +LL | <u8 as A>::N; //~ ERROR cannot find method or associated constant `N` in `A` + | ^ not found in `A` + +error[E0575]: expected associated type, found variant `E::Y` + --> $DIR/ufcs-partially-resolved.rs:36:12 + | +LL | let _: <u8 as E>::Y; //~ ERROR expected associated type, found variant `E::Y` + | ^^^^^^^^^^^^ not a associated type + +error[E0575]: expected method or associated constant, found unit variant `E::Y` + --> $DIR/ufcs-partially-resolved.rs:38:5 + | +LL | <u8 as E>::Y; //~ ERROR expected method or associated constant, found unit variant `E::Y` + | ^^^^^^^^^^^^ not a method or associated constant + +error[E0576]: cannot find associated type `N` in trait `Tr` + --> $DIR/ufcs-partially-resolved.rs:40:24 + | +LL | let _: <u8 as Tr>::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr` + | ^ did you mean `Y`? + +error[E0576]: cannot find associated type `N` in enum `E` + --> $DIR/ufcs-partially-resolved.rs:41:23 + | +LL | let _: <u8 as E>::N::NN; //~ ERROR cannot find associated type `N` in enum `E` + | ^ not found in `E` + +error[E0576]: cannot find associated type `N` in `A` + --> $DIR/ufcs-partially-resolved.rs:42:23 + | +LL | let _: <u8 as A>::N::NN; //~ ERROR cannot find associated type `N` in `A` + | ^ not found in `A` + +error[E0576]: cannot find associated type `N` in trait `Tr` + --> $DIR/ufcs-partially-resolved.rs:43:17 + | +LL | <u8 as Tr>::N::NN; //~ ERROR cannot find associated type `N` in trait `Tr` + | ^ did you mean `Y`? + +error[E0576]: cannot find associated type `N` in enum `E` + --> $DIR/ufcs-partially-resolved.rs:44:16 + | +LL | <u8 as E>::N::NN; //~ ERROR cannot find associated type `N` in enum `E` + | ^ not found in `E` + +error[E0576]: cannot find associated type `N` in `A` + --> $DIR/ufcs-partially-resolved.rs:45:16 + | +LL | <u8 as A>::N::NN; //~ ERROR cannot find associated type `N` in `A` + | ^ not found in `A` + +error[E0575]: expected associated type, found variant `E::Y` + --> $DIR/ufcs-partially-resolved.rs:47:12 + | +LL | let _: <u8 as E>::Y::NN; //~ ERROR expected associated type, found variant `E::Y` + | ^^^^^^^^^^^^^^^^ not a associated type + +error[E0575]: expected associated type, found variant `E::Y` + --> $DIR/ufcs-partially-resolved.rs:49:5 + | +LL | <u8 as E>::Y::NN; //~ ERROR expected associated type, found variant `E::Y` + | ^^^^^^^^^^^^^^^^ not a associated type + +error[E0576]: cannot find associated type `NN` in `Tr::N` + --> $DIR/ufcs-partially-resolved.rs:51:27 + | +LL | let _: <u8 as Tr::N>::NN; //~ ERROR cannot find associated type `NN` in `Tr::N` + | ^^ not found in `Tr::N` + +error[E0576]: cannot find associated type `NN` in `E::N` + --> $DIR/ufcs-partially-resolved.rs:52:26 + | +LL | let _: <u8 as E::N>::NN; //~ ERROR cannot find associated type `NN` in `E::N` + | ^^ not found in `E::N` + +error[E0576]: cannot find associated type `NN` in `A::N` + --> $DIR/ufcs-partially-resolved.rs:53:26 + | +LL | let _: <u8 as A::N>::NN; //~ ERROR cannot find associated type `NN` in `A::N` + | ^^ not found in `A::N` + +error[E0576]: cannot find method or associated constant `NN` in `Tr::N` + --> $DIR/ufcs-partially-resolved.rs:54:20 + | +LL | <u8 as Tr::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::N` + | ^^ not found in `Tr::N` + +error[E0576]: cannot find method or associated constant `NN` in `E::N` + --> $DIR/ufcs-partially-resolved.rs:55:19 + | +LL | <u8 as E::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `E::N` + | ^^ not found in `E::N` + +error[E0576]: cannot find method or associated constant `NN` in `A::N` + --> $DIR/ufcs-partially-resolved.rs:56:19 + | +LL | <u8 as A::N>::NN; //~ ERROR cannot find method or associated constant `NN` in `A::N` + | ^^ not found in `A::N` + +error[E0576]: cannot find associated type `NN` in `Tr::Y` + --> $DIR/ufcs-partially-resolved.rs:57:27 + | +LL | let _: <u8 as Tr::Y>::NN; //~ ERROR cannot find associated type `NN` in `Tr::Y` + | ^^ not found in `Tr::Y` + +error[E0576]: cannot find method or associated constant `NN` in `Tr::Y` + --> $DIR/ufcs-partially-resolved.rs:59:20 + | +LL | <u8 as Tr::Y>::NN; //~ ERROR cannot find method or associated constant `NN` in `Tr::Y` + | ^^ not found in `Tr::Y` + +error[E0575]: expected associated type, found method `Dr::Z` + --> $DIR/ufcs-partially-resolved.rs:62:12 + | +LL | let _: <u8 as Dr>::Z; //~ ERROR expected associated type, found method `Dr::Z` + | ^^^^^^^^^^^^- + | | + | did you mean `X`? + +error[E0575]: expected method or associated constant, found associated type `Dr::X` + --> $DIR/ufcs-partially-resolved.rs:63:5 + | +LL | <u8 as Dr>::X; //~ ERROR expected method or associated constant, found associated type `Dr::X` + | ^^^^^^^^^^^^- + | | + | did you mean `Z`? + | + = note: can't use a type alias as a constructor + +error[E0575]: expected associated type, found method `Dr::Z` + --> $DIR/ufcs-partially-resolved.rs:64:12 + | +LL | let _: <u8 as Dr>::Z::N; //~ ERROR expected associated type, found method `Dr::Z` + | ^^^^^^^^^^^^-^^^ + | | + | did you mean `X`? + +error[E0223]: ambiguous associated type + --> $DIR/ufcs-partially-resolved.rs:46:12 + | +LL | let _: <u8 as Tr>::Y::NN; //~ ERROR ambiguous associated type + | ^^^^^^^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<<u8 as Tr>::Y as Trait>::NN` + +error[E0599]: no associated item named `NN` found for type `<u8 as Tr>::Y` in the current scope + --> $DIR/ufcs-partially-resolved.rs:48:5 + | +LL | <u8 as Tr>::Y::NN; //~ ERROR no associated item named `NN` found for type `<u8 as Tr>::Y` + | ^^^^^^^^^^^^^^^^^ associated item not found in `<u8 as Tr>::Y` + +error[E0599]: no associated item named `N` found for type `<u8 as Dr>::X` in the current scope + --> $DIR/ufcs-partially-resolved.rs:65:5 + | +LL | <u8 as Dr>::X::N; //~ ERROR no associated item named `N` found for type `<u8 as Dr>::X` + | ^^^^^^^^^^^^^^^^ associated item not found in `<u8 as Dr>::X` + +error: aborting due to 32 previous errors + +Some errors occurred: E0223, E0433, E0575, E0576, E0599. +For more information about an error, try `rustc --explain E0223`. diff --git a/src/test/compile-fail/ufcs-qpath-missing-params.rs b/src/test/ui/compile-fail-migration/ufcs-qpath-missing-params.rs index 5c108e05216..5c108e05216 100644 --- a/src/test/compile-fail/ufcs-qpath-missing-params.rs +++ b/src/test/ui/compile-fail-migration/ufcs-qpath-missing-params.rs diff --git a/src/test/ui/compile-fail-migration/ufcs-qpath-missing-params.stderr b/src/test/ui/compile-fail-migration/ufcs-qpath-missing-params.stderr new file mode 100644 index 00000000000..6c752dba6b4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/ufcs-qpath-missing-params.stderr @@ -0,0 +1,9 @@ +error[E0089]: too few type parameters provided: expected 1 type parameter, found 0 type parameters + --> $DIR/ufcs-qpath-missing-params.rs:24:5 + | +LL | <String as IntoCow>::into_cow("foo".to_string()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 type parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0089`. diff --git a/src/test/compile-fail/ufcs-qpath-self-mismatch.rs b/src/test/ui/compile-fail-migration/ufcs-qpath-self-mismatch.rs index caf510071bd..caf510071bd 100644 --- a/src/test/compile-fail/ufcs-qpath-self-mismatch.rs +++ b/src/test/ui/compile-fail-migration/ufcs-qpath-self-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/ufcs-qpath-self-mismatch.stderr b/src/test/ui/compile-fail-migration/ufcs-qpath-self-mismatch.stderr new file mode 100644 index 00000000000..f4222631872 --- /dev/null +++ b/src/test/ui/compile-fail-migration/ufcs-qpath-self-mismatch.stderr @@ -0,0 +1,24 @@ +error[E0277]: cannot add `u32` to `i32` + --> $DIR/ufcs-qpath-self-mismatch.rs:14:5 + | +LL | <i32 as Add<u32>>::add(1, 2); + | ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32` + | + = help: the trait `std::ops::Add<u32>` is not implemented for `i32` + +error[E0308]: mismatched types + --> $DIR/ufcs-qpath-self-mismatch.rs:16:28 + | +LL | <i32 as Add<i32>>::add(1u32, 2); + | ^^^^ expected i32, found u32 + +error[E0308]: mismatched types + --> $DIR/ufcs-qpath-self-mismatch.rs:18:31 + | +LL | <i32 as Add<i32>>::add(1, 2u32); + | ^^^^ expected i32, found u32 + +error: aborting due to 3 previous errors + +Some errors occurred: E0277, E0308. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unboxed-closure-feature-gate.rs b/src/test/ui/compile-fail-migration/unboxed-closure-feature-gate.rs index 3a3ea058b4e..3a3ea058b4e 100644 --- a/src/test/compile-fail/unboxed-closure-feature-gate.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-feature-gate.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-feature-gate.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-feature-gate.stderr new file mode 100644 index 00000000000..aea57d9cb4e --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-feature-gate.stderr @@ -0,0 +1,11 @@ +error[E0658]: parenthetical notation is only stable when used with `Fn`-family traits (see issue #29625) + --> $DIR/unboxed-closure-feature-gate.rs:23:16 + | +LL | let x: Box<Foo(isize)>; + | ^^^^^^^^^^ + | + = help: add #![feature(unboxed_closures)] to the crate attributes to enable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-illegal-move.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-illegal-move.nll.stderr new file mode 100644 index 00000000000..e74c66c27b1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-illegal-move.nll.stderr @@ -0,0 +1,27 @@ +error[E0507]: cannot move out of captured variable in an `Fn` closure + --> $DIR/unboxed-closure-illegal-move.rs:25:31 + | +LL | let f = to_fn(|| drop(x)); //~ ERROR cannot move + | ^ cannot move out of captured variable in an `Fn` closure + +error[E0507]: cannot move out of captured variable in an `FnMut` closure + --> $DIR/unboxed-closure-illegal-move.rs:29:35 + | +LL | let f = to_fn_mut(|| drop(x)); //~ ERROR cannot move + | ^ cannot move out of captured variable in an `FnMut` closure + +error[E0507]: cannot move out of captured variable in an `Fn` closure + --> $DIR/unboxed-closure-illegal-move.rs:38:36 + | +LL | let f = to_fn(move || drop(x)); //~ ERROR cannot move + | ^ cannot move out of captured variable in an `Fn` closure + +error[E0507]: cannot move out of captured variable in an `FnMut` closure + --> $DIR/unboxed-closure-illegal-move.rs:42:40 + | +LL | let f = to_fn_mut(move || drop(x)); //~ ERROR cannot move + | ^ cannot move out of captured variable in an `FnMut` closure + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/compile-fail/unboxed-closure-illegal-move.rs b/src/test/ui/compile-fail-migration/unboxed-closure-illegal-move.rs index 427be560760..427be560760 100644 --- a/src/test/compile-fail/unboxed-closure-illegal-move.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-illegal-move.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-illegal-move.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-illegal-move.stderr new file mode 100644 index 00000000000..7ff4c1c03ba --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-illegal-move.stderr @@ -0,0 +1,35 @@ +error[E0507]: cannot move out of captured outer variable in an `Fn` closure + --> $DIR/unboxed-closure-illegal-move.rs:25:31 + | +LL | let x = Box::new(0); + | - captured outer variable +LL | let f = to_fn(|| drop(x)); //~ ERROR cannot move + | ^ cannot move out of captured outer variable in an `Fn` closure + +error[E0507]: cannot move out of captured outer variable in an `FnMut` closure + --> $DIR/unboxed-closure-illegal-move.rs:29:35 + | +LL | let x = Box::new(0); + | - captured outer variable +LL | let f = to_fn_mut(|| drop(x)); //~ ERROR cannot move + | ^ cannot move out of captured outer variable in an `FnMut` closure + +error[E0507]: cannot move out of captured outer variable in an `Fn` closure + --> $DIR/unboxed-closure-illegal-move.rs:38:36 + | +LL | let x = Box::new(0); + | - captured outer variable +LL | let f = to_fn(move || drop(x)); //~ ERROR cannot move + | ^ cannot move out of captured outer variable in an `Fn` closure + +error[E0507]: cannot move out of captured outer variable in an `FnMut` closure + --> $DIR/unboxed-closure-illegal-move.rs:42:40 + | +LL | let x = Box::new(0); + | - captured outer variable +LL | let f = to_fn_mut(move || drop(x)); //~ ERROR cannot move + | ^ cannot move out of captured outer variable in an `FnMut` closure + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0507`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-immutable-capture.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-immutable-capture.nll.stderr new file mode 100644 index 00000000000..084d7ff3bcd --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-immutable-capture.nll.stderr @@ -0,0 +1,75 @@ +error[E0594]: cannot assign to `x`, as it is not declared as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:19:13 + | +LL | let x = 0; + | - help: consider changing this to be mutable: `mut x` +LL | move || x = 1; //~ ERROR cannot assign + | ^^^^^ cannot assign + +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:20:17 + | +LL | let x = 0; + | - help: consider changing this to be mutable: `mut x` +LL | move || x = 1; //~ ERROR cannot assign +LL | move || set(&mut x); //~ ERROR cannot borrow + | ^^^^^^ cannot borrow as mutable + +error[E0594]: cannot assign to `x`, as it is not declared as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:21:13 + | +LL | let x = 0; + | - help: consider changing this to be mutable: `mut x` +... +LL | move || x = 1; //~ ERROR cannot assign + | ^^^^^ cannot assign + +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:22:17 + | +LL | let x = 0; + | - help: consider changing this to be mutable: `mut x` +... +LL | move || set(&mut x); //~ ERROR cannot borrow + | ^^^^^^ cannot borrow as mutable + +error[E0594]: cannot assign to `x`, as it is not declared as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:23:8 + | +LL | let x = 0; + | - help: consider changing this to be mutable: `mut x` +... +LL | || x = 1; //~ ERROR cannot assign + | ^^^^^ cannot assign + +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:25:12 + | +LL | let x = 0; + | - help: consider changing this to be mutable: `mut x` +... +LL | || set(&mut x); //~ ERROR cannot assign + | ^^^^^^ cannot borrow as mutable + +error[E0594]: cannot assign to `x`, as it is not declared as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:26:8 + | +LL | let x = 0; + | - help: consider changing this to be mutable: `mut x` +... +LL | || x = 1; //~ ERROR cannot assign + | ^^^^^ cannot assign + +error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:28:12 + | +LL | let x = 0; + | - help: consider changing this to be mutable: `mut x` +... +LL | || set(&mut x); //~ ERROR cannot assign + | ^^^^^^ cannot borrow as mutable + +error: aborting due to 8 previous errors + +Some errors occurred: E0594, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/unboxed-closure-immutable-capture.rs b/src/test/ui/compile-fail-migration/unboxed-closure-immutable-capture.rs index 2d998374229..2d998374229 100644 --- a/src/test/compile-fail/unboxed-closure-immutable-capture.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-immutable-capture.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-immutable-capture.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-immutable-capture.stderr new file mode 100644 index 00000000000..02fbb5f17ee --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-immutable-capture.stderr @@ -0,0 +1,69 @@ +error[E0595]: closure cannot assign to immutable local variable `x` + --> $DIR/unboxed-closure-immutable-capture.rs:23:5 + | +LL | let x = 0; + | - consider changing this to `mut x` +... +LL | || x = 1; //~ ERROR cannot assign + | ^^ cannot borrow mutably + +error[E0595]: closure cannot assign to immutable local variable `x` + --> $DIR/unboxed-closure-immutable-capture.rs:25:5 + | +LL | let x = 0; + | - consider changing this to `mut x` +... +LL | || set(&mut x); //~ ERROR cannot assign + | ^^ cannot borrow mutably + +error[E0595]: closure cannot assign to immutable local variable `x` + --> $DIR/unboxed-closure-immutable-capture.rs:26:5 + | +LL | let x = 0; + | - consider changing this to `mut x` +... +LL | || x = 1; //~ ERROR cannot assign + | ^^ cannot borrow mutably + +error[E0595]: closure cannot assign to immutable local variable `x` + --> $DIR/unboxed-closure-immutable-capture.rs:28:5 + | +LL | let x = 0; + | - consider changing this to `mut x` +... +LL | || set(&mut x); //~ ERROR cannot assign + | ^^ cannot borrow mutably + +error[E0594]: cannot assign to captured outer variable in an `FnMut` closure + --> $DIR/unboxed-closure-immutable-capture.rs:19:13 + | +LL | let x = 0; + | - help: consider making `x` mutable: `mut x` +LL | move || x = 1; //~ ERROR cannot assign + | ^^^^^ + +error[E0596]: cannot borrow captured outer variable in an `FnMut` closure as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:20:22 + | +LL | move || set(&mut x); //~ ERROR cannot borrow + | ^ + +error[E0594]: cannot assign to captured outer variable in an `FnMut` closure + --> $DIR/unboxed-closure-immutable-capture.rs:21:13 + | +LL | let x = 0; + | - help: consider making `x` mutable: `mut x` +... +LL | move || x = 1; //~ ERROR cannot assign + | ^^^^^ + +error[E0596]: cannot borrow captured outer variable in an `FnMut` closure as mutable + --> $DIR/unboxed-closure-immutable-capture.rs:22:22 + | +LL | move || set(&mut x); //~ ERROR cannot borrow + | ^ + +error: aborting due to 8 previous errors + +Some errors occurred: E0594, E0595, E0596. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/unboxed-closure-region.rs b/src/test/ui/compile-fail-migration/unboxed-closure-region.rs index 1c86dda3378..1c86dda3378 100644 --- a/src/test/compile-fail/unboxed-closure-region.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-region.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-region.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-region.stderr new file mode 100644 index 00000000000..946a52c4673 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-region.stderr @@ -0,0 +1,15 @@ +error[E0597]: `x` does not live long enough + --> $DIR/unboxed-closure-region.rs:16:12 + | +LL | || x //~ ERROR `x` does not live long enough + | -- ^ borrowed value does not live long enough + | | + | capture occurs here +LL | }; + | - borrowed value only lives until here +LL | } + | - borrowed value needs to live until here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-default.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-default.rs index 849f7e0573c..849f7e0573c 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-default.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-default.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-default.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-default.stderr new file mode 100644 index 00000000000..fccf295b72c --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-default.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `dyn Foo<(isize,), isize, Output=()>: Eq<dyn Foo<(isize,), Output=()>>` is not satisfied + --> $DIR/unboxed-closure-sugar-default.rs:31:5 + | +LL | eq::< Foo<(isize,),isize,Output=()>, Foo(isize) >(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq<dyn Foo<(isize,), Output=()>>` is not implemented for `dyn Foo<(isize,), isize, Output=()>` + | +note: required by `eq` + --> $DIR/unboxed-closure-sugar-default.rs:24:1 + | +LL | fn eq<A: ?Sized,B: ?Sized>() where A : Eq<B> { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-equiv.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-equiv.rs index 0cf44a2ca61..0cf44a2ca61 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-equiv.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-equiv.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-equiv.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-equiv.stderr new file mode 100644 index 00000000000..7d687a55df9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-equiv.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `dyn Foo<(char,), Output=()>: Eq<dyn Foo<(), Output=()>>` is not satisfied + --> $DIR/unboxed-closure-sugar-equiv.rs:53:5 + | +LL | / eq::< Foo<(),Output=()>, +LL | | Foo(char) >(); + | |___________________________________________________________________^ the trait `Eq<dyn Foo<(), Output=()>>` is not implemented for `dyn Foo<(char,), Output=()>` + | +note: required by `eq` + --> $DIR/unboxed-closure-sugar-equiv.rs:26:1 + | +LL | fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-lifetime-elision.rs index a6f59b78823..a6f59b78823 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-lifetime-elision.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-lifetime-elision.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-lifetime-elision.stderr new file mode 100644 index 00000000000..fa74e6e6607 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-lifetime-elision.stderr @@ -0,0 +1,11 @@ +error[E0106]: missing lifetime specifier + --> $DIR/unboxed-closure-sugar-lifetime-elision.rs:36:35 + | +LL | let _: Foo(&isize, &usize) -> &usize; //~ ERROR missing lifetime specifier + | ^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0106`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-not-used-on-fn.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-not-used-on-fn.rs index ed27a4d0b2a..ed27a4d0b2a 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-not-used-on-fn.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-not-used-on-fn.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-not-used-on-fn.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-not-used-on-fn.stderr new file mode 100644 index 00000000000..bda88f4e4d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-not-used-on-fn.stderr @@ -0,0 +1,19 @@ +error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change. Use parenthetical notation (Fn(Foo, Bar) -> Baz) instead (see issue #29625) + --> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:14:13 + | +LL | fn bar1(x: &Fn<(), Output=()>) { + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unboxed_closures)] to the crate attributes to enable + +error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change. Use parenthetical notation (Fn(Foo, Bar) -> Baz) instead (see issue #29625) + --> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:18:28 + | +LL | fn bar2<T>(x: &T) where T: Fn<()> { + | ^^^^^^ + | + = help: add #![feature(unboxed_closures)] to the crate attributes to enable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-region.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-region.rs index 18a1185d695..18a1185d695 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-region.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-region.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-region.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-region.stderr new file mode 100644 index 00000000000..663034ba143 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-region.stderr @@ -0,0 +1,9 @@ +error[E0107]: wrong number of lifetime parameters: expected 1, found 0 + --> $DIR/unboxed-closure-sugar-region.rs:40:43 + | +LL | fn test2(x: &Foo<(isize,),Output=()>, y: &Foo(isize)) { + | ^^^^^^^^^^ expected 1 lifetime parameter + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0107`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-1.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-1.rs index 3f88f16d2c3..3f88f16d2c3 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-1.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-1.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-1.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-1.stderr new file mode 100644 index 00000000000..1ca99680b53 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-1.stderr @@ -0,0 +1,9 @@ +error[E0214]: parenthesized parameters may only be used with a trait + --> $DIR/unboxed-closure-sugar-used-on-struct-1.rs:19:19 + | +LL | let x: Box<Bar()> = panic!(); + | ^^ only traits may use parentheses + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0214`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-3.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-3.rs index 42fffe546c2..42fffe546c2 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-3.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-3.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-3.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-3.stderr new file mode 100644 index 00000000000..d6c08a70565 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct-3.stderr @@ -0,0 +1,9 @@ +error[E0214]: parenthesized parameters may only be used with a trait + --> $DIR/unboxed-closure-sugar-used-on-struct-3.rs:24:16 + | +LL | let b = Bar::(isize, usize)::new(); // OK too (for the parser) + | ^^^^^^^^^^^^^^^^ only traits may use parentheses + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0214`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct.rs index 5fcde4facbe..5fcde4facbe 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct.stderr new file mode 100644 index 00000000000..954ec4d63a6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-used-on-struct.stderr @@ -0,0 +1,16 @@ +error[E0214]: parenthesized parameters may only be used with a trait + --> $DIR/unboxed-closure-sugar-used-on-struct.rs:17:18 + | +LL | fn foo(b: Box<Bar()>) { + | ^^ only traits may use parentheses + +error[E0121]: the type placeholder `_` is not allowed within types on item signatures + --> $DIR/unboxed-closure-sugar-used-on-struct.rs:17:15 + | +LL | fn foo(b: Box<Bar()>) { + | ^^^^^ not allowed in type signatures + +error: aborting due to 2 previous errors + +Some errors occurred: E0121, E0214. +For more information about an error, try `rustc --explain E0121`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs index bb7e02d0d8b..bb7e02d0d8b 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-1.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-1.stderr new file mode 100644 index 00000000000..e7476f0fa6d --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-1.stderr @@ -0,0 +1,9 @@ +error[E0220]: associated type `Output` not found for `One<()>` + --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs:15:15 + | +LL | fn foo(_: &One()) //~ ERROR associated type `Output` not found for `One<()>` + | ^^ associated type `Output` not found + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0220`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs index 20fdd52b82a..20fdd52b82a 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr new file mode 100644 index 00000000000..feac4274357 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr @@ -0,0 +1,16 @@ +error[E0243]: wrong number of type arguments: expected 3, found 1 + --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs:15:12 + | +LL | fn foo(_: &Three()) + | ^^^^^^^ expected 3 type arguments + +error[E0220]: associated type `Output` not found for `Three<(), [type error], [type error]>` + --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs:15:17 + | +LL | fn foo(_: &Three()) + | ^^ associated type `Output` not found + +error: aborting due to 2 previous errors + +Some errors occurred: E0220, E0243. +For more information about an error, try `rustc --explain E0220`. diff --git a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters.rs index 027fa6b0fe3..027fa6b0fe3 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr new file mode 100644 index 00000000000..457bea046c7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr @@ -0,0 +1,16 @@ +error[E0244]: wrong number of type arguments: expected 0, found 1 + --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:15:11 + | +LL | fn foo(_: Zero()) + | ^^^^^^ expected no type arguments + +error[E0220]: associated type `Output` not found for `Zero` + --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:15:15 + | +LL | fn foo(_: Zero()) + | ^^ associated type `Output` not found + +error: aborting due to 2 previous errors + +Some errors occurred: E0220, E0244. +For more information about an error, try `rustc --explain E0220`. diff --git a/src/test/compile-fail/unboxed-closures-borrow-conflict.rs b/src/test/ui/compile-fail-migration/unboxed-closures-borrow-conflict.rs index ad7e6784a0a..ad7e6784a0a 100644 --- a/src/test/compile-fail/unboxed-closures-borrow-conflict.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-borrow-conflict.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-borrow-conflict.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-borrow-conflict.stderr new file mode 100644 index 00000000000..cd62d77caed --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-borrow-conflict.stderr @@ -0,0 +1,11 @@ +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/unboxed-closures-borrow-conflict.rs:17:9 + | +LL | let f = || x += 1; + | -- borrow of `x` occurs here +LL | let _y = x; //~ ERROR cannot use `x` because it was mutably borrowed + | ^^ use of borrowed `x` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0503`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-1.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-1.nll.stderr new file mode 100644 index 00000000000..a4527e79392 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-1.nll.stderr @@ -0,0 +1,66 @@ +error[E0597]: `factorial` does not live long enough + --> $DIR/unboxed-closures-failed-recursive-fn-1.rs:25:17 + | +LL | let f = |x: u32| -> u32 { + | --------------- value captured here +LL | let g = factorial.as_ref().unwrap(); + | ^^^^^^^^^ borrowed value does not live long enough +... +LL | } + | - + | | + | `factorial` dropped here while still borrowed + | borrow later used here, when `factorial` is dropped + | + = note: values in a scope are dropped in the opposite order they are defined + +error[E0506]: cannot assign to `factorial` because it is borrowed + --> $DIR/unboxed-closures-failed-recursive-fn-1.rs:30:5 + | +LL | let f = |x: u32| -> u32 { + | --------------- borrow of `factorial` occurs here +LL | let g = factorial.as_ref().unwrap(); + | --------- borrow occurs due to use in closure +... +LL | factorial = Some(Box::new(f)); + | ^^^^^^^^^ + | | + | assignment to borrowed `factorial` occurs here + | borrow later used here + +error[E0597]: `factorial` does not live long enough + --> $DIR/unboxed-closures-failed-recursive-fn-1.rs:38:17 + | +LL | let f = |x: u32| -> u32 { + | --------------- value captured here +LL | //~^ ERROR closure may outlive the current function, but it borrows `factorial` +LL | let g = factorial.as_ref().unwrap(); + | ^^^^^^^^^ borrowed value does not live long enough +... +LL | } + | - + | | + | `factorial` dropped here while still borrowed + | borrow later used here, when `factorial` is dropped + | + = note: values in a scope are dropped in the opposite order they are defined + +error[E0506]: cannot assign to `factorial` because it is borrowed + --> $DIR/unboxed-closures-failed-recursive-fn-1.rs:42:5 + | +LL | let f = |x: u32| -> u32 { + | --------------- borrow of `factorial` occurs here +LL | //~^ ERROR closure may outlive the current function, but it borrows `factorial` +LL | let g = factorial.as_ref().unwrap(); + | --------- borrow occurs due to use in closure +... +LL | factorial = Some(Box::new(f)); + | ^^^^^^^^^ + | | + | assignment to borrowed `factorial` occurs here + | borrow later used here + +error: aborting due to 4 previous errors + +Some errors occurred: E0506, E0597. +For more information about an error, try `rustc --explain E0506`. diff --git a/src/test/compile-fail/unboxed-closures-failed-recursive-fn-1.rs b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-1.rs index ce60521034e..ce60521034e 100644 --- a/src/test/compile-fail/unboxed-closures-failed-recursive-fn-1.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-1.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-1.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-1.stderr new file mode 100644 index 00000000000..8390e9f0f95 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-1.stderr @@ -0,0 +1,30 @@ +error[E0597]: `factorial` does not live long enough + --> $DIR/unboxed-closures-failed-recursive-fn-1.rs:25:17 + | +LL | let f = |x: u32| -> u32 { + | --------------- capture occurs here +LL | let g = factorial.as_ref().unwrap(); + | ^^^^^^^^^ borrowed value does not live long enough +... +LL | } + | - borrowed value dropped before borrower + | + = note: values in a scope are dropped in the opposite order they are created + +error[E0373]: closure may outlive the current function, but it borrows `factorial`, which is owned by the current function + --> $DIR/unboxed-closures-failed-recursive-fn-1.rs:36:13 + | +LL | let f = |x: u32| -> u32 { + | ^^^^^^^^^^^^^^^ may outlive borrowed value `factorial` +LL | //~^ ERROR closure may outlive the current function, but it borrows `factorial` +LL | let g = factorial.as_ref().unwrap(); + | --------- `factorial` is borrowed here +help: to force the closure to take ownership of `factorial` (and any other referenced variables), use the `move` keyword + | +LL | let f = move |x: u32| -> u32 { + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0373, E0597. +For more information about an error, try `rustc --explain E0373`. diff --git a/src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-2.rs index 8f5bf827fcf..8f5bf827fcf 100644 --- a/src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-2.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-2.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-2.stderr new file mode 100644 index 00000000000..fd6858cf7bf --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-failed-recursive-fn-2.stderr @@ -0,0 +1,14 @@ +error[E0282]: type annotations needed + --> $DIR/unboxed-closures-failed-recursive-fn-2.rs:26:32 + | +LL | let mut closure0 = None; + | ------------ consider giving `closure0` a type +... +LL | return c(); + | ^^^ cannot infer type + | + = note: type must be known at this point + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/src/test/compile-fail/unboxed-closures-fnmut-as-fn.rs b/src/test/ui/compile-fail-migration/unboxed-closures-fnmut-as-fn.rs index 2e865b2aac8..2e865b2aac8 100644 --- a/src/test/compile-fail/unboxed-closures-fnmut-as-fn.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-fnmut-as-fn.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-fnmut-as-fn.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-fnmut-as-fn.stderr new file mode 100644 index 00000000000..95aa3f15b76 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-fnmut-as-fn.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `S: std::ops::Fn<(isize,)>` is not satisfied + --> $DIR/unboxed-closures-fnmut-as-fn.rs:38:13 + | +LL | let x = call_it(&S, 22); + | ^^^^^^^ the trait `std::ops::Fn<(isize,)>` is not implemented for `S` + | +note: required by `call_it` + --> $DIR/unboxed-closures-fnmut-as-fn.rs:33:1 + | +LL | fn call_it<F:Fn(isize)->isize>(f: &F, x: isize) -> isize { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr new file mode 100644 index 00000000000..a113c1ae27f --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr @@ -0,0 +1,18 @@ +warning: not reporting region error due to nll + --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:27:15 + | +LL | x.set(y); //~ ERROR E0312 + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:27:9 + | +LL | doit(0, &|x, y| { + | - - has type `&'1 i32` + | | + | has type `&std::cell::Cell<&'2 i32>` +LL | x.set(y); //~ ERROR E0312 + | ^^^^^^^^ argument requires that `'1` must outlive `'2` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unboxed-closures-infer-argument-types-two-region-pointers.rs b/src/test/ui/compile-fail-migration/unboxed-closures-infer-argument-types-two-region-pointers.rs index bfb24c58722..bfb24c58722 100644 --- a/src/test/compile-fail/unboxed-closures-infer-argument-types-two-region-pointers.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-argument-types-two-region-pointers.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-argument-types-two-region-pointers.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-argument-types-two-region-pointers.stderr new file mode 100644 index 00000000000..7e59347155b --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-argument-types-two-region-pointers.stderr @@ -0,0 +1,26 @@ +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:27:15 + | +LL | x.set(y); //~ ERROR E0312 + | ^ + | +note: ...the reference is valid for the anonymous lifetime #3 defined on the body at 26:14... + --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:26:14 + | +LL | doit(0, &|x, y| { + | ______________^ +LL | | x.set(y); //~ ERROR E0312 +LL | | }); + | |_____^ +note: ...but the borrowed content is only valid for the anonymous lifetime #4 defined on the body at 26:14 + --> $DIR/unboxed-closures-infer-argument-types-two-region-pointers.rs:26:14 + | +LL | doit(0, &|x, y| { + | ______________^ +LL | | x.set(y); //~ ERROR E0312 +LL | | }); + | |_____^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0312`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.nll.stderr new file mode 100644 index 00000000000..718c3a19938 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.nll.stderr @@ -0,0 +1,21 @@ +error[E0596]: cannot borrow `tick1` as mutable, as it is not declared as mutable + --> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:27:9 + | +LL | let tick1 = || { + | ----- help: consider changing this to be mutable: `mut tick1` +... +LL | tick1(); + | ^^^^^ cannot borrow as mutable + +error[E0596]: cannot borrow `tick2` as mutable, as it is not declared as mutable + --> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:30:5 + | +LL | let tick2 = || { //~ ERROR closure cannot assign to immutable local variable `tick1` + | ----- help: consider changing this to be mutable: `mut tick2` +... +LL | tick2(); //~ ERROR cannot borrow + | ^^^^^ cannot borrow as mutable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs index 7c5ea031596..7c5ea031596 100644 --- a/src/test/compile-fail/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr new file mode 100644 index 00000000000..bb2ffcd21b0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr @@ -0,0 +1,22 @@ +error[E0595]: closure cannot assign to immutable local variable `tick1` + --> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:26:17 + | +LL | let tick1 = || { + | ----- consider changing this to `mut tick1` +... +LL | let tick2 = || { //~ ERROR closure cannot assign to immutable local variable `tick1` + | ^^ cannot borrow mutably + +error[E0596]: cannot borrow immutable local variable `tick2` as mutable + --> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:30:5 + | +LL | let tick2 = || { //~ ERROR closure cannot assign to immutable local variable `tick1` + | ----- consider changing this to `mut tick2` +... +LL | tick2(); //~ ERROR cannot borrow + | ^^^^^ cannot borrow mutably + +error: aborting due to 2 previous errors + +Some errors occurred: E0595, E0596. +For more information about an error, try `rustc --explain E0595`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-missing-mut.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-missing-mut.nll.stderr new file mode 100644 index 00000000000..c57f97652b3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-missing-mut.nll.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `tick` as mutable, as it is not declared as mutable + --> $DIR/unboxed-closures-infer-fnmut-missing-mut.rs:17:5 + | +LL | let tick = || counter += 1; + | ---- help: consider changing this to be mutable: `mut tick` +LL | tick(); //~ ERROR cannot borrow immutable local variable `tick` as mutable + | ^^^^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/unboxed-closures-infer-fnmut-missing-mut.rs b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-missing-mut.rs index 9e4ed307996..9e4ed307996 100644 --- a/src/test/compile-fail/unboxed-closures-infer-fnmut-missing-mut.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-missing-mut.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-missing-mut.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-missing-mut.stderr new file mode 100644 index 00000000000..22e11b6977c --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-missing-mut.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow immutable local variable `tick` as mutable + --> $DIR/unboxed-closures-infer-fnmut-missing-mut.rs:17:5 + | +LL | let tick = || counter += 1; + | ---- consider changing this to `mut tick` +LL | tick(); //~ ERROR cannot borrow immutable local variable `tick` as mutable + | ^^^^ cannot borrow mutably + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-move-missing-mut.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-move-missing-mut.nll.stderr new file mode 100644 index 00000000000..a26dc08e54a --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-move-missing-mut.nll.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `tick` as mutable, as it is not declared as mutable + --> $DIR/unboxed-closures-infer-fnmut-move-missing-mut.rs:17:5 + | +LL | let tick = move || counter += 1; + | ---- help: consider changing this to be mutable: `mut tick` +LL | tick(); //~ ERROR cannot borrow immutable local variable `tick` as mutable + | ^^^^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/unboxed-closures-infer-fnmut-move-missing-mut.rs b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-move-missing-mut.rs index de17d25b4c3..de17d25b4c3 100644 --- a/src/test/compile-fail/unboxed-closures-infer-fnmut-move-missing-mut.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-move-missing-mut.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-move-missing-mut.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-move-missing-mut.stderr new file mode 100644 index 00000000000..f9fd6c21b70 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnmut-move-missing-mut.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow immutable local variable `tick` as mutable + --> $DIR/unboxed-closures-infer-fnmut-move-missing-mut.rs:17:5 + | +LL | let tick = move || counter += 1; + | ---- consider changing this to `mut tick` +LL | tick(); //~ ERROR cannot borrow immutable local variable `tick` as mutable + | ^^^^ cannot borrow mutably + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-call-twice.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-call-twice.nll.stderr new file mode 100644 index 00000000000..f4756696b6b --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-call-twice.nll.stderr @@ -0,0 +1,11 @@ +error[E0382]: use of moved value: `tick` + --> $DIR/unboxed-closures-infer-fnonce-call-twice.rs:20:5 + | +LL | tick(); + | ---- value moved here +LL | tick(); //~ ERROR use of moved value: `tick` + | ^^^^ value used here after move + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/unboxed-closures-infer-fnonce-call-twice.rs b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-call-twice.rs index 0050fbdde26..0050fbdde26 100644 --- a/src/test/compile-fail/unboxed-closures-infer-fnonce-call-twice.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-call-twice.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-call-twice.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-call-twice.stderr new file mode 100644 index 00000000000..c713b3dd8fe --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-call-twice.stderr @@ -0,0 +1,17 @@ +error[E0382]: use of moved value: `tick` + --> $DIR/unboxed-closures-infer-fnonce-call-twice.rs:20:5 + | +LL | tick(); + | ---- value moved here +LL | tick(); //~ ERROR use of moved value: `tick` + | ^^^^ value used here after move + | +note: closure cannot be invoked more than once because it moves the variable `counter` out of its environment + --> $DIR/unboxed-closures-infer-fnonce-call-twice.rs:18:29 + | +LL | let tick = || mem::drop(counter); + | ^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-move-call-twice.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-move-call-twice.nll.stderr new file mode 100644 index 00000000000..95ed6736278 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-move-call-twice.nll.stderr @@ -0,0 +1,11 @@ +error[E0382]: use of moved value: `tick` + --> $DIR/unboxed-closures-infer-fnonce-move-call-twice.rs:20:5 + | +LL | tick(); + | ---- value moved here +LL | tick(); //~ ERROR use of moved value: `tick` + | ^^^^ value used here after move + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/unboxed-closures-infer-fnonce-move-call-twice.rs b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-move-call-twice.rs index f9709b8c596..f9709b8c596 100644 --- a/src/test/compile-fail/unboxed-closures-infer-fnonce-move-call-twice.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-move-call-twice.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-move-call-twice.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-move-call-twice.stderr new file mode 100644 index 00000000000..a9006318cd8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-infer-fnonce-move-call-twice.stderr @@ -0,0 +1,17 @@ +error[E0382]: use of moved value: `tick` + --> $DIR/unboxed-closures-infer-fnonce-move-call-twice.rs:20:5 + | +LL | tick(); + | ---- value moved here +LL | tick(); //~ ERROR use of moved value: `tick` + | ^^^^ value used here after move + | +note: closure cannot be invoked more than once because it moves the variable `counter` out of its environment + --> $DIR/unboxed-closures-infer-fnonce-move-call-twice.rs:18:34 + | +LL | let tick = move || mem::drop(counter); + | ^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-mutate-upvar.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-mutate-upvar.nll.stderr new file mode 100644 index 00000000000..f765f207303 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-mutate-upvar.nll.stderr @@ -0,0 +1,45 @@ +error[E0594]: cannot assign to `n`, as it is not declared as mutable + --> $DIR/unboxed-closures-mutate-upvar.rs:25:9 + | +LL | let n = 0; + | - help: consider changing this to be mutable: `mut n` +LL | let mut f = to_fn_mut(|| { //~ ERROR closure cannot assign +LL | n += 1; + | ^^^^^^ cannot assign + +error[E0594]: cannot assign to `n`, as it is not declared as mutable + --> $DIR/unboxed-closures-mutate-upvar.rs:42:9 + | +LL | let n = 0; + | - help: consider changing this to be mutable: `mut n` +... +LL | n += 1; //~ ERROR cannot assign + | ^^^^^^ cannot assign + +error[E0594]: cannot assign to `n`, as it is not declared as mutable + --> $DIR/unboxed-closures-mutate-upvar.rs:56:9 + | +LL | let n = 0; + | - help: consider changing this to be mutable: `mut n` +LL | let mut f = to_fn(move || { +LL | n += 1; //~ ERROR cannot assign + | ^^^^^^ cannot assign + +error[E0594]: cannot assign to `n`, as it is a captured variable in a `Fn` closure + --> $DIR/unboxed-closures-mutate-upvar.rs:63:9 + | +LL | n += 1; //~ ERROR cannot assign + | ^^^^^^ cannot assign + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/unboxed-closures-mutate-upvar.rs:62:23 + | +LL | let mut f = to_fn(move || { + | _______________________^ +LL | | n += 1; //~ ERROR cannot assign +LL | | }); + | |_____^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/unboxed-closures-mutate-upvar.rs b/src/test/ui/compile-fail-migration/unboxed-closures-mutate-upvar.rs index 35052ec0bd5..35052ec0bd5 100644 --- a/src/test/compile-fail/unboxed-closures-mutate-upvar.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-mutate-upvar.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-mutate-upvar.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-mutate-upvar.stderr new file mode 100644 index 00000000000..1164a864b6b --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-mutate-upvar.stderr @@ -0,0 +1,53 @@ +error[E0595]: closure cannot assign to immutable local variable `n` + --> $DIR/unboxed-closures-mutate-upvar.rs:24:27 + | +LL | let n = 0; + | - consider changing this to `mut n` +LL | let mut f = to_fn_mut(|| { //~ ERROR closure cannot assign + | ^^ cannot borrow mutably + +error[E0594]: cannot assign to captured outer variable in an `FnMut` closure + --> $DIR/unboxed-closures-mutate-upvar.rs:42:9 + | +LL | let n = 0; + | - help: consider making `n` mutable: `mut n` +... +LL | n += 1; //~ ERROR cannot assign + | ^^^^^^ + +error[E0594]: cannot assign to captured outer variable in an `Fn` closure + --> $DIR/unboxed-closures-mutate-upvar.rs:56:9 + | +LL | n += 1; //~ ERROR cannot assign + | ^^^^^^ + | + = note: `Fn` closures cannot capture their enclosing environment for modifications +help: consider changing this closure to take self by mutable reference + --> $DIR/unboxed-closures-mutate-upvar.rs:55:23 + | +LL | let mut f = to_fn(move || { + | _______________________^ +LL | | n += 1; //~ ERROR cannot assign +LL | | }); + | |_____^ + +error[E0594]: cannot assign to captured outer variable in an `Fn` closure + --> $DIR/unboxed-closures-mutate-upvar.rs:63:9 + | +LL | n += 1; //~ ERROR cannot assign + | ^^^^^^ + | + = note: `Fn` closures cannot capture their enclosing environment for modifications +help: consider changing this closure to take self by mutable reference + --> $DIR/unboxed-closures-mutate-upvar.rs:62:23 + | +LL | let mut f = to_fn(move || { + | _______________________^ +LL | | n += 1; //~ ERROR cannot assign +LL | | }); + | |_____^ + +error: aborting due to 4 previous errors + +Some errors occurred: E0594, E0595. +For more information about an error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr new file mode 100644 index 00000000000..be18e7cee91 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr @@ -0,0 +1,20 @@ +error[E0594]: cannot assign to `counter`, as it is a captured variable in a `Fn` closure + --> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:24:9 + | +LL | counter += 1; + | ^^^^^^^^^^^^ cannot assign + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:23:10 + | +LL | call(|| { + | __________^ +LL | | counter += 1; +LL | | //[ast]~^ ERROR cannot assign to data in a captured outer variable in an `Fn` closure +LL | | //[mir]~^^ ERROR cannot assign to `counter` +LL | | }); + | |_____^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.ast.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.ast.stderr new file mode 100644 index 00000000000..756bf06440c --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.ast.stderr @@ -0,0 +1,20 @@ +error[E0387]: cannot assign to data in a captured outer variable in an `Fn` closure + --> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:24:9 + | +LL | counter += 1; + | ^^^^^^^^^^^^ + | +help: consider changing this closure to take self by mutable reference + --> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:23:10 + | +LL | call(|| { + | __________^ +LL | | counter += 1; +LL | | //[ast]~^ ERROR cannot assign to data in a captured outer variable in an `Fn` closure +LL | | //[mir]~^^ ERROR cannot assign to `counter` +LL | | }); + | |_____^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0387`. diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr new file mode 100644 index 00000000000..be18e7cee91 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr @@ -0,0 +1,20 @@ +error[E0594]: cannot assign to `counter`, as it is a captured variable in a `Fn` closure + --> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:24:9 + | +LL | counter += 1; + | ^^^^^^^^^^^^ cannot assign + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/unboxed-closures-mutated-upvar-from-fn-closure.rs:23:10 + | +LL | call(|| { + | __________^ +LL | | counter += 1; +LL | | //[ast]~^ ERROR cannot assign to data in a captured outer variable in an `Fn` closure +LL | | //[mir]~^^ ERROR cannot assign to `counter` +LL | | }); + | |_____^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/compile-fail/unboxed-closures-mutated-upvar-from-fn-closure.rs b/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.rs index f20719ec7fa..f20719ec7fa 100644 --- a/src/test/compile-fail/unboxed-closures-mutated-upvar-from-fn-closure.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-mutated-upvar-from-fn-closure.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-recursive-fn-using-fn-mut.nll.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-recursive-fn-using-fn-mut.nll.stderr new file mode 100644 index 00000000000..e2747e1bb62 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-recursive-fn-using-fn-mut.nll.stderr @@ -0,0 +1,13 @@ +error[E0499]: cannot borrow `*self` as mutable more than once at a time + --> $DIR/unboxed-closures-recursive-fn-using-fn-mut.rs:32:21 + | +LL | (self.func)(self, arg) + | ------------^^^^------ + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + | borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/unboxed-closures-recursive-fn-using-fn-mut.rs b/src/test/ui/compile-fail-migration/unboxed-closures-recursive-fn-using-fn-mut.rs index 433c0c839c5..433c0c839c5 100644 --- a/src/test/compile-fail/unboxed-closures-recursive-fn-using-fn-mut.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-recursive-fn-using-fn-mut.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-recursive-fn-using-fn-mut.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-recursive-fn-using-fn-mut.stderr new file mode 100644 index 00000000000..eec48dd78b0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-recursive-fn-using-fn-mut.stderr @@ -0,0 +1,12 @@ +error[E0499]: cannot borrow `*self` as mutable more than once at a time + --> $DIR/unboxed-closures-recursive-fn-using-fn-mut.rs:32:21 + | +LL | (self.func)(self, arg) + | ----------- ^^^^ - first borrow ends here + | | | + | | second mutable borrow occurs here + | first mutable borrow occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/unboxed-closures-static-call-wrong-trait.rs b/src/test/ui/compile-fail-migration/unboxed-closures-static-call-wrong-trait.rs index 1c133fbfcdb..1c133fbfcdb 100644 --- a/src/test/compile-fail/unboxed-closures-static-call-wrong-trait.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-static-call-wrong-trait.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-static-call-wrong-trait.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-static-call-wrong-trait.stderr new file mode 100644 index 00000000000..53386f0e68e --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-static-call-wrong-trait.stderr @@ -0,0 +1,11 @@ +error[E0599]: no method named `call` found for type `[closure@$DIR/unboxed-closures-static-call-wrong-trait.rs:16:26: 16:31]` in the current scope + --> $DIR/unboxed-closures-static-call-wrong-trait.rs:17:10 + | +LL | mut_.call((0, )); //~ ERROR no method named `call` found + | ^^^^ + | + = note: mut_ is a function, perhaps you wish to call it + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/unboxed-closures-type-mismatch.rs b/src/test/ui/compile-fail-migration/unboxed-closures-type-mismatch.rs index dba4c8cc2e9..dba4c8cc2e9 100644 --- a/src/test/compile-fail/unboxed-closures-type-mismatch.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-type-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-type-mismatch.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-type-mismatch.stderr new file mode 100644 index 00000000000..7e11130573b --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-type-mismatch.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/unboxed-closures-type-mismatch.rs:15:15 + | +LL | let z = f(1_usize, 2); //~ ERROR mismatched types + | ^^^^^^^ expected isize, found usize + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/unboxed-closures-unsafe-extern-fn.rs b/src/test/ui/compile-fail-migration/unboxed-closures-unsafe-extern-fn.rs index 5ba93bf483f..5ba93bf483f 100644 --- a/src/test/compile-fail/unboxed-closures-unsafe-extern-fn.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-unsafe-extern-fn.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-unsafe-extern-fn.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-unsafe-extern-fn.stderr new file mode 100644 index 00000000000..16b2b11ad7b --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-unsafe-extern-fn.stderr @@ -0,0 +1,39 @@ +error[E0277]: the trait bound `for<'r> for<'s> unsafe fn(&'s isize) -> isize {square}: std::ops::Fn<(&'r isize,)>` is not satisfied + --> $DIR/unboxed-closures-unsafe-extern-fn.rs:22:13 + | +LL | let x = call_it(&square, 22); + | ^^^^^^^ the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}` + | +note: required by `call_it` + --> $DIR/unboxed-closures-unsafe-extern-fn.rs:17:1 + | +LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `for<'r> for<'s> unsafe fn(&'s isize) -> isize {square}: std::ops::FnMut<(&'r isize,)>` is not satisfied + --> $DIR/unboxed-closures-unsafe-extern-fn.rs:27:13 + | +LL | let y = call_it_mut(&mut square, 22); + | ^^^^^^^^^^^ the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}` + | +note: required by `call_it_mut` + --> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:1 + | +LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `for<'r> for<'s> unsafe fn(&'s isize) -> isize {square}: std::ops::FnOnce<(&'r isize,)>` is not satisfied + --> $DIR/unboxed-closures-unsafe-extern-fn.rs:32:13 + | +LL | let z = call_it_once(square, 22); + | ^^^^^^^^^^^^ the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `for<'r> unsafe fn(&'r isize) -> isize {square}` + | +note: required by `call_it_once` + --> $DIR/unboxed-closures-unsafe-extern-fn.rs:19:1 + | +LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unboxed-closures-wrong-abi.rs b/src/test/ui/compile-fail-migration/unboxed-closures-wrong-abi.rs index ff06f7c559b..ff06f7c559b 100644 --- a/src/test/compile-fail/unboxed-closures-wrong-abi.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-wrong-abi.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-wrong-abi.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-wrong-abi.stderr new file mode 100644 index 00000000000..6e5e1b928a2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-wrong-abi.stderr @@ -0,0 +1,39 @@ +error[E0277]: the trait bound `for<'r> for<'s> extern "C" fn(&'s isize) -> isize {square}: std::ops::Fn<(&'r isize,)>` is not satisfied + --> $DIR/unboxed-closures-wrong-abi.rs:22:13 + | +LL | let x = call_it(&square, 22); + | ^^^^^^^ the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}` + | +note: required by `call_it` + --> $DIR/unboxed-closures-wrong-abi.rs:17:1 + | +LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `for<'r> for<'s> extern "C" fn(&'s isize) -> isize {square}: std::ops::FnMut<(&'r isize,)>` is not satisfied + --> $DIR/unboxed-closures-wrong-abi.rs:27:13 + | +LL | let y = call_it_mut(&mut square, 22); + | ^^^^^^^^^^^ the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}` + | +note: required by `call_it_mut` + --> $DIR/unboxed-closures-wrong-abi.rs:18:1 + | +LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `for<'r> for<'s> extern "C" fn(&'s isize) -> isize {square}: std::ops::FnOnce<(&'r isize,)>` is not satisfied + --> $DIR/unboxed-closures-wrong-abi.rs:32:13 + | +LL | let z = call_it_once(square, 22); + | ^^^^^^^^^^^^ the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `for<'r> extern "C" fn(&'r isize) -> isize {square}` + | +note: required by `call_it_once` + --> $DIR/unboxed-closures-wrong-abi.rs:19:1 + | +LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unboxed-closures-wrong-arg-type-extern-fn.rs b/src/test/ui/compile-fail-migration/unboxed-closures-wrong-arg-type-extern-fn.rs index d77750d2a04..d77750d2a04 100644 --- a/src/test/compile-fail/unboxed-closures-wrong-arg-type-extern-fn.rs +++ b/src/test/ui/compile-fail-migration/unboxed-closures-wrong-arg-type-extern-fn.rs diff --git a/src/test/ui/compile-fail-migration/unboxed-closures-wrong-arg-type-extern-fn.stderr b/src/test/ui/compile-fail-migration/unboxed-closures-wrong-arg-type-extern-fn.stderr new file mode 100644 index 00000000000..5c2e73f5716 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unboxed-closures-wrong-arg-type-extern-fn.stderr @@ -0,0 +1,39 @@ +error[E0277]: the trait bound `for<'r> unsafe fn(isize) -> isize {square}: std::ops::Fn<(&'r isize,)>` is not satisfied + --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:23:13 + | +LL | let x = call_it(&square, 22); + | ^^^^^^^ the trait `for<'r> std::ops::Fn<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}` + | +note: required by `call_it` + --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:18:1 + | +LL | fn call_it<F:Fn(&isize)->isize>(_: &F, _: isize) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `for<'r> unsafe fn(isize) -> isize {square}: std::ops::FnMut<(&'r isize,)>` is not satisfied + --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:28:13 + | +LL | let y = call_it_mut(&mut square, 22); + | ^^^^^^^^^^^ the trait `for<'r> std::ops::FnMut<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}` + | +note: required by `call_it_mut` + --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:1 + | +LL | fn call_it_mut<F:FnMut(&isize)->isize>(_: &mut F, _: isize) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `for<'r> unsafe fn(isize) -> isize {square}: std::ops::FnOnce<(&'r isize,)>` is not satisfied + --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:33:13 + | +LL | let z = call_it_once(square, 22); + | ^^^^^^^^^^^^ the trait `for<'r> std::ops::FnOnce<(&'r isize,)>` is not implemented for `unsafe fn(isize) -> isize {square}` + | +note: required by `call_it_once` + --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:20:1 + | +LL | fn call_it_once<F:FnOnce(&isize)->isize>(_: F, _: isize) -> isize { 0 } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/underscore-lifetime-binders.rs b/src/test/ui/compile-fail-migration/underscore-lifetime-binders.rs index 6a6698957d9..6a6698957d9 100644 --- a/src/test/compile-fail/underscore-lifetime-binders.rs +++ b/src/test/ui/compile-fail-migration/underscore-lifetime-binders.rs diff --git a/src/test/ui/compile-fail-migration/underscore-lifetime-binders.stderr b/src/test/ui/compile-fail-migration/underscore-lifetime-binders.stderr new file mode 100644 index 00000000000..4917c2795e3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/underscore-lifetime-binders.stderr @@ -0,0 +1,45 @@ +error[E0106]: missing lifetime specifier + --> $DIR/underscore-lifetime-binders.rs:12:17 + | +LL | struct Baz<'a>(&'_ &'a u8); //~ ERROR missing lifetime specifier + | ^^ expected lifetime parameter + +error[E0106]: missing lifetime specifier + --> $DIR/underscore-lifetime-binders.rs:14:10 + | +LL | impl Foo<'_> { //~ ERROR missing lifetime specifier + | ^^ expected lifetime parameter + +error[E0262]: invalid lifetime parameter name: `'_` + --> $DIR/underscore-lifetime-binders.rs:18:8 + | +LL | fn foo<'_> //~ ERROR invalid lifetime parameter name: `'_` + | ^^ '_ is a reserved lifetime name + +error[E0262]: invalid lifetime parameter name: `'_` + --> $DIR/underscore-lifetime-binders.rs:24:21 + | +LL | fn meh() -> Box<for<'_> Meh<'_>> //~ ERROR invalid lifetime parameter name: `'_` + | ^^ '_ is a reserved lifetime name + +error[E0106]: missing lifetime specifier + --> $DIR/underscore-lifetime-binders.rs:24:29 + | +LL | fn meh() -> Box<for<'_> Meh<'_>> //~ ERROR invalid lifetime parameter name: `'_` + | ^^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from + = help: consider giving it a 'static lifetime + +error[E0106]: missing lifetime specifier + --> $DIR/underscore-lifetime-binders.rs:30:35 + | +LL | fn foo2(_: &'_ u8, y: &'_ u8) -> &'_ u8 { y } //~ ERROR missing lifetime specifier + | ^^ expected lifetime parameter + | + = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `_` or `y` + +error: aborting due to 6 previous errors + +Some errors occurred: E0106, E0262. +For more information about an error, try `rustc --explain E0106`. diff --git a/src/test/ui/compile-fail-migration/underscore-lifetime-elison-mismatch.nll.stderr b/src/test/ui/compile-fail-migration/underscore-lifetime-elison-mismatch.nll.stderr new file mode 100644 index 00000000000..eef04cbf351 --- /dev/null +++ b/src/test/ui/compile-fail-migration/underscore-lifetime-elison-mismatch.nll.stderr @@ -0,0 +1,17 @@ +warning: not reporting region error due to nll + --> $DIR/underscore-lifetime-elison-mismatch.rs:11:49 + | +LL | fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); } //~ ERROR lifetime mismatch + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/underscore-lifetime-elison-mismatch.rs:11:42 + | +LL | fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); } //~ ERROR lifetime mismatch + | - - ^^^^^^^^^ argument requires that `'1` must outlive `'2` + | | | + | | let's call the lifetime of this reference `'1` + | let's call the lifetime of this reference `'2` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/underscore-lifetime-elison-mismatch.rs b/src/test/ui/compile-fail-migration/underscore-lifetime-elison-mismatch.rs index b36c8eb324e..b36c8eb324e 100644 --- a/src/test/compile-fail/underscore-lifetime-elison-mismatch.rs +++ b/src/test/ui/compile-fail-migration/underscore-lifetime-elison-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/underscore-lifetime-elison-mismatch.stderr b/src/test/ui/compile-fail-migration/underscore-lifetime-elison-mismatch.stderr new file mode 100644 index 00000000000..0847ea362c9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/underscore-lifetime-elison-mismatch.stderr @@ -0,0 +1,11 @@ +error[E0623]: lifetime mismatch + --> $DIR/underscore-lifetime-elison-mismatch.rs:11:49 + | +LL | fn foo(x: &mut Vec<&'_ u8>, y: &'_ u8) { x.push(y); } //~ ERROR lifetime mismatch + | ------ ------ ^ ...but data from `y` flows into `x` here + | | + | these two types are declared with different lifetimes... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/compile-fail/uninhabited-enum-cast.rs b/src/test/ui/compile-fail-migration/uninhabited-enum-cast.rs index 2a5d25e6b98..2a5d25e6b98 100644 --- a/src/test/compile-fail/uninhabited-enum-cast.rs +++ b/src/test/ui/compile-fail-migration/uninhabited-enum-cast.rs diff --git a/src/test/ui/compile-fail-migration/uninhabited-enum-cast.stderr b/src/test/ui/compile-fail-migration/uninhabited-enum-cast.stderr new file mode 100644 index 00000000000..058f8fba77c --- /dev/null +++ b/src/test/ui/compile-fail-migration/uninhabited-enum-cast.stderr @@ -0,0 +1,11 @@ +error[E0605]: non-primitive cast: `E` as `isize` + --> $DIR/uninhabited-enum-cast.rs:14:20 + | +LL | println!("{}", (e as isize).to_string()); //~ ERROR non-primitive cast + | ^^^^^^^^^^^^ + | + = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0605`. diff --git a/src/test/compile-fail/uninhabited-irrefutable.rs b/src/test/ui/compile-fail-migration/uninhabited-irrefutable.rs index 05a97b855e7..05a97b855e7 100644 --- a/src/test/compile-fail/uninhabited-irrefutable.rs +++ b/src/test/ui/compile-fail-migration/uninhabited-irrefutable.rs diff --git a/src/test/ui/compile-fail-migration/uninhabited-irrefutable.stderr b/src/test/ui/compile-fail-migration/uninhabited-irrefutable.stderr new file mode 100644 index 00000000000..e14ca626222 --- /dev/null +++ b/src/test/ui/compile-fail-migration/uninhabited-irrefutable.stderr @@ -0,0 +1,9 @@ +error[E0005]: refutable pattern in local binding: `A(_)` not covered + --> $DIR/uninhabited-irrefutable.rs:37:9 + | +LL | let Foo::D(_y) = x; //~ ERROR refutable pattern in local binding: `A(_)` not covered + | ^^^^^^^^^^ pattern `A(_)` not covered + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/compile-fail/uninhabited-matches-feature-gated.rs b/src/test/ui/compile-fail-migration/uninhabited-matches-feature-gated.rs index 1d3f8ff12d8..1d3f8ff12d8 100644 --- a/src/test/compile-fail/uninhabited-matches-feature-gated.rs +++ b/src/test/ui/compile-fail-migration/uninhabited-matches-feature-gated.rs diff --git a/src/test/ui/compile-fail-migration/uninhabited-matches-feature-gated.stderr b/src/test/ui/compile-fail-migration/uninhabited-matches-feature-gated.stderr new file mode 100644 index 00000000000..d86ebda027e --- /dev/null +++ b/src/test/ui/compile-fail-migration/uninhabited-matches-feature-gated.stderr @@ -0,0 +1,64 @@ +error[E0004]: non-exhaustive patterns: `Err(_)` not covered + --> $DIR/uninhabited-matches-feature-gated.rs:15:19 + | +LL | let _ = match x { //~ ERROR non-exhaustive + | ^ pattern `Err(_)` not covered + +error[E0004]: non-exhaustive patterns: type &Void is non-empty + --> $DIR/uninhabited-matches-feature-gated.rs:20:19 + | +LL | let _ = match x {}; //~ ERROR non-exhaustive + | ^ + | +help: Please ensure that all possible cases are being handled; possibly adding wildcards or more match arms. + --> $DIR/uninhabited-matches-feature-gated.rs:20:19 + | +LL | let _ = match x {}; //~ ERROR non-exhaustive + | ^ + +error[E0004]: non-exhaustive patterns: type (Void,) is non-empty + --> $DIR/uninhabited-matches-feature-gated.rs:23:19 + | +LL | let _ = match x {}; //~ ERROR non-exhaustive + | ^ + | +help: Please ensure that all possible cases are being handled; possibly adding wildcards or more match arms. + --> $DIR/uninhabited-matches-feature-gated.rs:23:19 + | +LL | let _ = match x {}; //~ ERROR non-exhaustive + | ^ + +error[E0004]: non-exhaustive patterns: type [Void; 1] is non-empty + --> $DIR/uninhabited-matches-feature-gated.rs:26:19 + | +LL | let _ = match x {}; //~ ERROR non-exhaustive + | ^ + | +help: Please ensure that all possible cases are being handled; possibly adding wildcards or more match arms. + --> $DIR/uninhabited-matches-feature-gated.rs:26:19 + | +LL | let _ = match x {}; //~ ERROR non-exhaustive + | ^ + +error[E0004]: non-exhaustive patterns: `&[_]` not covered + --> $DIR/uninhabited-matches-feature-gated.rs:29:19 + | +LL | let _ = match x { //~ ERROR non-exhaustive + | ^ pattern `&[_]` not covered + +error[E0004]: non-exhaustive patterns: `Err(_)` not covered + --> $DIR/uninhabited-matches-feature-gated.rs:37:19 + | +LL | let _ = match x { //~ ERROR non-exhaustive + | ^ pattern `Err(_)` not covered + +error[E0005]: refutable pattern in local binding: `Err(_)` not covered + --> $DIR/uninhabited-matches-feature-gated.rs:42:9 + | +LL | let Ok(x) = x; + | ^^^^^ pattern `Err(_)` not covered + +error: aborting due to 7 previous errors + +Some errors occurred: E0004, E0005. +For more information about an error, try `rustc --explain E0004`. diff --git a/src/test/compile-fail/uninhabited-patterns.rs b/src/test/ui/compile-fail-migration/uninhabited-patterns.rs index 2cf4b78bdff..2cf4b78bdff 100644 --- a/src/test/compile-fail/uninhabited-patterns.rs +++ b/src/test/ui/compile-fail-migration/uninhabited-patterns.rs diff --git a/src/test/ui/compile-fail-migration/uninhabited-patterns.stderr b/src/test/ui/compile-fail-migration/uninhabited-patterns.stderr new file mode 100644 index 00000000000..f11ff7c13b5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/uninhabited-patterns.stderr @@ -0,0 +1,38 @@ +error: unreachable pattern + --> $DIR/uninhabited-patterns.rs:37:9 + | +LL | &[..] => (), //~ ERROR unreachable pattern + | ^^^^^ + | +note: lint level defined here + --> $DIR/uninhabited-patterns.rs:16:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/uninhabited-patterns.rs:42:9 + | +LL | Ok(box _) => (), //~ ERROR unreachable pattern + | ^^^^^^^^^ + +error: unreachable pattern + --> $DIR/uninhabited-patterns.rs:44:9 + | +LL | Err(&[..]) => (), //~ ERROR unreachable pattern + | ^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/uninhabited-patterns.rs:51:9 + | +LL | Err(Ok(_y)) => (), //~ ERROR unreachable pattern + | ^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/uninhabited-patterns.rs:54:15 + | +LL | while let Some(_y) = foo() { + | ^^^^^^^^ + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/union-ub-fat-ptr.rs b/src/test/ui/compile-fail-migration/union-ub-fat-ptr.rs index 935e69d2e22..935e69d2e22 100644 --- a/src/test/compile-fail/union-ub-fat-ptr.rs +++ b/src/test/ui/compile-fail-migration/union-ub-fat-ptr.rs diff --git a/src/test/ui/compile-fail-migration/union-ub-fat-ptr.stderr b/src/test/ui/compile-fail-migration/union-ub-fat-ptr.stderr new file mode 100644 index 00000000000..f8877e35f7a --- /dev/null +++ b/src/test/ui/compile-fail-migration/union-ub-fat-ptr.stderr @@ -0,0 +1,43 @@ +error[E0080]: this constant likely exhibits undefined behavior + --> $DIR/union-ub-fat-ptr.rs:67:1 + | +LL | const C: &str = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.str}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered length is not a valid integer + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior + +error[E0080]: this constant likely exhibits undefined behavior + --> $DIR/union-ub-fat-ptr.rs:75:1 + | +LL | const C2: &[u8] = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.slice}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered length is not a valid integer + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior + +error[E0080]: this constant likely exhibits undefined behavior + --> $DIR/union-ub-fat-ptr.rs:79:1 + | +LL | const D: &Trait = unsafe { DynTransmute { repr: DynRepr { ptr: &92, vtable: &3 } }.rust}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tried to access memory with alignment 1, but alignment 8 is required + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior + +error[E0080]: this constant likely exhibits undefined behavior + --> $DIR/union-ub-fat-ptr.rs:82:1 + | +LL | const E: &Trait = unsafe { DynTransmute { repr2: DynRepr2 { ptr: &92, vtable: &3 } }.rust}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access at offset 16, outside bounds of allocation 56 which has size 8 + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior + +error[E0080]: this constant likely exhibits undefined behavior + --> $DIR/union-ub-fat-ptr.rs:85:1 + | +LL | const F: &Trait = unsafe { DynTransmute { bad: BadDynRepr { ptr: &92, vtable: 3 } }.rust}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered vtable address is not a pointer + | + = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rust compiler repository if you believe it should not be considered undefined behavior + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0080`. diff --git a/src/test/ui/compile-fail-migration/union/union-borrow-move-parent-sibling.nll.stderr b/src/test/ui/compile-fail-migration/union/union-borrow-move-parent-sibling.nll.stderr new file mode 100644 index 00000000000..1ca2a56e757 --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-borrow-move-parent-sibling.nll.stderr @@ -0,0 +1,33 @@ +error[E0382]: use of moved value: `u.y` + --> $DIR/union-borrow-move-parent-sibling.rs:29:13 + | +LL | let a = u.x.0; + | ----- value moved here +LL | let a = u.y; //~ ERROR use of moved value: `u.y` + | ^^^ value used here after move + | + = note: move occurs because `u` has type `U`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.y` + --> $DIR/union-borrow-move-parent-sibling.rs:41:13 + | +LL | let a = (u.x.0).0; + | --------- value moved here +LL | let a = u.y; //~ ERROR use of moved value: `u.y` + | ^^^ value used here after move + | + = note: move occurs because `u` has type `U`, which does not implement the `Copy` trait + +error[E0382]: use of moved value: `u.x` + --> $DIR/union-borrow-move-parent-sibling.rs:53:13 + | +LL | let a = *u.y; + | ---- value moved here +LL | let a = u.x; //~ ERROR use of moved value: `u.x` + | ^^^ value used here after move + | + = note: move occurs because `u` has type `U`, which does not implement the `Copy` trait + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/union/union-borrow-move-parent-sibling.rs b/src/test/ui/compile-fail-migration/union/union-borrow-move-parent-sibling.rs index 5f504feabb2..5f504feabb2 100644 --- a/src/test/compile-fail/union/union-borrow-move-parent-sibling.rs +++ b/src/test/ui/compile-fail-migration/union/union-borrow-move-parent-sibling.rs diff --git a/src/test/ui/compile-fail-migration/union/union-borrow-move-parent-sibling.stderr b/src/test/ui/compile-fail-migration/union/union-borrow-move-parent-sibling.stderr new file mode 100644 index 00000000000..d855435416e --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-borrow-move-parent-sibling.stderr @@ -0,0 +1,64 @@ +error[E0502]: cannot borrow `u.y` as immutable because `u.x.0` is also borrowed as mutable + --> $DIR/union-borrow-move-parent-sibling.rs:23:14 + | +LL | let a = &mut u.x.0; + | ----- mutable borrow occurs here +LL | let a = &u.y; //~ ERROR cannot borrow `u.y` + | ^^^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error[E0382]: use of moved value: `u.y` + --> $DIR/union-borrow-move-parent-sibling.rs:29:9 + | +LL | let a = u.x.0; + | - value moved here +LL | let a = u.y; //~ ERROR use of moved value: `u.y` + | ^ value used here after move + | + = note: move occurs because `u.y` has type `[type error]`, which does not implement the `Copy` trait + +error[E0502]: cannot borrow `u.y` as immutable because `u.x.0.0` is also borrowed as mutable + --> $DIR/union-borrow-move-parent-sibling.rs:35:14 + | +LL | let a = &mut (u.x.0).0; + | --------- mutable borrow occurs here +LL | let a = &u.y; //~ ERROR cannot borrow `u.y` + | ^^^ immutable borrow occurs here +LL | } + | - mutable borrow ends here + +error[E0382]: use of moved value: `u.y` + --> $DIR/union-borrow-move-parent-sibling.rs:41:9 + | +LL | let a = (u.x.0).0; + | - value moved here +LL | let a = u.y; //~ ERROR use of moved value: `u.y` + | ^ value used here after move + | + = note: move occurs because `u.y` has type `[type error]`, which does not implement the `Copy` trait + +error[E0502]: cannot borrow `u` (via `u.x`) as immutable because `u` is also borrowed as mutable (via `*u.y`) + --> $DIR/union-borrow-move-parent-sibling.rs:47:14 + | +LL | let a = &mut *u.y; + | ---- mutable borrow occurs here (via `*u.y`) +LL | let a = &u.x; //~ ERROR cannot borrow `u` (via `u.x`) + | ^^^ immutable borrow occurs here (via `u.x`) +LL | } + | - mutable borrow ends here + +error[E0382]: use of moved value: `u.x` + --> $DIR/union-borrow-move-parent-sibling.rs:53:9 + | +LL | let a = *u.y; + | - value moved here +LL | let a = u.x; //~ ERROR use of moved value: `u.x` + | ^ value used here after move + | + = note: move occurs because `u.x` has type `[type error]`, which does not implement the `Copy` trait + +error: aborting due to 6 previous errors + +Some errors occurred: E0382, E0502. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/union/union-const-pat.rs b/src/test/ui/compile-fail-migration/union/union-const-pat.rs index 5f75e3cc4a2..5f75e3cc4a2 100644 --- a/src/test/compile-fail/union/union-const-pat.rs +++ b/src/test/ui/compile-fail-migration/union/union-const-pat.rs diff --git a/src/test/ui/compile-fail-migration/union/union-const-pat.stderr b/src/test/ui/compile-fail-migration/union/union-const-pat.stderr new file mode 100644 index 00000000000..2d9c9a5e520 --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-const-pat.stderr @@ -0,0 +1,8 @@ +error: cannot use unions in constant patterns + --> $DIR/union-const-pat.rs:20:9 + | +LL | C => {} //~ ERROR cannot use unions in constant patterns + | ^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/union/union-copy.rs b/src/test/ui/compile-fail-migration/union/union-copy.rs index 9014b3f2956..9014b3f2956 100644 --- a/src/test/compile-fail/union/union-copy.rs +++ b/src/test/ui/compile-fail-migration/union/union-copy.rs diff --git a/src/test/ui/compile-fail-migration/union/union-copy.stderr b/src/test/ui/compile-fail-migration/union/union-copy.stderr new file mode 100644 index 00000000000..05da9e90af7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-copy.stderr @@ -0,0 +1,12 @@ +error[E0204]: the trait `Copy` may not be implemented for this type + --> $DIR/union-copy.rs:24:6 + | +LL | a: String + | --------- this field does not implement `Copy` +... +LL | impl Copy for W {} //~ ERROR the trait `Copy` may not be implemented for this type + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0204`. diff --git a/src/test/compile-fail/union/union-derive-clone.rs b/src/test/ui/compile-fail-migration/union/union-derive-clone.rs index 6e226d7d79f..6e226d7d79f 100644 --- a/src/test/compile-fail/union/union-derive-clone.rs +++ b/src/test/ui/compile-fail-migration/union/union-derive-clone.rs diff --git a/src/test/ui/compile-fail-migration/union/union-derive-clone.stderr b/src/test/ui/compile-fail-migration/union/union-derive-clone.stderr new file mode 100644 index 00000000000..e9a92b4452a --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-derive-clone.stderr @@ -0,0 +1,27 @@ +error[E0277]: the trait bound `U1: std::marker::Copy` is not satisfied + --> $DIR/union-derive-clone.rs:13:10 + | +LL | #[derive(Clone)] //~ ERROR the trait bound `U1: std::marker::Copy` is not satisfied + | ^^^^^ the trait `std::marker::Copy` is not implemented for `U1` + | + = note: required by `std::clone::AssertParamIsCopy` + +error[E0599]: no method named `clone` found for type `U4<CloneNoCopy>` in the current scope + --> $DIR/union-derive-clone.rs:40:15 + | +LL | union U4<T> { + | ----------- method `clone` not found for this +... +LL | let w = u.clone(); //~ ERROR no method named `clone` found for type `U4<CloneNoCopy>` + | ^^^^^ + | + = note: the method `clone` exists but the following trait bounds were not satisfied: + `U4<CloneNoCopy> : std::clone::Clone` + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `clone`, perhaps you need to implement it: + candidate #1: `std::clone::Clone` + +error: aborting due to 2 previous errors + +Some errors occurred: E0277, E0599. +For more information about an error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/union/union-derive.rs b/src/test/ui/compile-fail-migration/union/union-derive.rs index ffd290fb073..ffd290fb073 100644 --- a/src/test/compile-fail/union/union-derive.rs +++ b/src/test/ui/compile-fail-migration/union/union-derive.rs diff --git a/src/test/ui/compile-fail-migration/union/union-derive.stderr b/src/test/ui/compile-fail-migration/union/union-derive.stderr new file mode 100644 index 00000000000..e8e11e832d9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-derive.stderr @@ -0,0 +1,38 @@ +error: this trait cannot be derived for unions + --> $DIR/union-derive.rs:19:5 + | +LL | Debug, //~ ERROR this trait cannot be derived for unions + | ^^^^^ + +error: this trait cannot be derived for unions + --> $DIR/union-derive.rs:18:5 + | +LL | Default, //~ ERROR this trait cannot be derived for unions + | ^^^^^^^ + +error: this trait cannot be derived for unions + --> $DIR/union-derive.rs:17:5 + | +LL | Hash, //~ ERROR this trait cannot be derived for unions + | ^^^^ + +error: this trait cannot be derived for unions + --> $DIR/union-derive.rs:16:5 + | +LL | Ord, //~ ERROR this trait cannot be derived for unions + | ^^^ + +error: this trait cannot be derived for unions + --> $DIR/union-derive.rs:15:5 + | +LL | PartialOrd, //~ ERROR this trait cannot be derived for unions + | ^^^^^^^^^^ + +error: this trait cannot be derived for unions + --> $DIR/union-derive.rs:14:5 + | +LL | PartialEq, //~ ERROR this trait cannot be derived for unions + | ^^^^^^^^^ + +error: aborting due to 6 previous errors + diff --git a/src/test/compile-fail/union/union-empty.rs b/src/test/ui/compile-fail-migration/union/union-empty.rs index 1f499c49a68..1f499c49a68 100644 --- a/src/test/compile-fail/union/union-empty.rs +++ b/src/test/ui/compile-fail-migration/union/union-empty.rs diff --git a/src/test/ui/compile-fail-migration/union/union-empty.stderr b/src/test/ui/compile-fail-migration/union/union-empty.stderr new file mode 100644 index 00000000000..5abe45814ac --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-empty.stderr @@ -0,0 +1,8 @@ +error: unions cannot have zero fields + --> $DIR/union-empty.rs:11:1 + | +LL | union U {} //~ ERROR unions cannot have zero fields + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/union/union-generic.rs b/src/test/ui/compile-fail-migration/union/union-generic.rs index 8bd422b42d8..8bd422b42d8 100644 --- a/src/test/compile-fail/union/union-generic.rs +++ b/src/test/ui/compile-fail-migration/union/union-generic.rs diff --git a/src/test/ui/compile-fail-migration/union/union-generic.stderr b/src/test/ui/compile-fail-migration/union/union-generic.stderr new file mode 100644 index 00000000000..dbfffa005fb --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-generic.stderr @@ -0,0 +1,27 @@ +error[E0277]: the trait bound `std::rc::Rc<u32>: std::marker::Copy` is not satisfied + --> $DIR/union-generic.rs:18:13 + | +LL | let u = U { a: Rc::new(0u32) }; + | ^ the trait `std::marker::Copy` is not implemented for `std::rc::Rc<u32>` + | +note: required by `U` + --> $DIR/union-generic.rs:13:1 + | +LL | union U<T: Copy> { + | ^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::rc::Rc<u32>: std::marker::Copy` is not satisfied + --> $DIR/union-generic.rs:20:13 + | +LL | let u = U::<Rc<u32>> { a: Default::default() }; + | ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::rc::Rc<u32>` + | +note: required by `U` + --> $DIR/union-generic.rs:13:1 + | +LL | union U<T: Copy> { + | ^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/union/union-lint-dead-code.rs b/src/test/ui/compile-fail-migration/union/union-lint-dead-code.rs index a64187c5f23..a64187c5f23 100644 --- a/src/test/compile-fail/union/union-lint-dead-code.rs +++ b/src/test/ui/compile-fail-migration/union/union-lint-dead-code.rs diff --git a/src/test/ui/compile-fail-migration/union/union-lint-dead-code.stderr b/src/test/ui/compile-fail-migration/union/union-lint-dead-code.stderr new file mode 100644 index 00000000000..2cd3aab8c29 --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-lint-dead-code.stderr @@ -0,0 +1,14 @@ +error: field is never used: `b` + --> $DIR/union-lint-dead-code.rs:15:5 + | +LL | b: bool, //~ ERROR: field is never used + | ^^^^^^^ + | +note: lint level defined here + --> $DIR/union-lint-dead-code.rs:11:9 + | +LL | #![deny(dead_code)] + | ^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/union/union-nonrepresentable.rs b/src/test/ui/compile-fail-migration/union/union-nonrepresentable.rs index cb4683c2a0e..cb4683c2a0e 100644 --- a/src/test/compile-fail/union/union-nonrepresentable.rs +++ b/src/test/ui/compile-fail-migration/union/union-nonrepresentable.rs diff --git a/src/test/ui/compile-fail-migration/union/union-nonrepresentable.stderr b/src/test/ui/compile-fail-migration/union/union-nonrepresentable.stderr new file mode 100644 index 00000000000..17d78ea4c2b --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-nonrepresentable.stderr @@ -0,0 +1,14 @@ +error[E0072]: recursive type `U` has infinite size + --> $DIR/union-nonrepresentable.rs:13:1 + | +LL | union U { //~ ERROR recursive type `U` has infinite size + | ^^^^^^^ recursive type has infinite size +LL | a: u8, +LL | b: U, + | ---- recursive without indirection + | + = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `U` representable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0072`. diff --git a/src/test/compile-fail/union/union-repr-c.rs b/src/test/ui/compile-fail-migration/union/union-repr-c.rs index 36c42ce1104..36c42ce1104 100644 --- a/src/test/compile-fail/union/union-repr-c.rs +++ b/src/test/ui/compile-fail-migration/union/union-repr-c.rs diff --git a/src/test/ui/compile-fail-migration/union/union-repr-c.stderr b/src/test/ui/compile-fail-migration/union/union-repr-c.stderr new file mode 100644 index 00000000000..ddf50049192 --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-repr-c.stderr @@ -0,0 +1,22 @@ +error: `extern` block uses type `W` which is not FFI-safe: this union has unspecified layout + --> $DIR/union-repr-c.rs:25:22 + | +LL | static FOREIGN2: W; //~ ERROR union has unspecified layout + | ^ + | +note: lint level defined here + --> $DIR/union-repr-c.rs:12:9 + | +LL | #![deny(improper_ctypes)] + | ^^^^^^^^^^^^^^^ + = help: consider adding a #[repr(C)] attribute to this union +note: type defined here + --> $DIR/union-repr-c.rs:19:1 + | +LL | / union W { +LL | | a: u8, +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/union/union-unsafe.rs b/src/test/ui/compile-fail-migration/union/union-unsafe.rs index d993816e6f4..d993816e6f4 100644 --- a/src/test/compile-fail/union/union-unsafe.rs +++ b/src/test/ui/compile-fail-migration/union/union-unsafe.rs diff --git a/src/test/ui/compile-fail-migration/union/union-unsafe.stderr b/src/test/ui/compile-fail-migration/union/union-unsafe.stderr new file mode 100644 index 00000000000..a0b3d98f7a0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-unsafe.stderr @@ -0,0 +1,51 @@ +error[E0133]: assignment to non-`Copy` union field is unsafe and requires unsafe function or block + --> $DIR/union-unsafe.rs:31:5 + | +LL | u3.a = T::default(); //~ ERROR assignment to non-`Copy` union field is unsafe + | ^^^^ assignment to non-`Copy` union field + | + = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-unsafe.rs:43:13 + | +LL | let a = u1.a; //~ ERROR access to union field is unsafe + | ^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-unsafe.rs:45:14 + | +LL | let U1 { a } = u1; //~ ERROR access to union field is unsafe + | ^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-unsafe.rs:46:20 + | +LL | if let U1 { a: 12 } = u1 {} //~ ERROR access to union field is unsafe + | ^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: assignment to non-`Copy` union field is unsafe and requires unsafe function or block + --> $DIR/union-unsafe.rs:50:5 + | +LL | u2.a = String::from("new"); //~ ERROR assignment to non-`Copy` union field is unsafe + | ^^^^ assignment to non-`Copy` union field + | + = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized + +error[E0133]: assignment to non-`Copy` union field is unsafe and requires unsafe function or block + --> $DIR/union-unsafe.rs:54:5 + | +LL | u3.a = String::from("new"); //~ ERROR assignment to non-`Copy` union field is unsafe + | ^^^^ assignment to non-`Copy` union field + | + = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/union/union-unsized.rs b/src/test/ui/compile-fail-migration/union/union-unsized.rs index d79c2ed710e..d79c2ed710e 100644 --- a/src/test/compile-fail/union/union-unsized.rs +++ b/src/test/ui/compile-fail-migration/union/union-unsized.rs diff --git a/src/test/ui/compile-fail-migration/union/union-unsized.stderr b/src/test/ui/compile-fail-migration/union/union-unsized.stderr new file mode 100644 index 00000000000..f23dc315425 --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-unsized.stderr @@ -0,0 +1,23 @@ +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/union-unsized.rs:14:5 + | +LL | a: str, + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: no field of a union may have a dynamically sized type + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/union-unsized.rs:22:5 + | +LL | b: str, + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: no field of a union may have a dynamically sized type + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/union/union-with-drop-fields-lint.rs b/src/test/ui/compile-fail-migration/union/union-with-drop-fields-lint.rs index 87a72efbe08..87a72efbe08 100644 --- a/src/test/compile-fail/union/union-with-drop-fields-lint.rs +++ b/src/test/ui/compile-fail-migration/union/union-with-drop-fields-lint.rs diff --git a/src/test/ui/compile-fail-migration/union/union-with-drop-fields-lint.stderr b/src/test/ui/compile-fail-migration/union/union-with-drop-fields-lint.stderr new file mode 100644 index 00000000000..2d3d539cda5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/union/union-with-drop-fields-lint.stderr @@ -0,0 +1,26 @@ +error: union contains a field with possibly non-trivial drop code, drop code of union fields is ignored when dropping the union + --> $DIR/union-with-drop-fields-lint.rs:20:5 + | +LL | a: String, //~ ERROR union contains a field with possibly non-trivial drop code + | ^^^^^^^^^ + | +note: lint level defined here + --> $DIR/union-with-drop-fields-lint.rs:13:9 + | +LL | #![deny(unions_with_drop_fields)] + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: union contains a field with possibly non-trivial drop code, drop code of union fields is ignored when dropping the union + --> $DIR/union-with-drop-fields-lint.rs:28:5 + | +LL | a: S, //~ ERROR union contains a field with possibly non-trivial drop code + | ^^^^ + +error: union contains a field with possibly non-trivial drop code, drop code of union fields is ignored when dropping the union + --> $DIR/union-with-drop-fields-lint.rs:33:5 + | +LL | a: T, //~ ERROR union contains a field with possibly non-trivial drop code + | ^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/unique-object-noncopyable.rs b/src/test/ui/compile-fail-migration/unique-object-noncopyable.rs index c44718c4fc9..c44718c4fc9 100644 --- a/src/test/compile-fail/unique-object-noncopyable.rs +++ b/src/test/ui/compile-fail-migration/unique-object-noncopyable.rs diff --git a/src/test/ui/compile-fail-migration/unique-object-noncopyable.stderr b/src/test/ui/compile-fail-migration/unique-object-noncopyable.stderr new file mode 100644 index 00000000000..777b9f19bad --- /dev/null +++ b/src/test/ui/compile-fail-migration/unique-object-noncopyable.stderr @@ -0,0 +1,15 @@ +error[E0599]: no method named `clone` found for type `std::boxed::Box<dyn Foo>` in the current scope + --> $DIR/unique-object-noncopyable.rs:34:16 + | +LL | let _z = y.clone(); //~ ERROR no method named `clone` found + | ^^^^^ + | + = note: the method `clone` exists but the following trait bounds were not satisfied: + `std::boxed::Box<dyn Foo> : std::clone::Clone` + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `clone`, perhaps you need to implement it: + candidate #1: `std::clone::Clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/unique-pinned-nocopy.rs b/src/test/ui/compile-fail-migration/unique-pinned-nocopy.rs index c09feec1d4a..c09feec1d4a 100644 --- a/src/test/compile-fail/unique-pinned-nocopy.rs +++ b/src/test/ui/compile-fail-migration/unique-pinned-nocopy.rs diff --git a/src/test/ui/compile-fail-migration/unique-pinned-nocopy.stderr b/src/test/ui/compile-fail-migration/unique-pinned-nocopy.stderr new file mode 100644 index 00000000000..ddc676601fa --- /dev/null +++ b/src/test/ui/compile-fail-migration/unique-pinned-nocopy.stderr @@ -0,0 +1,15 @@ +error[E0599]: no method named `clone` found for type `std::boxed::Box<r>` in the current scope + --> $DIR/unique-pinned-nocopy.rs:22:16 + | +LL | let _j = i.clone(); //~ ERROR no method named `clone` found + | ^^^^^ + | + = note: the method `clone` exists but the following trait bounds were not satisfied: + `std::boxed::Box<r> : std::clone::Clone` + = help: items from traits can only be used if the trait is implemented and in scope + = note: the following trait defines an item `clone`, perhaps you need to implement it: + candidate #1: `std::clone::Clone` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/compile-fail/unknown-lint-tool-name.rs b/src/test/ui/compile-fail-migration/unknown-lint-tool-name.rs index 78b736edceb..78b736edceb 100644 --- a/src/test/compile-fail/unknown-lint-tool-name.rs +++ b/src/test/ui/compile-fail-migration/unknown-lint-tool-name.rs diff --git a/src/test/ui/compile-fail-migration/unknown-lint-tool-name.stderr b/src/test/ui/compile-fail-migration/unknown-lint-tool-name.stderr new file mode 100644 index 00000000000..29c3a642d87 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unknown-lint-tool-name.stderr @@ -0,0 +1,15 @@ +error[E0710]: an unknown tool name found in scoped lint: `foo::bar` + --> $DIR/unknown-lint-tool-name.rs:13:9 + | +LL | #![deny(foo::bar)] //~ ERROR an unknown tool name found in scoped lint: `foo::bar` + | ^^^ + +error[E0710]: an unknown tool name found in scoped lint: `foo::bar` + --> $DIR/unknown-lint-tool-name.rs:15:9 + | +LL | #[allow(foo::bar)] //~ ERROR an unknown tool name found in scoped lint: `foo::bar` + | ^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0710`. diff --git a/src/test/compile-fail/unknown-tool-name.rs b/src/test/ui/compile-fail-migration/unknown-tool-name.rs index 99c336c28cd..99c336c28cd 100644 --- a/src/test/compile-fail/unknown-tool-name.rs +++ b/src/test/ui/compile-fail-migration/unknown-tool-name.rs diff --git a/src/test/ui/compile-fail-migration/unknown-tool-name.stderr b/src/test/ui/compile-fail-migration/unknown-tool-name.stderr new file mode 100644 index 00000000000..151f957ac56 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unknown-tool-name.stderr @@ -0,0 +1,9 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `foo` + --> $DIR/unknown-tool-name.rs:13:3 + | +LL | #[foo::bar] //~ ERROR failed to resolve. Use of undeclared type or module `foo` + | ^^^ Use of undeclared type or module `foo` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/compile-fail-migration/unop-move-semantics.nll.stderr b/src/test/ui/compile-fail-migration/unop-move-semantics.nll.stderr new file mode 100644 index 00000000000..111940aab2c --- /dev/null +++ b/src/test/ui/compile-fail-migration/unop-move-semantics.nll.stderr @@ -0,0 +1,27 @@ +error[E0382]: borrow of moved value: `x` + --> $DIR/unop-move-semantics.rs:18:5 + | +LL | !x; + | - value moved here +LL | +LL | x.clone(); //~ ERROR: use of moved value + | ^ value borrowed here after move + | + = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait + +error[E0507]: cannot move out of borrowed content + --> $DIR/unop-move-semantics.rs:34:6 + | +LL | !*m; //~ ERROR: cannot move out of borrowed content + | ^^ cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/unop-move-semantics.rs:36:6 + | +LL | !*n; //~ ERROR: cannot move out of borrowed content + | ^^ cannot move out of borrowed content + +error: aborting due to 3 previous errors + +Some errors occurred: E0382, E0507. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/unop-move-semantics.rs b/src/test/ui/compile-fail-migration/unop-move-semantics.rs index 94656667598..94656667598 100644 --- a/src/test/compile-fail/unop-move-semantics.rs +++ b/src/test/ui/compile-fail-migration/unop-move-semantics.rs diff --git a/src/test/ui/compile-fail-migration/unop-move-semantics.stderr b/src/test/ui/compile-fail-migration/unop-move-semantics.stderr new file mode 100644 index 00000000000..42d17e54aa2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unop-move-semantics.stderr @@ -0,0 +1,45 @@ +error[E0382]: use of moved value: `x` + --> $DIR/unop-move-semantics.rs:18:5 + | +LL | !x; + | - value moved here +LL | +LL | x.clone(); //~ ERROR: use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait + +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/unop-move-semantics.rs:25:6 + | +LL | let m = &x; + | - borrow of `x` occurs here +... +LL | !x; //~ ERROR: cannot move out of `x` because it is borrowed + | ^ move out of `x` occurs here + +error[E0505]: cannot move out of `y` because it is borrowed + --> $DIR/unop-move-semantics.rs:27:6 + | +LL | let n = &mut y; + | - borrow of `y` occurs here +... +LL | !y; //~ ERROR: cannot move out of `y` because it is borrowed + | ^ move out of `y` occurs here + +error[E0507]: cannot move out of borrowed content + --> $DIR/unop-move-semantics.rs:34:6 + | +LL | !*m; //~ ERROR: cannot move out of borrowed content + | ^^ cannot move out of borrowed content + +error[E0507]: cannot move out of borrowed content + --> $DIR/unop-move-semantics.rs:36:6 + | +LL | !*n; //~ ERROR: cannot move out of borrowed content + | ^^ cannot move out of borrowed content + +error: aborting due to 5 previous errors + +Some errors occurred: E0382, E0505, E0507. +For more information about an error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/unop-neg-bool.rs b/src/test/ui/compile-fail-migration/unop-neg-bool.rs index 316e17c54ad..316e17c54ad 100644 --- a/src/test/compile-fail/unop-neg-bool.rs +++ b/src/test/ui/compile-fail-migration/unop-neg-bool.rs diff --git a/src/test/ui/compile-fail-migration/unop-neg-bool.stderr b/src/test/ui/compile-fail-migration/unop-neg-bool.stderr new file mode 100644 index 00000000000..8ffb71ec4ce --- /dev/null +++ b/src/test/ui/compile-fail-migration/unop-neg-bool.stderr @@ -0,0 +1,11 @@ +error[E0600]: cannot apply unary operator `-` to type `bool` + --> $DIR/unop-neg-bool.rs:12:5 + | +LL | -true; //~ ERROR cannot apply unary operator `-` to type `bool` + | ^^^^^ cannot apply unary operator `-` + | + = note: an implementation of `std::ops::Neg` might be missing for `bool` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0600`. diff --git a/src/test/compile-fail/unreachable-arm.rs b/src/test/ui/compile-fail-migration/unreachable-arm.rs index df827d2c784..df827d2c784 100644 --- a/src/test/compile-fail/unreachable-arm.rs +++ b/src/test/ui/compile-fail-migration/unreachable-arm.rs diff --git a/src/test/ui/compile-fail-migration/unreachable-arm.stderr b/src/test/ui/compile-fail-migration/unreachable-arm.stderr new file mode 100644 index 00000000000..6bd3f281ea9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unreachable-arm.stderr @@ -0,0 +1,14 @@ +error: unreachable pattern + --> $DIR/unreachable-arm.rs:21:9 + | +LL | Foo::A(_, 1) => { } //~ ERROR unreachable pattern + | ^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/unreachable-arm.rs:14:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unreachable-code.rs b/src/test/ui/compile-fail-migration/unreachable-code.rs index dd08eed5df9..dd08eed5df9 100644 --- a/src/test/compile-fail/unreachable-code.rs +++ b/src/test/ui/compile-fail-migration/unreachable-code.rs diff --git a/src/test/ui/compile-fail-migration/unreachable-code.stderr b/src/test/ui/compile-fail-migration/unreachable-code.stderr new file mode 100644 index 00000000000..0c5d94c6502 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unreachable-code.stderr @@ -0,0 +1,14 @@ +error: unreachable statement + --> $DIR/unreachable-code.rs:17:3 + | +LL | let a = 3; //~ ERROR: unreachable statement + | ^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/unreachable-code.rs:11:9 + | +LL | #![deny(unreachable_code)] + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unreachable-in-call.rs b/src/test/ui/compile-fail-migration/unreachable-in-call.rs index 72462468432..72462468432 100644 --- a/src/test/compile-fail/unreachable-in-call.rs +++ b/src/test/ui/compile-fail-migration/unreachable-in-call.rs diff --git a/src/test/ui/compile-fail-migration/unreachable-in-call.stderr b/src/test/ui/compile-fail-migration/unreachable-in-call.stderr new file mode 100644 index 00000000000..215829af443 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unreachable-in-call.stderr @@ -0,0 +1,22 @@ +error: unreachable expression + --> $DIR/unreachable-in-call.rs:24:10 + | +LL | get_u8()); //~ ERROR unreachable expression + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/unreachable-in-call.rs:12:9 + | +LL | #![deny(unreachable_code)] + | ^^^^^^^^^^^^^^^^ + +error: unreachable expression + --> $DIR/unreachable-in-call.rs:27:5 + | +LL | / call( //~ ERROR unreachable expression +LL | | get_u8(), +LL | | diverge()); + | |__________________^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/unreachable-loop-patterns.rs b/src/test/ui/compile-fail-migration/unreachable-loop-patterns.rs index cfd829e416e..cfd829e416e 100644 --- a/src/test/compile-fail/unreachable-loop-patterns.rs +++ b/src/test/ui/compile-fail-migration/unreachable-loop-patterns.rs diff --git a/src/test/ui/compile-fail-migration/unreachable-loop-patterns.stderr b/src/test/ui/compile-fail-migration/unreachable-loop-patterns.stderr new file mode 100644 index 00000000000..724a92b0947 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unreachable-loop-patterns.stderr @@ -0,0 +1,14 @@ +error: unreachable pattern + --> $DIR/unreachable-loop-patterns.rs:18:9 + | +LL | for _ in x {} + | ^ + | +note: lint level defined here + --> $DIR/unreachable-loop-patterns.rs:13:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unreachable-try-pattern.rs b/src/test/ui/compile-fail-migration/unreachable-try-pattern.rs index df340095bb4..df340095bb4 100644 --- a/src/test/compile-fail/unreachable-try-pattern.rs +++ b/src/test/ui/compile-fail-migration/unreachable-try-pattern.rs diff --git a/src/test/ui/compile-fail-migration/unreachable-try-pattern.stderr b/src/test/ui/compile-fail-migration/unreachable-try-pattern.stderr new file mode 100644 index 00000000000..a8a0ed3d03b --- /dev/null +++ b/src/test/ui/compile-fail-migration/unreachable-try-pattern.stderr @@ -0,0 +1,43 @@ +warning: unreachable expression + --> $DIR/unreachable-try-pattern.rs:29:36 + | +LL | let y = (match x { Ok(n) => Ok(n as u32), Err(e) => Err(e) })?; + | ^^^^^^^^ + | +note: lint level defined here + --> $DIR/unreachable-try-pattern.rs:13:9 + | +LL | #![warn(unreachable_code)] + | ^^^^^^^^^^^^^^^^ + +warning: unreachable pattern + --> $DIR/unreachable-try-pattern.rs:29:24 + | +LL | let y = (match x { Ok(n) => Ok(n as u32), Err(e) => Err(e) })?; + | ^^^^^ + | +note: lint level defined here + --> $DIR/unreachable-try-pattern.rs:14:9 + | +LL | #![warn(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +warning: unreachable pattern + --> $DIR/unreachable-try-pattern.rs:40:40 + | +LL | let y = (match x { Ok(n) => Ok(n), Err(e) => Err(e) })?; + | ^^^^^^ + +error: compilation successful + --> $DIR/unreachable-try-pattern.rs:46:1 + | +LL | / fn main() { //~ ERROR: compilation successful +LL | | let _ = bar(Err(123)); +LL | | let _ = foo(Err(123)); +LL | | let _ = qux(Ok(123)); +LL | | let _ = vom(Ok(123)); +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unreachable-variant.rs b/src/test/ui/compile-fail-migration/unreachable-variant.rs index 5983c83f8b4..5983c83f8b4 100644 --- a/src/test/compile-fail/unreachable-variant.rs +++ b/src/test/ui/compile-fail-migration/unreachable-variant.rs diff --git a/src/test/ui/compile-fail-migration/unreachable-variant.stderr b/src/test/ui/compile-fail-migration/unreachable-variant.stderr new file mode 100644 index 00000000000..fff77586549 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unreachable-variant.stderr @@ -0,0 +1,9 @@ +error[E0603]: module `super_sekrit` is private + --> $DIR/unreachable-variant.rs:16:14 + | +LL | let _x = other::super_sekrit::sooper_sekrit::baz; //~ ERROR is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/unresolved-extern-mod-suggestion.rs b/src/test/ui/compile-fail-migration/unresolved-extern-mod-suggestion.rs index 714b73ec739..714b73ec739 100644 --- a/src/test/compile-fail/unresolved-extern-mod-suggestion.rs +++ b/src/test/ui/compile-fail-migration/unresolved-extern-mod-suggestion.rs diff --git a/src/test/ui/compile-fail-migration/unresolved-extern-mod-suggestion.stderr b/src/test/ui/compile-fail-migration/unresolved-extern-mod-suggestion.stderr new file mode 100644 index 00000000000..4e3ea573d27 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unresolved-extern-mod-suggestion.stderr @@ -0,0 +1,17 @@ +error[E0254]: the name `core` is defined multiple times + --> $DIR/unresolved-extern-mod-suggestion.rs:12:5 + | +LL | extern crate core; + | ------------------ previous import of the extern crate `core` here +LL | use core; + | ^^^^ `core` reimported here + | + = note: `core` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | use core as other_core; + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0254`. diff --git a/src/test/compile-fail/unresolved-import-recovery.rs b/src/test/ui/compile-fail-migration/unresolved-import-recovery.rs index 8173f69191d..8173f69191d 100644 --- a/src/test/compile-fail/unresolved-import-recovery.rs +++ b/src/test/ui/compile-fail-migration/unresolved-import-recovery.rs diff --git a/src/test/ui/compile-fail-migration/unresolved-import-recovery.stderr b/src/test/ui/compile-fail-migration/unresolved-import-recovery.stderr new file mode 100644 index 00000000000..d4304195eb1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unresolved-import-recovery.stderr @@ -0,0 +1,9 @@ +error[E0432]: unresolved import `unresolved` + --> $DIR/unresolved-import-recovery.rs:14:13 + | +LL | pub use unresolved; //~ ERROR unresolved import `unresolved` + | ^^^^^^^^^^ no `unresolved` in the root + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/unresolved-import.rs b/src/test/ui/compile-fail-migration/unresolved-import.rs index a3eeb6de96b..a3eeb6de96b 100644 --- a/src/test/compile-fail/unresolved-import.rs +++ b/src/test/ui/compile-fail-migration/unresolved-import.rs diff --git a/src/test/ui/compile-fail-migration/unresolved-import.stderr b/src/test/ui/compile-fail-migration/unresolved-import.stderr new file mode 100644 index 00000000000..1e663cde48a --- /dev/null +++ b/src/test/ui/compile-fail-migration/unresolved-import.stderr @@ -0,0 +1,44 @@ +error[E0432]: unresolved import `foo` + --> $DIR/unresolved-import.rs:13:5 + | +LL | use foo::bar; //~ ERROR unresolved import `foo` [E0432] + | ^^^ Maybe a missing `extern crate foo;`? + +error[E0432]: unresolved import `bar::Baz` + --> $DIR/unresolved-import.rs:16:5 + | +LL | use bar::Baz as x; //~ ERROR unresolved import `bar::Baz` [E0432] + | ^^^^^^^^^^^^^ no `Baz` in `bar`. Did you mean to use `Bar`? + +error[E0432]: unresolved import `food::baz` + --> $DIR/unresolved-import.rs:19:5 + | +LL | use food::baz; //~ ERROR unresolved import `food::baz` + | ^^^^^^^^^ no `baz` in `food`. Did you mean to use `bag`? + +error[E0432]: unresolved import `food::beens` + --> $DIR/unresolved-import.rs:22:12 + | +LL | use food::{beens as Foo}; //~ ERROR unresolved import `food::beens` [E0432] + | ^^^^^^^^^^^^ no `beens` in `food`. Did you mean to use `beans`? + +error[E0432]: unresolved import `MyEnum` + --> $DIR/unresolved-import.rs:44:9 + | +LL | use MyEnum::*; //~ ERROR unresolved import `MyEnum` [E0432] + | ^^^^^^ Did you mean `self::MyEnum`? + +error[E0432]: unresolved import `Enum` + --> $DIR/unresolved-import.rs:53:9 + | +LL | use Enum::*; //~ ERROR unresolved import `Enum` [E0432] + | ^^^^ Did you mean `self::Enum`? + +error[E0601]: `main` function not found in crate `unresolved_import` + | + = note: consider adding a `main` function to `$DIR/unresolved-import.rs` + +error: aborting due to 7 previous errors + +Some errors occurred: E0432, E0601. +For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/unsafe-around-compiler-generated-unsafe.rs b/src/test/ui/compile-fail-migration/unsafe-around-compiler-generated-unsafe.rs index 484a8979d71..484a8979d71 100644 --- a/src/test/compile-fail/unsafe-around-compiler-generated-unsafe.rs +++ b/src/test/ui/compile-fail-migration/unsafe-around-compiler-generated-unsafe.rs diff --git a/src/test/ui/compile-fail-migration/unsafe-around-compiler-generated-unsafe.stderr b/src/test/ui/compile-fail-migration/unsafe-around-compiler-generated-unsafe.stderr new file mode 100644 index 00000000000..849630ac34e --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsafe-around-compiler-generated-unsafe.stderr @@ -0,0 +1,14 @@ +error: unnecessary `unsafe` block + --> $DIR/unsafe-around-compiler-generated-unsafe.rs:16:5 + | +LL | unsafe { println!("foo"); } //~ ERROR unnecessary `unsafe` + | ^^^^^^ unnecessary `unsafe` block + | +note: lint level defined here + --> $DIR/unsafe-around-compiler-generated-unsafe.rs:13:9 + | +LL | #![deny(unused_unsafe)] + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs b/src/test/ui/compile-fail-migration/unsafe-fn-assign-deref-ptr.rs index baf2002a94f..baf2002a94f 100644 --- a/src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs +++ b/src/test/ui/compile-fail-migration/unsafe-fn-assign-deref-ptr.rs diff --git a/src/test/ui/compile-fail-migration/unsafe-fn-assign-deref-ptr.stderr b/src/test/ui/compile-fail-migration/unsafe-fn-assign-deref-ptr.stderr new file mode 100644 index 00000000000..e98600a8f2f --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsafe-fn-assign-deref-ptr.stderr @@ -0,0 +1,11 @@ +error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block + --> $DIR/unsafe-fn-assign-deref-ptr.rs:14:5 + | +LL | *p = 0; //~ ERROR dereference of raw pointer is unsafe + | ^^^^^^ dereference of raw pointer + | + = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/unsafe-fn-autoderef.rs b/src/test/ui/compile-fail-migration/unsafe-fn-autoderef.rs index 15b304c69ba..15b304c69ba 100644 --- a/src/test/compile-fail/unsafe-fn-autoderef.rs +++ b/src/test/ui/compile-fail-migration/unsafe-fn-autoderef.rs diff --git a/src/test/ui/compile-fail-migration/unsafe-fn-autoderef.stderr b/src/test/ui/compile-fail-migration/unsafe-fn-autoderef.stderr new file mode 100644 index 00000000000..13fcbb347c9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsafe-fn-autoderef.stderr @@ -0,0 +1,9 @@ +error[E0609]: no field `f` on type `*const Rec` + --> $DIR/unsafe-fn-autoderef.rs:29:14 + | +LL | return p.f; //~ ERROR no field `f` on type `*const Rec` + | ^ help: `p` is a native pointer; try dereferencing it: `(*p).f` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0609`. diff --git a/src/test/compile-fail/unsafe-fn-called-from-safe.rs b/src/test/ui/compile-fail-migration/unsafe-fn-called-from-safe.rs index 46f28da43d0..46f28da43d0 100644 --- a/src/test/compile-fail/unsafe-fn-called-from-safe.rs +++ b/src/test/ui/compile-fail-migration/unsafe-fn-called-from-safe.rs diff --git a/src/test/ui/compile-fail-migration/unsafe-fn-called-from-safe.stderr b/src/test/ui/compile-fail-migration/unsafe-fn-called-from-safe.stderr new file mode 100644 index 00000000000..a781347040e --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsafe-fn-called-from-safe.stderr @@ -0,0 +1,11 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/unsafe-fn-called-from-safe.rs:15:5 + | +LL | f(); //~ ERROR call to unsafe function is unsafe + | ^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/unsafe-fn-deref-ptr.rs b/src/test/ui/compile-fail-migration/unsafe-fn-deref-ptr.rs index 8e3ce8ff9b5..8e3ce8ff9b5 100644 --- a/src/test/compile-fail/unsafe-fn-deref-ptr.rs +++ b/src/test/ui/compile-fail-migration/unsafe-fn-deref-ptr.rs diff --git a/src/test/ui/compile-fail-migration/unsafe-fn-deref-ptr.stderr b/src/test/ui/compile-fail-migration/unsafe-fn-deref-ptr.stderr new file mode 100644 index 00000000000..885f6e446fe --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsafe-fn-deref-ptr.stderr @@ -0,0 +1,11 @@ +error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block + --> $DIR/unsafe-fn-deref-ptr.rs:13:12 + | +LL | return *p; //~ ERROR dereference of raw pointer is unsafe + | ^^ dereference of raw pointer + | + = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/unsafe-fn-used-as-value.rs b/src/test/ui/compile-fail-migration/unsafe-fn-used-as-value.rs index f09a0c7107a..f09a0c7107a 100644 --- a/src/test/compile-fail/unsafe-fn-used-as-value.rs +++ b/src/test/ui/compile-fail-migration/unsafe-fn-used-as-value.rs diff --git a/src/test/ui/compile-fail-migration/unsafe-fn-used-as-value.stderr b/src/test/ui/compile-fail-migration/unsafe-fn-used-as-value.stderr new file mode 100644 index 00000000000..7f8af300be5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsafe-fn-used-as-value.stderr @@ -0,0 +1,11 @@ +error[E0133]: call to unsafe function is unsafe and requires unsafe function or block + --> $DIR/unsafe-fn-used-as-value.rs:16:5 + | +LL | x(); //~ ERROR call to unsafe function is unsafe + | ^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/unsafe-move-val-init.rs b/src/test/ui/compile-fail-migration/unsafe-move-val-init.rs index b4e425e7bbf..b4e425e7bbf 100644 --- a/src/test/compile-fail/unsafe-move-val-init.rs +++ b/src/test/ui/compile-fail-migration/unsafe-move-val-init.rs diff --git a/src/test/ui/compile-fail-migration/unsafe-move-val-init.stderr b/src/test/ui/compile-fail-migration/unsafe-move-val-init.stderr new file mode 100644 index 00000000000..be92623b5d0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsafe-move-val-init.stderr @@ -0,0 +1,11 @@ +error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block + --> $DIR/unsafe-move-val-init.rs:18:5 + | +LL | intrinsics::move_val_init(1 as *mut u32, 1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer + | + = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/compile-fail/unsafe-subtyping.rs b/src/test/ui/compile-fail-migration/unsafe-subtyping.rs index f4867636819..f4867636819 100644 --- a/src/test/compile-fail/unsafe-subtyping.rs +++ b/src/test/ui/compile-fail-migration/unsafe-subtyping.rs diff --git a/src/test/ui/compile-fail-migration/unsafe-subtyping.stderr b/src/test/ui/compile-fail-migration/unsafe-subtyping.stderr new file mode 100644 index 00000000000..645f2a7939e --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsafe-subtyping.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/unsafe-subtyping.rs:14:5 + | +LL | fn foo(x: Option<fn(i32)>) -> Option<unsafe fn(i32)> { + | ---------------------- expected `std::option::Option<unsafe fn(i32)>` because of return type +LL | x //~ ERROR mismatched types + | ^ expected unsafe fn, found normal fn + | + = note: expected type `std::option::Option<unsafe fn(i32)>` + found type `std::option::Option<fn(i32)>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/unsafe-trait-impl.rs b/src/test/ui/compile-fail-migration/unsafe-trait-impl.rs index fb4652affd0..fb4652affd0 100644 --- a/src/test/compile-fail/unsafe-trait-impl.rs +++ b/src/test/ui/compile-fail-migration/unsafe-trait-impl.rs diff --git a/src/test/ui/compile-fail-migration/unsafe-trait-impl.stderr b/src/test/ui/compile-fail-migration/unsafe-trait-impl.stderr new file mode 100644 index 00000000000..ae47d6c1627 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsafe-trait-impl.stderr @@ -0,0 +1,15 @@ +error[E0053]: method `len` has an incompatible type for trait + --> $DIR/unsafe-trait-impl.rs:18:5 + | +LL | unsafe fn len(&self) -> u32; + | ---------------------------- type in trait +... +LL | fn len(&self) -> u32 { *self } + | ^^^^^^^^^^^^^^^^^^^^ expected unsafe fn, found normal fn + | + = note: expected type `unsafe fn(&u32) -> u32` + found type `fn(&u32) -> u32` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/compile-fail/unsized-bare-typaram.rs b/src/test/ui/compile-fail-migration/unsized-bare-typaram.rs index 498bdded350..498bdded350 100644 --- a/src/test/compile-fail/unsized-bare-typaram.rs +++ b/src/test/ui/compile-fail-migration/unsized-bare-typaram.rs diff --git a/src/test/ui/compile-fail-migration/unsized-bare-typaram.stderr b/src/test/ui/compile-fail-migration/unsized-bare-typaram.stderr new file mode 100644 index 00000000000..884d7acff03 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized-bare-typaram.stderr @@ -0,0 +1,18 @@ +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/unsized-bare-typaram.rs:12:23 + | +LL | fn foo<T: ?Sized>() { bar::<T>() } + | ^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `T` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where T: std::marker::Sized` bound +note: required by `bar` + --> $DIR/unsized-bare-typaram.rs:11:1 + | +LL | fn bar<T: Sized>() { } + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unsized-enum.rs b/src/test/ui/compile-fail-migration/unsized-enum.rs index 4a6a5557c95..4a6a5557c95 100644 --- a/src/test/compile-fail/unsized-enum.rs +++ b/src/test/ui/compile-fail-migration/unsized-enum.rs diff --git a/src/test/ui/compile-fail-migration/unsized-enum.stderr b/src/test/ui/compile-fail-migration/unsized-enum.stderr new file mode 100644 index 00000000000..7e965fbda52 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized-enum.stderr @@ -0,0 +1,18 @@ +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/unsized-enum.rs:17:36 + | +LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() } + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `T` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where T: std::marker::Sized` bound +note: required by `Foo` + --> $DIR/unsized-enum.rs:15:1 + | +LL | enum Foo<U> { FooSome(U), FooNone } + | ^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unsized-inherent-impl-self-type.rs b/src/test/ui/compile-fail-migration/unsized-inherent-impl-self-type.rs index a679bf77015..a679bf77015 100644 --- a/src/test/compile-fail/unsized-inherent-impl-self-type.rs +++ b/src/test/ui/compile-fail-migration/unsized-inherent-impl-self-type.rs diff --git a/src/test/ui/compile-fail-migration/unsized-inherent-impl-self-type.stderr b/src/test/ui/compile-fail-migration/unsized-inherent-impl-self-type.stderr new file mode 100644 index 00000000000..e89a3bffe9a --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized-inherent-impl-self-type.stderr @@ -0,0 +1,18 @@ +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized-inherent-impl-self-type.rs:17:17 + | +LL | impl<X: ?Sized> S5<X> { + | ^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound +note: required by `S5` + --> $DIR/unsized-inherent-impl-self-type.rs:15:1 + | +LL | struct S5<Y>(Y); + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unsized-struct.rs b/src/test/ui/compile-fail-migration/unsized-struct.rs index f2c63455c51..f2c63455c51 100644 --- a/src/test/compile-fail/unsized-struct.rs +++ b/src/test/ui/compile-fail-migration/unsized-struct.rs diff --git a/src/test/ui/compile-fail-migration/unsized-struct.stderr b/src/test/ui/compile-fail-migration/unsized-struct.stderr new file mode 100644 index 00000000000..7a089b76a44 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized-struct.stderr @@ -0,0 +1,34 @@ +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/unsized-struct.rs:17:36 + | +LL | fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() } + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `T` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where T: std::marker::Sized` bound +note: required by `Foo` + --> $DIR/unsized-struct.rs:15:1 + | +LL | struct Foo<T> { data: T } + | ^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `T` cannot be known at compilation time + --> $DIR/unsized-struct.rs:24:24 + | +LL | fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() } + | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Bar<T>`, the trait `std::marker::Sized` is not implemented for `T` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where T: std::marker::Sized` bound + = note: required because it appears within the type `Bar<T>` +note: required by `is_sized` + --> $DIR/unsized-struct.rs:12:1 + | +LL | fn is_sized<T:Sized>() { } + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unsized-trait-impl-self-type.rs b/src/test/ui/compile-fail-migration/unsized-trait-impl-self-type.rs index 5c0b8f12402..5c0b8f12402 100644 --- a/src/test/compile-fail/unsized-trait-impl-self-type.rs +++ b/src/test/ui/compile-fail-migration/unsized-trait-impl-self-type.rs diff --git a/src/test/ui/compile-fail-migration/unsized-trait-impl-self-type.stderr b/src/test/ui/compile-fail-migration/unsized-trait-impl-self-type.stderr new file mode 100644 index 00000000000..4bb9bd48358 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized-trait-impl-self-type.stderr @@ -0,0 +1,18 @@ +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized-trait-impl-self-type.rs:20:17 + | +LL | impl<X: ?Sized> T3<X> for S5<X> { + | ^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound +note: required by `S5` + --> $DIR/unsized-trait-impl-self-type.rs:18:1 + | +LL | struct S5<Y>(Y); + | ^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs b/src/test/ui/compile-fail-migration/unsized-trait-impl-trait-arg.rs index 875a52e11c0..875a52e11c0 100644 --- a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs +++ b/src/test/ui/compile-fail-migration/unsized-trait-impl-trait-arg.rs diff --git a/src/test/ui/compile-fail-migration/unsized-trait-impl-trait-arg.stderr b/src/test/ui/compile-fail-migration/unsized-trait-impl-trait-arg.stderr new file mode 100644 index 00000000000..b4369755a0e --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized-trait-impl-trait-arg.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized-trait-impl-trait-arg.rs:18:17 + | +LL | impl<X: ?Sized> T2<X> for S4<X> { + | ^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unsized3.rs b/src/test/ui/compile-fail-migration/unsized3.rs index 2e346e473ca..2e346e473ca 100644 --- a/src/test/compile-fail/unsized3.rs +++ b/src/test/ui/compile-fail-migration/unsized3.rs diff --git a/src/test/ui/compile-fail-migration/unsized3.stderr b/src/test/ui/compile-fail-migration/unsized3.stderr new file mode 100644 index 00000000000..3e01248d7d9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized3.stderr @@ -0,0 +1,91 @@ +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized3.rs:17:5 + | +LL | f2::<X>(x); + | ^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound +note: required by `f2` + --> $DIR/unsized3.rs:20:1 + | +LL | fn f2<X>(x: &X) { + | ^^^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized3.rs:28:5 + | +LL | f4::<X>(x); + | ^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound +note: required by `f4` + --> $DIR/unsized3.rs:31:1 + | +LL | fn f4<X: T>(x: &X) { + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized3.rs:43:5 + | +LL | f5(x1); + | ^^ doesn't have a size known at compile-time + | + = help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: required because it appears within the type `S<X>` +note: required by `f5` + --> $DIR/unsized3.rs:34:1 + | +LL | fn f5<Y>(x: &Y) {} + | ^^^^^^^^^^^^^^^ + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized3.rs:50:5 + | +LL | f5(&(*x1, 34)); + | ^^ doesn't have a size known at compile-time + | + = help: within `S<X>`, the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: required because it appears within the type `S<X>` + = note: only the last element of a tuple may have a dynamically sized type + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized3.rs:55:9 + | +LL | f5(&(32, *x1)); + | ^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: required because it appears within the type `S<X>` + = note: required because it appears within the type `({integer}, S<X>)` + = note: tuples must have a statically known size to be initialized + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized3.rs:55:5 + | +LL | f5(&(32, *x1)); + | ^^ doesn't have a size known at compile-time + | + = help: within `({integer}, S<X>)`, the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: required because it appears within the type `S<X>` + = note: required because it appears within the type `({integer}, S<X>)` +note: required by `f5` + --> $DIR/unsized3.rs:34:1 + | +LL | fn f5<Y>(x: &Y) {} + | ^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unsized5.rs b/src/test/ui/compile-fail-migration/unsized5.rs index a50786e306a..a50786e306a 100644 --- a/src/test/compile-fail/unsized5.rs +++ b/src/test/ui/compile-fail-migration/unsized5.rs diff --git a/src/test/ui/compile-fail-migration/unsized5.stderr b/src/test/ui/compile-fail-migration/unsized5.stderr new file mode 100644 index 00000000000..fa93ec236a5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized5.stderr @@ -0,0 +1,67 @@ +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized5.rs:14:5 + | +LL | f1: X, + | ^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: only the last field of a struct may have a dynamically sized type + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized5.rs:20:5 + | +LL | g: X, + | ^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: only the last field of a struct may have a dynamically sized type + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/unsized5.rs:25:5 + | +LL | f: str, + | ^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `str` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = note: only the last field of a struct may have a dynamically sized type + +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time + --> $DIR/unsized5.rs:30:5 + | +LL | f: [u8], + | ^^^^^^^ doesn't have a size known at compile-time + | + = help: 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-sized> + = note: only the last field of a struct may have a dynamically sized type + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized5.rs:35:8 + | +LL | V1(X, isize), + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: no field of an enum variant may have a dynamically sized type + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized5.rs:39:8 + | +LL | V2{f1: X, f: isize}, + | ^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: no field of an enum variant may have a dynamically sized type + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unsized6.rs b/src/test/ui/compile-fail-migration/unsized6.rs index 1a57f2caf8d..1a57f2caf8d 100644 --- a/src/test/compile-fail/unsized6.rs +++ b/src/test/ui/compile-fail-migration/unsized6.rs diff --git a/src/test/ui/compile-fail-migration/unsized6.stderr b/src/test/ui/compile-fail-migration/unsized6.stderr new file mode 100644 index 00000000000..9f53369b12f --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized6.stderr @@ -0,0 +1,146 @@ +error[E0277]: the size for values of type `Y` cannot be known at compilation time + --> $DIR/unsized6.rs:19:9 + | +LL | let y: Y; + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `Y` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where Y: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:17:12 + | +LL | let _: (isize, (X, isize)); + | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: only the last element of a tuple may have a dynamically sized type + +error[E0277]: the size for values of type `Z` cannot be known at compilation time + --> $DIR/unsized6.rs:21:12 + | +LL | let y: (isize, (Z, usize)); + | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `Z` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where Z: std::marker::Sized` bound + = note: only the last element of a tuple may have a dynamically sized type + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:25:9 + | +LL | let y: X; + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `Y` cannot be known at compilation time + --> $DIR/unsized6.rs:27:12 + | +LL | let y: (isize, (Y, isize)); + | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `Y` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where Y: std::marker::Sized` bound + = note: only the last element of a tuple may have a dynamically sized type + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:32:9 + | +LL | let y: X = *x1; + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:34:9 + | +LL | let y = *x2; + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:36:10 + | +LL | let (y, z) = (*x3, 4); + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:40:9 + | +LL | let y: X = *x1; + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:42:9 + | +LL | let y = *x2; + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:44:10 + | +LL | let (y, z) = (*x3, 4); + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:48:18 + | +LL | fn g1<X: ?Sized>(x: X) {} + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized6.rs:50:22 + | +LL | fn g2<X: ?Sized + T>(x: X) {} + | ^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + = note: all local variables must have a statically known size + +error: aborting due to 13 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unsized7.rs b/src/test/ui/compile-fail-migration/unsized7.rs index 07b4ae4c394..07b4ae4c394 100644 --- a/src/test/compile-fail/unsized7.rs +++ b/src/test/ui/compile-fail-migration/unsized7.rs diff --git a/src/test/ui/compile-fail-migration/unsized7.stderr b/src/test/ui/compile-fail-migration/unsized7.stderr new file mode 100644 index 00000000000..c5539d8d319 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsized7.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `X` cannot be known at compilation time + --> $DIR/unsized7.rs:22:21 + | +LL | impl<X: ?Sized + T> T1<X> for S3<X> { + | ^^^^^ doesn't have a size known at compile-time + | + = help: the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized> + = help: consider adding a `where X: std::marker::Sized` bound + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/unspecified-self-in-trait-ref.rs b/src/test/ui/compile-fail-migration/unspecified-self-in-trait-ref.rs index cf8f3e91602..cf8f3e91602 100644 --- a/src/test/compile-fail/unspecified-self-in-trait-ref.rs +++ b/src/test/ui/compile-fail-migration/unspecified-self-in-trait-ref.rs diff --git a/src/test/ui/compile-fail-migration/unspecified-self-in-trait-ref.stderr b/src/test/ui/compile-fail-migration/unspecified-self-in-trait-ref.stderr new file mode 100644 index 00000000000..c036540068b --- /dev/null +++ b/src/test/ui/compile-fail-migration/unspecified-self-in-trait-ref.stderr @@ -0,0 +1,36 @@ +error[E0599]: no function or associated item named `lol` found for type `dyn Foo<_>` in the current scope + --> $DIR/unspecified-self-in-trait-ref.rs:20:13 + | +LL | let a = Foo::lol(); + | ^^^^^^^^ function or associated item not found in `dyn Foo<_>` + +error[E0599]: no function or associated item named `lol` found for type `dyn Foo<_>` in the current scope + --> $DIR/unspecified-self-in-trait-ref.rs:22:13 + | +LL | let b = Foo::<_>::lol(); + | ^^^^^^^^^^^^^ function or associated item not found in `dyn Foo<_>` + +error[E0599]: no function or associated item named `lol` found for type `dyn Bar<_, _>` in the current scope + --> $DIR/unspecified-self-in-trait-ref.rs:24:13 + | +LL | let c = Bar::lol(); + | ^^^^^^^^ function or associated item not found in `dyn Bar<_, _>` + +error[E0599]: no function or associated item named `lol` found for type `dyn Bar<usize, _>` in the current scope + --> $DIR/unspecified-self-in-trait-ref.rs:26:13 + | +LL | let d = Bar::<usize, _>::lol(); + | ^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `dyn Bar<usize, _>` + +error[E0393]: the type parameter `A` must be explicitly specified + --> $DIR/unspecified-self-in-trait-ref.rs:28:13 + | +LL | let e = Bar::<usize>::lol(); + | ^^^^^^^^^^^^^^^^^ missing reference to `A` + | + = note: because of the default `Self` reference, type parameters must be specified on object types + +error: aborting due to 5 previous errors + +Some errors occurred: E0393, E0599. +For more information about an error, try `rustc --explain E0393`. diff --git a/src/test/compile-fail/unsupported-cast.rs b/src/test/ui/compile-fail-migration/unsupported-cast.rs index 5137663a269..5137663a269 100644 --- a/src/test/compile-fail/unsupported-cast.rs +++ b/src/test/ui/compile-fail-migration/unsupported-cast.rs diff --git a/src/test/ui/compile-fail-migration/unsupported-cast.stderr b/src/test/ui/compile-fail-migration/unsupported-cast.stderr new file mode 100644 index 00000000000..4babc01ad7f --- /dev/null +++ b/src/test/ui/compile-fail-migration/unsupported-cast.stderr @@ -0,0 +1,9 @@ +error[E0606]: casting `f64` as `*const A` is invalid + --> $DIR/unsupported-cast.rs:16:20 + | +LL | println!("{:?}", 1.0 as *const A); // Can't cast float to foreign. + | ^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0606`. diff --git a/src/test/compile-fail/unused-attr.rs b/src/test/ui/compile-fail-migration/unused-attr.rs index e20d03478ec..e20d03478ec 100644 --- a/src/test/compile-fail/unused-attr.rs +++ b/src/test/ui/compile-fail-migration/unused-attr.rs diff --git a/src/test/ui/compile-fail-migration/unused-attr.stderr b/src/test/ui/compile-fail-migration/unused-attr.stderr new file mode 100644 index 00000000000..7265dd3c63f --- /dev/null +++ b/src/test/ui/compile-fail-migration/unused-attr.stderr @@ -0,0 +1,98 @@ +error: unused attribute + --> $DIR/unused-attr.rs:17:1 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + | +note: lint level defined here + --> $DIR/unused-attr.rs:11:9 + | +LL | #![deny(unused_attributes)] + | ^^^^^^^^^^^^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:20:1 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:25:5 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:23:1 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:33:9 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:31:5 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:29:1 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:41:9 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:38:1 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:48:5 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:46:1 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:54:5 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:56:5 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:52:1 + | +LL | #[foo] //~ ERROR unused attribute + | ^^^^^^ + +error: unused attribute + --> $DIR/unused-attr.rs:15:1 + | +LL | #![foo] //~ ERROR unused attribute + | ^^^^^^^ + +error: aborting due to 15 previous errors + diff --git a/src/test/compile-fail/unused-macro-rules.rs b/src/test/ui/compile-fail-migration/unused-macro-rules.rs index 5e401c09bda..5e401c09bda 100644 --- a/src/test/compile-fail/unused-macro-rules.rs +++ b/src/test/ui/compile-fail-migration/unused-macro-rules.rs diff --git a/src/test/ui/compile-fail-migration/unused-macro-rules.stderr b/src/test/ui/compile-fail-migration/unused-macro-rules.stderr new file mode 100644 index 00000000000..8ced41022f8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unused-macro-rules.stderr @@ -0,0 +1,41 @@ +error: unused macro definition + --> $DIR/unused-macro-rules.rs:14:1 + | +LL | / macro_rules! unused { //~ ERROR: unused macro definition +LL | | () => {}; +LL | | } + | |_^ + | +note: lint level defined here + --> $DIR/unused-macro-rules.rs:11:9 + | +LL | #![deny(unused_macros)] + | ^^^^^^^^^^^^^ + +error: unused macro definition + --> $DIR/unused-macro-rules.rs:21:9 + | +LL | / macro_rules! m { //~ ERROR: unused macro definition +LL | | () => {}; +LL | | } + | |_________^ +... +LL | create_macro!(); + | ---------------- in this macro invocation + +error: unused macro definition + --> $DIR/unused-macro-rules.rs:34:5 + | +LL | / macro_rules! unused { //~ ERROR: unused macro definition +LL | | () => {}; +LL | | } + | |_____^ + | +note: lint level defined here + --> $DIR/unused-macro-rules.rs:33:12 + | +LL | #[deny(unused_macros)] + | ^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/unused-macro-with-bad-frag-spec.rs b/src/test/ui/compile-fail-migration/unused-macro-with-bad-frag-spec.rs index 28a69e6f9e2..28a69e6f9e2 100644 --- a/src/test/compile-fail/unused-macro-with-bad-frag-spec.rs +++ b/src/test/ui/compile-fail-migration/unused-macro-with-bad-frag-spec.rs diff --git a/src/test/ui/compile-fail-migration/unused-macro-with-bad-frag-spec.stderr b/src/test/ui/compile-fail-migration/unused-macro-with-bad-frag-spec.stderr new file mode 100644 index 00000000000..88435878905 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unused-macro-with-bad-frag-spec.stderr @@ -0,0 +1,10 @@ +error: invalid fragment specifier `t_ty` + --> $DIR/unused-macro-with-bad-frag-spec.rs:16:6 + | +LL | ($wrong:t_ty) => () //~ ERROR invalid fragment specifier `t_ty` + | ^^^^^^^^^^^ + | + = help: valid fragment specifiers are `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `literal`, `path`, `meta`, `tt`, `item` and `vis` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unused-macro-with-follow-violation.rs b/src/test/ui/compile-fail-migration/unused-macro-with-follow-violation.rs index dda0d3fc955..dda0d3fc955 100644 --- a/src/test/compile-fail/unused-macro-with-follow-violation.rs +++ b/src/test/ui/compile-fail-migration/unused-macro-with-follow-violation.rs diff --git a/src/test/ui/compile-fail-migration/unused-macro-with-follow-violation.stderr b/src/test/ui/compile-fail-migration/unused-macro-with-follow-violation.stderr new file mode 100644 index 00000000000..8efb191c7c6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unused-macro-with-follow-violation.stderr @@ -0,0 +1,8 @@ +error: `$e:expr` is followed by `+`, which is not allowed for `expr` fragments + --> $DIR/unused-macro-with-follow-violation.rs:14:14 + | +LL | ($e:expr +) => () //~ ERROR not allowed for `expr` fragments + | ^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unused-macro.rs b/src/test/ui/compile-fail-migration/unused-macro.rs index 9e32f01724d..9e32f01724d 100644 --- a/src/test/compile-fail/unused-macro.rs +++ b/src/test/ui/compile-fail-migration/unused-macro.rs diff --git a/src/test/ui/compile-fail-migration/unused-macro.stderr b/src/test/ui/compile-fail-migration/unused-macro.stderr new file mode 100644 index 00000000000..3e1c1164d5b --- /dev/null +++ b/src/test/ui/compile-fail-migration/unused-macro.stderr @@ -0,0 +1,38 @@ +error: unused macro definition + --> $DIR/unused-macro.rs:15:1 + | +LL | / macro unused { //~ ERROR: unused macro definition +LL | | () => {} +LL | | } + | |_^ + | +note: lint level defined here + --> $DIR/unused-macro.rs:12:9 + | +LL | #![deny(unused_macros)] + | ^^^^^^^^^^^^^ + +error: unused macro definition + --> $DIR/unused-macro.rs:25:5 + | +LL | / macro unused { //~ ERROR: unused macro definition +LL | | () => {} +LL | | } + | |_____^ + | +note: lint level defined here + --> $DIR/unused-macro.rs:24:12 + | +LL | #[deny(unused_macros)] + | ^^^^^^^^^^^^^ + +error: unused macro definition + --> $DIR/unused-macro.rs:31:5 + | +LL | / pub(crate) macro unused { //~ ERROR: unused macro definition +LL | | () => {} +LL | | } + | |_____^ + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/unused-mut-warning-captured-var.rs b/src/test/ui/compile-fail-migration/unused-mut-warning-captured-var.rs index d4dc58864ad..d4dc58864ad 100644 --- a/src/test/compile-fail/unused-mut-warning-captured-var.rs +++ b/src/test/ui/compile-fail-migration/unused-mut-warning-captured-var.rs diff --git a/src/test/ui/compile-fail-migration/unused-mut-warning-captured-var.stderr b/src/test/ui/compile-fail-migration/unused-mut-warning-captured-var.stderr new file mode 100644 index 00000000000..ae976d85bde --- /dev/null +++ b/src/test/ui/compile-fail-migration/unused-mut-warning-captured-var.stderr @@ -0,0 +1,16 @@ +error: variable does not need to be mutable + --> $DIR/unused-mut-warning-captured-var.rs:14:9 + | +LL | let mut x = 1; + | ----^ + | | + | help: remove this `mut` + | +note: lint level defined here + --> $DIR/unused-mut-warning-captured-var.rs:11:11 + | +LL | #![forbid(unused_mut)] + | ^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/unused-result.rs b/src/test/ui/compile-fail-migration/unused-result.rs index 363ab6220bd..363ab6220bd 100644 --- a/src/test/compile-fail/unused-result.rs +++ b/src/test/ui/compile-fail-migration/unused-result.rs diff --git a/src/test/ui/compile-fail-migration/unused-result.stderr b/src/test/ui/compile-fail-migration/unused-result.stderr new file mode 100644 index 00000000000..e6ca7b8fab8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/unused-result.stderr @@ -0,0 +1,48 @@ +error: unused `MustUse` which must be used + --> $DIR/unused-result.rs:31:5 + | +LL | foo::<MustUse>(); //~ ERROR: unused `MustUse` which must be used + | ^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/unused-result.rs:12:25 + | +LL | #![deny(unused_results, unused_must_use)] + | ^^^^^^^^^^^^^^^ + +error: unused `MustUseMsg` which must be used + --> $DIR/unused-result.rs:32:5 + | +LL | foo::<MustUseMsg>(); //~ ERROR: unused `MustUseMsg` which must be used + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: some message + +error: unused result + --> $DIR/unused-result.rs:44:5 + | +LL | foo::<isize>(); //~ ERROR: unused result + | ^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/unused-result.rs:12:9 + | +LL | #![deny(unused_results, unused_must_use)] + | ^^^^^^^^^^^^^^ + +error: unused `MustUse` which must be used + --> $DIR/unused-result.rs:45:5 + | +LL | foo::<MustUse>(); //~ ERROR: unused `MustUse` which must be used + | ^^^^^^^^^^^^^^^^^ + +error: unused `MustUseMsg` which must be used + --> $DIR/unused-result.rs:46:5 + | +LL | foo::<MustUseMsg>(); //~ ERROR: unused `MustUseMsg` which must be used + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: some message + +error: aborting due to 5 previous errors + diff --git a/src/test/ui/compile-fail-migration/use-after-move-based-on-type.nll.stderr b/src/test/ui/compile-fail-migration/use-after-move-based-on-type.nll.stderr new file mode 100644 index 00000000000..a18c25cbb55 --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-after-move-based-on-type.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: borrow of moved value: `x` + --> $DIR/use-after-move-based-on-type.rs:14:20 + | +LL | let _y = x; + | - value moved here +LL | println!("{}", x); //~ ERROR use of moved value + | ^ value borrowed here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/use-after-move-based-on-type.rs b/src/test/ui/compile-fail-migration/use-after-move-based-on-type.rs index e2167ca446f..e2167ca446f 100644 --- a/src/test/compile-fail/use-after-move-based-on-type.rs +++ b/src/test/ui/compile-fail-migration/use-after-move-based-on-type.rs diff --git a/src/test/ui/compile-fail-migration/use-after-move-based-on-type.stderr b/src/test/ui/compile-fail-migration/use-after-move-based-on-type.stderr new file mode 100644 index 00000000000..510cc708bed --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-after-move-based-on-type.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `x` + --> $DIR/use-after-move-based-on-type.rs:14:20 + | +LL | let _y = x; + | -- value moved here +LL | println!("{}", x); //~ ERROR use of moved value + | ^ value used here after move + | + = note: move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/use-after-move-implicity-coerced-object.nll.stderr b/src/test/ui/compile-fail-migration/use-after-move-implicity-coerced-object.nll.stderr new file mode 100644 index 00000000000..23753506368 --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-after-move-implicity-coerced-object.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: borrow of moved value: `n` + --> $DIR/use-after-move-implicity-coerced-object.rs:38:13 + | +LL | l.push(n); + | - value moved here +LL | let x = n.to_string(); + | ^ value borrowed here after move + | + = note: move occurs because `n` has type `std::boxed::Box<Number>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/use-after-move-implicity-coerced-object.rs b/src/test/ui/compile-fail-migration/use-after-move-implicity-coerced-object.rs index addc5721752..addc5721752 100644 --- a/src/test/compile-fail/use-after-move-implicity-coerced-object.rs +++ b/src/test/ui/compile-fail-migration/use-after-move-implicity-coerced-object.rs diff --git a/src/test/ui/compile-fail-migration/use-after-move-implicity-coerced-object.stderr b/src/test/ui/compile-fail-migration/use-after-move-implicity-coerced-object.stderr new file mode 100644 index 00000000000..ab7494702d7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-after-move-implicity-coerced-object.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `n` + --> $DIR/use-after-move-implicity-coerced-object.rs:38:13 + | +LL | l.push(n); + | - value moved here +LL | let x = n.to_string(); + | ^ value used here after move + | + = note: move occurs because `n` has type `std::boxed::Box<Number>`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/use-after-move-self-based-on-type.rs b/src/test/ui/compile-fail-migration/use-after-move-self-based-on-type.rs index 810fc68a0f4..810fc68a0f4 100644 --- a/src/test/compile-fail/use-after-move-self-based-on-type.rs +++ b/src/test/ui/compile-fail-migration/use-after-move-self-based-on-type.rs diff --git a/src/test/ui/compile-fail-migration/use-after-move-self-based-on-type.stderr b/src/test/ui/compile-fail-migration/use-after-move-self-based-on-type.stderr new file mode 100644 index 00000000000..60cd142799e --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-after-move-self-based-on-type.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `self.x` + --> $DIR/use-after-move-self-based-on-type.rs:22:16 + | +LL | self.bar(); + | ---- value moved here +LL | return self.x; //~ ERROR use of moved value: `self.x` + | ^^^^^^ value used here after move + | + = note: move occurs because `self` has type `S`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/compile-fail-migration/use-after-move-self.nll.stderr b/src/test/ui/compile-fail-migration/use-after-move-self.nll.stderr new file mode 100644 index 00000000000..3b19e96d12c --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-after-move-self.nll.stderr @@ -0,0 +1,11 @@ +error[E0382]: use of moved value: `*self.x` + --> $DIR/use-after-move-self.rs:20:16 + | +LL | self.bar(); + | ---- value moved here +LL | return *self.x; //~ ERROR use of moved value: `*self.x` + | ^^^^^^^ value used here after move + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/use-after-move-self.rs b/src/test/ui/compile-fail-migration/use-after-move-self.rs index e9ffb26aba5..e9ffb26aba5 100644 --- a/src/test/compile-fail/use-after-move-self.rs +++ b/src/test/ui/compile-fail-migration/use-after-move-self.rs diff --git a/src/test/ui/compile-fail-migration/use-after-move-self.stderr b/src/test/ui/compile-fail-migration/use-after-move-self.stderr new file mode 100644 index 00000000000..7273602aadc --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-after-move-self.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `*self.x` + --> $DIR/use-after-move-self.rs:20:16 + | +LL | self.bar(); + | ---- value moved here +LL | return *self.x; //~ ERROR use of moved value: `*self.x` + | ^^^^^^^ value used here after move + | + = note: move occurs because `self` has type `S`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/use-from-trait-xc.rs b/src/test/ui/compile-fail-migration/use-from-trait-xc.rs index 3848b6814d9..3848b6814d9 100644 --- a/src/test/compile-fail/use-from-trait-xc.rs +++ b/src/test/ui/compile-fail-migration/use-from-trait-xc.rs diff --git a/src/test/ui/compile-fail-migration/use-from-trait-xc.stderr b/src/test/ui/compile-fail-migration/use-from-trait-xc.stderr new file mode 100644 index 00000000000..130aca8162a --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-from-trait-xc.stderr @@ -0,0 +1,58 @@ +error[E0253]: `foo` is not directly importable + --> $DIR/use-from-trait-xc.rs:15:5 + | +LL | use use_from_trait_xc::Trait::foo; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly + +error[E0253]: `Assoc` is not directly importable + --> $DIR/use-from-trait-xc.rs:18:5 + | +LL | use use_from_trait_xc::Trait::Assoc; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly + +error[E0253]: `CONST` is not directly importable + --> $DIR/use-from-trait-xc.rs:21:5 + | +LL | use use_from_trait_xc::Trait::CONST; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly + +error[E0432]: unresolved import `use_from_trait_xc::Foo` + --> $DIR/use-from-trait-xc.rs:24:24 + | +LL | use use_from_trait_xc::Foo::new; //~ ERROR struct `Foo` is private + | ^^^ Not a module `Foo` + +error[E0432]: unresolved import `use_from_trait_xc::Foo` + --> $DIR/use-from-trait-xc.rs:27:24 + | +LL | use use_from_trait_xc::Foo::C; //~ ERROR struct `Foo` is private + | ^^^ Not a module `Foo` + +error[E0432]: unresolved import `use_from_trait_xc::Bar` + --> $DIR/use-from-trait-xc.rs:30:24 + | +LL | use use_from_trait_xc::Bar::new as bnew; + | ^^^ Not a module `Bar` + +error[E0432]: unresolved import `use_from_trait_xc::Baz::new` + --> $DIR/use-from-trait-xc.rs:33:5 + | +LL | use use_from_trait_xc::Baz::new as baznew; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `new` in `Baz` + +error[E0603]: struct `Foo` is private + --> $DIR/use-from-trait-xc.rs:24:5 + | +LL | use use_from_trait_xc::Foo::new; //~ ERROR struct `Foo` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: struct `Foo` is private + --> $DIR/use-from-trait-xc.rs:27:5 + | +LL | use use_from_trait_xc::Foo::C; //~ ERROR struct `Foo` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 9 previous errors + +Some errors occurred: E0253, E0432, E0603. +For more information about an error, try `rustc --explain E0253`. diff --git a/src/test/compile-fail/use-from-trait.rs b/src/test/ui/compile-fail-migration/use-from-trait.rs index 29db949acd0..29db949acd0 100644 --- a/src/test/compile-fail/use-from-trait.rs +++ b/src/test/ui/compile-fail-migration/use-from-trait.rs diff --git a/src/test/ui/compile-fail-migration/use-from-trait.stderr b/src/test/ui/compile-fail-migration/use-from-trait.stderr new file mode 100644 index 00000000000..b43a32988ca --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-from-trait.stderr @@ -0,0 +1,34 @@ +error[E0253]: `foo` is not directly importable + --> $DIR/use-from-trait.rs:12:5 + | +LL | use Trait::foo; + | ^^^^^^^^^^ cannot be imported directly + +error[E0253]: `Assoc` is not directly importable + --> $DIR/use-from-trait.rs:14:5 + | +LL | use Trait::Assoc; + | ^^^^^^^^^^^^ cannot be imported directly + +error[E0253]: `C` is not directly importable + --> $DIR/use-from-trait.rs:16:5 + | +LL | use Trait::C; + | ^^^^^^^^ cannot be imported directly + +error[E0432]: unresolved import `Foo` + --> $DIR/use-from-trait.rs:19:5 + | +LL | use Foo::new; + | ^^^ Not a module `Foo` + +error[E0432]: unresolved import `Foo` + --> $DIR/use-from-trait.rs:23:5 + | +LL | use Foo::C2; + | ^^^ Not a module `Foo` + +error: aborting due to 5 previous errors + +Some errors occurred: E0253, E0432. +For more information about an error, try `rustc --explain E0253`. diff --git a/src/test/compile-fail/use-keyword.rs b/src/test/ui/compile-fail-migration/use-keyword.rs index aff54f18c19..aff54f18c19 100644 --- a/src/test/compile-fail/use-keyword.rs +++ b/src/test/ui/compile-fail-migration/use-keyword.rs diff --git a/src/test/ui/compile-fail-migration/use-keyword.stderr b/src/test/ui/compile-fail-migration/use-keyword.stderr new file mode 100644 index 00000000000..11893bce5c4 --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-keyword.stderr @@ -0,0 +1,22 @@ +error[E0429]: `self` imports are only allowed within a { } list + --> $DIR/use-keyword.rs:16:13 + | +LL | use self as A; + | ^^^^^^^^^ + +error[E0432]: unresolved import `super` + --> $DIR/use-keyword.rs:18:13 + | +LL | use super as B; + | ^^^^^^^^^^ no `super` in the root + +error[E0432]: unresolved import `super` + --> $DIR/use-keyword.rs:21:21 + | +LL | use super::{self as C}; + | ^^^^^^^^^ no `super` in the root + +error: aborting due to 3 previous errors + +Some errors occurred: E0429, E0432. +For more information about an error, try `rustc --explain E0429`. diff --git a/src/test/compile-fail/use-meta-mismatch.rs b/src/test/ui/compile-fail-migration/use-meta-mismatch.rs index 6b7b9c89149..6b7b9c89149 100644 --- a/src/test/compile-fail/use-meta-mismatch.rs +++ b/src/test/ui/compile-fail-migration/use-meta-mismatch.rs diff --git a/src/test/ui/compile-fail-migration/use-meta-mismatch.stderr b/src/test/ui/compile-fail-migration/use-meta-mismatch.stderr new file mode 100644 index 00000000000..063de29510e --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-meta-mismatch.stderr @@ -0,0 +1,9 @@ +error[E0463]: can't find crate for `extra` + --> $DIR/use-meta-mismatch.rs:13:1 + | +LL | extern crate fake_crate as extra; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/compile-fail/use-mod-2.rs b/src/test/ui/compile-fail-migration/use-mod-2.rs index 5f8842a521a..5f8842a521a 100644 --- a/src/test/compile-fail/use-mod-2.rs +++ b/src/test/ui/compile-fail-migration/use-mod-2.rs diff --git a/src/test/ui/compile-fail-migration/use-mod-2.stderr b/src/test/ui/compile-fail-migration/use-mod-2.stderr new file mode 100644 index 00000000000..f343dc2b31d --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-mod-2.stderr @@ -0,0 +1,15 @@ +error[E0432]: unresolved import `self` + --> $DIR/use-mod-2.rs:12:16 + | +LL | use self::{self}; + | ^^^^ no `self` in the root + +error[E0432]: unresolved import `super` + --> $DIR/use-mod-2.rs:16:17 + | +LL | use super::{self}; + | ^^^^ no `super` in the root + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/use-mod-3.rs b/src/test/ui/compile-fail-migration/use-mod-3.rs index cce500800ca..cce500800ca 100644 --- a/src/test/compile-fail/use-mod-3.rs +++ b/src/test/ui/compile-fail-migration/use-mod-3.rs diff --git a/src/test/ui/compile-fail-migration/use-mod-3.stderr b/src/test/ui/compile-fail-migration/use-mod-3.stderr new file mode 100644 index 00000000000..61923984641 --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-mod-3.stderr @@ -0,0 +1,15 @@ +error[E0603]: module `bar` is private + --> $DIR/use-mod-3.rs:12:5 + | +LL | self //~ ERROR module `bar` is private + | ^^^^ + +error[E0603]: module `bar` is private + --> $DIR/use-mod-3.rs:15:5 + | +LL | Bar //~ ERROR module `bar` is private + | ^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/use-mod-4.rs b/src/test/ui/compile-fail-migration/use-mod-4.rs index 275e5ff1da6..275e5ff1da6 100644 --- a/src/test/compile-fail/use-mod-4.rs +++ b/src/test/ui/compile-fail-migration/use-mod-4.rs diff --git a/src/test/ui/compile-fail-migration/use-mod-4.stderr b/src/test/ui/compile-fail-migration/use-mod-4.stderr new file mode 100644 index 00000000000..9a6d608faac --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-mod-4.stderr @@ -0,0 +1,22 @@ +error[E0429]: `self` imports are only allowed within a { } list + --> $DIR/use-mod-4.rs:11:5 + | +LL | use foo::self; //~ ERROR unresolved import `foo` + | ^^^^^^^^^ + +error[E0429]: `self` imports are only allowed within a { } list + --> $DIR/use-mod-4.rs:14:5 + | +LL | use std::mem::self; + | ^^^^^^^^^^^^^^ + +error[E0432]: unresolved import `foo` + --> $DIR/use-mod-4.rs:11:5 + | +LL | use foo::self; //~ ERROR unresolved import `foo` + | ^^^ Maybe a missing `extern crate foo;`? + +error: aborting due to 3 previous errors + +Some errors occurred: E0429, E0432. +For more information about an error, try `rustc --explain E0429`. diff --git a/src/test/compile-fail/use-paths-as-items.rs b/src/test/ui/compile-fail-migration/use-paths-as-items.rs index db69bb33ae2..db69bb33ae2 100644 --- a/src/test/compile-fail/use-paths-as-items.rs +++ b/src/test/ui/compile-fail-migration/use-paths-as-items.rs diff --git a/src/test/ui/compile-fail-migration/use-paths-as-items.stderr b/src/test/ui/compile-fail-migration/use-paths-as-items.stderr new file mode 100644 index 00000000000..200cefc23af --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-paths-as-items.stderr @@ -0,0 +1,17 @@ +error[E0252]: the name `mem` is defined multiple times + --> $DIR/use-paths-as-items.rs:17:5 + | +LL | use std::{mem, ptr}; + | --- previous import of the module `mem` here +LL | use std::mem; //~ ERROR the name `mem` is defined multiple times + | ^^^^^^^^ `mem` reimported here + | + = note: `mem` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | use std::mem as other_mem; //~ ERROR the name `mem` is defined multiple times + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0252`. diff --git a/src/test/compile-fail/use-self-type.rs b/src/test/ui/compile-fail-migration/use-self-type.rs index 6b5286bf0a7..6b5286bf0a7 100644 --- a/src/test/compile-fail/use-self-type.rs +++ b/src/test/ui/compile-fail-migration/use-self-type.rs diff --git a/src/test/ui/compile-fail-migration/use-self-type.stderr b/src/test/ui/compile-fail-migration/use-self-type.stderr new file mode 100644 index 00000000000..1a3bf5a9e88 --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-self-type.stderr @@ -0,0 +1,16 @@ +error[E0433]: failed to resolve. Use of undeclared type or module `Self` + --> $DIR/use-self-type.rs:17:16 + | +LL | pub(in Self::f) struct Z; //~ ERROR Use of undeclared type or module `Self` + | ^^^^ Use of undeclared type or module `Self` + +error[E0432]: unresolved import + --> $DIR/use-self-type.rs:16:13 + | +LL | use Self::f; //~ ERROR unresolved import + | ^^^^^^^ + +error: aborting due to 2 previous errors + +Some errors occurred: E0432, E0433. +For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/compile-fail/use-super-global-path.rs b/src/test/ui/compile-fail-migration/use-super-global-path.rs index fc1a72f6f2b..fc1a72f6f2b 100644 --- a/src/test/compile-fail/use-super-global-path.rs +++ b/src/test/ui/compile-fail-migration/use-super-global-path.rs diff --git a/src/test/ui/compile-fail-migration/use-super-global-path.stderr b/src/test/ui/compile-fail-migration/use-super-global-path.stderr new file mode 100644 index 00000000000..4730653dbf9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/use-super-global-path.stderr @@ -0,0 +1,26 @@ +error[E0433]: failed to resolve. global paths cannot start with `super` + --> $DIR/use-super-global-path.rs:17:11 + | +LL | use ::super::{S, Z}; //~ ERROR global paths cannot start with `super` + | ^^^^^ global paths cannot start with `super` + +error[E0433]: failed to resolve. global paths cannot start with `super` + --> $DIR/use-super-global-path.rs:20:15 + | +LL | use ::super::main; //~ ERROR global paths cannot start with `super` + | ^^^^^ global paths cannot start with `super` + +error[E0425]: cannot find function `main` in this scope + --> $DIR/use-super-global-path.rs:21:9 + | +LL | main(); //~ ERROR cannot find function `main` in this scope + | ^^^^ not found in this scope +help: possible candidate is found in another module, you can import it into scope + | +LL | use main; + | + +error: aborting due to 3 previous errors + +Some errors occurred: E0425, E0433. +For more information about an error, try `rustc --explain E0425`. diff --git a/src/test/compile-fail/used.rs b/src/test/ui/compile-fail-migration/used.rs index f170d9c25f5..f170d9c25f5 100644 --- a/src/test/compile-fail/used.rs +++ b/src/test/ui/compile-fail-migration/used.rs diff --git a/src/test/ui/compile-fail-migration/used.stderr b/src/test/ui/compile-fail-migration/used.stderr new file mode 100644 index 00000000000..b8d0f42c3a3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/used.stderr @@ -0,0 +1,26 @@ +error: attribute must be applied to a `static` variable + --> $DIR/used.rs:16:1 + | +LL | #[used] //~ ERROR attribute must be applied to a `static` variable + | ^^^^^^^ + +error: attribute must be applied to a `static` variable + --> $DIR/used.rs:19:1 + | +LL | #[used] //~ ERROR attribute must be applied to a `static` variable + | ^^^^^^^ + +error: attribute must be applied to a `static` variable + --> $DIR/used.rs:22:1 + | +LL | #[used] //~ ERROR attribute must be applied to a `static` variable + | ^^^^^^^ + +error: attribute must be applied to a `static` variable + --> $DIR/used.rs:25:1 + | +LL | #[used] //~ ERROR attribute must be applied to a `static` variable + | ^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/useless-pub.rs b/src/test/ui/compile-fail-migration/useless-pub.rs index 064062df753..064062df753 100644 --- a/src/test/compile-fail/useless-pub.rs +++ b/src/test/ui/compile-fail-migration/useless-pub.rs diff --git a/src/test/ui/compile-fail-migration/useless-pub.stderr b/src/test/ui/compile-fail-migration/useless-pub.stderr new file mode 100644 index 00000000000..7e36bf2667e --- /dev/null +++ b/src/test/ui/compile-fail-migration/useless-pub.stderr @@ -0,0 +1,21 @@ +error[E0449]: unnecessary visibility qualifier + --> $DIR/useless-pub.rs:18:5 + | +LL | pub fn foo(&self) {} //~ ERROR: unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/useless-pub.rs:22:10 + | +LL | V1 { pub f: i32 }, //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error[E0449]: unnecessary visibility qualifier + --> $DIR/useless-pub.rs:23:8 + | +LL | V2(pub i32), //~ ERROR unnecessary visibility qualifier + | ^^^ `pub` not permitted here because it's implied + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0449`. diff --git a/src/test/compile-fail/useless_comment.rs b/src/test/ui/compile-fail-migration/useless_comment.rs index 645514971da..645514971da 100644 --- a/src/test/compile-fail/useless_comment.rs +++ b/src/test/ui/compile-fail-migration/useless_comment.rs diff --git a/src/test/ui/compile-fail-migration/useless_comment.stderr b/src/test/ui/compile-fail-migration/useless_comment.stderr new file mode 100644 index 00000000000..78c6787c88e --- /dev/null +++ b/src/test/ui/compile-fail-migration/useless_comment.stderr @@ -0,0 +1,32 @@ +error: doc comment not used by rustdoc + --> $DIR/useless_comment.rs:14:5 + | +LL | /// a //~ ERROR doc comment not used by rustdoc + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/useless_comment.rs:11:9 + | +LL | #![deny(unused_doc_comments)] + | ^^^^^^^^^^^^^^^^^^^ + +error: doc comment not used by rustdoc + --> $DIR/useless_comment.rs:17:5 + | +LL | /// b //~ doc comment not used by rustdoc + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: doc comment not used by rustdoc + --> $DIR/useless_comment.rs:19:9 + | +LL | /// c //~ ERROR doc comment not used by rustdoc + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: doc comment not used by rustdoc + --> $DIR/useless_comment.rs:24:5 + | +LL | /// foo //~ ERROR doc comment not used by rustdoc + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/user-defined-macro-rules.rs b/src/test/ui/compile-fail-migration/user-defined-macro-rules.rs index 02e1a585fa8..02e1a585fa8 100644 --- a/src/test/compile-fail/user-defined-macro-rules.rs +++ b/src/test/ui/compile-fail-migration/user-defined-macro-rules.rs diff --git a/src/test/ui/compile-fail-migration/user-defined-macro-rules.stderr b/src/test/ui/compile-fail-migration/user-defined-macro-rules.stderr new file mode 100644 index 00000000000..3359aa4bcd7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/user-defined-macro-rules.stderr @@ -0,0 +1,13 @@ +error: user-defined macros may not be named `macro_rules` + --> $DIR/user-defined-macro-rules.rs:13:1 + | +LL | macro_rules! macro_rules { () => {} } //~ ERROR user-defined macros may not be named `macro_rules` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0601]: `main` function not found in crate `user_defined_macro_rules` + | + = note: consider adding a `main` function to `$DIR/user-defined-macro-rules.rs` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/compile-fail/utf8_idents.rs b/src/test/ui/compile-fail-migration/utf8_idents.rs index 8594c35f8dd..8594c35f8dd 100644 --- a/src/test/compile-fail/utf8_idents.rs +++ b/src/test/ui/compile-fail-migration/utf8_idents.rs diff --git a/src/test/ui/compile-fail-migration/utf8_idents.stderr b/src/test/ui/compile-fail-migration/utf8_idents.stderr new file mode 100644 index 00000000000..42ee13e0511 --- /dev/null +++ b/src/test/ui/compile-fail-migration/utf8_idents.stderr @@ -0,0 +1,35 @@ +error[E0658]: non-ascii idents are not fully supported. (see issue #28979) + --> $DIR/utf8_idents.rs:13:5 + | +LL | 'β, //~ ERROR non-ascii idents are not fully supported + | ^^ + | + = help: add #![feature(non_ascii_idents)] to the crate attributes to enable + +error[E0658]: non-ascii idents are not fully supported. (see issue #28979) + --> $DIR/utf8_idents.rs:14:5 + | +LL | γ //~ ERROR non-ascii idents are not fully supported + | ^ + | + = help: add #![feature(non_ascii_idents)] to the crate attributes to enable + +error[E0658]: non-ascii idents are not fully supported. (see issue #28979) + --> $DIR/utf8_idents.rs:18:5 + | +LL | δ: usize //~ ERROR non-ascii idents are not fully supported + | ^ + | + = help: add #![feature(non_ascii_idents)] to the crate attributes to enable + +error[E0658]: non-ascii idents are not fully supported. (see issue #28979) + --> $DIR/utf8_idents.rs:22:9 + | +LL | let α = 0.00001f64; //~ ERROR non-ascii idents are not fully supported + | ^ + | + = help: add #![feature(non_ascii_idents)] to the crate attributes to enable + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/compile-fail/variadic-ffi-2.rs b/src/test/ui/compile-fail-migration/variadic-ffi-2.rs index ec5669f6392..ec5669f6392 100644 --- a/src/test/compile-fail/variadic-ffi-2.rs +++ b/src/test/ui/compile-fail-migration/variadic-ffi-2.rs diff --git a/src/test/ui/compile-fail-migration/variadic-ffi-2.stderr b/src/test/ui/compile-fail-migration/variadic-ffi-2.stderr new file mode 100644 index 00000000000..9af7b5bf753 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variadic-ffi-2.stderr @@ -0,0 +1,9 @@ +error[E0045]: variadic function must have C or cdecl calling convention + --> $DIR/variadic-ffi-2.rs:13:11 + | +LL | fn baz(f: extern "stdcall" fn(usize, ...)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variadics require C or cdecl calling convention + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0045`. diff --git a/src/test/compile-fail/variadic-ffi.rs b/src/test/ui/compile-fail-migration/variadic-ffi.rs index f245306f4d8..f245306f4d8 100644 --- a/src/test/compile-fail/variadic-ffi.rs +++ b/src/test/ui/compile-fail-migration/variadic-ffi.rs diff --git a/src/test/ui/compile-fail-migration/variadic-ffi.stderr b/src/test/ui/compile-fail-migration/variadic-ffi.stderr new file mode 100644 index 00000000000..0d0462b709d --- /dev/null +++ b/src/test/ui/compile-fail-migration/variadic-ffi.stderr @@ -0,0 +1,9 @@ +error[E0045]: variadic function must have C or cdecl calling convention + --> $DIR/variadic-ffi.rs:15:5 + | +LL | fn printf(_: *const u8, ...); //~ ERROR: variadic function must have C or cdecl calling + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ variadics require C or cdecl calling convention + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0045`. diff --git a/src/test/compile-fail/variance-associated-types.rs b/src/test/ui/compile-fail-migration/variance-associated-types.rs index 7dbfc6ac125..7dbfc6ac125 100644 --- a/src/test/compile-fail/variance-associated-types.rs +++ b/src/test/ui/compile-fail-migration/variance-associated-types.rs diff --git a/src/test/ui/compile-fail-migration/variance-associated-types.stderr b/src/test/ui/compile-fail-migration/variance-associated-types.stderr new file mode 100644 index 00000000000..03ea1e625f8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-associated-types.stderr @@ -0,0 +1,19 @@ +error[E0208]: [-, +] + --> $DIR/variance-associated-types.rs:23:1 + | +LL | / struct Foo<'a, T : Trait<'a>> { //~ ERROR [-, +] +LL | | field: (T, &'a ()) +LL | | } + | |_^ + +error[E0208]: [o, o] + --> $DIR/variance-associated-types.rs:28:1 + | +LL | / struct Bar<'a, T : Trait<'a>> { //~ ERROR [o, o] +LL | | field: <T as Trait<'a>>::Type +LL | | } + | |_^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0208`. diff --git a/src/test/ui/compile-fail-migration/variance-btree-invariant-types.nll.stderr b/src/test/ui/compile-fail-migration/variance-btree-invariant-types.nll.stderr new file mode 100644 index 00000000000..33230c26b8b --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-btree-invariant-types.nll.stderr @@ -0,0 +1,178 @@ +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:16:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:19:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:22:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:25:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:30:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:34:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:38:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:42:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:47:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:51:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:55:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-btree-invariant-types.rs:59:5 + | +LL | v //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:16:5 + | +LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> { + | ---- lifetime `'new` defined here +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:19:5 + | +LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> { + | ---- lifetime `'new` defined here +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:22:5 + | +LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> { + | ---- lifetime `'new` defined here +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:25:5 + | +LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> { + | ---- lifetime `'new` defined here +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:30:5 + | +LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>) + | ---- lifetime `'new` defined here +LL | -> OccupiedEntry<'a, &'new (), ()> { +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:34:5 + | +LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>) + | ---- lifetime `'new` defined here +LL | -> OccupiedEntry<'a, (), &'new ()> { +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:38:5 + | +LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>) + | ---- lifetime `'new` defined here +LL | -> OccupiedEntry<'a, &'static (), ()> { +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:42:5 + | +LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>) + | ---- lifetime `'new` defined here +LL | -> OccupiedEntry<'a, (), &'static ()> { +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:47:5 + | +LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>) + | ---- lifetime `'new` defined here +LL | -> VacantEntry<'a, &'new (), ()> { +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:51:5 + | +LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>) + | ---- lifetime `'new` defined here +LL | -> VacantEntry<'a, (), &'new ()> { +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:55:5 + | +LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>) + | ---- lifetime `'new` defined here +LL | -> VacantEntry<'a, &'static (), ()> { +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: unsatisfied lifetime constraints + --> $DIR/variance-btree-invariant-types.rs:59:5 + | +LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>) + | ---- lifetime `'new` defined here +LL | -> VacantEntry<'a, (), &'static ()> { +LL | v //~ ERROR mismatched types + | ^ return requires that `'new` must outlive `'static` + +error: aborting due to 12 previous errors + diff --git a/src/test/compile-fail/variance-btree-invariant-types.rs b/src/test/ui/compile-fail-migration/variance-btree-invariant-types.rs index e9607de00a3..e9607de00a3 100644 --- a/src/test/compile-fail/variance-btree-invariant-types.rs +++ b/src/test/ui/compile-fail-migration/variance-btree-invariant-types.rs diff --git a/src/test/ui/compile-fail-migration/variance-btree-invariant-types.stderr b/src/test/ui/compile-fail-migration/variance-btree-invariant-types.stderr new file mode 100644 index 00000000000..96f76fa5c2d --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-btree-invariant-types.stderr @@ -0,0 +1,183 @@ +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:16:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::IterMut<'_, &'new (), _>` + found type `std::collections::btree_map::IterMut<'_, &'static (), _>` +note: the lifetime 'new as defined on the function body at 15:21... + --> $DIR/variance-btree-invariant-types.rs:15:21 + | +LL | fn iter_cov_key<'a, 'new>(v: IterMut<'a, &'static (), ()>) -> IterMut<'a, &'new (), ()> { + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:19:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::IterMut<'_, _, &'new ()>` + found type `std::collections::btree_map::IterMut<'_, _, &'static ()>` +note: the lifetime 'new as defined on the function body at 18:21... + --> $DIR/variance-btree-invariant-types.rs:18:21 + | +LL | fn iter_cov_val<'a, 'new>(v: IterMut<'a, (), &'static ()>) -> IterMut<'a, (), &'new ()> { + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:22:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::IterMut<'_, &'static (), _>` + found type `std::collections::btree_map::IterMut<'_, &'new (), _>` +note: the lifetime 'new as defined on the function body at 21:24... + --> $DIR/variance-btree-invariant-types.rs:21:24 + | +LL | fn iter_contra_key<'a, 'new>(v: IterMut<'a, &'new (), ()>) -> IterMut<'a, &'static (), ()> { + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:25:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::IterMut<'_, _, &'static ()>` + found type `std::collections::btree_map::IterMut<'_, _, &'new ()>` +note: the lifetime 'new as defined on the function body at 24:24... + --> $DIR/variance-btree-invariant-types.rs:24:24 + | +LL | fn iter_contra_val<'a, 'new>(v: IterMut<'a, (), &'new ()>) -> IterMut<'a, (), &'static ()> { + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:30:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>` + found type `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>` +note: the lifetime 'new as defined on the function body at 28:20... + --> $DIR/variance-btree-invariant-types.rs:28:20 + | +LL | fn occ_cov_key<'a, 'new>(v: OccupiedEntry<'a, &'static (), ()>) + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:34:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>` + found type `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>` +note: the lifetime 'new as defined on the function body at 32:20... + --> $DIR/variance-btree-invariant-types.rs:32:20 + | +LL | fn occ_cov_val<'a, 'new>(v: OccupiedEntry<'a, (), &'static ()>) + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:38:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::OccupiedEntry<'_, &'static (), _>` + found type `std::collections::btree_map::OccupiedEntry<'_, &'new (), _>` +note: the lifetime 'new as defined on the function body at 36:23... + --> $DIR/variance-btree-invariant-types.rs:36:23 + | +LL | fn occ_contra_key<'a, 'new>(v: OccupiedEntry<'a, &'new (), ()>) + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:42:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::OccupiedEntry<'_, _, &'static ()>` + found type `std::collections::btree_map::OccupiedEntry<'_, _, &'new ()>` +note: the lifetime 'new as defined on the function body at 40:23... + --> $DIR/variance-btree-invariant-types.rs:40:23 + | +LL | fn occ_contra_val<'a, 'new>(v: OccupiedEntry<'a, (), &'new ()>) + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:47:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::VacantEntry<'_, &'new (), _>` + found type `std::collections::btree_map::VacantEntry<'_, &'static (), _>` +note: the lifetime 'new as defined on the function body at 45:20... + --> $DIR/variance-btree-invariant-types.rs:45:20 + | +LL | fn vac_cov_key<'a, 'new>(v: VacantEntry<'a, &'static (), ()>) + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:51:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::VacantEntry<'_, _, &'new ()>` + found type `std::collections::btree_map::VacantEntry<'_, _, &'static ()>` +note: the lifetime 'new as defined on the function body at 49:20... + --> $DIR/variance-btree-invariant-types.rs:49:20 + | +LL | fn vac_cov_val<'a, 'new>(v: VacantEntry<'a, (), &'static ()>) + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:55:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::VacantEntry<'_, &'static (), _>` + found type `std::collections::btree_map::VacantEntry<'_, &'new (), _>` +note: the lifetime 'new as defined on the function body at 53:23... + --> $DIR/variance-btree-invariant-types.rs:53:23 + | +LL | fn vac_contra_key<'a, 'new>(v: VacantEntry<'a, &'new (), ()>) + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error[E0308]: mismatched types + --> $DIR/variance-btree-invariant-types.rs:59:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `std::collections::btree_map::VacantEntry<'_, _, &'static ()>` + found type `std::collections::btree_map::VacantEntry<'_, _, &'new ()>` +note: the lifetime 'new as defined on the function body at 57:23... + --> $DIR/variance-btree-invariant-types.rs:57:23 + | +LL | fn vac_contra_val<'a, 'new>(v: VacantEntry<'a, (), &'new ()>) + | ^^^^ + = note: ...does not necessarily outlive the static lifetime + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variance-cell-is-invariant.rs b/src/test/ui/compile-fail-migration/variance-cell-is-invariant.rs index 1ddbcf4ab84..1ddbcf4ab84 100644 --- a/src/test/compile-fail/variance-cell-is-invariant.rs +++ b/src/test/ui/compile-fail-migration/variance-cell-is-invariant.rs diff --git a/src/test/ui/compile-fail-migration/variance-cell-is-invariant.stderr b/src/test/ui/compile-fail-migration/variance-cell-is-invariant.stderr new file mode 100644 index 00000000000..86f5c1176d9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-cell-is-invariant.stderr @@ -0,0 +1,15 @@ +error[E0623]: lifetime mismatch + --> $DIR/variance-cell-is-invariant.rs:24:25 + | +LL | fn use_<'short,'long>(c: Foo<'short>, + | ----------- these two types are declared with different lifetimes... +LL | s: &'short isize, +LL | l: &'long isize, + | ------------ +LL | _where:Option<&'short &'long ()>) { +LL | let _: Foo<'long> = c; //~ ERROR E0623 + | ^ ...but data from `c` flows into `l` here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0623`. diff --git a/src/test/ui/compile-fail-migration/variance-contravariant-arg-object.nll.stderr b/src/test/ui/compile-fail-migration/variance-contravariant-arg-object.nll.stderr new file mode 100644 index 00000000000..67d43dd5070 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-contravariant-arg-object.nll.stderr @@ -0,0 +1,36 @@ +warning: not reporting region error due to nll + --> $DIR/variance-contravariant-arg-object.rs:24:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-contravariant-arg-object.rs:32:5 + | +LL | v //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/variance-contravariant-arg-object.rs:24:5 + | +LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ cast requires that `'min` must outlive `'max` + +error: unsatisfied lifetime constraints + --> $DIR/variance-contravariant-arg-object.rs:32:5 + | +LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ cast requires that `'min` must outlive `'max` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/variance-contravariant-arg-object.rs b/src/test/ui/compile-fail-migration/variance-contravariant-arg-object.rs index 1795ac95358..1795ac95358 100644 --- a/src/test/compile-fail/variance-contravariant-arg-object.rs +++ b/src/test/ui/compile-fail-migration/variance-contravariant-arg-object.rs diff --git a/src/test/ui/compile-fail-migration/variance-contravariant-arg-object.stderr b/src/test/ui/compile-fail-migration/variance-contravariant-arg-object.stderr new file mode 100644 index 00000000000..aeed03733f3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-contravariant-arg-object.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-contravariant-arg-object.rs:24:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `dyn Get<&'min i32>` + found type `dyn Get<&'max i32>` +note: the lifetime 'min as defined on the function body at 20:21... + --> $DIR/variance-contravariant-arg-object.rs:20:21 + | +LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 20:27 + --> $DIR/variance-contravariant-arg-object.rs:20:27 + | +LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>) + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-contravariant-arg-object.rs:32:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `dyn Get<&'max i32>` + found type `dyn Get<&'min i32>` +note: the lifetime 'min as defined on the function body at 27:21... + --> $DIR/variance-contravariant-arg-object.rs:27:21 + | +LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 27:27 + --> $DIR/variance-contravariant-arg-object.rs:27:27 + | +LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>) + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variance-contravariant-arg-trait-match.rs b/src/test/ui/compile-fail-migration/variance-contravariant-arg-trait-match.rs index 9b6e3c9de3b..9b6e3c9de3b 100644 --- a/src/test/compile-fail/variance-contravariant-arg-trait-match.rs +++ b/src/test/ui/compile-fail-migration/variance-contravariant-arg-trait-match.rs diff --git a/src/test/ui/compile-fail-migration/variance-contravariant-arg-trait-match.stderr b/src/test/ui/compile-fail-migration/variance-contravariant-arg-trait-match.stderr new file mode 100644 index 00000000000..2895a9511ea --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-contravariant-arg-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-contravariant-arg-trait-match.rs:23:5 + | +LL | impls_get::<G,&'min i32>() //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get<&'min i32>` + found type `Get<&'max i32>` +note: the lifetime 'min as defined on the function body at 20:21... + --> $DIR/variance-contravariant-arg-trait-match.rs:20:21 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 20:27 + --> $DIR/variance-contravariant-arg-trait-match.rs:20:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-contravariant-arg-trait-match.rs:31:5 + | +LL | impls_get::<G,&'max i32>() //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get<&'max i32>` + found type `Get<&'min i32>` +note: the lifetime 'min as defined on the function body at 26:21... + --> $DIR/variance-contravariant-arg-trait-match.rs:26:21 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 26:27 + --> $DIR/variance-contravariant-arg-trait-match.rs:26:27 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variance-contravariant-self-trait-match.rs b/src/test/ui/compile-fail-migration/variance-contravariant-self-trait-match.rs index 6d9d1e61fed..6d9d1e61fed 100644 --- a/src/test/compile-fail/variance-contravariant-self-trait-match.rs +++ b/src/test/ui/compile-fail-migration/variance-contravariant-self-trait-match.rs diff --git a/src/test/ui/compile-fail-migration/variance-contravariant-self-trait-match.stderr b/src/test/ui/compile-fail-migration/variance-contravariant-self-trait-match.stderr new file mode 100644 index 00000000000..bc3f274a861 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-contravariant-self-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-contravariant-self-trait-match.rs:23:5 + | +LL | impls_get::<&'min G>(); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get` + found type `Get` +note: the lifetime 'min as defined on the function body at 20:21... + --> $DIR/variance-contravariant-self-trait-match.rs:20:21 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 20:27 + --> $DIR/variance-contravariant-self-trait-match.rs:20:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-contravariant-self-trait-match.rs:32:5 + | +LL | impls_get::<&'max G>(); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get` + found type `Get` +note: the lifetime 'min as defined on the function body at 26:21... + --> $DIR/variance-contravariant-self-trait-match.rs:26:21 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 26:27 + --> $DIR/variance-contravariant-self-trait-match.rs:26:27 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/variance-covariant-arg-object.nll.stderr b/src/test/ui/compile-fail-migration/variance-covariant-arg-object.nll.stderr new file mode 100644 index 00000000000..55413e57a94 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-covariant-arg-object.nll.stderr @@ -0,0 +1,36 @@ +warning: not reporting region error due to nll + --> $DIR/variance-covariant-arg-object.rs:25:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-covariant-arg-object.rs:32:5 + | +LL | v //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/variance-covariant-arg-object.rs:25:5 + | +LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ cast requires that `'min` must outlive `'max` + +error: unsatisfied lifetime constraints + --> $DIR/variance-covariant-arg-object.rs:32:5 + | +LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ cast requires that `'min` must outlive `'max` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/variance-covariant-arg-object.rs b/src/test/ui/compile-fail-migration/variance-covariant-arg-object.rs index ad059a467f5..ad059a467f5 100644 --- a/src/test/compile-fail/variance-covariant-arg-object.rs +++ b/src/test/ui/compile-fail-migration/variance-covariant-arg-object.rs diff --git a/src/test/ui/compile-fail-migration/variance-covariant-arg-object.stderr b/src/test/ui/compile-fail-migration/variance-covariant-arg-object.stderr new file mode 100644 index 00000000000..074ef658419 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-covariant-arg-object.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-covariant-arg-object.rs:25:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `dyn Get<&'min i32>` + found type `dyn Get<&'max i32>` +note: the lifetime 'min as defined on the function body at 20:21... + --> $DIR/variance-covariant-arg-object.rs:20:21 + | +LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 20:27 + --> $DIR/variance-covariant-arg-object.rs:20:27 + | +LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>) + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-covariant-arg-object.rs:32:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `dyn Get<&'max i32>` + found type `dyn Get<&'min i32>` +note: the lifetime 'min as defined on the function body at 28:21... + --> $DIR/variance-covariant-arg-object.rs:28:21 + | +LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 28:27 + --> $DIR/variance-covariant-arg-object.rs:28:27 + | +LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>) + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variance-covariant-arg-trait-match.rs b/src/test/ui/compile-fail-migration/variance-covariant-arg-trait-match.rs index c42a845b3b5..c42a845b3b5 100644 --- a/src/test/compile-fail/variance-covariant-arg-trait-match.rs +++ b/src/test/ui/compile-fail-migration/variance-covariant-arg-trait-match.rs diff --git a/src/test/ui/compile-fail-migration/variance-covariant-arg-trait-match.stderr b/src/test/ui/compile-fail-migration/variance-covariant-arg-trait-match.stderr new file mode 100644 index 00000000000..7692a6646f2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-covariant-arg-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-covariant-arg-trait-match.rs:24:5 + | +LL | impls_get::<G,&'min i32>() //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get<&'min i32>` + found type `Get<&'max i32>` +note: the lifetime 'min as defined on the function body at 20:21... + --> $DIR/variance-covariant-arg-trait-match.rs:20:21 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 20:27 + --> $DIR/variance-covariant-arg-trait-match.rs:20:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-covariant-arg-trait-match.rs:30:5 + | +LL | impls_get::<G,&'max i32>() //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get<&'max i32>` + found type `Get<&'min i32>` +note: the lifetime 'min as defined on the function body at 27:21... + --> $DIR/variance-covariant-arg-trait-match.rs:27:21 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 27:27 + --> $DIR/variance-covariant-arg-trait-match.rs:27:27 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variance-covariant-self-trait-match.rs b/src/test/ui/compile-fail-migration/variance-covariant-self-trait-match.rs index 25148dfc020..25148dfc020 100644 --- a/src/test/compile-fail/variance-covariant-self-trait-match.rs +++ b/src/test/ui/compile-fail-migration/variance-covariant-self-trait-match.rs diff --git a/src/test/ui/compile-fail-migration/variance-covariant-self-trait-match.stderr b/src/test/ui/compile-fail-migration/variance-covariant-self-trait-match.stderr new file mode 100644 index 00000000000..aa82b69bbbc --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-covariant-self-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-covariant-self-trait-match.rs:24:5 + | +LL | impls_get::<&'min G>(); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get` + found type `Get` +note: the lifetime 'min as defined on the function body at 20:21... + --> $DIR/variance-covariant-self-trait-match.rs:20:21 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 20:27 + --> $DIR/variance-covariant-self-trait-match.rs:20:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-covariant-self-trait-match.rs:30:5 + | +LL | impls_get::<&'max G>(); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get` + found type `Get` +note: the lifetime 'min as defined on the function body at 27:21... + --> $DIR/variance-covariant-self-trait-match.rs:27:21 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 27:27 + --> $DIR/variance-covariant-self-trait-match.rs:27:27 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/variance-invariant-arg-object.nll.stderr b/src/test/ui/compile-fail-migration/variance-invariant-arg-object.nll.stderr new file mode 100644 index 00000000000..f9097519246 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-invariant-arg-object.nll.stderr @@ -0,0 +1,36 @@ +warning: not reporting region error due to nll + --> $DIR/variance-invariant-arg-object.rs:21:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-invariant-arg-object.rs:28:5 + | +LL | v //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/variance-invariant-arg-object.rs:21:5 + | +LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ cast requires that `'min` must outlive `'max` + +error: unsatisfied lifetime constraints + --> $DIR/variance-invariant-arg-object.rs:28:5 + | +LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ cast requires that `'min` must outlive `'max` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/variance-invariant-arg-object.rs b/src/test/ui/compile-fail-migration/variance-invariant-arg-object.rs index 9edb510b826..9edb510b826 100644 --- a/src/test/compile-fail/variance-invariant-arg-object.rs +++ b/src/test/ui/compile-fail-migration/variance-invariant-arg-object.rs diff --git a/src/test/ui/compile-fail-migration/variance-invariant-arg-object.stderr b/src/test/ui/compile-fail-migration/variance-invariant-arg-object.stderr new file mode 100644 index 00000000000..3283ae67e51 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-invariant-arg-object.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-invariant-arg-object.rs:21:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `dyn Get<&'min i32>` + found type `dyn Get<&'max i32>` +note: the lifetime 'min as defined on the function body at 17:21... + --> $DIR/variance-invariant-arg-object.rs:17:21 + | +LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 17:27 + --> $DIR/variance-invariant-arg-object.rs:17:27 + | +LL | fn get_min_from_max<'min, 'max>(v: Box<Get<&'max i32>>) + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-invariant-arg-object.rs:28:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `dyn Get<&'max i32>` + found type `dyn Get<&'min i32>` +note: the lifetime 'min as defined on the function body at 24:21... + --> $DIR/variance-invariant-arg-object.rs:24:21 + | +LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 24:27 + --> $DIR/variance-invariant-arg-object.rs:24:27 + | +LL | fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>) + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variance-invariant-arg-trait-match.rs b/src/test/ui/compile-fail-migration/variance-invariant-arg-trait-match.rs index 45fed0b083d..45fed0b083d 100644 --- a/src/test/compile-fail/variance-invariant-arg-trait-match.rs +++ b/src/test/ui/compile-fail-migration/variance-invariant-arg-trait-match.rs diff --git a/src/test/ui/compile-fail-migration/variance-invariant-arg-trait-match.stderr b/src/test/ui/compile-fail-migration/variance-invariant-arg-trait-match.stderr new file mode 100644 index 00000000000..fc0d5e486de --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-invariant-arg-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-invariant-arg-trait-match.rs:20:5 + | +LL | impls_get::<G,&'min i32>() //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get<&'min i32>` + found type `Get<&'max i32>` +note: the lifetime 'min as defined on the function body at 17:21... + --> $DIR/variance-invariant-arg-trait-match.rs:17:21 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 17:27 + --> $DIR/variance-invariant-arg-trait-match.rs:17:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-invariant-arg-trait-match.rs:26:5 + | +LL | impls_get::<G,&'max i32>() //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get<&'max i32>` + found type `Get<&'min i32>` +note: the lifetime 'min as defined on the function body at 23:21... + --> $DIR/variance-invariant-arg-trait-match.rs:23:21 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 23:27 + --> $DIR/variance-invariant-arg-trait-match.rs:23:27 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variance-invariant-self-trait-match.rs b/src/test/ui/compile-fail-migration/variance-invariant-self-trait-match.rs index fe61dee23bc..fe61dee23bc 100644 --- a/src/test/compile-fail/variance-invariant-self-trait-match.rs +++ b/src/test/ui/compile-fail-migration/variance-invariant-self-trait-match.rs diff --git a/src/test/ui/compile-fail-migration/variance-invariant-self-trait-match.stderr b/src/test/ui/compile-fail-migration/variance-invariant-self-trait-match.stderr new file mode 100644 index 00000000000..b34f027e895 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-invariant-self-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-invariant-self-trait-match.rs:20:5 + | +LL | impls_get::<&'min G>(); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get` + found type `Get` +note: the lifetime 'min as defined on the function body at 17:21... + --> $DIR/variance-invariant-self-trait-match.rs:17:21 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 17:27 + --> $DIR/variance-invariant-self-trait-match.rs:17:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-invariant-self-trait-match.rs:26:5 + | +LL | impls_get::<&'max G>(); //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch + | + = note: expected type `Get` + found type `Get` +note: the lifetime 'min as defined on the function body at 23:21... + --> $DIR/variance-invariant-self-trait-match.rs:23:21 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 23:27 + --> $DIR/variance-invariant-self-trait-match.rs:23:27 + | +LL | fn get_max_from_min<'min, 'max, G>() + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/compile-fail-migration/variance-issue-20533.nll.stderr b/src/test/ui/compile-fail-migration/variance-issue-20533.nll.stderr new file mode 100644 index 00000000000..f9e2ae89a9d --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-issue-20533.nll.stderr @@ -0,0 +1,33 @@ +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/variance-issue-20533.rs:38:14 + | +LL | let x = foo(&a); + | -- borrow of `a` occurs here +LL | drop(a); //~ ERROR cannot move out of `a` + | ^ move out of `a` occurs here +LL | drop(x); + | - borrow later used here + +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/variance-issue-20533.rs:44:14 + | +LL | let x = bar(&a); + | -- borrow of `a` occurs here +LL | drop(a); //~ ERROR cannot move out of `a` + | ^ move out of `a` occurs here +LL | drop(x); + | - borrow later used here + +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/variance-issue-20533.rs:50:14 + | +LL | let x = baz(&a); + | -- borrow of `a` occurs here +LL | drop(a); //~ ERROR cannot move out of `a` + | ^ move out of `a` occurs here +LL | drop(x); + | - borrow later used here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/variance-issue-20533.rs b/src/test/ui/compile-fail-migration/variance-issue-20533.rs index 60690012485..60690012485 100644 --- a/src/test/compile-fail/variance-issue-20533.rs +++ b/src/test/ui/compile-fail-migration/variance-issue-20533.rs diff --git a/src/test/ui/compile-fail-migration/variance-issue-20533.stderr b/src/test/ui/compile-fail-migration/variance-issue-20533.stderr new file mode 100644 index 00000000000..680dea2447f --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-issue-20533.stderr @@ -0,0 +1,27 @@ +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/variance-issue-20533.rs:38:14 + | +LL | let x = foo(&a); + | - borrow of `a` occurs here +LL | drop(a); //~ ERROR cannot move out of `a` + | ^ move out of `a` occurs here + +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/variance-issue-20533.rs:44:14 + | +LL | let x = bar(&a); + | - borrow of `a` occurs here +LL | drop(a); //~ ERROR cannot move out of `a` + | ^ move out of `a` occurs here + +error[E0505]: cannot move out of `a` because it is borrowed + --> $DIR/variance-issue-20533.rs:50:14 + | +LL | let x = baz(&a); + | - borrow of `a` occurs here +LL | drop(a); //~ ERROR cannot move out of `a` + | ^ move out of `a` occurs here + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0505`. diff --git a/src/test/compile-fail/variance-object-types.rs b/src/test/ui/compile-fail-migration/variance-object-types.rs index 1f54771e367..1f54771e367 100644 --- a/src/test/compile-fail/variance-object-types.rs +++ b/src/test/ui/compile-fail-migration/variance-object-types.rs diff --git a/src/test/ui/compile-fail-migration/variance-object-types.stderr b/src/test/ui/compile-fail-migration/variance-object-types.stderr new file mode 100644 index 00000000000..9a1c9965de3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-object-types.stderr @@ -0,0 +1,11 @@ +error[E0208]: [o] + --> $DIR/variance-object-types.rs:21:1 + | +LL | / struct Foo<'a> { //~ ERROR [o] +LL | | x: Box<Fn(i32) -> &'a i32 + 'static> +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0208`. diff --git a/src/test/compile-fail/variance-regions-direct.rs b/src/test/ui/compile-fail-migration/variance-regions-direct.rs index cd047cc580f..cd047cc580f 100644 --- a/src/test/compile-fail/variance-regions-direct.rs +++ b/src/test/ui/compile-fail-migration/variance-regions-direct.rs diff --git a/src/test/ui/compile-fail-migration/variance-regions-direct.stderr b/src/test/ui/compile-fail-migration/variance-regions-direct.stderr new file mode 100644 index 00000000000..81cb929c63b --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-regions-direct.stderr @@ -0,0 +1,65 @@ +error[E0208]: [-, -, -] + --> $DIR/variance-regions-direct.rs:19:1 + | +LL | / struct Test2<'a, 'b, 'c> { //~ ERROR [-, -, -] +LL | | x: &'a isize, +LL | | y: &'b [isize], +LL | | c: &'c str +LL | | } + | |_^ + +error[E0208]: [+, +, +] + --> $DIR/variance-regions-direct.rs:28:1 + | +LL | / struct Test3<'a, 'b, 'c> { //~ ERROR [+, +, +] +LL | | x: extern "Rust" fn(&'a isize), +LL | | y: extern "Rust" fn(&'b [isize]), +LL | | c: extern "Rust" fn(&'c str), +LL | | } + | |_^ + +error[E0208]: [-, o] + --> $DIR/variance-regions-direct.rs:37:1 + | +LL | / struct Test4<'a, 'b:'a> { //~ ERROR [-, o] +LL | | x: &'a mut &'b isize, +LL | | } + | |_^ + +error[E0208]: [+, o] + --> $DIR/variance-regions-direct.rs:45:1 + | +LL | / struct Test5<'a, 'b:'a> { //~ ERROR [+, o] +LL | | x: extern "Rust" fn(&'a mut &'b isize), +LL | | } + | |_^ + +error[E0208]: [-, o] + --> $DIR/variance-regions-direct.rs:55:1 + | +LL | / struct Test6<'a, 'b:'a> { //~ ERROR [-, o] +LL | | x: &'a mut extern "Rust" fn(&'b isize), +LL | | } + | |_^ + +error[E0208]: [*] + --> $DIR/variance-regions-direct.rs:62:1 + | +LL | / struct Test7<'a> { //~ ERROR [*] +LL | | x: isize +LL | | } + | |_^ + +error[E0208]: [+, -, o] + --> $DIR/variance-regions-direct.rs:69:1 + | +LL | / enum Test8<'a, 'b, 'c:'b> { //~ ERROR [+, -, o] +LL | | Test8A(extern "Rust" fn(&'a isize)), +LL | | Test8B(&'b [isize]), +LL | | Test8C(&'b mut &'c str), +LL | | } + | |_^ + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0208`. diff --git a/src/test/compile-fail/variance-regions-indirect.rs b/src/test/ui/compile-fail-migration/variance-regions-indirect.rs index 60d4d73fe88..60d4d73fe88 100644 --- a/src/test/compile-fail/variance-regions-indirect.rs +++ b/src/test/ui/compile-fail-migration/variance-regions-indirect.rs diff --git a/src/test/ui/compile-fail-migration/variance-regions-indirect.stderr b/src/test/ui/compile-fail-migration/variance-regions-indirect.stderr new file mode 100644 index 00000000000..edf39537ff6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-regions-indirect.stderr @@ -0,0 +1,45 @@ +error[E0208]: [+, -, o, *] + --> $DIR/variance-regions-indirect.rs:18:1 + | +LL | / enum Base<'a, 'b, 'c:'b, 'd> { //~ ERROR [+, -, o, *] +LL | | Test8A(extern "Rust" fn(&'a isize)), +LL | | Test8B(&'b [isize]), +LL | | Test8C(&'b mut &'c str), +LL | | } + | |_^ + +error[E0208]: [*, o, -, +] + --> $DIR/variance-regions-indirect.rs:25:1 + | +LL | / struct Derived1<'w, 'x:'y, 'y, 'z> { //~ ERROR [*, o, -, +] +LL | | f: Base<'z, 'y, 'x, 'w> +LL | | } + | |_^ + +error[E0208]: [o, o, *] + --> $DIR/variance-regions-indirect.rs:30:1 + | +LL | / struct Derived2<'a, 'b:'a, 'c> { //~ ERROR [o, o, *] +LL | | f: Base<'a, 'a, 'b, 'c> +LL | | } + | |_^ + +error[E0208]: [o, -, *] + --> $DIR/variance-regions-indirect.rs:35:1 + | +LL | / struct Derived3<'a:'b, 'b, 'c> { //~ ERROR [o, -, *] +LL | | f: Base<'a, 'b, 'a, 'c> +LL | | } + | |_^ + +error[E0208]: [+, -, o] + --> $DIR/variance-regions-indirect.rs:40:1 + | +LL | / struct Derived4<'a, 'b, 'c:'b> { //~ ERROR [+, -, o] +LL | | f: Base<'a, 'b, 'c, 'a> +LL | | } + | |_^ + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0208`. diff --git a/src/test/compile-fail/variance-regions-unused-direct.rs b/src/test/ui/compile-fail-migration/variance-regions-unused-direct.rs index 037fff72c80..037fff72c80 100644 --- a/src/test/compile-fail/variance-regions-unused-direct.rs +++ b/src/test/ui/compile-fail-migration/variance-regions-unused-direct.rs diff --git a/src/test/ui/compile-fail-migration/variance-regions-unused-direct.stderr b/src/test/ui/compile-fail-migration/variance-regions-unused-direct.stderr new file mode 100644 index 00000000000..e3d02c649dc --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-regions-unused-direct.stderr @@ -0,0 +1,19 @@ +error[E0392]: parameter `'a` is never used + --> $DIR/variance-regions-unused-direct.rs:15:18 + | +LL | struct Bivariant<'a>; //~ ERROR parameter `'a` is never used + | ^^ unused type parameter + | + = help: consider removing `'a` or using a marker such as `std::marker::PhantomData` + +error[E0392]: parameter `'d` is never used + --> $DIR/variance-regions-unused-direct.rs:17:19 + | +LL | struct Struct<'a, 'd> { //~ ERROR parameter `'d` is never used + | ^^ unused type parameter + | + = help: consider removing `'d` or using a marker such as `std::marker::PhantomData` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/compile-fail/variance-regions-unused-indirect.rs b/src/test/ui/compile-fail-migration/variance-regions-unused-indirect.rs index 2d234ed7b57..2d234ed7b57 100644 --- a/src/test/compile-fail/variance-regions-unused-indirect.rs +++ b/src/test/ui/compile-fail-migration/variance-regions-unused-indirect.rs diff --git a/src/test/ui/compile-fail-migration/variance-regions-unused-indirect.stderr b/src/test/ui/compile-fail-migration/variance-regions-unused-indirect.stderr new file mode 100644 index 00000000000..f3eee86d5ab --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-regions-unused-indirect.stderr @@ -0,0 +1,19 @@ +error[E0392]: parameter `'a` is never used + --> $DIR/variance-regions-unused-indirect.rs:13:10 + | +LL | enum Foo<'a> { //~ ERROR parameter `'a` is never used + | ^^ unused type parameter + | + = help: consider removing `'a` or using a marker such as `std::marker::PhantomData` + +error[E0392]: parameter `'a` is never used + --> $DIR/variance-regions-unused-indirect.rs:17:10 + | +LL | enum Bar<'a> { //~ ERROR parameter `'a` is never used + | ^^ unused type parameter + | + = help: consider removing `'a` or using a marker such as `std::marker::PhantomData` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/compile-fail/variance-trait-bounds.rs b/src/test/ui/compile-fail-migration/variance-trait-bounds.rs index ff446f175b7..ff446f175b7 100644 --- a/src/test/compile-fail/variance-trait-bounds.rs +++ b/src/test/ui/compile-fail-migration/variance-trait-bounds.rs diff --git a/src/test/ui/compile-fail-migration/variance-trait-bounds.stderr b/src/test/ui/compile-fail-migration/variance-trait-bounds.stderr new file mode 100644 index 00000000000..1c82ed772e2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-trait-bounds.stderr @@ -0,0 +1,35 @@ +error[E0208]: [+, +] + --> $DIR/variance-trait-bounds.rs:26:1 + | +LL | / struct TestStruct<U,T:Setter<U>> { //~ ERROR [+, +] +LL | | t: T, u: U +LL | | } + | |_^ + +error[E0208]: [*, +] + --> $DIR/variance-trait-bounds.rs:31:1 + | +LL | / enum TestEnum<U,T:Setter<U>> { //~ ERROR [*, +] +LL | | Foo(T) +LL | | } + | |_^ + +error[E0208]: [*, +] + --> $DIR/variance-trait-bounds.rs:36:1 + | +LL | / struct TestContraStruct<U,T:Setter<U>> { //~ ERROR [*, +] +LL | | t: T +LL | | } + | |_^ + +error[E0208]: [*, +] + --> $DIR/variance-trait-bounds.rs:41:1 + | +LL | / struct TestBox<U,T:Getter<U>+Setter<U>> { //~ ERROR [*, +] +LL | | t: T +LL | | } + | |_^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0208`. diff --git a/src/test/ui/compile-fail-migration/variance-trait-matching.nll.stderr b/src/test/ui/compile-fail-migration/variance-trait-matching.nll.stderr new file mode 100644 index 00000000000..baf75b73463 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-trait-matching.nll.stderr @@ -0,0 +1,30 @@ +warning: not reporting region error due to nll + --> $DIR/variance-trait-matching.rs:34:10 + | +LL | pick(get, &22) //~ ERROR 34:5: 34:9: explicit lifetime required in the type of `get` [E0621] + | ^^^ + +warning: not reporting region error due to nll + --> $DIR/variance-trait-matching.rs:34:5 + | +LL | pick(get, &22) //~ ERROR 34:5: 34:9: explicit lifetime required in the type of `get` [E0621] + | ^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/variance-trait-matching.rs:34:5 + | +LL | pick(get, &22) //~ ERROR 34:5: 34:9: explicit lifetime required in the type of `get` [E0621] + | ^^^^ + +error[E0621]: explicit lifetime required in the type of `get` + --> $DIR/variance-trait-matching.rs:34:5 + | +LL | fn get<'a, G>(get: &G) -> i32 + | -- help: add explicit lifetime `'a` to the type of `get`: `&'a G` +... +LL | pick(get, &22) //~ ERROR 34:5: 34:9: explicit lifetime required in the type of `get` [E0621] + | ^^^^^^^^^^^^^^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/compile-fail/variance-trait-matching.rs b/src/test/ui/compile-fail-migration/variance-trait-matching.rs index bc9eab2be82..bc9eab2be82 100644 --- a/src/test/compile-fail/variance-trait-matching.rs +++ b/src/test/ui/compile-fail-migration/variance-trait-matching.rs diff --git a/src/test/ui/compile-fail-migration/variance-trait-matching.stderr b/src/test/ui/compile-fail-migration/variance-trait-matching.stderr new file mode 100644 index 00000000000..645d0ffd311 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-trait-matching.stderr @@ -0,0 +1,12 @@ +error[E0621]: explicit lifetime required in the type of `get` + --> $DIR/variance-trait-matching.rs:34:5 + | +LL | fn get<'a, G>(get: &G) -> i32 + | -- help: add explicit lifetime `'a` to the type of `get`: `&'a G` +... +LL | pick(get, &22) //~ ERROR 34:5: 34:9: explicit lifetime required in the type of `get` [E0621] + | ^^^^ lifetime `'a` required + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0621`. diff --git a/src/test/compile-fail/variance-trait-object-bound.rs b/src/test/ui/compile-fail-migration/variance-trait-object-bound.rs index b120588ecab..b120588ecab 100644 --- a/src/test/compile-fail/variance-trait-object-bound.rs +++ b/src/test/ui/compile-fail-migration/variance-trait-object-bound.rs diff --git a/src/test/ui/compile-fail-migration/variance-trait-object-bound.stderr b/src/test/ui/compile-fail-migration/variance-trait-object-bound.stderr new file mode 100644 index 00000000000..b44fa940ed3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-trait-object-bound.stderr @@ -0,0 +1,11 @@ +error[E0208]: [-] + --> $DIR/variance-trait-object-bound.rs:24:1 + | +LL | / struct TOption<'a> { //~ ERROR [-] +LL | | v: Option<Box<T + 'a>>, +LL | | } + | |_^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0208`. diff --git a/src/test/compile-fail/variance-types-bounds.rs b/src/test/ui/compile-fail-migration/variance-types-bounds.rs index 5075dd2ceed..5075dd2ceed 100644 --- a/src/test/compile-fail/variance-types-bounds.rs +++ b/src/test/ui/compile-fail-migration/variance-types-bounds.rs diff --git a/src/test/ui/compile-fail-migration/variance-types-bounds.stderr b/src/test/ui/compile-fail-migration/variance-types-bounds.stderr new file mode 100644 index 00000000000..e4b0887912b --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-types-bounds.stderr @@ -0,0 +1,47 @@ +error[E0208]: [+, +] + --> $DIR/variance-types-bounds.rs:17:1 + | +LL | / struct TestImm<A, B> { //~ ERROR [+, +] +LL | | x: A, +LL | | y: B, +LL | | } + | |_^ + +error[E0208]: [+, o] + --> $DIR/variance-types-bounds.rs:23:1 + | +LL | / struct TestMut<A, B:'static> { //~ ERROR [+, o] +LL | | x: A, +LL | | y: &'static mut B, +LL | | } + | |_^ + +error[E0208]: [+, o] + --> $DIR/variance-types-bounds.rs:29:1 + | +LL | / struct TestIndirect<A:'static, B:'static> { //~ ERROR [+, o] +LL | | m: TestMut<A, B> +LL | | } + | |_^ + +error[E0208]: [o, o] + --> $DIR/variance-types-bounds.rs:34:1 + | +LL | / struct TestIndirect2<A:'static, B:'static> { //~ ERROR [o, o] +LL | | n: TestMut<A, B>, +LL | | m: TestMut<B, A> +LL | | } + | |_^ + +error[E0208]: [o, o] + --> $DIR/variance-types-bounds.rs:48:1 + | +LL | / struct TestObject<A, R> { //~ ERROR [o, o] +LL | | n: Box<Setter<A>+Send>, +LL | | m: Box<Getter<R>+Send>, +LL | | } + | |_^ + +error: aborting due to 5 previous errors + +For more information about this error, try `rustc --explain E0208`. diff --git a/src/test/compile-fail/variance-types.rs b/src/test/ui/compile-fail-migration/variance-types.rs index 7667972c9d2..7667972c9d2 100644 --- a/src/test/compile-fail/variance-types.rs +++ b/src/test/ui/compile-fail-migration/variance-types.rs diff --git a/src/test/ui/compile-fail-migration/variance-types.stderr b/src/test/ui/compile-fail-migration/variance-types.stderr new file mode 100644 index 00000000000..59975fa7a7e --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-types.stderr @@ -0,0 +1,53 @@ +error[E0208]: [-, o, o] + --> $DIR/variance-types.rs:20:1 + | +LL | / struct InvariantMut<'a,A:'a,B:'a> { //~ ERROR [-, o, o] +LL | | t: &'a mut (A,B) +LL | | } + | |_^ + +error[E0208]: [o] + --> $DIR/variance-types.rs:25:1 + | +LL | / struct InvariantCell<A> { //~ ERROR [o] +LL | | t: Cell<A> +LL | | } + | |_^ + +error[E0208]: [o] + --> $DIR/variance-types.rs:30:1 + | +LL | / struct InvariantIndirect<A> { //~ ERROR [o] +LL | | t: InvariantCell<A> +LL | | } + | |_^ + +error[E0208]: [+] + --> $DIR/variance-types.rs:35:1 + | +LL | / struct Covariant<A> { //~ ERROR [+] +LL | | t: A, u: fn() -> A +LL | | } + | |_^ + +error[E0208]: [-] + --> $DIR/variance-types.rs:40:1 + | +LL | / struct Contravariant<A> { //~ ERROR [-] +LL | | t: fn(A) +LL | | } + | |_^ + +error[E0208]: [+, -, o] + --> $DIR/variance-types.rs:45:1 + | +LL | / enum Enum<A,B,C> { //~ ERROR [+, -, o] +LL | | Foo(Covariant<A>), +LL | | Bar(Contravariant<B>), +LL | | Zed(Covariant<C>,Contravariant<C>) +LL | | } + | |_^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0208`. diff --git a/src/test/compile-fail/variance-unused-region-param.rs b/src/test/ui/compile-fail-migration/variance-unused-region-param.rs index 407282e5ce0..407282e5ce0 100644 --- a/src/test/compile-fail/variance-unused-region-param.rs +++ b/src/test/ui/compile-fail-migration/variance-unused-region-param.rs diff --git a/src/test/ui/compile-fail-migration/variance-unused-region-param.stderr b/src/test/ui/compile-fail-migration/variance-unused-region-param.stderr new file mode 100644 index 00000000000..354fcf373a6 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-unused-region-param.stderr @@ -0,0 +1,19 @@ +error[E0392]: parameter `'a` is never used + --> $DIR/variance-unused-region-param.rs:13:19 + | +LL | struct SomeStruct<'a> { x: u32 } //~ ERROR parameter `'a` is never used + | ^^ unused type parameter + | + = help: consider removing `'a` or using a marker such as `std::marker::PhantomData` + +error[E0392]: parameter `'a` is never used + --> $DIR/variance-unused-region-param.rs:14:15 + | +LL | enum SomeEnum<'a> { Nothing } //~ ERROR parameter `'a` is never used + | ^^ unused type parameter + | + = help: consider removing `'a` or using a marker such as `std::marker::PhantomData` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0392`. diff --git a/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-1.nll.stderr b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-1.nll.stderr new file mode 100644 index 00000000000..5189945982d --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-1.nll.stderr @@ -0,0 +1,19 @@ +warning: not reporting region error due to nll + --> $DIR/variance-use-contravariant-struct-1.rs:22:5 + | +LL | v //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/variance-use-contravariant-struct-1.rs:22:5 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ return requires that `'min` must outlive `'max` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/variance-use-contravariant-struct-1.rs b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-1.rs index d2fd2978750..d2fd2978750 100644 --- a/src/test/compile-fail/variance-use-contravariant-struct-1.rs +++ b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-1.rs diff --git a/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-1.stderr b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-1.stderr new file mode 100644 index 00000000000..48e0d380c66 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-1.stderr @@ -0,0 +1,22 @@ +error[E0308]: mismatched types + --> $DIR/variance-use-contravariant-struct-1.rs:22:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `SomeStruct<&'min ()>` + found type `SomeStruct<&'max ()>` +note: the lifetime 'min as defined on the function body at 18:8... + --> $DIR/variance-use-contravariant-struct-1.rs:18:8 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 18:13 + --> $DIR/variance-use-contravariant-struct-1.rs:18:13 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variance-use-contravariant-struct-2.rs b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-2.rs index b38fd0e9ffc..b38fd0e9ffc 100644 --- a/src/test/compile-fail/variance-use-contravariant-struct-2.rs +++ b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-2.rs diff --git a/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-2.stderr b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-2.stderr new file mode 100644 index 00000000000..e3663eb0345 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-use-contravariant-struct-2.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/variance-use-contravariant-struct-2.rs:27:1 + | +LL | fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/variance-use-covariant-struct-1.nll.stderr b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-1.nll.stderr new file mode 100644 index 00000000000..8c47513a587 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-1.nll.stderr @@ -0,0 +1,19 @@ +warning: not reporting region error due to nll + --> $DIR/variance-use-covariant-struct-1.rs:20:5 + | +LL | v //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/variance-use-covariant-struct-1.rs:20:5 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ return requires that `'min` must outlive `'max` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/variance-use-covariant-struct-1.rs b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-1.rs index 2631cfc05e8..2631cfc05e8 100644 --- a/src/test/compile-fail/variance-use-covariant-struct-1.rs +++ b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-1.rs diff --git a/src/test/ui/compile-fail-migration/variance-use-covariant-struct-1.stderr b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-1.stderr new file mode 100644 index 00000000000..947abe24b55 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-1.stderr @@ -0,0 +1,22 @@ +error[E0308]: mismatched types + --> $DIR/variance-use-covariant-struct-1.rs:20:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `SomeStruct<&'max ()>` + found type `SomeStruct<&'min ()>` +note: the lifetime 'min as defined on the function body at 16:8... + --> $DIR/variance-use-covariant-struct-1.rs:16:8 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 16:13 + --> $DIR/variance-use-covariant-struct-1.rs:16:13 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>) + | ^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variance-use-covariant-struct-2.rs b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-2.rs index d8e1a5f5f1c..d8e1a5f5f1c 100644 --- a/src/test/compile-fail/variance-use-covariant-struct-2.rs +++ b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-2.rs diff --git a/src/test/ui/compile-fail-migration/variance-use-covariant-struct-2.stderr b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-2.stderr new file mode 100644 index 00000000000..9c3a1cf1cc2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-use-covariant-struct-2.stderr @@ -0,0 +1,8 @@ +error: compilation successful + --> $DIR/variance-use-covariant-struct-2.rs:26:16 + | +LL | #[rustc_error] fn main() { } //~ ERROR compilation successful + | ^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/variance-use-invariant-struct-1.nll.stderr b/src/test/ui/compile-fail-migration/variance-use-invariant-struct-1.nll.stderr new file mode 100644 index 00000000000..6553efdbd62 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-use-invariant-struct-1.nll.stderr @@ -0,0 +1,36 @@ +warning: not reporting region error due to nll + --> $DIR/variance-use-invariant-struct-1.rs:22:5 + | +LL | v //~ ERROR mismatched types + | ^ + +warning: not reporting region error due to nll + --> $DIR/variance-use-invariant-struct-1.rs:29:5 + | +LL | v //~ ERROR mismatched types + | ^ + +error: unsatisfied lifetime constraints + --> $DIR/variance-use-invariant-struct-1.rs:22:5 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ return requires that `'min` must outlive `'max` + +error: unsatisfied lifetime constraints + --> $DIR/variance-use-invariant-struct-1.rs:29:5 + | +LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v //~ ERROR mismatched types + | ^ return requires that `'min` must outlive `'max` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/variance-use-invariant-struct-1.rs b/src/test/ui/compile-fail-migration/variance-use-invariant-struct-1.rs index c89436b2094..c89436b2094 100644 --- a/src/test/compile-fail/variance-use-invariant-struct-1.rs +++ b/src/test/ui/compile-fail-migration/variance-use-invariant-struct-1.rs diff --git a/src/test/ui/compile-fail-migration/variance-use-invariant-struct-1.stderr b/src/test/ui/compile-fail-migration/variance-use-invariant-struct-1.stderr new file mode 100644 index 00000000000..30da7e38c57 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variance-use-invariant-struct-1.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-use-invariant-struct-1.rs:22:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `SomeStruct<&'min ()>` + found type `SomeStruct<&'max ()>` +note: the lifetime 'min as defined on the function body at 18:8... + --> $DIR/variance-use-invariant-struct-1.rs:18:8 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 18:13 + --> $DIR/variance-use-invariant-struct-1.rs:18:13 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-use-invariant-struct-1.rs:29:5 + | +LL | v //~ ERROR mismatched types + | ^ lifetime mismatch + | + = note: expected type `SomeStruct<&'max ()>` + found type `SomeStruct<&'min ()>` +note: the lifetime 'min as defined on the function body at 25:8... + --> $DIR/variance-use-invariant-struct-1.rs:25:8 + | +LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>) + | ^^^^ +note: ...does not necessarily outlive the lifetime 'max as defined on the function body at 25:13 + --> $DIR/variance-use-invariant-struct-1.rs:25:13 + | +LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>) + | ^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/variant-namespacing.rs b/src/test/ui/compile-fail-migration/variant-namespacing.rs index 58bfd91550e..58bfd91550e 100644 --- a/src/test/compile-fail/variant-namespacing.rs +++ b/src/test/ui/compile-fail-migration/variant-namespacing.rs diff --git a/src/test/ui/compile-fail-migration/variant-namespacing.stderr b/src/test/ui/compile-fail-migration/variant-namespacing.stderr new file mode 100644 index 00000000000..322ea617f34 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variant-namespacing.stderr @@ -0,0 +1,93 @@ +error[E0255]: the name `XStruct` is defined multiple times + --> $DIR/variant-namespacing.rs:34:35 + | +LL | type XStruct = u8; + | ------------------ previous definition of the type `XStruct` here +... +LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit}; + | ^^^^^^^ `XStruct` reimported here + | + = note: `XStruct` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | pub use variant_namespacing::XE::{XStruct as OtherXStruct, XTuple, XUnit}; + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `XTuple` is defined multiple times + --> $DIR/variant-namespacing.rs:34:44 + | +LL | type XTuple = u8; + | ----------------- previous definition of the type `XTuple` here +... +LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit}; + | ^^^^^^ `XTuple` reimported here + | + = note: `XTuple` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | pub use variant_namespacing::XE::{XStruct, XTuple as OtherXTuple, XUnit}; + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `XUnit` is defined multiple times + --> $DIR/variant-namespacing.rs:34:52 + | +LL | type XUnit = u8; + | ---------------- previous definition of the type `XUnit` here +... +LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit}; + | ^^^^^ `XUnit` reimported here + | + = note: `XUnit` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit as OtherXUnit}; + | ^^^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `Struct` is defined multiple times + --> $DIR/variant-namespacing.rs:38:13 + | +LL | type Struct = u8; + | ----------------- previous definition of the type `Struct` here +... +LL | pub use E::{Struct, Tuple, Unit}; + | ^^^^^^ `Struct` reimported here + | + = note: `Struct` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | pub use E::{Struct as OtherStruct, Tuple, Unit}; + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `Tuple` is defined multiple times + --> $DIR/variant-namespacing.rs:38:21 + | +LL | type Tuple = u8; + | ---------------- previous definition of the type `Tuple` here +... +LL | pub use E::{Struct, Tuple, Unit}; + | ^^^^^ `Tuple` reimported here + | + = note: `Tuple` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | pub use E::{Struct, Tuple as OtherTuple, Unit}; + | ^^^^^^^^^^^^^^^^^^^ + +error[E0255]: the name `Unit` is defined multiple times + --> $DIR/variant-namespacing.rs:38:28 + | +LL | type Unit = u8; + | --------------- previous definition of the type `Unit` here +... +LL | pub use E::{Struct, Tuple, Unit}; + | ^^^^ `Unit` reimported here + | + = note: `Unit` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | pub use E::{Struct, Tuple, Unit as OtherUnit}; + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0255`. diff --git a/src/test/compile-fail/variant-size-differences.rs b/src/test/ui/compile-fail-migration/variant-size-differences.rs index f2cffeefe90..f2cffeefe90 100644 --- a/src/test/compile-fail/variant-size-differences.rs +++ b/src/test/ui/compile-fail-migration/variant-size-differences.rs diff --git a/src/test/ui/compile-fail-migration/variant-size-differences.stderr b/src/test/ui/compile-fail-migration/variant-size-differences.stderr new file mode 100644 index 00000000000..a41a5c17ea3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variant-size-differences.stderr @@ -0,0 +1,14 @@ +error: enum variant is more than three times larger (1024 bytes) than the next largest + --> $DIR/variant-size-differences.rs:15:5 + | +LL | VBig([u8; 1024]), //~ ERROR variant is more than three times larger + | ^^^^^^^^^^^^^^^^ + | +note: lint level defined here + --> $DIR/variant-size-differences.rs:11:9 + | +LL | #![deny(variant_size_differences)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/variant-used-as-type.rs b/src/test/ui/compile-fail-migration/variant-used-as-type.rs index c889b7d28f8..c889b7d28f8 100644 --- a/src/test/compile-fail/variant-used-as-type.rs +++ b/src/test/ui/compile-fail-migration/variant-used-as-type.rs diff --git a/src/test/ui/compile-fail-migration/variant-used-as-type.stderr b/src/test/ui/compile-fail-migration/variant-used-as-type.stderr new file mode 100644 index 00000000000..972fe8a8a61 --- /dev/null +++ b/src/test/ui/compile-fail-migration/variant-used-as-type.stderr @@ -0,0 +1,31 @@ +error[E0573]: expected type, found variant `Ty::A` + --> $DIR/variant-used-as-type.rs:17:7 + | +LL | B(Ty::A), + | ^^^^^ not a type +help: you can try using the variant's enum + | +LL | B(Ty), + | ^^ +help: you can try using the variant's enum + | +LL | B(E), + | ^ + +error[E0573]: expected type, found variant `E::A` + --> $DIR/variant-used-as-type.rs:27:6 + | +LL | impl E::A {} + | ^^^^ not a type +help: you can try using the variant's enum + | +LL | impl Ty {} + | ^^ +help: you can try using the variant's enum + | +LL | impl E {} + | ^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0573`. diff --git a/src/test/compile-fail/vec-macro-with-comma-only.rs b/src/test/ui/compile-fail-migration/vec-macro-with-comma-only.rs index c79e67a3768..c79e67a3768 100644 --- a/src/test/compile-fail/vec-macro-with-comma-only.rs +++ b/src/test/ui/compile-fail-migration/vec-macro-with-comma-only.rs diff --git a/src/test/ui/compile-fail-migration/vec-macro-with-comma-only.stderr b/src/test/ui/compile-fail-migration/vec-macro-with-comma-only.stderr new file mode 100644 index 00000000000..f5341ccc312 --- /dev/null +++ b/src/test/ui/compile-fail-migration/vec-macro-with-comma-only.stderr @@ -0,0 +1,8 @@ +error: no rules expected the token `,` + --> $DIR/vec-macro-with-comma-only.rs:12:10 + | +LL | vec![,]; //~ ERROR no rules expected the token `,` + | ^ + +error: aborting due to previous error + diff --git a/src/test/ui/compile-fail-migration/vec-mut-iter-borrow.nll.stderr b/src/test/ui/compile-fail-migration/vec-mut-iter-borrow.nll.stderr new file mode 100644 index 00000000000..fd7843f39bc --- /dev/null +++ b/src/test/ui/compile-fail-migration/vec-mut-iter-borrow.nll.stderr @@ -0,0 +1,14 @@ +error[E0499]: cannot borrow `xs` as mutable more than once at a time + --> $DIR/vec-mut-iter-borrow.rs:15:9 + | +LL | for x in &mut xs { + | ------- + | | + | first mutable borrow occurs here + | borrow used here in later iteration of loop +LL | xs.push(1) //~ ERROR cannot borrow `xs` + | ^^ second mutable borrow occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/vec-mut-iter-borrow.rs b/src/test/ui/compile-fail-migration/vec-mut-iter-borrow.rs index 571634e3992..571634e3992 100644 --- a/src/test/compile-fail/vec-mut-iter-borrow.rs +++ b/src/test/ui/compile-fail-migration/vec-mut-iter-borrow.rs diff --git a/src/test/ui/compile-fail-migration/vec-mut-iter-borrow.stderr b/src/test/ui/compile-fail-migration/vec-mut-iter-borrow.stderr new file mode 100644 index 00000000000..18fdf2c6867 --- /dev/null +++ b/src/test/ui/compile-fail-migration/vec-mut-iter-borrow.stderr @@ -0,0 +1,14 @@ +error[E0499]: cannot borrow `xs` as mutable more than once at a time + --> $DIR/vec-mut-iter-borrow.rs:15:9 + | +LL | for x in &mut xs { + | -- + | || + | |first borrow ends here + | first mutable borrow occurs here +LL | xs.push(1) //~ ERROR cannot borrow `xs` + | ^^ second mutable borrow occurs here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. diff --git a/src/test/compile-fail/vec-res-add.rs b/src/test/ui/compile-fail-migration/vec-res-add.rs index 27f6fc51164..27f6fc51164 100644 --- a/src/test/compile-fail/vec-res-add.rs +++ b/src/test/ui/compile-fail-migration/vec-res-add.rs diff --git a/src/test/ui/compile-fail-migration/vec-res-add.stderr b/src/test/ui/compile-fail-migration/vec-res-add.stderr new file mode 100644 index 00000000000..62d3f046c96 --- /dev/null +++ b/src/test/ui/compile-fail-migration/vec-res-add.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `+` cannot be applied to type `std::vec::Vec<r>` + --> $DIR/vec-res-add.rs:26:13 + | +LL | let k = i + j; + | ^^^^^ + | + = note: an implementation of `std::ops::Add` might be missing for `std::vec::Vec<r>` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0369`. diff --git a/src/test/compile-fail/vector-cast-weirdness.rs b/src/test/ui/compile-fail-migration/vector-cast-weirdness.rs index 26c59c440d4..26c59c440d4 100644 --- a/src/test/compile-fail/vector-cast-weirdness.rs +++ b/src/test/ui/compile-fail-migration/vector-cast-weirdness.rs diff --git a/src/test/ui/compile-fail-migration/vector-cast-weirdness.stderr b/src/test/ui/compile-fail-migration/vector-cast-weirdness.stderr new file mode 100644 index 00000000000..a096fee16b9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/vector-cast-weirdness.stderr @@ -0,0 +1,9 @@ +error[E0606]: casting `&mut [u8; 2]` as `*mut u8` is invalid + --> $DIR/vector-cast-weirdness.rs:31:23 + | +LL | let p1: *mut u8 = &mut x1.y as *mut _; //~ ERROR casting + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0606`. diff --git a/src/test/compile-fail/vtable-res-trait-param.rs b/src/test/ui/compile-fail-migration/vtable-res-trait-param.rs index 8b3e9369ece..8b3e9369ece 100644 --- a/src/test/compile-fail/vtable-res-trait-param.rs +++ b/src/test/ui/compile-fail-migration/vtable-res-trait-param.rs diff --git a/src/test/ui/compile-fail-migration/vtable-res-trait-param.stderr b/src/test/ui/compile-fail-migration/vtable-res-trait-param.stderr new file mode 100644 index 00000000000..0d0e8202623 --- /dev/null +++ b/src/test/ui/compile-fail-migration/vtable-res-trait-param.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `{integer}: TraitA` is not satisfied + --> $DIR/vtable-res-trait-param.rs:27:7 + | +LL | b.gimme_an_a(y) //~ ERROR `{integer}: TraitA` is not satisfied + | ^^^^^^^^^^ the trait `TraitA` is not implemented for `{integer}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/walk-struct-literal-with.nll.stderr b/src/test/ui/compile-fail-migration/walk-struct-literal-with.nll.stderr new file mode 100644 index 00000000000..668473882ab --- /dev/null +++ b/src/test/ui/compile-fail-migration/walk-struct-literal-with.nll.stderr @@ -0,0 +1,13 @@ +error[E0382]: borrow of moved value: `start.test` + --> $DIR/walk-struct-literal-with.rs:26:20 + | +LL | let end = Mine{other_val:1, ..start.make_string_bar()}; + | ----- value moved here +LL | println!("{}", start.test); //~ ERROR use of moved value: `start.test` + | ^^^^^^^^^^ value borrowed here after move + | + = note: move occurs because `start` has type `Mine`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/walk-struct-literal-with.rs b/src/test/ui/compile-fail-migration/walk-struct-literal-with.rs index 10503084b9d..10503084b9d 100644 --- a/src/test/compile-fail/walk-struct-literal-with.rs +++ b/src/test/ui/compile-fail-migration/walk-struct-literal-with.rs diff --git a/src/test/ui/compile-fail-migration/walk-struct-literal-with.stderr b/src/test/ui/compile-fail-migration/walk-struct-literal-with.stderr new file mode 100644 index 00000000000..751e41f5ce9 --- /dev/null +++ b/src/test/ui/compile-fail-migration/walk-struct-literal-with.stderr @@ -0,0 +1,13 @@ +error[E0382]: use of moved value: `start.test` + --> $DIR/walk-struct-literal-with.rs:26:20 + | +LL | let end = Mine{other_val:1, ..start.make_string_bar()}; + | ----- value moved here +LL | println!("{}", start.test); //~ ERROR use of moved value: `start.test` + | ^^^^^^^^^^ value used here after move + | + = note: move occurs because `start` has type `Mine`, which does not implement the `Copy` trait + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/compile-fail/warn-path-statement.rs b/src/test/ui/compile-fail-migration/warn-path-statement.rs index 892d82d0934..892d82d0934 100644 --- a/src/test/compile-fail/warn-path-statement.rs +++ b/src/test/ui/compile-fail-migration/warn-path-statement.rs diff --git a/src/test/ui/compile-fail-migration/warn-path-statement.stderr b/src/test/ui/compile-fail-migration/warn-path-statement.stderr new file mode 100644 index 00000000000..44b194bc62d --- /dev/null +++ b/src/test/ui/compile-fail-migration/warn-path-statement.stderr @@ -0,0 +1,10 @@ +error: path statement with no effect + --> $DIR/warn-path-statement.rs:15:5 + | +LL | x; //~ ERROR path statement with no effect + | ^^ + | + = note: requested on the command line with `-D path-statements` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/weak-lang-item.rs b/src/test/ui/compile-fail-migration/weak-lang-item.rs index 42972c40674..42972c40674 100644 --- a/src/test/compile-fail/weak-lang-item.rs +++ b/src/test/ui/compile-fail-migration/weak-lang-item.rs diff --git a/src/test/ui/compile-fail-migration/weak-lang-item.stderr b/src/test/ui/compile-fail-migration/weak-lang-item.stderr new file mode 100644 index 00000000000..e85b777b203 --- /dev/null +++ b/src/test/ui/compile-fail-migration/weak-lang-item.stderr @@ -0,0 +1,19 @@ +error[E0259]: the name `core` is defined multiple times + --> $DIR/weak-lang-item.rs:18:1 + | +LL | extern crate core; + | ^^^^^^^^^^^^^^^^^^ `core` reimported here + | + = note: `core` must be defined only once in the type namespace of this module +help: You can use `as` to change the binding name of the import + | +LL | extern crate core as other_core; + | + +error: `#[panic_implementation]` function required, but not found + +error: language item required, but not found: `eh_personality` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0259`. diff --git a/src/test/compile-fail/wf-array-elem-sized.rs b/src/test/ui/compile-fail-migration/wf-array-elem-sized.rs index 946341a1a75..946341a1a75 100644 --- a/src/test/compile-fail/wf-array-elem-sized.rs +++ b/src/test/ui/compile-fail-migration/wf-array-elem-sized.rs diff --git a/src/test/ui/compile-fail-migration/wf-array-elem-sized.stderr b/src/test/ui/compile-fail-migration/wf-array-elem-sized.stderr new file mode 100644 index 00000000000..dc1391469e8 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-array-elem-sized.stderr @@ -0,0 +1,13 @@ +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time + --> $DIR/wf-array-elem-sized.rs:17:5 + | +LL | foo: [[u8]], //~ ERROR E0277 + | ^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: 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-sized> + = note: slice and array elements must have `Sized` type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-const-type.rs b/src/test/ui/compile-fail-migration/wf-const-type.rs index c3015afd8dd..c3015afd8dd 100644 --- a/src/test/compile-fail/wf-const-type.rs +++ b/src/test/ui/compile-fail-migration/wf-const-type.rs diff --git a/src/test/ui/compile-fail-migration/wf-const-type.stderr b/src/test/ui/compile-fail-migration/wf-const-type.stderr new file mode 100644 index 00000000000..1c07824ef77 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-const-type.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `NotCopy: std::marker::Copy` is not satisfied + --> $DIR/wf-const-type.rs:20:1 + | +LL | const FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `NotCopy` + | + = note: required because of the requirements on the impl of `std::marker::Copy` for `std::option::Option<NotCopy>` +note: required by `IsCopy` + --> $DIR/wf-const-type.rs:17:1 + | +LL | struct IsCopy<T:Copy> { t: T } + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-enum-bound.rs b/src/test/ui/compile-fail-migration/wf-enum-bound.rs index e3e79fdd940..e3e79fdd940 100644 --- a/src/test/compile-fail/wf-enum-bound.rs +++ b/src/test/ui/compile-fail-migration/wf-enum-bound.rs diff --git a/src/test/ui/compile-fail-migration/wf-enum-bound.stderr b/src/test/ui/compile-fail-migration/wf-enum-bound.stderr new file mode 100644 index 00000000000..3313eb20508 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-enum-bound.stderr @@ -0,0 +1,20 @@ +error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied + --> $DIR/wf-enum-bound.rs:19:1 + | +LL | / enum SomeEnum<T,U> //~ ERROR E0277 +LL | | where T: ExtraCopy<U> +LL | | { +LL | | SomeVariant(T,U) +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `U` + | + = help: consider adding a `where U: std::marker::Copy` bound +note: required by `ExtraCopy` + --> $DIR/wf-enum-bound.rs:17:1 + | +LL | trait ExtraCopy<T:Copy> { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-enum-fields-struct-variant.rs b/src/test/ui/compile-fail-migration/wf-enum-fields-struct-variant.rs index 5eb53e7edde..5eb53e7edde 100644 --- a/src/test/compile-fail/wf-enum-fields-struct-variant.rs +++ b/src/test/ui/compile-fail-migration/wf-enum-fields-struct-variant.rs diff --git a/src/test/ui/compile-fail-migration/wf-enum-fields-struct-variant.stderr b/src/test/ui/compile-fail-migration/wf-enum-fields-struct-variant.stderr new file mode 100644 index 00000000000..86a605f073c --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-enum-fields-struct-variant.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `A: std::marker::Copy` is not satisfied + --> $DIR/wf-enum-fields-struct-variant.rs:23:9 + | +LL | f: IsCopy<A> //~ ERROR E0277 + | ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `A` + | + = help: consider adding a `where A: std::marker::Copy` bound +note: required by `IsCopy` + --> $DIR/wf-enum-fields-struct-variant.rs:17:1 + | +LL | struct IsCopy<T:Copy> { + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-enum-fields.rs b/src/test/ui/compile-fail-migration/wf-enum-fields.rs index 76ad40f8457..76ad40f8457 100644 --- a/src/test/compile-fail/wf-enum-fields.rs +++ b/src/test/ui/compile-fail-migration/wf-enum-fields.rs diff --git a/src/test/ui/compile-fail-migration/wf-enum-fields.stderr b/src/test/ui/compile-fail-migration/wf-enum-fields.stderr new file mode 100644 index 00000000000..5aa263f389a --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-enum-fields.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `A: std::marker::Copy` is not satisfied + --> $DIR/wf-enum-fields.rs:22:17 + | +LL | SomeVariant(IsCopy<A>) //~ ERROR E0277 + | ^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `A` + | + = help: consider adding a `where A: std::marker::Copy` bound +note: required by `IsCopy` + --> $DIR/wf-enum-fields.rs:17:1 + | +LL | struct IsCopy<T:Copy> { + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-fn-where-clause.rs b/src/test/ui/compile-fail-migration/wf-fn-where-clause.rs index 3ed9e5d9f1e..3ed9e5d9f1e 100644 --- a/src/test/compile-fail/wf-fn-where-clause.rs +++ b/src/test/ui/compile-fail-migration/wf-fn-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/wf-fn-where-clause.stderr b/src/test/ui/compile-fail-migration/wf-fn-where-clause.stderr new file mode 100644 index 00000000000..5f0f982577e --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-fn-where-clause.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied + --> $DIR/wf-fn-where-clause.rs:19:1 + | +LL | / fn foo<T,U>() where T: ExtraCopy<U> //~ ERROR E0277 +LL | | { +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `U` + | + = help: consider adding a `where U: std::marker::Copy` bound +note: required by `ExtraCopy` + --> $DIR/wf-fn-where-clause.rs:17:1 + | +LL | trait ExtraCopy<T:Copy> { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-impl-associated-type-region.rs b/src/test/ui/compile-fail-migration/wf-impl-associated-type-region.rs index a319b676eeb..a319b676eeb 100644 --- a/src/test/compile-fail/wf-impl-associated-type-region.rs +++ b/src/test/ui/compile-fail-migration/wf-impl-associated-type-region.rs diff --git a/src/test/ui/compile-fail-migration/wf-impl-associated-type-region.stderr b/src/test/ui/compile-fail-migration/wf-impl-associated-type-region.stderr new file mode 100644 index 00000000000..f238b3c0d13 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-impl-associated-type-region.stderr @@ -0,0 +1,17 @@ +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/wf-impl-associated-type-region.rs:20:5 + | +LL | impl<'a, T> Foo<'a> for T { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | type Bar = &'a T; //~ ERROR E0309 + | ^^^^^^^^^^^^^^^^^ + | +note: ...so that the reference type `&'a T` does not outlive the data it points at + --> $DIR/wf-impl-associated-type-region.rs:20:5 + | +LL | type Bar = &'a T; //~ ERROR E0309 + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/wf-impl-associated-type-trait.rs b/src/test/ui/compile-fail-migration/wf-impl-associated-type-trait.rs index 1e82f609d2a..1e82f609d2a 100644 --- a/src/test/compile-fail/wf-impl-associated-type-trait.rs +++ b/src/test/ui/compile-fail-migration/wf-impl-associated-type-trait.rs diff --git a/src/test/ui/compile-fail-migration/wf-impl-associated-type-trait.stderr b/src/test/ui/compile-fail-migration/wf-impl-associated-type-trait.stderr new file mode 100644 index 00000000000..595c5b4d8fd --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-impl-associated-type-trait.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `T: MyHash` is not satisfied + --> $DIR/wf-impl-associated-type-trait.rs:27:5 + | +LL | type Bar = MySet<T>; + | ^^^^^^^^^^^^^^^^^^^^ the trait `MyHash` is not implemented for `T` + | + = help: consider adding a `where T: MyHash` bound +note: required by `MySet` + --> $DIR/wf-impl-associated-type-trait.rs:18:1 + | +LL | pub struct MySet<T:MyHash> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-in-fn-arg.rs b/src/test/ui/compile-fail-migration/wf-in-fn-arg.rs index e302cac0006..e302cac0006 100644 --- a/src/test/compile-fail/wf-in-fn-arg.rs +++ b/src/test/ui/compile-fail-migration/wf-in-fn-arg.rs diff --git a/src/test/ui/compile-fail-migration/wf-in-fn-arg.stderr b/src/test/ui/compile-fail-migration/wf-in-fn-arg.stderr new file mode 100644 index 00000000000..f82bc1674df --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-in-fn-arg.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/wf-in-fn-arg.rs:20:1 + | +LL | / fn bar<T>(_: &MustBeCopy<T>) //~ ERROR E0277 +LL | | { +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound +note: required by `MustBeCopy` + --> $DIR/wf-in-fn-arg.rs:16:1 + | +LL | struct MustBeCopy<T:Copy> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-in-fn-ret.rs b/src/test/ui/compile-fail-migration/wf-in-fn-ret.rs index 719bc9282ad..719bc9282ad 100644 --- a/src/test/compile-fail/wf-in-fn-ret.rs +++ b/src/test/ui/compile-fail-migration/wf-in-fn-ret.rs diff --git a/src/test/ui/compile-fail-migration/wf-in-fn-ret.stderr b/src/test/ui/compile-fail-migration/wf-in-fn-ret.stderr new file mode 100644 index 00000000000..357199c4e31 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-in-fn-ret.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/wf-in-fn-ret.rs:20:1 + | +LL | / fn bar<T>() -> MustBeCopy<T> //~ ERROR E0277 +LL | | { +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound +note: required by `MustBeCopy` + --> $DIR/wf-in-fn-ret.rs:16:1 + | +LL | struct MustBeCopy<T:Copy> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-in-fn-type-arg.rs b/src/test/ui/compile-fail-migration/wf-in-fn-type-arg.rs index 08ee0e954ac..08ee0e954ac 100644 --- a/src/test/compile-fail/wf-in-fn-type-arg.rs +++ b/src/test/ui/compile-fail-migration/wf-in-fn-type-arg.rs diff --git a/src/test/ui/compile-fail-migration/wf-in-fn-type-arg.stderr b/src/test/ui/compile-fail-migration/wf-in-fn-type-arg.stderr new file mode 100644 index 00000000000..7e3d22b262c --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-in-fn-type-arg.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/wf-in-fn-type-arg.rs:19:5 + | +LL | x: fn(MustBeCopy<T>) //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound +note: required by `MustBeCopy` + --> $DIR/wf-in-fn-type-arg.rs:13:1 + | +LL | struct MustBeCopy<T:Copy> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-in-fn-type-ret.rs b/src/test/ui/compile-fail-migration/wf-in-fn-type-ret.rs index 6942f786060..6942f786060 100644 --- a/src/test/compile-fail/wf-in-fn-type-ret.rs +++ b/src/test/ui/compile-fail-migration/wf-in-fn-type-ret.rs diff --git a/src/test/ui/compile-fail-migration/wf-in-fn-type-ret.stderr b/src/test/ui/compile-fail-migration/wf-in-fn-type-ret.stderr new file mode 100644 index 00000000000..5d592532d28 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-in-fn-type-ret.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/wf-in-fn-type-ret.rs:19:5 + | +LL | x: fn() -> MustBeCopy<T> //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound +note: required by `MustBeCopy` + --> $DIR/wf-in-fn-type-ret.rs:13:1 + | +LL | struct MustBeCopy<T:Copy> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-in-fn-type-static.rs b/src/test/ui/compile-fail-migration/wf-in-fn-type-static.rs index 8e3bca09758..8e3bca09758 100644 --- a/src/test/compile-fail/wf-in-fn-type-static.rs +++ b/src/test/ui/compile-fail-migration/wf-in-fn-type-static.rs diff --git a/src/test/ui/compile-fail-migration/wf-in-fn-type-static.stderr b/src/test/ui/compile-fail-migration/wf-in-fn-type-static.stderr new file mode 100644 index 00000000000..0013331f010 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-in-fn-type-static.stderr @@ -0,0 +1,33 @@ +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/wf-in-fn-type-static.rs:23:5 + | +LL | struct Foo<T> { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // needs T: 'static +LL | x: fn() -> &'static T //~ ERROR E0310 + | ^^^^^^^^^^^^^^^^^^^^^ + | +note: ...so that the reference type `&'static T` does not outlive the data it points at + --> $DIR/wf-in-fn-type-static.rs:23:5 + | +LL | x: fn() -> &'static T //~ ERROR E0310 + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/wf-in-fn-type-static.rs:28:5 + | +LL | struct Bar<T> { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // needs T: Copy +LL | x: fn(&'static T) //~ ERROR E0310 + | ^^^^^^^^^^^^^^^^^ + | +note: ...so that the reference type `&'static T` does not outlive the data it points at + --> $DIR/wf-in-fn-type-static.rs:28:5 + | +LL | x: fn(&'static T) //~ ERROR E0310 + | ^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/compile-fail/wf-in-fn-where-clause.rs b/src/test/ui/compile-fail-migration/wf-in-fn-where-clause.rs index c2f66a2a460..c2f66a2a460 100644 --- a/src/test/compile-fail/wf-in-fn-where-clause.rs +++ b/src/test/ui/compile-fail-migration/wf-in-fn-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/wf-in-fn-where-clause.stderr b/src/test/ui/compile-fail-migration/wf-in-fn-where-clause.stderr new file mode 100644 index 00000000000..76693eace2f --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-in-fn-where-clause.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied + --> $DIR/wf-in-fn-where-clause.rs:19:1 + | +LL | / fn bar<T,U>() //~ ERROR E0277 +LL | | where T: MustBeCopy<U> +LL | | { +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `U` + | + = help: consider adding a `where U: std::marker::Copy` bound +note: required by `MustBeCopy` + --> $DIR/wf-in-fn-where-clause.rs:16:1 + | +LL | trait MustBeCopy<T:Copy> { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-in-obj-type-static.rs b/src/test/ui/compile-fail-migration/wf-in-obj-type-static.rs index 11535fb9f9e..11535fb9f9e 100644 --- a/src/test/compile-fail/wf-in-obj-type-static.rs +++ b/src/test/ui/compile-fail-migration/wf-in-obj-type-static.rs diff --git a/src/test/ui/compile-fail-migration/wf-in-obj-type-static.stderr b/src/test/ui/compile-fail-migration/wf-in-obj-type-static.stderr new file mode 100644 index 00000000000..5cbb4be7e92 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-in-obj-type-static.stderr @@ -0,0 +1,18 @@ +error[E0310]: the parameter type `T` may not live long enough + --> $DIR/wf-in-obj-type-static.rs:24:5 + | +LL | struct Foo<T> { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // needs T: 'static +LL | x: Object<&'static T> //~ ERROR E0310 + | ^^^^^^^^^^^^^^^^^^^^^ + | +note: ...so that the reference type `&'static T` does not outlive the data it points at + --> $DIR/wf-in-obj-type-static.rs:24:5 + | +LL | x: Object<&'static T> //~ ERROR E0310 + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/compile-fail/wf-in-obj-type-trait.rs b/src/test/ui/compile-fail-migration/wf-in-obj-type-trait.rs index add48219c1d..add48219c1d 100644 --- a/src/test/compile-fail/wf-in-obj-type-trait.rs +++ b/src/test/ui/compile-fail-migration/wf-in-obj-type-trait.rs diff --git a/src/test/ui/compile-fail-migration/wf-in-obj-type-trait.stderr b/src/test/ui/compile-fail-migration/wf-in-obj-type-trait.stderr new file mode 100644 index 00000000000..93af991cc93 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-in-obj-type-trait.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/wf-in-obj-type-trait.rs:21:5 + | +LL | x: Object<MustBeCopy<T>> //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound +note: required by `MustBeCopy` + --> $DIR/wf-in-obj-type-trait.rs:15:1 + | +LL | struct MustBeCopy<T:Copy> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-inherent-impl-method-where-clause.rs b/src/test/ui/compile-fail-migration/wf-inherent-impl-method-where-clause.rs index 78e12c47e24..78e12c47e24 100644 --- a/src/test/compile-fail/wf-inherent-impl-method-where-clause.rs +++ b/src/test/ui/compile-fail-migration/wf-inherent-impl-method-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/wf-inherent-impl-method-where-clause.stderr b/src/test/ui/compile-fail-migration/wf-inherent-impl-method-where-clause.stderr new file mode 100644 index 00000000000..25ec4195ab1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-inherent-impl-method-where-clause.stderr @@ -0,0 +1,17 @@ +error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied + --> $DIR/wf-inherent-impl-method-where-clause.rs:22:5 + | +LL | / fn foo(self) where T: ExtraCopy<U> //~ ERROR E0277 +LL | | {} + | |______^ the trait `std::marker::Copy` is not implemented for `U` + | + = help: consider adding a `where U: std::marker::Copy` bound +note: required by `ExtraCopy` + --> $DIR/wf-inherent-impl-method-where-clause.rs:17:1 + | +LL | trait ExtraCopy<T:Copy> { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-inherent-impl-where-clause.rs b/src/test/ui/compile-fail-migration/wf-inherent-impl-where-clause.rs index 7edbb11e245..7edbb11e245 100644 --- a/src/test/compile-fail/wf-inherent-impl-where-clause.rs +++ b/src/test/ui/compile-fail-migration/wf-inherent-impl-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/wf-inherent-impl-where-clause.stderr b/src/test/ui/compile-fail-migration/wf-inherent-impl-where-clause.stderr new file mode 100644 index 00000000000..3c5c557db42 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-inherent-impl-where-clause.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied + --> $DIR/wf-inherent-impl-where-clause.rs:21:1 + | +LL | / impl<T,U> Foo<T,U> where T: ExtraCopy<U> //~ ERROR E0277 +LL | | { +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `U` + | + = help: consider adding a `where U: std::marker::Copy` bound +note: required by `ExtraCopy` + --> $DIR/wf-inherent-impl-where-clause.rs:17:1 + | +LL | trait ExtraCopy<T:Copy> { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/compile-fail-migration/wf-misc-methods-issue-28609.nll.stderr b/src/test/ui/compile-fail-migration/wf-misc-methods-issue-28609.nll.stderr new file mode 100644 index 00000000000..48a68bf5749 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-misc-methods-issue-28609.nll.stderr @@ -0,0 +1,111 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:32:31 + | +LL | s.transmute_inherent(&mut 42) //~ ERROR does not live long enough + | ^^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 30:1... + --> $DIR/wf-misc-methods-issue-28609.rs:30:1 + | +LL | / fn return_dangling_pointer_inherent(s: S2) -> &u32 { +LL | | let s = s; +LL | | s.transmute_inherent(&mut 42) //~ ERROR does not live long enough +LL | | } + | |_^ + +error[E0597]: `four` does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:45:19 + | +LL | s.bomb = Some(&four); //~ ERROR does not live long enough + | ^^^^^ borrowed value does not live long enough +LL | &s +LL | } + | - `four` dropped here while still borrowed + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 42:1... + --> $DIR/wf-misc-methods-issue-28609.rs:42:1 + | +LL | / fn return_dangling_pointer_coerce(s: S2) -> &u32 { +LL | | let four = 4; +LL | | let mut s = s; +LL | | s.bomb = Some(&four); //~ ERROR does not live long enough +LL | | &s +LL | | } + | |_^ + +error[E0597]: `four` does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:52:19 + | +LL | s.bomb = Some(&four); //~ ERROR does not live long enough + | ^^^^^ borrowed value does not live long enough +LL | &*s +LL | } + | - `four` dropped here while still borrowed + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 49:1... + --> $DIR/wf-misc-methods-issue-28609.rs:49:1 + | +LL | / fn return_dangling_pointer_unary_op(s: S2) -> &u32 { +LL | | let four = 4; +LL | | let mut s = s; +LL | | s.bomb = Some(&four); //~ ERROR does not live long enough +LL | | &*s +LL | | } + | |_^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:63:15 + | +LL | s << &mut 3 //~ ERROR does not live long enough + | ^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 61:1... + --> $DIR/wf-misc-methods-issue-28609.rs:61:1 + | +LL | / fn return_dangling_pointer_binary_op(s: S2) -> &u32 { +LL | | let s = s; +LL | | s << &mut 3 //~ ERROR does not live long enough +LL | | } + | |_^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:68:16 + | +LL | s.shl(&mut 3) //~ ERROR does not live long enough + | ^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 66:1... + --> $DIR/wf-misc-methods-issue-28609.rs:66:1 + | +LL | / fn return_dangling_pointer_method(s: S2) -> &u32 { +LL | | let s = s; +LL | | s.shl(&mut 3) //~ ERROR does not live long enough +LL | | } + | |_^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:73:21 + | +LL | S2::shl(s, &mut 3) //~ ERROR does not live long enough + | ^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 71:1... + --> $DIR/wf-misc-methods-issue-28609.rs:71:1 + | +LL | / fn return_dangling_pointer_ufcs(s: S2) -> &u32 { +LL | | let s = s; +LL | | S2::shl(s, &mut 3) //~ ERROR does not live long enough +LL | | } + | |_^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/wf-misc-methods-issue-28609.rs b/src/test/ui/compile-fail-migration/wf-misc-methods-issue-28609.rs index 055c86a03a7..055c86a03a7 100644 --- a/src/test/compile-fail/wf-misc-methods-issue-28609.rs +++ b/src/test/ui/compile-fail-migration/wf-misc-methods-issue-28609.rs diff --git a/src/test/ui/compile-fail-migration/wf-misc-methods-issue-28609.stderr b/src/test/ui/compile-fail-migration/wf-misc-methods-issue-28609.stderr new file mode 100644 index 00000000000..352697e6f94 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-misc-methods-issue-28609.stderr @@ -0,0 +1,111 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:32:31 + | +LL | s.transmute_inherent(&mut 42) //~ ERROR does not live long enough + | ^^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 30:1... + --> $DIR/wf-misc-methods-issue-28609.rs:30:1 + | +LL | / fn return_dangling_pointer_inherent(s: S2) -> &u32 { +LL | | let s = s; +LL | | s.transmute_inherent(&mut 42) //~ ERROR does not live long enough +LL | | } + | |_^ + +error[E0597]: `four` does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:45:20 + | +LL | s.bomb = Some(&four); //~ ERROR does not live long enough + | ^^^^ borrowed value does not live long enough +LL | &s +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 42:1... + --> $DIR/wf-misc-methods-issue-28609.rs:42:1 + | +LL | / fn return_dangling_pointer_coerce(s: S2) -> &u32 { +LL | | let four = 4; +LL | | let mut s = s; +LL | | s.bomb = Some(&four); //~ ERROR does not live long enough +LL | | &s +LL | | } + | |_^ + +error[E0597]: `four` does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:52:20 + | +LL | s.bomb = Some(&four); //~ ERROR does not live long enough + | ^^^^ borrowed value does not live long enough +LL | &*s +LL | } + | - borrowed value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 49:1... + --> $DIR/wf-misc-methods-issue-28609.rs:49:1 + | +LL | / fn return_dangling_pointer_unary_op(s: S2) -> &u32 { +LL | | let four = 4; +LL | | let mut s = s; +LL | | s.bomb = Some(&four); //~ ERROR does not live long enough +LL | | &*s +LL | | } + | |_^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:63:15 + | +LL | s << &mut 3 //~ ERROR does not live long enough + | ^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 61:1... + --> $DIR/wf-misc-methods-issue-28609.rs:61:1 + | +LL | / fn return_dangling_pointer_binary_op(s: S2) -> &u32 { +LL | | let s = s; +LL | | s << &mut 3 //~ ERROR does not live long enough +LL | | } + | |_^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:68:16 + | +LL | s.shl(&mut 3) //~ ERROR does not live long enough + | ^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 66:1... + --> $DIR/wf-misc-methods-issue-28609.rs:66:1 + | +LL | / fn return_dangling_pointer_method(s: S2) -> &u32 { +LL | | let s = s; +LL | | s.shl(&mut 3) //~ ERROR does not live long enough +LL | | } + | |_^ + +error[E0597]: borrowed value does not live long enough + --> $DIR/wf-misc-methods-issue-28609.rs:73:21 + | +LL | S2::shl(s, &mut 3) //~ ERROR does not live long enough + | ^ temporary value does not live long enough +LL | } + | - temporary value only lives until here + | +note: borrowed value must be valid for the anonymous lifetime #1 defined on the function body at 71:1... + --> $DIR/wf-misc-methods-issue-28609.rs:71:1 + | +LL | / fn return_dangling_pointer_ufcs(s: S2) -> &u32 { +LL | | let s = s; +LL | | S2::shl(s, &mut 3) //~ ERROR does not live long enough +LL | | } + | |_^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/compile-fail/wf-object-safe.rs b/src/test/ui/compile-fail-migration/wf-object-safe.rs index 92c0a8c5be8..92c0a8c5be8 100644 --- a/src/test/compile-fail/wf-object-safe.rs +++ b/src/test/ui/compile-fail-migration/wf-object-safe.rs diff --git a/src/test/ui/compile-fail-migration/wf-object-safe.stderr b/src/test/ui/compile-fail-migration/wf-object-safe.stderr new file mode 100644 index 00000000000..3d42c52136b --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-object-safe.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait `A` cannot be made into an object + --> $DIR/wf-object-safe.rs:19:13 + | +LL | let _x: &A; //~ ERROR E0038 + | ^^ the trait `A` cannot be made into an object + | + = note: method `foo` references the `Self` type in its arguments or return type + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/compile-fail/wf-outlives-ty-in-fn-or-trait.rs b/src/test/ui/compile-fail-migration/wf-outlives-ty-in-fn-or-trait.rs index c11b2e4c544..c11b2e4c544 100644 --- a/src/test/compile-fail/wf-outlives-ty-in-fn-or-trait.rs +++ b/src/test/ui/compile-fail-migration/wf-outlives-ty-in-fn-or-trait.rs diff --git a/src/test/ui/compile-fail-migration/wf-outlives-ty-in-fn-or-trait.stderr b/src/test/ui/compile-fail-migration/wf-outlives-ty-in-fn-or-trait.stderr new file mode 100644 index 00000000000..9a8c63126f2 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-outlives-ty-in-fn-or-trait.stderr @@ -0,0 +1,31 @@ +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:21:5 + | +LL | struct Foo<'a,T> { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | f: &'a fn(T), + | ^^^^^^^^^^^^ + | +note: ...so that the reference type `&'a fn(T)` does not outlive the data it points at + --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:21:5 + | +LL | f: &'a fn(T), + | ^^^^^^^^^^^^ + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:26:5 + | +LL | struct Bar<'a,T> { + | - help: consider adding an explicit lifetime bound `T: 'a`... +LL | f: &'a Trait<T>, + | ^^^^^^^^^^^^^^^ + | +note: ...so that the reference type `&'a (dyn Trait<T> + 'a)` does not outlive the data it points at + --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:26:5 + | +LL | f: &'a Trait<T>, + | ^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/compile-fail-migration/wf-static-method.nll.stderr b/src/test/ui/compile-fail-migration/wf-static-method.nll.stderr new file mode 100644 index 00000000000..77896ff2ece --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-static-method.nll.stderr @@ -0,0 +1,54 @@ +warning: not reporting region error due to nll + --> $DIR/wf-static-method.rs:27:9 + | +LL | u //~ ERROR E0312 + | ^ + +warning: not reporting region error due to nll + --> $DIR/wf-static-method.rs:36:18 + | +LL | let me = Self::make_me(); //~ ERROR lifetime bound not satisfied + | ^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/wf-static-method.rs:43:9 + | +LL | u //~ ERROR E0312 + | ^ + +warning: not reporting region error due to nll + --> $DIR/wf-static-method.rs:51:5 + | +LL | <()>::static_evil(b) //~ ERROR cannot infer an appropriate lifetime + | ^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/wf-static-method.rs:55:5 + | +LL | <IndirectEvil>::static_evil(b) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: unsatisfied lifetime constraints + --> $DIR/wf-static-method.rs:27:9 + | +LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +... +LL | u //~ ERROR E0312 + | ^ return requires that `'b` must outlive `'a` + +error: unsatisfied lifetime constraints + --> $DIR/wf-static-method.rs:43:9 + | +LL | impl<'a, 'b> Evil<'a, 'b> { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | fn inherent_evil(u: &'b u32) -> &'a u32 { +LL | u //~ ERROR E0312 + | ^ return requires that `'b` must outlive `'a` + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/wf-static-method.rs b/src/test/ui/compile-fail-migration/wf-static-method.rs index e99957c7914..e99957c7914 100644 --- a/src/test/compile-fail/wf-static-method.rs +++ b/src/test/ui/compile-fail-migration/wf-static-method.rs diff --git a/src/test/ui/compile-fail-migration/wf-static-method.stderr b/src/test/ui/compile-fail-migration/wf-static-method.stderr new file mode 100644 index 00000000000..0de2d8e6ca0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-static-method.stderr @@ -0,0 +1,109 @@ +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/wf-static-method.rs:27:9 + | +LL | u //~ ERROR E0312 + | ^ + | +note: ...the reference is valid for the lifetime 'a as defined on the impl at 24:6... + --> $DIR/wf-static-method.rs:24:6 + | +LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () { + | ^^ +note: ...but the borrowed content is only valid for the lifetime 'b as defined on the impl at 24:10 + --> $DIR/wf-static-method.rs:24:10 + | +LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () { + | ^^ + +error[E0478]: lifetime bound not satisfied + --> $DIR/wf-static-method.rs:36:18 + | +LL | let me = Self::make_me(); //~ ERROR lifetime bound not satisfied + | ^^^^^^^^^^^^^ + | +note: lifetime parameter instantiated with the lifetime 'b as defined on the impl at 33:10 + --> $DIR/wf-static-method.rs:33:10 + | +LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> { + | ^^ +note: but lifetime parameter must outlive the lifetime 'a as defined on the impl at 33:6 + --> $DIR/wf-static-method.rs:33:6 + | +LL | impl<'a, 'b> Foo<'a, 'b, ()> for IndirectEvil<'a, 'b> { + | ^^ + +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/wf-static-method.rs:43:9 + | +LL | u //~ ERROR E0312 + | ^ + | +note: ...the reference is valid for the lifetime 'a as defined on the impl at 41:6... + --> $DIR/wf-static-method.rs:41:6 + | +LL | impl<'a, 'b> Evil<'a, 'b> { + | ^^ +note: ...but the borrowed content is only valid for the lifetime 'b as defined on the impl at 41:10 + --> $DIR/wf-static-method.rs:41:10 + | +LL | impl<'a, 'b> Evil<'a, 'b> { + | ^^ + +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements + --> $DIR/wf-static-method.rs:51:5 + | +LL | <()>::static_evil(b) //~ ERROR cannot infer an appropriate lifetime + | ^^^^^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'b as defined on the function body at 50:13... + --> $DIR/wf-static-method.rs:50:13 + | +LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/wf-static-method.rs:51:23 + | +LL | <()>::static_evil(b) //~ ERROR cannot infer an appropriate lifetime + | ^ +note: but, the lifetime must be valid for the lifetime 'a as defined on the function body at 50:9... + --> $DIR/wf-static-method.rs:50:9 + | +LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/wf-static-method.rs:51:5 + | +LL | <()>::static_evil(b) //~ ERROR cannot infer an appropriate lifetime + | ^^^^^^^^^^^^^^^^^^^^ + +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'b` due to conflicting requirements + --> $DIR/wf-static-method.rs:55:5 + | +LL | <IndirectEvil>::static_evil(b) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'b as defined on the function body at 54:22... + --> $DIR/wf-static-method.rs:54:22 + | +LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/wf-static-method.rs:55:33 + | +LL | <IndirectEvil>::static_evil(b) + | ^ +note: but, the lifetime must be valid for the lifetime 'a as defined on the function body at 54:18... + --> $DIR/wf-static-method.rs:54:18 + | +LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 { + | ^^ +note: ...so that reference does not outlive borrowed content + --> $DIR/wf-static-method.rs:55:5 + | +LL | <IndirectEvil>::static_evil(b) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 5 previous errors + +Some errors occurred: E0312, E0478, E0495. +For more information about an error, try `rustc --explain E0312`. diff --git a/src/test/compile-fail/wf-static-type.rs b/src/test/ui/compile-fail-migration/wf-static-type.rs index ba02c5dca3e..ba02c5dca3e 100644 --- a/src/test/compile-fail/wf-static-type.rs +++ b/src/test/ui/compile-fail-migration/wf-static-type.rs diff --git a/src/test/ui/compile-fail-migration/wf-static-type.stderr b/src/test/ui/compile-fail-migration/wf-static-type.stderr new file mode 100644 index 00000000000..f76444cfe1f --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-static-type.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `NotCopy: std::marker::Copy` is not satisfied + --> $DIR/wf-static-type.rs:20:1 + | +LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `NotCopy` + | + = note: required because of the requirements on the impl of `std::marker::Copy` for `std::option::Option<NotCopy>` +note: required by `IsCopy` + --> $DIR/wf-static-type.rs:17:1 + | +LL | struct IsCopy<T:Copy> { t: T } + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-struct-bound.rs b/src/test/ui/compile-fail-migration/wf-struct-bound.rs index e263b251aa3..e263b251aa3 100644 --- a/src/test/compile-fail/wf-struct-bound.rs +++ b/src/test/ui/compile-fail-migration/wf-struct-bound.rs diff --git a/src/test/ui/compile-fail-migration/wf-struct-bound.stderr b/src/test/ui/compile-fail-migration/wf-struct-bound.stderr new file mode 100644 index 00000000000..397d8609ceb --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-struct-bound.stderr @@ -0,0 +1,20 @@ +error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied + --> $DIR/wf-struct-bound.rs:19:1 + | +LL | / struct SomeStruct<T,U> //~ ERROR E0277 +LL | | where T: ExtraCopy<U> +LL | | { +LL | | data: (T,U) +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `U` + | + = help: consider adding a `where U: std::marker::Copy` bound +note: required by `ExtraCopy` + --> $DIR/wf-struct-bound.rs:17:1 + | +LL | trait ExtraCopy<T:Copy> { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-struct-field.rs b/src/test/ui/compile-fail-migration/wf-struct-field.rs index 8a631a6c335..8a631a6c335 100644 --- a/src/test/compile-fail/wf-struct-field.rs +++ b/src/test/ui/compile-fail-migration/wf-struct-field.rs diff --git a/src/test/ui/compile-fail-migration/wf-struct-field.stderr b/src/test/ui/compile-fail-migration/wf-struct-field.stderr new file mode 100644 index 00000000000..48a03c71d7d --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-struct-field.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `A: std::marker::Copy` is not satisfied + --> $DIR/wf-struct-field.rs:22:5 + | +LL | data: IsCopy<A> //~ ERROR E0277 + | ^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `A` + | + = help: consider adding a `where A: std::marker::Copy` bound +note: required by `IsCopy` + --> $DIR/wf-struct-field.rs:17:1 + | +LL | struct IsCopy<T:Copy> { + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-associated-type-bound.rs b/src/test/ui/compile-fail-migration/wf-trait-associated-type-bound.rs index 8420edd66a1..8420edd66a1 100644 --- a/src/test/compile-fail/wf-trait-associated-type-bound.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-associated-type-bound.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-associated-type-bound.stderr b/src/test/ui/compile-fail-migration/wf-trait-associated-type-bound.stderr new file mode 100644 index 00000000000..f09ba381db1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-associated-type-bound.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/wf-trait-associated-type-bound.rs:19:1 + | +LL | / trait SomeTrait<T> { //~ ERROR E0277 +LL | | type Type1: ExtraCopy<T>; +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound +note: required by `ExtraCopy` + --> $DIR/wf-trait-associated-type-bound.rs:17:1 + | +LL | trait ExtraCopy<T:Copy> { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-associated-type-region.rs b/src/test/ui/compile-fail-migration/wf-trait-associated-type-region.rs index 95d9ffdf9d3..95d9ffdf9d3 100644 --- a/src/test/compile-fail/wf-trait-associated-type-region.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-associated-type-region.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-associated-type-region.stderr b/src/test/ui/compile-fail-migration/wf-trait-associated-type-region.stderr new file mode 100644 index 00000000000..26d56f7e964 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-associated-type-region.stderr @@ -0,0 +1,16 @@ +error[E0309]: the associated type `<Self as SomeTrait<'a>>::Type1` may not live long enough + --> $DIR/wf-trait-associated-type-region.rs:19:5 + | +LL | type Type2 = &'a Self::Type1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `<Self as SomeTrait<'a>>::Type1: 'a`... +note: ...so that the reference type `&'a <Self as SomeTrait<'a>>::Type1` does not outlive the data it points at + --> $DIR/wf-trait-associated-type-region.rs:19:5 + | +LL | type Type2 = &'a Self::Type1; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/compile-fail/wf-trait-associated-type-trait.rs b/src/test/ui/compile-fail-migration/wf-trait-associated-type-trait.rs index 902cbe2676b..902cbe2676b 100644 --- a/src/test/compile-fail/wf-trait-associated-type-trait.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-associated-type-trait.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-associated-type-trait.stderr b/src/test/ui/compile-fail-migration/wf-trait-associated-type-trait.stderr new file mode 100644 index 00000000000..6bfca64c443 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-associated-type-trait.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `<Self as SomeTrait>::Type1: std::marker::Copy` is not satisfied + --> $DIR/wf-trait-associated-type-trait.rs:21:5 + | +LL | type Type2 = IsCopy<Self::Type1>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `<Self as SomeTrait>::Type1` + | + = help: consider adding a `where <Self as SomeTrait>::Type1: std::marker::Copy` bound +note: required by `IsCopy` + --> $DIR/wf-trait-associated-type-trait.rs:17:1 + | +LL | struct IsCopy<T:Copy> { x: T } + | ^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-bound.rs b/src/test/ui/compile-fail-migration/wf-trait-bound.rs index ca15a6ab648..ca15a6ab648 100644 --- a/src/test/compile-fail/wf-trait-bound.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-bound.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-bound.stderr b/src/test/ui/compile-fail-migration/wf-trait-bound.stderr new file mode 100644 index 00000000000..4c21959d9f7 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-bound.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `U: std::marker::Copy` is not satisfied + --> $DIR/wf-trait-bound.rs:19:1 + | +LL | / trait SomeTrait<T,U> //~ ERROR E0277 +LL | | where T: ExtraCopy<U> +LL | | { +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `U` + | + = help: consider adding a `where U: std::marker::Copy` bound +note: required by `ExtraCopy` + --> $DIR/wf-trait-bound.rs:17:1 + | +LL | trait ExtraCopy<T:Copy> { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-default-fn-arg.rs b/src/test/ui/compile-fail-migration/wf-trait-default-fn-arg.rs index 453aa2428ce..453aa2428ce 100644 --- a/src/test/compile-fail/wf-trait-default-fn-arg.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-default-fn-arg.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-default-fn-arg.stderr b/src/test/ui/compile-fail-migration/wf-trait-default-fn-arg.stderr new file mode 100644 index 00000000000..5754fd77b72 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-default-fn-arg.stderr @@ -0,0 +1,20 @@ +error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied + --> $DIR/wf-trait-default-fn-arg.rs:21:5 + | +LL | / fn bar(&self, x: &Bar<Self>) { +LL | | //~^ ERROR E0277 +LL | | // +LL | | // Here, Eq ought to be implemented. +LL | | } + | |_____^ the trait `std::cmp::Eq` is not implemented for `Self` + | + = help: consider adding a `where Self: std::cmp::Eq` bound +note: required by `Bar` + --> $DIR/wf-trait-default-fn-arg.rs:18:1 + | +LL | struct Bar<T:Eq+?Sized> { value: Box<T> } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-default-fn-ret.rs b/src/test/ui/compile-fail-migration/wf-trait-default-fn-ret.rs index d94708d3e06..d94708d3e06 100644 --- a/src/test/compile-fail/wf-trait-default-fn-ret.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-default-fn-ret.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-default-fn-ret.stderr b/src/test/ui/compile-fail-migration/wf-trait-default-fn-ret.stderr new file mode 100644 index 00000000000..28d690b1b05 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-default-fn-ret.stderr @@ -0,0 +1,21 @@ +error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied + --> $DIR/wf-trait-default-fn-ret.rs:21:5 + | +LL | / fn bar(&self) -> Bar<Self> { +LL | | //~^ ERROR E0277 +LL | | // +LL | | // Here, Eq ought to be implemented. +LL | | loop { } +LL | | } + | |_____^ the trait `std::cmp::Eq` is not implemented for `Self` + | + = help: consider adding a `where Self: std::cmp::Eq` bound +note: required by `Bar` + --> $DIR/wf-trait-default-fn-ret.rs:18:1 + | +LL | struct Bar<T:Eq+?Sized> { value: Box<T> } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-default-fn-where-clause.rs b/src/test/ui/compile-fail-migration/wf-trait-default-fn-where-clause.rs index 29c85250583..29c85250583 100644 --- a/src/test/compile-fail/wf-trait-default-fn-where-clause.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-default-fn-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-default-fn-where-clause.stderr b/src/test/ui/compile-fail-migration/wf-trait-default-fn-where-clause.stderr new file mode 100644 index 00000000000..c135f199a26 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-default-fn-where-clause.stderr @@ -0,0 +1,20 @@ +error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied + --> $DIR/wf-trait-default-fn-where-clause.rs:21:5 + | +LL | / fn bar<A>(&self) where A: Bar<Self> { +LL | | //~^ ERROR E0277 +LL | | // +LL | | // Here, Eq ought to be implemented. +LL | | } + | |_____^ the trait `std::cmp::Eq` is not implemented for `Self` + | + = help: consider adding a `where Self: std::cmp::Eq` bound +note: required by `Bar` + --> $DIR/wf-trait-default-fn-where-clause.rs:18:1 + | +LL | trait Bar<T:Eq+?Sized> { } + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-fn-arg.rs b/src/test/ui/compile-fail-migration/wf-trait-fn-arg.rs index d88e36faeec..d88e36faeec 100644 --- a/src/test/compile-fail/wf-trait-fn-arg.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-fn-arg.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-fn-arg.stderr b/src/test/ui/compile-fail-migration/wf-trait-fn-arg.stderr new file mode 100644 index 00000000000..6d624fc62ff --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-fn-arg.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied + --> $DIR/wf-trait-fn-arg.rs:20:5 + | +LL | fn bar(&self, x: &Bar<Self>); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `Self` + | + = help: consider adding a `where Self: std::cmp::Eq` bound +note: required by `Bar` + --> $DIR/wf-trait-fn-arg.rs:17:1 + | +LL | struct Bar<T:Eq+?Sized> { value: Box<T> } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-fn-ret.rs b/src/test/ui/compile-fail-migration/wf-trait-fn-ret.rs index c368ff9a4a8..c368ff9a4a8 100644 --- a/src/test/compile-fail/wf-trait-fn-ret.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-fn-ret.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-fn-ret.stderr b/src/test/ui/compile-fail-migration/wf-trait-fn-ret.stderr new file mode 100644 index 00000000000..dca26a63079 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-fn-ret.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied + --> $DIR/wf-trait-fn-ret.rs:20:5 + | +LL | fn bar(&self) -> &Bar<Self>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `Self` + | + = help: consider adding a `where Self: std::cmp::Eq` bound +note: required by `Bar` + --> $DIR/wf-trait-fn-ret.rs:17:1 + | +LL | struct Bar<T:Eq+?Sized> { value: Box<T> } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-fn-where-clause.rs b/src/test/ui/compile-fail-migration/wf-trait-fn-where-clause.rs index f46a54504a0..f46a54504a0 100644 --- a/src/test/compile-fail/wf-trait-fn-where-clause.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-fn-where-clause.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-fn-where-clause.stderr b/src/test/ui/compile-fail-migration/wf-trait-fn-where-clause.stderr new file mode 100644 index 00000000000..887f60935b0 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-fn-where-clause.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `Self: std::cmp::Eq` is not satisfied + --> $DIR/wf-trait-fn-where-clause.rs:20:5 + | +LL | fn bar(&self) where Self: Sized, Bar<Self>: Copy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Eq` is not implemented for `Self` + | + = help: consider adding a `where Self: std::cmp::Eq` bound +note: required by `Bar` + --> $DIR/wf-trait-fn-where-clause.rs:17:1 + | +LL | struct Bar<T:Eq+?Sized> { value: Box<T> } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/wf-trait-superbound.rs b/src/test/ui/compile-fail-migration/wf-trait-superbound.rs index ea8b2fdf3a1..ea8b2fdf3a1 100644 --- a/src/test/compile-fail/wf-trait-superbound.rs +++ b/src/test/ui/compile-fail-migration/wf-trait-superbound.rs diff --git a/src/test/ui/compile-fail-migration/wf-trait-superbound.stderr b/src/test/ui/compile-fail-migration/wf-trait-superbound.stderr new file mode 100644 index 00000000000..ac58dc7496e --- /dev/null +++ b/src/test/ui/compile-fail-migration/wf-trait-superbound.stderr @@ -0,0 +1,17 @@ +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/wf-trait-superbound.rs:19:1 + | +LL | / trait SomeTrait<T>: ExtraCopy<T> { //~ ERROR E0277 +LL | | } + | |_^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound +note: required by `ExtraCopy` + --> $DIR/wf-trait-superbound.rs:17:1 + | +LL | trait ExtraCopy<T:Copy> { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs b/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-inherent-impl.rs index 458ee669424..458ee669424 100644 --- a/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs +++ b/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-inherent-impl.rs diff --git a/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-inherent-impl.stderr b/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-inherent-impl.stderr new file mode 100644 index 00000000000..0d6906a85d5 --- /dev/null +++ b/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-inherent-impl.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/where-clause-constraints-are-local-for-inherent-impl.rs:23:9 + | +LL | require_copy(self.x); + | ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound +note: required by `require_copy` + --> $DIR/where-clause-constraints-are-local-for-inherent-impl.rs:11:1 + | +LL | fn require_copy<T: Copy>(x: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs b/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-trait-impl.rs index b3f99f2ae25..b3f99f2ae25 100644 --- a/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs +++ b/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-trait-impl.rs diff --git a/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-trait-impl.stderr b/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-trait-impl.stderr new file mode 100644 index 00000000000..976cca7b895 --- /dev/null +++ b/src/test/ui/compile-fail-migration/where-clause-constraints-are-local-for-trait-impl.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied + --> $DIR/where-clause-constraints-are-local-for-trait-impl.rs:28:9 + | +LL | require_copy(self.x); + | ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `T` + | + = help: consider adding a `where T: std::marker::Copy` bound +note: required by `require_copy` + --> $DIR/where-clause-constraints-are-local-for-trait-impl.rs:11:1 + | +LL | fn require_copy<T: Copy>(x: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/where-clause-method-substituion.rs b/src/test/ui/compile-fail-migration/where-clause-method-substituion.rs index 05a58daf906..05a58daf906 100644 --- a/src/test/compile-fail/where-clause-method-substituion.rs +++ b/src/test/ui/compile-fail-migration/where-clause-method-substituion.rs diff --git a/src/test/ui/compile-fail-migration/where-clause-method-substituion.stderr b/src/test/ui/compile-fail-migration/where-clause-method-substituion.stderr new file mode 100644 index 00000000000..5cd4c395869 --- /dev/null +++ b/src/test/ui/compile-fail-migration/where-clause-method-substituion.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `X: Foo<X>` is not satisfied + --> $DIR/where-clause-method-substituion.rs:30:7 + | +LL | 1.method::<X>(); + | ^^^^^^ the trait `Foo<X>` is not implemented for `X` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/where-clauses-method-unsatisfied.rs b/src/test/ui/compile-fail-migration/where-clauses-method-unsatisfied.rs index 1ac03330afd..1ac03330afd 100644 --- a/src/test/compile-fail/where-clauses-method-unsatisfied.rs +++ b/src/test/ui/compile-fail-migration/where-clauses-method-unsatisfied.rs diff --git a/src/test/ui/compile-fail-migration/where-clauses-method-unsatisfied.stderr b/src/test/ui/compile-fail-migration/where-clauses-method-unsatisfied.stderr new file mode 100644 index 00000000000..eeb0b51b80a --- /dev/null +++ b/src/test/ui/compile-fail-migration/where-clauses-method-unsatisfied.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `Bar: std::cmp::Eq` is not satisfied + --> $DIR/where-clauses-method-unsatisfied.rs:28:7 + | +LL | x.equals(&x); + | ^^^^^^ the trait `std::cmp::Eq` is not implemented for `Bar` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/where-clauses-unsatisfied.rs b/src/test/ui/compile-fail-migration/where-clauses-unsatisfied.rs index ffc39008c4e..ffc39008c4e 100644 --- a/src/test/compile-fail/where-clauses-unsatisfied.rs +++ b/src/test/ui/compile-fail-migration/where-clauses-unsatisfied.rs diff --git a/src/test/ui/compile-fail-migration/where-clauses-unsatisfied.stderr b/src/test/ui/compile-fail-migration/where-clauses-unsatisfied.stderr new file mode 100644 index 00000000000..dd042599382 --- /dev/null +++ b/src/test/ui/compile-fail-migration/where-clauses-unsatisfied.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `Struct: std::cmp::Eq` is not satisfied + --> $DIR/where-clauses-unsatisfied.rs:16:10 + | +LL | drop(equal(&Struct, &Struct)) + | ^^^^^ the trait `std::cmp::Eq` is not implemented for `Struct` + | +note: required by `equal` + --> $DIR/where-clauses-unsatisfied.rs:11:1 + | +LL | fn equal<T>(a: &T, b: &T) -> bool where T : Eq { a == b } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/where-equality-constraints.rs b/src/test/ui/compile-fail-migration/where-equality-constraints.rs index e449a736c75..e449a736c75 100644 --- a/src/test/compile-fail/where-equality-constraints.rs +++ b/src/test/ui/compile-fail-migration/where-equality-constraints.rs diff --git a/src/test/ui/compile-fail-migration/where-equality-constraints.stderr b/src/test/ui/compile-fail-migration/where-equality-constraints.stderr new file mode 100644 index 00000000000..f2bcfacc452 --- /dev/null +++ b/src/test/ui/compile-fail-migration/where-equality-constraints.stderr @@ -0,0 +1,14 @@ +error: equality constraints are not yet supported in where clauses (#20041) + --> $DIR/where-equality-constraints.rs:11:14 + | +LL | fn f() where u8 = u16 {} + | ^^^^^^^^ + +error: equality constraints are not yet supported in where clauses (#20041) + --> $DIR/where-equality-constraints.rs:13:14 + | +LL | fn g() where for<'a> &'static (u8,) == u16, {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/src/test/compile-fail/where-for-self-2.rs b/src/test/ui/compile-fail-migration/where-for-self-2.rs index bf8fc292173..bf8fc292173 100644 --- a/src/test/compile-fail/where-for-self-2.rs +++ b/src/test/ui/compile-fail-migration/where-for-self-2.rs diff --git a/src/test/ui/compile-fail-migration/where-for-self-2.stderr b/src/test/ui/compile-fail-migration/where-for-self-2.stderr new file mode 100644 index 00000000000..d234c718215 --- /dev/null +++ b/src/test/ui/compile-fail-migration/where-for-self-2.stderr @@ -0,0 +1,19 @@ +error[E0277]: the trait bound `for<'a> &'a _: Bar` is not satisfied + --> $DIR/where-for-self-2.rs:31:5 + | +LL | foo(&X); + | ^^^ the trait `for<'a> Bar` is not implemented for `&'a _` + | + = help: the following implementations were found: + <&'static u32 as Bar> +note: required by `foo` + --> $DIR/where-for-self-2.rs:26:1 + | +LL | / fn foo<T>(x: &T) +LL | | where for<'a> &'a T: Bar +LL | | {} + | |__^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/compile-fail/where-for-self.rs b/src/test/ui/compile-fail-migration/where-for-self.rs index 8f447face4e..8f447face4e 100644 --- a/src/test/compile-fail/where-for-self.rs +++ b/src/test/ui/compile-fail-migration/where-for-self.rs diff --git a/src/test/ui/compile-fail-migration/where-for-self.stderr b/src/test/ui/compile-fail-migration/where-for-self.stderr new file mode 100644 index 00000000000..89c0bd023c3 --- /dev/null +++ b/src/test/ui/compile-fail-migration/where-for-self.stderr @@ -0,0 +1,9 @@ +error[E0316]: nested quantification of lifetimes + --> $DIR/where-for-self.rs:25:26 + | +LL | where for<'a> &'a T: for<'b> Bar<'b> + | ^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0316`. diff --git a/src/test/compile-fail/where-lifetime-resolution.rs b/src/test/ui/compile-fail-migration/where-lifetime-resolution.rs index 1204cc0df47..1204cc0df47 100644 --- a/src/test/compile-fail/where-lifetime-resolution.rs +++ b/src/test/ui/compile-fail-migration/where-lifetime-resolution.rs diff --git a/src/test/ui/compile-fail-migration/where-lifetime-resolution.stderr b/src/test/ui/compile-fail-migration/where-lifetime-resolution.stderr new file mode 100644 index 00000000000..a6fc1b25962 --- /dev/null +++ b/src/test/ui/compile-fail-migration/where-lifetime-resolution.stderr @@ -0,0 +1,22 @@ +error[E0261]: use of undeclared lifetime name `'a` + --> $DIR/where-lifetime-resolution.rs:16:34 + | +LL | (for<'a> Trait1<'a>): Trait1<'a>, + | ^^ undeclared lifetime + +error[E0316]: nested quantification of lifetimes + --> $DIR/where-lifetime-resolution.rs:18:13 + | +LL | for<'a> for<'b> Trait2<'a, 'b>: Trait2<'a, 'b>, + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0261]: use of undeclared lifetime name `'b` + --> $DIR/where-lifetime-resolution.rs:18:48 + | +LL | for<'a> for<'b> Trait2<'a, 'b>: Trait2<'a, 'b>, + | ^^ undeclared lifetime + +error: aborting due to 3 previous errors + +Some errors occurred: E0261, E0316. +For more information about an error, try `rustc --explain E0261`. diff --git a/src/test/compile-fail/while-let.rs b/src/test/ui/compile-fail-migration/while-let.rs index a70dcccd4e8..a70dcccd4e8 100644 --- a/src/test/compile-fail/while-let.rs +++ b/src/test/ui/compile-fail-migration/while-let.rs diff --git a/src/test/ui/compile-fail-migration/while-let.stderr b/src/test/ui/compile-fail-migration/while-let.stderr new file mode 100644 index 00000000000..de4d8be212e --- /dev/null +++ b/src/test/ui/compile-fail-migration/while-let.stderr @@ -0,0 +1,21 @@ +error[E0165]: irrefutable while-let pattern + --> $DIR/while-let.rs:23:10 + | +LL | foo!(a, 1, { //~ ERROR irrefutable while-let + | ^ irrefutable pattern + +error[E0165]: irrefutable while-let pattern + --> $DIR/while-let.rs:26:10 + | +LL | bar!(a, 1, { //~ ERROR irrefutable while-let + | ^ irrefutable pattern + +error[E0165]: irrefutable while-let pattern + --> $DIR/while-let.rs:32:15 + | +LL | while let a = 1 { //~ ERROR irrefutable while-let + | ^ irrefutable pattern + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0165`. diff --git a/src/test/compile-fail/while-type-error.rs b/src/test/ui/compile-fail-migration/while-type-error.rs index ecab746373a..ecab746373a 100644 --- a/src/test/compile-fail/while-type-error.rs +++ b/src/test/ui/compile-fail-migration/while-type-error.rs diff --git a/src/test/ui/compile-fail-migration/while-type-error.stderr b/src/test/ui/compile-fail-migration/while-type-error.stderr new file mode 100644 index 00000000000..cfc3f3e257e --- /dev/null +++ b/src/test/ui/compile-fail-migration/while-type-error.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/while-type-error.rs:13:19 + | +LL | fn main() { while main { } } + | ^^^^ expected bool, found fn item + | + = note: expected type `bool` + found type `fn() {main}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/windows-subsystem-invalid.rs b/src/test/ui/compile-fail-migration/windows-subsystem-invalid.rs index 7772cfd6a2c..7772cfd6a2c 100644 --- a/src/test/compile-fail/windows-subsystem-invalid.rs +++ b/src/test/ui/compile-fail-migration/windows-subsystem-invalid.rs diff --git a/src/test/ui/compile-fail-migration/windows-subsystem-invalid.stderr b/src/test/ui/compile-fail-migration/windows-subsystem-invalid.stderr new file mode 100644 index 00000000000..0cb843cf0f1 --- /dev/null +++ b/src/test/ui/compile-fail-migration/windows-subsystem-invalid.stderr @@ -0,0 +1,4 @@ +error: invalid windows subsystem `wrong`, only `windows` and `console` are allowed + +error: aborting due to previous error + diff --git a/src/test/compile-fail/write-to-static-mut-in-static.rs b/src/test/ui/compile-fail-migration/write-to-static-mut-in-static.rs index 1ea74f73723..1ea74f73723 100644 --- a/src/test/compile-fail/write-to-static-mut-in-static.rs +++ b/src/test/ui/compile-fail-migration/write-to-static-mut-in-static.rs diff --git a/src/test/ui/compile-fail-migration/write-to-static-mut-in-static.stderr b/src/test/ui/compile-fail-migration/write-to-static-mut-in-static.stderr new file mode 100644 index 00000000000..f07d240746f --- /dev/null +++ b/src/test/ui/compile-fail-migration/write-to-static-mut-in-static.stderr @@ -0,0 +1,19 @@ +error[E0658]: statements in statics are unstable (see issue #48821) + --> $DIR/write-to-static-mut-in-static.rs:14:33 + | +LL | pub static mut B: () = unsafe { A = 1; }; + | ^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error[E0658]: statements in statics are unstable (see issue #48821) + --> $DIR/write-to-static-mut-in-static.rs:17:34 + | +LL | pub static mut C: u32 = unsafe { C = 1; 0 }; + | ^^^^^ + | + = help: add #![feature(const_let)] to the crate attributes to enable + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/compile-fail-migration/writing-to-immutable-vec.nll.stderr b/src/test/ui/compile-fail-migration/writing-to-immutable-vec.nll.stderr new file mode 100644 index 00000000000..96899276b97 --- /dev/null +++ b/src/test/ui/compile-fail-migration/writing-to-immutable-vec.nll.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable + --> $DIR/writing-to-immutable-vec.rs:14:5 + | +LL | let v: Vec<isize> = vec![1, 2, 3]; + | - help: consider changing this to be mutable: `mut v` +LL | v[1] = 4; //~ ERROR cannot borrow immutable local variable `v` as mutable + | ^ cannot borrow as mutable + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/writing-to-immutable-vec.rs b/src/test/ui/compile-fail-migration/writing-to-immutable-vec.rs index f289b85992e..f289b85992e 100644 --- a/src/test/compile-fail/writing-to-immutable-vec.rs +++ b/src/test/ui/compile-fail-migration/writing-to-immutable-vec.rs diff --git a/src/test/ui/compile-fail-migration/writing-to-immutable-vec.stderr b/src/test/ui/compile-fail-migration/writing-to-immutable-vec.stderr new file mode 100644 index 00000000000..07e17797139 --- /dev/null +++ b/src/test/ui/compile-fail-migration/writing-to-immutable-vec.stderr @@ -0,0 +1,11 @@ +error[E0596]: cannot borrow immutable local variable `v` as mutable + --> $DIR/writing-to-immutable-vec.rs:14:5 + | +LL | let v: Vec<isize> = vec![1, 2, 3]; + | - consider changing this to `mut v` +LL | v[1] = 4; //~ ERROR cannot borrow immutable local variable `v` as mutable + | ^ cannot borrow mutably + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0596`. diff --git a/src/test/compile-fail/wrong-mul-method-signature.rs b/src/test/ui/compile-fail-migration/wrong-mul-method-signature.rs index 069fd2dec99..069fd2dec99 100644 --- a/src/test/compile-fail/wrong-mul-method-signature.rs +++ b/src/test/ui/compile-fail-migration/wrong-mul-method-signature.rs diff --git a/src/test/ui/compile-fail-migration/wrong-mul-method-signature.stderr b/src/test/ui/compile-fail-migration/wrong-mul-method-signature.stderr new file mode 100644 index 00000000000..7c4d22c7cca --- /dev/null +++ b/src/test/ui/compile-fail-migration/wrong-mul-method-signature.stderr @@ -0,0 +1,30 @@ +error[E0053]: method `mul` has an incompatible type for trait + --> $DIR/wrong-mul-method-signature.rs:26:5 + | +LL | fn mul(self, s: &f64) -> Vec1 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected f64, found &f64 + | + = note: expected type `fn(Vec1, f64) -> Vec1` + found type `fn(Vec1, &f64) -> Vec1` + +error[E0053]: method `mul` has an incompatible type for trait + --> $DIR/wrong-mul-method-signature.rs:43:5 + | +LL | fn mul(self, s: f64) -> Vec2 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found f64 + | + = note: expected type `fn(Vec2, Vec2) -> f64` + found type `fn(Vec2, f64) -> Vec2` + +error[E0053]: method `mul` has an incompatible type for trait + --> $DIR/wrong-mul-method-signature.rs:62:5 + | +LL | fn mul(self, s: f64) -> f64 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found f64 + | + = note: expected type `fn(Vec3, f64) -> i32` + found type `fn(Vec3, f64) -> f64` + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0053`. diff --git a/src/test/compile-fail/wrong-ret-type.rs b/src/test/ui/compile-fail-migration/wrong-ret-type.rs index 6db11fcffd2..6db11fcffd2 100644 --- a/src/test/compile-fail/wrong-ret-type.rs +++ b/src/test/ui/compile-fail-migration/wrong-ret-type.rs diff --git a/src/test/ui/compile-fail-migration/wrong-ret-type.stderr b/src/test/ui/compile-fail-migration/wrong-ret-type.stderr new file mode 100644 index 00000000000..4ff6f707603 --- /dev/null +++ b/src/test/ui/compile-fail-migration/wrong-ret-type.stderr @@ -0,0 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/wrong-ret-type.rs:12:49 + | +LL | fn mk_int() -> usize { let i: isize = 3; return i; } + | ^ expected usize, found isize + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/xc-private-method.rs b/src/test/ui/compile-fail-migration/xc-private-method.rs index edc0e31040d..edc0e31040d 100644 --- a/src/test/compile-fail/xc-private-method.rs +++ b/src/test/ui/compile-fail-migration/xc-private-method.rs diff --git a/src/test/ui/compile-fail-migration/xc-private-method.stderr b/src/test/ui/compile-fail-migration/xc-private-method.stderr new file mode 100644 index 00000000000..35078e73d46 --- /dev/null +++ b/src/test/ui/compile-fail-migration/xc-private-method.stderr @@ -0,0 +1,15 @@ +error[E0624]: method `static_meth_struct` is private + --> $DIR/xc-private-method.rs:16:13 + | +LL | let _ = xc_private_method_lib::Struct::static_meth_struct(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0624]: method `static_meth_enum` is private + --> $DIR/xc-private-method.rs:19:13 + | +LL | let _ = xc_private_method_lib::Enum::static_meth_enum(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0624`. diff --git a/src/test/compile-fail/xc-private-method2.rs b/src/test/ui/compile-fail-migration/xc-private-method2.rs index 26e055d7cbb..26e055d7cbb 100644 --- a/src/test/compile-fail/xc-private-method2.rs +++ b/src/test/ui/compile-fail-migration/xc-private-method2.rs diff --git a/src/test/ui/compile-fail-migration/xc-private-method2.stderr b/src/test/ui/compile-fail-migration/xc-private-method2.stderr new file mode 100644 index 00000000000..d671aa35817 --- /dev/null +++ b/src/test/ui/compile-fail-migration/xc-private-method2.stderr @@ -0,0 +1,15 @@ +error[E0624]: method `meth_struct` is private + --> $DIR/xc-private-method2.rs:16:52 + | +LL | let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct(); + | ^^^^^^^^^^^ + +error[E0624]: method `meth_enum` is private + --> $DIR/xc-private-method2.rs:19:55 + | +LL | let _ = xc_private_method_lib::Enum::Variant1(20).meth_enum(); + | ^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0624`. diff --git a/src/test/compile-fail/xcrate-private-by-default.rs b/src/test/ui/compile-fail-migration/xcrate-private-by-default.rs index 7dd4d970945..7dd4d970945 100644 --- a/src/test/compile-fail/xcrate-private-by-default.rs +++ b/src/test/ui/compile-fail-migration/xcrate-private-by-default.rs diff --git a/src/test/ui/compile-fail-migration/xcrate-private-by-default.stderr b/src/test/ui/compile-fail-migration/xcrate-private-by-default.stderr new file mode 100644 index 00000000000..c4560b9ca77 --- /dev/null +++ b/src/test/ui/compile-fail-migration/xcrate-private-by-default.stderr @@ -0,0 +1,63 @@ +error[E0603]: static `j` is private + --> $DIR/xcrate-private-by-default.rs:33:5 + | +LL | static_priv_by_default::j; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: function `k` is private + --> $DIR/xcrate-private-by-default.rs:35:5 + | +LL | static_priv_by_default::k; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: unit struct `l` is private + --> $DIR/xcrate-private-by-default.rs:37:5 + | +LL | static_priv_by_default::l; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: enum `m` is private + --> $DIR/xcrate-private-by-default.rs:39:11 + | +LL | foo::<static_priv_by_default::m>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: type alias `n` is private + --> $DIR/xcrate-private-by-default.rs:41:11 + | +LL | foo::<static_priv_by_default::n>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: module `foo` is private + --> $DIR/xcrate-private-by-default.rs:45:5 + | +LL | static_priv_by_default::foo::a; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: module `foo` is private + --> $DIR/xcrate-private-by-default.rs:47:5 + | +LL | static_priv_by_default::foo::b; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: module `foo` is private + --> $DIR/xcrate-private-by-default.rs:49:5 + | +LL | static_priv_by_default::foo::c; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: module `foo` is private + --> $DIR/xcrate-private-by-default.rs:51:11 + | +LL | foo::<static_priv_by_default::foo::d>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: module `foo` is private + --> $DIR/xcrate-private-by-default.rs:53:11 + | +LL | foo::<static_priv_by_default::foo::e>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 10 previous errors + +For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/compile-fail/xcrate-unit-struct.rs b/src/test/ui/compile-fail-migration/xcrate-unit-struct.rs index 04af7133000..04af7133000 100644 --- a/src/test/compile-fail/xcrate-unit-struct.rs +++ b/src/test/ui/compile-fail-migration/xcrate-unit-struct.rs diff --git a/src/test/ui/compile-fail-migration/xcrate-unit-struct.stderr b/src/test/ui/compile-fail-migration/xcrate-unit-struct.stderr new file mode 100644 index 00000000000..9ee4cb3ba17 --- /dev/null +++ b/src/test/ui/compile-fail-migration/xcrate-unit-struct.stderr @@ -0,0 +1,9 @@ +error[E0423]: expected value, found struct `xcrate_unit_struct::StructWithFields` + --> $DIR/xcrate-unit-struct.rs:19:13 + | +LL | let _ = xcrate_unit_struct::StructWithFields; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `xcrate_unit_struct::StructWithFields { /* fields */ }`? + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0423`. |
