diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index a02b63755dc12..7349c520c2407 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -435,13 +435,14 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { } fn report_similar_impl_candidates(&self, - impl_candidates: Vec>, + mut impl_candidates: Vec>, err: &mut DiagnosticBuilder) { if impl_candidates.is_empty() { return; } + let len = impl_candidates.len(); let end = if impl_candidates.len() <= 5 { impl_candidates.len() } else { @@ -459,10 +460,17 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { } }); + // Sort impl candidates so that ordering is consistent for UI tests. + let normalized_impl_candidates = &mut impl_candidates[0..end] + .iter() + .map(normalize) + .collect::>(); + normalized_impl_candidates.sort(); + err.help(&format!("the following implementations were found:{}{}", - &impl_candidates[0..end].iter().map(normalize).collect::(), - if impl_candidates.len() > 5 { - format!("\nand {} others", impl_candidates.len() - 4) + normalized_impl_candidates.join(""), + if len > 5 { + format!("\nand {} others", len - 4) } else { "".to_owned() } diff --git a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-lang-items.rs b/src/test/compile-fail/auxiliary/panic-runtime-lang-items.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-lang-items.rs rename to src/test/compile-fail/auxiliary/panic-runtime-lang-items.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-unwind.rs b/src/test/compile-fail/auxiliary/panic-runtime-unwind.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-unwind.rs rename to src/test/compile-fail/auxiliary/panic-runtime-unwind.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-unwind2.rs b/src/test/compile-fail/auxiliary/panic-runtime-unwind2.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-unwind2.rs rename to src/test/compile-fail/auxiliary/panic-runtime-unwind2.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs b/src/test/compile-fail/auxiliary/wants-panic-runtime-unwind.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs rename to src/test/compile-fail/auxiliary/wants-panic-runtime-unwind.rs diff --git a/src/test/compile-fail/meta-expected-error-wrong-rev.rs b/src/test/compile-fail/meta-expected-error-wrong-rev.rs index 3c13050812c93..8869e950b3a44 100644 --- a/src/test/compile-fail/meta-expected-error-wrong-rev.rs +++ b/src/test/compile-fail/meta-expected-error-wrong-rev.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // revisions: a // should-fail diff --git a/src/test/compile-fail/panic-runtime/two-panic-runtimes.rs b/src/test/compile-fail/two-panic-runtimes.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/two-panic-runtimes.rs rename to src/test/compile-fail/two-panic-runtimes.rs diff --git a/src/test/compile-fail/panic-runtime/want-abort-got-unwind.rs b/src/test/compile-fail/want-abort-got-unwind.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/want-abort-got-unwind.rs rename to src/test/compile-fail/want-abort-got-unwind.rs diff --git a/src/test/compile-fail/panic-runtime/want-abort-got-unwind2.rs b/src/test/compile-fail/want-abort-got-unwind2.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/want-abort-got-unwind2.rs rename to src/test/compile-fail/want-abort-got-unwind2.rs diff --git a/src/test/compile-fail/.gitattributes b/src/test/ui/.gitattributes similarity index 100% rename from src/test/compile-fail/.gitattributes rename to src/test/ui/.gitattributes diff --git a/src/test/ui/E0501.ast.nll.stderr b/src/test/ui/E0501.ast.nll.stderr new file mode 100644 index 0000000000000..a9abc79400e67 --- /dev/null +++ b/src/test/ui/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/E0501.ast.stderr b/src/test/ui/E0501.ast.stderr new file mode 100644 index 0000000000000..229b16650173e --- /dev/null +++ b/src/test/ui/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/E0501.mir.stderr b/src/test/ui/E0501.mir.stderr new file mode 100644 index 0000000000000..a9abc79400e67 --- /dev/null +++ b/src/test/ui/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/E0501.rs similarity index 100% rename from src/test/compile-fail/E0501.rs rename to src/test/ui/E0501.rs diff --git a/src/test/ui/E0506.ast.nll.stderr b/src/test/ui/E0506.ast.nll.stderr new file mode 100644 index 0000000000000..cf6b8d9c8d1d5 --- /dev/null +++ b/src/test/ui/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/E0506.ast.stderr b/src/test/ui/E0506.ast.stderr new file mode 100644 index 0000000000000..54b4e16368157 --- /dev/null +++ b/src/test/ui/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/E0506.mir.stderr b/src/test/ui/E0506.mir.stderr new file mode 100644 index 0000000000000..cf6b8d9c8d1d5 --- /dev/null +++ b/src/test/ui/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/E0506.rs similarity index 100% rename from src/test/compile-fail/E0506.rs rename to src/test/ui/E0506.rs diff --git a/src/test/ui/E0508-fail.ast.stderr b/src/test/ui/E0508-fail.ast.stderr new file mode 100644 index 0000000000000..faf7411af317b --- /dev/null +++ b/src/test/ui/E0508-fail.ast.stderr @@ -0,0 +1,12 @@ +error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array + --> $DIR/E0508-fail.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/E0508-fail.mir.stderr b/src/test/ui/E0508-fail.mir.stderr new file mode 100644 index 0000000000000..faf7411af317b --- /dev/null +++ b/src/test/ui/E0508-fail.mir.stderr @@ -0,0 +1,12 @@ +error[E0508]: cannot move out of type `[NonCopy; 1]`, a non-copy array + --> $DIR/E0508-fail.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/E0508-fail.rs similarity index 100% rename from src/test/compile-fail/E0508.rs rename to src/test/ui/E0508-fail.rs diff --git a/src/test/ui/E0508.ast.stderr b/src/test/ui/E0508.ast.stderr new file mode 100644 index 0000000000000..5878b795b771c --- /dev/null +++ b/src/test/ui/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/E0508.mir.stderr b/src/test/ui/E0508.mir.stderr new file mode 100644 index 0000000000000..5878b795b771c --- /dev/null +++ b/src/test/ui/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/E0583.rs b/src/test/ui/E0583.rs similarity index 100% rename from src/test/compile-fail/E0583.rs rename to src/test/ui/E0583.rs diff --git a/src/test/ui/E0583.stderr b/src/test/ui/E0583.stderr new file mode 100644 index 0000000000000..82e1cccbb68af --- /dev/null +++ b/src/test/ui/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/E0594.ast.nll.stderr b/src/test/ui/E0594.ast.nll.stderr new file mode 100644 index 0000000000000..f96eb01abe4e7 --- /dev/null +++ b/src/test/ui/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/E0594.ast.stderr b/src/test/ui/E0594.ast.stderr new file mode 100644 index 0000000000000..f84c1f56ad01c --- /dev/null +++ b/src/test/ui/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/E0594.mir.stderr b/src/test/ui/E0594.mir.stderr new file mode 100644 index 0000000000000..f96eb01abe4e7 --- /dev/null +++ b/src/test/ui/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/E0594.rs similarity index 100% rename from src/test/compile-fail/E0594.rs rename to src/test/ui/E0594.rs diff --git a/src/test/ui/E0596.ast.nll.stderr b/src/test/ui/E0596.ast.nll.stderr new file mode 100644 index 0000000000000..589db4a032d38 --- /dev/null +++ b/src/test/ui/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/E0596.ast.stderr b/src/test/ui/E0596.ast.stderr new file mode 100644 index 0000000000000..d88530b21647e --- /dev/null +++ b/src/test/ui/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/E0596.mir.stderr b/src/test/ui/E0596.mir.stderr new file mode 100644 index 0000000000000..589db4a032d38 --- /dev/null +++ b/src/test/ui/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/E0596.rs similarity index 100% rename from src/test/compile-fail/E0596.rs rename to src/test/ui/E0596.rs diff --git a/src/test/compile-fail/absolute-paths-in-nested-use-groups.rs b/src/test/ui/absolute-paths-in-nested-use-groups.rs similarity index 100% rename from src/test/compile-fail/absolute-paths-in-nested-use-groups.rs rename to src/test/ui/absolute-paths-in-nested-use-groups.rs diff --git a/src/test/ui/absolute-paths-in-nested-use-groups.stderr b/src/test/ui/absolute-paths-in-nested-use-groups.stderr new file mode 100644 index 0000000000000..e88d26718a01e --- /dev/null +++ b/src/test/ui/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/access-mode-in-closures.nll.stderr b/src/test/ui/access-mode-in-closures.nll.stderr new file mode 100644 index 0000000000000..2aa8f1c381309 --- /dev/null +++ b/src/test/ui/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`, 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/access-mode-in-closures.rs similarity index 100% rename from src/test/compile-fail/access-mode-in-closures.rs rename to src/test/ui/access-mode-in-closures.rs diff --git a/src/test/ui/access-mode-in-closures.stderr b/src/test/ui/access-mode-in-closures.stderr new file mode 100644 index 0000000000000..daecbb6ed2993 --- /dev/null +++ b/src/test/ui/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/alloc-error/alloc-error-handler-bad-signature-1.rs similarity index 100% rename from src/test/compile-fail/alloc-error-handler-bad-signature-1.rs rename to src/test/ui/alloc-error/alloc-error-handler-bad-signature-1.rs diff --git a/src/test/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr b/src/test/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr new file mode 100644 index 0000000000000..6dd905ceab405 --- /dev/null +++ b/src/test/ui/alloc-error/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/alloc-error/alloc-error-handler-bad-signature-2.rs similarity index 100% rename from src/test/compile-fail/alloc-error-handler-bad-signature-2.rs rename to src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.rs diff --git a/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr b/src/test/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr new file mode 100644 index 0000000000000..c1fcdc7583360 --- /dev/null +++ b/src/test/ui/alloc-error/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/alloc-error/alloc-error-handler-bad-signature-3.rs similarity index 100% rename from src/test/compile-fail/alloc-error-handler-bad-signature-3.rs rename to src/test/ui/alloc-error/alloc-error-handler-bad-signature-3.rs diff --git a/src/test/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr b/src/test/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr new file mode 100644 index 0000000000000..9b792c46c24b9 --- /dev/null +++ b/src/test/ui/alloc-error/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/allocator/auxiliary/system-allocator.rs similarity index 100% rename from src/test/compile-fail/allocator/auxiliary/system-allocator.rs rename to src/test/ui/allocator/auxiliary/system-allocator.rs diff --git a/src/test/compile-fail/allocator/auxiliary/system-allocator2.rs b/src/test/ui/allocator/auxiliary/system-allocator2.rs similarity index 100% rename from src/test/compile-fail/allocator/auxiliary/system-allocator2.rs rename to src/test/ui/allocator/auxiliary/system-allocator2.rs diff --git a/src/test/compile-fail/allocator/function-allocator.rs b/src/test/ui/allocator/function-allocator.rs similarity index 100% rename from src/test/compile-fail/allocator/function-allocator.rs rename to src/test/ui/allocator/function-allocator.rs diff --git a/src/test/ui/allocator/function-allocator.stderr b/src/test/ui/allocator/function-allocator.stderr new file mode 100644 index 0000000000000..8649b6b124452 --- /dev/null +++ b/src/test/ui/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/allocator/not-an-allocator.rs similarity index 100% rename from src/test/compile-fail/allocator/not-an-allocator.rs rename to src/test/ui/allocator/not-an-allocator.rs diff --git a/src/test/ui/allocator/not-an-allocator.stderr b/src/test/ui/allocator/not-an-allocator.stderr new file mode 100644 index 0000000000000..757c5066a6608 --- /dev/null +++ b/src/test/ui/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/allocator/two-allocators.rs similarity index 100% rename from src/test/compile-fail/allocator/two-allocators.rs rename to src/test/ui/allocator/two-allocators.rs diff --git a/src/test/ui/allocator/two-allocators.stderr b/src/test/ui/allocator/two-allocators.stderr new file mode 100644 index 0000000000000..5285ee93f2d6a --- /dev/null +++ b/src/test/ui/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/allocator/two-allocators2.rs similarity index 100% rename from src/test/compile-fail/allocator/two-allocators2.rs rename to src/test/ui/allocator/two-allocators2.rs diff --git a/src/test/ui/allocator/two-allocators2.stderr b/src/test/ui/allocator/two-allocators2.stderr new file mode 100644 index 0000000000000..2b23ce38ede76 --- /dev/null +++ b/src/test/ui/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/allocator/two-allocators3.rs similarity index 100% rename from src/test/compile-fail/allocator/two-allocators3.rs rename to src/test/ui/allocator/two-allocators3.rs diff --git a/src/test/ui/allocator/two-allocators3.stderr b/src/test/ui/allocator/two-allocators3.stderr new file mode 100644 index 0000000000000..86e385a96a1b6 --- /dev/null +++ b/src/test/ui/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/anon-params-deprecated.rs similarity index 100% rename from src/test/compile-fail/anon-params-deprecated.rs rename to src/test/ui/anon-params-deprecated.rs diff --git a/src/test/ui/anon-params-deprecated.stderr b/src/test/ui/anon-params-deprecated.stderr new file mode 100644 index 0000000000000..fa13b8d97e5d9 --- /dev/null +++ b/src/test/ui/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 + +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 + +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 + +error: aborting due to 3 previous errors + diff --git a/src/test/compile-fail/arg-count-mismatch.rs b/src/test/ui/arg-count-mismatch.rs similarity index 100% rename from src/test/compile-fail/arg-count-mismatch.rs rename to src/test/ui/arg-count-mismatch.rs diff --git a/src/test/ui/arg-count-mismatch.stderr b/src/test/ui/arg-count-mismatch.stderr new file mode 100644 index 0000000000000..699e36f3472d6 --- /dev/null +++ b/src/test/ui/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/arg-type-mismatch.rs similarity index 100% rename from src/test/compile-fail/arg-type-mismatch.rs rename to src/test/ui/arg-type-mismatch.rs diff --git a/src/test/ui/arg-type-mismatch.stderr b/src/test/ui/arg-type-mismatch.stderr new file mode 100644 index 0000000000000..2b24d9db3f5b6 --- /dev/null +++ b/src/test/ui/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/array-not-vector.rs similarity index 100% rename from src/test/compile-fail/array-not-vector.rs rename to src/test/ui/array-not-vector.rs diff --git a/src/test/ui/array-not-vector.stderr b/src/test/ui/array-not-vector.stderr new file mode 100644 index 0000000000000..83bf058c449c9 --- /dev/null +++ b/src/test/ui/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/array_const_index-0.rs similarity index 100% rename from src/test/compile-fail/array_const_index-0.rs rename to src/test/ui/array_const_index-0.rs diff --git a/src/test/ui/array_const_index-0.stderr b/src/test/ui/array_const_index-0.stderr new file mode 100644 index 0000000000000..b71d224f4f0eb --- /dev/null +++ b/src/test/ui/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/array_const_index-1.rs similarity index 100% rename from src/test/compile-fail/array_const_index-1.rs rename to src/test/ui/array_const_index-1.rs diff --git a/src/test/ui/array_const_index-1.stderr b/src/test/ui/array_const_index-1.stderr new file mode 100644 index 0000000000000..02f86a693af0c --- /dev/null +++ b/src/test/ui/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/asm/asm-bad-clobber.rs similarity index 100% rename from src/test/compile-fail/asm-bad-clobber.rs rename to src/test/ui/asm/asm-bad-clobber.rs diff --git a/src/test/ui/asm/asm-bad-clobber.stderr b/src/test/ui/asm/asm-bad-clobber.stderr new file mode 100644 index 0000000000000..81ab006a18ad3 --- /dev/null +++ b/src/test/ui/asm/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/asm/asm-in-bad-modifier.rs similarity index 100% rename from src/test/compile-fail/asm-in-bad-modifier.rs rename to src/test/ui/asm/asm-in-bad-modifier.rs diff --git a/src/test/ui/asm/asm-in-bad-modifier.stderr b/src/test/ui/asm/asm-in-bad-modifier.stderr new file mode 100644 index 0000000000000..dcb11bd1e7630 --- /dev/null +++ b/src/test/ui/asm/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/asm/asm-misplaced-option.rs similarity index 100% rename from src/test/compile-fail/asm-misplaced-option.rs rename to src/test/ui/asm/asm-misplaced-option.rs diff --git a/src/test/ui/asm/asm-misplaced-option.stderr b/src/test/ui/asm/asm-misplaced-option.stderr new file mode 100644 index 0000000000000..46723918a3afe --- /dev/null +++ b/src/test/ui/asm/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/ui/asm-out-assign-imm.nll.stderr b/src/test/ui/asm/asm-out-assign-imm.nll.stderr similarity index 100% rename from src/test/ui/asm-out-assign-imm.nll.stderr rename to src/test/ui/asm/asm-out-assign-imm.nll.stderr diff --git a/src/test/ui/asm-out-assign-imm.rs b/src/test/ui/asm/asm-out-assign-imm.rs similarity index 100% rename from src/test/ui/asm-out-assign-imm.rs rename to src/test/ui/asm/asm-out-assign-imm.rs diff --git a/src/test/ui/asm-out-assign-imm.stderr b/src/test/ui/asm/asm-out-assign-imm.stderr similarity index 100% rename from src/test/ui/asm-out-assign-imm.stderr rename to src/test/ui/asm/asm-out-assign-imm.stderr diff --git a/src/test/compile-fail/asm-out-no-modifier.rs b/src/test/ui/asm/asm-out-no-modifier.rs similarity index 100% rename from src/test/compile-fail/asm-out-no-modifier.rs rename to src/test/ui/asm/asm-out-no-modifier.rs diff --git a/src/test/ui/asm/asm-out-no-modifier.stderr b/src/test/ui/asm/asm-out-no-modifier.stderr new file mode 100644 index 0000000000000..4e9d7b884b3b7 --- /dev/null +++ b/src/test/ui/asm/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/asm/asm-out-read-uninit.ast.stderr b/src/test/ui/asm/asm-out-read-uninit.ast.stderr new file mode 100644 index 0000000000000..5f6685e5c1c9f --- /dev/null +++ b/src/test/ui/asm/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/asm/asm-out-read-uninit.mir.stderr b/src/test/ui/asm/asm-out-read-uninit.mir.stderr new file mode 100644 index 0000000000000..5f6685e5c1c9f --- /dev/null +++ b/src/test/ui/asm/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/asm/asm-out-read-uninit.rs similarity index 100% rename from src/test/compile-fail/asm-out-read-uninit.rs rename to src/test/ui/asm/asm-out-read-uninit.rs diff --git a/src/test/ui/assign-imm-local-twice.ast.nll.stderr b/src/test/ui/assign-imm-local-twice.ast.nll.stderr new file mode 100644 index 0000000000000..6d415eb733318 --- /dev/null +++ b/src/test/ui/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/assign-imm-local-twice.ast.stderr b/src/test/ui/assign-imm-local-twice.ast.stderr new file mode 100644 index 0000000000000..32752621e149f --- /dev/null +++ b/src/test/ui/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/assign-imm-local-twice.mir.stderr b/src/test/ui/assign-imm-local-twice.mir.stderr new file mode 100644 index 0000000000000..6d415eb733318 --- /dev/null +++ b/src/test/ui/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/assign-imm-local-twice.rs similarity index 100% rename from src/test/compile-fail/assign-imm-local-twice.rs rename to src/test/ui/assign-imm-local-twice.rs diff --git a/src/test/compile-fail/assign-to-method.rs b/src/test/ui/assign-to-method.rs similarity index 100% rename from src/test/compile-fail/assign-to-method.rs rename to src/test/ui/assign-to-method.rs diff --git a/src/test/ui/assign-to-method.stderr b/src/test/ui/assign-to-method.stderr new file mode 100644 index 0000000000000..930b4512572c2 --- /dev/null +++ b/src/test/ui/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/assignment-operator-unimplemented.rs similarity index 100% rename from src/test/compile-fail/assignment-operator-unimplemented.rs rename to src/test/ui/assignment-operator-unimplemented.rs diff --git a/src/test/ui/assignment-operator-unimplemented.stderr b/src/test/ui/assignment-operator-unimplemented.stderr new file mode 100644 index 0000000000000..983d698c63ebe --- /dev/null +++ b/src/test/ui/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/assoc-inherent.rs similarity index 100% rename from src/test/compile-fail/assoc-inherent.rs rename to src/test/ui/assoc-inherent.rs diff --git a/src/test/ui/assoc-inherent.stderr b/src/test/ui/assoc-inherent.stderr new file mode 100644 index 0000000000000..11497cba0ffaa --- /dev/null +++ b/src/test/ui/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/associated-const/associated-const-ambiguity-report.rs similarity index 100% rename from src/test/compile-fail/associated-const-ambiguity-report.rs rename to src/test/ui/associated-const/associated-const-ambiguity-report.rs diff --git a/src/test/ui/associated-const/associated-const-ambiguity-report.stderr b/src/test/ui/associated-const/associated-const-ambiguity-report.stderr new file mode 100644 index 0000000000000..0832b1a2605b0 --- /dev/null +++ b/src/test/ui/associated-const/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 = ::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/associated-const/associated-const-array-len.rs similarity index 100% rename from src/test/compile-fail/associated-const-array-len.rs rename to src/test/ui/associated-const/associated-const-array-len.rs diff --git a/src/test/ui/associated-const/associated-const-array-len.stderr b/src/test/ui/associated-const/associated-const-array-len.stderr new file mode 100644 index 0000000000000..5504af8fecd2c --- /dev/null +++ b/src/test/ui/associated-const/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; ::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/associated-const/associated-const-dead-code.rs similarity index 100% rename from src/test/compile-fail/associated-const-dead-code.rs rename to src/test/ui/associated-const/associated-const-dead-code.rs diff --git a/src/test/ui/associated-const/associated-const-dead-code.stderr b/src/test/ui/associated-const/associated-const-dead-code.stderr new file mode 100644 index 0000000000000..ee0658121838a --- /dev/null +++ b/src/test/ui/associated-const/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/associated-const/associated-const-generic-obligations.rs similarity index 100% rename from src/test/compile-fail/associated-const-generic-obligations.rs rename to src/test/ui/associated-const/associated-const-generic-obligations.rs diff --git a/src/test/ui/associated-const/associated-const-generic-obligations.stderr b/src/test/ui/associated-const/associated-const-generic-obligations.stderr new file mode 100644 index 0000000000000..97986a27c6415 --- /dev/null +++ b/src/test/ui/associated-const/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/ui/associated-const-impl-wrong-lifetime.rs b/src/test/ui/associated-const/associated-const-impl-wrong-lifetime.rs similarity index 100% rename from src/test/ui/associated-const-impl-wrong-lifetime.rs rename to src/test/ui/associated-const/associated-const-impl-wrong-lifetime.rs diff --git a/src/test/ui/associated-const-impl-wrong-lifetime.stderr b/src/test/ui/associated-const/associated-const-impl-wrong-lifetime.stderr similarity index 100% rename from src/test/ui/associated-const-impl-wrong-lifetime.stderr rename to src/test/ui/associated-const/associated-const-impl-wrong-lifetime.stderr diff --git a/src/test/ui/associated-const-impl-wrong-type.rs b/src/test/ui/associated-const/associated-const-impl-wrong-type.rs similarity index 100% rename from src/test/ui/associated-const-impl-wrong-type.rs rename to src/test/ui/associated-const/associated-const-impl-wrong-type.rs diff --git a/src/test/ui/associated-const-impl-wrong-type.stderr b/src/test/ui/associated-const/associated-const-impl-wrong-type.stderr similarity index 100% rename from src/test/ui/associated-const-impl-wrong-type.stderr rename to src/test/ui/associated-const/associated-const-impl-wrong-type.stderr diff --git a/src/test/compile-fail/associated-const-in-trait.rs b/src/test/ui/associated-const/associated-const-in-trait.rs similarity index 100% rename from src/test/compile-fail/associated-const-in-trait.rs rename to src/test/ui/associated-const/associated-const-in-trait.rs diff --git a/src/test/ui/associated-const/associated-const-in-trait.stderr b/src/test/ui/associated-const/associated-const-in-trait.stderr new file mode 100644 index 0000000000000..7804e44f2d722 --- /dev/null +++ b/src/test/ui/associated-const/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/associated-const/associated-const-no-item.rs similarity index 100% rename from src/test/compile-fail/associated-const-no-item.rs rename to src/test/ui/associated-const/associated-const-no-item.rs diff --git a/src/test/ui/associated-const/associated-const-no-item.stderr b/src/test/ui/associated-const/associated-const-no-item.stderr new file mode 100644 index 0000000000000..a09c04ea0b2fd --- /dev/null +++ b/src/test/ui/associated-const/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 = ::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/associated-const/associated-const-private-impl.rs similarity index 100% rename from src/test/compile-fail/associated-const-private-impl.rs rename to src/test/ui/associated-const/associated-const-private-impl.rs diff --git a/src/test/ui/associated-const/associated-const-private-impl.stderr b/src/test/ui/associated-const/associated-const-private-impl.stderr new file mode 100644 index 0000000000000..65be3753bacce --- /dev/null +++ b/src/test/ui/associated-const/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/associated-const/associated-const-type-parameter-arms.rs similarity index 100% rename from src/test/compile-fail/associated-const-type-parameter-arms.rs rename to src/test/ui/associated-const/associated-const-type-parameter-arms.rs diff --git a/src/test/ui/associated-const/associated-const-type-parameter-arms.stderr b/src/test/ui/associated-const/associated-const-type-parameter-arms.stderr new file mode 100644 index 0000000000000..a88dd4d995503 --- /dev/null +++ b/src/test/ui/associated-const/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/associated-const/associated-const-type-parameter-arrays-2.rs similarity index 100% rename from src/test/compile-fail/associated-const-type-parameter-arrays-2.rs rename to src/test/ui/associated-const/associated-const-type-parameter-arrays-2.rs diff --git a/src/test/ui/associated-const/associated-const-type-parameter-arrays-2.stderr b/src/test/ui/associated-const/associated-const-type-parameter-arrays-2.stderr new file mode 100644 index 0000000000000..a440f1f82f1b5 --- /dev/null +++ b/src/test/ui/associated-const/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; ::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/associated-const/associated-const-type-parameter-arrays.rs similarity index 100% rename from src/test/compile-fail/associated-const-type-parameter-arrays.rs rename to src/test/ui/associated-const/associated-const-type-parameter-arrays.rs diff --git a/src/test/ui/associated-const/associated-const-type-parameter-arrays.stderr b/src/test/ui/associated-const/associated-const-type-parameter-arrays.stderr new file mode 100644 index 0000000000000..4889154636002 --- /dev/null +++ b/src/test/ui/associated-const/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; ::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/associated-const/associated-const-upper-case-lint.rs similarity index 100% rename from src/test/compile-fail/associated-const-upper-case-lint.rs rename to src/test/ui/associated-const/associated-const-upper-case-lint.rs diff --git a/src/test/ui/associated-const/associated-const-upper-case-lint.stderr b/src/test/ui/associated-const/associated-const-upper-case-lint.stderr new file mode 100644 index 0000000000000..7a5cad69094f5 --- /dev/null +++ b/src/test/ui/associated-const/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/associated-item/associated-item-duplicate-names-2.rs similarity index 100% rename from src/test/compile-fail/associated-item-duplicate-names-2.rs rename to src/test/ui/associated-item/associated-item-duplicate-names-2.rs diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr new file mode 100644 index 0000000000000..3b9be8976b42e --- /dev/null +++ b/src/test/ui/associated-item/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/associated-item/associated-item-duplicate-names-3.rs similarity index 100% rename from src/test/compile-fail/associated-item-duplicate-names-3.rs rename to src/test/ui/associated-item/associated-item-duplicate-names-3.rs diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr new file mode 100644 index 0000000000000..3edf59f2010f1 --- /dev/null +++ b/src/test/ui/associated-item/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/associated-item/associated-item-duplicate-names.rs similarity index 100% rename from src/test/compile-fail/associated-item-duplicate-names.rs rename to src/test/ui/associated-item/associated-item-duplicate-names.rs diff --git a/src/test/ui/associated-item/associated-item-duplicate-names.stderr b/src/test/ui/associated-item/associated-item-duplicate-names.stderr new file mode 100644 index 0000000000000..4b060a991f9d7 --- /dev/null +++ b/src/test/ui/associated-item/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/associated-path-shl.rs similarity index 100% rename from src/test/compile-fail/associated-path-shl.rs rename to src/test/ui/associated-path-shl.rs diff --git a/src/test/ui/associated-path-shl.stderr b/src/test/ui/associated-path-shl.stderr new file mode 100644 index 0000000000000..fa41d4abff482 --- /dev/null +++ b/src/test/ui/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 _: <::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 _ = <::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 <::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 ..= <::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 | <::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 ..= <::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/associated-type/associated-type-projection-ambig-between-bound-and-where-clause.rs similarity index 100% rename from src/test/compile-fail/associated-type-projection-ambig-between-bound-and-where-clause.rs rename to src/test/ui/associated-type/associated-type-projection-ambig-between-bound-and-where-clause.rs diff --git a/src/test/ui/associated-type/associated-type-projection-ambig-between-bound-and-where-clause.stderr b/src/test/ui/associated-type/associated-type-projection-ambig-between-bound-and-where-clause.stderr new file mode 100644 index 0000000000000..2706dda1c5209 --- /dev/null +++ b/src/test/ui/associated-type/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::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::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::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/ui/associated-type-projection-from-multiple-supertraits.rs b/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.rs similarity index 100% rename from src/test/ui/associated-type-projection-from-multiple-supertraits.rs rename to src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.rs diff --git a/src/test/ui/associated-type-projection-from-multiple-supertraits.stderr b/src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr similarity index 100% rename from src/test/ui/associated-type-projection-from-multiple-supertraits.stderr rename to src/test/ui/associated-type/associated-type-projection-from-multiple-supertraits.stderr diff --git a/src/test/compile-fail/associated-type-projection-from-supertrait.rs b/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs similarity index 100% rename from src/test/compile-fail/associated-type-projection-from-supertrait.rs rename to src/test/ui/associated-type/associated-type-projection-from-supertrait.rs diff --git a/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr b/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr new file mode 100644 index 0000000000000..4bc09b624c8a1 --- /dev/null +++ b/src/test/ui/associated-type/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/ui/associated-types-ICE-when-projecting-out-of-err.rs b/src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs similarity index 100% rename from src/test/ui/associated-types-ICE-when-projecting-out-of-err.rs rename to src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.rs diff --git a/src/test/ui/associated-types-ICE-when-projecting-out-of-err.stderr b/src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.stderr similarity index 100% rename from src/test/ui/associated-types-ICE-when-projecting-out-of-err.stderr rename to src/test/ui/associated-types/associated-types-ICE-when-projecting-out-of-err.stderr diff --git a/src/test/compile-fail/associated-types-binding-to-type-defined-in-supertrait.rs b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.rs similarity index 100% rename from src/test/compile-fail/associated-types-binding-to-type-defined-in-supertrait.rs rename to src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.rs diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr new file mode 100644 index 0000000000000..c43ff1ae4cbee --- /dev/null +++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr @@ -0,0 +1,31 @@ +error[E0271]: type mismatch resolving `::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: C) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0271]: type mismatch resolving `::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: 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/associated-types/associated-types-bound-failure.rs similarity index 100% rename from src/test/compile-fail/associated-types-bound-failure.rs rename to src/test/ui/associated-types/associated-types-bound-failure.rs diff --git a/src/test/ui/associated-types/associated-types-bound-failure.stderr b/src/test/ui/associated-types/associated-types-bound-failure.stderr new file mode 100644 index 0000000000000..067dfeb454ce8 --- /dev/null +++ b/src/test/ui/associated-types/associated-types-bound-failure.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `::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 `::R` + | + = help: consider adding a `where ::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/associated-types/associated-types-coherence-failure.rs similarity index 100% rename from src/test/compile-fail/associated-types-coherence-failure.rs rename to src/test/ui/associated-types/associated-types-coherence-failure.rs diff --git a/src/test/ui/associated-types/associated-types-coherence-failure.stderr b/src/test/ui/associated-types/associated-types-coherence-failure.stderr new file mode 100644 index 0000000000000..85d4bf784587e --- /dev/null +++ b/src/test/ui/associated-types/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 ::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 ::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/associated-types/associated-types-eq-1.rs similarity index 100% rename from src/test/compile-fail/associated-types-eq-1.rs rename to src/test/ui/associated-types/associated-types-eq-1.rs diff --git a/src/test/ui/associated-types/associated-types-eq-1.stderr b/src/test/ui/associated-types/associated-types-eq-1.stderr new file mode 100644 index 0000000000000..81bb2ae4ce22f --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-eq-2.rs similarity index 100% rename from src/test/compile-fail/associated-types-eq-2.rs rename to src/test/ui/associated-types/associated-types-eq-2.rs diff --git a/src/test/ui/associated-types/associated-types-eq-2.stderr b/src/test/ui/associated-types/associated-types-eq-2.stderr new file mode 100644 index 0000000000000..0b80f3472dcc9 --- /dev/null +++ b/src/test/ui/associated-types/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(x: &>::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/associated-types/associated-types-eq-3.rs similarity index 100% rename from src/test/compile-fail/associated-types-eq-3.rs rename to src/test/ui/associated-types/associated-types-eq-3.rs diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr new file mode 100644 index 0000000000000..d8b2be0e1b00d --- /dev/null +++ b/src/test/ui/associated-types/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 `::A` + +error[E0271]: type mismatch resolving `::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>(x: I) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0271]: type mismatch resolving `::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` + +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/associated-types/associated-types-eq-expr-path.rs similarity index 100% rename from src/test/compile-fail/associated-types-eq-expr-path.rs rename to src/test/ui/associated-types/associated-types-eq-expr-path.rs diff --git a/src/test/ui/associated-types/associated-types-eq-expr-path.stderr b/src/test/ui/associated-types/associated-types-eq-expr-path.stderr new file mode 100644 index 0000000000000..36c31cd3f0560 --- /dev/null +++ b/src/test/ui/associated-types/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::::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/associated-types/associated-types-eq-hr.rs similarity index 100% rename from src/test/compile-fail/associated-types-eq-hr.rs rename to src/test/ui/associated-types/associated-types-eq-hr.rs diff --git a/src/test/ui/associated-types/associated-types-eq-hr.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr new file mode 100644 index 0000000000000..5081a2649d1a2 --- /dev/null +++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr @@ -0,0 +1,126 @@ +error[E0271]: type mismatch resolving `for<'x> >::A == &'x isize` + --> $DIR/associated-types-eq-hr.rs:92:5 + | +LL | foo::(); //~ 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() +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> >::A == &'x usize` + --> $DIR/associated-types-eq-hr.rs:94:5 + | +LL | bar::(); //~ 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() +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::(); + | ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` + | + = help: the following implementations were found: + > +note: required by `tuple_one` + --> $DIR/associated-types-eq-hr.rs:66:1 + | +LL | / fn tuple_one() +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> >::A == &'x isize` + --> $DIR/associated-types-eq-hr.rs:97:5 + | +LL | tuple_one::(); + | ^^^^^^^^^^^^^^^^^^ 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() +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::(); + | ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` + | + = help: the following implementations were found: + > +note: required by `tuple_two` + --> $DIR/associated-types-eq-hr.rs:72:1 + | +LL | / fn tuple_two() +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> >::A == &'y isize` + --> $DIR/associated-types-eq-hr.rs:101:5 + | +LL | tuple_two::(); + | ^^^^^^^^^^^^^^^^^^ 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() +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::(); + | ^^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` + | + = help: the following implementations were found: + > +note: required by `tuple_four` + --> $DIR/associated-types-eq-hr.rs:84:1 + | +LL | / fn tuple_four() +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/associated-types/associated-types-for-unimpl-trait.rs similarity index 100% rename from src/test/compile-fail/associated-types-for-unimpl-trait.rs rename to src/test/ui/associated-types/associated-types-for-unimpl-trait.rs diff --git a/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr b/src/test/ui/associated-types/associated-types-for-unimpl-trait.stderr new file mode 100644 index 0000000000000..e6c15e465b625 --- /dev/null +++ b/src/test/ui/associated-types/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(&self, foo: U, bar: ::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/ui/associated-types-in-ambiguous-context.rs b/src/test/ui/associated-types/associated-types-in-ambiguous-context.rs similarity index 100% rename from src/test/ui/associated-types-in-ambiguous-context.rs rename to src/test/ui/associated-types/associated-types-in-ambiguous-context.rs diff --git a/src/test/ui/associated-types-in-ambiguous-context.stderr b/src/test/ui/associated-types/associated-types-in-ambiguous-context.stderr similarity index 100% rename from src/test/ui/associated-types-in-ambiguous-context.stderr rename to src/test/ui/associated-types/associated-types-in-ambiguous-context.stderr diff --git a/src/test/compile-fail/associated-types-incomplete-object.rs b/src/test/ui/associated-types/associated-types-incomplete-object.rs similarity index 100% rename from src/test/compile-fail/associated-types-incomplete-object.rs rename to src/test/ui/associated-types/associated-types-incomplete-object.rs diff --git a/src/test/ui/associated-types/associated-types-incomplete-object.stderr b/src/test/ui/associated-types/associated-types-incomplete-object.stderr new file mode 100644 index 0000000000000..95b1c63125005 --- /dev/null +++ b/src/test/ui/associated-types/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; + | ^^^^^^^^^^^^ 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; + | ^^^^^^^^^^^ 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/associated-types/associated-types-invalid-trait-ref-issue-18865.rs similarity index 100% rename from src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs rename to src/test/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.rs diff --git a/src/test/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.stderr b/src/test/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.stderr new file mode 100644 index 0000000000000..40cba5e68340f --- /dev/null +++ b/src/test/ui/associated-types/associated-types-invalid-trait-ref-issue-18865.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `T: Foo` is not satisfied + --> $DIR/associated-types-invalid-trait-ref-issue-18865.rs:20:12 + | +LL | let u: >::Bar = t.get_bar(); + | ^^^^^^^^^^^^^^^^^^^^^^ 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-types-issue-17359.rs b/src/test/ui/associated-types/associated-types-issue-17359.rs similarity index 100% rename from src/test/compile-fail/associated-types-issue-17359.rs rename to src/test/ui/associated-types/associated-types-issue-17359.rs diff --git a/src/test/ui/associated-types/associated-types-issue-17359.stderr b/src/test/ui/associated-types/associated-types-issue-17359.stderr new file mode 100644 index 0000000000000..8ba8194bdedf0 --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-issue-20346.rs similarity index 100% rename from src/test/compile-fail/associated-types-issue-20346.rs rename to src/test/ui/associated-types/associated-types-issue-20346.rs diff --git a/src/test/ui/associated-types/associated-types-issue-20346.stderr b/src/test/ui/associated-types/associated-types-issue-20346.stderr new file mode 100644 index 0000000000000..6f3dfbe0898ec --- /dev/null +++ b/src/test/ui/associated-types/associated-types-issue-20346.stderr @@ -0,0 +1,17 @@ +error[E0271]: type mismatch resolving ` as Iterator>::Item == std::option::Option` + --> $DIR/associated-types-issue-20346.rs:44:5 + | +LL | is_iterator_of::, _>(&adapter); //~ ERROR type mismatch + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter, found enum `std::option::Option` + | + = note: expected type `T` + found type `std::option::Option` +note: required by `is_iterator_of` + --> $DIR/associated-types-issue-20346.rs:25:1 + | +LL | fn is_iterator_of>(_: &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/associated-types/associated-types-multiple-types-one-trait.rs similarity index 100% rename from src/test/compile-fail/associated-types-multiple-types-one-trait.rs rename to src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs diff --git a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr new file mode 100644 index 0000000000000..c38a5f6e7f455 --- /dev/null +++ b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr @@ -0,0 +1,31 @@ +error[E0271]: type mismatch resolving `::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 `::Y` + found type `i32` +note: required by `want_y` + --> $DIR/associated-types-multiple-types-one-trait.rs:54:1 + | +LL | fn want_y>(t: &T) { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0271]: type mismatch resolving `::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 `::X` + found type `u32` +note: required by `want_x` + --> $DIR/associated-types-multiple-types-one-trait.rs:52:1 + | +LL | fn want_x>(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/associated-types/associated-types-no-suitable-bound.rs similarity index 100% rename from src/test/compile-fail/associated-types-no-suitable-bound.rs rename to src/test/ui/associated-types/associated-types-no-suitable-bound.rs diff --git a/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr b/src/test/ui/associated-types/associated-types-no-suitable-bound.stderr new file mode 100644 index 0000000000000..84802d49caa4e --- /dev/null +++ b/src/test/ui/associated-types/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(foo: ::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/associated-types/associated-types-no-suitable-supertrait-2.rs similarity index 100% rename from src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs rename to src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.rs diff --git a/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr b/src/test/ui/associated-types/associated-types-no-suitable-supertrait-2.stderr new file mode 100644 index 0000000000000..712b95f8e547f --- /dev/null +++ b/src/test/ui/associated-types/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(&self, foo: U, bar: ::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/associated-types/associated-types-no-suitable-supertrait.rs similarity index 100% rename from src/test/compile-fail/associated-types-no-suitable-supertrait.rs rename to src/test/ui/associated-types/associated-types-no-suitable-supertrait.rs diff --git a/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr b/src/test/ui/associated-types/associated-types-no-suitable-supertrait.stderr new file mode 100644 index 0000000000000..6927146ffbc44 --- /dev/null +++ b/src/test/ui/associated-types/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(&self, foo: U, bar: ::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(&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/associated-types/associated-types-outlives.nll.stderr b/src/test/ui/associated-types/associated-types-outlives.nll.stderr new file mode 100644 index 0000000000000..384ed8f32847b --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-outlives.rs similarity index 100% rename from src/test/compile-fail/associated-types-outlives.rs rename to src/test/ui/associated-types/associated-types-outlives.rs diff --git a/src/test/ui/associated-types/associated-types-outlives.stderr b/src/test/ui/associated-types/associated-types-outlives.stderr new file mode 100644 index 0000000000000..6d46392d94bb4 --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-overridden-default.rs similarity index 100% rename from src/test/compile-fail/associated-types-overridden-default.rs rename to src/test/ui/associated-types/associated-types-overridden-default.rs diff --git a/src/test/ui/associated-types/associated-types-overridden-default.stderr b/src/test/ui/associated-types/associated-types-overridden-default.stderr new file mode 100644 index 0000000000000..e9a480be0678d --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-path-1.rs similarity index 100% rename from src/test/compile-fail/associated-types-path-1.rs rename to src/test/ui/associated-types/associated-types-path-1.rs diff --git a/src/test/ui/associated-types/associated-types-path-1.stderr b/src/test/ui/associated-types/associated-types-path-1.stderr new file mode 100644 index 0000000000000..04147922d9cf1 --- /dev/null +++ b/src/test/ui/associated-types/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(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(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/associated-types/associated-types-path-2.rs similarity index 100% rename from src/test/compile-fail/associated-types-path-2.rs rename to src/test/ui/associated-types/associated-types-path-2.rs diff --git a/src/test/ui/associated-types/associated-types-path-2.stderr b/src/test/ui/associated-types/associated-types-path-2.stderr new file mode 100644 index 0000000000000..403b4fd4d8ead --- /dev/null +++ b/src/test/ui/associated-types/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(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(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/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.nll.stderr new file mode 100644 index 0000000000000..5b8223ff29258 --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-project-from-hrtb-in-fn-body.rs similarity index 100% rename from src/test/compile-fail/associated-types-project-from-hrtb-in-fn-body.rs rename to src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.rs diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn-body.stderr new file mode 100644 index 0000000000000..12bbfb24910cb --- /dev/null +++ b/src/test/ui/associated-types/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: >::A, + | --------- these two types are declared with different lifetimes... +LL | y: >::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/associated-types/associated-types-project-from-hrtb-in-fn.rs similarity index 100% rename from src/test/compile-fail/associated-types-project-from-hrtb-in-fn.rs rename to src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn.rs diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-fn.stderr new file mode 100644 index 0000000000000..399f4d9409a7a --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-project-from-hrtb-in-struct.rs similarity index 100% rename from src/test/compile-fail/associated-types-project-from-hrtb-in-struct.rs rename to src/test/ui/associated-types/associated-types-project-from-hrtb-in-struct.rs diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-struct.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-struct.stderr new file mode 100644 index 0000000000000..05c0c38c79f33 --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-project-from-hrtb-in-trait-method.rs similarity index 100% rename from src/test/compile-fail/associated-types-project-from-hrtb-in-trait-method.rs rename to src/test/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.rs diff --git a/src/test/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr b/src/test/ui/associated-types/associated-types-project-from-hrtb-in-trait-method.stderr new file mode 100644 index 0000000000000..ccd568b62533d --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.rs similarity index 100% rename from src/test/compile-fail/associated-types-projection-to-unrelated-trait-in-method-without-default.rs rename to src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.rs diff --git a/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr b/src/test/ui/associated-types/associated-types-projection-to-unrelated-trait-in-method-without-default.stderr new file mode 100644 index 0000000000000..e7e68dcf852dc --- /dev/null +++ b/src/test/ui/associated-types/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(&self, foo: U, bar: ::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/associated-types/associated-types-subtyping-1.rs similarity index 86% rename from src/test/compile-fail/associated-types-subtyping-1.rs rename to src/test/ui/associated-types/associated-types-subtyping-1.rs index 64dcdd39e7c2c..c3acffff240b5 100644 --- a/src/test/compile-fail/associated-types-subtyping-1.rs +++ b/src/test/ui/associated-types/associated-types-subtyping-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![allow(unused_variables)] trait Trait<'a> { @@ -22,7 +24,7 @@ fn method1<'a,'b,T>(x: &'a T, y: &'b T) // Note that &'static T <: &'a T. let a: >::Type = loop { }; let b: >::Type = loop { }; - let _: >::Type = a; + let _c: >::Type = a; } fn method2<'a,'b,T>(x: &'a T, y: &'b T) @@ -31,7 +33,7 @@ fn method2<'a,'b,T>(x: &'a T, y: &'b T) // Note that &'static T <: &'a T. let a: >::Type = loop { }; let b: >::Type = loop { }; - let _: >::Type = a; //~ ERROR E0623 + let _c: >::Type = a; //~ ERROR E0623 } fn method3<'a,'b,T>(x: &'a T, y: &'b T) @@ -40,7 +42,7 @@ fn method3<'a,'b,T>(x: &'a T, y: &'b T) // Note that &'static T <: &'a T. let a: >::Type = loop { }; let b: >::Type = loop { }; - let _: >::Type = b; //~ ERROR E0623 + let _c: >::Type = b; //~ ERROR E0623 } fn method4<'a,'b,T>(x: &'a T, y: &'b T) @@ -49,7 +51,7 @@ fn method4<'a,'b,T>(x: &'a T, y: &'b T) // Note that &'static T <: &'a T. let a: >::Type = loop { }; let b: >::Type = loop { }; - let _: >::Type = b; + let _c: >::Type = b; } fn main() { } diff --git a/src/test/ui/associated-types/associated-types-subtyping-1.stderr b/src/test/ui/associated-types/associated-types-subtyping-1.stderr new file mode 100644 index 0000000000000..3cc7b07a20c59 --- /dev/null +++ b/src/test/ui/associated-types/associated-types-subtyping-1.stderr @@ -0,0 +1,21 @@ +error[E0623]: lifetime mismatch + --> $DIR/associated-types-subtyping-1.rs:36:38 + | +LL | fn method2<'a,'b,T>(x: &'a T, y: &'b T) + | ----- ----- these two types are declared with different lifetimes... +... +LL | let _c: >::Type = a; //~ ERROR E0623 + | ^ ...but data from `y` flows into `x` here + +error[E0623]: lifetime mismatch + --> $DIR/associated-types-subtyping-1.rs:45:38 + | +LL | fn method3<'a,'b,T>(x: &'a T, y: &'b T) + | ----- ----- these two types are declared with different lifetimes... +... +LL | let _c: >::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/associated-types/associated-types-unconstrained.rs similarity index 100% rename from src/test/compile-fail/associated-types-unconstrained.rs rename to src/test/ui/associated-types/associated-types-unconstrained.rs diff --git a/src/test/ui/associated-types/associated-types-unconstrained.stderr b/src/test/ui/associated-types/associated-types-unconstrained.stderr new file mode 100644 index 0000000000000..abb220c96c6c6 --- /dev/null +++ b/src/test/ui/associated-types/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/associated-types/associated-types-unsized.rs similarity index 100% rename from src/test/compile-fail/associated-types-unsized.rs rename to src/test/ui/associated-types/associated-types-unsized.rs diff --git a/src/test/ui/associated-types/associated-types-unsized.stderr b/src/test/ui/associated-types/associated-types-unsized.stderr new file mode 100644 index 0000000000000..0b338c9ad45c5 --- /dev/null +++ b/src/test/ui/associated-types/associated-types-unsized.stderr @@ -0,0 +1,14 @@ +error[E0277]: the size for values of type `::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 `::Value` + = note: to learn more, visit + = help: consider adding a `where ::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/associated-types/bound-lifetime-constrained.clause.stderr b/src/test/ui/associated-types/bound-lifetime-constrained.clause.stderr new file mode 100644 index 0000000000000..23a67b5b064b6 --- /dev/null +++ b/src/test/ui/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() 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() 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/associated-types/bound-lifetime-constrained.func.stderr b/src/test/ui/associated-types/bound-lifetime-constrained.func.stderr new file mode 100644 index 0000000000000..c969baeaefeb7 --- /dev/null +++ b/src/test/ui/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/associated-types/bound-lifetime-constrained.object.stderr b/src/test/ui/associated-types/bound-lifetime-constrained.object.stderr new file mode 100644 index 0000000000000..f24fed0f02ea2 --- /dev/null +++ b/src/test/ui/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 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 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/associated-types/bound-lifetime-constrained.rs similarity index 100% rename from src/test/compile-fail/associated-types/bound-lifetime-constrained.rs rename to src/test/ui/associated-types/bound-lifetime-constrained.rs diff --git a/src/test/ui/associated-types/bound-lifetime-in-binding-only.angle.stderr b/src/test/ui/associated-types/bound-lifetime-in-binding-only.angle.stderr new file mode 100644 index 0000000000000..5df8a828012c7 --- /dev/null +++ b/src/test/ui/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 Foo>() { + | ^^^^^^^^^^^^ + +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() where T: for<'a> Foo { + | ^^^^^^^^^^^^ + +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() where for<'a> T: Foo { + | ^^^^^^^^^^^^ + +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) { + | ^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0582`. diff --git a/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr b/src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr new file mode 100644 index 0000000000000..0a12aa76a785b --- /dev/null +++ b/src/test/ui/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 &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/associated-types/bound-lifetime-in-binding-only.ok.stderr b/src/test/ui/associated-types/bound-lifetime-in-binding-only.ok.stderr new file mode 100644 index 0000000000000..53594cb83fc67 --- /dev/null +++ b/src/test/ui/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/associated-types/bound-lifetime-in-binding-only.paren.stderr b/src/test/ui/associated-types/bound-lifetime-in-binding-only.paren.stderr new file mode 100644 index 0000000000000..39a5366080b68 --- /dev/null +++ b/src/test/ui/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 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() 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() 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/associated-types/bound-lifetime-in-binding-only.rs similarity index 100% rename from src/test/compile-fail/associated-types/bound-lifetime-in-binding-only.rs rename to src/test/ui/associated-types/bound-lifetime-in-binding-only.rs diff --git a/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr b/src/test/ui/associated-types/bound-lifetime-in-return-only.elision.stderr new file mode 100644 index 0000000000000..8fefdfd4d19ef --- /dev/null +++ b/src/test/ui/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/associated-types/bound-lifetime-in-return-only.local.stderr b/src/test/ui/associated-types/bound-lifetime-in-return-only.local.stderr new file mode 100644 index 0000000000000..ce2cfa6765d17 --- /dev/null +++ b/src/test/ui/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/associated-types/bound-lifetime-in-return-only.ok.stderr b/src/test/ui/associated-types/bound-lifetime-in-return-only.ok.stderr new file mode 100644 index 0000000000000..21bef7e5e52c7 --- /dev/null +++ b/src/test/ui/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/associated-types/bound-lifetime-in-return-only.rs similarity index 100% rename from src/test/compile-fail/associated-types/bound-lifetime-in-return-only.rs rename to src/test/ui/associated-types/bound-lifetime-in-return-only.rs diff --git a/src/test/ui/associated-types/bound-lifetime-in-return-only.sig.stderr b/src/test/ui/associated-types/bound-lifetime-in-return-only.sig.stderr new file mode 100644 index 0000000000000..26a1585463a13 --- /dev/null +++ b/src/test/ui/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/associated-types/bound-lifetime-in-return-only.structure.stderr b/src/test/ui/associated-types/bound-lifetime-in-return-only.structure.stderr new file mode 100644 index 0000000000000..db52e4de69bce --- /dev/null +++ b/src/test/ui/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/associated-types/cache/chrono-scan.rs similarity index 100% rename from src/test/compile-fail/associated-types/cache/chrono-scan.rs rename to src/test/ui/associated-types/cache/chrono-scan.rs diff --git a/src/test/ui/associated-types/cache/chrono-scan.stderr b/src/test/ui/associated-types/cache/chrono-scan.stderr new file mode 100644 index 0000000000000..99281e745656d --- /dev/null +++ b/src/test/ui/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/associated-types/cache/elision.rs similarity index 100% rename from src/test/compile-fail/associated-types/cache/elision.rs rename to src/test/ui/associated-types/cache/elision.rs diff --git a/src/test/ui/associated-types/cache/elision.stderr b/src/test/ui/associated-types/cache/elision.stderr new file mode 100644 index 0000000000000..c5314b58002c0 --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.nll.stderr new file mode 100644 index 0000000000000..89a7bb00f74e1 --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.krisskross.stderr new file mode 100644 index 0000000000000..6cecf68ffffe1 --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-contravariant.ok.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.ok.stderr new file mode 100644 index 0000000000000..c92aa37a60fb7 --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-contravariant.oneuse.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.oneuse.stderr new file mode 100644 index 0000000000000..c92aa37a60fb7 --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-contravariant.rs similarity index 100% rename from src/test/compile-fail/associated-types/cache/project-fn-ret-contravariant.rs rename to src/test/ui/associated-types/cache/project-fn-ret-contravariant.rs diff --git a/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.nll.stderr new file mode 100644 index 0000000000000..793209b7cbcef --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-contravariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-contravariant.transmute.stderr new file mode 100644 index 0000000000000..9d42c8e3c6388 --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.nll.stderr new file mode 100644 index 0000000000000..dedce3121569c --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-invariant.krisskross.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.krisskross.stderr new file mode 100644 index 0000000000000..e867ac4baac6a --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-invariant.ok.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.ok.stderr new file mode 100644 index 0000000000000..e3e620ea3a03e --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.nll.stderr new file mode 100644 index 0000000000000..a669c7ac73bc5 --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-invariant.oneuse.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.oneuse.stderr new file mode 100644 index 0000000000000..7c86e20fe64d6 --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-invariant.rs similarity index 100% rename from src/test/compile-fail/associated-types/cache/project-fn-ret-invariant.rs rename to src/test/ui/associated-types/cache/project-fn-ret-invariant.rs diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.nll.stderr new file mode 100644 index 0000000000000..ed3f2a07aa2e7 --- /dev/null +++ b/src/test/ui/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/associated-types/cache/project-fn-ret-invariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr new file mode 100644 index 0000000000000..6432ab9e57d73 --- /dev/null +++ b/src/test/ui/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/associated-types/higher-ranked-projection.bad.stderr b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr new file mode 100644 index 0000000000000..1351d14fe0087 --- /dev/null +++ b/src/test/ui/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(_t: T) +LL | | where for<'a> &'a T: Mirror +LL | | {} + | |__^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0271`. diff --git a/src/test/ui/associated-types/higher-ranked-projection.good.stderr b/src/test/ui/associated-types/higher-ranked-projection.good.stderr new file mode 100644 index 0000000000000..861827f329bea --- /dev/null +++ b/src/test/ui/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/associated-types/higher-ranked-projection.rs similarity index 100% rename from src/test/compile-fail/associated-types/higher-ranked-projection.rs rename to src/test/ui/associated-types/higher-ranked-projection.rs diff --git a/src/test/compile-fail/associated-types/issue-36499.rs b/src/test/ui/associated-types/issue-36499.rs similarity index 100% rename from src/test/compile-fail/associated-types/issue-36499.rs rename to src/test/ui/associated-types/issue-36499.rs diff --git a/src/test/ui/associated-types/issue-36499.stderr b/src/test/ui/associated-types/issue-36499.stderr new file mode 100644 index 0000000000000..5167c47a6cfcd --- /dev/null +++ b/src/test/ui/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/attempted-access-non-fatal.rs similarity index 100% rename from src/test/compile-fail/attempted-access-non-fatal.rs rename to src/test/ui/attempted-access-non-fatal.rs diff --git a/src/test/ui/attempted-access-non-fatal.stderr b/src/test/ui/attempted-access-non-fatal.stderr new file mode 100644 index 0000000000000..d056a3eff6fc7 --- /dev/null +++ b/src/test/ui/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/attr-bad-crate-attr.rc similarity index 100% rename from src/test/compile-fail/attr-bad-crate-attr.rc rename to src/test/ui/attr-bad-crate-attr.rc diff --git a/src/test/compile-fail/attr-usage-inline.rs b/src/test/ui/attr-usage-inline.rs similarity index 100% rename from src/test/compile-fail/attr-usage-inline.rs rename to src/test/ui/attr-usage-inline.rs diff --git a/src/test/ui/attr-usage-inline.stderr b/src/test/ui/attr-usage-inline.stderr new file mode 100644 index 0000000000000..171bd949e10c6 --- /dev/null +++ b/src/test/ui/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/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.rs similarity index 100% rename from src/test/compile-fail/attrs-with-no-formal-in-generics-1.rs rename to src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.rs diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.stderr b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.stderr new file mode 100644 index 0000000000000..afab999b02e6b --- /dev/null +++ b/src/test/ui/attrs-with-no-formal-in-generics/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/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.rs similarity index 100% rename from src/test/compile-fail/attrs-with-no-formal-in-generics-2.rs rename to src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.rs diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.stderr b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.stderr new file mode 100644 index 0000000000000..8bff45ea9890a --- /dev/null +++ b/src/test/ui/attrs-with-no-formal-in-generics/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/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs similarity index 100% rename from src/test/compile-fail/attrs-with-no-formal-in-generics-3.rs rename to src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr b/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr new file mode 100644 index 0000000000000..351c788f84fd1 --- /dev/null +++ b/src/test/ui/attrs-with-no-formal-in-generics/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/auto-ref-slice-plus-ref.rs similarity index 100% rename from src/test/compile-fail/auto-ref-slice-plus-ref.rs rename to src/test/ui/auto-ref-slice-plus-ref.rs diff --git a/src/test/ui/auto-ref-slice-plus-ref.stderr b/src/test/ui/auto-ref-slice-plus-ref.stderr new file mode 100644 index 0000000000000..f62ac84a185a3 --- /dev/null +++ b/src/test/ui/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/auto-trait-validation.rs similarity index 100% rename from src/test/compile-fail/auto-trait-validation.rs rename to src/test/ui/auto-trait-validation.rs diff --git a/src/test/ui/auto-trait-validation.stderr b/src/test/ui/auto-trait-validation.stderr new file mode 100644 index 0000000000000..a6bd887021ee1 --- /dev/null +++ b/src/test/ui/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 {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +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/autoderef-full-lval.rs similarity index 100% rename from src/test/compile-fail/autoderef-full-lval.rs rename to src/test/ui/autoderef-full-lval.rs diff --git a/src/test/ui/autoderef-full-lval.stderr b/src/test/ui/autoderef-full-lval.stderr new file mode 100644 index 0000000000000..df8eeb5d171c6 --- /dev/null +++ b/src/test/ui/autoderef-full-lval.stderr @@ -0,0 +1,19 @@ +error[E0369]: binary operation `+` cannot be applied to type `std::boxed::Box` + --> $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` + +error[E0369]: binary operation `+` cannot be applied to type `std::boxed::Box` + --> $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` + +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/cdylib-dep.rs b/src/test/ui/auxiliary/cdylib-dep.rs similarity index 100% rename from src/test/compile-fail/auxiliary/cdylib-dep.rs rename to src/test/ui/auxiliary/cdylib-dep.rs diff --git a/src/test/compile-fail/auxiliary/default_ty_param_cross_crate_crate.rs b/src/test/ui/auxiliary/default_ty_param_cross_crate_crate.rs similarity index 100% rename from src/test/compile-fail/auxiliary/default_ty_param_cross_crate_crate.rs rename to src/test/ui/auxiliary/default_ty_param_cross_crate_crate.rs diff --git a/src/test/compile-fail/auxiliary/define_macro.rs b/src/test/ui/auxiliary/define_macro.rs similarity index 100% rename from src/test/compile-fail/auxiliary/define_macro.rs rename to src/test/ui/auxiliary/define_macro.rs diff --git a/src/test/compile-fail/auxiliary/extern-statics.rs b/src/test/ui/auxiliary/extern-statics.rs similarity index 100% rename from src/test/compile-fail/auxiliary/extern-statics.rs rename to src/test/ui/auxiliary/extern-statics.rs diff --git a/src/test/compile-fail/auxiliary/lto-duplicate-symbols1.rs b/src/test/ui/auxiliary/lto-duplicate-symbols1.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lto-duplicate-symbols1.rs rename to src/test/ui/auxiliary/lto-duplicate-symbols1.rs diff --git a/src/test/compile-fail/auxiliary/lto-duplicate-symbols2.rs b/src/test/ui/auxiliary/lto-duplicate-symbols2.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lto-duplicate-symbols2.rs rename to src/test/ui/auxiliary/lto-duplicate-symbols2.rs diff --git a/src/test/compile-fail/auxiliary/namespaced_enums.rs b/src/test/ui/auxiliary/namespaced_enums.rs similarity index 100% rename from src/test/compile-fail/auxiliary/namespaced_enums.rs rename to src/test/ui/auxiliary/namespaced_enums.rs diff --git a/src/test/compile-fail/auxiliary/noexporttypelib.rs b/src/test/ui/auxiliary/noexporttypelib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/noexporttypelib.rs rename to src/test/ui/auxiliary/noexporttypelib.rs diff --git a/src/test/compile-fail/auxiliary/orphan_check_diagnostics.rs b/src/test/ui/auxiliary/orphan_check_diagnostics.rs similarity index 100% rename from src/test/compile-fail/auxiliary/orphan_check_diagnostics.rs rename to src/test/ui/auxiliary/orphan_check_diagnostics.rs diff --git a/src/test/compile-fail/auxiliary/rmeta_meta.rs b/src/test/ui/auxiliary/rmeta_meta.rs similarity index 100% rename from src/test/compile-fail/auxiliary/rmeta_meta.rs rename to src/test/ui/auxiliary/rmeta_meta.rs diff --git a/src/test/compile-fail/auxiliary/rmeta_rlib.rs b/src/test/ui/auxiliary/rmeta_rlib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/rmeta_rlib.rs rename to src/test/ui/auxiliary/rmeta_rlib.rs diff --git a/src/test/compile-fail/auxiliary/stability_cfg2.rs b/src/test/ui/auxiliary/stability_cfg2.rs similarity index 100% rename from src/test/compile-fail/auxiliary/stability_cfg2.rs rename to src/test/ui/auxiliary/stability_cfg2.rs diff --git a/src/test/ui/auxiliary/weak-lang-items.rs b/src/test/ui/auxiliary/weak-lang-items.rs new file mode 100644 index 0000000000000..6434e62b6f703 --- /dev/null +++ b/src/test/ui/auxiliary/weak-lang-items.rs @@ -0,0 +1,32 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// no-prefer-dynamic + +// This aux-file will require the eh_personality function to be codegen'd, but +// it hasn't been defined just yet. Make sure we don't explode. + +#![no_std] +#![crate_type = "rlib"] + +struct A; + +impl core::ops::Drop for A { + fn drop(&mut self) {} +} + +pub fn foo() { + let _a = A; + panic!("wut"); +} + +mod std { + pub use core::{option, fmt}; +} diff --git a/src/test/compile-fail/auxiliary/xc_private_method_lib.rs b/src/test/ui/auxiliary/xc_private_method_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/xc_private_method_lib.rs rename to src/test/ui/auxiliary/xc_private_method_lib.rs diff --git a/src/test/compile-fail/bad-const-type.rs b/src/test/ui/bad/bad-const-type.rs similarity index 100% rename from src/test/compile-fail/bad-const-type.rs rename to src/test/ui/bad/bad-const-type.rs diff --git a/src/test/ui/bad/bad-const-type.stderr b/src/test/ui/bad/bad-const-type.stderr new file mode 100644 index 0000000000000..fbde1573200aa --- /dev/null +++ b/src/test/ui/bad/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/ui/bad-crate-name.rs b/src/test/ui/bad/bad-crate-name.rs similarity index 100% rename from src/test/ui/bad-crate-name.rs rename to src/test/ui/bad/bad-crate-name.rs diff --git a/src/test/ui/bad-crate-name.stderr b/src/test/ui/bad/bad-crate-name.stderr similarity index 100% rename from src/test/ui/bad-crate-name.stderr rename to src/test/ui/bad/bad-crate-name.stderr diff --git a/src/test/compile-fail/bad-env-capture.rs b/src/test/ui/bad/bad-env-capture.rs similarity index 100% rename from src/test/compile-fail/bad-env-capture.rs rename to src/test/ui/bad/bad-env-capture.rs diff --git a/src/test/ui/bad/bad-env-capture.stderr b/src/test/ui/bad/bad-env-capture.stderr new file mode 100644 index 0000000000000..bf460d2a81e9c --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-env-capture2.rs similarity index 100% rename from src/test/compile-fail/bad-env-capture2.rs rename to src/test/ui/bad/bad-env-capture2.rs diff --git a/src/test/ui/bad/bad-env-capture2.stderr b/src/test/ui/bad/bad-env-capture2.stderr new file mode 100644 index 0000000000000..8d5703d29f50c --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-env-capture3.rs similarity index 100% rename from src/test/compile-fail/bad-env-capture3.rs rename to src/test/ui/bad/bad-env-capture3.rs diff --git a/src/test/ui/bad/bad-env-capture3.stderr b/src/test/ui/bad/bad-env-capture3.stderr new file mode 100644 index 0000000000000..258f7d43b56a8 --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-expr-lhs.rs similarity index 100% rename from src/test/compile-fail/bad-expr-lhs.rs rename to src/test/ui/bad/bad-expr-lhs.rs diff --git a/src/test/ui/bad/bad-expr-lhs.stderr b/src/test/ui/bad/bad-expr-lhs.stderr new file mode 100644 index 0000000000000..5937beef9c7a2 --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-expr-path.rs similarity index 100% rename from src/test/compile-fail/bad-expr-path.rs rename to src/test/ui/bad/bad-expr-path.rs diff --git a/src/test/ui/bad/bad-expr-path.stderr b/src/test/ui/bad/bad-expr-path.stderr new file mode 100644 index 0000000000000..a1ac17c78d6a0 --- /dev/null +++ b/src/test/ui/bad/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) { //~ ERROR main function has wrong type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters + | + = note: expected type `fn()` + found type `fn(std::vec::Vec)` + +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/bad/bad-expr-path2.rs similarity index 100% rename from src/test/compile-fail/bad-expr-path2.rs rename to src/test/ui/bad/bad-expr-path2.rs diff --git a/src/test/ui/bad/bad-expr-path2.stderr b/src/test/ui/bad/bad-expr-path2.stderr new file mode 100644 index 0000000000000..bb7d01c72fe97 --- /dev/null +++ b/src/test/ui/bad/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) { //~ ERROR main function has wrong type + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ incorrect number of function parameters + | + = note: expected type `fn()` + found type `fn(std::vec::Vec)` + +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/bad/bad-extern-link-attrs.rs similarity index 100% rename from src/test/compile-fail/bad-extern-link-attrs.rs rename to src/test/ui/bad/bad-extern-link-attrs.rs diff --git a/src/test/ui/bad/bad-extern-link-attrs.stderr b/src/test/ui/bad/bad-extern-link-attrs.stderr new file mode 100644 index 0000000000000..5e58bcd009492 --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-intrinsic-monomorphization.rs similarity index 100% rename from src/test/compile-fail/bad-intrinsic-monomorphization.rs rename to src/test/ui/bad/bad-intrinsic-monomorphization.rs diff --git a/src/test/ui/bad/bad-intrinsic-monomorphization.stderr b/src/test/ui/bad/bad-intrinsic-monomorphization.stderr new file mode 100644 index 0000000000000..a088dd0aa4395 --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-lint-cap.rs similarity index 100% rename from src/test/compile-fail/bad-lint-cap.rs rename to src/test/ui/bad/bad-lint-cap.rs diff --git a/src/test/ui/bad/bad-lint-cap.stderr b/src/test/ui/bad/bad-lint-cap.stderr new file mode 100644 index 0000000000000..f284dbf847955 --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-lint-cap2.rs similarity index 100% rename from src/test/compile-fail/bad-lint-cap2.rs rename to src/test/ui/bad/bad-lint-cap2.rs diff --git a/src/test/ui/bad/bad-lint-cap2.stderr b/src/test/ui/bad/bad-lint-cap2.stderr new file mode 100644 index 0000000000000..7471aa21e58cc --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-lint-cap3.rs similarity index 100% rename from src/test/compile-fail/bad-lint-cap3.rs rename to src/test/ui/bad/bad-lint-cap3.rs diff --git a/src/test/ui/bad/bad-lint-cap3.stderr b/src/test/ui/bad/bad-lint-cap3.stderr new file mode 100644 index 0000000000000..d32246073146f --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-main.rs similarity index 100% rename from src/test/compile-fail/bad-main.rs rename to src/test/ui/bad/bad-main.rs diff --git a/src/test/ui/bad/bad-main.stderr b/src/test/ui/bad/bad-main.stderr new file mode 100644 index 0000000000000..3388e0866e56a --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-method-typaram-kind.rs similarity index 100% rename from src/test/compile-fail/bad-method-typaram-kind.rs rename to src/test/ui/bad/bad-method-typaram-kind.rs diff --git a/src/test/ui/bad/bad-method-typaram-kind.stderr b/src/test/ui/bad/bad-method-typaram-kind.stderr new file mode 100644 index 0000000000000..ed0c49a4f6651 --- /dev/null +++ b/src/test/ui/bad/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::(); //~ 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/bad/bad-mid-path-type-params.rs similarity index 100% rename from src/test/compile-fail/bad-mid-path-type-params.rs rename to src/test/ui/bad/bad-mid-path-type-params.rs diff --git a/src/test/ui/bad/bad-mid-path-type-params.stderr b/src/test/ui/bad/bad-mid-path-type-params.stderr new file mode 100644 index 0000000000000..d2b002ebee92c --- /dev/null +++ b/src/test/ui/bad/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::(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::(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::(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::(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/bad/bad-module.rs similarity index 100% rename from src/test/compile-fail/bad-module.rs rename to src/test/ui/bad/bad-module.rs diff --git a/src/test/ui/bad/bad-module.stderr b/src/test/ui/bad/bad-module.stderr new file mode 100644 index 0000000000000..8c19922dcabe9 --- /dev/null +++ b/src/test/ui/bad/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/bad/bad-sized.rs similarity index 100% rename from src/test/compile-fail/bad-sized.rs rename to src/test/ui/bad/bad-sized.rs diff --git a/src/test/ui/bad/bad-sized.stderr b/src/test/ui/bad/bad-sized.stderr new file mode 100644 index 0000000000000..5f8013826d9ce --- /dev/null +++ b/src/test/ui/bad/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 = 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 = 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 + = 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 = 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 + = note: required by `>::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/bad/bad-type-env-capture.rs similarity index 100% rename from src/test/compile-fail/bad-type-env-capture.rs rename to src/test/ui/bad/bad-type-env-capture.rs diff --git a/src/test/ui/bad/bad-type-env-capture.stderr b/src/test/ui/bad/bad-type-env-capture.stderr new file mode 100644 index 0000000000000..3cb087ab09afb --- /dev/null +++ b/src/test/ui/bad/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() { + | - 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` + +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/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-2.rs similarity index 100% rename from src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs rename to src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-2.rs diff --git a/src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-2.stderr b/src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-2.stderr new file mode 100644 index 0000000000000..2f05755eabda9 --- /dev/null +++ b/src/test/ui/bind-by-move/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/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-3.rs similarity index 100% rename from src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs rename to src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-3.rs diff --git a/src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-3.stderr b/src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-3.stderr new file mode 100644 index 0000000000000..a573b9a04ba26 --- /dev/null +++ b/src/test/ui/bind-by-move/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/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-4.rs similarity index 100% rename from src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs rename to src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-4.rs diff --git a/src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-4.stderr b/src/test/ui/bind-by-move/bind-by-move-neither-can-live-while-the-other-survives-4.stderr new file mode 100644 index 0000000000000..e38916b8b273d --- /dev/null +++ b/src/test/ui/bind-by-move/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/bind-by-move/bind-by-move-no-guards.rs similarity index 100% rename from src/test/compile-fail/bind-by-move-no-guards.rs rename to src/test/ui/bind-by-move/bind-by-move-no-guards.rs diff --git a/src/test/ui/bind-by-move/bind-by-move-no-guards.stderr b/src/test/ui/bind-by-move/bind-by-move-no-guards.stderr new file mode 100644 index 0000000000000..ed516cd559ebb --- /dev/null +++ b/src/test/ui/bind-by-move/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/binop/binop-bitxor-str.rs similarity index 100% rename from src/test/compile-fail/binop-bitxor-str.rs rename to src/test/ui/binop/binop-bitxor-str.rs diff --git a/src/test/ui/binop/binop-bitxor-str.stderr b/src/test/ui/binop/binop-bitxor-str.stderr new file mode 100644 index 0000000000000..a6804a6d42cd9 --- /dev/null +++ b/src/test/ui/binop/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/binop/binop-consume-args.rs similarity index 100% rename from src/test/compile-fail/binop-consume-args.rs rename to src/test/ui/binop/binop-consume-args.rs diff --git a/src/test/ui/binop/binop-consume-args.stderr b/src/test/ui/binop/binop-consume-args.stderr new file mode 100644 index 0000000000000..07627d3711b2b --- /dev/null +++ b/src/test/ui/binop/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/binop/binop-logic-float.rs similarity index 100% rename from src/test/compile-fail/binop-logic-float.rs rename to src/test/ui/binop/binop-logic-float.rs diff --git a/src/test/ui/binop/binop-logic-float.stderr b/src/test/ui/binop/binop-logic-float.stderr new file mode 100644 index 0000000000000..947ee4e2427b0 --- /dev/null +++ b/src/test/ui/binop/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/binop/binop-logic-int.rs similarity index 100% rename from src/test/compile-fail/binop-logic-int.rs rename to src/test/ui/binop/binop-logic-int.rs diff --git a/src/test/ui/binop/binop-logic-int.stderr b/src/test/ui/binop/binop-logic-int.stderr new file mode 100644 index 0000000000000..56f7601ace2b6 --- /dev/null +++ b/src/test/ui/binop/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/binop/binop-move-semantics.nll.stderr b/src/test/ui/binop/binop-move-semantics.nll.stderr new file mode 100644 index 0000000000000..98762a0f6cfff --- /dev/null +++ b/src/test/ui/binop/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/binop/binop-move-semantics.rs similarity index 100% rename from src/test/compile-fail/binop-move-semantics.rs rename to src/test/ui/binop/binop-move-semantics.rs diff --git a/src/test/ui/binop/binop-move-semantics.stderr b/src/test/ui/binop/binop-move-semantics.stderr new file mode 100644 index 0000000000000..81b8a336a2048 --- /dev/null +++ b/src/test/ui/binop/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/binop/binop-mul-bool.rs similarity index 100% rename from src/test/compile-fail/binop-mul-bool.rs rename to src/test/ui/binop/binop-mul-bool.rs diff --git a/src/test/ui/binop/binop-mul-bool.stderr b/src/test/ui/binop/binop-mul-bool.stderr new file mode 100644 index 0000000000000..1df50876c26d9 --- /dev/null +++ b/src/test/ui/binop/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/binop/binop-typeck.rs similarity index 100% rename from src/test/compile-fail/binop-typeck.rs rename to src/test/ui/binop/binop-typeck.rs diff --git a/src/test/ui/binop/binop-typeck.stderr b/src/test/ui/binop/binop-typeck.stderr new file mode 100644 index 0000000000000..1ff81779f3d64 --- /dev/null +++ b/src/test/ui/binop/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/blind/blind-item-block-item-shadow.rs similarity index 100% rename from src/test/compile-fail/blind-item-block-item-shadow.rs rename to src/test/ui/blind/blind-item-block-item-shadow.rs diff --git a/src/test/ui/blind/blind-item-block-item-shadow.stderr b/src/test/ui/blind/blind-item-block-item-shadow.stderr new file mode 100644 index 0000000000000..5adc953e4058e --- /dev/null +++ b/src/test/ui/blind/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/blind/blind-item-block-middle.rs similarity index 100% rename from src/test/compile-fail/blind-item-block-middle.rs rename to src/test/ui/blind/blind-item-block-middle.rs diff --git a/src/test/ui/blind/blind-item-block-middle.stderr b/src/test/ui/blind/blind-item-block-middle.stderr new file mode 100644 index 0000000000000..0123fd01173ac --- /dev/null +++ b/src/test/ui/blind/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/blind-item-item-shadow.rs b/src/test/ui/blind/blind-item-item-shadow.rs similarity index 100% rename from src/test/ui/blind-item-item-shadow.rs rename to src/test/ui/blind/blind-item-item-shadow.rs diff --git a/src/test/ui/blind-item-item-shadow.stderr b/src/test/ui/blind/blind-item-item-shadow.stderr similarity index 100% rename from src/test/ui/blind-item-item-shadow.stderr rename to src/test/ui/blind/blind-item-item-shadow.stderr diff --git a/src/test/ui/borrowck/borrow-immutable-upvar-mutation.nll.stderr b/src/test/ui/borrowck/borrow-immutable-upvar-mutation.nll.stderr new file mode 100644 index 0000000000000..631add3e62d85 --- /dev/null +++ b/src/test/ui/borrowck/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/borrowck/borrow-immutable-upvar-mutation.rs similarity index 100% rename from src/test/compile-fail/borrow-immutable-upvar-mutation.rs rename to src/test/ui/borrowck/borrow-immutable-upvar-mutation.rs diff --git a/src/test/ui/borrowck/borrow-immutable-upvar-mutation.stderr b/src/test/ui/borrowck/borrow-immutable-upvar-mutation.stderr new file mode 100644 index 0000000000000..740e1820f4f3c --- /dev/null +++ b/src/test/ui/borrowck/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/borrowck/borrow-tuple-fields.rs similarity index 97% rename from src/test/compile-fail/borrow-tuple-fields.rs rename to src/test/ui/borrowck/borrow-tuple-fields.rs index f3417fafe9037..4337f569fa4c0 100644 --- a/src/test/compile-fail/borrow-tuple-fields.rs +++ b/src/test/ui/borrowck/borrow-tuple-fields.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![feature(box_syntax)] struct Foo(Box, isize); diff --git a/src/test/ui/borrowck/borrow-tuple-fields.stderr b/src/test/ui/borrowck/borrow-tuple-fields.stderr new file mode 100644 index 0000000000000..d010d1d989c9b --- /dev/null +++ b/src/test/ui/borrowck/borrow-tuple-fields.stderr @@ -0,0 +1,63 @@ +error[E0505]: cannot move out of `x` because it is borrowed + --> $DIR/borrow-tuple-fields.rs:22: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:26: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:30: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:35: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:39: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:43: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/borrowck/borrowck-access-permissions.ast.nll.stderr b/src/test/ui/borrowck/borrowck-access-permissions.ast.nll.stderr new file mode 100644 index 0000000000000..0df5e0c6e6692 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-access-permissions.ast.stderr b/src/test/ui/borrowck/borrowck-access-permissions.ast.stderr new file mode 100644 index 0000000000000..b17245673e02a --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-access-permissions.mir.stderr b/src/test/ui/borrowck/borrowck-access-permissions.mir.stderr new file mode 100644 index 0000000000000..0df5e0c6e6692 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-access-permissions.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-access-permissions.rs rename to src/test/ui/borrowck/borrowck-access-permissions.rs diff --git a/src/test/ui/borrowck/borrowck-and-init.nll.stderr b/src/test/ui/borrowck/borrowck-and-init.nll.stderr new file mode 100644 index 0000000000000..0b1b157f3e055 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-and-init.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-and-init.rs rename to src/test/ui/borrowck/borrowck-and-init.rs diff --git a/src/test/ui/borrowck/borrowck-and-init.stderr b/src/test/ui/borrowck/borrowck-and-init.stderr new file mode 100644 index 0000000000000..2cbc57d66e9b8 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-anon-fields-struct.nll.stderr b/src/test/ui/borrowck/borrowck-anon-fields-struct.nll.stderr new file mode 100644 index 0000000000000..0fe9106249be9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-anon-fields-struct.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-anon-fields-struct.rs rename to src/test/ui/borrowck/borrowck-anon-fields-struct.rs diff --git a/src/test/ui/borrowck/borrowck-anon-fields-struct.stderr b/src/test/ui/borrowck/borrowck-anon-fields-struct.stderr new file mode 100644 index 0000000000000..e635a2392e1e3 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-anon-fields-tuple.nll.stderr b/src/test/ui/borrowck/borrowck-anon-fields-tuple.nll.stderr new file mode 100644 index 0000000000000..015174a9e4579 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-anon-fields-tuple.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-anon-fields-tuple.rs rename to src/test/ui/borrowck/borrowck-anon-fields-tuple.rs diff --git a/src/test/ui/borrowck/borrowck-anon-fields-tuple.stderr b/src/test/ui/borrowck/borrowck-anon-fields-tuple.stderr new file mode 100644 index 0000000000000..d05d1c31f9d67 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-anon-fields-variant.nll.stderr b/src/test/ui/borrowck/borrowck-anon-fields-variant.nll.stderr new file mode 100644 index 0000000000000..e4b9f2f2329c6 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-anon-fields-variant.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-anon-fields-variant.rs rename to src/test/ui/borrowck/borrowck-anon-fields-variant.rs diff --git a/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr b/src/test/ui/borrowck/borrowck-anon-fields-variant.stderr new file mode 100644 index 0000000000000..817d0154a63a5 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-argument.nll.stderr b/src/test/ui/borrowck/borrowck-argument.nll.stderr new file mode 100644 index 0000000000000..4470566eabbca --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-argument.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-argument.rs rename to src/test/ui/borrowck/borrowck-argument.rs diff --git a/src/test/ui/borrowck/borrowck-argument.stderr b/src/test/ui/borrowck/borrowck-argument.stderr new file mode 100644 index 0000000000000..2a7a7b3ffeeae --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-asm.ast.nll.stderr b/src/test/ui/borrowck/borrowck-asm.ast.nll.stderr new file mode 100644 index 0000000000000..6936d32a78971 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-asm.ast.stderr b/src/test/ui/borrowck/borrowck-asm.ast.stderr new file mode 100644 index 0000000000000..e2e54aa9b8ad9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-asm.mir.stderr b/src/test/ui/borrowck/borrowck-asm.mir.stderr new file mode 100644 index 0000000000000..6936d32a78971 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-asm.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-asm.rs rename to src/test/ui/borrowck/borrowck-asm.rs diff --git a/src/test/ui/borrowck/borrowck-assign-comp-idx.nll.stderr b/src/test/ui/borrowck/borrowck-assign-comp-idx.nll.stderr new file mode 100644 index 0000000000000..f4568d7c9eb8a --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-comp-idx.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-assign-comp-idx.rs rename to src/test/ui/borrowck/borrowck-assign-comp-idx.rs diff --git a/src/test/ui/borrowck/borrowck-assign-comp-idx.stderr b/src/test/ui/borrowck/borrowck-assign-comp-idx.stderr new file mode 100644 index 0000000000000..69a69b36fc737 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-comp.ast.nll.stderr b/src/test/ui/borrowck/borrowck-assign-comp.ast.nll.stderr new file mode 100644 index 0000000000000..2a1fbfd43bfb0 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-comp.ast.stderr b/src/test/ui/borrowck/borrowck-assign-comp.ast.stderr new file mode 100644 index 0000000000000..9e5e0e197a93b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-comp.mir.stderr b/src/test/ui/borrowck/borrowck-assign-comp.mir.stderr new file mode 100644 index 0000000000000..2a1fbfd43bfb0 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-comp.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-assign-comp.rs rename to src/test/ui/borrowck/borrowck-assign-comp.rs diff --git a/src/test/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.nll.stderr b/src/test/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.nll.stderr new file mode 100644 index 0000000000000..eb4c1ff025b02 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.rs rename to src/test/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.rs diff --git a/src/test/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr b/src/test/ui/borrowck/borrowck-assign-to-andmut-in-aliasable-loc.stderr new file mode 100644 index 0000000000000..4fb65988eee9d --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.nll.stderr b/src/test/ui/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.nll.stderr new file mode 100644 index 0000000000000..8ca7229b42a69 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.rs rename to src/test/ui/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.rs diff --git a/src/test/ui/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.stderr b/src/test/ui/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.stderr new file mode 100644 index 0000000000000..9a7c833050500 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-to-constants.ast.nll.stderr b/src/test/ui/borrowck/borrowck-assign-to-constants.ast.nll.stderr new file mode 100644 index 0000000000000..861fe2f2c5065 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-to-constants.ast.stderr b/src/test/ui/borrowck/borrowck-assign-to-constants.ast.stderr new file mode 100644 index 0000000000000..09ddf8387cefc --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-to-constants.mir.stderr b/src/test/ui/borrowck/borrowck-assign-to-constants.mir.stderr new file mode 100644 index 0000000000000..861fe2f2c5065 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-assign-to-constants.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-assign-to-constants.rs rename to src/test/ui/borrowck/borrowck-assign-to-constants.rs diff --git a/src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.nll.stderr b/src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.nll.stderr new file mode 100644 index 0000000000000..b41d5cd3623cd --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-auto-mut-ref-to-immut-var.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-auto-mut-ref-to-immut-var.rs rename to src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.rs diff --git a/src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr b/src/test/ui/borrowck/borrowck-auto-mut-ref-to-immut-var.stderr new file mode 100644 index 0000000000000..ca6b86e5ca686 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-autoref-3261.nll.stderr b/src/test/ui/borrowck/borrowck-autoref-3261.nll.stderr new file mode 100644 index 0000000000000..eb26676cde24b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-autoref-3261.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-autoref-3261.rs rename to src/test/ui/borrowck/borrowck-autoref-3261.rs diff --git a/src/test/ui/borrowck/borrowck-autoref-3261.stderr b/src/test/ui/borrowck/borrowck-autoref-3261.stderr new file mode 100644 index 0000000000000..c9e649dee0c25 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-bad-nested-calls-free.nll.stderr b/src/test/ui/borrowck/borrowck-bad-nested-calls-free.nll.stderr new file mode 100644 index 0000000000000..73f533a6b9699 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-bad-nested-calls-free.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-bad-nested-calls-free.rs rename to src/test/ui/borrowck/borrowck-bad-nested-calls-free.rs diff --git a/src/test/ui/borrowck/borrowck-bad-nested-calls-free.stderr b/src/test/ui/borrowck/borrowck-bad-nested-calls-free.stderr new file mode 100644 index 0000000000000..461d2fec58961 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-bad-nested-calls-move.nll.stderr b/src/test/ui/borrowck/borrowck-bad-nested-calls-move.nll.stderr new file mode 100644 index 0000000000000..ecb70068fed30 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-bad-nested-calls-move.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-bad-nested-calls-move.rs rename to src/test/ui/borrowck/borrowck-bad-nested-calls-move.rs diff --git a/src/test/ui/borrowck/borrowck-bad-nested-calls-move.stderr b/src/test/ui/borrowck/borrowck-bad-nested-calls-move.stderr new file mode 100644 index 0000000000000..7ed1f2c6583ba --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-block-unint.nll.stderr b/src/test/ui/borrowck/borrowck-block-unint.nll.stderr new file mode 100644 index 0000000000000..f3246c12bd9a8 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-block-unint.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-block-unint.rs rename to src/test/ui/borrowck/borrowck-block-unint.rs diff --git a/src/test/ui/borrowck/borrowck-block-unint.stderr b/src/test/ui/borrowck/borrowck-block-unint.stderr new file mode 100644 index 0000000000000..53aa8919fd87c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-from-owned-ptr.nll.stderr b/src/test/ui/borrowck/borrowck-borrow-from-owned-ptr.nll.stderr new file mode 100644 index 0000000000000..08d66eb034459 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-from-owned-ptr.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-borrow-from-owned-ptr.rs rename to src/test/ui/borrowck/borrowck-borrow-from-owned-ptr.rs diff --git a/src/test/ui/borrowck/borrowck-borrow-from-owned-ptr.stderr b/src/test/ui/borrowck/borrowck-borrow-from-owned-ptr.stderr new file mode 100644 index 0000000000000..9fc030f604c11 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-from-stack-variable.nll.stderr b/src/test/ui/borrowck/borrowck-borrow-from-stack-variable.nll.stderr new file mode 100644 index 0000000000000..8d1b9ca672ac9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-from-stack-variable.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-borrow-from-stack-variable.rs rename to src/test/ui/borrowck/borrowck-borrow-from-stack-variable.rs diff --git a/src/test/ui/borrowck/borrowck-borrow-from-stack-variable.stderr b/src/test/ui/borrowck/borrowck-borrow-from-stack-variable.stderr new file mode 100644 index 0000000000000..cd0d6aa4ca379 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-from-temporary.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-borrow-from-temporary.rs rename to src/test/ui/borrowck/borrowck-borrow-from-temporary.rs diff --git a/src/test/ui/borrowck/borrowck-borrow-from-temporary.stderr b/src/test/ui/borrowck/borrowck-borrow-from-temporary.stderr new file mode 100644 index 0000000000000..7dcfb3e3c87dd --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.nll.stderr b/src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.nll.stderr new file mode 100644 index 0000000000000..c2b7d790eeac0 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs rename to src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.rs diff --git a/src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr b/src/test/ui/borrowck/borrowck-borrow-immut-deref-of-box-as-mut.stderr new file mode 100644 index 0000000000000..d852125a775d1 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.nll.stderr b/src/test/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.nll.stderr new file mode 100644 index 0000000000000..8c30e6ac00207 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs rename to src/test/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.rs diff --git a/src/test/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr b/src/test/ui/borrowck/borrowck-borrow-mut-base-ptr-in-aliasable-loc.stderr new file mode 100644 index 0000000000000..f90ffa8c35a86 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-mut-object-twice.rs similarity index 96% rename from src/test/compile-fail/borrowck/borrowck-borrow-mut-object-twice.rs rename to src/test/ui/borrowck/borrowck-borrow-mut-object-twice.rs index 7175194355b0a..910851a1030c5 100644 --- a/src/test/compile-fail/borrowck/borrowck-borrow-mut-object-twice.rs +++ b/src/test/ui/borrowck/borrowck-borrow-mut-object-twice.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Check that `&mut` objects cannot be borrowed twice, just like // other `&mut` pointers. diff --git a/src/test/ui/borrowck/borrowck-borrow-mut-object-twice.stderr b/src/test/ui/borrowck/borrowck-borrow-mut-object-twice.stderr new file mode 100644 index 0000000000000..e0ea39a249176 --- /dev/null +++ b/src/test/ui/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:23: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/borrowck/borrowck-borrow-overloaded-auto-deref.nll.stderr b/src/test/ui/borrowck/borrowck-borrow-overloaded-auto-deref.nll.stderr new file mode 100644 index 0000000000000..522cdfd94d7c0 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-overloaded-auto-deref.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-borrow-overloaded-auto-deref.rs rename to src/test/ui/borrowck/borrowck-borrow-overloaded-auto-deref.rs diff --git a/src/test/ui/borrowck/borrowck-borrow-overloaded-auto-deref.stderr b/src/test/ui/borrowck/borrowck-borrow-overloaded-auto-deref.stderr new file mode 100644 index 0000000000000..31563fbaa1c98 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-overloaded-deref.nll.stderr b/src/test/ui/borrowck/borrowck-borrow-overloaded-deref.nll.stderr new file mode 100644 index 0000000000000..1e8d81fe76e97 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrow-overloaded-deref.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-borrow-overloaded-deref.rs rename to src/test/ui/borrowck/borrowck-borrow-overloaded-deref.rs diff --git a/src/test/ui/borrowck/borrowck-borrow-overloaded-deref.stderr b/src/test/ui/borrowck/borrowck-borrow-overloaded-deref.stderr new file mode 100644 index 0000000000000..641f943b6ce48 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr new file mode 100644 index 0000000000000..8f42fb4562721 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrowed-uniq-rvalue-2.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-borrowed-uniq-rvalue-2.rs rename to src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs diff --git a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr new file mode 100644 index 0000000000000..890b2894943dd --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr new file mode 100644 index 0000000000000..04f74af41141c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-borrowed-uniq-rvalue.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-borrowed-uniq-rvalue.rs rename to src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.rs diff --git a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.stderr b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.stderr new file mode 100644 index 0000000000000..7defd1ee936a6 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-break-uninit-2.nll.stderr b/src/test/ui/borrowck/borrowck-break-uninit-2.nll.stderr new file mode 100644 index 0000000000000..8c961838ca4ee --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-break-uninit-2.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-break-uninit-2.rs rename to src/test/ui/borrowck/borrowck-break-uninit-2.rs diff --git a/src/test/ui/borrowck/borrowck-break-uninit-2.stderr b/src/test/ui/borrowck/borrowck-break-uninit-2.stderr new file mode 100644 index 0000000000000..4d7d1a0ed2227 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-break-uninit.nll.stderr b/src/test/ui/borrowck/borrowck-break-uninit.nll.stderr new file mode 100644 index 0000000000000..4441c727539ea --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-break-uninit.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-break-uninit.rs rename to src/test/ui/borrowck/borrowck-break-uninit.rs diff --git a/src/test/ui/borrowck/borrowck-break-uninit.stderr b/src/test/ui/borrowck/borrowck-break-uninit.stderr new file mode 100644 index 0000000000000..9d5a21319ab3d --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-closures-mut-and-imm.ast.nll.stderr b/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.nll.stderr new file mode 100644 index 0000000000000..f24d0ed046a57 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-closures-mut-and-imm.ast.stderr b/src/test/ui/borrowck/borrowck-closures-mut-and-imm.ast.stderr new file mode 100644 index 0000000000000..628fbbd1901ef --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-closures-mut-and-imm.mir.stderr b/src/test/ui/borrowck/borrowck-closures-mut-and-imm.mir.stderr new file mode 100644 index 0000000000000..f24d0ed046a57 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-closures-mut-and-imm.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-closures-mut-and-imm.rs rename to src/test/ui/borrowck/borrowck-closures-mut-and-imm.rs diff --git a/src/test/ui/borrowck/borrowck-closures-mut-of-imm.nll.stderr b/src/test/ui/borrowck/borrowck-closures-mut-of-imm.nll.stderr new file mode 100644 index 0000000000000..e8fae63a5d617 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-closures-mut-of-imm.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-closures-mut-of-imm.rs rename to src/test/ui/borrowck/borrowck-closures-mut-of-imm.rs diff --git a/src/test/ui/borrowck/borrowck-closures-mut-of-imm.stderr b/src/test/ui/borrowck/borrowck-closures-mut-of-imm.stderr new file mode 100644 index 0000000000000..87eb52b6aa605 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-closures-two-mut-fail.rs similarity index 96% rename from src/test/compile-fail/borrowck/borrowck-closures-two-mut.rs rename to src/test/ui/borrowck/borrowck-closures-two-mut-fail.rs index 29546abe0bb20..6a1b786f52843 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-two-mut.rs +++ b/src/test/ui/borrowck/borrowck-closures-two-mut-fail.rs @@ -8,10 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Tests that two closures cannot simultaneously have mutable // access to the variable, whether that mutable access be used // for direct assignment or for taking mutable ref. Issue #6801. +// ignore-compare-mode-nll + #![feature(box_syntax)] fn to_fn_mut(f: F) -> F { f } diff --git a/src/test/ui/borrowck/borrowck-closures-two-mut-fail.stderr b/src/test/ui/borrowck/borrowck-closures-two-mut-fail.stderr new file mode 100644 index 0000000000000..bea32f6be9964 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-closures-two-mut-fail.stderr @@ -0,0 +1,75 @@ +error[E0499]: cannot borrow `x` as mutable more than once at a time + --> $DIR/borrowck-closures-two-mut-fail.rs:26: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-fail.rs:36: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-fail.rs:42: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-fail.rs:48: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-fail.rs:59: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/borrowck/borrowck-closures-unique-imm.rs similarity index 96% rename from src/test/compile-fail/borrowck/borrowck-closures-unique-imm.rs rename to src/test/ui/borrowck/borrowck-closures-unique-imm.rs index 247a4fe89a501..9fefbe2bdc690 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-unique-imm.rs +++ b/src/test/ui/borrowck/borrowck-closures-unique-imm.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + struct Foo { x: isize, } diff --git a/src/test/ui/borrowck/borrowck-closures-unique-imm.stderr b/src/test/ui/borrowck/borrowck-closures-unique-imm.stderr new file mode 100644 index 0000000000000..a166b6292e654 --- /dev/null +++ b/src/test/ui/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:23: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/borrowck/borrowck-closures-unique.rs similarity index 98% rename from src/test/compile-fail/borrowck/borrowck-closures-unique.rs rename to src/test/ui/borrowck/borrowck-closures-unique.rs index 1b22dc4d2c6af..9a74f188a545f 100644 --- a/src/test/compile-fail/borrowck/borrowck-closures-unique.rs +++ b/src/test/ui/borrowck/borrowck-closures-unique.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Tests that a closure which requires mutable access to the referent // of an `&mut` requires a "unique" borrow -- that is, the variable to // be borrowed (here, `x`) will not be borrowed *mutably*, but diff --git a/src/test/ui/borrowck/borrowck-closures-unique.stderr b/src/test/ui/borrowck/borrowck-closures-unique.stderr new file mode 100644 index 0000000000000..27163bde34f6a --- /dev/null +++ b/src/test/ui/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:34: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:39: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:44: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:48: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/borrowck/borrowck-closures-use-after-free.nll.stderr b/src/test/ui/borrowck/borrowck-closures-use-after-free.nll.stderr new file mode 100644 index 0000000000000..dc73929989ce1 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-closures-use-after-free.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-closures-use-after-free.rs rename to src/test/ui/borrowck/borrowck-closures-use-after-free.rs diff --git a/src/test/ui/borrowck/borrowck-closures-use-after-free.stderr b/src/test/ui/borrowck/borrowck-closures-use-after-free.stderr new file mode 100644 index 0000000000000..7beb31f394489 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-consume-unsize-vec.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-consume-unsize-vec.rs rename to src/test/ui/borrowck/borrowck-consume-unsize-vec.rs diff --git a/src/test/ui/borrowck/borrowck-consume-unsize-vec.stderr b/src/test/ui/borrowck/borrowck-consume-unsize-vec.stderr new file mode 100644 index 0000000000000..8199ce70e2a92 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-consume-upcast-box.nll.stderr b/src/test/ui/borrowck/borrowck-consume-upcast-box.nll.stderr new file mode 100644 index 0000000000000..b999e09284773 --- /dev/null +++ b/src/test/ui/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`, 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/borrowck/borrowck-consume-upcast-box.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-consume-upcast-box.rs rename to src/test/ui/borrowck/borrowck-consume-upcast-box.rs diff --git a/src/test/ui/borrowck/borrowck-consume-upcast-box.stderr b/src/test/ui/borrowck/borrowck-consume-upcast-box.stderr new file mode 100644 index 0000000000000..159933a615509 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-describe-lvalue.ast.nll.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr new file mode 100644 index 0000000000000..c8170436e05f2 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr @@ -0,0 +1,540 @@ +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 | || { + | -- + | || + | |return type of closure is [closure@$DIR/borrowck-describe-lvalue.rs:305:16: 311:18 x:&'2 mut i32] + | lifetime `'1` represents this closure's body +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` + | + = note: closure implements `FnMut`, so references to captured variables can't escape the closure + +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`, 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/borrowck/borrowck-describe-lvalue.ast.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr new file mode 100644 index 0000000000000..ca9b2dda8bcf3 --- /dev/null +++ b/src/test/ui/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`, 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/borrowck/borrowck-describe-lvalue.mir.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr new file mode 100644 index 0000000000000..c8170436e05f2 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr @@ -0,0 +1,540 @@ +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 | || { + | -- + | || + | |return type of closure is [closure@$DIR/borrowck-describe-lvalue.rs:305:16: 311:18 x:&'2 mut i32] + | lifetime `'1` represents this closure's body +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` + | + = note: closure implements `FnMut`, so references to captured variables can't escape the closure + +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`, 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/borrowck/borrowck-describe-lvalue.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-describe-lvalue.rs rename to src/test/ui/borrowck/borrowck-describe-lvalue.rs diff --git a/src/test/compile-fail/borrowck/borrowck-drop-from-guard.rs b/src/test/ui/borrowck/borrowck-drop-from-guard.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-drop-from-guard.rs rename to src/test/ui/borrowck/borrowck-drop-from-guard.rs diff --git a/src/test/ui/borrowck/borrowck-drop-from-guard.stderr b/src/test/ui/borrowck/borrowck-drop-from-guard.stderr new file mode 100644 index 0000000000000..e28b500ce63f0 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-field-sensitivity.nll.stderr b/src/test/ui/borrowck/borrowck-field-sensitivity.nll.stderr new file mode 100644 index 0000000000000..fb300d32b05e9 --- /dev/null +++ b/src/test/ui/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`, 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`, 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`, 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`, 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`, 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`, 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/borrowck/borrowck-field-sensitivity.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-field-sensitivity.rs rename to src/test/ui/borrowck/borrowck-field-sensitivity.rs diff --git a/src/test/ui/borrowck/borrowck-field-sensitivity.stderr b/src/test/ui/borrowck/borrowck-field-sensitivity.stderr new file mode 100644 index 0000000000000..e5eba3790a0bc --- /dev/null +++ b/src/test/ui/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`, 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`, 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`, 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`, 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`, 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`, 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`, 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`, 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/borrowck/borrowck-fn-in-const-a.ast.stderr b/src/test/ui/borrowck/borrowck-fn-in-const-a.ast.stderr new file mode 100644 index 0000000000000..4d0c762ca77c9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-fn-in-const-a.mir.stderr b/src/test/ui/borrowck/borrowck-fn-in-const-a.mir.stderr new file mode 100644 index 0000000000000..4d0c762ca77c9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-fn-in-const-a.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-fn-in-const-a.rs rename to src/test/ui/borrowck/borrowck-fn-in-const-a.rs diff --git a/src/test/ui/borrowck/borrowck-fn-in-const-c.nll.stderr b/src/test/ui/borrowck/borrowck-fn-in-const-c.nll.stderr new file mode 100644 index 0000000000000..827b66cf068b4 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-fn-in-const-c.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-fn-in-const-c.rs rename to src/test/ui/borrowck/borrowck-fn-in-const-c.rs diff --git a/src/test/ui/borrowck/borrowck-fn-in-const-c.stderr b/src/test/ui/borrowck/borrowck-fn-in-const-c.stderr new file mode 100644 index 0000000000000..1dda8d4186034 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-for-loop-correct-cmt-for-pattern.nll.stderr b/src/test/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.nll.stderr new file mode 100644 index 0000000000000..f9e517def1406 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-for-loop-correct-cmt-for-pattern.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-for-loop-correct-cmt-for-pattern.rs rename to src/test/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.rs diff --git a/src/test/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.stderr b/src/test/ui/borrowck/borrowck-for-loop-correct-cmt-for-pattern.stderr new file mode 100644 index 0000000000000..baa8a668cd930 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-for-loop-head-linkage.nll.stderr b/src/test/ui/borrowck/borrowck-for-loop-head-linkage.nll.stderr new file mode 100644 index 0000000000000..c3f71d60072b9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-for-loop-head-linkage.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-for-loop-head-linkage.rs rename to src/test/ui/borrowck/borrowck-for-loop-head-linkage.rs diff --git a/src/test/ui/borrowck/borrowck-for-loop-head-linkage.stderr b/src/test/ui/borrowck/borrowck-for-loop-head-linkage.stderr new file mode 100644 index 0000000000000..fd00138356d25 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-if-no-else.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-if-no-else.rs rename to src/test/ui/borrowck/borrowck-if-no-else.rs diff --git a/src/test/ui/borrowck/borrowck-if-no-else.stderr b/src/test/ui/borrowck/borrowck-if-no-else.stderr new file mode 100644 index 0000000000000..6c4a53a37d9c8 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-if-with-else.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-if-with-else.rs rename to src/test/ui/borrowck/borrowck-if-with-else.rs diff --git a/src/test/ui/borrowck/borrowck-if-with-else.stderr b/src/test/ui/borrowck/borrowck-if-with-else.stderr new file mode 100644 index 0000000000000..097d11e387e84 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.nll.stderr b/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.nll.stderr new file mode 100644 index 0000000000000..0a1bc2c195902 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.stderr b/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.ast.stderr new file mode 100644 index 0000000000000..cb6d9875a9222 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.mir.stderr b/src/test/ui/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.mir.stderr new file mode 100644 index 0000000000000..0a1bc2c195902 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-imm-ref-to-mut-rec-field-issue-3162-c.rs rename to src/test/ui/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/borrowck/borrowck-init-in-called-fn-expr.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-init-in-called-fn-expr.rs rename to src/test/ui/borrowck/borrowck-init-in-called-fn-expr.rs diff --git a/src/test/ui/borrowck/borrowck-init-in-called-fn-expr.stderr b/src/test/ui/borrowck/borrowck-init-in-called-fn-expr.stderr new file mode 100644 index 0000000000000..e55603c451f5b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-init-in-fn-expr.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-init-in-fn-expr.rs rename to src/test/ui/borrowck/borrowck-init-in-fn-expr.rs diff --git a/src/test/ui/borrowck/borrowck-init-in-fn-expr.stderr b/src/test/ui/borrowck/borrowck-init-in-fn-expr.stderr new file mode 100644 index 0000000000000..406fb5e68349b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-init-in-fru.ast.nll.stderr b/src/test/ui/borrowck/borrowck-init-in-fru.ast.nll.stderr new file mode 100644 index 0000000000000..cac9d890dae0f --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-init-in-fru.ast.stderr b/src/test/ui/borrowck/borrowck-init-in-fru.ast.stderr new file mode 100644 index 0000000000000..a5c1ef7f4f52c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-init-in-fru.mir.stderr b/src/test/ui/borrowck/borrowck-init-in-fru.mir.stderr new file mode 100644 index 0000000000000..cac9d890dae0f --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-init-in-fru.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-init-in-fru.rs rename to src/test/ui/borrowck/borrowck-init-in-fru.rs diff --git a/src/test/compile-fail/borrowck/borrowck-init-op-equal.rs b/src/test/ui/borrowck/borrowck-init-op-equal.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-init-op-equal.rs rename to src/test/ui/borrowck/borrowck-init-op-equal.rs diff --git a/src/test/ui/borrowck/borrowck-init-op-equal.stderr b/src/test/ui/borrowck/borrowck-init-op-equal.stderr new file mode 100644 index 0000000000000..b8e91e356c106 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-init-plus-equal.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-init-plus-equal.rs rename to src/test/ui/borrowck/borrowck-init-plus-equal.rs diff --git a/src/test/ui/borrowck/borrowck-init-plus-equal.stderr b/src/test/ui/borrowck/borrowck-init-plus-equal.stderr new file mode 100644 index 0000000000000..f49c06c0c8659 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-insert-during-each.nll.stderr b/src/test/ui/borrowck/borrowck-insert-during-each.nll.stderr new file mode 100644 index 0000000000000..e403b076ab406 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-insert-during-each.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-insert-during-each.rs rename to src/test/ui/borrowck/borrowck-insert-during-each.rs diff --git a/src/test/ui/borrowck/borrowck-insert-during-each.stderr b/src/test/ui/borrowck/borrowck-insert-during-each.stderr new file mode 100644 index 0000000000000..30648edffd817 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-issue-14498.ast.nll.stderr b/src/test/ui/borrowck/borrowck-issue-14498.ast.nll.stderr new file mode 100644 index 0000000000000..d90eda41164fe --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-issue-14498.ast.stderr b/src/test/ui/borrowck/borrowck-issue-14498.ast.stderr new file mode 100644 index 0000000000000..ffb793e48dfcf --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-issue-14498.mir.stderr b/src/test/ui/borrowck/borrowck-issue-14498.mir.stderr new file mode 100644 index 0000000000000..d90eda41164fe --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-issue-14498.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-issue-14498.rs rename to src/test/ui/borrowck/borrowck-issue-14498.rs diff --git a/src/test/compile-fail/borrowck/borrowck-issue-2657-1.rs b/src/test/ui/borrowck/borrowck-issue-2657-1.rs similarity index 95% rename from src/test/compile-fail/borrowck/borrowck-issue-2657-1.rs rename to src/test/ui/borrowck/borrowck-issue-2657-1.rs index 0e1712137d34e..500de9865dcce 100644 --- a/src/test/compile-fail/borrowck/borrowck-issue-2657-1.rs +++ b/src/test/ui/borrowck/borrowck-issue-2657-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![feature(box_syntax)] fn main() { diff --git a/src/test/ui/borrowck/borrowck-issue-2657-1.stderr b/src/test/ui/borrowck/borrowck-issue-2657-1.stderr new file mode 100644 index 0000000000000..532f0e6fb0092 --- /dev/null +++ b/src/test/ui/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:19: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/borrowck/borrowck-issue-2657-2.nll.stderr b/src/test/ui/borrowck/borrowck-issue-2657-2.nll.stderr new file mode 100644 index 0000000000000..55c6a40d281bc --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-issue-2657-2.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-issue-2657-2.rs rename to src/test/ui/borrowck/borrowck-issue-2657-2.rs diff --git a/src/test/ui/borrowck/borrowck-issue-2657-2.stderr b/src/test/ui/borrowck/borrowck-issue-2657-2.stderr new file mode 100644 index 0000000000000..42baecd7943dd --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-issue-48962.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-issue-48962.rs rename to src/test/ui/borrowck/borrowck-issue-48962.rs diff --git a/src/test/ui/borrowck/borrowck-issue-48962.stderr b/src/test/ui/borrowck/borrowck-issue-48962.stderr new file mode 100644 index 0000000000000..4448cedda69af --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-lend-flow-if.rs similarity index 98% rename from src/test/compile-fail/borrowck/borrowck-lend-flow-if.rs rename to src/test/ui/borrowck/borrowck-lend-flow-if.rs index a6ce36a5507f2..3df174b4fb83a 100644 --- a/src/test/compile-fail/borrowck/borrowck-lend-flow-if.rs +++ b/src/test/ui/borrowck/borrowck-lend-flow-if.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Note: the borrowck analysis is currently flow-insensitive. // Therefore, some of these errors are marked as spurious and could be // corrected by a simple change to the analysis. The others are diff --git a/src/test/ui/borrowck/borrowck-lend-flow-if.stderr b/src/test/ui/borrowck/borrowck-lend-flow-if.stderr new file mode 100644 index 0000000000000..c53c4e46d4f25 --- /dev/null +++ b/src/test/ui/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:40: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/borrowck/borrowck-lend-flow-loop.nll.stderr b/src/test/ui/borrowck/borrowck-lend-flow-loop.nll.stderr new file mode 100644 index 0000000000000..c46e94866ab5a --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-lend-flow-loop.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-lend-flow-loop.rs rename to src/test/ui/borrowck/borrowck-lend-flow-loop.rs diff --git a/src/test/ui/borrowck/borrowck-lend-flow-loop.stderr b/src/test/ui/borrowck/borrowck-lend-flow-loop.stderr new file mode 100644 index 0000000000000..534e30b564d7f --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-lend-flow-match.ast.nll.stderr b/src/test/ui/borrowck/borrowck-lend-flow-match.ast.nll.stderr new file mode 100644 index 0000000000000..0b6eabfb7edd8 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-lend-flow-match.ast.stderr b/src/test/ui/borrowck/borrowck-lend-flow-match.ast.stderr new file mode 100644 index 0000000000000..0fcc6bbbc83d4 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-lend-flow-match.mir.stderr b/src/test/ui/borrowck/borrowck-lend-flow-match.mir.stderr new file mode 100644 index 0000000000000..0b6eabfb7edd8 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-lend-flow-match.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-lend-flow-match.rs rename to src/test/ui/borrowck/borrowck-lend-flow-match.rs diff --git a/src/test/compile-fail/borrowck/borrowck-lend-flow.rs b/src/test/ui/borrowck/borrowck-lend-flow.rs similarity index 98% rename from src/test/compile-fail/borrowck/borrowck-lend-flow.rs rename to src/test/ui/borrowck/borrowck-lend-flow.rs index 1ed779cfaac71..27a21f0e40a66 100644 --- a/src/test/compile-fail/borrowck/borrowck-lend-flow.rs +++ b/src/test/ui/borrowck/borrowck-lend-flow.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Note: the borrowck analysis is currently flow-insensitive. // Therefore, some of these errors are marked as spurious and could be // corrected by a simple change to the analysis. The others are diff --git a/src/test/ui/borrowck/borrowck-lend-flow.stderr b/src/test/ui/borrowck/borrowck-lend-flow.stderr new file mode 100644 index 0000000000000..abb83c8dfc883 --- /dev/null +++ b/src/test/ui/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:36: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/borrowck/borrowck-loan-blocks-move-cc.rs similarity index 97% rename from src/test/compile-fail/borrowck/borrowck-loan-blocks-move-cc.rs rename to src/test/ui/borrowck/borrowck-loan-blocks-move-cc.rs index 57b584a89599f..e57575d8f03d4 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-blocks-move-cc.rs +++ b/src/test/ui/borrowck/borrowck-loan-blocks-move-cc.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![feature(box_syntax)] use std::thread; diff --git a/src/test/ui/borrowck/borrowck-loan-blocks-move-cc.stderr b/src/test/ui/borrowck/borrowck-loan-blocks-move-cc.stderr new file mode 100644 index 0000000000000..a1d633e54f021 --- /dev/null +++ b/src/test/ui/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:25: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:34: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/borrowck/borrowck-loan-blocks-move.rs similarity index 95% rename from src/test/compile-fail/borrowck/borrowck-loan-blocks-move.rs rename to src/test/ui/borrowck/borrowck-loan-blocks-move.rs index f3f18807314f9..dc83dc731b353 100644 --- a/src/test/compile-fail/borrowck/borrowck-loan-blocks-move.rs +++ b/src/test/ui/borrowck/borrowck-loan-blocks-move.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![feature(box_syntax)] fn take(_v: Box) { diff --git a/src/test/ui/borrowck/borrowck-loan-blocks-move.stderr b/src/test/ui/borrowck/borrowck-loan-blocks-move.stderr new file mode 100644 index 0000000000000..fb5657f6928a4 --- /dev/null +++ b/src/test/ui/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:21: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/borrowck/borrowck-loan-blocks-mut-uniq.nll.stderr b/src/test/ui/borrowck/borrowck-loan-blocks-mut-uniq.nll.stderr new file mode 100644 index 0000000000000..5c3cd46a87d9c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-blocks-mut-uniq.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-loan-blocks-mut-uniq.rs rename to src/test/ui/borrowck/borrowck-loan-blocks-mut-uniq.rs diff --git a/src/test/ui/borrowck/borrowck-loan-blocks-mut-uniq.stderr b/src/test/ui/borrowck/borrowck-loan-blocks-mut-uniq.stderr new file mode 100644 index 0000000000000..752322dec87c6 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-in-overloaded-op.nll.stderr b/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.nll.stderr new file mode 100644 index 0000000000000..03ddfb4c9032a --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-in-overloaded-op.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-loan-in-overloaded-op.rs rename to src/test/ui/borrowck/borrowck-loan-in-overloaded-op.rs diff --git a/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.stderr b/src/test/ui/borrowck/borrowck-loan-in-overloaded-op.stderr new file mode 100644 index 0000000000000..7cd54e293b010 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-of-static-data-issue-27616.nll.stderr b/src/test/ui/borrowck/borrowck-loan-of-static-data-issue-27616.nll.stderr new file mode 100644 index 0000000000000..eb9e72a6c5c78 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-of-static-data-issue-27616.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-loan-of-static-data-issue-27616.rs rename to src/test/ui/borrowck/borrowck-loan-of-static-data-issue-27616.rs diff --git a/src/test/ui/borrowck/borrowck-loan-of-static-data-issue-27616.stderr b/src/test/ui/borrowck/borrowck-loan-of-static-data-issue-27616.stderr new file mode 100644 index 0000000000000..3f5e09b74432c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-rcvr-overloaded-op.nll.stderr b/src/test/ui/borrowck/borrowck-loan-rcvr-overloaded-op.nll.stderr new file mode 100644 index 0000000000000..b7c871625870c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-rcvr-overloaded-op.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-loan-rcvr-overloaded-op.rs rename to src/test/ui/borrowck/borrowck-loan-rcvr-overloaded-op.rs diff --git a/src/test/ui/borrowck/borrowck-loan-rcvr-overloaded-op.stderr b/src/test/ui/borrowck/borrowck-loan-rcvr-overloaded-op.stderr new file mode 100644 index 0000000000000..4db1d1f298e52 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-rcvr.nll.stderr b/src/test/ui/borrowck/borrowck-loan-rcvr.nll.stderr new file mode 100644 index 0000000000000..a5b81027c2fc4 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-rcvr.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-loan-rcvr.rs rename to src/test/ui/borrowck/borrowck-loan-rcvr.rs diff --git a/src/test/ui/borrowck/borrowck-loan-rcvr.stderr b/src/test/ui/borrowck/borrowck-loan-rcvr.stderr new file mode 100644 index 0000000000000..f5d3cfb383464 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-vec-content.nll.stderr b/src/test/ui/borrowck/borrowck-loan-vec-content.nll.stderr new file mode 100644 index 0000000000000..492e90914ea70 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-loan-vec-content.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-loan-vec-content.rs rename to src/test/ui/borrowck/borrowck-loan-vec-content.rs diff --git a/src/test/ui/borrowck/borrowck-loan-vec-content.stderr b/src/test/ui/borrowck/borrowck-loan-vec-content.stderr new file mode 100644 index 0000000000000..2fcfd1fb08d05 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-local-borrow-outlives-fn.ast.nll.stderr b/src/test/ui/borrowck/borrowck-local-borrow-outlives-fn.ast.nll.stderr new file mode 100644 index 0000000000000..97bf509a45840 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-local-borrow-outlives-fn.ast.stderr b/src/test/ui/borrowck/borrowck-local-borrow-outlives-fn.ast.stderr new file mode 100644 index 0000000000000..af1d294c387bf --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-local-borrow-outlives-fn.mir.stderr b/src/test/ui/borrowck/borrowck-local-borrow-outlives-fn.mir.stderr new file mode 100644 index 0000000000000..97bf509a45840 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-local-borrow-outlives-fn.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-local-borrow-outlives-fn.rs rename to src/test/ui/borrowck/borrowck-local-borrow-outlives-fn.rs diff --git a/src/test/ui/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.nll.stderr b/src/test/ui/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.nll.stderr new file mode 100644 index 0000000000000..5e2b469e68fd1 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.stderr b/src/test/ui/borrowck/borrowck-local-borrow-with-panic-outlives-fn.ast.stderr new file mode 100644 index 0000000000000..0c61c13345c1c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-local-borrow-with-panic-outlives-fn.mir.stderr b/src/test/ui/borrowck/borrowck-local-borrow-with-panic-outlives-fn.mir.stderr new file mode 100644 index 0000000000000..5e2b469e68fd1 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-local-borrow-with-panic-outlives-fn.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-local-borrow-with-panic-outlives-fn.rs rename to src/test/ui/borrowck/borrowck-local-borrow-with-panic-outlives-fn.rs diff --git a/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.nll.stderr b/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.nll.stderr new file mode 100644 index 0000000000000..8dec40520c4e3 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-match-already-borrowed.ast.stderr b/src/test/ui/borrowck/borrowck-match-already-borrowed.ast.stderr new file mode 100644 index 0000000000000..2e49f90a16997 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-match-already-borrowed.mir.stderr b/src/test/ui/borrowck/borrowck-match-already-borrowed.mir.stderr new file mode 100644 index 0000000000000..8dec40520c4e3 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-match-already-borrowed.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-match-already-borrowed.rs rename to src/test/ui/borrowck/borrowck-match-already-borrowed.rs diff --git a/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.nll.stderr b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.nll.stderr new file mode 100644 index 0000000000000..0191e0765b382 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-match-binding-is-assignment.ast.stderr b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.ast.stderr new file mode 100644 index 0000000000000..0d776f44daad3 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-match-binding-is-assignment.mir.stderr b/src/test/ui/borrowck/borrowck-match-binding-is-assignment.mir.stderr new file mode 100644 index 0000000000000..0191e0765b382 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-match-binding-is-assignment.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-match-binding-is-assignment.rs rename to src/test/ui/borrowck/borrowck-match-binding-is-assignment.rs diff --git a/src/test/ui/borrowck/borrowck-move-by-capture.nll.stderr b/src/test/ui/borrowck/borrowck-move-by-capture.nll.stderr new file mode 100644 index 0000000000000..f5b7ca22278e4 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-by-capture.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-by-capture.rs rename to src/test/ui/borrowck/borrowck-move-by-capture.rs diff --git a/src/test/ui/borrowck/borrowck-move-by-capture.stderr b/src/test/ui/borrowck/borrowck-move-by-capture.stderr new file mode 100644 index 0000000000000..a88af1596efdc --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs similarity index 96% rename from src/test/compile-fail/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs rename to src/test/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs index c02c6a7151428..8423b4cc9b0b2 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs +++ b/src/test/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // verify that an error is raised when trying to move out of a // borrowed path. diff --git a/src/test/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr b/src/test/ui/borrowck/borrowck-move-from-subpath-of-borrowed-path.stderr new file mode 100644 index 0000000000000..e5557eca6de03 --- /dev/null +++ b/src/test/ui/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:22: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/borrowck/borrowck-move-from-unsafe-ptr.nll.stderr b/src/test/ui/borrowck/borrowck-move-from-unsafe-ptr.nll.stderr new file mode 100644 index 0000000000000..4f692bfc55e42 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-from-unsafe-ptr.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-from-unsafe-ptr.rs rename to src/test/ui/borrowck/borrowck-move-from-unsafe-ptr.rs diff --git a/src/test/ui/borrowck/borrowck-move-from-unsafe-ptr.stderr b/src/test/ui/borrowck/borrowck-move-from-unsafe-ptr.stderr new file mode 100644 index 0000000000000..cad155103f0c9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-in-irrefut-pat.ast.nll.stderr b/src/test/ui/borrowck/borrowck-move-in-irrefut-pat.ast.nll.stderr new file mode 100644 index 0000000000000..f670936dbac17 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-in-irrefut-pat.ast.stderr b/src/test/ui/borrowck/borrowck-move-in-irrefut-pat.ast.stderr new file mode 100644 index 0000000000000..fa7fb649c8d30 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-in-irrefut-pat.mir.stderr b/src/test/ui/borrowck/borrowck-move-in-irrefut-pat.mir.stderr new file mode 100644 index 0000000000000..f670936dbac17 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-in-irrefut-pat.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-in-irrefut-pat.rs rename to src/test/ui/borrowck/borrowck-move-in-irrefut-pat.rs diff --git a/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.nll.stderr b/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.nll.stderr new file mode 100644 index 0000000000000..d896ff491c646 --- /dev/null +++ b/src/test/ui/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`, 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/borrowck/borrowck-move-moved-value-into-closure.ast.stderr b/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.ast.stderr new file mode 100644 index 0000000000000..c7576b1b32ddb --- /dev/null +++ b/src/test/ui/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`, 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/borrowck/borrowck-move-moved-value-into-closure.mir.stderr b/src/test/ui/borrowck/borrowck-move-moved-value-into-closure.mir.stderr new file mode 100644 index 0000000000000..d896ff491c646 --- /dev/null +++ b/src/test/ui/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`, 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/borrowck/borrowck-move-moved-value-into-closure.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-moved-value-into-closure.rs rename to src/test/ui/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/borrowck/borrowck-move-mut-base-ptr.rs similarity index 96% rename from src/test/compile-fail/borrowck/borrowck-move-mut-base-ptr.rs rename to src/test/ui/borrowck/borrowck-move-mut-base-ptr.rs index 2fb89e6364bb1..d18f962397416 100644 --- a/src/test/compile-fail/borrowck/borrowck-move-mut-base-ptr.rs +++ b/src/test/ui/borrowck/borrowck-move-mut-base-ptr.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that attempt to move `&mut` pointer while pointee is borrowed // yields an error. // diff --git a/src/test/ui/borrowck/borrowck-move-mut-base-ptr.stderr b/src/test/ui/borrowck/borrowck-move-mut-base-ptr.stderr new file mode 100644 index 0000000000000..33ccd148f5b1d --- /dev/null +++ b/src/test/ui/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:20: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/borrowck/borrowck-move-out-from-array.ast.nll.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array.ast.nll.stderr new file mode 100644 index 0000000000000..d67b63b5aa71a --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-from-array.ast.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array.ast.stderr new file mode 100644 index 0000000000000..d19c23dce5f5f --- /dev/null +++ b/src/test/ui/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`, 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`, 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/borrowck/borrowck-move-out-from-array.mir.stderr b/src/test/ui/borrowck/borrowck-move-out-from-array.mir.stderr new file mode 100644 index 0000000000000..d67b63b5aa71a --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-from-array.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-out-from-array.rs rename to src/test/ui/borrowck/borrowck-move-out-from-array.rs diff --git a/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.ast.stderr b/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.ast.stderr new file mode 100644 index 0000000000000..94f7eba63a1ca --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-of-overloaded-auto-deref.mir.stderr b/src/test/ui/borrowck/borrowck-move-out-of-overloaded-auto-deref.mir.stderr new file mode 100644 index 0000000000000..94f7eba63a1ca --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-out-of-overloaded-auto-deref.rs rename to src/test/ui/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/borrowck/borrowck-move-out-of-overloaded-deref.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-out-of-overloaded-deref.rs rename to src/test/ui/borrowck/borrowck-move-out-of-overloaded-deref.rs diff --git a/src/test/ui/borrowck/borrowck-move-out-of-overloaded-deref.stderr b/src/test/ui/borrowck/borrowck-move-out-of-overloaded-deref.stderr new file mode 100644 index 0000000000000..df5d911f6a88d --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-of-static-item.ast.stderr b/src/test/ui/borrowck/borrowck-move-out-of-static-item.ast.stderr new file mode 100644 index 0000000000000..65f70a7984fe4 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-of-static-item.mir.stderr b/src/test/ui/borrowck/borrowck-move-out-of-static-item.mir.stderr new file mode 100644 index 0000000000000..65f70a7984fe4 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-of-static-item.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-out-of-static-item.rs rename to src/test/ui/borrowck/borrowck-move-out-of-static-item.rs diff --git a/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr b/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.ast.nll.stderr new file mode 100644 index 0000000000000..15c7011d71671 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-of-struct-with-dtor.ast.stderr b/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.ast.stderr new file mode 100644 index 0000000000000..4384f046d1642 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr b/src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.mir.stderr new file mode 100644 index 0000000000000..15c7011d71671 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-of-struct-with-dtor.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-out-of-struct-with-dtor.rs rename to src/test/ui/borrowck/borrowck-move-out-of-struct-with-dtor.rs diff --git a/src/test/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.nll.stderr b/src/test/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.nll.stderr new file mode 100644 index 0000000000000..c69ae8755a957 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs rename to src/test/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.rs diff --git a/src/test/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.stderr b/src/test/ui/borrowck/borrowck-move-out-of-tuple-struct-with-dtor.stderr new file mode 100644 index 0000000000000..78a065b60da58 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-subcomponent.nll.stderr b/src/test/ui/borrowck/borrowck-move-subcomponent.nll.stderr new file mode 100644 index 0000000000000..cd8d0cdfee2c9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-move-subcomponent.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-move-subcomponent.rs rename to src/test/ui/borrowck/borrowck-move-subcomponent.rs diff --git a/src/test/ui/borrowck/borrowck-move-subcomponent.stderr b/src/test/ui/borrowck/borrowck-move-subcomponent.stderr new file mode 100644 index 0000000000000..f249f0f22cd35 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-multiple-captures.nll.stderr b/src/test/ui/borrowck/borrowck-multiple-captures.nll.stderr new file mode 100644 index 0000000000000..ce1880c584a6e --- /dev/null +++ b/src/test/ui/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`, 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`, 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`, 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`, 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`, 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/borrowck/borrowck-multiple-captures.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-multiple-captures.rs rename to src/test/ui/borrowck/borrowck-multiple-captures.rs diff --git a/src/test/ui/borrowck/borrowck-multiple-captures.stderr b/src/test/ui/borrowck/borrowck-multiple-captures.stderr new file mode 100644 index 0000000000000..3163ca6345288 --- /dev/null +++ b/src/test/ui/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`, 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`, 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`, 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`, 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`, 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/borrowck/borrowck-mut-addr-of-imm-var.nll.stderr b/src/test/ui/borrowck/borrowck-mut-addr-of-imm-var.nll.stderr new file mode 100644 index 0000000000000..352ace41d9308 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-mut-addr-of-imm-var.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-mut-addr-of-imm-var.rs rename to src/test/ui/borrowck/borrowck-mut-addr-of-imm-var.rs diff --git a/src/test/ui/borrowck/borrowck-mut-addr-of-imm-var.stderr b/src/test/ui/borrowck/borrowck-mut-addr-of-imm-var.stderr new file mode 100644 index 0000000000000..0859a4e0f5550 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-mut-borrow-linear-errors.ast.nll.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.nll.stderr new file mode 100644 index 0000000000000..b3c86a56091d2 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-mut-borrow-linear-errors.ast.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.ast.stderr new file mode 100644 index 0000000000000..7a43cf1542276 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-linear-errors.mir.stderr new file mode 100644 index 0000000000000..b3c86a56091d2 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-mut-borrow-linear-errors.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-mut-borrow-linear-errors.rs rename to src/test/ui/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/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs similarity index 97% rename from src/test/compile-fail/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs rename to src/test/ui/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs index bdeb7ea69bdfb..5b73ca8e49a44 100644 --- a/src/test/compile-fail/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs +++ b/src/test/ui/borrowck/borrowck-mut-borrow-of-mut-base-ptr.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that attempt to mutably borrow `&mut` pointer while pointee is // borrowed yields an error. // diff --git a/src/test/ui/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr b/src/test/ui/borrowck/borrowck-mut-borrow-of-mut-base-ptr.stderr new file mode 100644 index 0000000000000..e7d41dd46028d --- /dev/null +++ b/src/test/ui/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:21: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:28: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/borrowck/borrowck-mut-slice-of-imm-vec.nll.stderr b/src/test/ui/borrowck/borrowck-mut-slice-of-imm-vec.nll.stderr new file mode 100644 index 0000000000000..7c151da3c368b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-mut-slice-of-imm-vec.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-mut-slice-of-imm-vec.rs rename to src/test/ui/borrowck/borrowck-mut-slice-of-imm-vec.rs diff --git a/src/test/ui/borrowck/borrowck-mut-slice-of-imm-vec.stderr b/src/test/ui/borrowck/borrowck-mut-slice-of-imm-vec.stderr new file mode 100644 index 0000000000000..e2fd9d771f1aa --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-mutate-in-guard.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-mutate-in-guard.rs rename to src/test/ui/borrowck/borrowck-mutate-in-guard.rs diff --git a/src/test/ui/borrowck/borrowck-mutate-in-guard.stderr b/src/test/ui/borrowck/borrowck-mutate-in-guard.stderr new file mode 100644 index 0000000000000..7a111a1bbccc4 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-no-cycle-in-exchange-heap.nll.stderr b/src/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.nll.stderr new file mode 100644 index 0000000000000..9bb1e825f2598 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-no-cycle-in-exchange-heap.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-no-cycle-in-exchange-heap.rs rename to src/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.rs diff --git a/src/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.stderr b/src/test/ui/borrowck/borrowck-no-cycle-in-exchange-heap.stderr new file mode 100644 index 0000000000000..693f25e243cb1 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-object-lifetime.rs similarity index 97% rename from src/test/compile-fail/borrowck/borrowck-object-lifetime.rs rename to src/test/ui/borrowck/borrowck-object-lifetime.rs index 021b3f38e0019..23148304d6c4e 100644 --- a/src/test/compile-fail/borrowck/borrowck-object-lifetime.rs +++ b/src/test/ui/borrowck/borrowck-object-lifetime.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that borrows that occur due to calls to object methods // properly "claim" the object path. diff --git a/src/test/ui/borrowck/borrowck-object-lifetime.stderr b/src/test/ui/borrowck/borrowck-object-lifetime.stderr new file mode 100644 index 0000000000000..5680007579548 --- /dev/null +++ b/src/test/ui/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:28: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:33: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/borrowck/borrowck-or-init.nll.stderr b/src/test/ui/borrowck/borrowck-or-init.nll.stderr new file mode 100644 index 0000000000000..dd8bf87973516 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-or-init.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-or-init.rs rename to src/test/ui/borrowck/borrowck-or-init.rs diff --git a/src/test/ui/borrowck/borrowck-or-init.stderr b/src/test/ui/borrowck/borrowck-or-init.stderr new file mode 100644 index 0000000000000..bc1c3a51667fb --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-call.nll.stderr b/src/test/ui/borrowck/borrowck-overloaded-call.nll.stderr new file mode 100644 index 0000000000000..dc8d731dede74 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-call.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-overloaded-call.rs rename to src/test/ui/borrowck/borrowck-overloaded-call.rs diff --git a/src/test/ui/borrowck/borrowck-overloaded-call.stderr b/src/test/ui/borrowck/borrowck-overloaded-call.stderr new file mode 100644 index 0000000000000..213d78339e2a4 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.nll.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.nll.stderr new file mode 100644 index 0000000000000..874e6d74b643c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-and-overloaded-deref.ast.stderr new file mode 100644 index 0000000000000..8343b60dfbfa8 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-and-overloaded-deref.mir.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-and-overloaded-deref.mir.stderr new file mode 100644 index 0000000000000..874e6d74b643c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-and-overloaded-deref.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-overloaded-index-and-overloaded-deref.rs rename to src/test/ui/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/borrowck/borrowck-overloaded-index-autoderef.rs similarity index 98% rename from src/test/compile-fail/borrowck/borrowck-overloaded-index-autoderef.rs rename to src/test/ui/borrowck/borrowck-overloaded-index-autoderef.rs index b726c46d5d533..51d154c0f3abc 100644 --- a/src/test/compile-fail/borrowck/borrowck-overloaded-index-autoderef.rs +++ b/src/test/ui/borrowck/borrowck-overloaded-index-autoderef.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that we still see borrowck errors of various kinds when using // indexing and autoderef in combination. diff --git a/src/test/ui/borrowck/borrowck-overloaded-index-autoderef.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-autoderef.stderr new file mode 100644 index 0000000000000..d269ce5ec34c3 --- /dev/null +++ b/src/test/ui/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:47: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:52: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:61: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:71: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:76: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:81: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:86: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:91: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/borrowck/borrowck-overloaded-index-move-from-vec.nll.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-move-from-vec.nll.stderr new file mode 100644 index 0000000000000..4a72d7f330266 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-move-from-vec.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-overloaded-index-move-from-vec.rs rename to src/test/ui/borrowck/borrowck-overloaded-index-move-from-vec.rs diff --git a/src/test/ui/borrowck/borrowck-overloaded-index-move-from-vec.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-move-from-vec.stderr new file mode 100644 index 0000000000000..56246cbf770a6 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-move-index.nll.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-move-index.nll.stderr new file mode 100644 index 0000000000000..824d8298ecbc6 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-move-index.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-overloaded-index-move-index.rs rename to src/test/ui/borrowck/borrowck-overloaded-index-move-index.rs diff --git a/src/test/ui/borrowck/borrowck-overloaded-index-move-index.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-move-index.stderr new file mode 100644 index 0000000000000..cfa5a6e317d1b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-ref-index.ast.nll.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-ref-index.ast.nll.stderr new file mode 100644 index 0000000000000..3a2bfb18cb9e6 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-ref-index.ast.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-ref-index.ast.stderr new file mode 100644 index 0000000000000..8675c5b7ac6a8 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-overloaded-index-ref-index.ast.stderr @@ -0,0 +1,35 @@ +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 + | + = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `Bar` + +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/borrowck/borrowck-overloaded-index-ref-index.mir.stderr b/src/test/ui/borrowck/borrowck-overloaded-index-ref-index.mir.stderr new file mode 100644 index 0000000000000..3a2bfb18cb9e6 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-overloaded-index-ref-index.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-overloaded-index-ref-index.rs rename to src/test/ui/borrowck/borrowck-overloaded-index-ref-index.rs diff --git a/src/test/ui/borrowck/borrowck-partial-reinit-1.nll.stderr b/src/test/ui/borrowck/borrowck-partial-reinit-1.nll.stderr new file mode 100644 index 0000000000000..0444bf97c65ce --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-partial-reinit-1.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-partial-reinit-1.rs rename to src/test/ui/borrowck/borrowck-partial-reinit-1.rs diff --git a/src/test/ui/borrowck/borrowck-partial-reinit-1.stderr b/src/test/ui/borrowck/borrowck-partial-reinit-1.stderr new file mode 100644 index 0000000000000..c03921cd3dd9a --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-partial-reinit-2.nll.stderr b/src/test/ui/borrowck/borrowck-partial-reinit-2.nll.stderr new file mode 100644 index 0000000000000..14272fa3ed5d5 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-partial-reinit-2.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-partial-reinit-2.rs rename to src/test/ui/borrowck/borrowck-partial-reinit-2.rs diff --git a/src/test/ui/borrowck/borrowck-partial-reinit-2.stderr b/src/test/ui/borrowck/borrowck-partial-reinit-2.stderr new file mode 100644 index 0000000000000..4ed87b9529250 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-partial-reinit-3.nll.stderr b/src/test/ui/borrowck/borrowck-partial-reinit-3.nll.stderr new file mode 100644 index 0000000000000..3979f1e67536d --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-partial-reinit-3.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-partial-reinit-3.rs rename to src/test/ui/borrowck/borrowck-partial-reinit-3.rs diff --git a/src/test/ui/borrowck/borrowck-partial-reinit-3.stderr b/src/test/ui/borrowck/borrowck-partial-reinit-3.stderr new file mode 100644 index 0000000000000..66465c0737454 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-partial-reinit-4.nll.stderr b/src/test/ui/borrowck/borrowck-partial-reinit-4.nll.stderr new file mode 100644 index 0000000000000..e1ede72a7c9ba --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-partial-reinit-4.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-partial-reinit-4.rs rename to src/test/ui/borrowck/borrowck-partial-reinit-4.rs diff --git a/src/test/ui/borrowck/borrowck-partial-reinit-4.stderr b/src/test/ui/borrowck/borrowck-partial-reinit-4.stderr new file mode 100644 index 0000000000000..229a53ad82717 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-pat-reassign-binding.ast.nll.stderr b/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.nll.stderr new file mode 100644 index 0000000000000..cfcf177efa3eb --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-pat-reassign-binding.ast.stderr b/src/test/ui/borrowck/borrowck-pat-reassign-binding.ast.stderr new file mode 100644 index 0000000000000..fdc04e226a52b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-pat-reassign-binding.mir.stderr b/src/test/ui/borrowck/borrowck-pat-reassign-binding.mir.stderr new file mode 100644 index 0000000000000..cfcf177efa3eb --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-pat-reassign-binding.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-pat-reassign-binding.rs rename to src/test/ui/borrowck/borrowck-pat-reassign-binding.rs diff --git a/src/test/ui/borrowck/borrowck-reborrow-from-mut.nll.stderr b/src/test/ui/borrowck/borrowck-reborrow-from-mut.nll.stderr new file mode 100644 index 0000000000000..4c81bb8eb3086 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-reborrow-from-mut.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-reborrow-from-mut.rs rename to src/test/ui/borrowck/borrowck-reborrow-from-mut.rs diff --git a/src/test/ui/borrowck/borrowck-reborrow-from-mut.stderr b/src/test/ui/borrowck/borrowck-reborrow-from-mut.stderr new file mode 100644 index 0000000000000..00660ff84841b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.nll.stderr new file mode 100644 index 0000000000000..43c2a84c95780 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs rename to src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.rs diff --git a/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr b/src/test/ui/borrowck/borrowck-reborrow-from-shorter-lived-andmut.stderr new file mode 100644 index 0000000000000..52dabfaa1d481 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-ref-mut-of-imm.nll.stderr b/src/test/ui/borrowck/borrowck-ref-mut-of-imm.nll.stderr new file mode 100644 index 0000000000000..ccea5d9565be1 --- /dev/null +++ b/src/test/ui/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 { + | - 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/borrowck/borrowck-ref-mut-of-imm.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-ref-mut-of-imm.rs rename to src/test/ui/borrowck/borrowck-ref-mut-of-imm.rs diff --git a/src/test/ui/borrowck/borrowck-ref-mut-of-imm.stderr b/src/test/ui/borrowck/borrowck-ref-mut-of-imm.stderr new file mode 100644 index 0000000000000..2e2a1224306cb --- /dev/null +++ b/src/test/ui/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 { + | - 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/borrowck/borrowck-return-variable-on-stack-via-clone.nll.stderr b/src/test/ui/borrowck/borrowck-return-variable-on-stack-via-clone.nll.stderr new file mode 100644 index 0000000000000..93436d0ca9745 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-return-variable-on-stack-via-clone.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-return-variable-on-stack-via-clone.rs rename to src/test/ui/borrowck/borrowck-return-variable-on-stack-via-clone.rs diff --git a/src/test/ui/borrowck/borrowck-return-variable-on-stack-via-clone.stderr b/src/test/ui/borrowck/borrowck-return-variable-on-stack-via-clone.stderr new file mode 100644 index 0000000000000..69d5229244bdb --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-return.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-return.rs rename to src/test/ui/borrowck/borrowck-return.rs diff --git a/src/test/ui/borrowck/borrowck-return.stderr b/src/test/ui/borrowck/borrowck-return.stderr new file mode 100644 index 0000000000000..7223289b376e1 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-storage-dead.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-storage-dead.rs rename to src/test/ui/borrowck/borrowck-storage-dead.rs diff --git a/src/test/ui/borrowck/borrowck-storage-dead.stderr b/src/test/ui/borrowck/borrowck-storage-dead.stderr new file mode 100644 index 0000000000000..edb7c13cf8bdb --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-struct-update-with-dtor.ast.nll.stderr b/src/test/ui/borrowck/borrowck-struct-update-with-dtor.ast.nll.stderr new file mode 100644 index 0000000000000..a811f5d4defc8 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-struct-update-with-dtor.ast.stderr b/src/test/ui/borrowck/borrowck-struct-update-with-dtor.ast.stderr new file mode 100644 index 0000000000000..aebee2c33216b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-struct-update-with-dtor.mir.stderr b/src/test/ui/borrowck/borrowck-struct-update-with-dtor.mir.stderr new file mode 100644 index 0000000000000..a811f5d4defc8 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-struct-update-with-dtor.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-struct-update-with-dtor.rs rename to src/test/ui/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/borrowck/borrowck-swap-mut-base-ptr.rs similarity index 96% rename from src/test/compile-fail/borrowck/borrowck-swap-mut-base-ptr.rs rename to src/test/ui/borrowck/borrowck-swap-mut-base-ptr.rs index 552fcec8e2858..cf9fab9f0a183 100644 --- a/src/test/compile-fail/borrowck/borrowck-swap-mut-base-ptr.rs +++ b/src/test/ui/borrowck/borrowck-swap-mut-base-ptr.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that attempt to swap `&mut` pointer while pointee is borrowed // yields an error. // diff --git a/src/test/ui/borrowck/borrowck-swap-mut-base-ptr.stderr b/src/test/ui/borrowck/borrowck-swap-mut-base-ptr.stderr new file mode 100644 index 0000000000000..f9e4a580ccc6c --- /dev/null +++ b/src/test/ui/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:23: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/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr new file mode 100644 index 0000000000000..7373457e71988 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.nll.stderr @@ -0,0 +1,12 @@ +error[E0712]: thread-local variable borrowed past end of function + --> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:21:20 + | +LL | assert_static(&FOO); //[ast]~ ERROR [E0597] + | ^^^^ thread-local variables cannot be borrowed beyond the end of the function +LL | //[mir]~^ ERROR [E0712] +LL | } + | - end of enclosing function is here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0712`. diff --git a/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.stderr b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.ast.stderr new file mode 100644 index 0000000000000..27e0dba5095b2 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr new file mode 100644 index 0000000000000..7373457e71988 --- /dev/null +++ b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.mir.stderr @@ -0,0 +1,12 @@ +error[E0712]: thread-local variable borrowed past end of function + --> $DIR/borrowck-thread-local-static-borrow-outlives-fn.rs:21:20 + | +LL | assert_static(&FOO); //[ast]~ ERROR [E0597] + | ^^^^ thread-local variables cannot be borrowed beyond the end of the function +LL | //[mir]~^ ERROR [E0712] +LL | } + | - end of enclosing function is here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0712`. diff --git a/src/test/compile-fail/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs b/src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs rename to src/test/ui/borrowck/borrowck-thread-local-static-borrow-outlives-fn.rs diff --git a/src/test/ui/borrowck/borrowck-unary-move.ast.nll.stderr b/src/test/ui/borrowck/borrowck-unary-move.ast.nll.stderr new file mode 100644 index 0000000000000..caeaa173bb85e --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-unary-move.ast.stderr b/src/test/ui/borrowck/borrowck-unary-move.ast.stderr new file mode 100644 index 0000000000000..968fbb4526d04 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-unary-move.mir.stderr b/src/test/ui/borrowck/borrowck-unary-move.mir.stderr new file mode 100644 index 0000000000000..caeaa173bb85e --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-unary-move.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-unary-move.rs rename to src/test/ui/borrowck/borrowck-unary-move.rs diff --git a/src/test/ui/borrowck/borrowck-unboxed-closures.nll.stderr b/src/test/ui/borrowck/borrowck-unboxed-closures.nll.stderr new file mode 100644 index 0000000000000..3fbb747db24f1 --- /dev/null +++ b/src/test/ui/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 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/borrowck/borrowck-unboxed-closures.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-unboxed-closures.rs rename to src/test/ui/borrowck/borrowck-unboxed-closures.rs diff --git a/src/test/ui/borrowck/borrowck-unboxed-closures.stderr b/src/test/ui/borrowck/borrowck-unboxed-closures.stderr new file mode 100644 index 0000000000000..03b835d30770b --- /dev/null +++ b/src/test/ui/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 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/borrowck/borrowck-uninit-after-item.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-uninit-after-item.rs rename to src/test/ui/borrowck/borrowck-uninit-after-item.rs diff --git a/src/test/ui/borrowck/borrowck-uninit-after-item.stderr b/src/test/ui/borrowck/borrowck-uninit-after-item.stderr new file mode 100644 index 0000000000000..17f9c0197ab79 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-uninit-field-access.ast.nll.stderr b/src/test/ui/borrowck/borrowck-uninit-field-access.ast.nll.stderr new file mode 100644 index 0000000000000..9c7dbd7e77884 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-uninit-field-access.ast.stderr b/src/test/ui/borrowck/borrowck-uninit-field-access.ast.stderr new file mode 100644 index 0000000000000..8536bf22de905 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-uninit-field-access.mir.stderr b/src/test/ui/borrowck/borrowck-uninit-field-access.mir.stderr new file mode 100644 index 0000000000000..9c7dbd7e77884 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-uninit-field-access.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-uninit-field-access.rs rename to src/test/ui/borrowck/borrowck-uninit-field-access.rs diff --git a/src/test/compile-fail/borrowck/borrowck-uninit-in-assignop.rs b/src/test/ui/borrowck/borrowck-uninit-in-assignop.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-uninit-in-assignop.rs rename to src/test/ui/borrowck/borrowck-uninit-in-assignop.rs diff --git a/src/test/ui/borrowck/borrowck-uninit-in-assignop.stderr b/src/test/ui/borrowck/borrowck-uninit-in-assignop.stderr new file mode 100644 index 0000000000000..7d905f647619b --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr b/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.nll.stderr new file mode 100644 index 0000000000000..bd9836e3174fb --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-uninit-ref-chain.ast.stderr b/src/test/ui/borrowck/borrowck-uninit-ref-chain.ast.stderr new file mode 100644 index 0000000000000..6b51414e5a200 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-uninit-ref-chain.mir.stderr b/src/test/ui/borrowck/borrowck-uninit-ref-chain.mir.stderr new file mode 100644 index 0000000000000..bd9836e3174fb --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-uninit-ref-chain.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-uninit-ref-chain.rs rename to src/test/ui/borrowck/borrowck-uninit-ref-chain.rs diff --git a/src/test/compile-fail/borrowck/borrowck-uninit.rs b/src/test/ui/borrowck/borrowck-uninit.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-uninit.rs rename to src/test/ui/borrowck/borrowck-uninit.rs diff --git a/src/test/ui/borrowck/borrowck-uninit.stderr b/src/test/ui/borrowck/borrowck-uninit.stderr new file mode 100644 index 0000000000000..ce78001dc64aa --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-union-borrow-nested.rs similarity index 97% rename from src/test/compile-fail/borrowck/borrowck-union-borrow-nested.rs rename to src/test/ui/borrowck/borrowck-union-borrow-nested.rs index 6298c87453ca6..f1c4e4c1869c5 100644 --- a/src/test/compile-fail/borrowck/borrowck-union-borrow-nested.rs +++ b/src/test/ui/borrowck/borrowck-union-borrow-nested.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #[derive(Clone, Copy)] struct S { a: u8, diff --git a/src/test/ui/borrowck/borrowck-union-borrow-nested.stderr b/src/test/ui/borrowck/borrowck-union-borrow-nested.stderr new file mode 100644 index 0000000000000..4e7392a422814 --- /dev/null +++ b/src/test/ui/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:35: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/borrowck/borrowck-union-borrow.ast.nll.stderr b/src/test/ui/borrowck/borrowck-union-borrow.ast.nll.stderr new file mode 100644 index 0000000000000..2f14826fa1253 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-union-borrow.ast.stderr b/src/test/ui/borrowck/borrowck-union-borrow.ast.stderr new file mode 100644 index 0000000000000..9a02070579213 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-union-borrow.mir.stderr b/src/test/ui/borrowck/borrowck-union-borrow.mir.stderr new file mode 100644 index 0000000000000..2f14826fa1253 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-union-borrow.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-union-borrow.rs rename to src/test/ui/borrowck/borrowck-union-borrow.rs diff --git a/src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr b/src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr new file mode 100644 index 0000000000000..2a877050e4c87 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-union-move-assign.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-union-move-assign.rs rename to src/test/ui/borrowck/borrowck-union-move-assign.rs diff --git a/src/test/ui/borrowck/borrowck-union-move-assign.stderr b/src/test/ui/borrowck/borrowck-union-move-assign.stderr new file mode 100644 index 0000000000000..b0924d28c9c56 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-union-move.nll.stderr b/src/test/ui/borrowck/borrowck-union-move.nll.stderr new file mode 100644 index 0000000000000..6fd6a1c82a1a0 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-union-move.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-union-move.rs rename to src/test/ui/borrowck/borrowck-union-move.rs diff --git a/src/test/ui/borrowck/borrowck-union-move.stderr b/src/test/ui/borrowck/borrowck-union-move.stderr new file mode 100644 index 0000000000000..d3e441bbbf481 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-union-uninitialized.nll.stderr b/src/test/ui/borrowck/borrowck-union-uninitialized.nll.stderr new file mode 100644 index 0000000000000..49bc6d3263660 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-union-uninitialized.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-union-uninitialized.rs rename to src/test/ui/borrowck/borrowck-union-uninitialized.rs diff --git a/src/test/ui/borrowck/borrowck-union-uninitialized.stderr b/src/test/ui/borrowck/borrowck-union-uninitialized.stderr new file mode 100644 index 0000000000000..901d1ecc50642 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-uniq-via-lend.rs similarity index 98% rename from src/test/compile-fail/borrowck/borrowck-uniq-via-lend.rs rename to src/test/ui/borrowck/borrowck-uniq-via-lend.rs index f36dc0ca43fa2..5a4e27768afc3 100644 --- a/src/test/compile-fail/borrowck/borrowck-uniq-via-lend.rs +++ b/src/test/ui/borrowck/borrowck-uniq-via-lend.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![feature(box_syntax)] fn borrow(_v: &isize) {} diff --git a/src/test/ui/borrowck/borrowck-uniq-via-lend.stderr b/src/test/ui/borrowck/borrowck-uniq-via-lend.stderr new file mode 100644 index 0000000000000..b731a6192d132 --- /dev/null +++ b/src/test/ui/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:45: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:60: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/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.nll.stderr new file mode 100644 index 0000000000000..d69693eb03532 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-in-index-lvalue.ast.stderr b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.ast.stderr new file mode 100644 index 0000000000000..3a33081dfcdd2 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-in-index-lvalue.mir.stderr b/src/test/ui/borrowck/borrowck-use-in-index-lvalue.mir.stderr new file mode 100644 index 0000000000000..d69693eb03532 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-in-index-lvalue.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-use-in-index-lvalue.rs rename to src/test/ui/borrowck/borrowck-use-in-index-lvalue.rs diff --git a/src/test/ui/borrowck/borrowck-use-mut-borrow.nll.stderr b/src/test/ui/borrowck/borrowck-use-mut-borrow.nll.stderr new file mode 100644 index 0000000000000..2289dd688cfd7 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-mut-borrow.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-use-mut-borrow.rs rename to src/test/ui/borrowck/borrowck-use-mut-borrow.rs diff --git a/src/test/ui/borrowck/borrowck-use-mut-borrow.stderr b/src/test/ui/borrowck/borrowck-use-mut-borrow.stderr new file mode 100644 index 0000000000000..c5bfd813a791e --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.nll.stderr new file mode 100644 index 0000000000000..b96379db650bb --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.ast.stderr new file mode 100644 index 0000000000000..47ea9f33b1e25 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.mir.stderr new file mode 100644 index 0000000000000..b96379db650bb --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-uninitialized-in-cast-trait.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-use-uninitialized-in-cast-trait.rs rename to src/test/ui/borrowck/borrowck-use-uninitialized-in-cast-trait.rs diff --git a/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.nll.stderr new file mode 100644 index 0000000000000..6eddbd934d54e --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-uninitialized-in-cast.ast.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.ast.stderr new file mode 100644 index 0000000000000..75109abad51f1 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr b/src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.mir.stderr new file mode 100644 index 0000000000000..6eddbd934d54e --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-use-uninitialized-in-cast.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-use-uninitialized-in-cast.rs rename to src/test/ui/borrowck/borrowck-use-uninitialized-in-cast.rs diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-element-loan.nll.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-element-loan.nll.stderr new file mode 100644 index 0000000000000..374256c6bd6b9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-vec-pattern-element-loan.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-vec-pattern-element-loan.rs rename to src/test/ui/borrowck/borrowck-vec-pattern-element-loan.rs diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-element-loan.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-element-loan.stderr new file mode 100644 index 0000000000000..656a25d14fc94 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-vec-pattern-loan-from-mut.nll.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.nll.stderr new file mode 100644 index 0000000000000..9b73991ce30d8 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-vec-pattern-loan-from-mut.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-vec-pattern-loan-from-mut.rs rename to src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.rs diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-loan-from-mut.stderr new file mode 100644 index 0000000000000..7015923af0aaa --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.nll.stderr new file mode 100644 index 0000000000000..f99e2cec33028 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-vec-pattern-move-tail.ast.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.ast.stderr new file mode 100644 index 0000000000000..2b32de6944a4c --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-vec-pattern-move-tail.cmp.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-move-tail.cmp.stderr new file mode 100644 index 0000000000000..a6aa9cd6d2a13 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-vec-pattern-move-tail.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-vec-pattern-move-tail.rs rename to src/test/ui/borrowck/borrowck-vec-pattern-move-tail.rs diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.nll.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.nll.stderr new file mode 100644 index 0000000000000..6d45f1541a0fe --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-vec-pattern-tail-element-loan.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-vec-pattern-tail-element-loan.rs rename to src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.rs diff --git a/src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.stderr b/src/test/ui/borrowck/borrowck-vec-pattern-tail-element-loan.stderr new file mode 100644 index 0000000000000..36343c1bde6d6 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-while-break.nll.stderr b/src/test/ui/borrowck/borrowck-while-break.nll.stderr new file mode 100644 index 0000000000000..de2ba578962e6 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-while-break.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-while-break.rs rename to src/test/ui/borrowck/borrowck-while-break.rs diff --git a/src/test/ui/borrowck/borrowck-while-break.stderr b/src/test/ui/borrowck/borrowck-while-break.stderr new file mode 100644 index 0000000000000..eaaecdb5bbbd9 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-while-cond.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-while-cond.rs rename to src/test/ui/borrowck/borrowck-while-cond.rs diff --git a/src/test/ui/borrowck/borrowck-while-cond.stderr b/src/test/ui/borrowck/borrowck-while-cond.stderr new file mode 100644 index 0000000000000..41ef9e800bde4 --- /dev/null +++ b/src/test/ui/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/borrowck/borrowck-while.rs similarity index 100% rename from src/test/compile-fail/borrowck/borrowck-while.rs rename to src/test/ui/borrowck/borrowck-while.rs diff --git a/src/test/ui/borrowck/borrowck-while.stderr b/src/test/ui/borrowck/borrowck-while.stderr new file mode 100644 index 0000000000000..9fb2dcaa436d9 --- /dev/null +++ b/src/test/ui/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/borrowck/move-in-static-initializer-issue-38520.ast.stderr b/src/test/ui/borrowck/move-in-static-initializer-issue-38520.ast.stderr new file mode 100644 index 0000000000000..4c399ab6014df --- /dev/null +++ b/src/test/ui/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/borrowck/move-in-static-initializer-issue-38520.mir.stderr b/src/test/ui/borrowck/move-in-static-initializer-issue-38520.mir.stderr new file mode 100644 index 0000000000000..4c399ab6014df --- /dev/null +++ b/src/test/ui/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/borrowck/move-in-static-initializer-issue-38520.rs similarity index 100% rename from src/test/compile-fail/borrowck/move-in-static-initializer-issue-38520.rs rename to src/test/ui/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/borrowck/two-phase-across-loop.rs similarity index 100% rename from src/test/compile-fail/borrowck/two-phase-across-loop.rs rename to src/test/ui/borrowck/two-phase-across-loop.rs diff --git a/src/test/ui/borrowck/two-phase-across-loop.stderr b/src/test/ui/borrowck/two-phase-across-loop.stderr new file mode 100644 index 0000000000000..65c3d27923ef5 --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-activation-sharing-interference.nll_target.stderr b/src/test/ui/borrowck/two-phase-activation-sharing-interference.nll_target.stderr new file mode 100644 index 0000000000000..5a7f33e5b56a3 --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-activation-sharing-interference.rs similarity index 100% rename from src/test/compile-fail/borrowck/two-phase-activation-sharing-interference.rs rename to src/test/ui/borrowck/two-phase-activation-sharing-interference.rs diff --git a/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr b/src/test/ui/borrowck/two-phase-allow-access-during-reservation.nll_target.stderr new file mode 100644 index 0000000000000..45cfc836017b1 --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-allow-access-during-reservation.rs similarity index 100% rename from src/test/compile-fail/borrowck/two-phase-allow-access-during-reservation.rs rename to src/test/ui/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/borrowck/two-phase-cannot-nest-mut-self-calls.rs similarity index 100% rename from src/test/compile-fail/borrowck/two-phase-cannot-nest-mut-self-calls.rs rename to src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.rs diff --git a/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr b/src/test/ui/borrowck/two-phase-cannot-nest-mut-self-calls.stderr new file mode 100644 index 0000000000000..942a38febdd49 --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-nonrecv-autoref.ast.nll.stderr b/src/test/ui/borrowck/two-phase-nonrecv-autoref.ast.nll.stderr new file mode 100644 index 0000000000000..a8651c0e741bf --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-nonrecv-autoref.ast.stderr b/src/test/ui/borrowck/two-phase-nonrecv-autoref.ast.stderr new file mode 100644 index 0000000000000..b64323a5cc421 --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-nonrecv-autoref.nll.stderr b/src/test/ui/borrowck/two-phase-nonrecv-autoref.nll.stderr new file mode 100644 index 0000000000000..a8651c0e741bf --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-nonrecv-autoref.rs similarity index 100% rename from src/test/compile-fail/borrowck/two-phase-nonrecv-autoref.rs rename to src/test/ui/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/borrowck/two-phase-reservation-sharing-interference-2.rs similarity index 100% rename from src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference-2.rs rename to src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.rs diff --git a/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference-2.stderr new file mode 100644 index 0000000000000..2ac10a82f7b05 --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr b/src/test/ui/borrowck/two-phase-reservation-sharing-interference.nll_target.stderr new file mode 100644 index 0000000000000..62a548af62b5f --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-reservation-sharing-interference.rs similarity index 100% rename from src/test/compile-fail/borrowck/two-phase-reservation-sharing-interference.rs rename to src/test/ui/borrowck/two-phase-reservation-sharing-interference.rs diff --git a/src/test/ui/borrowck/two-phase-sneaky.nll.stderr b/src/test/ui/borrowck/two-phase-sneaky.nll.stderr new file mode 100644 index 0000000000000..26a6271bbdea2 --- /dev/null +++ b/src/test/ui/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/borrowck/two-phase-sneaky.rs similarity index 100% rename from src/test/compile-fail/borrowck/two-phase-sneaky.rs rename to src/test/ui/borrowck/two-phase-sneaky.rs diff --git a/src/test/ui/borrowck/two-phase-sneaky.stderr b/src/test/ui/borrowck/two-phase-sneaky.stderr new file mode 100644 index 0000000000000..1ab9c18848270 --- /dev/null +++ b/src/test/ui/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/bounds-lifetime.rs similarity index 100% rename from src/test/compile-fail/bounds-lifetime.rs rename to src/test/ui/bounds-lifetime.rs diff --git a/src/test/ui/bounds-lifetime.stderr b/src/test/ui/bounds-lifetime.stderr new file mode 100644 index 0000000000000..cbd140c13bece --- /dev/null +++ b/src/test/ui/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 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/break-outside-loop.rs similarity index 100% rename from src/test/compile-fail/break-outside-loop.rs rename to src/test/ui/break-outside-loop.rs diff --git a/src/test/ui/break-outside-loop.stderr b/src/test/ui/break-outside-loop.stderr new file mode 100644 index 0000000000000..820272d7e801b --- /dev/null +++ b/src/test/ui/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/auxiliary/trait_superkinds_in_metadata.rs b/src/test/ui/builtin-superkinds/auxiliary/trait_superkinds_in_metadata.rs similarity index 100% rename from src/test/compile-fail/auxiliary/trait_superkinds_in_metadata.rs rename to src/test/ui/builtin-superkinds/auxiliary/trait_superkinds_in_metadata.rs diff --git a/src/test/compile-fail/builtin-superkinds-double-superkind.rs b/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.rs similarity index 100% rename from src/test/compile-fail/builtin-superkinds-double-superkind.rs rename to src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.rs diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-double-superkind.stderr new file mode 100644 index 0000000000000..a462fcf4de4d6 --- /dev/null +++ b/src/test/ui/builtin-superkinds/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 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 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/builtin-superkinds/builtin-superkinds-in-metadata.rs similarity index 100% rename from src/test/compile-fail/builtin-superkinds-in-metadata.rs rename to src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.rs diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr new file mode 100644 index 0000000000000..dcc7e3cd35086 --- /dev/null +++ b/src/test/ui/builtin-superkinds/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 RequiresRequiresShareAndSend for X { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `T` cannot be sent between threads safely + | + = help: within `X`, 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` + +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/builtin-superkinds/builtin-superkinds-self-type.rs similarity index 100% rename from src/test/compile-fail/builtin-superkinds-self-type.rs rename to src/test/ui/builtin-superkinds/builtin-superkinds-self-type.rs diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-self-type.stderr new file mode 100644 index 0000000000000..f96393d4b8543 --- /dev/null +++ b/src/test/ui/builtin-superkinds/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 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 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/builtin-superkinds/builtin-superkinds-simple.rs similarity index 100% rename from src/test/compile-fail/builtin-superkinds-simple.rs rename to src/test/ui/builtin-superkinds/builtin-superkinds-simple.rs diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-simple.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-simple.stderr new file mode 100644 index 0000000000000..043953e7a2bfc --- /dev/null +++ b/src/test/ui/builtin-superkinds/builtin-superkinds-simple.stderr @@ -0,0 +1,11 @@ +error[E0277]: `std::rc::Rc` cannot be sent between threads safely + --> $DIR/builtin-superkinds-simple.rs:16:6 + | +LL | impl Foo for std::rc::Rc { } + | ^^^ `std::rc::Rc` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `std::rc::Rc` + +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/builtin-superkinds/builtin-superkinds-typaram-not-send.rs similarity index 100% rename from src/test/compile-fail/builtin-superkinds-typaram-not-send.rs rename to src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.rs diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-typaram-not-send.stderr new file mode 100644 index 0000000000000..00bad2e80ef9a --- /dev/null +++ b/src/test/ui/builtin-superkinds/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 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/by-move-pattern-binding.nll.stderr b/src/test/ui/by-move-pattern-binding.nll.stderr new file mode 100644 index 0000000000000..4ba9b3aeb5d5d --- /dev/null +++ b/src/test/ui/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/by-move-pattern-binding.rs similarity index 100% rename from src/test/compile-fail/by-move-pattern-binding.rs rename to src/test/ui/by-move-pattern-binding.rs diff --git a/src/test/ui/by-move-pattern-binding.stderr b/src/test/ui/by-move-pattern-binding.stderr new file mode 100644 index 0000000000000..a20de4ba42a5b --- /dev/null +++ b/src/test/ui/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/call-fn-never-arg-wrong-type.rs similarity index 100% rename from src/test/compile-fail/call-fn-never-arg-wrong-type.rs rename to src/test/ui/call-fn-never-arg-wrong-type.rs diff --git a/src/test/ui/call-fn-never-arg-wrong-type.stderr b/src/test/ui/call-fn-never-arg-wrong-type.stderr new file mode 100644 index 0000000000000..84ed8d15a425d --- /dev/null +++ b/src/test/ui/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/can-begin-expr-check.rs similarity index 100% rename from src/test/compile-fail/can-begin-expr-check.rs rename to src/test/ui/can-begin-expr-check.rs diff --git a/src/test/ui/can-begin-expr-check.stderr b/src/test/ui/can-begin-expr-check.stderr new file mode 100644 index 0000000000000..ddcb69c5ee3cf --- /dev/null +++ b/src/test/ui/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/cannot-mutate-captured-non-mut-var.ast.nll.stderr b/src/test/ui/cannot-mutate-captured-non-mut-var.ast.nll.stderr new file mode 100644 index 0000000000000..a7ffc06872c2e --- /dev/null +++ b/src/test/ui/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/cannot-mutate-captured-non-mut-var.ast.stderr b/src/test/ui/cannot-mutate-captured-non-mut-var.ast.stderr new file mode 100644 index 0000000000000..02d57ca48f232 --- /dev/null +++ b/src/test/ui/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/cannot-mutate-captured-non-mut-var.mir.stderr b/src/test/ui/cannot-mutate-captured-non-mut-var.mir.stderr new file mode 100644 index 0000000000000..a7ffc06872c2e --- /dev/null +++ b/src/test/ui/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/cannot-mutate-captured-non-mut-var.rs similarity index 100% rename from src/test/compile-fail/cannot-mutate-captured-non-mut-var.rs rename to src/test/ui/cannot-mutate-captured-non-mut-var.rs diff --git a/src/test/compile-fail/capture1.rs b/src/test/ui/capture1.rs similarity index 100% rename from src/test/compile-fail/capture1.rs rename to src/test/ui/capture1.rs diff --git a/src/test/ui/capture1.stderr b/src/test/ui/capture1.stderr new file mode 100644 index 0000000000000..82eb1b64cfc58 --- /dev/null +++ b/src/test/ui/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/ui/cast-as-bool.rs b/src/test/ui/cast/cast-as-bool.rs similarity index 100% rename from src/test/ui/cast-as-bool.rs rename to src/test/ui/cast/cast-as-bool.rs diff --git a/src/test/ui/cast-as-bool.stderr b/src/test/ui/cast/cast-as-bool.stderr similarity index 100% rename from src/test/ui/cast-as-bool.stderr rename to src/test/ui/cast/cast-as-bool.stderr diff --git a/src/test/ui/cast-errors-issue-43825.rs b/src/test/ui/cast/cast-errors-issue-43825.rs similarity index 100% rename from src/test/ui/cast-errors-issue-43825.rs rename to src/test/ui/cast/cast-errors-issue-43825.rs diff --git a/src/test/ui/cast-errors-issue-43825.stderr b/src/test/ui/cast/cast-errors-issue-43825.stderr similarity index 100% rename from src/test/ui/cast-errors-issue-43825.stderr rename to src/test/ui/cast/cast-errors-issue-43825.stderr diff --git a/src/test/compile-fail/cast-from-nil.rs b/src/test/ui/cast/cast-from-nil.rs similarity index 100% rename from src/test/compile-fail/cast-from-nil.rs rename to src/test/ui/cast/cast-from-nil.rs diff --git a/src/test/ui/cast/cast-from-nil.stderr b/src/test/ui/cast/cast-from-nil.stderr new file mode 100644 index 0000000000000..4400007f93d4a --- /dev/null +++ b/src/test/ui/cast/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/cast/cast-ptr-to-int-const.rs similarity index 100% rename from src/test/compile-fail/cast-ptr-to-int-const.rs rename to src/test/ui/cast/cast-ptr-to-int-const.rs diff --git a/src/test/ui/cast/cast-ptr-to-int-const.stderr b/src/test/ui/cast/cast-ptr-to-int-const.stderr new file mode 100644 index 0000000000000..7c3b4e42138e7 --- /dev/null +++ b/src/test/ui/cast/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/ui/cast-rfc0401-2.rs b/src/test/ui/cast/cast-rfc0401-2.rs similarity index 100% rename from src/test/ui/cast-rfc0401-2.rs rename to src/test/ui/cast/cast-rfc0401-2.rs diff --git a/src/test/ui/cast-rfc0401-2.stderr b/src/test/ui/cast/cast-rfc0401-2.stderr similarity index 100% rename from src/test/ui/cast-rfc0401-2.stderr rename to src/test/ui/cast/cast-rfc0401-2.stderr diff --git a/src/test/compile-fail/cast-to-bare-fn.rs b/src/test/ui/cast/cast-to-bare-fn.rs similarity index 100% rename from src/test/compile-fail/cast-to-bare-fn.rs rename to src/test/ui/cast/cast-to-bare-fn.rs diff --git a/src/test/ui/cast/cast-to-bare-fn.stderr b/src/test/ui/cast/cast-to-bare-fn.stderr new file mode 100644 index 0000000000000..ed07f37f4f138 --- /dev/null +++ b/src/test/ui/cast/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/cast/cast-to-nil.rs similarity index 100% rename from src/test/compile-fail/cast-to-nil.rs rename to src/test/ui/cast/cast-to-nil.rs diff --git a/src/test/ui/cast/cast-to-nil.stderr b/src/test/ui/cast/cast-to-nil.stderr new file mode 100644 index 0000000000000..f7ee68e3d2bb0 --- /dev/null +++ b/src/test/ui/cast/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/cast-to-unsized-trait-object-suggestion.rs b/src/test/ui/cast/cast-to-unsized-trait-object-suggestion.rs similarity index 100% rename from src/test/ui/cast-to-unsized-trait-object-suggestion.rs rename to src/test/ui/cast/cast-to-unsized-trait-object-suggestion.rs diff --git a/src/test/ui/cast-to-unsized-trait-object-suggestion.stderr b/src/test/ui/cast/cast-to-unsized-trait-object-suggestion.stderr similarity index 100% rename from src/test/ui/cast-to-unsized-trait-object-suggestion.stderr rename to src/test/ui/cast/cast-to-unsized-trait-object-suggestion.stderr diff --git a/src/test/ui/catch/catch-bad-lifetime.nll.stderr b/src/test/ui/catch/catch-bad-lifetime.nll.stderr new file mode 100644 index 0000000000000..dd1595f931511 --- /dev/null +++ b/src/test/ui/catch/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/catch/catch-bad-lifetime.rs similarity index 100% rename from src/test/compile-fail/catch-bad-lifetime.rs rename to src/test/ui/catch/catch-bad-lifetime.rs diff --git a/src/test/ui/catch/catch-bad-lifetime.stderr b/src/test/ui/catch/catch-bad-lifetime.stderr new file mode 100644 index 0000000000000..2ea54d1fb24db --- /dev/null +++ b/src/test/ui/catch/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/catch/catch-bad-type.rs similarity index 100% rename from src/test/compile-fail/catch-bad-type.rs rename to src/test/ui/catch/catch-bad-type.rs diff --git a/src/test/ui/catch/catch-bad-type.stderr b/src/test/ui/catch/catch-bad-type.stderr new file mode 100644 index 0000000000000..2ab5b3e31768c --- /dev/null +++ b/src/test/ui/catch/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: + > + > + > + > + > + = note: required by `std::convert::From::from` + +error[E0271]: type mismatch resolving ` 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 ` as std::ops::Try>::Ok == ()` + --> $DIR/catch-bad-type.rs:23:44 + | +LL | let res: Result = 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/ui/catch-block-type-error.rs b/src/test/ui/catch/catch-block-type-error.rs similarity index 100% rename from src/test/ui/catch-block-type-error.rs rename to src/test/ui/catch/catch-block-type-error.rs diff --git a/src/test/ui/catch-block-type-error.stderr b/src/test/ui/catch/catch-block-type-error.stderr similarity index 100% rename from src/test/ui/catch-block-type-error.stderr rename to src/test/ui/catch/catch-block-type-error.stderr diff --git a/src/test/compile-fail/catch-in-match.rs b/src/test/ui/catch/catch-in-match.rs similarity index 100% rename from src/test/compile-fail/catch-in-match.rs rename to src/test/ui/catch/catch-in-match.rs diff --git a/src/test/ui/catch/catch-in-match.stderr b/src/test/ui/catch/catch-in-match.stderr new file mode 100644 index 0000000000000..1542989cc359a --- /dev/null +++ b/src/test/ui/catch/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/catch/catch-in-while.rs similarity index 100% rename from src/test/compile-fail/catch-in-while.rs rename to src/test/ui/catch/catch-in-while.rs diff --git a/src/test/ui/catch/catch-in-while.stderr b/src/test/ui/catch/catch-in-while.stderr new file mode 100644 index 0000000000000..9316bbcd4bcfb --- /dev/null +++ b/src/test/ui/catch/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/catch/catch-maybe-bad-lifetime.nll.stderr b/src/test/ui/catch/catch-maybe-bad-lifetime.nll.stderr new file mode 100644 index 0000000000000..157793160ce4e --- /dev/null +++ b/src/test/ui/catch/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/catch/catch-maybe-bad-lifetime.rs similarity index 100% rename from src/test/compile-fail/catch-maybe-bad-lifetime.rs rename to src/test/ui/catch/catch-maybe-bad-lifetime.rs diff --git a/src/test/ui/catch/catch-maybe-bad-lifetime.stderr b/src/test/ui/catch/catch-maybe-bad-lifetime.stderr new file mode 100644 index 0000000000000..21fe1049f436e --- /dev/null +++ b/src/test/ui/catch/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/catch/catch-opt-init.nll.stderr b/src/test/ui/catch/catch-opt-init.nll.stderr new file mode 100644 index 0000000000000..ea8c8ebdcb7af --- /dev/null +++ b/src/test/ui/catch/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/catch/catch-opt-init.rs similarity index 100% rename from src/test/compile-fail/catch-opt-init.rs rename to src/test/ui/catch/catch-opt-init.rs diff --git a/src/test/ui/catch/catch-opt-init.stderr b/src/test/ui/catch/catch-opt-init.stderr new file mode 100644 index 0000000000000..6a14ba17f9e80 --- /dev/null +++ b/src/test/ui/catch/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/cdylib-deps-must-be-static.rs similarity index 100% rename from src/test/compile-fail/cdylib-deps-must-be-static.rs rename to src/test/ui/cdylib-deps-must-be-static.rs diff --git a/src/test/ui/cdylib-deps-must-be-static.stderr b/src/test/ui/cdylib-deps-must-be-static.stderr new file mode 100644 index 0000000000000..a1dc8e985dad0 --- /dev/null +++ b/src/test/ui/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/cfg-arg-invalid.rs similarity index 100% rename from src/test/compile-fail/cfg-arg-invalid.rs rename to src/test/ui/cfg-arg-invalid.rs diff --git a/src/test/compile-fail/cfg-attr-cfg-2.rs b/src/test/ui/cfg-attr-cfg-2.rs similarity index 100% rename from src/test/compile-fail/cfg-attr-cfg-2.rs rename to src/test/ui/cfg-attr-cfg-2.rs diff --git a/src/test/ui/cfg-attr-cfg-2.stderr b/src/test/ui/cfg-attr-cfg-2.stderr new file mode 100644 index 0000000000000..db3c7acff151c --- /dev/null +++ b/src/test/ui/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/cfg-attr-crate-2.rs similarity index 100% rename from src/test/compile-fail/cfg-attr-crate-2.rs rename to src/test/ui/cfg-attr-crate-2.rs diff --git a/src/test/ui/cfg-attr-crate-2.stderr b/src/test/ui/cfg-attr-crate-2.stderr new file mode 100644 index 0000000000000..7b66c8f5e40f0 --- /dev/null +++ b/src/test/ui/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/cfg-attr-invalid-predicate.rs similarity index 100% rename from src/test/compile-fail/cfg-attr-invalid-predicate.rs rename to src/test/ui/cfg-attr-invalid-predicate.rs diff --git a/src/test/ui/cfg-attr-invalid-predicate.stderr b/src/test/ui/cfg-attr-invalid-predicate.stderr new file mode 100644 index 0000000000000..5a89f9766d166 --- /dev/null +++ b/src/test/ui/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/cfg-attr-unknown-attribute-macro-expansion.rs similarity index 100% rename from src/test/compile-fail/cfg-attr-unknown-attribute-macro-expansion.rs rename to src/test/ui/cfg-attr-unknown-attribute-macro-expansion.rs diff --git a/src/test/ui/cfg-attr-unknown-attribute-macro-expansion.stderr b/src/test/ui/cfg-attr-unknown-attribute-macro-expansion.stderr new file mode 100644 index 0000000000000..33fe52366dbbb --- /dev/null +++ b/src/test/ui/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/cfg-empty-codemap.rs similarity index 100% rename from src/test/compile-fail/cfg-empty-codemap.rs rename to src/test/ui/cfg-empty-codemap.rs diff --git a/src/test/compile-fail/cfg-in-crate-1.rs b/src/test/ui/cfg-in-crate-1.rs similarity index 100% rename from src/test/compile-fail/cfg-in-crate-1.rs rename to src/test/ui/cfg-in-crate-1.rs diff --git a/src/test/ui/cfg-in-crate-1.stderr b/src/test/ui/cfg-in-crate-1.stderr new file mode 100644 index 0000000000000..c6d42c732c934 --- /dev/null +++ b/src/test/ui/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/cfg-non-opt-expr.rs similarity index 100% rename from src/test/compile-fail/cfg-non-opt-expr.rs rename to src/test/ui/cfg-non-opt-expr.rs diff --git a/src/test/ui/cfg-non-opt-expr.stderr b/src/test/ui/cfg-non-opt-expr.stderr new file mode 100644 index 0000000000000..0511c5755462e --- /dev/null +++ b/src/test/ui/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/cfg_attr_path.rs similarity index 100% rename from src/test/compile-fail/cfg_attr_path.rs rename to src/test/ui/cfg_attr_path.rs diff --git a/src/test/ui/cfg_attr_path.stderr b/src/test/ui/cfg_attr_path.stderr new file mode 100644 index 0000000000000..67e59d054d5c1 --- /dev/null +++ b/src/test/ui/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/check-static-immutable-mut-slices.rs similarity index 100% rename from src/test/compile-fail/check-static-immutable-mut-slices.rs rename to src/test/ui/check-static-immutable-mut-slices.rs diff --git a/src/test/ui/check-static-immutable-mut-slices.stderr b/src/test/ui/check-static-immutable-mut-slices.stderr new file mode 100644 index 0000000000000..b0a7cd1221ba9 --- /dev/null +++ b/src/test/ui/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/check-static-values-constraints.nll.stderr b/src/test/ui/check-static-values-constraints.nll.stderr new file mode 100644 index 0000000000000..b265ec8bddac6 --- /dev/null +++ b/src/test/ui/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 = 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 = 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 = 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/check-static-values-constraints.rs similarity index 100% rename from src/test/compile-fail/check-static-values-constraints.rs rename to src/test/ui/check-static-values-constraints.rs diff --git a/src/test/ui/check-static-values-constraints.stderr b/src/test/ui/check-static-values-constraints.stderr new file mode 100644 index 0000000000000..ac979a3fa7cfc --- /dev/null +++ b/src/test/ui/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 = 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 = 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 = 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/class-cast-to-trait.rs similarity index 100% rename from src/test/compile-fail/class-cast-to-trait.rs rename to src/test/ui/class-cast-to-trait.rs diff --git a/src/test/ui/class-cast-to-trait.stderr b/src/test/ui/class-cast-to-trait.stderr new file mode 100644 index 0000000000000..c1e08807f97c1 --- /dev/null +++ b/src/test/ui/class-cast-to-trait.stderr @@ -0,0 +1,9 @@ +error[E0599]: no method named `eat` found for type `std::boxed::Box` 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/class-method-missing.rs similarity index 100% rename from src/test/compile-fail/class-method-missing.rs rename to src/test/ui/class-method-missing.rs diff --git a/src/test/ui/class-method-missing.stderr b/src/test/ui/class-method-missing.stderr new file mode 100644 index 0000000000000..c1da06e3a3ad6 --- /dev/null +++ b/src/test/ui/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/class-missing-self.rs similarity index 100% rename from src/test/compile-fail/class-missing-self.rs rename to src/test/ui/class-missing-self.rs diff --git a/src/test/ui/class-missing-self.stderr b/src/test/ui/class-missing-self.stderr new file mode 100644 index 0000000000000..33bf62e70873e --- /dev/null +++ b/src/test/ui/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/cleanup-rvalue-scopes-cf.rs similarity index 98% rename from src/test/compile-fail/cleanup-rvalue-scopes-cf.rs rename to src/test/ui/cleanup-rvalue-scopes-cf.rs index dcbb25ba5a95f..0f83bf80d2453 100644 --- a/src/test/compile-fail/cleanup-rvalue-scopes-cf.rs +++ b/src/test/ui/cleanup-rvalue-scopes-cf.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that the borrow checker prevents pointers to temporaries // with statement lifetimes from escaping. diff --git a/src/test/ui/cleanup-rvalue-scopes-cf.stderr b/src/test/ui/cleanup-rvalue-scopes-cf.stderr new file mode 100644 index 0000000000000..e1de4a2a8d49b --- /dev/null +++ b/src/test/ui/cleanup-rvalue-scopes-cf.stderr @@ -0,0 +1,93 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/cleanup-rvalue-scopes-cf.rs:38: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:39: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:40: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:41: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:42: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:43: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:44: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-expected-type/README.md b/src/test/ui/closure-expected-type/README.md similarity index 100% rename from src/test/compile-fail/closure-expected-type/README.md rename to src/test/ui/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/closure-expected-type/expect-fn-supply-fn-multiple.rs similarity index 100% rename from src/test/compile-fail/closure-expected-type/expect-fn-supply-fn-multiple.rs rename to src/test/ui/closure-expected-type/expect-fn-supply-fn-multiple.rs diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr new file mode 100644 index 0000000000000..fe857001bfaef --- /dev/null +++ b/src/test/ui/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) +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) +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) +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/closure-expected-type/expect-fn-supply-fn.rs similarity index 100% rename from src/test/compile-fail/closure-expected-type/expect-fn-supply-fn.rs rename to src/test/ui/closure-expected-type/expect-fn-supply-fn.rs diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr new file mode 100644 index 0000000000000..4dca5922910f2 --- /dev/null +++ b/src/test/ui/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) +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) +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) +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/closure-expected-type/expect-infer-var-appearing-twice.rs similarity index 100% rename from src/test/compile-fail/closure-expected-type/expect-infer-var-appearing-twice.rs rename to src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.rs diff --git a/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr b/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr new file mode 100644 index 0000000000000..51dcf5eb3dae9 --- /dev/null +++ b/src/test/ui/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) +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/closure-expected-type/expect-infer-var-supply-ty-with-bound-region.rs similarity index 100% rename from src/test/compile-fail/closure-expected-type/expect-infer-var-supply-ty-with-bound-region.rs rename to src/test/ui/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/closure-expected-type/expect-infer-var-supply-ty-with-free-region.rs similarity index 100% rename from src/test/compile-fail/closure-expected-type/expect-infer-var-supply-ty-with-free-region.rs rename to src/test/ui/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/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.rs similarity index 100% rename from src/test/compile-fail/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.rs rename to src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.rs diff --git a/src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr b/src/test/ui/closure-expected-type/expect-two-infer-vars-supply-ty-with-bound-region.stderr new file mode 100644 index 0000000000000..273fb2a2dd287 --- /dev/null +++ b/src/test/ui/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_promotion.rs b/src/test/ui/closure_promotion.rs similarity index 96% rename from src/test/compile-fail/closure_promotion.rs rename to src/test/ui/closure_promotion.rs index ddc995a1a4100..8826661f84a4b 100644 --- a/src/test/compile-fail/closure_promotion.rs +++ b/src/test/ui/closure_promotion.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![allow(const_err)] // nll successfully compiles this. It is a bug. diff --git a/src/test/ui/closure_promotion.stderr b/src/test/ui/closure_promotion.stderr new file mode 100644 index 0000000000000..8f08796b5c60b --- /dev/null +++ b/src/test/ui/closure_promotion.stderr @@ -0,0 +1,13 @@ +error[E0597]: borrowed value does not live long enough + --> $DIR/closure_promotion.rs:18: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/ui/closure-array-break-length.rs b/src/test/ui/closures/closure-array-break-length.rs similarity index 100% rename from src/test/ui/closure-array-break-length.rs rename to src/test/ui/closures/closure-array-break-length.rs diff --git a/src/test/ui/closure-array-break-length.stderr b/src/test/ui/closures/closure-array-break-length.stderr similarity index 100% rename from src/test/ui/closure-array-break-length.stderr rename to src/test/ui/closures/closure-array-break-length.stderr diff --git a/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs b/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs similarity index 100% rename from src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs rename to src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.rs diff --git a/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr b/src/test/ui/closures/closure-bounds-cant-promote-superkind-in-struct.stderr new file mode 100644 index 0000000000000..e1b18b1d49e10 --- /dev/null +++ b/src/test/ui/closures/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(blk: F) -> X 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 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/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.nll.stderr new file mode 100644 index 0000000000000..ca82020a2ccb1 --- /dev/null +++ b/src/test/ui/closures/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/closures/closure-bounds-static-cant-capture-borrowed.rs similarity index 100% rename from src/test/compile-fail/closure-bounds-static-cant-capture-borrowed.rs rename to src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.rs diff --git a/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr b/src/test/ui/closures/closure-bounds-static-cant-capture-borrowed.stderr new file mode 100644 index 0000000000000..825f469c33063 --- /dev/null +++ b/src/test/ui/closures/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/closures/closure-bounds-subtype.rs similarity index 100% rename from src/test/compile-fail/closure-bounds-subtype.rs rename to src/test/ui/closures/closure-bounds-subtype.rs diff --git a/src/test/ui/closures/closure-bounds-subtype.stderr b/src/test/ui/closures/closure-bounds-subtype.stderr new file mode 100644 index 0000000000000..ffe486d446822 --- /dev/null +++ b/src/test/ui/closures/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) 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/ui/closure-expected-type/expect-region-supply-region.nll.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region.nll.stderr similarity index 100% rename from src/test/ui/closure-expected-type/expect-region-supply-region.nll.stderr rename to src/test/ui/closures/closure-expected-type/expect-region-supply-region.nll.stderr diff --git a/src/test/ui/closure-expected-type/expect-region-supply-region.rs b/src/test/ui/closures/closure-expected-type/expect-region-supply-region.rs similarity index 100% rename from src/test/ui/closure-expected-type/expect-region-supply-region.rs rename to src/test/ui/closures/closure-expected-type/expect-region-supply-region.rs diff --git a/src/test/ui/closure-expected-type/expect-region-supply-region.stderr b/src/test/ui/closures/closure-expected-type/expect-region-supply-region.stderr similarity index 100% rename from src/test/ui/closure-expected-type/expect-region-supply-region.stderr rename to src/test/ui/closures/closure-expected-type/expect-region-supply-region.stderr diff --git a/src/test/ui/closure-immutable-outer-variable.fixed b/src/test/ui/closures/closure-immutable-outer-variable.fixed similarity index 100% rename from src/test/ui/closure-immutable-outer-variable.fixed rename to src/test/ui/closures/closure-immutable-outer-variable.fixed diff --git a/src/test/ui/closure-immutable-outer-variable.nll.stderr b/src/test/ui/closures/closure-immutable-outer-variable.nll.stderr similarity index 100% rename from src/test/ui/closure-immutable-outer-variable.nll.stderr rename to src/test/ui/closures/closure-immutable-outer-variable.nll.stderr diff --git a/src/test/ui/closure-immutable-outer-variable.rs b/src/test/ui/closures/closure-immutable-outer-variable.rs similarity index 100% rename from src/test/ui/closure-immutable-outer-variable.rs rename to src/test/ui/closures/closure-immutable-outer-variable.rs diff --git a/src/test/ui/closure-immutable-outer-variable.rs.fixed b/src/test/ui/closures/closure-immutable-outer-variable.rs.fixed similarity index 100% rename from src/test/ui/closure-immutable-outer-variable.rs.fixed rename to src/test/ui/closures/closure-immutable-outer-variable.rs.fixed diff --git a/src/test/ui/closure-immutable-outer-variable.stderr b/src/test/ui/closures/closure-immutable-outer-variable.stderr similarity index 100% rename from src/test/ui/closure-immutable-outer-variable.stderr rename to src/test/ui/closures/closure-immutable-outer-variable.stderr diff --git a/src/test/ui/closure-move-sync.rs b/src/test/ui/closures/closure-move-sync.rs similarity index 100% rename from src/test/ui/closure-move-sync.rs rename to src/test/ui/closures/closure-move-sync.rs diff --git a/src/test/ui/closure-move-sync.stderr b/src/test/ui/closures/closure-move-sync.stderr similarity index 100% rename from src/test/ui/closure-move-sync.stderr rename to src/test/ui/closures/closure-move-sync.stderr diff --git a/src/test/compile-fail/closure-no-fn-1.rs b/src/test/ui/closures/closure-no-fn-1.rs similarity index 100% rename from src/test/compile-fail/closure-no-fn-1.rs rename to src/test/ui/closures/closure-no-fn-1.rs diff --git a/src/test/ui/closures/closure-no-fn-1.stderr b/src/test/ui/closures/closure-no-fn-1.stderr new file mode 100644 index 0000000000000..4786a6836cd89 --- /dev/null +++ b/src/test/ui/closures/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/closures/closure-no-fn-2.rs similarity index 100% rename from src/test/compile-fail/closure-no-fn-2.rs rename to src/test/ui/closures/closure-no-fn-2.rs diff --git a/src/test/ui/closures/closure-no-fn-2.stderr b/src/test/ui/closures/closure-no-fn-2.stderr new file mode 100644 index 0000000000000..1aad49777dc90 --- /dev/null +++ b/src/test/ui/closures/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/closures/closure-no-fn-3.rs similarity index 100% rename from src/test/compile-fail/closure-no-fn-3.rs rename to src/test/ui/closures/closure-no-fn-3.rs diff --git a/src/test/ui/closures/closure-no-fn-3.stderr b/src/test/ui/closures/closure-no-fn-3.stderr new file mode 100644 index 0000000000000..bd28045c1b98d --- /dev/null +++ b/src/test/ui/closures/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/closures/closure-referencing-itself-issue-25954.rs similarity index 100% rename from src/test/compile-fail/closure-referencing-itself-issue-25954.rs rename to src/test/ui/closures/closure-referencing-itself-issue-25954.rs diff --git a/src/test/ui/closures/closure-referencing-itself-issue-25954.stderr b/src/test/ui/closures/closure-referencing-itself-issue-25954.stderr new file mode 100644 index 0000000000000..fa00d9fd9a4d2 --- /dev/null +++ b/src/test/ui/closures/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/closures/closure-reform-bad.rs similarity index 100% rename from src/test/compile-fail/closure-reform-bad.rs rename to src/test/ui/closures/closure-reform-bad.rs diff --git a/src/test/ui/closures/closure-reform-bad.stderr b/src/test/ui/closures/closure-reform-bad.stderr new file mode 100644 index 0000000000000..a4e181753690f --- /dev/null +++ b/src/test/ui/closures/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/closures/closure-wrong-kind.rs similarity index 100% rename from src/test/compile-fail/closure-wrong-kind.rs rename to src/test/ui/closures/closure-wrong-kind.rs diff --git a/src/test/ui/closures/closure-wrong-kind.stderr b/src/test/ui/closures/closure-wrong-kind.stderr new file mode 100644 index 0000000000000..636f30770a9a3 --- /dev/null +++ b/src/test/ui/closures/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/coerce-expect-unsized-ascribed.rs b/src/test/ui/coercion/coerce-expect-unsized-ascribed.rs similarity index 100% rename from src/test/compile-fail/coerce-expect-unsized-ascribed.rs rename to src/test/ui/coercion/coerce-expect-unsized-ascribed.rs diff --git a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr new file mode 100644 index 0000000000000..894fbbf202a9a --- /dev/null +++ b/src/test/ui/coercion/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 _>; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure + | + = note: expected type `std::boxed::Box 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; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found bool + | + = note: expected type `std::boxed::Box` + found type `std::boxed::Box` + +error[E0308]: mismatched types + --> $DIR/coerce-expect-unsized-ascribed.rs:25:13 + | +LL | let _ = box match true { true => 'a', false => 'b' }: Box; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::fmt::Debug, found char + | + = note: expected type `std::boxed::Box` + found type `std::boxed::Box` + +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 _>; //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^^^^^ expected trait std::ops::Fn, found closure + | + = note: expected type `std::boxed::Box _>` + 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/coercion/coerce-mut.rs similarity index 100% rename from src/test/compile-fail/coerce-mut.rs rename to src/test/ui/coercion/coerce-mut.rs diff --git a/src/test/ui/coercion/coerce-mut.stderr b/src/test/ui/coercion/coerce-mut.stderr new file mode 100644 index 0000000000000..5e460b199a150 --- /dev/null +++ b/src/test/ui/coercion/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/coercion/coerce-overloaded-autoderef.ast.nll.stderr b/src/test/ui/coercion/coerce-overloaded-autoderef.ast.nll.stderr new file mode 100644 index 0000000000000..29b6f0575627c --- /dev/null +++ b/src/test/ui/coercion/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/coercion/coerce-overloaded-autoderef.ast.stderr b/src/test/ui/coercion/coerce-overloaded-autoderef.ast.stderr new file mode 100644 index 0000000000000..3bb5ec7200243 --- /dev/null +++ b/src/test/ui/coercion/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/coercion/coerce-overloaded-autoderef.mir.nll.stderr b/src/test/ui/coercion/coerce-overloaded-autoderef.mir.nll.stderr new file mode 100644 index 0000000000000..29b6f0575627c --- /dev/null +++ b/src/test/ui/coercion/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/coercion/coerce-overloaded-autoderef.mir.stderr b/src/test/ui/coercion/coerce-overloaded-autoderef.mir.stderr new file mode 100644 index 0000000000000..fbc49a7e91f88 --- /dev/null +++ b/src/test/ui/coercion/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/coercion/coerce-overloaded-autoderef.rs similarity index 100% rename from src/test/compile-fail/coerce-overloaded-autoderef.rs rename to src/test/ui/coercion/coerce-overloaded-autoderef.rs diff --git a/src/test/compile-fail/coerce-to-bang-cast.rs b/src/test/ui/coercion/coerce-to-bang-cast.rs similarity index 100% rename from src/test/compile-fail/coerce-to-bang-cast.rs rename to src/test/ui/coercion/coerce-to-bang-cast.rs diff --git a/src/test/ui/coercion/coerce-to-bang-cast.stderr b/src/test/ui/coercion/coerce-to-bang-cast.stderr new file mode 100644 index 0000000000000..fde9414451233 --- /dev/null +++ b/src/test/ui/coercion/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/coercion/coerce-to-bang.rs similarity index 100% rename from src/test/compile-fail/coerce-to-bang.rs rename to src/test/ui/coercion/coerce-to-bang.rs diff --git a/src/test/ui/coercion/coerce-to-bang.stderr b/src/test/ui/coercion/coerce-to-bang.stderr new file mode 100644 index 0000000000000..bf490cd20aa65 --- /dev/null +++ b/src/test/ui/coercion/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/ui/coercion-missing-tail-expected-type.rs b/src/test/ui/coercion/coercion-missing-tail-expected-type.rs similarity index 100% rename from src/test/ui/coercion-missing-tail-expected-type.rs rename to src/test/ui/coercion/coercion-missing-tail-expected-type.rs diff --git a/src/test/ui/coercion-missing-tail-expected-type.stderr b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr similarity index 100% rename from src/test/ui/coercion-missing-tail-expected-type.stderr rename to src/test/ui/coercion/coercion-missing-tail-expected-type.stderr diff --git a/src/test/compile-fail/coercion-slice.rs b/src/test/ui/coercion/coercion-slice.rs similarity index 100% rename from src/test/compile-fail/coercion-slice.rs rename to src/test/ui/coercion/coercion-slice.rs diff --git a/src/test/ui/coercion/coercion-slice.stderr b/src/test/ui/coercion/coercion-slice.stderr new file mode 100644 index 0000000000000..47a77d4277370 --- /dev/null +++ b/src/test/ui/coercion/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/auxiliary/coherence_copy_like_lib.rs b/src/test/ui/coherence/auxiliary/coherence_copy_like_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/coherence_copy_like_lib.rs rename to src/test/ui/coherence/auxiliary/coherence_copy_like_lib.rs diff --git a/src/test/compile-fail/auxiliary/coherence_inherent_cc_lib.rs b/src/test/ui/coherence/auxiliary/coherence_inherent_cc_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/coherence_inherent_cc_lib.rs rename to src/test/ui/coherence/auxiliary/coherence_inherent_cc_lib.rs diff --git a/src/test/compile-fail/auxiliary/coherence_lib.rs b/src/test/ui/coherence/auxiliary/coherence_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/coherence_lib.rs rename to src/test/ui/coherence/auxiliary/coherence_lib.rs diff --git a/src/test/compile-fail/auxiliary/coherence_orphan_lib.rs b/src/test/ui/coherence/auxiliary/coherence_orphan_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/coherence_orphan_lib.rs rename to src/test/ui/coherence/auxiliary/coherence_orphan_lib.rs diff --git a/src/test/compile-fail/auxiliary/go_trait.rs b/src/test/ui/coherence/auxiliary/go_trait.rs similarity index 100% rename from src/test/compile-fail/auxiliary/go_trait.rs rename to src/test/ui/coherence/auxiliary/go_trait.rs diff --git a/src/test/compile-fail/auxiliary/trait_impl_conflict.rs b/src/test/ui/coherence/auxiliary/trait_impl_conflict.rs similarity index 100% rename from src/test/compile-fail/auxiliary/trait_impl_conflict.rs rename to src/test/ui/coherence/auxiliary/trait_impl_conflict.rs diff --git a/src/test/compile-fail/coherence-all-remote.rs b/src/test/ui/coherence/coherence-all-remote.rs similarity index 100% rename from src/test/compile-fail/coherence-all-remote.rs rename to src/test/ui/coherence/coherence-all-remote.rs diff --git a/src/test/ui/coherence/coherence-all-remote.stderr b/src/test/ui/coherence/coherence-all-remote.stderr new file mode 100644 index 0000000000000..1f71969989bda --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-all-remote.rs:16:1 + | +LL | impl Remote1 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/coherence/coherence-bigint-param.rs similarity index 100% rename from src/test/compile-fail/coherence-bigint-param.rs rename to src/test/ui/coherence/coherence-bigint-param.rs diff --git a/src/test/ui/coherence/coherence-bigint-param.stderr b/src/test/ui/coherence/coherence-bigint-param.stderr new file mode 100644 index 0000000000000..7d2796ee6905c --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-bigint-param.rs:18:1 + | +LL | impl Remote1 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/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs similarity index 100% rename from src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs rename to src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.rs diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr new file mode 100644 index 0000000000000..7dbcda06511b8 --- /dev/null +++ b/src/test/ui/coherence/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 MyTrait for T { + | -------------------------- first implementation here +... +LL | impl 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/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs similarity index 100% rename from src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs rename to src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.rs diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr new file mode 100644 index 0000000000000..faabfb6c7c0c4 --- /dev/null +++ b/src/test/ui/coherence/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 MyTrait for T { + | -------------------------- first implementation here +... +LL | impl 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/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs similarity index 100% rename from src/test/compile-fail/coherence-blanket-conflicts-with-specific-cross-crate.rs rename to src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.rs diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr new file mode 100644 index 0000000000000..38aff37bfcca4 --- /dev/null +++ b/src/test/ui/coherence/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 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/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs similarity index 100% rename from src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs rename to src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr new file mode 100644 index 0000000000000..a5992406262fc --- /dev/null +++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`: + --> $DIR/coherence-blanket-conflicts-with-specific-multidispatch.rs:32:1 + | +LL | impl 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-trait.rs b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs similarity index 100% rename from src/test/compile-fail/coherence-blanket-conflicts-with-specific-trait.rs rename to src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.rs diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr new file mode 100644 index 0000000000000..9a6e0071eb7b6 --- /dev/null +++ b/src/test/ui/coherence/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 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/coherence/coherence-blanket-conflicts-with-specific.rs similarity index 100% rename from src/test/compile-fail/coherence-blanket-conflicts-with-specific.rs rename to src/test/ui/coherence/coherence-blanket-conflicts-with-specific.rs diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr new file mode 100644 index 0000000000000..955cd3b125faf --- /dev/null +++ b/src/test/ui/coherence/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 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/coherence/coherence-conflicting-negative-trait-impl.rs similarity index 100% rename from src/test/compile-fail/coherence-conflicting-negative-trait-impl.rs rename to src/test/ui/coherence/coherence-conflicting-negative-trait-impl.rs diff --git a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr new file mode 100644 index 0000000000000..a2a869daff063 --- /dev/null +++ b/src/test/ui/coherence/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 Send for TestType {} + | ---------------------------------------------------- first implementation here +LL | +LL | impl !Send for TestType {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>` + +error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType`: + --> $DIR/coherence-conflicting-negative-trait-impl.rs:25:1 + | +LL | unsafe impl Send for TestType {} + | ------------------------------------------- first implementation here +LL | +LL | impl !Send for TestType {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0119`. diff --git a/src/test/ui/coherence/coherence-cow.a.stderr b/src/test/ui/coherence/coherence-cow.a.stderr new file mode 100644 index 0000000000000..f05333348ec3a --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-cow.rs:26:1 + | +LL | impl Remote for Pair> { } //[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/coherence/coherence-cow.b.stderr b/src/test/ui/coherence/coherence-cow.b.stderr new file mode 100644 index 0000000000000..269bcd576af5a --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-cow.rs:29:1 + | +LL | impl Remote for Pair,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/coherence/coherence-cow.c.stderr b/src/test/ui/coherence/coherence-cow.c.stderr new file mode 100644 index 0000000000000..e89308db054ff --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-cow.rs:32:1 + | +LL | impl Remote for Pair,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/coherence/coherence-cow.rs similarity index 100% rename from src/test/compile-fail/coherence-cow.rs rename to src/test/ui/coherence/coherence-cow.rs diff --git a/src/test/compile-fail/coherence-cross-crate-conflict.rs b/src/test/ui/coherence/coherence-cross-crate-conflict.rs similarity index 100% rename from src/test/compile-fail/coherence-cross-crate-conflict.rs rename to src/test/ui/coherence/coherence-cross-crate-conflict.rs diff --git a/src/test/ui/coherence/coherence-cross-crate-conflict.stderr b/src/test/ui/coherence/coherence-cross-crate-conflict.stderr new file mode 100644 index 0000000000000..ee11967cc0d3a --- /dev/null +++ b/src/test/ui/coherence/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 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`) + --> $DIR/coherence-cross-crate-conflict.rs:18:1 + | +LL | impl 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/coherence/coherence-default-trait-impl.rs similarity index 100% rename from src/test/compile-fail/coherence-default-trait-impl.rs rename to src/test/ui/coherence/coherence-default-trait-impl.rs diff --git a/src/test/ui/coherence/coherence-default-trait-impl.stderr b/src/test/ui/coherence/coherence-default-trait-impl.stderr new file mode 100644 index 0000000000000..b7d9364f23771 --- /dev/null +++ b/src/test/ui/coherence/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/ui/coherence-error-suppression.rs b/src/test/ui/coherence/coherence-error-suppression.rs similarity index 100% rename from src/test/ui/coherence-error-suppression.rs rename to src/test/ui/coherence/coherence-error-suppression.rs diff --git a/src/test/ui/coherence-error-suppression.stderr b/src/test/ui/coherence/coherence-error-suppression.stderr similarity index 100% rename from src/test/ui/coherence-error-suppression.stderr rename to src/test/ui/coherence/coherence-error-suppression.stderr diff --git a/src/test/compile-fail/coherence-impl-trait-for-trait-object-safe.rs b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs similarity index 100% rename from src/test/compile-fail/coherence-impl-trait-for-trait-object-safe.rs rename to src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr b/src/test/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr new file mode 100644 index 0000000000000..5d62a86b96f07 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence-impl-trait-for-trait.rs similarity index 100% rename from src/test/compile-fail/coherence-impl-trait-for-trait.rs rename to src/test/ui/coherence/coherence-impl-trait-for-trait.rs diff --git a/src/test/ui/coherence/coherence-impl-trait-for-trait.stderr b/src/test/ui/coherence/coherence-impl-trait-for-trait.stderr new file mode 100644 index 0000000000000..26e702d1fde04 --- /dev/null +++ b/src/test/ui/coherence/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/ui/coherence-impls-copy.rs b/src/test/ui/coherence/coherence-impls-copy.rs similarity index 100% rename from src/test/ui/coherence-impls-copy.rs rename to src/test/ui/coherence/coherence-impls-copy.rs diff --git a/src/test/ui/coherence-impls-copy.stderr b/src/test/ui/coherence/coherence-impls-copy.stderr similarity index 100% rename from src/test/ui/coherence-impls-copy.stderr rename to src/test/ui/coherence/coherence-impls-copy.stderr diff --git a/src/test/compile-fail/coherence-impls-send.rs b/src/test/ui/coherence/coherence-impls-send.rs similarity index 100% rename from src/test/compile-fail/coherence-impls-send.rs rename to src/test/ui/coherence/coherence-impls-send.rs diff --git a/src/test/ui/coherence/coherence-impls-send.stderr b/src/test/ui/coherence/coherence-impls-send.stderr new file mode 100644 index 0000000000000..4e7e228b23f3d --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence-impls-sized.rs similarity index 100% rename from src/test/compile-fail/coherence-impls-sized.rs rename to src/test/ui/coherence/coherence-impls-sized.rs diff --git a/src/test/ui/coherence/coherence-impls-sized.stderr b/src/test/ui/coherence/coherence-impls-sized.stderr new file mode 100644 index 0000000000000..683fb0aaa68a7 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence-inherited-assoc-ty-cycle-err.rs similarity index 100% rename from src/test/compile-fail/coherence-inherited-assoc-ty-cycle-err.rs rename to src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.rs diff --git a/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr b/src/test/ui/coherence/coherence-inherited-assoc-ty-cycle-err.stderr new file mode 100644 index 0000000000000..5dba448a96333 --- /dev/null +++ b/src/test/ui/coherence/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 { 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 { 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/coherence/coherence-lone-type-parameter.rs similarity index 100% rename from src/test/compile-fail/coherence-lone-type-parameter.rs rename to src/test/ui/coherence/coherence-lone-type-parameter.rs diff --git a/src/test/ui/coherence/coherence-lone-type-parameter.stderr b/src/test/ui/coherence/coherence-lone-type-parameter.stderr new file mode 100644 index 0000000000000..6389bc0e7aba7 --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-lone-type-parameter.rs:16:1 + | +LL | impl 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/coherence/coherence-negative-impls-safe.rs similarity index 100% rename from src/test/compile-fail/coherence-negative-impls-safe.rs rename to src/test/ui/coherence/coherence-negative-impls-safe.rs diff --git a/src/test/ui/coherence/coherence-negative-impls-safe.stderr b/src/test/ui/coherence/coherence-negative-impls-safe.stderr new file mode 100644 index 0000000000000..7373f79942f73 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence-no-direct-lifetime-dispatch.rs similarity index 100% rename from src/test/compile-fail/coherence-no-direct-lifetime-dispatch.rs rename to src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.rs diff --git a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr new file mode 100644 index 0000000000000..669c5e3a4a6d8 --- /dev/null +++ b/src/test/ui/coherence/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 MyTrait for T {} + | --------------------- first implementation here +LL | impl 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/coherence/coherence-orphan.rs similarity index 100% rename from src/test/compile-fail/coherence-orphan.rs rename to src/test/ui/coherence/coherence-orphan.rs diff --git a/src/test/ui/coherence/coherence-orphan.stderr b/src/test/ui/coherence/coherence-orphan.stderr new file mode 100644 index 0000000000000..ee863533237e0 --- /dev/null +++ b/src/test/ui/coherence/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 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 { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^ 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/coherence/coherence-overlap-all-t-and-tuple.rs similarity index 100% rename from src/test/compile-fail/coherence-overlap-all-t-and-tuple.rs rename to src/test/ui/coherence/coherence-overlap-all-t-and-tuple.rs diff --git a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr new file mode 100644 index 0000000000000..993de789ef5d8 --- /dev/null +++ b/src/test/ui/coherence/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 From for T { + | ---------------------- first implementation here +... +LL | impl 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/ui/coherence-overlap-downstream-inherent.rs b/src/test/ui/coherence/coherence-overlap-downstream-inherent.rs similarity index 100% rename from src/test/ui/coherence-overlap-downstream-inherent.rs rename to src/test/ui/coherence/coherence-overlap-downstream-inherent.rs diff --git a/src/test/ui/coherence-overlap-downstream-inherent.stderr b/src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr similarity index 100% rename from src/test/ui/coherence-overlap-downstream-inherent.stderr rename to src/test/ui/coherence/coherence-overlap-downstream-inherent.stderr diff --git a/src/test/ui/coherence-overlap-downstream.rs b/src/test/ui/coherence/coherence-overlap-downstream.rs similarity index 100% rename from src/test/ui/coherence-overlap-downstream.rs rename to src/test/ui/coherence/coherence-overlap-downstream.rs diff --git a/src/test/ui/coherence-overlap-downstream.stderr b/src/test/ui/coherence/coherence-overlap-downstream.stderr similarity index 100% rename from src/test/ui/coherence-overlap-downstream.stderr rename to src/test/ui/coherence/coherence-overlap-downstream.stderr diff --git a/src/test/ui/coherence-overlap-issue-23516-inherent.rs b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs similarity index 100% rename from src/test/ui/coherence-overlap-issue-23516-inherent.rs rename to src/test/ui/coherence/coherence-overlap-issue-23516-inherent.rs diff --git a/src/test/ui/coherence-overlap-issue-23516-inherent.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr similarity index 100% rename from src/test/ui/coherence-overlap-issue-23516-inherent.stderr rename to src/test/ui/coherence/coherence-overlap-issue-23516-inherent.stderr diff --git a/src/test/ui/coherence-overlap-issue-23516.rs b/src/test/ui/coherence/coherence-overlap-issue-23516.rs similarity index 100% rename from src/test/ui/coherence-overlap-issue-23516.rs rename to src/test/ui/coherence/coherence-overlap-issue-23516.rs diff --git a/src/test/ui/coherence-overlap-issue-23516.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516.stderr similarity index 100% rename from src/test/ui/coherence-overlap-issue-23516.stderr rename to src/test/ui/coherence/coherence-overlap-issue-23516.stderr diff --git a/src/test/compile-fail/coherence-overlap-messages.rs b/src/test/ui/coherence/coherence-overlap-messages.rs similarity index 100% rename from src/test/compile-fail/coherence-overlap-messages.rs rename to src/test/ui/coherence/coherence-overlap-messages.rs diff --git a/src/test/ui/coherence/coherence-overlap-messages.stderr b/src/test/ui/coherence/coherence-overlap-messages.stderr new file mode 100644 index 0000000000000..60023c6c2495b --- /dev/null +++ b/src/test/ui/coherence/coherence-overlap-messages.stderr @@ -0,0 +1,44 @@ +error[E0119]: conflicting implementations of trait `Foo`: + --> $DIR/coherence-overlap-messages.rs:14:1 + | +LL | impl Foo for T {} + | ----------------- first implementation here +LL | impl 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 Bar for (T, u8) {} + | ----------------------- first implementation here +LL | impl 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` for type `u8`: + --> $DIR/coherence-overlap-messages.rs:24:1 + | +LL | impl Baz for T {} + | --------------------- first implementation here +LL | impl Baz for u8 {} //~ ERROR conflicting implementations of trait `Baz` for type `u8`: + | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8` + +error[E0119]: conflicting implementations of trait `Quux<_, _>`: + --> $DIR/coherence-overlap-messages.rs:29:1 + | +LL | impl Quux for T {} + | ------------------------------ first implementation here +LL | impl Quux 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 Quux for T {} + | ------------------------------ first implementation here +LL | impl Quux for T {} //~ ERROR conflicting implementations of trait `Quux<_, _>`: +LL | impl Quux 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/ui/coherence-overlap-upstream-inherent.rs b/src/test/ui/coherence/coherence-overlap-upstream-inherent.rs similarity index 100% rename from src/test/ui/coherence-overlap-upstream-inherent.rs rename to src/test/ui/coherence/coherence-overlap-upstream-inherent.rs diff --git a/src/test/ui/coherence-overlap-upstream-inherent.stderr b/src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr similarity index 100% rename from src/test/ui/coherence-overlap-upstream-inherent.stderr rename to src/test/ui/coherence/coherence-overlap-upstream-inherent.stderr diff --git a/src/test/ui/coherence-overlap-upstream.rs b/src/test/ui/coherence/coherence-overlap-upstream.rs similarity index 100% rename from src/test/ui/coherence-overlap-upstream.rs rename to src/test/ui/coherence/coherence-overlap-upstream.rs diff --git a/src/test/ui/coherence-overlap-upstream.stderr b/src/test/ui/coherence/coherence-overlap-upstream.stderr similarity index 100% rename from src/test/ui/coherence-overlap-upstream.stderr rename to src/test/ui/coherence/coherence-overlap-upstream.stderr diff --git a/src/test/compile-fail/coherence-overlapping-pairs.rs b/src/test/ui/coherence/coherence-overlapping-pairs.rs similarity index 100% rename from src/test/compile-fail/coherence-overlapping-pairs.rs rename to src/test/ui/coherence/coherence-overlapping-pairs.rs diff --git a/src/test/ui/coherence/coherence-overlapping-pairs.stderr b/src/test/ui/coherence/coherence-overlapping-pairs.stderr new file mode 100644 index 0000000000000..41d478885549f --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-overlapping-pairs.rs:18:1 + | +LL | impl Remote for lib::Pair { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/coherence/coherence-pair-covered-uncovered-1.rs similarity index 100% rename from src/test/compile-fail/coherence-pair-covered-uncovered-1.rs rename to src/test/ui/coherence/coherence-pair-covered-uncovered-1.rs diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr b/src/test/ui/coherence/coherence-pair-covered-uncovered-1.stderr new file mode 100644 index 0000000000000..3545593fb6d5c --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-pair-covered-uncovered-1.rs:21:1 + | +LL | impl Remote1>> 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/coherence/coherence-pair-covered-uncovered.rs similarity index 100% rename from src/test/compile-fail/coherence-pair-covered-uncovered.rs rename to src/test/ui/coherence/coherence-pair-covered-uncovered.rs diff --git a/src/test/ui/coherence/coherence-pair-covered-uncovered.stderr b/src/test/ui/coherence/coherence-pair-covered-uncovered.stderr new file mode 100644 index 0000000000000..f58cb4648cbfc --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-pair-covered-uncovered.rs:18:1 + | +LL | impl Remote for Pair> { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/coherence/coherence-projection-conflict-orphan.rs similarity index 100% rename from src/test/compile-fail/coherence-projection-conflict-orphan.rs rename to src/test/ui/coherence/coherence-projection-conflict-orphan.rs diff --git a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr b/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr new file mode 100644 index 0000000000000..a0fcf072fa813 --- /dev/null +++ b/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr @@ -0,0 +1,14 @@ +error[E0119]: conflicting implementations of trait `Foo` for type `i32`: + --> $DIR/coherence-projection-conflict-orphan.rs:26:1 + | +LL | impl Foo for i32 { } + | --------------------- first implementation here +LL | +LL | impl Foo 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/coherence/coherence-projection-conflict-ty-param.rs similarity index 100% rename from src/test/compile-fail/coherence-projection-conflict-ty-param.rs rename to src/test/ui/coherence/coherence-projection-conflict-ty-param.rs diff --git a/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr b/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr new file mode 100644 index 0000000000000..cfbf96bc1c851 --- /dev/null +++ b/src/test/ui/coherence/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 > Foo

for Option {} + | ---------------------------------------- first implementation here +LL | +LL | impl Foo for Option { } //~ 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/coherence/coherence-projection-conflict.rs similarity index 100% rename from src/test/compile-fail/coherence-projection-conflict.rs rename to src/test/ui/coherence/coherence-projection-conflict.rs diff --git a/src/test/ui/coherence/coherence-projection-conflict.stderr b/src/test/ui/coherence/coherence-projection-conflict.stderr new file mode 100644 index 0000000000000..3832faf28d820 --- /dev/null +++ b/src/test/ui/coherence/coherence-projection-conflict.stderr @@ -0,0 +1,12 @@ +error[E0119]: conflicting implementations of trait `Foo` for type `i32`: + --> $DIR/coherence-projection-conflict.rs:21:1 + | +LL | impl Foo for i32 { } + | --------------------- first implementation here +LL | +LL | impl Foo 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/coherence/coherence-projection-ok-orphan.rs similarity index 100% rename from src/test/compile-fail/coherence-projection-ok-orphan.rs rename to src/test/ui/coherence/coherence-projection-ok-orphan.rs diff --git a/src/test/ui/coherence/coherence-projection-ok-orphan.stderr b/src/test/ui/coherence/coherence-projection-ok-orphan.stderr new file mode 100644 index 0000000000000..1b9a32525bfac --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence-projection-ok.rs similarity index 100% rename from src/test/compile-fail/coherence-projection-ok.rs rename to src/test/ui/coherence/coherence-projection-ok.rs diff --git a/src/test/ui/coherence/coherence-projection-ok.stderr b/src/test/ui/coherence/coherence-projection-ok.stderr new file mode 100644 index 0000000000000..945f3b396b7b2 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence-tuple-conflict.rs similarity index 100% rename from src/test/compile-fail/coherence-tuple-conflict.rs rename to src/test/ui/coherence/coherence-tuple-conflict.rs diff --git a/src/test/ui/coherence/coherence-tuple-conflict.stderr b/src/test/ui/coherence/coherence-tuple-conflict.stderr new file mode 100644 index 0000000000000..4ceafea0a70fd --- /dev/null +++ b/src/test/ui/coherence/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 MyTrait for (T,T) { + | ------------------------- first implementation here +... +LL | impl 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/coherence/coherence-vec-local-2.rs similarity index 100% rename from src/test/compile-fail/coherence-vec-local-2.rs rename to src/test/ui/coherence/coherence-vec-local-2.rs diff --git a/src/test/ui/coherence/coherence-vec-local-2.stderr b/src/test/ui/coherence/coherence-vec-local-2.stderr new file mode 100644 index 0000000000000..2980d4a3392c5 --- /dev/null +++ b/src/test/ui/coherence/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`) + --> $DIR/coherence-vec-local-2.rs:21:1 + | +LL | impl Remote for Vec> { } //~ 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/coherence/coherence-vec-local.rs similarity index 100% rename from src/test/compile-fail/coherence-vec-local.rs rename to src/test/ui/coherence/coherence-vec-local.rs diff --git a/src/test/ui/coherence/coherence-vec-local.stderr b/src/test/ui/coherence/coherence-vec-local.stderr new file mode 100644 index 0000000000000..b3c26160fe5b1 --- /dev/null +++ b/src/test/ui/coherence/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 { } //~ 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/coherence/coherence_copy_like_err_fundamental_struct.rs similarity index 100% rename from src/test/compile-fail/coherence_copy_like_err_fundamental_struct.rs rename to src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.stderr b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.stderr new file mode 100644 index 0000000000000..675dc1b7004d8 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence_copy_like_err_fundamental_struct_ref.rs similarity index 100% rename from src/test/compile-fail/coherence_copy_like_err_fundamental_struct_ref.rs rename to src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.stderr b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.stderr new file mode 100644 index 0000000000000..5143d4e874b09 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs similarity index 100% rename from src/test/compile-fail/coherence_copy_like_err_fundamental_struct_tuple.rs rename to src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.rs diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr new file mode 100644 index 0000000000000..c7c49fe14622b --- /dev/null +++ b/src/test/ui/coherence/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 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/coherence/coherence_copy_like_err_struct.rs similarity index 100% rename from src/test/compile-fail/coherence_copy_like_err_struct.rs rename to src/test/ui/coherence/coherence_copy_like_err_struct.rs diff --git a/src/test/ui/coherence/coherence_copy_like_err_struct.stderr b/src/test/ui/coherence/coherence_copy_like_err_struct.stderr new file mode 100644 index 0000000000000..786a3df050375 --- /dev/null +++ b/src/test/ui/coherence/coherence_copy_like_err_struct.stderr @@ -0,0 +1,14 @@ +error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct`: + --> $DIR/coherence_copy_like_err_struct.rs:29:1 + | +LL | impl MyTrait for T { } + | ---------------------------------- first implementation here +... +LL | impl MyTrait for lib::MyStruct { } //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `lib::MyStruct` + | + = note: upstream crates may add new impl of trait `lib::MyCopy` for type `lib::MyStruct` 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/coherence/coherence_copy_like_err_tuple.rs similarity index 100% rename from src/test/compile-fail/coherence_copy_like_err_tuple.rs rename to src/test/ui/coherence/coherence_copy_like_err_tuple.rs diff --git a/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr b/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr new file mode 100644 index 0000000000000..3708a38443c3c --- /dev/null +++ b/src/test/ui/coherence/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 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/coherence/coherence_inherent.rs similarity index 100% rename from src/test/compile-fail/coherence_inherent.rs rename to src/test/ui/coherence/coherence_inherent.rs diff --git a/src/test/ui/coherence/coherence_inherent.stderr b/src/test/ui/coherence/coherence_inherent.stderr new file mode 100644 index 0000000000000..1708979ab11d6 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence_inherent_cc.rs similarity index 100% rename from src/test/compile-fail/coherence_inherent_cc.rs rename to src/test/ui/coherence/coherence_inherent_cc.rs diff --git a/src/test/ui/coherence/coherence_inherent_cc.stderr b/src/test/ui/coherence/coherence_inherent_cc.stderr new file mode 100644 index 0000000000000..a3c1b60d09a61 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence_local.rs similarity index 100% rename from src/test/compile-fail/coherence_local.rs rename to src/test/ui/coherence/coherence_local.rs diff --git a/src/test/ui/coherence/coherence_local.stderr b/src/test/ui/coherence/coherence_local.stderr new file mode 100644 index 0000000000000..c4340e8d87686 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence_local_err_struct.rs similarity index 100% rename from src/test/compile-fail/coherence_local_err_struct.rs rename to src/test/ui/coherence/coherence_local_err_struct.rs diff --git a/src/test/ui/coherence/coherence_local_err_struct.stderr b/src/test/ui/coherence/coherence_local_err_struct.stderr new file mode 100644 index 0000000000000..c35e95040de15 --- /dev/null +++ b/src/test/ui/coherence/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 { } //~ 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/coherence/coherence_local_err_tuple.rs similarity index 100% rename from src/test/compile-fail/coherence_local_err_tuple.rs rename to src/test/ui/coherence/coherence_local_err_tuple.rs diff --git a/src/test/ui/coherence/coherence_local_err_tuple.stderr b/src/test/ui/coherence/coherence_local_err_tuple.stderr new file mode 100644 index 0000000000000..a3f9f2d32b8f9 --- /dev/null +++ b/src/test/ui/coherence/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/coherence/coherence_local_ref.rs similarity index 100% rename from src/test/compile-fail/coherence_local_ref.rs rename to src/test/ui/coherence/coherence_local_ref.rs diff --git a/src/test/ui/coherence/coherence_local_ref.stderr b/src/test/ui/coherence/coherence_local_ref.stderr new file mode 100644 index 0000000000000..13d6fdd80f8a1 --- /dev/null +++ b/src/test/ui/coherence/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_error_macro.rs similarity index 100% rename from src/test/compile-fail/compile_error_macro.rs rename to src/test/ui/compile_error_macro.rs diff --git a/src/test/ui/compile_error_macro.stderr b/src/test/ui/compile_error_macro.stderr new file mode 100644 index 0000000000000..1abf5accc1747 --- /dev/null +++ b/src/test/ui/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/concat.rs similarity index 100% rename from src/test/compile-fail/concat.rs rename to src/test/ui/concat.rs diff --git a/src/test/ui/concat.stderr b/src/test/ui/concat.stderr new file mode 100644 index 0000000000000..0128811353f16 --- /dev/null +++ b/src/test/ui/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/conflicting-repr-hints.rs similarity index 100% rename from src/test/compile-fail/conflicting-repr-hints.rs rename to src/test/ui/conflicting-repr-hints.rs diff --git a/src/test/ui/conflicting-repr-hints.stderr b/src/test/ui/conflicting-repr-hints.stderr new file mode 100644 index 0000000000000..7a4e5a5488ad3 --- /dev/null +++ b/src/test/ui/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/conservative_impl_trait.rs similarity index 100% rename from src/test/compile-fail/conservative_impl_trait.rs rename to src/test/ui/conservative_impl_trait.rs diff --git a/src/test/ui/conservative_impl_trait.stderr b/src/test/ui/conservative_impl_trait.stderr new file mode 100644 index 0000000000000..6fcd384566cf8 --- /dev/null +++ b/src/test/ui/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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `()` 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/constructor-lifetime-args.rs b/src/test/ui/constructor-lifetime-args.rs similarity index 100% rename from src/test/compile-fail/constructor-lifetime-args.rs rename to src/test/ui/constructor-lifetime-args.rs diff --git a/src/test/ui/constructor-lifetime-args.stderr b/src/test/ui/constructor-lifetime-args.stderr new file mode 100644 index 0000000000000..1710594d255e7 --- /dev/null +++ b/src/test/ui/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/auxiliary/const_fn_lib.rs b/src/test/ui/consts/auxiliary/const_fn_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/const_fn_lib.rs rename to src/test/ui/consts/auxiliary/const_fn_lib.rs diff --git a/src/test/compile-fail/const-array-oob-arith.rs b/src/test/ui/consts/const-array-oob-arith.rs similarity index 100% rename from src/test/compile-fail/const-array-oob-arith.rs rename to src/test/ui/consts/const-array-oob-arith.rs diff --git a/src/test/ui/consts/const-array-oob-arith.stderr b/src/test/ui/consts/const-array-oob-arith.stderr new file mode 100644 index 0000000000000..5b5f9425e73b8 --- /dev/null +++ b/src/test/ui/consts/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/consts/const-array-oob.rs similarity index 100% rename from src/test/compile-fail/const-array-oob.rs rename to src/test/ui/consts/const-array-oob.rs diff --git a/src/test/ui/consts/const-array-oob.stderr b/src/test/ui/consts/const-array-oob.stderr new file mode 100644 index 0000000000000..09e4918bf6eed --- /dev/null +++ b/src/test/ui/consts/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/consts/const-block-non-item-statement-2.rs similarity index 100% rename from src/test/compile-fail/const-block-non-item-statement-2.rs rename to src/test/ui/consts/const-block-non-item-statement-2.rs diff --git a/src/test/ui/consts/const-block-non-item-statement-2.stderr b/src/test/ui/consts/const-block-non-item-statement-2.stderr new file mode 100644 index 0000000000000..580f7e039d1c3 --- /dev/null +++ b/src/test/ui/consts/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/consts/const-block-non-item-statement-3.rs similarity index 100% rename from src/test/compile-fail/const-block-non-item-statement-3.rs rename to src/test/ui/consts/const-block-non-item-statement-3.rs diff --git a/src/test/ui/consts/const-block-non-item-statement-3.stderr b/src/test/ui/consts/const-block-non-item-statement-3.stderr new file mode 100644 index 0000000000000..0124288d43d57 --- /dev/null +++ b/src/test/ui/consts/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/consts/const-block-non-item-statement.rs similarity index 100% rename from src/test/compile-fail/const-block-non-item-statement.rs rename to src/test/ui/consts/const-block-non-item-statement.rs diff --git a/src/test/ui/consts/const-block-non-item-statement.stderr b/src/test/ui/consts/const-block-non-item-statement.stderr new file mode 100644 index 0000000000000..b367a9d99374e --- /dev/null +++ b/src/test/ui/consts/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/consts/const-call.rs similarity index 100% rename from src/test/compile-fail/const-call.rs rename to src/test/ui/consts/const-call.rs diff --git a/src/test/ui/consts/const-call.stderr b/src/test/ui/consts/const-call.stderr new file mode 100644 index 0000000000000..efc3c58c6813b --- /dev/null +++ b/src/test/ui/consts/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/consts/const-cast-different-types.rs similarity index 100% rename from src/test/compile-fail/const-cast-different-types.rs rename to src/test/ui/consts/const-cast-different-types.rs diff --git a/src/test/ui/consts/const-cast-different-types.stderr b/src/test/ui/consts/const-cast-different-types.stderr new file mode 100644 index 0000000000000..bc4d135869744 --- /dev/null +++ b/src/test/ui/consts/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/consts/const-cast-wrong-type.rs similarity index 100% rename from src/test/compile-fail/const-cast-wrong-type.rs rename to src/test/ui/consts/const-cast-wrong-type.rs diff --git a/src/test/ui/consts/const-cast-wrong-type.stderr b/src/test/ui/consts/const-cast-wrong-type.stderr new file mode 100644 index 0000000000000..d7ac89cc6a04e --- /dev/null +++ b/src/test/ui/consts/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/ui/const-deref-ptr.rs b/src/test/ui/consts/const-deref-ptr.rs similarity index 100% rename from src/test/ui/const-deref-ptr.rs rename to src/test/ui/consts/const-deref-ptr.rs diff --git a/src/test/ui/const-deref-ptr.stderr b/src/test/ui/consts/const-deref-ptr.stderr similarity index 100% rename from src/test/ui/const-deref-ptr.stderr rename to src/test/ui/consts/const-deref-ptr.stderr diff --git a/src/test/compile-fail/const-err-early.rs b/src/test/ui/consts/const-err-early.rs similarity index 100% rename from src/test/compile-fail/const-err-early.rs rename to src/test/ui/consts/const-err-early.rs diff --git a/src/test/ui/consts/const-err-early.stderr b/src/test/ui/consts/const-err-early.stderr new file mode 100644 index 0000000000000..36f3ac1a9bca2 --- /dev/null +++ b/src/test/ui/consts/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/consts/const-err-multi.rs similarity index 100% rename from src/test/compile-fail/const-err-multi.rs rename to src/test/ui/consts/const-err-multi.rs diff --git a/src/test/ui/consts/const-err-multi.stderr b/src/test/ui/consts/const-err-multi.stderr new file mode 100644 index 0000000000000..dd3eaa4c47b9d --- /dev/null +++ b/src/test/ui/consts/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/consts/const-err.rs similarity index 100% rename from src/test/compile-fail/const-err.rs rename to src/test/ui/consts/const-err.rs diff --git a/src/test/ui/consts/const-err.stderr b/src/test/ui/consts/const-err.stderr new file mode 100644 index 0000000000000..1674f99b6823d --- /dev/null +++ b/src/test/ui/consts/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/consts/const-err2.rs similarity index 100% rename from src/test/compile-fail/const-err2.rs rename to src/test/ui/consts/const-err2.rs diff --git a/src/test/ui/consts/const-err2.stderr b/src/test/ui/consts/const-err2.stderr new file mode 100644 index 0000000000000..7201ecbc55d5e --- /dev/null +++ b/src/test/ui/consts/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-err4.rs b/src/test/ui/consts/const-err4.rs similarity index 100% rename from src/test/compile-fail/const-err4.rs rename to src/test/ui/consts/const-err4.rs diff --git a/src/test/ui/consts/const-err4.stderr b/src/test/ui/consts/const-err4.stderr new file mode 100644 index 0000000000000..dc64737b22f5e --- /dev/null +++ b/src/test/ui/consts/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/ui/const-eval/conditional_array_execution.nll.stderr b/src/test/ui/consts/const-eval/conditional_array_execution.nll.stderr similarity index 100% rename from src/test/ui/const-eval/conditional_array_execution.nll.stderr rename to src/test/ui/consts/const-eval/conditional_array_execution.nll.stderr diff --git a/src/test/ui/const-eval/conditional_array_execution.rs b/src/test/ui/consts/const-eval/conditional_array_execution.rs similarity index 100% rename from src/test/ui/const-eval/conditional_array_execution.rs rename to src/test/ui/consts/const-eval/conditional_array_execution.rs diff --git a/src/test/ui/const-eval/conditional_array_execution.stderr b/src/test/ui/consts/const-eval/conditional_array_execution.stderr similarity index 100% rename from src/test/ui/const-eval/conditional_array_execution.stderr rename to src/test/ui/consts/const-eval/conditional_array_execution.stderr diff --git a/src/test/ui/const-eval-overflow-2.rs b/src/test/ui/consts/const-eval/const-eval-overflow-2.rs similarity index 100% rename from src/test/ui/const-eval-overflow-2.rs rename to src/test/ui/consts/const-eval/const-eval-overflow-2.rs diff --git a/src/test/ui/const-eval-overflow-2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-2.stderr similarity index 100% rename from src/test/ui/const-eval-overflow-2.stderr rename to src/test/ui/consts/const-eval/const-eval-overflow-2.stderr diff --git a/src/test/compile-fail/const-eval-overflow-3.rs b/src/test/ui/consts/const-eval/const-eval-overflow-3.rs similarity index 100% rename from src/test/compile-fail/const-eval-overflow-3.rs rename to src/test/ui/consts/const-eval/const-eval-overflow-3.rs diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-3.stderr new file mode 100644 index 0000000000000..f2b4e6b3b567b --- /dev/null +++ b/src/test/ui/consts/const-eval/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/consts/const-eval/const-eval-overflow-3b.rs similarity index 100% rename from src/test/compile-fail/const-eval-overflow-3b.rs rename to src/test/ui/consts/const-eval/const-eval-overflow-3b.rs diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-3b.stderr new file mode 100644 index 0000000000000..4f1163bf9a197 --- /dev/null +++ b/src/test/ui/consts/const-eval/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` 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/ui/const-eval-overflow-4.rs b/src/test/ui/consts/const-eval/const-eval-overflow-4.rs similarity index 100% rename from src/test/ui/const-eval-overflow-4.rs rename to src/test/ui/consts/const-eval/const-eval-overflow-4.rs diff --git a/src/test/ui/const-eval-overflow-4.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-4.stderr similarity index 100% rename from src/test/ui/const-eval-overflow-4.stderr rename to src/test/ui/consts/const-eval/const-eval-overflow-4.stderr diff --git a/src/test/compile-fail/const-eval-overflow-4b.rs b/src/test/ui/consts/const-eval/const-eval-overflow-4b.rs similarity index 100% rename from src/test/compile-fail/const-eval-overflow-4b.rs rename to src/test/ui/consts/const-eval/const-eval-overflow-4b.rs diff --git a/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow-4b.stderr new file mode 100644 index 0000000000000..d171e7f09d1e8 --- /dev/null +++ b/src/test/ui/consts/const-eval/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` 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/consts/const-eval/const-eval-overflow2.rs similarity index 100% rename from src/test/compile-fail/const-eval-overflow2.rs rename to src/test/ui/consts/const-eval/const-eval-overflow2.rs diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2.stderr new file mode 100644 index 0000000000000..5cf5ce367e253 --- /dev/null +++ b/src/test/ui/consts/const-eval/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/consts/const-eval/const-eval-overflow2b.rs similarity index 100% rename from src/test/compile-fail/const-eval-overflow2b.rs rename to src/test/ui/consts/const-eval/const-eval-overflow2b.rs diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2b.stderr new file mode 100644 index 0000000000000..458a9e11e7573 --- /dev/null +++ b/src/test/ui/consts/const-eval/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/consts/const-eval/const-eval-overflow2c.rs similarity index 100% rename from src/test/compile-fail/const-eval-overflow2c.rs rename to src/test/ui/consts/const-eval/const-eval-overflow2c.rs diff --git a/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr b/src/test/ui/consts/const-eval/const-eval-overflow2c.stderr new file mode 100644 index 0000000000000..866860281cf66 --- /dev/null +++ b/src/test/ui/consts/const-eval/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/ui/const-eval-span.rs b/src/test/ui/consts/const-eval/const-eval-span.rs similarity index 100% rename from src/test/ui/const-eval-span.rs rename to src/test/ui/consts/const-eval/const-eval-span.rs diff --git a/src/test/ui/const-eval-span.stderr b/src/test/ui/consts/const-eval/const-eval-span.stderr similarity index 100% rename from src/test/ui/const-eval-span.stderr rename to src/test/ui/consts/const-eval/const-eval-span.stderr diff --git a/src/test/ui/const-eval/const_let.rs b/src/test/ui/consts/const-eval/const_let.rs similarity index 100% rename from src/test/ui/const-eval/const_let.rs rename to src/test/ui/consts/const-eval/const_let.rs diff --git a/src/test/ui/const-eval/const_let.stderr b/src/test/ui/consts/const-eval/const_let.stderr similarity index 100% rename from src/test/ui/const-eval/const_let.stderr rename to src/test/ui/consts/const-eval/const_let.stderr diff --git a/src/test/ui/const-eval/const_prop_errors.rs b/src/test/ui/consts/const-eval/const_prop_errors.rs similarity index 100% rename from src/test/ui/const-eval/const_prop_errors.rs rename to src/test/ui/consts/const-eval/const_prop_errors.rs diff --git a/src/test/ui/const-eval/const_raw_ptr_ops.rs b/src/test/ui/consts/const-eval/const_raw_ptr_ops.rs similarity index 100% rename from src/test/ui/const-eval/const_raw_ptr_ops.rs rename to src/test/ui/consts/const-eval/const_raw_ptr_ops.rs diff --git a/src/test/ui/const-eval/const_raw_ptr_ops.stderr b/src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr similarity index 100% rename from src/test/ui/const-eval/const_raw_ptr_ops.stderr rename to src/test/ui/consts/const-eval/const_raw_ptr_ops.stderr diff --git a/src/test/ui/const-eval/const_signed_pat.rs b/src/test/ui/consts/const-eval/const_signed_pat.rs similarity index 100% rename from src/test/ui/const-eval/const_signed_pat.rs rename to src/test/ui/consts/const-eval/const_signed_pat.rs diff --git a/src/test/ui/const-eval/const_transmute.rs b/src/test/ui/consts/const-eval/const_transmute.rs similarity index 100% rename from src/test/ui/const-eval/const_transmute.rs rename to src/test/ui/consts/const-eval/const_transmute.rs diff --git a/src/test/ui/const-eval/dont_promote_unstable_const_fn.nll.stderr b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.nll.stderr similarity index 100% rename from src/test/ui/const-eval/dont_promote_unstable_const_fn.nll.stderr rename to src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.nll.stderr diff --git a/src/test/ui/const-eval/dont_promote_unstable_const_fn.rs b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs similarity index 100% rename from src/test/ui/const-eval/dont_promote_unstable_const_fn.rs rename to src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.rs diff --git a/src/test/ui/const-eval/dont_promote_unstable_const_fn.stderr b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr similarity index 100% rename from src/test/ui/const-eval/dont_promote_unstable_const_fn.stderr rename to src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.stderr diff --git a/src/test/ui/const-eval/double_check.rs b/src/test/ui/consts/const-eval/double_check.rs similarity index 100% rename from src/test/ui/const-eval/double_check.rs rename to src/test/ui/consts/const-eval/double_check.rs diff --git a/src/test/ui/const-eval/double_check2.rs b/src/test/ui/consts/const-eval/double_check2.rs similarity index 100% rename from src/test/ui/const-eval/double_check2.rs rename to src/test/ui/consts/const-eval/double_check2.rs diff --git a/src/test/ui/const-eval/double_check2.stderr b/src/test/ui/consts/const-eval/double_check2.stderr similarity index 100% rename from src/test/ui/const-eval/double_check2.stderr rename to src/test/ui/consts/const-eval/double_check2.stderr diff --git a/src/test/ui/const-eval/duration_conversion.rs b/src/test/ui/consts/const-eval/duration_conversion.rs similarity index 100% rename from src/test/ui/const-eval/duration_conversion.rs rename to src/test/ui/consts/const-eval/duration_conversion.rs diff --git a/src/test/ui/const-eval/enum_discr.rs b/src/test/ui/consts/const-eval/enum_discr.rs similarity index 100% rename from src/test/ui/const-eval/enum_discr.rs rename to src/test/ui/consts/const-eval/enum_discr.rs diff --git a/src/test/ui/const-eval/extern_fat_pointer.rs b/src/test/ui/consts/const-eval/extern_fat_pointer.rs similarity index 100% rename from src/test/ui/const-eval/extern_fat_pointer.rs rename to src/test/ui/consts/const-eval/extern_fat_pointer.rs diff --git a/src/test/ui/const-eval/feature-gate-const_fn_union.rs b/src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs similarity index 100% rename from src/test/ui/const-eval/feature-gate-const_fn_union.rs rename to src/test/ui/consts/const-eval/feature-gate-const_fn_union.rs diff --git a/src/test/ui/const-eval/feature-gate-const_fn_union.stderr b/src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr similarity index 100% rename from src/test/ui/const-eval/feature-gate-const_fn_union.stderr rename to src/test/ui/consts/const-eval/feature-gate-const_fn_union.stderr diff --git a/src/test/ui/const-eval/ice-generic-assoc-const.rs b/src/test/ui/consts/const-eval/ice-generic-assoc-const.rs similarity index 100% rename from src/test/ui/const-eval/ice-generic-assoc-const.rs rename to src/test/ui/consts/const-eval/ice-generic-assoc-const.rs diff --git a/src/test/ui/const-eval/ice-packed.rs b/src/test/ui/consts/const-eval/ice-packed.rs similarity index 100% rename from src/test/ui/const-eval/ice-packed.rs rename to src/test/ui/consts/const-eval/ice-packed.rs diff --git a/src/test/ui/const-eval/index_out_of_bounds.rs b/src/test/ui/consts/const-eval/index_out_of_bounds.rs similarity index 100% rename from src/test/ui/const-eval/index_out_of_bounds.rs rename to src/test/ui/consts/const-eval/index_out_of_bounds.rs diff --git a/src/test/ui/const-eval/index_out_of_bounds.stderr b/src/test/ui/consts/const-eval/index_out_of_bounds.stderr similarity index 100% rename from src/test/ui/const-eval/index_out_of_bounds.stderr rename to src/test/ui/consts/const-eval/index_out_of_bounds.stderr diff --git a/src/test/ui/const-eval/index_out_of_bounds_propagated.rs b/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.rs similarity index 100% rename from src/test/ui/const-eval/index_out_of_bounds_propagated.rs rename to src/test/ui/consts/const-eval/index_out_of_bounds_propagated.rs diff --git a/src/test/ui/const-eval/index_out_of_bounds_propagated.stderr b/src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr similarity index 100% rename from src/test/ui/const-eval/index_out_of_bounds_propagated.stderr rename to src/test/ui/consts/const-eval/index_out_of_bounds_propagated.stderr diff --git a/src/test/ui/const-eval/infinite_loop.rs b/src/test/ui/consts/const-eval/infinite_loop.rs similarity index 100% rename from src/test/ui/const-eval/infinite_loop.rs rename to src/test/ui/consts/const-eval/infinite_loop.rs diff --git a/src/test/ui/const-eval/infinite_loop.stderr b/src/test/ui/consts/const-eval/infinite_loop.stderr similarity index 100% rename from src/test/ui/const-eval/infinite_loop.stderr rename to src/test/ui/consts/const-eval/infinite_loop.stderr diff --git a/src/test/ui/const-eval/issue-43197.nll.stderr b/src/test/ui/consts/const-eval/issue-43197.nll.stderr similarity index 100% rename from src/test/ui/const-eval/issue-43197.nll.stderr rename to src/test/ui/consts/const-eval/issue-43197.nll.stderr diff --git a/src/test/ui/const-eval/issue-43197.rs b/src/test/ui/consts/const-eval/issue-43197.rs similarity index 100% rename from src/test/ui/const-eval/issue-43197.rs rename to src/test/ui/consts/const-eval/issue-43197.rs diff --git a/src/test/ui/const-eval/issue-43197.stderr b/src/test/ui/consts/const-eval/issue-43197.stderr similarity index 100% rename from src/test/ui/const-eval/issue-43197.stderr rename to src/test/ui/consts/const-eval/issue-43197.stderr diff --git a/src/test/ui/const-eval/issue-44578.nll.stderr b/src/test/ui/consts/const-eval/issue-44578.nll.stderr similarity index 100% rename from src/test/ui/const-eval/issue-44578.nll.stderr rename to src/test/ui/consts/const-eval/issue-44578.nll.stderr diff --git a/src/test/ui/const-eval/issue-44578.rs b/src/test/ui/consts/const-eval/issue-44578.rs similarity index 100% rename from src/test/ui/const-eval/issue-44578.rs rename to src/test/ui/consts/const-eval/issue-44578.rs diff --git a/src/test/ui/const-eval/issue-44578.stderr b/src/test/ui/consts/const-eval/issue-44578.stderr similarity index 100% rename from src/test/ui/const-eval/issue-44578.stderr rename to src/test/ui/consts/const-eval/issue-44578.stderr diff --git a/src/test/ui/const-eval/issue-47971.rs b/src/test/ui/consts/const-eval/issue-47971.rs similarity index 100% rename from src/test/ui/const-eval/issue-47971.rs rename to src/test/ui/consts/const-eval/issue-47971.rs diff --git a/src/test/ui/const-eval/issue-50706.rs b/src/test/ui/consts/const-eval/issue-50706.rs similarity index 100% rename from src/test/ui/const-eval/issue-50706.rs rename to src/test/ui/consts/const-eval/issue-50706.rs diff --git a/src/test/ui/const-eval/issue-50814-2.rs b/src/test/ui/consts/const-eval/issue-50814-2.rs similarity index 100% rename from src/test/ui/const-eval/issue-50814-2.rs rename to src/test/ui/consts/const-eval/issue-50814-2.rs diff --git a/src/test/ui/const-eval/issue-50814-2.stderr b/src/test/ui/consts/const-eval/issue-50814-2.stderr similarity index 100% rename from src/test/ui/const-eval/issue-50814-2.stderr rename to src/test/ui/consts/const-eval/issue-50814-2.stderr diff --git a/src/test/ui/const-eval/issue-50814.rs b/src/test/ui/consts/const-eval/issue-50814.rs similarity index 100% rename from src/test/ui/const-eval/issue-50814.rs rename to src/test/ui/consts/const-eval/issue-50814.rs diff --git a/src/test/ui/const-eval/issue-50814.stderr b/src/test/ui/consts/const-eval/issue-50814.stderr similarity index 100% rename from src/test/ui/const-eval/issue-50814.stderr rename to src/test/ui/consts/const-eval/issue-50814.stderr diff --git a/src/test/ui/const-eval/issue-51300.rs b/src/test/ui/consts/const-eval/issue-51300.rs similarity index 100% rename from src/test/ui/const-eval/issue-51300.rs rename to src/test/ui/consts/const-eval/issue-51300.rs diff --git a/src/test/ui/const-eval/issue-52442.rs b/src/test/ui/consts/const-eval/issue-52442.rs similarity index 100% rename from src/test/ui/const-eval/issue-52442.rs rename to src/test/ui/consts/const-eval/issue-52442.rs diff --git a/src/test/ui/const-eval/issue-52442.stderr b/src/test/ui/consts/const-eval/issue-52442.stderr similarity index 100% rename from src/test/ui/const-eval/issue-52442.stderr rename to src/test/ui/consts/const-eval/issue-52442.stderr diff --git a/src/test/ui/const-eval/issue-52443.rs b/src/test/ui/consts/const-eval/issue-52443.rs similarity index 100% rename from src/test/ui/const-eval/issue-52443.rs rename to src/test/ui/consts/const-eval/issue-52443.rs diff --git a/src/test/ui/const-eval/issue-52443.stderr b/src/test/ui/consts/const-eval/issue-52443.stderr similarity index 100% rename from src/test/ui/const-eval/issue-52443.stderr rename to src/test/ui/consts/const-eval/issue-52443.stderr diff --git a/src/test/ui/const-eval/match-test-ptr-null.rs b/src/test/ui/consts/const-eval/match-test-ptr-null.rs similarity index 100% rename from src/test/ui/const-eval/match-test-ptr-null.rs rename to src/test/ui/consts/const-eval/match-test-ptr-null.rs diff --git a/src/test/ui/const-eval/match-test-ptr-null.stderr b/src/test/ui/consts/const-eval/match-test-ptr-null.stderr similarity index 100% rename from src/test/ui/const-eval/match-test-ptr-null.stderr rename to src/test/ui/consts/const-eval/match-test-ptr-null.stderr diff --git a/src/test/ui/const-eval/no_lint_for_statically_known_error.rs b/src/test/ui/consts/const-eval/no_lint_for_statically_known_error.rs similarity index 100% rename from src/test/ui/const-eval/no_lint_for_statically_known_error.rs rename to src/test/ui/consts/const-eval/no_lint_for_statically_known_error.rs diff --git a/src/test/ui/const-eval/promote_mutable_zst_mir_borrowck.rs b/src/test/ui/consts/const-eval/promote_mutable_zst_mir_borrowck.rs similarity index 100% rename from src/test/ui/const-eval/promote_mutable_zst_mir_borrowck.rs rename to src/test/ui/consts/const-eval/promote_mutable_zst_mir_borrowck.rs diff --git a/src/test/ui/const-eval/promoted_const_fn_fail.rs b/src/test/ui/consts/const-eval/promoted_const_fn_fail.rs similarity index 100% rename from src/test/ui/const-eval/promoted_const_fn_fail.rs rename to src/test/ui/consts/const-eval/promoted_const_fn_fail.rs diff --git a/src/test/ui/const-eval/promoted_errors.rs b/src/test/ui/consts/const-eval/promoted_errors.rs similarity index 100% rename from src/test/ui/const-eval/promoted_errors.rs rename to src/test/ui/consts/const-eval/promoted_errors.rs diff --git a/src/test/ui/const-eval/promoted_errors.stderr b/src/test/ui/consts/const-eval/promoted_errors.stderr similarity index 100% rename from src/test/ui/const-eval/promoted_errors.stderr rename to src/test/ui/consts/const-eval/promoted_errors.stderr diff --git a/src/test/ui/const-eval/promoted_raw_ptr_ops.rs b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.rs similarity index 100% rename from src/test/ui/const-eval/promoted_raw_ptr_ops.rs rename to src/test/ui/consts/const-eval/promoted_raw_ptr_ops.rs diff --git a/src/test/ui/const-eval/promoted_raw_ptr_ops.stderr b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.stderr similarity index 100% rename from src/test/ui/const-eval/promoted_raw_ptr_ops.stderr rename to src/test/ui/consts/const-eval/promoted_raw_ptr_ops.stderr diff --git a/src/test/ui/const-eval/pub_const_err.rs b/src/test/ui/consts/const-eval/pub_const_err.rs similarity index 100% rename from src/test/ui/const-eval/pub_const_err.rs rename to src/test/ui/consts/const-eval/pub_const_err.rs diff --git a/src/test/ui/const-eval/pub_const_err.stderr b/src/test/ui/consts/const-eval/pub_const_err.stderr similarity index 100% rename from src/test/ui/const-eval/pub_const_err.stderr rename to src/test/ui/consts/const-eval/pub_const_err.stderr diff --git a/src/test/ui/const-eval/pub_const_err_bin.rs b/src/test/ui/consts/const-eval/pub_const_err_bin.rs similarity index 100% rename from src/test/ui/const-eval/pub_const_err_bin.rs rename to src/test/ui/consts/const-eval/pub_const_err_bin.rs diff --git a/src/test/ui/const-eval/pub_const_err_bin.stderr b/src/test/ui/consts/const-eval/pub_const_err_bin.stderr similarity index 100% rename from src/test/ui/const-eval/pub_const_err_bin.stderr rename to src/test/ui/consts/const-eval/pub_const_err_bin.stderr diff --git a/src/test/ui/const-eval/ref_to_float_transmute.rs b/src/test/ui/consts/const-eval/ref_to_float_transmute.rs similarity index 100% rename from src/test/ui/const-eval/ref_to_float_transmute.rs rename to src/test/ui/consts/const-eval/ref_to_float_transmute.rs diff --git a/src/test/ui/const-eval/ref_to_int_match.rs b/src/test/ui/consts/const-eval/ref_to_int_match.rs similarity index 100% rename from src/test/ui/const-eval/ref_to_int_match.rs rename to src/test/ui/consts/const-eval/ref_to_int_match.rs diff --git a/src/test/ui/const-eval/ref_to_int_match.stderr b/src/test/ui/consts/const-eval/ref_to_int_match.stderr similarity index 100% rename from src/test/ui/const-eval/ref_to_int_match.stderr rename to src/test/ui/consts/const-eval/ref_to_int_match.stderr diff --git a/src/test/ui/const-eval/shift_overflow.rs b/src/test/ui/consts/const-eval/shift_overflow.rs similarity index 100% rename from src/test/ui/const-eval/shift_overflow.rs rename to src/test/ui/consts/const-eval/shift_overflow.rs diff --git a/src/test/ui/const-eval/shift_overflow.stderr b/src/test/ui/consts/const-eval/shift_overflow.stderr similarity index 100% rename from src/test/ui/const-eval/shift_overflow.stderr rename to src/test/ui/consts/const-eval/shift_overflow.stderr diff --git a/src/test/ui/const-eval/simple_with_undef.rs b/src/test/ui/consts/const-eval/simple_with_undef.rs similarity index 100% rename from src/test/ui/const-eval/simple_with_undef.rs rename to src/test/ui/consts/const-eval/simple_with_undef.rs diff --git a/src/test/ui/const-eval/strlen.rs b/src/test/ui/consts/const-eval/strlen.rs similarity index 100% rename from src/test/ui/const-eval/strlen.rs rename to src/test/ui/consts/const-eval/strlen.rs diff --git a/src/test/ui/const-eval/ub-enum-ptr.rs b/src/test/ui/consts/const-eval/ub-enum-ptr.rs similarity index 100% rename from src/test/ui/const-eval/ub-enum-ptr.rs rename to src/test/ui/consts/const-eval/ub-enum-ptr.rs diff --git a/src/test/ui/const-eval/ub-enum-ptr.stderr b/src/test/ui/consts/const-eval/ub-enum-ptr.stderr similarity index 100% rename from src/test/ui/const-eval/ub-enum-ptr.stderr rename to src/test/ui/consts/const-eval/ub-enum-ptr.stderr diff --git a/src/test/ui/const-eval/ub-ptr-in-usize.rs b/src/test/ui/consts/const-eval/ub-ptr-in-usize.rs similarity index 100% rename from src/test/ui/const-eval/ub-ptr-in-usize.rs rename to src/test/ui/consts/const-eval/ub-ptr-in-usize.rs diff --git a/src/test/ui/const-eval/ub-uninhabit.rs b/src/test/ui/consts/const-eval/ub-uninhabit.rs similarity index 100% rename from src/test/ui/const-eval/ub-uninhabit.rs rename to src/test/ui/consts/const-eval/ub-uninhabit.rs diff --git a/src/test/ui/const-eval/ub-uninhabit.stderr b/src/test/ui/consts/const-eval/ub-uninhabit.stderr similarity index 100% rename from src/test/ui/const-eval/ub-uninhabit.stderr rename to src/test/ui/consts/const-eval/ub-uninhabit.stderr diff --git a/src/test/ui/const-eval/ub-usize-in-ref.rs b/src/test/ui/consts/const-eval/ub-usize-in-ref.rs similarity index 100% rename from src/test/ui/const-eval/ub-usize-in-ref.rs rename to src/test/ui/consts/const-eval/ub-usize-in-ref.rs diff --git a/src/test/ui/const-eval/union-const-eval-field.rs b/src/test/ui/consts/const-eval/union-const-eval-field.rs similarity index 100% rename from src/test/ui/const-eval/union-const-eval-field.rs rename to src/test/ui/consts/const-eval/union-const-eval-field.rs diff --git a/src/test/ui/const-eval/union-const-eval-field.stderr b/src/test/ui/consts/const-eval/union-const-eval-field.stderr similarity index 100% rename from src/test/ui/const-eval/union-const-eval-field.stderr rename to src/test/ui/consts/const-eval/union-const-eval-field.stderr diff --git a/src/test/ui/const-eval/union-ice.rs b/src/test/ui/consts/const-eval/union-ice.rs similarity index 100% rename from src/test/ui/const-eval/union-ice.rs rename to src/test/ui/consts/const-eval/union-ice.rs diff --git a/src/test/ui/const-eval/union-ice.stderr b/src/test/ui/consts/const-eval/union-ice.stderr similarity index 100% rename from src/test/ui/const-eval/union-ice.stderr rename to src/test/ui/consts/const-eval/union-ice.stderr diff --git a/src/test/ui/const-eval/union-ub.rs b/src/test/ui/consts/const-eval/union-ub.rs similarity index 100% rename from src/test/ui/const-eval/union-ub.rs rename to src/test/ui/consts/const-eval/union-ub.rs diff --git a/src/test/ui/const-eval/union-ub.stderr b/src/test/ui/consts/const-eval/union-ub.stderr similarity index 100% rename from src/test/ui/const-eval/union-ub.stderr rename to src/test/ui/consts/const-eval/union-ub.stderr diff --git a/src/test/ui/const-eval/union_promotion.rs b/src/test/ui/consts/const-eval/union_promotion.rs similarity index 100% rename from src/test/ui/const-eval/union_promotion.rs rename to src/test/ui/consts/const-eval/union_promotion.rs diff --git a/src/test/ui/const-eval/union_promotion.stderr b/src/test/ui/consts/const-eval/union_promotion.stderr similarity index 100% rename from src/test/ui/const-eval/union_promotion.stderr rename to src/test/ui/consts/const-eval/union_promotion.stderr diff --git a/src/test/ui/const-expr-addr-operator.rs b/src/test/ui/consts/const-expr-addr-operator.rs similarity index 100% rename from src/test/ui/const-expr-addr-operator.rs rename to src/test/ui/consts/const-expr-addr-operator.rs diff --git a/src/test/compile-fail/const-fn-destructuring-arg.rs b/src/test/ui/consts/const-fn-destructuring-arg.rs similarity index 100% rename from src/test/compile-fail/const-fn-destructuring-arg.rs rename to src/test/ui/consts/const-fn-destructuring-arg.rs diff --git a/src/test/ui/consts/const-fn-destructuring-arg.stderr b/src/test/ui/consts/const-fn-destructuring-arg.stderr new file mode 100644 index 0000000000000..029d63a7720a8 --- /dev/null +++ b/src/test/ui/consts/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/ui/const-fn-error.rs b/src/test/ui/consts/const-fn-error.rs similarity index 100% rename from src/test/ui/const-fn-error.rs rename to src/test/ui/consts/const-fn-error.rs diff --git a/src/test/ui/const-fn-error.stderr b/src/test/ui/consts/const-fn-error.stderr similarity index 100% rename from src/test/ui/const-fn-error.stderr rename to src/test/ui/consts/const-fn-error.stderr diff --git a/src/test/ui/const-fn-mismatch.rs b/src/test/ui/consts/const-fn-mismatch.rs similarity index 100% rename from src/test/ui/const-fn-mismatch.rs rename to src/test/ui/consts/const-fn-mismatch.rs diff --git a/src/test/ui/const-fn-mismatch.stderr b/src/test/ui/consts/const-fn-mismatch.stderr similarity index 100% rename from src/test/ui/const-fn-mismatch.stderr rename to src/test/ui/consts/const-fn-mismatch.stderr diff --git a/src/test/ui/const-fn-not-in-trait.rs b/src/test/ui/consts/const-fn-not-in-trait.rs similarity index 100% rename from src/test/ui/const-fn-not-in-trait.rs rename to src/test/ui/consts/const-fn-not-in-trait.rs diff --git a/src/test/ui/const-fn-not-in-trait.stderr b/src/test/ui/consts/const-fn-not-in-trait.stderr similarity index 100% rename from src/test/ui/const-fn-not-in-trait.stderr rename to src/test/ui/consts/const-fn-not-in-trait.stderr diff --git a/src/test/compile-fail/const-fn-not-safe-for-const.rs b/src/test/ui/consts/const-fn-not-safe-for-const.rs similarity index 100% rename from src/test/compile-fail/const-fn-not-safe-for-const.rs rename to src/test/ui/consts/const-fn-not-safe-for-const.rs diff --git a/src/test/ui/consts/const-fn-not-safe-for-const.stderr b/src/test/ui/consts/const-fn-not-safe-for-const.stderr new file mode 100644 index 0000000000000..1e99a4378faf3 --- /dev/null +++ b/src/test/ui/consts/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/consts/const-fn-stability-calls-3.rs similarity index 100% rename from src/test/compile-fail/const-fn-stability-calls-3.rs rename to src/test/ui/consts/const-fn-stability-calls-3.rs diff --git a/src/test/ui/consts/const-fn-stability-calls-3.stderr b/src/test/ui/consts/const-fn-stability-calls-3.stderr new file mode 100644 index 0000000000000..50c959d68053c --- /dev/null +++ b/src/test/ui/consts/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/consts/const-integer-bool-ops.rs similarity index 100% rename from src/test/compile-fail/const-integer-bool-ops.rs rename to src/test/ui/consts/const-integer-bool-ops.rs diff --git a/src/test/ui/consts/const-integer-bool-ops.stderr b/src/test/ui/consts/const-integer-bool-ops.stderr new file mode 100644 index 0000000000000..8075a3f0863b6 --- /dev/null +++ b/src/test/ui/consts/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/ui/const-len-underflow-separate-spans.rs b/src/test/ui/consts/const-len-underflow-separate-spans.rs similarity index 100% rename from src/test/ui/const-len-underflow-separate-spans.rs rename to src/test/ui/consts/const-len-underflow-separate-spans.rs diff --git a/src/test/ui/const-len-underflow-separate-spans.stderr b/src/test/ui/consts/const-len-underflow-separate-spans.stderr similarity index 100% rename from src/test/ui/const-len-underflow-separate-spans.stderr rename to src/test/ui/consts/const-len-underflow-separate-spans.stderr diff --git a/src/test/compile-fail/const-len-underflow-subspans.rs b/src/test/ui/consts/const-len-underflow-subspans.rs similarity index 100% rename from src/test/compile-fail/const-len-underflow-subspans.rs rename to src/test/ui/consts/const-len-underflow-subspans.rs diff --git a/src/test/ui/consts/const-len-underflow-subspans.stderr b/src/test/ui/consts/const-len-underflow-subspans.stderr new file mode 100644 index 0000000000000..860716c1f3855 --- /dev/null +++ b/src/test/ui/consts/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/consts/const-match-check.eval1.stderr b/src/test/ui/consts/const-match-check.eval1.stderr new file mode 100644 index 0000000000000..3caf1491aba68 --- /dev/null +++ b/src/test/ui/consts/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/consts/const-match-check.eval2.stderr b/src/test/ui/consts/const-match-check.eval2.stderr new file mode 100644 index 0000000000000..de85d4d73db0c --- /dev/null +++ b/src/test/ui/consts/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/consts/const-match-check.matchck.stderr b/src/test/ui/consts/const-match-check.matchck.stderr new file mode 100644 index 0000000000000..bbf1169c577cf --- /dev/null +++ b/src/test/ui/consts/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/consts/const-match-check.rs similarity index 100% rename from src/test/compile-fail/const-match-check.rs rename to src/test/ui/consts/const-match-check.rs diff --git a/src/test/compile-fail/const-match-pattern-arm.rs b/src/test/ui/consts/const-match-pattern-arm.rs similarity index 100% rename from src/test/compile-fail/const-match-pattern-arm.rs rename to src/test/ui/consts/const-match-pattern-arm.rs diff --git a/src/test/ui/consts/const-match-pattern-arm.stderr b/src/test/ui/consts/const-match-pattern-arm.stderr new file mode 100644 index 0000000000000..201aa7cd5b790 --- /dev/null +++ b/src/test/ui/consts/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/ui/const-pattern-irrefutable.rs b/src/test/ui/consts/const-pattern-irrefutable.rs similarity index 100% rename from src/test/ui/const-pattern-irrefutable.rs rename to src/test/ui/consts/const-pattern-irrefutable.rs diff --git a/src/test/ui/const-pattern-irrefutable.stderr b/src/test/ui/consts/const-pattern-irrefutable.stderr similarity index 100% rename from src/test/ui/const-pattern-irrefutable.stderr rename to src/test/ui/consts/const-pattern-irrefutable.stderr diff --git a/src/test/ui/const-pattern-not-const-evaluable.rs b/src/test/ui/consts/const-pattern-not-const-evaluable.rs similarity index 100% rename from src/test/ui/const-pattern-not-const-evaluable.rs rename to src/test/ui/consts/const-pattern-not-const-evaluable.rs diff --git a/src/test/compile-fail/const-size_of-cycle.rs b/src/test/ui/consts/const-size_of-cycle.rs similarity index 100% rename from src/test/compile-fail/const-size_of-cycle.rs rename to src/test/ui/consts/const-size_of-cycle.rs diff --git a/src/test/ui/consts/const-size_of-cycle.stderr b/src/test/ui/consts/const-size_of-cycle.stderr new file mode 100644 index 0000000000000..b10dd509e0b13 --- /dev/null +++ b/src/test/ui/consts/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::() } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + = 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::() } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/consts/const-slice-oob.rs similarity index 100% rename from src/test/compile-fail/const-slice-oob.rs rename to src/test/ui/consts/const-slice-oob.rs diff --git a/src/test/ui/consts/const-slice-oob.stderr b/src/test/ui/consts/const-slice-oob.stderr new file mode 100644 index 0000000000000..30260c36ffd35 --- /dev/null +++ b/src/test/ui/consts/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/consts/const-tup-index-span.rs similarity index 100% rename from src/test/compile-fail/const-tup-index-span.rs rename to src/test/ui/consts/const-tup-index-span.rs diff --git a/src/test/ui/consts/const-tup-index-span.stderr b/src/test/ui/consts/const-tup-index-span.stderr new file mode 100644 index 0000000000000..e924862965611 --- /dev/null +++ b/src/test/ui/consts/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/ui/const-type-mismatch.rs b/src/test/ui/consts/const-type-mismatch.rs similarity index 100% rename from src/test/ui/const-type-mismatch.rs rename to src/test/ui/consts/const-type-mismatch.rs diff --git a/src/test/ui/const-type-mismatch.stderr b/src/test/ui/consts/const-type-mismatch.stderr similarity index 100% rename from src/test/ui/const-type-mismatch.stderr rename to src/test/ui/consts/const-type-mismatch.stderr diff --git a/src/test/compile-fail/const-typeid-of.rs b/src/test/ui/consts/const-typeid-of.rs similarity index 100% rename from src/test/compile-fail/const-typeid-of.rs rename to src/test/ui/consts/const-typeid-of.rs diff --git a/src/test/ui/consts/const-typeid-of.stderr b/src/test/ui/consts/const-typeid-of.stderr new file mode 100644 index 0000000000000..d13ced9a10a0a --- /dev/null +++ b/src/test/ui/consts/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::(); + | ^^^^^^^^^^^^^^^^^ + | + = 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/ui/const-unsized.rs b/src/test/ui/consts/const-unsized.rs similarity index 100% rename from src/test/ui/const-unsized.rs rename to src/test/ui/consts/const-unsized.rs diff --git a/src/test/ui/const-unsized.stderr b/src/test/ui/consts/const-unsized.stderr similarity index 100% rename from src/test/ui/const-unsized.stderr rename to src/test/ui/consts/const-unsized.stderr diff --git a/src/test/compile-fail/copy-a-resource.rs b/src/test/ui/copy-a-resource.rs similarity index 100% rename from src/test/compile-fail/copy-a-resource.rs rename to src/test/ui/copy-a-resource.rs diff --git a/src/test/ui/copy-a-resource.stderr b/src/test/ui/copy-a-resource.stderr new file mode 100644 index 0000000000000..6d8d4884d73fa --- /dev/null +++ b/src/test/ui/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/crate-name-mismatch.rs similarity index 100% rename from src/test/compile-fail/crate-name-mismatch.rs rename to src/test/ui/crate-name-mismatch.rs diff --git a/src/test/ui/crate-name-mismatch.stderr b/src/test/ui/crate-name-mismatch.stderr new file mode 100644 index 0000000000000..26ef91ba8e7cf --- /dev/null +++ b/src/test/ui/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/compile-fail/cross-borrow-trait.rs b/src/test/ui/cross/cross-borrow-trait.rs similarity index 100% rename from src/test/compile-fail/cross-borrow-trait.rs rename to src/test/ui/cross/cross-borrow-trait.rs diff --git a/src/test/ui/cross/cross-borrow-trait.stderr b/src/test/ui/cross/cross-borrow-trait.stderr new file mode 100644 index 0000000000000..d25316d542aea --- /dev/null +++ b/src/test/ui/cross/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` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs b/src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs similarity index 100% rename from src/test/ui/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs rename to src/test/ui/cross/cross-crate-macro-backtrace/auxiliary/extern_macro_crate.rs diff --git a/src/test/ui/cross-crate-macro-backtrace/main.rs b/src/test/ui/cross/cross-crate-macro-backtrace/main.rs similarity index 100% rename from src/test/ui/cross-crate-macro-backtrace/main.rs rename to src/test/ui/cross/cross-crate-macro-backtrace/main.rs diff --git a/src/test/ui/cross-crate-macro-backtrace/main.stderr b/src/test/ui/cross/cross-crate-macro-backtrace/main.stderr similarity index 100% rename from src/test/ui/cross-crate-macro-backtrace/main.stderr rename to src/test/ui/cross/cross-crate-macro-backtrace/main.stderr diff --git a/src/test/ui/cross-file-errors/main.rs b/src/test/ui/cross/cross-file-errors/main.rs similarity index 100% rename from src/test/ui/cross-file-errors/main.rs rename to src/test/ui/cross/cross-file-errors/main.rs diff --git a/src/test/ui/cross-file-errors/main.stderr b/src/test/ui/cross/cross-file-errors/main.stderr similarity index 100% rename from src/test/ui/cross-file-errors/main.stderr rename to src/test/ui/cross/cross-file-errors/main.stderr diff --git a/src/test/ui/cross-file-errors/underscore.rs b/src/test/ui/cross/cross-file-errors/underscore.rs similarity index 100% rename from src/test/ui/cross-file-errors/underscore.rs rename to src/test/ui/cross/cross-file-errors/underscore.rs diff --git a/src/test/compile-fail/cross-fn-cache-hole.rs b/src/test/ui/cross/cross-fn-cache-hole.rs similarity index 100% rename from src/test/compile-fail/cross-fn-cache-hole.rs rename to src/test/ui/cross/cross-fn-cache-hole.rs diff --git a/src/test/ui/cross/cross-fn-cache-hole.stderr b/src/test/ui/cross/cross-fn-cache-hole.stderr new file mode 100644 index 0000000000000..bfcb83204bba1 --- /dev/null +++ b/src/test/ui/cross/cross-fn-cache-hole.stderr @@ -0,0 +1,18 @@ +error[E0277]: the trait bound `i32: Bar` is not satisfied + --> $DIR/cross-fn-cache-hole.rs:25:1 + | +LL | / fn vacuous() //~ ERROR the trait bound `i32: Bar` is not satisfied +LL | | where i32: Foo +LL | | { +LL | | // ... the original intention was to check that we don't use that +... | +LL | | require::(); +LL | | } + | |_^ the trait `Bar` 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/custom_attribute.rs similarity index 100% rename from src/test/compile-fail/custom_attribute.rs rename to src/test/ui/custom_attribute.rs diff --git a/src/test/ui/custom_attribute.stderr b/src/test/ui/custom_attribute.stderr new file mode 100644 index 0000000000000..4adfe1e450ee5 --- /dev/null +++ b/src/test/ui/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:13:1 + | +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: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: 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/cycle-projection-based-on-where-clause.rs similarity index 100% rename from src/test/compile-fail/cycle-projection-based-on-where-clause.rs rename to src/test/ui/cycle-projection-based-on-where-clause.rs diff --git a/src/test/ui/cycle-projection-based-on-where-clause.stderr b/src/test/ui/cycle-projection-based-on-where-clause.stderr new file mode 100644 index 0000000000000..c7147bcddc46d --- /dev/null +++ b/src/test/ui/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 + | ^^^^^^^ + | + = 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 + | ^^^^^^^ + +error[E0220]: associated type `Item` not found for `T` + --> $DIR/cycle-projection-based-on-where-clause.rs:27:19 + | +LL | T : Add + | ^^^^^^^ 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/cycle-trait/cycle-trait-default-type-trait.rs similarity index 100% rename from src/test/compile-fail/cycle-trait-default-type-trait.rs rename to src/test/ui/cycle-trait/cycle-trait-default-type-trait.rs diff --git a/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr b/src/test/ui/cycle-trait/cycle-trait-default-type-trait.stderr new file mode 100644 index 0000000000000..767a99a326517 --- /dev/null +++ b/src/test/ui/cycle-trait/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> { + | ^^^ + | + = 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/cycle-trait/cycle-trait-supertrait-direct.rs similarity index 100% rename from src/test/compile-fail/cycle-trait-supertrait-direct.rs rename to src/test/ui/cycle-trait/cycle-trait-supertrait-direct.rs diff --git a/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr b/src/test/ui/cycle-trait/cycle-trait-supertrait-direct.stderr new file mode 100644 index 0000000000000..724d4b1ec67a8 --- /dev/null +++ b/src/test/ui/cycle-trait/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/ui/cycle-trait-supertrait-indirect.rs b/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.rs similarity index 100% rename from src/test/ui/cycle-trait-supertrait-indirect.rs rename to src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.rs diff --git a/src/test/ui/cycle-trait-supertrait-indirect.stderr b/src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr similarity index 100% rename from src/test/ui/cycle-trait-supertrait-indirect.stderr rename to src/test/ui/cycle-trait/cycle-trait-supertrait-indirect.stderr diff --git a/src/test/compile-fail/dead-code-closure-bang.rs b/src/test/ui/dead-code-closure-bang.rs similarity index 100% rename from src/test/compile-fail/dead-code-closure-bang.rs rename to src/test/ui/dead-code-closure-bang.rs diff --git a/src/test/compile-fail/dead-code-ret.rs b/src/test/ui/dead-code-ret.rs similarity index 100% rename from src/test/compile-fail/dead-code-ret.rs rename to src/test/ui/dead-code-ret.rs diff --git a/src/test/ui/dead-code-ret.stderr b/src/test/ui/dead-code-ret.stderr new file mode 100644 index 0000000000000..9f94016696627 --- /dev/null +++ b/src/test/ui/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/defaulted-never-note.rs similarity index 100% rename from src/test/compile-fail/defaulted-never-note.rs rename to src/test/ui/defaulted-never-note.rs diff --git a/src/test/ui/defaulted-never-note.stderr b/src/test/ui/defaulted-never-note.stderr new file mode 100644 index 0000000000000..32922354fe67b --- /dev/null +++ b/src/test/ui/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: 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/dep-graph/dep-graph-assoc-type-codegen.rs similarity index 100% rename from src/test/compile-fail/dep-graph-assoc-type-codegen.rs rename to src/test/ui/dep-graph/dep-graph-assoc-type-codegen.rs diff --git a/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr b/src/test/ui/dep-graph/dep-graph-assoc-type-codegen.stderr new file mode 100644 index 0000000000000..e00b3ccf2818c --- /dev/null +++ b/src/test/ui/dep-graph/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/dep-graph/dep-graph-caller-callee.rs similarity index 100% rename from src/test/compile-fail/dep-graph-caller-callee.rs rename to src/test/ui/dep-graph/dep-graph-caller-callee.rs diff --git a/src/test/ui/dep-graph/dep-graph-caller-callee.stderr b/src/test/ui/dep-graph/dep-graph-caller-callee.stderr new file mode 100644 index 0000000000000..8943b051c1277 --- /dev/null +++ b/src/test/ui/dep-graph/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/dep-graph/dep-graph-struct-signature.rs similarity index 100% rename from src/test/compile-fail/dep-graph-struct-signature.rs rename to src/test/ui/dep-graph/dep-graph-struct-signature.rs diff --git a/src/test/ui/dep-graph/dep-graph-struct-signature.stderr b/src/test/ui/dep-graph/dep-graph-struct-signature.stderr new file mode 100644 index 0000000000000..cbb695d0cf2b9 --- /dev/null +++ b/src/test/ui/dep-graph/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/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs similarity index 100% rename from src/test/compile-fail/dep-graph-trait-impl-two-traits-same-method.rs rename to src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.rs diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits-same-method.stderr new file mode 100644 index 0000000000000..877a056019f67 --- /dev/null +++ b/src/test/ui/dep-graph/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::` 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/dep-graph/dep-graph-trait-impl-two-traits.rs similarity index 100% rename from src/test/compile-fail/dep-graph-trait-impl-two-traits.rs rename to src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.rs diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr new file mode 100644 index 0000000000000..f939fac3146d0 --- /dev/null +++ b/src/test/ui/dep-graph/dep-graph-trait-impl-two-traits.stderr @@ -0,0 +1,14 @@ +error: no path from `x::` 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::` 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/dep-graph/dep-graph-trait-impl.rs similarity index 100% rename from src/test/compile-fail/dep-graph-trait-impl.rs rename to src/test/ui/dep-graph/dep-graph-trait-impl.rs diff --git a/src/test/ui/dep-graph/dep-graph-trait-impl.stderr b/src/test/ui/dep-graph/dep-graph-trait-impl.stderr new file mode 100644 index 0000000000000..c569e8584e71e --- /dev/null +++ b/src/test/ui/dep-graph/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::` 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/dep-graph/dep-graph-type-alias.rs similarity index 100% rename from src/test/compile-fail/dep-graph-type-alias.rs rename to src/test/ui/dep-graph/dep-graph-type-alias.rs diff --git a/src/test/ui/dep-graph/dep-graph-type-alias.stderr b/src/test/ui/dep-graph/dep-graph-type-alias.stderr new file mode 100644 index 0000000000000..b018c250667f5 --- /dev/null +++ b/src/test/ui/dep-graph/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/dep-graph/dep-graph-variance-alias.rs similarity index 100% rename from src/test/compile-fail/dep-graph-variance-alias.rs rename to src/test/ui/dep-graph/dep-graph-variance-alias.rs diff --git a/src/test/ui/dep-graph/dep-graph-variance-alias.stderr b/src/test/ui/dep-graph/dep-graph-variance-alias.stderr new file mode 100644 index 0000000000000..a3b1201390631 --- /dev/null +++ b/src/test/ui/dep-graph/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/auxiliary/deprecation-lint.rs b/src/test/ui/deprecation/auxiliary/deprecation-lint.rs similarity index 100% rename from src/test/compile-fail/auxiliary/deprecation-lint.rs rename to src/test/ui/deprecation/auxiliary/deprecation-lint.rs diff --git a/src/test/ui/deprecated-macro_escape-inner.rs b/src/test/ui/deprecation/deprecated-macro_escape-inner.rs similarity index 100% rename from src/test/ui/deprecated-macro_escape-inner.rs rename to src/test/ui/deprecation/deprecated-macro_escape-inner.rs diff --git a/src/test/ui/deprecated-macro_escape-inner.stderr b/src/test/ui/deprecation/deprecated-macro_escape-inner.stderr similarity index 100% rename from src/test/ui/deprecated-macro_escape-inner.stderr rename to src/test/ui/deprecation/deprecated-macro_escape-inner.stderr diff --git a/src/test/ui/deprecated-macro_escape.rs b/src/test/ui/deprecation/deprecated-macro_escape.rs similarity index 100% rename from src/test/ui/deprecated-macro_escape.rs rename to src/test/ui/deprecation/deprecated-macro_escape.rs diff --git a/src/test/ui/deprecated-macro_escape.stderr b/src/test/ui/deprecation/deprecated-macro_escape.stderr similarity index 100% rename from src/test/ui/deprecated-macro_escape.stderr rename to src/test/ui/deprecation/deprecated-macro_escape.stderr diff --git a/src/test/compile-fail/deprecated_no_stack_check.rs b/src/test/ui/deprecation/deprecated_no_stack_check.rs similarity index 100% rename from src/test/compile-fail/deprecated_no_stack_check.rs rename to src/test/ui/deprecation/deprecated_no_stack_check.rs diff --git a/src/test/ui/deprecation/deprecated_no_stack_check.stderr b/src/test/ui/deprecation/deprecated_no_stack_check.stderr new file mode 100644 index 0000000000000..2f847a253e429 --- /dev/null +++ b/src/test/ui/deprecation/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/deprecation/deprecation-in-staged-api.rs similarity index 100% rename from src/test/compile-fail/deprecation-in-staged-api.rs rename to src/test/ui/deprecation/deprecation-in-staged-api.rs diff --git a/src/test/ui/deprecation/deprecation-in-staged-api.stderr b/src/test/ui/deprecation/deprecation-in-staged-api.stderr new file mode 100644 index 0000000000000..9ad5658501575 --- /dev/null +++ b/src/test/ui/deprecation/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/deprecation/deprecation-lint-2.rs similarity index 100% rename from src/test/compile-fail/deprecation-lint-2.rs rename to src/test/ui/deprecation/deprecation-lint-2.rs diff --git a/src/test/ui/deprecation/deprecation-lint-2.stderr b/src/test/ui/deprecation/deprecation-lint-2.stderr new file mode 100644 index 0000000000000..fedc6b22f32f0 --- /dev/null +++ b/src/test/ui/deprecation/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/deprecation/deprecation-lint-3.rs similarity index 100% rename from src/test/compile-fail/deprecation-lint-3.rs rename to src/test/ui/deprecation/deprecation-lint-3.rs diff --git a/src/test/ui/deprecation/deprecation-lint-3.stderr b/src/test/ui/deprecation/deprecation-lint-3.stderr new file mode 100644 index 0000000000000..9dfc44ebc61e0 --- /dev/null +++ b/src/test/ui/deprecation/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/deprecation/deprecation-lint-nested.rs similarity index 100% rename from src/test/compile-fail/deprecation-lint-nested.rs rename to src/test/ui/deprecation/deprecation-lint-nested.rs diff --git a/src/test/ui/deprecation/deprecation-lint-nested.stderr b/src/test/ui/deprecation/deprecation-lint-nested.stderr new file mode 100644 index 0000000000000..4e2b462fd1b57 --- /dev/null +++ b/src/test/ui/deprecation/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() { //~ 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/deprecation/deprecation-lint.rs similarity index 100% rename from src/test/compile-fail/deprecation-lint.rs rename to src/test/ui/deprecation/deprecation-lint.rs diff --git a/src/test/ui/deprecation/deprecation-lint.stderr b/src/test/ui/deprecation/deprecation-lint.stderr new file mode 100644 index 0000000000000..addca6699177f --- /dev/null +++ b/src/test/ui/deprecation/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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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/ui/deprecation-sanity.rs b/src/test/ui/deprecation/deprecation-sanity.rs similarity index 100% rename from src/test/ui/deprecation-sanity.rs rename to src/test/ui/deprecation/deprecation-sanity.rs diff --git a/src/test/ui/deprecation-sanity.stderr b/src/test/ui/deprecation/deprecation-sanity.stderr similarity index 100% rename from src/test/ui/deprecation-sanity.stderr rename to src/test/ui/deprecation/deprecation-sanity.stderr diff --git a/src/test/compile-fail/deref-non-pointer.rs b/src/test/ui/deref-non-pointer.rs similarity index 100% rename from src/test/compile-fail/deref-non-pointer.rs rename to src/test/ui/deref-non-pointer.rs diff --git a/src/test/ui/deref-non-pointer.stderr b/src/test/ui/deref-non-pointer.stderr new file mode 100644 index 0000000000000..3e0ea06123df9 --- /dev/null +++ b/src/test/ui/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/derived-errors/issue-30580.rs b/src/test/ui/derived-errors/issue-30580.rs similarity index 100% rename from src/test/compile-fail/derived-errors/issue-30580.rs rename to src/test/ui/derived-errors/issue-30580.rs diff --git a/src/test/ui/derived-errors/issue-30580.stderr b/src/test/ui/derived-errors/issue-30580.stderr new file mode 100644 index 0000000000000..bf9a5a299e307 --- /dev/null +++ b/src/test/ui/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/derived-errors/issue-31997.rs similarity index 100% rename from src/test/compile-fail/derived-errors/issue-31997.rs rename to src/test/ui/derived-errors/issue-31997.rs diff --git a/src/test/ui/derived-errors/issue-31997.stderr b/src/test/ui/derived-errors/issue-31997.stderr new file mode 100644 index 0000000000000..25088e8654bca --- /dev/null +++ b/src/test/ui/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/derive-assoc-type-not-impl.rs b/src/test/ui/derives/derive-assoc-type-not-impl.rs similarity index 100% rename from src/test/compile-fail/derive-assoc-type-not-impl.rs rename to src/test/ui/derives/derive-assoc-type-not-impl.rs diff --git a/src/test/ui/derives/derive-assoc-type-not-impl.stderr b/src/test/ui/derives/derive-assoc-type-not-impl.stderr new file mode 100644 index 0000000000000..c49e338766161 --- /dev/null +++ b/src/test/ui/derives/derive-assoc-type-not-impl.stderr @@ -0,0 +1,18 @@ +error[E0599]: no method named `clone` found for type `Bar` in the current scope + --> $DIR/derive-assoc-type-not-impl.rs:28:30 + | +LL | struct Bar { + | ------------------ method `clone` not found for this +... +LL | Bar:: { x: 1 }.clone(); //~ ERROR + | ^^^^^ + | + = note: the method `clone` exists but the following trait bounds were not satisfied: + `Bar : 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/derives/derive-on-trait-item-or-impl-item.rs similarity index 100% rename from src/test/compile-fail/derive-on-trait-item-or-impl-item.rs rename to src/test/ui/derives/derive-on-trait-item-or-impl-item.rs diff --git a/src/test/ui/derives/derive-on-trait-item-or-impl-item.stderr b/src/test/ui/derives/derive-on-trait-item-or-impl-item.stderr new file mode 100644 index 0000000000000..8246889b620be --- /dev/null +++ b/src/test/ui/derives/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/derives-span-Clone-enum-struct-variant.rs b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.rs similarity index 100% rename from src/test/compile-fail/derives-span-Clone-enum-struct-variant.rs rename to src/test/ui/derives/derives-span-Clone-enum-struct-variant.rs diff --git a/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Clone-enum-struct-variant.stderr new file mode 100644 index 0000000000000..fbe9d3f7d690b --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Clone-enum.rs similarity index 100% rename from src/test/compile-fail/derives-span-Clone-enum.rs rename to src/test/ui/derives/derives-span-Clone-enum.rs diff --git a/src/test/ui/derives/derives-span-Clone-enum.stderr b/src/test/ui/derives/derives-span-Clone-enum.stderr new file mode 100644 index 0000000000000..b5b3c8bfc8562 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Clone-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Clone-struct.rs rename to src/test/ui/derives/derives-span-Clone-struct.rs diff --git a/src/test/ui/derives/derives-span-Clone-struct.stderr b/src/test/ui/derives/derives-span-Clone-struct.stderr new file mode 100644 index 0000000000000..ebd1e666b38f9 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Clone-tuple-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Clone-tuple-struct.rs rename to src/test/ui/derives/derives-span-Clone-tuple-struct.rs diff --git a/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr b/src/test/ui/derives/derives-span-Clone-tuple-struct.stderr new file mode 100644 index 0000000000000..6867baad2c1da --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Debug-enum-struct-variant.rs similarity index 100% rename from src/test/compile-fail/derives-span-Debug-enum-struct-variant.rs rename to src/test/ui/derives/derives-span-Debug-enum-struct-variant.rs diff --git a/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Debug-enum-struct-variant.stderr new file mode 100644 index 0000000000000..f5939a2e937d9 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Debug-enum.rs similarity index 100% rename from src/test/compile-fail/derives-span-Debug-enum.rs rename to src/test/ui/derives/derives-span-Debug-enum.rs diff --git a/src/test/ui/derives/derives-span-Debug-enum.stderr b/src/test/ui/derives/derives-span-Debug-enum.stderr new file mode 100644 index 0000000000000..566a5786de7a5 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Debug-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Debug-struct.rs rename to src/test/ui/derives/derives-span-Debug-struct.rs diff --git a/src/test/ui/derives/derives-span-Debug-struct.stderr b/src/test/ui/derives/derives-span-Debug-struct.stderr new file mode 100644 index 0000000000000..30145a78a26a4 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Debug-tuple-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Debug-tuple-struct.rs rename to src/test/ui/derives/derives-span-Debug-tuple-struct.rs diff --git a/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr b/src/test/ui/derives/derives-span-Debug-tuple-struct.stderr new file mode 100644 index 0000000000000..963fc8a38f072 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Default-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Default-struct.rs rename to src/test/ui/derives/derives-span-Default-struct.rs diff --git a/src/test/ui/derives/derives-span-Default-struct.stderr b/src/test/ui/derives/derives-span-Default-struct.stderr new file mode 100644 index 0000000000000..a9634e64fa991 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Default-tuple-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Default-tuple-struct.rs rename to src/test/ui/derives/derives-span-Default-tuple-struct.rs diff --git a/src/test/ui/derives/derives-span-Default-tuple-struct.stderr b/src/test/ui/derives/derives-span-Default-tuple-struct.stderr new file mode 100644 index 0000000000000..eb0ef61a57d33 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Eq-enum-struct-variant.rs similarity index 100% rename from src/test/compile-fail/derives-span-Eq-enum-struct-variant.rs rename to src/test/ui/derives/derives-span-Eq-enum-struct-variant.rs diff --git a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr new file mode 100644 index 0000000000000..b230c0140929f --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Eq-enum.rs similarity index 100% rename from src/test/compile-fail/derives-span-Eq-enum.rs rename to src/test/ui/derives/derives-span-Eq-enum.rs diff --git a/src/test/ui/derives/derives-span-Eq-enum.stderr b/src/test/ui/derives/derives-span-Eq-enum.stderr new file mode 100644 index 0000000000000..7f6d27a311d16 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Eq-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Eq-struct.rs rename to src/test/ui/derives/derives-span-Eq-struct.rs diff --git a/src/test/ui/derives/derives-span-Eq-struct.stderr b/src/test/ui/derives/derives-span-Eq-struct.stderr new file mode 100644 index 0000000000000..a9db04019592f --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Eq-tuple-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Eq-tuple-struct.rs rename to src/test/ui/derives/derives-span-Eq-tuple-struct.rs diff --git a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr new file mode 100644 index 0000000000000..70f39f30eedad --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Hash-enum-struct-variant.rs similarity index 100% rename from src/test/compile-fail/derives-span-Hash-enum-struct-variant.rs rename to src/test/ui/derives/derives-span-Hash-enum-struct-variant.rs diff --git a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr new file mode 100644 index 0000000000000..bde7556f7ce25 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Hash-enum.rs similarity index 100% rename from src/test/compile-fail/derives-span-Hash-enum.rs rename to src/test/ui/derives/derives-span-Hash-enum.rs diff --git a/src/test/ui/derives/derives-span-Hash-enum.stderr b/src/test/ui/derives/derives-span-Hash-enum.stderr new file mode 100644 index 0000000000000..72b8f3ada0228 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Hash-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Hash-struct.rs rename to src/test/ui/derives/derives-span-Hash-struct.rs diff --git a/src/test/ui/derives/derives-span-Hash-struct.stderr b/src/test/ui/derives/derives-span-Hash-struct.stderr new file mode 100644 index 0000000000000..3068bcfe0a0bf --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Hash-tuple-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Hash-tuple-struct.rs rename to src/test/ui/derives/derives-span-Hash-tuple-struct.rs diff --git a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr new file mode 100644 index 0000000000000..a65fbd8b6e6d9 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Ord-enum-struct-variant.rs similarity index 100% rename from src/test/compile-fail/derives-span-Ord-enum-struct-variant.rs rename to src/test/ui/derives/derives-span-Ord-enum-struct-variant.rs diff --git a/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Ord-enum-struct-variant.stderr new file mode 100644 index 0000000000000..5968efd5ca1ea --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Ord-enum.rs similarity index 100% rename from src/test/compile-fail/derives-span-Ord-enum.rs rename to src/test/ui/derives/derives-span-Ord-enum.rs diff --git a/src/test/ui/derives/derives-span-Ord-enum.stderr b/src/test/ui/derives/derives-span-Ord-enum.stderr new file mode 100644 index 0000000000000..074a8f84cec24 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Ord-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Ord-struct.rs rename to src/test/ui/derives/derives-span-Ord-struct.rs diff --git a/src/test/ui/derives/derives-span-Ord-struct.stderr b/src/test/ui/derives/derives-span-Ord-struct.stderr new file mode 100644 index 0000000000000..2e584e6ca8752 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-Ord-tuple-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-Ord-tuple-struct.rs rename to src/test/ui/derives/derives-span-Ord-tuple-struct.rs diff --git a/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr b/src/test/ui/derives/derives-span-Ord-tuple-struct.stderr new file mode 100644 index 0000000000000..0da452f0a6a57 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-PartialEq-enum-struct-variant.rs similarity index 100% rename from src/test/compile-fail/derives-span-PartialEq-enum-struct-variant.rs rename to src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.rs diff --git a/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-PartialEq-enum-struct-variant.stderr new file mode 100644 index 0000000000000..cad446f832614 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-PartialEq-enum.rs similarity index 100% rename from src/test/compile-fail/derives-span-PartialEq-enum.rs rename to src/test/ui/derives/derives-span-PartialEq-enum.rs diff --git a/src/test/ui/derives/derives-span-PartialEq-enum.stderr b/src/test/ui/derives/derives-span-PartialEq-enum.stderr new file mode 100644 index 0000000000000..e75d0693db526 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-PartialEq-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-PartialEq-struct.rs rename to src/test/ui/derives/derives-span-PartialEq-struct.rs diff --git a/src/test/ui/derives/derives-span-PartialEq-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-struct.stderr new file mode 100644 index 0000000000000..c8cd509a824e1 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-PartialEq-tuple-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-PartialEq-tuple-struct.rs rename to src/test/ui/derives/derives-span-PartialEq-tuple-struct.rs diff --git a/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr b/src/test/ui/derives/derives-span-PartialEq-tuple-struct.stderr new file mode 100644 index 0000000000000..b66189fb567e6 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-PartialOrd-enum-struct-variant.rs similarity index 100% rename from src/test/compile-fail/derives-span-PartialOrd-enum-struct-variant.rs rename to src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.rs diff --git a/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-PartialOrd-enum-struct-variant.stderr new file mode 100644 index 0000000000000..7e55ba70c13ad --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-PartialOrd-enum.rs similarity index 100% rename from src/test/compile-fail/derives-span-PartialOrd-enum.rs rename to src/test/ui/derives/derives-span-PartialOrd-enum.rs diff --git a/src/test/ui/derives/derives-span-PartialOrd-enum.stderr b/src/test/ui/derives/derives-span-PartialOrd-enum.stderr new file mode 100644 index 0000000000000..d8b3bd9f1bc3d --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-PartialOrd-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-PartialOrd-struct.rs rename to src/test/ui/derives/derives-span-PartialOrd-struct.rs diff --git a/src/test/ui/derives/derives-span-PartialOrd-struct.stderr b/src/test/ui/derives/derives-span-PartialOrd-struct.stderr new file mode 100644 index 0000000000000..afd93dce62537 --- /dev/null +++ b/src/test/ui/derives/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/derives/derives-span-PartialOrd-tuple-struct.rs similarity index 100% rename from src/test/compile-fail/derives-span-PartialOrd-tuple-struct.rs rename to src/test/ui/derives/derives-span-PartialOrd-tuple-struct.rs diff --git a/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr b/src/test/ui/derives/derives-span-PartialOrd-tuple-struct.stderr new file mode 100644 index 0000000000000..a65ee40f2201b --- /dev/null +++ b/src/test/ui/derives/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/derives/deriving-bounds.rs similarity index 100% rename from src/test/compile-fail/deriving-bounds.rs rename to src/test/ui/derives/deriving-bounds.rs diff --git a/src/test/ui/derives/deriving-bounds.stderr b/src/test/ui/derives/deriving-bounds.stderr new file mode 100644 index 0000000000000..2c42fd1b672c9 --- /dev/null +++ b/src/test/ui/derives/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/derives/deriving-copyclone.rs similarity index 100% rename from src/test/compile-fail/deriving-copyclone.rs rename to src/test/ui/derives/deriving-copyclone.rs diff --git a/src/test/ui/derives/deriving-copyclone.stderr b/src/test/ui/derives/deriving-copyclone.stderr new file mode 100644 index 0000000000000..2d0dc6649e733 --- /dev/null +++ b/src/test/ui/derives/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` +note: required by `is_copy` + --> $DIR/deriving-copyclone.rs:28:1 + | +LL | fn is_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` +note: required by `is_clone` + --> $DIR/deriving-copyclone.rs:29:1 + | +LL | fn is_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` +note: required by `is_copy` + --> $DIR/deriving-copyclone.rs:28:1 + | +LL | fn is_copy(_: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/deriving-meta-empty-trait-list.rs b/src/test/ui/derives/deriving-meta-empty-trait-list.rs similarity index 100% rename from src/test/ui/deriving-meta-empty-trait-list.rs rename to src/test/ui/derives/deriving-meta-empty-trait-list.rs diff --git a/src/test/ui/deriving-meta-empty-trait-list.stderr b/src/test/ui/derives/deriving-meta-empty-trait-list.stderr similarity index 100% rename from src/test/ui/deriving-meta-empty-trait-list.stderr rename to src/test/ui/derives/deriving-meta-empty-trait-list.stderr diff --git a/src/test/compile-fail/deriving-meta-unknown-trait.rs b/src/test/ui/derives/deriving-meta-unknown-trait.rs similarity index 100% rename from src/test/compile-fail/deriving-meta-unknown-trait.rs rename to src/test/ui/derives/deriving-meta-unknown-trait.rs diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.stderr b/src/test/ui/derives/deriving-meta-unknown-trait.stderr new file mode 100644 index 0000000000000..aa0f1e21213c6 --- /dev/null +++ b/src/test/ui/derives/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/derives/deriving-no-inner-impl-error-message.rs similarity index 100% rename from src/test/compile-fail/deriving-no-inner-impl-error-message.rs rename to src/test/ui/derives/deriving-no-inner-impl-error-message.rs diff --git a/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr b/src/test/ui/derives/deriving-no-inner-impl-error-message.stderr new file mode 100644 index 0000000000000..48d27ae147464 --- /dev/null +++ b/src/test/ui/derives/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/derives/deriving-non-type.rs similarity index 100% rename from src/test/compile-fail/deriving-non-type.rs rename to src/test/ui/derives/deriving-non-type.rs diff --git a/src/test/ui/derives/deriving-non-type.stderr b/src/test/ui/derives/deriving-non-type.stderr new file mode 100644 index 0000000000000..d9da03afb0353 --- /dev/null +++ b/src/test/ui/derives/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/derives/deriving-primitive.rs similarity index 100% rename from src/test/compile-fail/deriving-primitive.rs rename to src/test/ui/derives/deriving-primitive.rs diff --git a/src/test/ui/derives/deriving-primitive.stderr b/src/test/ui/derives/deriving-primitive.stderr new file mode 100644 index 0000000000000..bc2d339329086 --- /dev/null +++ b/src/test/ui/derives/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/ui/deriving-with-repr-packed.rs b/src/test/ui/derives/deriving-with-repr-packed.rs similarity index 100% rename from src/test/ui/deriving-with-repr-packed.rs rename to src/test/ui/derives/deriving-with-repr-packed.rs diff --git a/src/test/ui/deriving-with-repr-packed.stderr b/src/test/ui/derives/deriving-with-repr-packed.stderr similarity index 100% rename from src/test/ui/deriving-with-repr-packed.stderr rename to src/test/ui/derives/deriving-with-repr-packed.stderr diff --git a/src/test/compile-fail/destructure-trait-ref.rs b/src/test/ui/destructure-trait-ref.rs similarity index 100% rename from src/test/compile-fail/destructure-trait-ref.rs rename to src/test/ui/destructure-trait-ref.rs diff --git a/src/test/ui/destructure-trait-ref.stderr b/src/test/ui/destructure-trait-ref.stderr new file mode 100644 index 0000000000000..0335fff7bce85 --- /dev/null +++ b/src/test/ui/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` cannot be dereferenced + --> $DIR/destructure-trait-ref.rs:38:9 + | +LL | let box x = box 1isize as Box; //~ ERROR type `std::boxed::Box` cannot be dereferenced + | ^^^^^ type `std::boxed::Box` 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; + | ^^^^^ 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/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr index eee7f32032b6d..33804553a2981 100644 --- a/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr +++ b/src/test/ui/did_you_mean/issue-21659-show-relevant-trait-impls-2.stderr @@ -5,9 +5,9 @@ LL | f1.foo(1usize); | ^^^ the trait `Foo` is not implemented for `Bar` | = help: the following implementations were found: - > > > + > > and 2 others diff --git a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr index 3f955da86ba00..3b08fcf0df106 100644 --- a/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr +++ b/src/test/ui/did_you_mean/issue-39802-show-5-trait-impls.stderr @@ -5,11 +5,11 @@ LL | Foo::::bar(&1i8); //~ ERROR is not satisfied | ^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `i8` | = help: the following implementations were found: - > + > > > > - > + > note: required by `Foo::bar` --> $DIR/issue-39802-show-5-trait-impls.rs:12:5 | @@ -23,10 +23,10 @@ LL | Foo::::bar(&1u8); //~ ERROR is not satisfied | ^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u8` | = help: the following implementations were found: + > > > > - > note: required by `Foo::bar` --> $DIR/issue-39802-show-5-trait-impls.rs:12:5 | @@ -40,10 +40,10 @@ LL | Foo::::bar(&true); //~ ERROR is not satisfied | ^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `bool` | = help: the following implementations were found: - > > > > + > and 2 others note: required by `Foo::bar` --> $DIR/issue-39802-show-5-trait-impls.rs:12:5 diff --git a/src/test/compile-fail/directory_ownership/foo/compiletest-ignore-dir b/src/test/ui/directory_ownership/foo/compiletest-ignore-dir similarity index 100% rename from src/test/compile-fail/directory_ownership/foo/compiletest-ignore-dir rename to src/test/ui/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/directory_ownership/foo/mod_file_not_owning/aux2.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/foo/mod_file_not_owning/aux2.rs rename to src/test/ui/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/directory_ownership/foo/mod_file_not_owning_aux2.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/foo/mod_file_not_owning_aux2.rs rename to src/test/ui/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/directory_ownership/macro-expanded-mod.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/macro-expanded-mod.rs rename to src/test/ui/directory_ownership/macro-expanded-mod.rs diff --git a/src/test/ui/directory_ownership/macro-expanded-mod.stderr b/src/test/ui/directory_ownership/macro-expanded-mod.stderr new file mode 100644 index 0000000000000..a9efcd883c15b --- /dev/null +++ b/src/test/ui/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/directory_ownership/macro_expanded_mod_helper/foo/bar.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/bar.rs rename to src/test/ui/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/directory_ownership/macro_expanded_mod_helper/foo/mod.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/macro_expanded_mod_helper/foo/mod.rs rename to src/test/ui/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/directory_ownership/mod_file_not_owning.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/mod_file_not_owning.rs rename to src/test/ui/directory_ownership/mod_file_not_owning.rs diff --git a/src/test/ui/directory_ownership/mod_file_not_owning.stderr b/src/test/ui/directory_ownership/mod_file_not_owning.stderr new file mode 100644 index 0000000000000..e2937573997fc --- /dev/null +++ b/src/test/ui/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/directory_ownership/mod_file_not_owning_aux1.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1.rs rename to src/test/ui/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/directory_ownership/mod_file_not_owning_aux1/compiletest-ignore-dir similarity index 100% rename from src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1/compiletest-ignore-dir rename to src/test/ui/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/directory_ownership/mod_file_not_owning_aux1/mod_file_not_owning_aux2.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/mod_file_not_owning_aux1/mod_file_not_owning_aux2.rs rename to src/test/ui/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/directory_ownership/mod_file_not_owning_aux2.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/mod_file_not_owning_aux2.rs rename to src/test/ui/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/directory_ownership/mod_file_not_owning_aux3.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/mod_file_not_owning_aux3.rs rename to src/test/ui/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/directory_ownership/non-inline-mod-restriction.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/non-inline-mod-restriction.rs rename to src/test/ui/directory_ownership/non-inline-mod-restriction.rs diff --git a/src/test/ui/directory_ownership/non-inline-mod-restriction.stderr b/src/test/ui/directory_ownership/non-inline-mod-restriction.stderr new file mode 100644 index 0000000000000..93debdd675aad --- /dev/null +++ b/src/test/ui/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/directory_ownership/unowned_mod_with_path.rs similarity index 100% rename from src/test/compile-fail/directory_ownership/unowned_mod_with_path.rs rename to src/test/ui/directory_ownership/unowned_mod_with_path.rs diff --git a/src/test/ui/directory_ownership/unowned_mod_with_path.stderr b/src/test/ui/directory_ownership/unowned_mod_with_path.stderr new file mode 100644 index 0000000000000..0c0b428143416 --- /dev/null +++ b/src/test/ui/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/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-let.nll.stderr b/src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-let.nll.stderr new file mode 100644 index 0000000000000..a8be048d7df6c --- /dev/null +++ b/src/test/ui/disallowed-deconstructing/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/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-let.rs similarity index 100% rename from src/test/compile-fail/disallowed-deconstructing-destructing-struct-let.rs rename to src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-let.rs diff --git a/src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-let.stderr b/src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-let.stderr new file mode 100644 index 0000000000000..cbf5fc61f9304 --- /dev/null +++ b/src/test/ui/disallowed-deconstructing/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/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-match.nll.stderr b/src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-match.nll.stderr new file mode 100644 index 0000000000000..9f0d2d5f0e189 --- /dev/null +++ b/src/test/ui/disallowed-deconstructing/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/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-match.rs similarity index 100% rename from src/test/compile-fail/disallowed-deconstructing-destructing-struct-match.rs rename to src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-match.rs diff --git a/src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-match.stderr b/src/test/ui/disallowed-deconstructing/disallowed-deconstructing-destructing-struct-match.stderr new file mode 100644 index 0000000000000..af2a1a06b56aa --- /dev/null +++ b/src/test/ui/disallowed-deconstructing/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/discrim/discrim-ill-typed.rs similarity index 100% rename from src/test/compile-fail/discrim-ill-typed.rs rename to src/test/ui/discrim/discrim-ill-typed.rs diff --git a/src/test/ui/discrim/discrim-ill-typed.stderr b/src/test/ui/discrim/discrim-ill-typed.stderr new file mode 100644 index 0000000000000..50911037794a9 --- /dev/null +++ b/src/test/ui/discrim/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/ui/discrim-overflow-2.rs b/src/test/ui/discrim/discrim-overflow-2.rs similarity index 100% rename from src/test/ui/discrim-overflow-2.rs rename to src/test/ui/discrim/discrim-overflow-2.rs diff --git a/src/test/ui/discrim-overflow-2.stderr b/src/test/ui/discrim/discrim-overflow-2.stderr similarity index 100% rename from src/test/ui/discrim-overflow-2.stderr rename to src/test/ui/discrim/discrim-overflow-2.stderr diff --git a/src/test/ui/discrim-overflow.rs b/src/test/ui/discrim/discrim-overflow.rs similarity index 100% rename from src/test/ui/discrim-overflow.rs rename to src/test/ui/discrim/discrim-overflow.rs diff --git a/src/test/ui/discrim-overflow.stderr b/src/test/ui/discrim/discrim-overflow.stderr similarity index 100% rename from src/test/ui/discrim-overflow.stderr rename to src/test/ui/discrim/discrim-overflow.stderr diff --git a/src/test/compile-fail/diverging-fn-tail-35849.rs b/src/test/ui/diverging-fn-tail-35849.rs similarity index 100% rename from src/test/compile-fail/diverging-fn-tail-35849.rs rename to src/test/ui/diverging-fn-tail-35849.rs diff --git a/src/test/ui/diverging-fn-tail-35849.stderr b/src/test/ui/diverging-fn-tail-35849.stderr new file mode 100644 index 0000000000000..8f8ab79b25b6c --- /dev/null +++ b/src/test/ui/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::(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/diverging-tuple-parts-39485.rs similarity index 100% rename from src/test/compile-fail/diverging-tuple-parts-39485.rs rename to src/test/ui/diverging-tuple-parts-39485.rs diff --git a/src/test/ui/diverging-tuple-parts-39485.stderr b/src/test/ui/diverging-tuple-parts-39485.stderr new file mode 100644 index 0000000000000..603f8709c14c5 --- /dev/null +++ b/src/test/ui/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/does-nothing.rs similarity index 100% rename from src/test/compile-fail/does-nothing.rs rename to src/test/ui/does-nothing.rs diff --git a/src/test/ui/does-nothing.stderr b/src/test/ui/does-nothing.stderr new file mode 100644 index 0000000000000..fa4b1f2f1c8f5 --- /dev/null +++ b/src/test/ui/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/dollar-crate/dollar-crate-is-keyword-2.rs similarity index 100% rename from src/test/compile-fail/dollar-crate-is-keyword-2.rs rename to src/test/ui/dollar-crate/dollar-crate-is-keyword-2.rs diff --git a/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr b/src/test/ui/dollar-crate/dollar-crate-is-keyword-2.stderr new file mode 100644 index 0000000000000..c9b4f894ff678 --- /dev/null +++ b/src/test/ui/dollar-crate/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/dollar-crate/dollar-crate-is-keyword.rs similarity index 100% rename from src/test/compile-fail/dollar-crate-is-keyword.rs rename to src/test/ui/dollar-crate/dollar-crate-is-keyword.rs diff --git a/src/test/ui/dollar-crate/dollar-crate-is-keyword.stderr b/src/test/ui/dollar-crate/dollar-crate-is-keyword.stderr new file mode 100644 index 0000000000000..77f4ef339499b --- /dev/null +++ b/src/test/ui/dollar-crate/dollar-crate-is-keyword.stderr @@ -0,0 +1,42 @@ +error: expected identifier, found reserved identifier `$crate` + --> $DIR/dollar-crate-is-keyword.rs:16:20 + | +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:21: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:19: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:21: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/double-type-import.rs similarity index 100% rename from src/test/compile-fail/double-type-import.rs rename to src/test/ui/double-type-import.rs diff --git a/src/test/ui/double-type-import.stderr b/src/test/ui/double-type-import.stderr new file mode 100644 index 0000000000000..d5d977da4aa4c --- /dev/null +++ b/src/test/ui/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/dropck/drop-on-non-struct.rs similarity index 100% rename from src/test/compile-fail/drop-on-non-struct.rs rename to src/test/ui/dropck/drop-on-non-struct.rs diff --git a/src/test/ui/dropck/drop-on-non-struct.stderr b/src/test/ui/dropck/drop-on-non-struct.stderr new file mode 100644 index 0000000000000..6582df6bddccf --- /dev/null +++ b/src/test/ui/dropck/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/dropck/drop-with-active-borrows-1.nll.stderr b/src/test/ui/dropck/drop-with-active-borrows-1.nll.stderr new file mode 100644 index 0000000000000..30f9907401c18 --- /dev/null +++ b/src/test/ui/dropck/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/dropck/drop-with-active-borrows-1.rs similarity index 100% rename from src/test/compile-fail/drop-with-active-borrows-1.rs rename to src/test/ui/dropck/drop-with-active-borrows-1.rs diff --git a/src/test/ui/dropck/drop-with-active-borrows-1.stderr b/src/test/ui/dropck/drop-with-active-borrows-1.stderr new file mode 100644 index 0000000000000..60107427ea5c5 --- /dev/null +++ b/src/test/ui/dropck/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/dropck/drop-with-active-borrows-2.nll.stderr b/src/test/ui/dropck/drop-with-active-borrows-2.nll.stderr new file mode 100644 index 0000000000000..4f792a9c9d28f --- /dev/null +++ b/src/test/ui/dropck/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/dropck/drop-with-active-borrows-2.rs similarity index 100% rename from src/test/compile-fail/drop-with-active-borrows-2.rs rename to src/test/ui/dropck/drop-with-active-borrows-2.rs diff --git a/src/test/ui/dropck/drop-with-active-borrows-2.stderr b/src/test/ui/dropck/drop-with-active-borrows-2.stderr new file mode 100644 index 0000000000000..0fd4bf81039ca --- /dev/null +++ b/src/test/ui/dropck/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/dropck/dropck_no_diverge_on_nonregular_1.rs similarity index 100% rename from src/test/compile-fail/dropck_no_diverge_on_nonregular_1.rs rename to src/test/ui/dropck/dropck_no_diverge_on_nonregular_1.rs diff --git a/src/test/ui/dropck/dropck_no_diverge_on_nonregular_1.stderr b/src/test/ui/dropck/dropck_no_diverge_on_nonregular_1.stderr new file mode 100644 index 0000000000000..f4dd867ec689c --- /dev/null +++ b/src/test/ui/dropck/dropck_no_diverge_on_nonregular_1.stderr @@ -0,0 +1,19 @@ +error[E0320]: overflow while adding drop-check rules for FingerTree + --> $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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error[E0320]: overflow while adding drop-check rules for FingerTree + --> $DIR/dropck_no_diverge_on_nonregular_1.rs:35:9 + | +LL | FingerTree::Single(1); + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: overflowed on FingerTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +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/dropck/dropck_no_diverge_on_nonregular_2.rs similarity index 100% rename from src/test/compile-fail/dropck_no_diverge_on_nonregular_2.rs rename to src/test/ui/dropck/dropck_no_diverge_on_nonregular_2.rs diff --git a/src/test/ui/dropck/dropck_no_diverge_on_nonregular_2.stderr b/src/test/ui/dropck/dropck_no_diverge_on_nonregular_2.stderr new file mode 100644 index 0000000000000..ae9c50a66a0ef --- /dev/null +++ b/src/test/ui/dropck/dropck_no_diverge_on_nonregular_2.stderr @@ -0,0 +1,19 @@ +error[E0320]: overflow while adding drop-check rules for FingerTree + --> $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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error[E0320]: overflow while adding drop-check rules for FingerTree + --> $DIR/dropck_no_diverge_on_nonregular_2.rs:34:9 + | +LL | FingerTree::Single(1); + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: overflowed on FingerTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +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/dropck/dropck_no_diverge_on_nonregular_3.rs similarity index 100% rename from src/test/compile-fail/dropck_no_diverge_on_nonregular_3.rs rename to src/test/ui/dropck/dropck_no_diverge_on_nonregular_3.rs diff --git a/src/test/ui/dropck/dropck_no_diverge_on_nonregular_3.stderr b/src/test/ui/dropck/dropck_no_diverge_on_nonregular_3.stderr new file mode 100644 index 0000000000000..e0089f8b2981a --- /dev/null +++ b/src/test/ui/dropck/dropck_no_diverge_on_nonregular_3.stderr @@ -0,0 +1,27 @@ +error[E0320]: overflow while adding drop-check rules for std::option::Option> + --> $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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error[E0320]: overflow while adding drop-check rules for std::option::Option> + --> $DIR/dropck_no_diverge_on_nonregular_3.rs:43:9 + | +LL | Some(Wrapper::Simple::); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: overflowed on FingerTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error[E0320]: overflow while adding drop-check rules for Wrapper + --> $DIR/dropck_no_diverge_on_nonregular_3.rs:43:14 + | +LL | Some(Wrapper::Simple::); + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: overflowed on FingerTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0320`. diff --git a/src/test/ui/dropck/dropck_trait_cycle_checked.nll.stderr b/src/test/ui/dropck/dropck_trait_cycle_checked.nll.stderr new file mode 100644 index 0000000000000..a47229cdca0bb --- /dev/null +++ b/src/test/ui/dropck/dropck_trait_cycle_checked.nll.stderr @@ -0,0 +1,68 @@ +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 + | + = 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: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 + | + = 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: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 + | + = 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: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/dropck/dropck_trait_cycle_checked.rs similarity index 100% rename from src/test/compile-fail/dropck_trait_cycle_checked.rs rename to src/test/ui/dropck/dropck_trait_cycle_checked.rs diff --git a/src/test/ui/dropck/dropck_trait_cycle_checked.stderr b/src/test/ui/dropck/dropck_trait_cycle_checked.stderr new file mode 100644 index 0000000000000..ab255cf0c9893 --- /dev/null +++ b/src/test/ui/dropck/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/dst/dst-bad-assign-2.rs similarity index 100% rename from src/test/compile-fail/dst-bad-assign-2.rs rename to src/test/ui/dst/dst-bad-assign-2.rs diff --git a/src/test/ui/dst/dst-bad-assign-2.stderr b/src/test/ui/dst/dst-bad-assign-2.stderr new file mode 100644 index 0000000000000..ead973d25a027 --- /dev/null +++ b/src/test/ui/dst/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 + = 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/dst/dst-bad-assign-3.rs similarity index 100% rename from src/test/compile-fail/dst-bad-assign-3.rs rename to src/test/ui/dst/dst-bad-assign-3.rs diff --git a/src/test/ui/dst/dst-bad-assign-3.stderr b/src/test/ui/dst/dst-bad-assign-3.stderr new file mode 100644 index 0000000000000..ec172fae7a6b0 --- /dev/null +++ b/src/test/ui/dst/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 + = 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/dst/dst-bad-assign.rs similarity index 100% rename from src/test/compile-fail/dst-bad-assign.rs rename to src/test/ui/dst/dst-bad-assign.rs diff --git a/src/test/ui/dst/dst-bad-assign.stderr b/src/test/ui/dst/dst-bad-assign.stderr new file mode 100644 index 0000000000000..72f28af517542 --- /dev/null +++ b/src/test/ui/dst/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 + = 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/dst/dst-bad-coerce1.rs similarity index 100% rename from src/test/compile-fail/dst-bad-coerce1.rs rename to src/test/ui/dst/dst-bad-coerce1.rs diff --git a/src/test/ui/dst/dst-bad-coerce1.stderr b/src/test/ui/dst/dst-bad-coerce1.stderr new file mode 100644 index 0000000000000..bb59c4d561727 --- /dev/null +++ b/src/test/ui/dst/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 = 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/dst/dst-bad-coerce2.rs similarity index 100% rename from src/test/compile-fail/dst-bad-coerce2.rs rename to src/test/ui/dst/dst-bad-coerce2.rs diff --git a/src/test/ui/dst/dst-bad-coerce2.stderr b/src/test/ui/dst/dst-bad-coerce2.stderr new file mode 100644 index 0000000000000..51991544a2e24 --- /dev/null +++ b/src/test/ui/dst/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 = f2; //~ ERROR mismatched types + | ^^ types differ in mutability + | + = note: expected type `&mut Fat` + found type `&Fat` + +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/dst/dst-bad-coerce3.nll.stderr b/src/test/ui/dst/dst-bad-coerce3.nll.stderr new file mode 100644 index 0000000000000..bc5b4ca71cfd4 --- /dev/null +++ b/src/test/ui/dst/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 = &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/dst/dst-bad-coerce3.rs similarity index 100% rename from src/test/compile-fail/dst-bad-coerce3.rs rename to src/test/ui/dst/dst-bad-coerce3.rs diff --git a/src/test/ui/dst/dst-bad-coerce3.stderr b/src/test/ui/dst/dst-bad-coerce3.stderr new file mode 100644 index 0000000000000..3c4eb2720827d --- /dev/null +++ b/src/test/ui/dst/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 = &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/dst/dst-bad-coerce4.rs similarity index 100% rename from src/test/compile-fail/dst-bad-coerce4.rs rename to src/test/ui/dst/dst-bad-coerce4.rs diff --git a/src/test/ui/dst/dst-bad-coerce4.stderr b/src/test/ui/dst/dst-bad-coerce4.stderr new file mode 100644 index 0000000000000..279de13cf37f1 --- /dev/null +++ b/src/test/ui/dst/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/dst/dst-bad-coercions.rs similarity index 100% rename from src/test/compile-fail/dst-bad-coercions.rs rename to src/test/ui/dst/dst-bad-coercions.rs diff --git a/src/test/ui/dst/dst-bad-coercions.stderr b/src/test/ui/dst/dst-bad-coercions.stderr new file mode 100644 index 0000000000000..8901ef1caaa97 --- /dev/null +++ b/src/test/ui/dst/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/dst/dst-bad-deep-2.rs similarity index 100% rename from src/test/compile-fail/dst-bad-deep-2.rs rename to src/test/ui/dst/dst-bad-deep-2.rs diff --git a/src/test/ui/dst/dst-bad-deep-2.stderr b/src/test/ui/dst/dst-bad-deep-2.stderr new file mode 100644 index 0000000000000..2c0a540f25a6b --- /dev/null +++ b/src/test/ui/dst/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 + = 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/dst/dst-bad-deep.rs similarity index 100% rename from src/test/compile-fail/dst-bad-deep.rs rename to src/test/ui/dst/dst-bad-deep.rs diff --git a/src/test/ui/dst/dst-bad-deep.stderr b/src/test/ui/dst/dst-bad-deep.stderr new file mode 100644 index 0000000000000..2ac8cb325a149 --- /dev/null +++ b/src/test/ui/dst/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 { ptr: *g }; + | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Fat>`, the trait `std::marker::Sized` is not implemented for `[isize]` + = note: to learn more, visit + = note: required because it appears within the type `Fat<[isize]>` + = note: required because it appears within the type `Fat>` + = 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/dst/dst-index.nll.stderr b/src/test/ui/dst/dst-index.nll.stderr new file mode 100644 index 0000000000000..767d8a84c041d --- /dev/null +++ b/src/test/ui/dst/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/dst/dst-index.rs similarity index 100% rename from src/test/compile-fail/dst-index.rs rename to src/test/ui/dst/dst-index.rs diff --git a/src/test/ui/dst/dst-index.stderr b/src/test/ui/dst/dst-index.stderr new file mode 100644 index 0000000000000..7c5e79dab992d --- /dev/null +++ b/src/test/ui/dst/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/dst/dst-object-from-unsized-type.rs similarity index 100% rename from src/test/compile-fail/dst-object-from-unsized-type.rs rename to src/test/ui/dst/dst-object-from-unsized-type.rs diff --git a/src/test/ui/dst/dst-object-from-unsized-type.stderr b/src/test/ui/dst/dst-object-from-unsized-type.stderr new file mode 100644 index 0000000000000..862c52e43c06a --- /dev/null +++ b/src/test/ui/dst/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 + = 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 + = 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 + = 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 + = 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/dst/dst-rvalue.nll.stderr b/src/test/ui/dst/dst-rvalue.nll.stderr new file mode 100644 index 0000000000000..5eadcc3def5ff --- /dev/null +++ b/src/test/ui/dst/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 = box *"hello world"; + | ^^^^^^^^^^^^^^ + +error[E0507]: cannot move out of borrowed content + --> $DIR/dst-rvalue.rs:16:28 + | +LL | let _x: Box = box *"hello world"; + | ^^^^^^^^^^^^^^ cannot move out of borrowed content + +error[E0161]: cannot move a value of type [isize]: the size of [isize] cannot be statically determined + --> $DIR/dst-rvalue.rs:21:32 + | +LL | let _x: Box<[isize]> = box *array; + | ^^^^^^ + +error[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/dst/dst-rvalue.rs similarity index 100% rename from src/test/compile-fail/dst-rvalue.rs rename to src/test/ui/dst/dst-rvalue.rs diff --git a/src/test/ui/dst/dst-rvalue.stderr b/src/test/ui/dst/dst-rvalue.stderr new file mode 100644 index 0000000000000..0957105c8a797 --- /dev/null +++ b/src/test/ui/dst/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 = 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 = 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/dst/dst-sized-trait-param.rs similarity index 100% rename from src/test/compile-fail/dst-sized-trait-param.rs rename to src/test/ui/dst/dst-sized-trait-param.rs diff --git a/src/test/ui/dst/dst-sized-trait-param.stderr b/src/test/ui/dst/dst-sized-trait-param.stderr new file mode 100644 index 0000000000000..47f8215d52620 --- /dev/null +++ b/src/test/ui/dst/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 + +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 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 + +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/duplicate/dupe-symbols-1.rs similarity index 100% rename from src/test/compile-fail/dupe-symbols-1.rs rename to src/test/ui/duplicate/dupe-symbols-1.rs diff --git a/src/test/ui/duplicate/dupe-symbols-1.stderr b/src/test/ui/duplicate/dupe-symbols-1.stderr new file mode 100644 index 0000000000000..c702a0f3a1be6 --- /dev/null +++ b/src/test/ui/duplicate/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/duplicate/dupe-symbols-2.rs similarity index 100% rename from src/test/compile-fail/dupe-symbols-2.rs rename to src/test/ui/duplicate/dupe-symbols-2.rs diff --git a/src/test/ui/duplicate/dupe-symbols-2.stderr b/src/test/ui/duplicate/dupe-symbols-2.stderr new file mode 100644 index 0000000000000..5d5e9d73d7b43 --- /dev/null +++ b/src/test/ui/duplicate/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/duplicate/dupe-symbols-3.rs similarity index 100% rename from src/test/compile-fail/dupe-symbols-3.rs rename to src/test/ui/duplicate/dupe-symbols-3.rs diff --git a/src/test/ui/duplicate/dupe-symbols-3.stderr b/src/test/ui/duplicate/dupe-symbols-3.stderr new file mode 100644 index 0000000000000..6801016373d19 --- /dev/null +++ b/src/test/ui/duplicate/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/duplicate/dupe-symbols-4.rs similarity index 100% rename from src/test/compile-fail/dupe-symbols-4.rs rename to src/test/ui/duplicate/dupe-symbols-4.rs diff --git a/src/test/ui/duplicate/dupe-symbols-4.stderr b/src/test/ui/duplicate/dupe-symbols-4.stderr new file mode 100644 index 0000000000000..fdbb5ce90c1e7 --- /dev/null +++ b/src/test/ui/duplicate/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/duplicate/dupe-symbols-5.rs similarity index 100% rename from src/test/compile-fail/dupe-symbols-5.rs rename to src/test/ui/duplicate/dupe-symbols-5.rs diff --git a/src/test/ui/duplicate/dupe-symbols-5.stderr b/src/test/ui/duplicate/dupe-symbols-5.stderr new file mode 100644 index 0000000000000..8ded374127b6c --- /dev/null +++ b/src/test/ui/duplicate/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/duplicate/dupe-symbols-6.rs similarity index 100% rename from src/test/compile-fail/dupe-symbols-6.rs rename to src/test/ui/duplicate/dupe-symbols-6.rs diff --git a/src/test/ui/duplicate/dupe-symbols-6.stderr b/src/test/ui/duplicate/dupe-symbols-6.stderr new file mode 100644 index 0000000000000..6dbb831832a23 --- /dev/null +++ b/src/test/ui/duplicate/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/duplicate/dupe-symbols-7.rs similarity index 100% rename from src/test/compile-fail/dupe-symbols-7.rs rename to src/test/ui/duplicate/dupe-symbols-7.rs diff --git a/src/test/ui/duplicate/dupe-symbols-7.stderr b/src/test/ui/duplicate/dupe-symbols-7.stderr new file mode 100644 index 0000000000000..5fadbd5bd1007 --- /dev/null +++ b/src/test/ui/duplicate/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/ui/duplicate-check-macro-exports.rs b/src/test/ui/duplicate/duplicate-check-macro-exports.rs similarity index 100% rename from src/test/ui/duplicate-check-macro-exports.rs rename to src/test/ui/duplicate/duplicate-check-macro-exports.rs diff --git a/src/test/ui/duplicate-check-macro-exports.stderr b/src/test/ui/duplicate/duplicate-check-macro-exports.stderr similarity index 100% rename from src/test/ui/duplicate-check-macro-exports.stderr rename to src/test/ui/duplicate/duplicate-check-macro-exports.stderr diff --git a/src/test/compile-fail/duplicate-parameter.rs b/src/test/ui/duplicate/duplicate-parameter.rs similarity index 100% rename from src/test/compile-fail/duplicate-parameter.rs rename to src/test/ui/duplicate/duplicate-parameter.rs diff --git a/src/test/ui/duplicate/duplicate-parameter.stderr b/src/test/ui/duplicate/duplicate-parameter.stderr new file mode 100644 index 0000000000000..6cc7244ea79df --- /dev/null +++ b/src/test/ui/duplicate/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/duplicate/duplicate-type-parameter.rs similarity index 100% rename from src/test/compile-fail/duplicate-type-parameter.rs rename to src/test/ui/duplicate/duplicate-type-parameter.rs diff --git a/src/test/ui/duplicate/duplicate-type-parameter.stderr b/src/test/ui/duplicate/duplicate-type-parameter.stderr new file mode 100644 index 0000000000000..186a1e52bb8b1 --- /dev/null +++ b/src/test/ui/duplicate/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 = Option; + | - ^ 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); + | - ^ 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 { + | - ^ 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 { + | - ^ 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(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 {} + | - ^ 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 Qux for Option {} + | - ^ 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 Qux for Option {} + | ^ 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/duplicate_entry_error.rs similarity index 100% rename from src/test/compile-fail/duplicate_entry_error.rs rename to src/test/ui/duplicate_entry_error.rs diff --git a/src/test/ui/duplicate_entry_error.stderr b/src/test/ui/duplicate_entry_error.stderr new file mode 100644 index 0000000000000..b330d2f30f863 --- /dev/null +++ b/src/test/ui/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/dyn-trait-compatibility.rs similarity index 100% rename from src/test/compile-fail/dyn-trait-compatibility.rs rename to src/test/ui/dyn-trait-compatibility.rs diff --git a/src/test/ui/dyn-trait-compatibility.stderr b/src/test/ui/dyn-trait-compatibility.stderr new file mode 100644 index 0000000000000..1ff3249371b9d --- /dev/null +++ b/src/test/ui/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>; + | ^^^ 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; + | ^^^ 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; + | ^^^ 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; + | ^^^ 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>; + | ^^^ 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>; + | ^^^ 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/auxiliary/edition-extern-crate-allowed.rs b/src/test/ui/editions/auxiliary/edition-extern-crate-allowed.rs similarity index 100% rename from src/test/compile-fail/auxiliary/edition-extern-crate-allowed.rs rename to src/test/ui/editions/auxiliary/edition-extern-crate-allowed.rs diff --git a/src/test/ui/auxiliary/edition-kw-macro-2015.rs b/src/test/ui/editions/auxiliary/edition-kw-macro-2015.rs similarity index 100% rename from src/test/ui/auxiliary/edition-kw-macro-2015.rs rename to src/test/ui/editions/auxiliary/edition-kw-macro-2015.rs diff --git a/src/test/ui/auxiliary/edition-kw-macro-2018.rs b/src/test/ui/editions/auxiliary/edition-kw-macro-2018.rs similarity index 100% rename from src/test/ui/auxiliary/edition-kw-macro-2018.rs rename to src/test/ui/editions/auxiliary/edition-kw-macro-2018.rs diff --git a/src/test/compile-fail/edition-extern-crate-allowed.rs b/src/test/ui/editions/edition-extern-crate-allowed.rs similarity index 100% rename from src/test/compile-fail/edition-extern-crate-allowed.rs rename to src/test/ui/editions/edition-extern-crate-allowed.rs diff --git a/src/test/ui/editions/edition-extern-crate-allowed.stderr b/src/test/ui/editions/edition-extern-crate-allowed.stderr new file mode 100644 index 0000000000000..7c1ccc540c552 --- /dev/null +++ b/src/test/ui/editions/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/editions/edition-feature-ok.rs similarity index 100% rename from src/test/compile-fail/edition-feature-ok.rs rename to src/test/ui/editions/edition-feature-ok.rs diff --git a/src/test/ui/edition-keywords-2015-2015-expansion.rs b/src/test/ui/editions/edition-keywords-2015-2015-expansion.rs similarity index 100% rename from src/test/ui/edition-keywords-2015-2015-expansion.rs rename to src/test/ui/editions/edition-keywords-2015-2015-expansion.rs diff --git a/src/test/ui/edition-keywords-2015-2015-parsing.rs b/src/test/ui/editions/edition-keywords-2015-2015-parsing.rs similarity index 100% rename from src/test/ui/edition-keywords-2015-2015-parsing.rs rename to src/test/ui/editions/edition-keywords-2015-2015-parsing.rs diff --git a/src/test/ui/edition-keywords-2015-2015-parsing.stderr b/src/test/ui/editions/edition-keywords-2015-2015-parsing.stderr similarity index 100% rename from src/test/ui/edition-keywords-2015-2015-parsing.stderr rename to src/test/ui/editions/edition-keywords-2015-2015-parsing.stderr diff --git a/src/test/ui/edition-keywords-2015-2018-expansion.rs b/src/test/ui/editions/edition-keywords-2015-2018-expansion.rs similarity index 100% rename from src/test/ui/edition-keywords-2015-2018-expansion.rs rename to src/test/ui/editions/edition-keywords-2015-2018-expansion.rs diff --git a/src/test/ui/edition-keywords-2015-2018-expansion.stderr b/src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr similarity index 100% rename from src/test/ui/edition-keywords-2015-2018-expansion.stderr rename to src/test/ui/editions/edition-keywords-2015-2018-expansion.stderr diff --git a/src/test/ui/edition-keywords-2015-2018-parsing.rs b/src/test/ui/editions/edition-keywords-2015-2018-parsing.rs similarity index 100% rename from src/test/ui/edition-keywords-2015-2018-parsing.rs rename to src/test/ui/editions/edition-keywords-2015-2018-parsing.rs diff --git a/src/test/ui/edition-keywords-2015-2018-parsing.stderr b/src/test/ui/editions/edition-keywords-2015-2018-parsing.stderr similarity index 100% rename from src/test/ui/edition-keywords-2015-2018-parsing.stderr rename to src/test/ui/editions/edition-keywords-2015-2018-parsing.stderr diff --git a/src/test/ui/edition-keywords-2018-2015-expansion.rs b/src/test/ui/editions/edition-keywords-2018-2015-expansion.rs similarity index 100% rename from src/test/ui/edition-keywords-2018-2015-expansion.rs rename to src/test/ui/editions/edition-keywords-2018-2015-expansion.rs diff --git a/src/test/ui/edition-keywords-2018-2015-parsing.rs b/src/test/ui/editions/edition-keywords-2018-2015-parsing.rs similarity index 100% rename from src/test/ui/edition-keywords-2018-2015-parsing.rs rename to src/test/ui/editions/edition-keywords-2018-2015-parsing.rs diff --git a/src/test/ui/edition-keywords-2018-2015-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr similarity index 100% rename from src/test/ui/edition-keywords-2018-2015-parsing.stderr rename to src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr diff --git a/src/test/ui/edition-keywords-2018-2018-expansion.rs b/src/test/ui/editions/edition-keywords-2018-2018-expansion.rs similarity index 100% rename from src/test/ui/edition-keywords-2018-2018-expansion.rs rename to src/test/ui/editions/edition-keywords-2018-2018-expansion.rs diff --git a/src/test/ui/edition-keywords-2018-2018-expansion.stderr b/src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr similarity index 100% rename from src/test/ui/edition-keywords-2018-2018-expansion.stderr rename to src/test/ui/editions/edition-keywords-2018-2018-expansion.stderr diff --git a/src/test/ui/edition-keywords-2018-2018-parsing.rs b/src/test/ui/editions/edition-keywords-2018-2018-parsing.rs similarity index 100% rename from src/test/ui/edition-keywords-2018-2018-parsing.rs rename to src/test/ui/editions/edition-keywords-2018-2018-parsing.rs diff --git a/src/test/ui/edition-keywords-2018-2018-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr similarity index 100% rename from src/test/ui/edition-keywords-2018-2018-parsing.stderr rename to src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr diff --git a/src/test/compile-fail/edition-raw-pointer-method-2015.rs b/src/test/ui/editions/edition-raw-pointer-method-2015.rs similarity index 100% rename from src/test/compile-fail/edition-raw-pointer-method-2015.rs rename to src/test/ui/editions/edition-raw-pointer-method-2015.rs diff --git a/src/test/ui/editions/edition-raw-pointer-method-2015.stderr b/src/test/ui/editions/edition-raw-pointer-method-2015.stderr new file mode 100644 index 0000000000000..7fd098c98e380 --- /dev/null +++ b/src/test/ui/editions/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 + +error: aborting due to previous error + diff --git a/src/test/compile-fail/edition-raw-pointer-method-2018.rs b/src/test/ui/editions/edition-raw-pointer-method-2018.rs similarity index 100% rename from src/test/compile-fail/edition-raw-pointer-method-2018.rs rename to src/test/ui/editions/edition-raw-pointer-method-2018.rs diff --git a/src/test/ui/editions/edition-raw-pointer-method-2018.stderr b/src/test/ui/editions/edition-raw-pointer-method-2018.stderr new file mode 100644 index 0000000000000..0708b4bbd469d --- /dev/null +++ b/src/test/ui/editions/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/elided-test.rs similarity index 100% rename from src/test/compile-fail/elided-test.rs rename to src/test/ui/elided-test.rs diff --git a/src/test/ui/elided-test.stderr b/src/test/ui/elided-test.stderr new file mode 100644 index 0000000000000..d22eee4e8bde7 --- /dev/null +++ b/src/test/ui/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/auxiliary/empty-struct.rs b/src/test/ui/empty/auxiliary/empty-struct.rs similarity index 100% rename from src/test/compile-fail/auxiliary/empty-struct.rs rename to src/test/ui/empty/auxiliary/empty-struct.rs diff --git a/src/test/compile-fail/auxiliary/two_macros.rs b/src/test/ui/empty/auxiliary/two_macros.rs similarity index 100% rename from src/test/compile-fail/auxiliary/two_macros.rs rename to src/test/ui/empty/auxiliary/two_macros.rs diff --git a/src/test/compile-fail/empty-comment.rs b/src/test/ui/empty/empty-comment.rs similarity index 100% rename from src/test/compile-fail/empty-comment.rs rename to src/test/ui/empty/empty-comment.rs diff --git a/src/test/ui/empty/empty-comment.stderr b/src/test/ui/empty/empty-comment.stderr new file mode 100644 index 0000000000000..d6990c4eaeb8f --- /dev/null +++ b/src/test/ui/empty/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-linkname.rs b/src/test/ui/empty/empty-linkname.rs similarity index 100% rename from src/test/compile-fail/empty-linkname.rs rename to src/test/ui/empty/empty-linkname.rs diff --git a/src/test/ui/empty/empty-linkname.stderr b/src/test/ui/empty/empty-linkname.stderr new file mode 100644 index 0000000000000..9a637aa7833a1 --- /dev/null +++ b/src/test/ui/empty/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/empty/empty-macro-use.rs similarity index 100% rename from src/test/compile-fail/empty-macro-use.rs rename to src/test/ui/empty/empty-macro-use.rs diff --git a/src/test/ui/empty/empty-macro-use.stderr b/src/test/ui/empty/empty-macro-use.stderr new file mode 100644 index 0000000000000..8feb0930718a1 --- /dev/null +++ b/src/test/ui/empty/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/empty/empty-never-array.rs similarity index 100% rename from src/test/compile-fail/empty-never-array.rs rename to src/test/ui/empty/empty-never-array.rs diff --git a/src/test/ui/empty/empty-never-array.stderr b/src/test/ui/empty/empty-never-array.stderr new file mode 100644 index 0000000000000..d9ef2f30aabe2 --- /dev/null +++ b/src/test/ui/empty/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/empty/empty-struct-braces-expr.rs similarity index 100% rename from src/test/compile-fail/empty-struct-braces-expr.rs rename to src/test/ui/empty/empty-struct-braces-expr.rs diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr new file mode 100644 index 0000000000000..9b6114875e2e5 --- /dev/null +++ b/src/test/ui/empty/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/empty/empty-struct-braces-pat-1.rs similarity index 100% rename from src/test/compile-fail/empty-struct-braces-pat-1.rs rename to src/test/ui/empty/empty-struct-braces-pat-1.rs diff --git a/src/test/ui/empty/empty-struct-braces-pat-1.stderr b/src/test/ui/empty/empty-struct-braces-pat-1.stderr new file mode 100644 index 0000000000000..aad47f4d954b1 --- /dev/null +++ b/src/test/ui/empty/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/empty/empty-struct-braces-pat-2.rs similarity index 100% rename from src/test/compile-fail/empty-struct-braces-pat-2.rs rename to src/test/ui/empty/empty-struct-braces-pat-2.rs diff --git a/src/test/ui/empty/empty-struct-braces-pat-2.stderr b/src/test/ui/empty/empty-struct-braces-pat-2.stderr new file mode 100644 index 0000000000000..26fb42c4e94d6 --- /dev/null +++ b/src/test/ui/empty/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/empty/empty-struct-braces-pat-3.rs similarity index 100% rename from src/test/compile-fail/empty-struct-braces-pat-3.rs rename to src/test/ui/empty/empty-struct-braces-pat-3.rs diff --git a/src/test/ui/empty/empty-struct-braces-pat-3.stderr b/src/test/ui/empty/empty-struct-braces-pat-3.stderr new file mode 100644 index 0000000000000..389bf0a65c633 --- /dev/null +++ b/src/test/ui/empty/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/empty/empty-struct-tuple-pat.rs similarity index 100% rename from src/test/compile-fail/empty-struct-tuple-pat.rs rename to src/test/ui/empty/empty-struct-tuple-pat.rs diff --git a/src/test/ui/empty/empty-struct-tuple-pat.stderr b/src/test/ui/empty/empty-struct-tuple-pat.stderr new file mode 100644 index 0000000000000..3d219b1752f67 --- /dev/null +++ b/src/test/ui/empty/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/ui/empty-struct-unit-expr.rs b/src/test/ui/empty/empty-struct-unit-expr.rs similarity index 100% rename from src/test/ui/empty-struct-unit-expr.rs rename to src/test/ui/empty/empty-struct-unit-expr.rs diff --git a/src/test/ui/empty-struct-unit-expr.stderr b/src/test/ui/empty/empty-struct-unit-expr.stderr similarity index 100% rename from src/test/ui/empty-struct-unit-expr.stderr rename to src/test/ui/empty/empty-struct-unit-expr.stderr diff --git a/src/test/compile-fail/empty-struct-unit-pat.rs b/src/test/ui/empty/empty-struct-unit-pat.rs similarity index 100% rename from src/test/compile-fail/empty-struct-unit-pat.rs rename to src/test/ui/empty/empty-struct-unit-pat.rs diff --git a/src/test/ui/empty/empty-struct-unit-pat.stderr b/src/test/ui/empty/empty-struct-unit-pat.stderr new file mode 100644 index 0000000000000..042b53521c293 --- /dev/null +++ b/src/test/ui/empty/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/enable-unstable-lib-feature.rs similarity index 100% rename from src/test/compile-fail/enable-unstable-lib-feature.rs rename to src/test/ui/enable-unstable-lib-feature.rs diff --git a/src/test/ui/enable-unstable-lib-feature.stderr b/src/test/ui/enable-unstable-lib-feature.stderr new file mode 100644 index 0000000000000..20b2eb51fcb7c --- /dev/null +++ b/src/test/ui/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/ui/enum-and-module-in-same-scope.rs b/src/test/ui/enum/enum-and-module-in-same-scope.rs similarity index 100% rename from src/test/ui/enum-and-module-in-same-scope.rs rename to src/test/ui/enum/enum-and-module-in-same-scope.rs diff --git a/src/test/ui/enum-and-module-in-same-scope.stderr b/src/test/ui/enum/enum-and-module-in-same-scope.stderr similarity index 100% rename from src/test/ui/enum-and-module-in-same-scope.stderr rename to src/test/ui/enum/enum-and-module-in-same-scope.stderr diff --git a/src/test/compile-fail/enum-discrim-autosizing.rs b/src/test/ui/enum/enum-discrim-autosizing.rs similarity index 100% rename from src/test/compile-fail/enum-discrim-autosizing.rs rename to src/test/ui/enum/enum-discrim-autosizing.rs diff --git a/src/test/ui/enum/enum-discrim-autosizing.stderr b/src/test/ui/enum/enum-discrim-autosizing.stderr new file mode 100644 index 0000000000000..3b4ac436898e6 --- /dev/null +++ b/src/test/ui/enum/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/enum/enum-discrim-too-small.rs similarity index 100% rename from src/test/compile-fail/enum-discrim-too-small.rs rename to src/test/ui/enum/enum-discrim-too-small.rs diff --git a/src/test/ui/enum/enum-discrim-too-small.stderr b/src/test/ui/enum/enum-discrim-too-small.stderr new file mode 100644 index 0000000000000..4c8ff52c12b96 --- /dev/null +++ b/src/test/ui/enum/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/enum/enum-discrim-too-small2.rs similarity index 100% rename from src/test/compile-fail/enum-discrim-too-small2.rs rename to src/test/ui/enum/enum-discrim-too-small2.rs diff --git a/src/test/ui/enum/enum-discrim-too-small2.stderr b/src/test/ui/enum/enum-discrim-too-small2.stderr new file mode 100644 index 0000000000000..536dbf64a9da8 --- /dev/null +++ b/src/test/ui/enum/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/enum/enum-in-scope.rs similarity index 100% rename from src/test/compile-fail/enum-in-scope.rs rename to src/test/ui/enum/enum-in-scope.rs diff --git a/src/test/ui/enum/enum-in-scope.stderr b/src/test/ui/enum/enum-in-scope.stderr new file mode 100644 index 0000000000000..1e8d594049542 --- /dev/null +++ b/src/test/ui/enum/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/ui/enum-size-variance.rs b/src/test/ui/enum/enum-size-variance.rs similarity index 100% rename from src/test/ui/enum-size-variance.rs rename to src/test/ui/enum/enum-size-variance.rs diff --git a/src/test/ui/enum-size-variance.stderr b/src/test/ui/enum/enum-size-variance.stderr similarity index 100% rename from src/test/ui/enum-size-variance.stderr rename to src/test/ui/enum/enum-size-variance.stderr diff --git a/src/test/compile-fail/enum-to-float-cast-2.rs b/src/test/ui/enum/enum-to-float-cast-2.rs similarity index 100% rename from src/test/compile-fail/enum-to-float-cast-2.rs rename to src/test/ui/enum/enum-to-float-cast-2.rs diff --git a/src/test/ui/enum/enum-to-float-cast-2.stderr b/src/test/ui/enum/enum-to-float-cast-2.stderr new file mode 100644 index 0000000000000..e8e6d8fbcfbcc --- /dev/null +++ b/src/test/ui/enum/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/enum/enum-to-float-cast.rs similarity index 100% rename from src/test/compile-fail/enum-to-float-cast.rs rename to src/test/ui/enum/enum-to-float-cast.rs diff --git a/src/test/ui/enum/enum-to-float-cast.stderr b/src/test/ui/enum/enum-to-float-cast.stderr new file mode 100644 index 0000000000000..adc2015909cd3 --- /dev/null +++ b/src/test/ui/enum/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/enum/enum-variant-type-2.rs similarity index 100% rename from src/test/compile-fail/enum-variant-type-2.rs rename to src/test/ui/enum/enum-variant-type-2.rs diff --git a/src/test/ui/enum/enum-variant-type-2.stderr b/src/test/ui/enum/enum-variant-type-2.stderr new file mode 100644 index 0000000000000..7a786af71bb3f --- /dev/null +++ b/src/test/ui/enum/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/enums-pats-not-idents.rs similarity index 100% rename from src/test/compile-fail/enums-pats-not-idents.rs rename to src/test/ui/enums-pats-not-idents.rs diff --git a/src/test/ui/enums-pats-not-idents.stderr b/src/test/ui/enums-pats-not-idents.stderr new file mode 100644 index 0000000000000..5bd119622e595 --- /dev/null +++ b/src/test/ui/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/error-should-say-copy-not-pod.rs similarity index 100% rename from src/test/compile-fail/error-should-say-copy-not-pod.rs rename to src/test/ui/error-should-say-copy-not-pod.rs diff --git a/src/test/ui/error-should-say-copy-not-pod.stderr b/src/test/ui/error-should-say-copy-not-pod.stderr new file mode 100644 index 0000000000000..704cd4f4838f2 --- /dev/null +++ b/src/test/ui/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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/estr-subtyping.rs similarity index 100% rename from src/test/compile-fail/estr-subtyping.rs rename to src/test/ui/estr-subtyping.rs diff --git a/src/test/ui/estr-subtyping.stderr b/src/test/ui/estr-subtyping.stderr new file mode 100644 index 0000000000000..fcff9d0380e89 --- /dev/null +++ b/src/test/ui/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/eval-enum.rs similarity index 100% rename from src/test/compile-fail/eval-enum.rs rename to src/test/ui/eval-enum.rs diff --git a/src/test/ui/eval-enum.stderr b/src/test/ui/eval-enum.stderr new file mode 100644 index 0000000000000..f26c48f1a72ae --- /dev/null +++ b/src/test/ui/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/exclusive-drop-and-copy.rs similarity index 100% rename from src/test/compile-fail/exclusive-drop-and-copy.rs rename to src/test/ui/exclusive-drop-and-copy.rs diff --git a/src/test/ui/exclusive-drop-and-copy.stderr b/src/test/ui/exclusive-drop-and-copy.stderr new file mode 100644 index 0000000000000..1c5e62e21a891 --- /dev/null +++ b/src/test/ui/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/exclusive-range/exclusive_range_pattern_syntax_collision.rs similarity index 100% rename from src/test/compile-fail/exclusive_range_pattern_syntax_collision.rs rename to src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.rs diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision.stderr new file mode 100644 index 0000000000000..6ccf7efbb8872 --- /dev/null +++ b/src/test/ui/exclusive-range/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/exclusive-range/exclusive_range_pattern_syntax_collision2.rs similarity index 100% rename from src/test/compile-fail/exclusive_range_pattern_syntax_collision2.rs rename to src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.rs diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision2.stderr new file mode 100644 index 0000000000000..d1863cbfb6fd2 --- /dev/null +++ b/src/test/ui/exclusive-range/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/exclusive-range/exclusive_range_pattern_syntax_collision3.rs similarity index 100% rename from src/test/compile-fail/exclusive_range_pattern_syntax_collision3.rs rename to src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.rs diff --git a/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr b/src/test/ui/exclusive-range/exclusive_range_pattern_syntax_collision3.stderr new file mode 100644 index 0000000000000..21b2d0c5c5713 --- /dev/null +++ b/src/test/ui/exclusive-range/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/expanded-cfg.rs similarity index 100% rename from src/test/compile-fail/expanded-cfg.rs rename to src/test/ui/expanded-cfg.rs diff --git a/src/test/ui/expanded-cfg.stderr b/src/test/ui/expanded-cfg.stderr new file mode 100644 index 0000000000000..d7bc47fad276f --- /dev/null +++ b/src/test/ui/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/explicit/explicit-call-to-dtor.rs similarity index 100% rename from src/test/compile-fail/explicit-call-to-dtor.rs rename to src/test/ui/explicit/explicit-call-to-dtor.rs diff --git a/src/test/ui/explicit/explicit-call-to-dtor.stderr b/src/test/ui/explicit/explicit-call-to-dtor.stderr new file mode 100644 index 0000000000000..264d820042ba7 --- /dev/null +++ b/src/test/ui/explicit/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/explicit/explicit-call-to-supertrait-dtor.rs similarity index 100% rename from src/test/compile-fail/explicit-call-to-supertrait-dtor.rs rename to src/test/ui/explicit/explicit-call-to-supertrait-dtor.rs diff --git a/src/test/ui/explicit/explicit-call-to-supertrait-dtor.stderr b/src/test/ui/explicit/explicit-call-to-supertrait-dtor.stderr new file mode 100644 index 0000000000000..0d0ae629defeb --- /dev/null +++ b/src/test/ui/explicit/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/explicit/explicit-self-lifetime-mismatch.rs similarity index 100% rename from src/test/compile-fail/explicit-self-lifetime-mismatch.rs rename to src/test/ui/explicit/explicit-self-lifetime-mismatch.rs diff --git a/src/test/ui/explicit/explicit-self-lifetime-mismatch.stderr b/src/test/ui/explicit/explicit-self-lifetime-mismatch.stderr new file mode 100644 index 0000000000000..6a22d20467bad --- /dev/null +++ b/src/test/ui/explicit/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/export-fully-qualified.rs similarity index 100% rename from src/test/compile-fail/export-fully-qualified.rs rename to src/test/ui/export-fully-qualified.rs diff --git a/src/test/ui/export-fully-qualified.stderr b/src/test/ui/export-fully-qualified.stderr new file mode 100644 index 0000000000000..b8409929763b6 --- /dev/null +++ b/src/test/ui/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/export-import.rs similarity index 100% rename from src/test/compile-fail/export-import.rs rename to src/test/ui/export-import.rs diff --git a/src/test/ui/export-import.stderr b/src/test/ui/export-import.stderr new file mode 100644 index 0000000000000..2f12485f123b6 --- /dev/null +++ b/src/test/ui/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/export-tag-variant.rs similarity index 100% rename from src/test/compile-fail/export-tag-variant.rs rename to src/test/ui/export-tag-variant.rs diff --git a/src/test/ui/export-tag-variant.stderr b/src/test/ui/export-tag-variant.stderr new file mode 100644 index 0000000000000..da67e2c41990b --- /dev/null +++ b/src/test/ui/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/export.rs similarity index 100% rename from src/test/compile-fail/export.rs rename to src/test/ui/export.rs diff --git a/src/test/ui/export.stderr b/src/test/ui/export.stderr new file mode 100644 index 0000000000000..dd19e83750b5f --- /dev/null +++ b/src/test/ui/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/export2.rs similarity index 100% rename from src/test/compile-fail/export2.rs rename to src/test/ui/export2.rs diff --git a/src/test/ui/export2.stderr b/src/test/ui/export2.stderr new file mode 100644 index 0000000000000..c76afb8a1e2c6 --- /dev/null +++ b/src/test/ui/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/expr_attr_paren_order.rs similarity index 100% rename from src/test/compile-fail/expr_attr_paren_order.rs rename to src/test/ui/expr_attr_paren_order.rs diff --git a/src/test/ui/expr_attr_paren_order.stderr b/src/test/ui/expr_attr_paren_order.stderr new file mode 100644 index 0000000000000..938ff51b37dda --- /dev/null +++ b/src/test/ui/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/ext-nonexistent.rs similarity index 100% rename from src/test/compile-fail/ext-nonexistent.rs rename to src/test/ui/ext-nonexistent.rs diff --git a/src/test/ui/ext-nonexistent.stderr b/src/test/ui/ext-nonexistent.stderr new file mode 100644 index 0000000000000..ff027f1847642 --- /dev/null +++ b/src/test/ui/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/extenv/extenv-arg-2-not-string-literal.rs similarity index 100% rename from src/test/compile-fail/extenv-arg-2-not-string-literal.rs rename to src/test/ui/extenv/extenv-arg-2-not-string-literal.rs diff --git a/src/test/ui/extenv/extenv-arg-2-not-string-literal.stderr b/src/test/ui/extenv/extenv-arg-2-not-string-literal.stderr new file mode 100644 index 0000000000000..4a10deb4bddda --- /dev/null +++ b/src/test/ui/extenv/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/extenv/extenv-no-args.rs similarity index 100% rename from src/test/compile-fail/extenv-no-args.rs rename to src/test/ui/extenv/extenv-no-args.rs diff --git a/src/test/ui/extenv/extenv-no-args.stderr b/src/test/ui/extenv/extenv-no-args.stderr new file mode 100644 index 0000000000000..ebd97c014f1f8 --- /dev/null +++ b/src/test/ui/extenv/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/extenv/extenv-not-defined-custom.rs similarity index 100% rename from src/test/compile-fail/extenv-not-defined-custom.rs rename to src/test/ui/extenv/extenv-not-defined-custom.rs diff --git a/src/test/ui/extenv/extenv-not-defined-custom.stderr b/src/test/ui/extenv/extenv-not-defined-custom.stderr new file mode 100644 index 0000000000000..845f87df91696 --- /dev/null +++ b/src/test/ui/extenv/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/extenv/extenv-not-defined-default.rs similarity index 100% rename from src/test/compile-fail/extenv-not-defined-default.rs rename to src/test/ui/extenv/extenv-not-defined-default.rs diff --git a/src/test/ui/extenv/extenv-not-defined-default.stderr b/src/test/ui/extenv/extenv-not-defined-default.stderr new file mode 100644 index 0000000000000..0db6f536edbd1 --- /dev/null +++ b/src/test/ui/extenv/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/extenv/extenv-not-string-literal.rs similarity index 100% rename from src/test/compile-fail/extenv-not-string-literal.rs rename to src/test/ui/extenv/extenv-not-string-literal.rs diff --git a/src/test/ui/extenv/extenv-not-string-literal.stderr b/src/test/ui/extenv/extenv-not-string-literal.stderr new file mode 100644 index 0000000000000..1660d8665dc39 --- /dev/null +++ b/src/test/ui/extenv/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/extenv/extenv-too-many-args.rs similarity index 100% rename from src/test/compile-fail/extenv-too-many-args.rs rename to src/test/ui/extenv/extenv-too-many-args.rs diff --git a/src/test/ui/extenv/extenv-too-many-args.stderr b/src/test/ui/extenv/extenv-too-many-args.stderr new file mode 100644 index 0000000000000..e4eda9e9e9ab3 --- /dev/null +++ b/src/test/ui/extenv/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/ui/auxiliary/m1.rs b/src/test/ui/extern/auxiliary/m1.rs similarity index 100% rename from src/test/ui/auxiliary/m1.rs rename to src/test/ui/extern/auxiliary/m1.rs diff --git a/src/test/ui/auxiliary/m2.rs b/src/test/ui/extern/auxiliary/m2.rs similarity index 100% rename from src/test/ui/auxiliary/m2.rs rename to src/test/ui/extern/auxiliary/m2.rs diff --git a/src/test/ui/extern-const.fixed b/src/test/ui/extern/extern-const.fixed similarity index 100% rename from src/test/ui/extern-const.fixed rename to src/test/ui/extern/extern-const.fixed diff --git a/src/test/ui/extern-const.rs b/src/test/ui/extern/extern-const.rs similarity index 100% rename from src/test/ui/extern-const.rs rename to src/test/ui/extern/extern-const.rs diff --git a/src/test/ui/extern-const.stderr b/src/test/ui/extern/extern-const.stderr similarity index 100% rename from src/test/ui/extern-const.stderr rename to src/test/ui/extern/extern-const.stderr diff --git a/src/test/ui/extern-crate-rename.rs b/src/test/ui/extern/extern-crate-rename.rs similarity index 100% rename from src/test/ui/extern-crate-rename.rs rename to src/test/ui/extern/extern-crate-rename.rs diff --git a/src/test/ui/extern-crate-rename.stderr b/src/test/ui/extern/extern-crate-rename.stderr similarity index 100% rename from src/test/ui/extern-crate-rename.stderr rename to src/test/ui/extern/extern-crate-rename.stderr diff --git a/src/test/compile-fail/extern-crate-visibility.rs b/src/test/ui/extern/extern-crate-visibility.rs similarity index 100% rename from src/test/compile-fail/extern-crate-visibility.rs rename to src/test/ui/extern/extern-crate-visibility.rs diff --git a/src/test/ui/extern/extern-crate-visibility.stderr b/src/test/ui/extern/extern-crate-visibility.stderr new file mode 100644 index 0000000000000..cadb636bf0d97 --- /dev/null +++ b/src/test/ui/extern/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/extern/extern-macro.rs similarity index 100% rename from src/test/compile-fail/extern-macro.rs rename to src/test/ui/extern/extern-macro.rs diff --git a/src/test/ui/extern/extern-macro.stderr b/src/test/ui/extern/extern-macro.stderr new file mode 100644 index 0000000000000..8918ac3143b1b --- /dev/null +++ b/src/test/ui/extern/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/extern/extern-main-fn.rs similarity index 100% rename from src/test/compile-fail/extern-main-fn.rs rename to src/test/ui/extern/extern-main-fn.rs diff --git a/src/test/ui/extern/extern-main-fn.stderr b/src/test/ui/extern/extern-main-fn.stderr new file mode 100644 index 0000000000000..24e9d138693e4 --- /dev/null +++ b/src/test/ui/extern/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/extern/extern-types-distinct-types.rs similarity index 100% rename from src/test/compile-fail/extern-types-distinct-types.rs rename to src/test/ui/extern/extern-types-distinct-types.rs diff --git a/src/test/ui/extern/extern-types-distinct-types.stderr b/src/test/ui/extern/extern-types-distinct-types.stderr new file mode 100644 index 0000000000000..6c74f63744ff9 --- /dev/null +++ b/src/test/ui/extern/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/extern/extern-types-not-sync-send.rs similarity index 100% rename from src/test/compile-fail/extern-types-not-sync-send.rs rename to src/test/ui/extern/extern-types-not-sync-send.rs diff --git a/src/test/ui/extern/extern-types-not-sync-send.stderr b/src/test/ui/extern/extern-types-not-sync-send.stderr new file mode 100644 index 0000000000000..f076aa0fd6817 --- /dev/null +++ b/src/test/ui/extern/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` 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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `A` cannot be sent between threads safely + --> $DIR/extern-types-not-sync-send.rs:26:5 + | +LL | assert_send::(); + | ^^^^^^^^^^^^^^^^ `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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/extern/extern-types-unsized.rs similarity index 100% rename from src/test/compile-fail/extern-types-unsized.rs rename to src/test/ui/extern/extern-types-unsized.rs diff --git a/src/test/ui/extern/extern-types-unsized.stderr b/src/test/ui/extern/extern-types-unsized.stderr new file mode 100644 index 0000000000000..19df7bdd347aa --- /dev/null +++ b/src/test/ui/extern/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::(); + | ^^^^^^^^^^^^^^^^^ 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 +note: required by `assert_sized` + --> $DIR/extern-types-unsized.rs:29:1 + | +LL | fn assert_sized() { } + | ^^^^^^^^^^^^^^^^^^^^ + +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::(); + | ^^^^^^^^^^^^^^^^^^^ 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 + = 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() { } + | ^^^^^^^^^^^^^^^^^^^^ + +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::>(); + | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Bar`, the trait `std::marker::Sized` is not implemented for `A` + = note: to learn more, visit + = note: required because it appears within the type `Bar` +note: required by `assert_sized` + --> $DIR/extern-types-unsized.rs:29:1 + | +LL | fn assert_sized() { } + | ^^^^^^^^^^^^^^^^^^^^ + +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::>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Bar>`, the trait `std::marker::Sized` is not implemented for `A` + = note: to learn more, visit + = note: required because it appears within the type `Bar` + = note: required because it appears within the type `Bar>` +note: required by `assert_sized` + --> $DIR/extern-types-unsized.rs:29:1 + | +LL | fn assert_sized() { } + | ^^^^^^^^^^^^^^^^^^^^ + +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/extern/extern-with-type-bounds.rs similarity index 100% rename from src/test/compile-fail/extern-with-type-bounds.rs rename to src/test/ui/extern/extern-with-type-bounds.rs diff --git a/src/test/ui/extern/extern-with-type-bounds.stderr b/src/test/ui/extern/extern-with-type-bounds.stderr new file mode 100644 index 0000000000000..4b62a12d36b97 --- /dev/null +++ b/src/test/ui/extern/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() -> 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/extern/extern-wrong-value-type.rs similarity index 100% rename from src/test/compile-fail/extern-wrong-value-type.rs rename to src/test/ui/extern/extern-wrong-value-type.rs diff --git a/src/test/ui/extern/extern-wrong-value-type.stderr b/src/test/ui/extern/extern-wrong-value-type.stderr new file mode 100644 index 0000000000000..35e0d68e46aa8 --- /dev/null +++ b/src/test/ui/extern/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) 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/extern/external-doc-error.rs similarity index 82% rename from src/test/compile-fail/external-doc-error.rs rename to src/test/ui/extern/external-doc-error.rs index 1ae0d0bd2760a..2cd17804e06ca 100644 --- a/src/test/compile-fail/external-doc-error.rs +++ b/src/test/ui/extern/external-doc-error.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test: "The system cannot find the file specified\." -> "No such file or directory" +// ignore-tidy-linelength + #![feature(external_doc)] #[doc(include = "not-a-file.md")] //~ ERROR: couldn't read diff --git a/src/test/ui/extern/external-doc-error.stderr b/src/test/ui/extern/external-doc-error.stderr new file mode 100644 index 0000000000000..98ade5de7f3a7 --- /dev/null +++ b/src/test/ui/extern/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:16: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/extoption_env-no-args.rs similarity index 100% rename from src/test/compile-fail/extoption_env-no-args.rs rename to src/test/ui/extoption_env-no-args.rs diff --git a/src/test/ui/extoption_env-no-args.stderr b/src/test/ui/extoption_env-no-args.stderr new file mode 100644 index 0000000000000..d01aefe46b10e --- /dev/null +++ b/src/test/ui/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/extoption_env-not-string-literal.rs similarity index 100% rename from src/test/compile-fail/extoption_env-not-string-literal.rs rename to src/test/ui/extoption_env-not-string-literal.rs diff --git a/src/test/ui/extoption_env-not-string-literal.stderr b/src/test/ui/extoption_env-not-string-literal.stderr new file mode 100644 index 0000000000000..af4163259ea85 --- /dev/null +++ b/src/test/ui/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/extoption_env-too-many-args.rs similarity index 100% rename from src/test/compile-fail/extoption_env-too-many-args.rs rename to src/test/ui/extoption_env-too-many-args.rs diff --git a/src/test/ui/extoption_env-too-many-args.stderr b/src/test/ui/extoption_env-too-many-args.stderr new file mode 100644 index 0000000000000..0e4569d7a0199 --- /dev/null +++ b/src/test/ui/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/fail-no-dead-code-core.rs similarity index 100% rename from src/test/compile-fail/fail-no-dead-code-core.rs rename to src/test/ui/fail-no-dead-code-core.rs diff --git a/src/test/ui/fail-no-dead-code-core.stderr b/src/test/ui/fail-no-dead-code-core.stderr new file mode 100644 index 0000000000000..d2af77a28d348 --- /dev/null +++ b/src/test/ui/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/fail-no-dead-code.rs similarity index 100% rename from src/test/compile-fail/fail-no-dead-code.rs rename to src/test/ui/fail-no-dead-code.rs diff --git a/src/test/ui/fail-no-dead-code.stderr b/src/test/ui/fail-no-dead-code.stderr new file mode 100644 index 0000000000000..f355c7dd731db --- /dev/null +++ b/src/test/ui/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/fail-simple.rs similarity index 100% rename from src/test/compile-fail/fail-simple.rs rename to src/test/ui/fail-simple.rs diff --git a/src/test/ui/fail-simple.stderr b/src/test/ui/fail-simple.stderr new file mode 100644 index 0000000000000..764f2c464bcb8 --- /dev/null +++ b/src/test/ui/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-gated-feature-in-macro-arg.rs b/src/test/ui/feature-gated-feature-in-macro-arg.rs similarity index 100% rename from src/test/compile-fail/feature-gated-feature-in-macro-arg.rs rename to src/test/ui/feature-gated-feature-in-macro-arg.rs diff --git a/src/test/ui/feature-gated-feature-in-macro-arg.stderr b/src/test/ui/feature-gated-feature-in-macro-arg.stderr new file mode 100644 index 0000000000000..41b3e3eaf10dc --- /dev/null +++ b/src/test/ui/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/ui/auxiliary/cfg-target-thread-local.rs b/src/test/ui/feature-gates/auxiliary/cfg-target-thread-local.rs similarity index 100% rename from src/test/ui/auxiliary/cfg-target-thread-local.rs rename to src/test/ui/feature-gates/auxiliary/cfg-target-thread-local.rs diff --git a/src/test/ui/feature-gate-abi-msp430-interrupt.rs b/src/test/ui/feature-gates/feature-gate-abi-msp430-interrupt.rs similarity index 100% rename from src/test/ui/feature-gate-abi-msp430-interrupt.rs rename to src/test/ui/feature-gates/feature-gate-abi-msp430-interrupt.rs diff --git a/src/test/ui/feature-gate-abi-msp430-interrupt.stderr b/src/test/ui/feature-gates/feature-gate-abi-msp430-interrupt.stderr similarity index 100% rename from src/test/ui/feature-gate-abi-msp430-interrupt.stderr rename to src/test/ui/feature-gates/feature-gate-abi-msp430-interrupt.stderr diff --git a/src/test/ui/feature-gate-abi.rs b/src/test/ui/feature-gates/feature-gate-abi.rs similarity index 100% rename from src/test/ui/feature-gate-abi.rs rename to src/test/ui/feature-gates/feature-gate-abi.rs diff --git a/src/test/ui/feature-gate-abi.stderr b/src/test/ui/feature-gates/feature-gate-abi.stderr similarity index 100% rename from src/test/ui/feature-gate-abi.stderr rename to src/test/ui/feature-gates/feature-gate-abi.stderr diff --git a/src/test/ui/feature-gate-abi_unadjusted.rs b/src/test/ui/feature-gates/feature-gate-abi_unadjusted.rs similarity index 100% rename from src/test/ui/feature-gate-abi_unadjusted.rs rename to src/test/ui/feature-gates/feature-gate-abi_unadjusted.rs diff --git a/src/test/ui/feature-gate-abi_unadjusted.stderr b/src/test/ui/feature-gates/feature-gate-abi_unadjusted.stderr similarity index 100% rename from src/test/ui/feature-gate-abi_unadjusted.stderr rename to src/test/ui/feature-gates/feature-gate-abi_unadjusted.stderr diff --git a/src/test/compile-fail/feature-gate-alloc-error-handler.rs b/src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs similarity index 100% rename from src/test/compile-fail/feature-gate-alloc-error-handler.rs rename to src/test/ui/feature-gates/feature-gate-alloc-error-handler.rs diff --git a/src/test/ui/feature-gates/feature-gate-alloc-error-handler.stderr b/src/test/ui/feature-gates/feature-gate-alloc-error-handler.stderr new file mode 100644 index 0000000000000..255d5b06c1768 --- /dev/null +++ b/src/test/ui/feature-gates/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/ui/feature-gate-allocator_internals.rs b/src/test/ui/feature-gates/feature-gate-allocator_internals.rs similarity index 100% rename from src/test/ui/feature-gate-allocator_internals.rs rename to src/test/ui/feature-gates/feature-gate-allocator_internals.rs diff --git a/src/test/ui/feature-gate-allocator_internals.stderr b/src/test/ui/feature-gates/feature-gate-allocator_internals.stderr similarity index 100% rename from src/test/ui/feature-gate-allocator_internals.stderr rename to src/test/ui/feature-gates/feature-gate-allocator_internals.stderr diff --git a/src/test/ui/feature-gate-allow-internal-unsafe-nested-macro.rs b/src/test/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.rs similarity index 100% rename from src/test/ui/feature-gate-allow-internal-unsafe-nested-macro.rs rename to src/test/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.rs diff --git a/src/test/ui/feature-gate-allow-internal-unsafe-nested-macro.stderr b/src/test/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr similarity index 100% rename from src/test/ui/feature-gate-allow-internal-unsafe-nested-macro.stderr rename to src/test/ui/feature-gates/feature-gate-allow-internal-unsafe-nested-macro.stderr diff --git a/src/test/ui/feature-gate-allow-internal-unstable-nested-macro.rs b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.rs similarity index 100% rename from src/test/ui/feature-gate-allow-internal-unstable-nested-macro.rs rename to src/test/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.rs diff --git a/src/test/ui/feature-gate-allow-internal-unstable-nested-macro.stderr b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr similarity index 100% rename from src/test/ui/feature-gate-allow-internal-unstable-nested-macro.stderr rename to src/test/ui/feature-gates/feature-gate-allow-internal-unstable-nested-macro.stderr diff --git a/src/test/ui/feature-gate-allow-internal-unstable-struct.rs b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs similarity index 100% rename from src/test/ui/feature-gate-allow-internal-unstable-struct.rs rename to src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.rs diff --git a/src/test/ui/feature-gate-allow-internal-unstable-struct.stderr b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr similarity index 100% rename from src/test/ui/feature-gate-allow-internal-unstable-struct.stderr rename to src/test/ui/feature-gates/feature-gate-allow-internal-unstable-struct.stderr diff --git a/src/test/ui/feature-gate-allow-internal-unstable.rs b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable.rs similarity index 100% rename from src/test/ui/feature-gate-allow-internal-unstable.rs rename to src/test/ui/feature-gates/feature-gate-allow-internal-unstable.rs diff --git a/src/test/ui/feature-gate-allow-internal-unstable.stderr b/src/test/ui/feature-gates/feature-gate-allow-internal-unstable.stderr similarity index 100% rename from src/test/ui/feature-gate-allow-internal-unstable.stderr rename to src/test/ui/feature-gates/feature-gate-allow-internal-unstable.stderr diff --git a/src/test/ui/feature-gate-allow_fail.rs b/src/test/ui/feature-gates/feature-gate-allow_fail.rs similarity index 100% rename from src/test/ui/feature-gate-allow_fail.rs rename to src/test/ui/feature-gates/feature-gate-allow_fail.rs diff --git a/src/test/ui/feature-gate-allow_fail.stderr b/src/test/ui/feature-gates/feature-gate-allow_fail.stderr similarity index 100% rename from src/test/ui/feature-gate-allow_fail.stderr rename to src/test/ui/feature-gates/feature-gate-allow_fail.stderr diff --git a/src/test/ui/feature-gate-arbitrary-self-types.rs b/src/test/ui/feature-gates/feature-gate-arbitrary-self-types.rs similarity index 100% rename from src/test/ui/feature-gate-arbitrary-self-types.rs rename to src/test/ui/feature-gates/feature-gate-arbitrary-self-types.rs diff --git a/src/test/ui/feature-gate-arbitrary-self-types.stderr b/src/test/ui/feature-gates/feature-gate-arbitrary-self-types.stderr similarity index 100% rename from src/test/ui/feature-gate-arbitrary-self-types.stderr rename to src/test/ui/feature-gates/feature-gate-arbitrary-self-types.stderr diff --git a/src/test/ui/feature-gate-arbitrary_self_types-raw-pointer.rs b/src/test/ui/feature-gates/feature-gate-arbitrary_self_types-raw-pointer.rs similarity index 100% rename from src/test/ui/feature-gate-arbitrary_self_types-raw-pointer.rs rename to src/test/ui/feature-gates/feature-gate-arbitrary_self_types-raw-pointer.rs diff --git a/src/test/ui/feature-gate-arbitrary_self_types-raw-pointer.stderr b/src/test/ui/feature-gates/feature-gate-arbitrary_self_types-raw-pointer.stderr similarity index 100% rename from src/test/ui/feature-gate-arbitrary_self_types-raw-pointer.stderr rename to src/test/ui/feature-gates/feature-gate-arbitrary_self_types-raw-pointer.stderr diff --git a/src/test/ui/feature-gate-asm.rs b/src/test/ui/feature-gates/feature-gate-asm.rs similarity index 100% rename from src/test/ui/feature-gate-asm.rs rename to src/test/ui/feature-gates/feature-gate-asm.rs diff --git a/src/test/ui/feature-gate-asm.stderr b/src/test/ui/feature-gates/feature-gate-asm.stderr similarity index 100% rename from src/test/ui/feature-gate-asm.stderr rename to src/test/ui/feature-gates/feature-gate-asm.stderr diff --git a/src/test/ui/feature-gate-asm2.rs b/src/test/ui/feature-gates/feature-gate-asm2.rs similarity index 100% rename from src/test/ui/feature-gate-asm2.rs rename to src/test/ui/feature-gates/feature-gate-asm2.rs diff --git a/src/test/ui/feature-gate-asm2.stderr b/src/test/ui/feature-gates/feature-gate-asm2.stderr similarity index 100% rename from src/test/ui/feature-gate-asm2.stderr rename to src/test/ui/feature-gates/feature-gate-asm2.stderr diff --git a/src/test/ui/feature-gate-assoc-type-defaults.rs b/src/test/ui/feature-gates/feature-gate-assoc-type-defaults.rs similarity index 100% rename from src/test/ui/feature-gate-assoc-type-defaults.rs rename to src/test/ui/feature-gates/feature-gate-assoc-type-defaults.rs diff --git a/src/test/ui/feature-gate-assoc-type-defaults.stderr b/src/test/ui/feature-gates/feature-gate-assoc-type-defaults.stderr similarity index 100% rename from src/test/ui/feature-gate-assoc-type-defaults.stderr rename to src/test/ui/feature-gates/feature-gate-assoc-type-defaults.stderr diff --git a/src/test/ui/feature-gate-async-await-2015-edition.rs b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs similarity index 100% rename from src/test/ui/feature-gate-async-await-2015-edition.rs rename to src/test/ui/feature-gates/feature-gate-async-await-2015-edition.rs diff --git a/src/test/ui/feature-gate-async-await-2015-edition.stderr b/src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr similarity index 100% rename from src/test/ui/feature-gate-async-await-2015-edition.stderr rename to src/test/ui/feature-gates/feature-gate-async-await-2015-edition.stderr diff --git a/src/test/ui/feature-gate-async-await.rs b/src/test/ui/feature-gates/feature-gate-async-await.rs similarity index 100% rename from src/test/ui/feature-gate-async-await.rs rename to src/test/ui/feature-gates/feature-gate-async-await.rs diff --git a/src/test/ui/feature-gate-async-await.stderr b/src/test/ui/feature-gates/feature-gate-async-await.stderr similarity index 100% rename from src/test/ui/feature-gate-async-await.stderr rename to src/test/ui/feature-gates/feature-gate-async-await.stderr diff --git a/src/test/ui/feature-gate-box-expr.rs b/src/test/ui/feature-gates/feature-gate-box-expr.rs similarity index 100% rename from src/test/ui/feature-gate-box-expr.rs rename to src/test/ui/feature-gates/feature-gate-box-expr.rs diff --git a/src/test/ui/feature-gate-box-expr.stderr b/src/test/ui/feature-gates/feature-gate-box-expr.stderr similarity index 100% rename from src/test/ui/feature-gate-box-expr.stderr rename to src/test/ui/feature-gates/feature-gate-box-expr.stderr diff --git a/src/test/ui/feature-gate-box_patterns.rs b/src/test/ui/feature-gates/feature-gate-box_patterns.rs similarity index 100% rename from src/test/ui/feature-gate-box_patterns.rs rename to src/test/ui/feature-gates/feature-gate-box_patterns.rs diff --git a/src/test/ui/feature-gate-box_patterns.stderr b/src/test/ui/feature-gates/feature-gate-box_patterns.stderr similarity index 100% rename from src/test/ui/feature-gate-box_patterns.stderr rename to src/test/ui/feature-gates/feature-gate-box_patterns.stderr diff --git a/src/test/ui/feature-gate-box_syntax.rs b/src/test/ui/feature-gates/feature-gate-box_syntax.rs similarity index 100% rename from src/test/ui/feature-gate-box_syntax.rs rename to src/test/ui/feature-gates/feature-gate-box_syntax.rs diff --git a/src/test/ui/feature-gate-box_syntax.stderr b/src/test/ui/feature-gates/feature-gate-box_syntax.stderr similarity index 100% rename from src/test/ui/feature-gate-box_syntax.stderr rename to src/test/ui/feature-gates/feature-gate-box_syntax.stderr diff --git a/src/test/ui/feature-gate-catch_expr.rs b/src/test/ui/feature-gates/feature-gate-catch_expr.rs similarity index 100% rename from src/test/ui/feature-gate-catch_expr.rs rename to src/test/ui/feature-gates/feature-gate-catch_expr.rs diff --git a/src/test/ui/feature-gate-catch_expr.stderr b/src/test/ui/feature-gates/feature-gate-catch_expr.stderr similarity index 100% rename from src/test/ui/feature-gate-catch_expr.stderr rename to src/test/ui/feature-gates/feature-gate-catch_expr.stderr diff --git a/src/test/ui/feature-gate-cfg-target-has-atomic.rs b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs similarity index 100% rename from src/test/ui/feature-gate-cfg-target-has-atomic.rs rename to src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.rs diff --git a/src/test/ui/feature-gate-cfg-target-has-atomic.stderr b/src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr similarity index 100% rename from src/test/ui/feature-gate-cfg-target-has-atomic.stderr rename to src/test/ui/feature-gates/feature-gate-cfg-target-has-atomic.stderr diff --git a/src/test/ui/feature-gate-cfg-target-thread-local.rs b/src/test/ui/feature-gates/feature-gate-cfg-target-thread-local.rs similarity index 100% rename from src/test/ui/feature-gate-cfg-target-thread-local.rs rename to src/test/ui/feature-gates/feature-gate-cfg-target-thread-local.rs diff --git a/src/test/ui/feature-gate-cfg-target-thread-local.stderr b/src/test/ui/feature-gates/feature-gate-cfg-target-thread-local.stderr similarity index 100% rename from src/test/ui/feature-gate-cfg-target-thread-local.stderr rename to src/test/ui/feature-gates/feature-gate-cfg-target-thread-local.stderr diff --git a/src/test/ui/feature-gate-cfg-target-vendor.rs b/src/test/ui/feature-gates/feature-gate-cfg-target-vendor.rs similarity index 100% rename from src/test/ui/feature-gate-cfg-target-vendor.rs rename to src/test/ui/feature-gates/feature-gate-cfg-target-vendor.rs diff --git a/src/test/ui/feature-gate-cfg-target-vendor.stderr b/src/test/ui/feature-gates/feature-gate-cfg-target-vendor.stderr similarity index 100% rename from src/test/ui/feature-gate-cfg-target-vendor.stderr rename to src/test/ui/feature-gates/feature-gate-cfg-target-vendor.stderr diff --git a/src/test/ui/feature-gate-compiler-builtins.rs b/src/test/ui/feature-gates/feature-gate-compiler-builtins.rs similarity index 100% rename from src/test/ui/feature-gate-compiler-builtins.rs rename to src/test/ui/feature-gates/feature-gate-compiler-builtins.rs diff --git a/src/test/ui/feature-gate-compiler-builtins.stderr b/src/test/ui/feature-gates/feature-gate-compiler-builtins.stderr similarity index 100% rename from src/test/ui/feature-gate-compiler-builtins.stderr rename to src/test/ui/feature-gates/feature-gate-compiler-builtins.stderr diff --git a/src/test/ui/feature-gate-concat_idents.rs b/src/test/ui/feature-gates/feature-gate-concat_idents.rs similarity index 100% rename from src/test/ui/feature-gate-concat_idents.rs rename to src/test/ui/feature-gates/feature-gate-concat_idents.rs diff --git a/src/test/ui/feature-gate-concat_idents.stderr b/src/test/ui/feature-gates/feature-gate-concat_idents.stderr similarity index 100% rename from src/test/ui/feature-gate-concat_idents.stderr rename to src/test/ui/feature-gates/feature-gate-concat_idents.stderr diff --git a/src/test/ui/feature-gate-concat_idents2.rs b/src/test/ui/feature-gates/feature-gate-concat_idents2.rs similarity index 100% rename from src/test/ui/feature-gate-concat_idents2.rs rename to src/test/ui/feature-gates/feature-gate-concat_idents2.rs diff --git a/src/test/ui/feature-gate-concat_idents2.stderr b/src/test/ui/feature-gates/feature-gate-concat_idents2.stderr similarity index 100% rename from src/test/ui/feature-gate-concat_idents2.stderr rename to src/test/ui/feature-gates/feature-gate-concat_idents2.stderr diff --git a/src/test/ui/feature-gate-concat_idents3.rs b/src/test/ui/feature-gates/feature-gate-concat_idents3.rs similarity index 100% rename from src/test/ui/feature-gate-concat_idents3.rs rename to src/test/ui/feature-gates/feature-gate-concat_idents3.rs diff --git a/src/test/ui/feature-gate-concat_idents3.stderr b/src/test/ui/feature-gates/feature-gate-concat_idents3.stderr similarity index 100% rename from src/test/ui/feature-gate-concat_idents3.stderr rename to src/test/ui/feature-gates/feature-gate-concat_idents3.stderr diff --git a/src/test/ui/feature-gate-const-indexing.rs b/src/test/ui/feature-gates/feature-gate-const-indexing.rs similarity index 100% rename from src/test/ui/feature-gate-const-indexing.rs rename to src/test/ui/feature-gates/feature-gate-const-indexing.rs diff --git a/src/test/ui/feature-gate-const_fn.rs b/src/test/ui/feature-gates/feature-gate-const_fn.rs similarity index 100% rename from src/test/ui/feature-gate-const_fn.rs rename to src/test/ui/feature-gates/feature-gate-const_fn.rs diff --git a/src/test/ui/feature-gate-const_fn.stderr b/src/test/ui/feature-gates/feature-gate-const_fn.stderr similarity index 100% rename from src/test/ui/feature-gate-const_fn.stderr rename to src/test/ui/feature-gates/feature-gate-const_fn.stderr diff --git a/src/test/ui/feature-gate-const_let.rs b/src/test/ui/feature-gates/feature-gate-const_let.rs similarity index 100% rename from src/test/ui/feature-gate-const_let.rs rename to src/test/ui/feature-gates/feature-gate-const_let.rs diff --git a/src/test/ui/feature-gate-const_let.stderr b/src/test/ui/feature-gates/feature-gate-const_let.stderr similarity index 100% rename from src/test/ui/feature-gate-const_let.stderr rename to src/test/ui/feature-gates/feature-gate-const_let.stderr diff --git a/src/test/ui/feature-gate-crate_in_paths.rs b/src/test/ui/feature-gates/feature-gate-crate_in_paths.rs similarity index 100% rename from src/test/ui/feature-gate-crate_in_paths.rs rename to src/test/ui/feature-gates/feature-gate-crate_in_paths.rs diff --git a/src/test/ui/feature-gate-crate_in_paths.stderr b/src/test/ui/feature-gates/feature-gate-crate_in_paths.stderr similarity index 100% rename from src/test/ui/feature-gate-crate_in_paths.stderr rename to src/test/ui/feature-gates/feature-gate-crate_in_paths.stderr diff --git a/src/test/ui/feature-gate-crate_visibility_modifier.rs b/src/test/ui/feature-gates/feature-gate-crate_visibility_modifier.rs similarity index 100% rename from src/test/ui/feature-gate-crate_visibility_modifier.rs rename to src/test/ui/feature-gates/feature-gate-crate_visibility_modifier.rs diff --git a/src/test/ui/feature-gate-crate_visibility_modifier.stderr b/src/test/ui/feature-gates/feature-gate-crate_visibility_modifier.stderr similarity index 100% rename from src/test/ui/feature-gate-crate_visibility_modifier.stderr rename to src/test/ui/feature-gates/feature-gate-crate_visibility_modifier.stderr diff --git a/src/test/ui/feature-gate-custom_attribute.rs b/src/test/ui/feature-gates/feature-gate-custom_attribute.rs similarity index 100% rename from src/test/ui/feature-gate-custom_attribute.rs rename to src/test/ui/feature-gates/feature-gate-custom_attribute.rs diff --git a/src/test/ui/feature-gate-custom_attribute.stderr b/src/test/ui/feature-gates/feature-gate-custom_attribute.stderr similarity index 100% rename from src/test/ui/feature-gate-custom_attribute.stderr rename to src/test/ui/feature-gates/feature-gate-custom_attribute.stderr diff --git a/src/test/ui/feature-gate-custom_attribute2.rs b/src/test/ui/feature-gates/feature-gate-custom_attribute2.rs similarity index 100% rename from src/test/ui/feature-gate-custom_attribute2.rs rename to src/test/ui/feature-gates/feature-gate-custom_attribute2.rs diff --git a/src/test/ui/feature-gate-custom_attribute2.stderr b/src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr similarity index 100% rename from src/test/ui/feature-gate-custom_attribute2.stderr rename to src/test/ui/feature-gates/feature-gate-custom_attribute2.stderr diff --git a/src/test/ui/feature-gate-custom_derive.rs b/src/test/ui/feature-gates/feature-gate-custom_derive.rs similarity index 100% rename from src/test/ui/feature-gate-custom_derive.rs rename to src/test/ui/feature-gates/feature-gate-custom_derive.rs diff --git a/src/test/ui/feature-gate-custom_derive.stderr b/src/test/ui/feature-gates/feature-gate-custom_derive.stderr similarity index 100% rename from src/test/ui/feature-gate-custom_derive.stderr rename to src/test/ui/feature-gates/feature-gate-custom_derive.stderr diff --git a/src/test/ui/feature-gate-decl_macro.rs b/src/test/ui/feature-gates/feature-gate-decl_macro.rs similarity index 100% rename from src/test/ui/feature-gate-decl_macro.rs rename to src/test/ui/feature-gates/feature-gate-decl_macro.rs diff --git a/src/test/ui/feature-gate-decl_macro.stderr b/src/test/ui/feature-gates/feature-gate-decl_macro.stderr similarity index 100% rename from src/test/ui/feature-gate-decl_macro.stderr rename to src/test/ui/feature-gates/feature-gate-decl_macro.stderr diff --git a/src/test/ui/feature-gate-default_type_parameter_fallback.rs b/src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.rs similarity index 100% rename from src/test/ui/feature-gate-default_type_parameter_fallback.rs rename to src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.rs diff --git a/src/test/ui/feature-gate-default_type_parameter_fallback.stderr b/src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr similarity index 100% rename from src/test/ui/feature-gate-default_type_parameter_fallback.stderr rename to src/test/ui/feature-gates/feature-gate-default_type_parameter_fallback.stderr diff --git a/src/test/ui/feature-gate-doc_alias.rs b/src/test/ui/feature-gates/feature-gate-doc_alias.rs similarity index 100% rename from src/test/ui/feature-gate-doc_alias.rs rename to src/test/ui/feature-gates/feature-gate-doc_alias.rs diff --git a/src/test/ui/feature-gate-doc_alias.stderr b/src/test/ui/feature-gates/feature-gate-doc_alias.stderr similarity index 100% rename from src/test/ui/feature-gate-doc_alias.stderr rename to src/test/ui/feature-gates/feature-gate-doc_alias.stderr diff --git a/src/test/ui/feature-gate-doc_cfg.rs b/src/test/ui/feature-gates/feature-gate-doc_cfg.rs similarity index 100% rename from src/test/ui/feature-gate-doc_cfg.rs rename to src/test/ui/feature-gates/feature-gate-doc_cfg.rs diff --git a/src/test/ui/feature-gate-doc_cfg.stderr b/src/test/ui/feature-gates/feature-gate-doc_cfg.stderr similarity index 100% rename from src/test/ui/feature-gate-doc_cfg.stderr rename to src/test/ui/feature-gates/feature-gate-doc_cfg.stderr diff --git a/src/test/ui/feature-gate-doc_keyword.rs b/src/test/ui/feature-gates/feature-gate-doc_keyword.rs similarity index 100% rename from src/test/ui/feature-gate-doc_keyword.rs rename to src/test/ui/feature-gates/feature-gate-doc_keyword.rs diff --git a/src/test/ui/feature-gate-doc_keyword.stderr b/src/test/ui/feature-gates/feature-gate-doc_keyword.stderr similarity index 100% rename from src/test/ui/feature-gate-doc_keyword.stderr rename to src/test/ui/feature-gates/feature-gate-doc_keyword.stderr diff --git a/src/test/ui/feature-gate-doc_masked.rs b/src/test/ui/feature-gates/feature-gate-doc_masked.rs similarity index 100% rename from src/test/ui/feature-gate-doc_masked.rs rename to src/test/ui/feature-gates/feature-gate-doc_masked.rs diff --git a/src/test/ui/feature-gate-doc_masked.stderr b/src/test/ui/feature-gates/feature-gate-doc_masked.stderr similarity index 100% rename from src/test/ui/feature-gate-doc_masked.stderr rename to src/test/ui/feature-gates/feature-gate-doc_masked.stderr diff --git a/src/test/ui/feature-gate-doc_spotlight.rs b/src/test/ui/feature-gates/feature-gate-doc_spotlight.rs similarity index 100% rename from src/test/ui/feature-gate-doc_spotlight.rs rename to src/test/ui/feature-gates/feature-gate-doc_spotlight.rs diff --git a/src/test/ui/feature-gate-doc_spotlight.stderr b/src/test/ui/feature-gates/feature-gate-doc_spotlight.stderr similarity index 100% rename from src/test/ui/feature-gate-doc_spotlight.stderr rename to src/test/ui/feature-gates/feature-gate-doc_spotlight.stderr diff --git a/src/test/ui/feature-gate-dropck-ugeh-2.rs b/src/test/ui/feature-gates/feature-gate-dropck-ugeh-2.rs similarity index 100% rename from src/test/ui/feature-gate-dropck-ugeh-2.rs rename to src/test/ui/feature-gates/feature-gate-dropck-ugeh-2.rs diff --git a/src/test/ui/feature-gate-dropck-ugeh-2.stderr b/src/test/ui/feature-gates/feature-gate-dropck-ugeh-2.stderr similarity index 100% rename from src/test/ui/feature-gate-dropck-ugeh-2.stderr rename to src/test/ui/feature-gates/feature-gate-dropck-ugeh-2.stderr diff --git a/src/test/ui/feature-gate-dropck-ugeh.rs b/src/test/ui/feature-gates/feature-gate-dropck-ugeh.rs similarity index 100% rename from src/test/ui/feature-gate-dropck-ugeh.rs rename to src/test/ui/feature-gates/feature-gate-dropck-ugeh.rs diff --git a/src/test/ui/feature-gate-dropck-ugeh.stderr b/src/test/ui/feature-gates/feature-gate-dropck-ugeh.stderr similarity index 100% rename from src/test/ui/feature-gate-dropck-ugeh.stderr rename to src/test/ui/feature-gates/feature-gate-dropck-ugeh.stderr diff --git a/src/test/ui/feature-gate-exclusive-range-pattern.rs b/src/test/ui/feature-gates/feature-gate-exclusive-range-pattern.rs similarity index 100% rename from src/test/ui/feature-gate-exclusive-range-pattern.rs rename to src/test/ui/feature-gates/feature-gate-exclusive-range-pattern.rs diff --git a/src/test/ui/feature-gate-exclusive-range-pattern.stderr b/src/test/ui/feature-gates/feature-gate-exclusive-range-pattern.stderr similarity index 100% rename from src/test/ui/feature-gate-exclusive-range-pattern.stderr rename to src/test/ui/feature-gates/feature-gate-exclusive-range-pattern.stderr diff --git a/src/test/ui/feature-gate-exhaustive-patterns.rs b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs similarity index 100% rename from src/test/ui/feature-gate-exhaustive-patterns.rs rename to src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs diff --git a/src/test/ui/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr similarity index 100% rename from src/test/ui/feature-gate-exhaustive-patterns.stderr rename to src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr diff --git a/src/test/ui/feature-gate-existential-type.rs b/src/test/ui/feature-gates/feature-gate-existential-type.rs similarity index 100% rename from src/test/ui/feature-gate-existential-type.rs rename to src/test/ui/feature-gates/feature-gate-existential-type.rs diff --git a/src/test/ui/feature-gate-existential-type.stderr b/src/test/ui/feature-gates/feature-gate-existential-type.stderr similarity index 100% rename from src/test/ui/feature-gate-existential-type.stderr rename to src/test/ui/feature-gates/feature-gate-existential-type.stderr diff --git a/src/test/ui/feature-gate-extern_absolute_paths.rs b/src/test/ui/feature-gates/feature-gate-extern_absolute_paths.rs similarity index 100% rename from src/test/ui/feature-gate-extern_absolute_paths.rs rename to src/test/ui/feature-gates/feature-gate-extern_absolute_paths.rs diff --git a/src/test/ui/feature-gate-extern_absolute_paths.stderr b/src/test/ui/feature-gates/feature-gate-extern_absolute_paths.stderr similarity index 100% rename from src/test/ui/feature-gate-extern_absolute_paths.stderr rename to src/test/ui/feature-gates/feature-gate-extern_absolute_paths.stderr diff --git a/src/test/ui/feature-gate-extern_in_paths.rs b/src/test/ui/feature-gates/feature-gate-extern_in_paths.rs similarity index 100% rename from src/test/ui/feature-gate-extern_in_paths.rs rename to src/test/ui/feature-gates/feature-gate-extern_in_paths.rs diff --git a/src/test/ui/feature-gate-extern_in_paths.stderr b/src/test/ui/feature-gates/feature-gate-extern_in_paths.stderr similarity index 100% rename from src/test/ui/feature-gate-extern_in_paths.stderr rename to src/test/ui/feature-gates/feature-gate-extern_in_paths.stderr diff --git a/src/test/ui/feature-gate-extern_prelude.rs b/src/test/ui/feature-gates/feature-gate-extern_prelude.rs similarity index 100% rename from src/test/ui/feature-gate-extern_prelude.rs rename to src/test/ui/feature-gates/feature-gate-extern_prelude.rs diff --git a/src/test/ui/feature-gate-extern_prelude.stderr b/src/test/ui/feature-gates/feature-gate-extern_prelude.stderr similarity index 100% rename from src/test/ui/feature-gate-extern_prelude.stderr rename to src/test/ui/feature-gates/feature-gate-extern_prelude.stderr diff --git a/src/test/ui/feature-gate-extern_types.rs b/src/test/ui/feature-gates/feature-gate-extern_types.rs similarity index 100% rename from src/test/ui/feature-gate-extern_types.rs rename to src/test/ui/feature-gates/feature-gate-extern_types.rs diff --git a/src/test/ui/feature-gate-extern_types.stderr b/src/test/ui/feature-gates/feature-gate-extern_types.stderr similarity index 100% rename from src/test/ui/feature-gate-extern_types.stderr rename to src/test/ui/feature-gates/feature-gate-extern_types.stderr diff --git a/src/test/ui/feature-gate-external_doc.rs b/src/test/ui/feature-gates/feature-gate-external_doc.rs similarity index 100% rename from src/test/ui/feature-gate-external_doc.rs rename to src/test/ui/feature-gates/feature-gate-external_doc.rs diff --git a/src/test/ui/feature-gate-external_doc.stderr b/src/test/ui/feature-gates/feature-gate-external_doc.stderr similarity index 100% rename from src/test/ui/feature-gate-external_doc.stderr rename to src/test/ui/feature-gates/feature-gate-external_doc.stderr diff --git a/src/test/ui/feature-gate-feature-gate.rs b/src/test/ui/feature-gates/feature-gate-feature-gate.rs similarity index 100% rename from src/test/ui/feature-gate-feature-gate.rs rename to src/test/ui/feature-gates/feature-gate-feature-gate.rs diff --git a/src/test/ui/feature-gate-feature-gate.stderr b/src/test/ui/feature-gates/feature-gate-feature-gate.stderr similarity index 100% rename from src/test/ui/feature-gate-feature-gate.stderr rename to src/test/ui/feature-gates/feature-gate-feature-gate.stderr diff --git a/src/test/ui/feature-gate-format_args_nl.rs b/src/test/ui/feature-gates/feature-gate-format_args_nl.rs similarity index 100% rename from src/test/ui/feature-gate-format_args_nl.rs rename to src/test/ui/feature-gates/feature-gate-format_args_nl.rs diff --git a/src/test/ui/feature-gate-format_args_nl.stderr b/src/test/ui/feature-gates/feature-gate-format_args_nl.stderr similarity index 100% rename from src/test/ui/feature-gate-format_args_nl.stderr rename to src/test/ui/feature-gates/feature-gate-format_args_nl.stderr diff --git a/src/test/ui/feature-gate-fundamental.rs b/src/test/ui/feature-gates/feature-gate-fundamental.rs similarity index 100% rename from src/test/ui/feature-gate-fundamental.rs rename to src/test/ui/feature-gates/feature-gate-fundamental.rs diff --git a/src/test/ui/feature-gate-fundamental.stderr b/src/test/ui/feature-gates/feature-gate-fundamental.stderr similarity index 100% rename from src/test/ui/feature-gate-fundamental.stderr rename to src/test/ui/feature-gates/feature-gate-fundamental.stderr diff --git a/src/test/ui/feature-gate-generators.rs b/src/test/ui/feature-gates/feature-gate-generators.rs similarity index 100% rename from src/test/ui/feature-gate-generators.rs rename to src/test/ui/feature-gates/feature-gate-generators.rs diff --git a/src/test/ui/feature-gate-generators.stderr b/src/test/ui/feature-gates/feature-gate-generators.stderr similarity index 100% rename from src/test/ui/feature-gate-generators.stderr rename to src/test/ui/feature-gates/feature-gate-generators.stderr diff --git a/src/test/ui/feature-gate-generic_associated_types.rs b/src/test/ui/feature-gates/feature-gate-generic_associated_types.rs similarity index 100% rename from src/test/ui/feature-gate-generic_associated_types.rs rename to src/test/ui/feature-gates/feature-gate-generic_associated_types.rs diff --git a/src/test/ui/feature-gate-generic_associated_types.stderr b/src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr similarity index 100% rename from src/test/ui/feature-gate-generic_associated_types.stderr rename to src/test/ui/feature-gates/feature-gate-generic_associated_types.stderr diff --git a/src/test/ui/feature-gate-global_asm.rs b/src/test/ui/feature-gates/feature-gate-global_asm.rs similarity index 100% rename from src/test/ui/feature-gate-global_asm.rs rename to src/test/ui/feature-gates/feature-gate-global_asm.rs diff --git a/src/test/ui/feature-gate-global_asm.stderr b/src/test/ui/feature-gates/feature-gate-global_asm.stderr similarity index 100% rename from src/test/ui/feature-gate-global_asm.stderr rename to src/test/ui/feature-gates/feature-gate-global_asm.stderr diff --git a/src/test/ui/feature-gate-if_while_or_patterns.rs b/src/test/ui/feature-gates/feature-gate-if_while_or_patterns.rs similarity index 100% rename from src/test/ui/feature-gate-if_while_or_patterns.rs rename to src/test/ui/feature-gates/feature-gate-if_while_or_patterns.rs diff --git a/src/test/ui/feature-gate-if_while_or_patterns.stderr b/src/test/ui/feature-gates/feature-gate-if_while_or_patterns.stderr similarity index 100% rename from src/test/ui/feature-gate-if_while_or_patterns.stderr rename to src/test/ui/feature-gates/feature-gate-if_while_or_patterns.stderr diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.rs b/src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision-with-in_band.rs similarity index 100% rename from src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.rs rename to src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision-with-in_band.rs diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.stderr b/src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision-with-in_band.stderr similarity index 100% rename from src/test/ui/feature-gate-impl_header_lifetime_elision-with-in_band.stderr rename to src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision-with-in_band.stderr diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision.rs b/src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision.rs similarity index 100% rename from src/test/ui/feature-gate-impl_header_lifetime_elision.rs rename to src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision.rs diff --git a/src/test/ui/feature-gate-impl_header_lifetime_elision.stderr b/src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision.stderr similarity index 100% rename from src/test/ui/feature-gate-impl_header_lifetime_elision.stderr rename to src/test/ui/feature-gates/feature-gate-impl_header_lifetime_elision.stderr diff --git a/src/test/ui/feature-gate-in_band_lifetimes.rs b/src/test/ui/feature-gates/feature-gate-in_band_lifetimes.rs similarity index 100% rename from src/test/ui/feature-gate-in_band_lifetimes.rs rename to src/test/ui/feature-gates/feature-gate-in_band_lifetimes.rs diff --git a/src/test/ui/feature-gate-in_band_lifetimes.stderr b/src/test/ui/feature-gates/feature-gate-in_band_lifetimes.stderr similarity index 100% rename from src/test/ui/feature-gate-in_band_lifetimes.stderr rename to src/test/ui/feature-gates/feature-gate-in_band_lifetimes.stderr diff --git a/src/test/ui/feature-gate-infer_outlives_requirements.rs b/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.rs similarity index 100% rename from src/test/ui/feature-gate-infer_outlives_requirements.rs rename to src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.rs diff --git a/src/test/ui/feature-gate-infer_outlives_requirements.stderr b/src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.stderr similarity index 100% rename from src/test/ui/feature-gate-infer_outlives_requirements.stderr rename to src/test/ui/feature-gates/feature-gate-infer_outlives_requirements.stderr diff --git a/src/test/ui/feature-gate-infer_static_outlives_requirements.rs b/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.rs similarity index 100% rename from src/test/ui/feature-gate-infer_static_outlives_requirements.rs rename to src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.rs diff --git a/src/test/ui/feature-gate-infer_static_outlives_requirements.stderr b/src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr similarity index 100% rename from src/test/ui/feature-gate-infer_static_outlives_requirements.stderr rename to src/test/ui/feature-gates/feature-gate-infer_static_outlives_requirements.stderr diff --git a/src/test/ui/feature-gate-intrinsics.rs b/src/test/ui/feature-gates/feature-gate-intrinsics.rs similarity index 100% rename from src/test/ui/feature-gate-intrinsics.rs rename to src/test/ui/feature-gates/feature-gate-intrinsics.rs diff --git a/src/test/ui/feature-gate-intrinsics.stderr b/src/test/ui/feature-gates/feature-gate-intrinsics.stderr similarity index 100% rename from src/test/ui/feature-gate-intrinsics.stderr rename to src/test/ui/feature-gates/feature-gate-intrinsics.stderr diff --git a/src/test/ui/feature-gate-label_break_value.rs b/src/test/ui/feature-gates/feature-gate-label_break_value.rs similarity index 100% rename from src/test/ui/feature-gate-label_break_value.rs rename to src/test/ui/feature-gates/feature-gate-label_break_value.rs diff --git a/src/test/ui/feature-gate-label_break_value.stderr b/src/test/ui/feature-gates/feature-gate-label_break_value.stderr similarity index 100% rename from src/test/ui/feature-gate-label_break_value.stderr rename to src/test/ui/feature-gates/feature-gate-label_break_value.stderr diff --git a/src/test/ui/feature-gate-lang-items.rs b/src/test/ui/feature-gates/feature-gate-lang-items.rs similarity index 100% rename from src/test/ui/feature-gate-lang-items.rs rename to src/test/ui/feature-gates/feature-gate-lang-items.rs diff --git a/src/test/ui/feature-gate-lang-items.stderr b/src/test/ui/feature-gates/feature-gate-lang-items.stderr similarity index 100% rename from src/test/ui/feature-gate-lang-items.stderr rename to src/test/ui/feature-gates/feature-gate-lang-items.stderr diff --git a/src/test/ui/feature-gate-link_args.rs b/src/test/ui/feature-gates/feature-gate-link_args.rs similarity index 100% rename from src/test/ui/feature-gate-link_args.rs rename to src/test/ui/feature-gates/feature-gate-link_args.rs diff --git a/src/test/ui/feature-gate-link_args.stderr b/src/test/ui/feature-gates/feature-gate-link_args.stderr similarity index 100% rename from src/test/ui/feature-gate-link_args.stderr rename to src/test/ui/feature-gates/feature-gate-link_args.stderr diff --git a/src/test/ui/feature-gate-link_cfg.rs b/src/test/ui/feature-gates/feature-gate-link_cfg.rs similarity index 100% rename from src/test/ui/feature-gate-link_cfg.rs rename to src/test/ui/feature-gates/feature-gate-link_cfg.rs diff --git a/src/test/ui/feature-gate-link_cfg.stderr b/src/test/ui/feature-gates/feature-gate-link_cfg.stderr similarity index 100% rename from src/test/ui/feature-gate-link_cfg.stderr rename to src/test/ui/feature-gates/feature-gate-link_cfg.stderr diff --git a/src/test/ui/feature-gate-link_llvm_intrinsics.rs b/src/test/ui/feature-gates/feature-gate-link_llvm_intrinsics.rs similarity index 100% rename from src/test/ui/feature-gate-link_llvm_intrinsics.rs rename to src/test/ui/feature-gates/feature-gate-link_llvm_intrinsics.rs diff --git a/src/test/ui/feature-gate-link_llvm_intrinsics.stderr b/src/test/ui/feature-gates/feature-gate-link_llvm_intrinsics.stderr similarity index 100% rename from src/test/ui/feature-gate-link_llvm_intrinsics.stderr rename to src/test/ui/feature-gates/feature-gate-link_llvm_intrinsics.stderr diff --git a/src/test/ui/feature-gate-linkage.rs b/src/test/ui/feature-gates/feature-gate-linkage.rs similarity index 100% rename from src/test/ui/feature-gate-linkage.rs rename to src/test/ui/feature-gates/feature-gate-linkage.rs diff --git a/src/test/ui/feature-gate-linkage.stderr b/src/test/ui/feature-gates/feature-gate-linkage.stderr similarity index 100% rename from src/test/ui/feature-gate-linkage.stderr rename to src/test/ui/feature-gates/feature-gate-linkage.stderr diff --git a/src/test/ui/feature-gate-linker-flavor.rs b/src/test/ui/feature-gates/feature-gate-linker-flavor.rs similarity index 100% rename from src/test/ui/feature-gate-linker-flavor.rs rename to src/test/ui/feature-gates/feature-gate-linker-flavor.rs diff --git a/src/test/ui/feature-gate-linker-flavor.stderr b/src/test/ui/feature-gates/feature-gate-linker-flavor.stderr similarity index 100% rename from src/test/ui/feature-gate-linker-flavor.stderr rename to src/test/ui/feature-gates/feature-gate-linker-flavor.stderr diff --git a/src/test/ui/feature-gate-log_syntax.rs b/src/test/ui/feature-gates/feature-gate-log_syntax.rs similarity index 100% rename from src/test/ui/feature-gate-log_syntax.rs rename to src/test/ui/feature-gates/feature-gate-log_syntax.rs diff --git a/src/test/ui/feature-gate-log_syntax.stderr b/src/test/ui/feature-gates/feature-gate-log_syntax.stderr similarity index 100% rename from src/test/ui/feature-gate-log_syntax.stderr rename to src/test/ui/feature-gates/feature-gate-log_syntax.stderr diff --git a/src/test/ui/feature-gate-log_syntax2.rs b/src/test/ui/feature-gates/feature-gate-log_syntax2.rs similarity index 100% rename from src/test/ui/feature-gate-log_syntax2.rs rename to src/test/ui/feature-gates/feature-gate-log_syntax2.rs diff --git a/src/test/ui/feature-gate-log_syntax2.stderr b/src/test/ui/feature-gates/feature-gate-log_syntax2.stderr similarity index 100% rename from src/test/ui/feature-gate-log_syntax2.stderr rename to src/test/ui/feature-gates/feature-gate-log_syntax2.stderr diff --git a/src/test/ui/feature-gate-macro-literal-matcher.rs b/src/test/ui/feature-gates/feature-gate-macro-literal-matcher.rs similarity index 100% rename from src/test/ui/feature-gate-macro-literal-matcher.rs rename to src/test/ui/feature-gates/feature-gate-macro-literal-matcher.rs diff --git a/src/test/ui/feature-gate-macro-literal-matcher.stderr b/src/test/ui/feature-gates/feature-gate-macro-literal-matcher.stderr similarity index 100% rename from src/test/ui/feature-gate-macro-literal-matcher.stderr rename to src/test/ui/feature-gates/feature-gate-macro-literal-matcher.stderr diff --git a/src/test/ui/feature-gate-macro-vis-matcher.rs b/src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs similarity index 100% rename from src/test/ui/feature-gate-macro-vis-matcher.rs rename to src/test/ui/feature-gates/feature-gate-macro-vis-matcher.rs diff --git a/src/test/ui/feature-gate-macro-vis-matcher.stderr b/src/test/ui/feature-gates/feature-gate-macro-vis-matcher.stderr similarity index 100% rename from src/test/ui/feature-gate-macro-vis-matcher.stderr rename to src/test/ui/feature-gates/feature-gate-macro-vis-matcher.stderr diff --git a/src/test/ui/feature-gate-macros_in_extern.rs b/src/test/ui/feature-gates/feature-gate-macros_in_extern.rs similarity index 100% rename from src/test/ui/feature-gate-macros_in_extern.rs rename to src/test/ui/feature-gates/feature-gate-macros_in_extern.rs diff --git a/src/test/ui/feature-gate-macros_in_extern.stderr b/src/test/ui/feature-gates/feature-gate-macros_in_extern.stderr similarity index 100% rename from src/test/ui/feature-gate-macros_in_extern.stderr rename to src/test/ui/feature-gates/feature-gate-macros_in_extern.stderr diff --git a/src/test/ui/feature-gate-main.rs b/src/test/ui/feature-gates/feature-gate-main.rs similarity index 100% rename from src/test/ui/feature-gate-main.rs rename to src/test/ui/feature-gates/feature-gate-main.rs diff --git a/src/test/ui/feature-gate-main.stderr b/src/test/ui/feature-gates/feature-gate-main.stderr similarity index 100% rename from src/test/ui/feature-gate-main.stderr rename to src/test/ui/feature-gates/feature-gate-main.stderr diff --git a/src/test/ui/feature-gate-may-dangle.rs b/src/test/ui/feature-gates/feature-gate-may-dangle.rs similarity index 100% rename from src/test/ui/feature-gate-may-dangle.rs rename to src/test/ui/feature-gates/feature-gate-may-dangle.rs diff --git a/src/test/ui/feature-gate-may-dangle.stderr b/src/test/ui/feature-gates/feature-gate-may-dangle.stderr similarity index 100% rename from src/test/ui/feature-gate-may-dangle.stderr rename to src/test/ui/feature-gates/feature-gate-may-dangle.stderr diff --git a/src/test/ui/feature-gate-naked_functions.rs b/src/test/ui/feature-gates/feature-gate-naked_functions.rs similarity index 100% rename from src/test/ui/feature-gate-naked_functions.rs rename to src/test/ui/feature-gates/feature-gate-naked_functions.rs diff --git a/src/test/ui/feature-gate-naked_functions.stderr b/src/test/ui/feature-gates/feature-gate-naked_functions.stderr similarity index 100% rename from src/test/ui/feature-gate-naked_functions.stderr rename to src/test/ui/feature-gates/feature-gate-naked_functions.stderr diff --git a/src/test/ui/feature-gate-needs-allocator.rs b/src/test/ui/feature-gates/feature-gate-needs-allocator.rs similarity index 100% rename from src/test/ui/feature-gate-needs-allocator.rs rename to src/test/ui/feature-gates/feature-gate-needs-allocator.rs diff --git a/src/test/ui/feature-gate-needs-allocator.stderr b/src/test/ui/feature-gates/feature-gate-needs-allocator.stderr similarity index 100% rename from src/test/ui/feature-gate-needs-allocator.stderr rename to src/test/ui/feature-gates/feature-gate-needs-allocator.stderr diff --git a/src/test/ui/feature-gate-negate-unsigned.rs b/src/test/ui/feature-gates/feature-gate-negate-unsigned.rs similarity index 100% rename from src/test/ui/feature-gate-negate-unsigned.rs rename to src/test/ui/feature-gates/feature-gate-negate-unsigned.rs diff --git a/src/test/ui/feature-gate-negate-unsigned.stderr b/src/test/ui/feature-gates/feature-gate-negate-unsigned.stderr similarity index 100% rename from src/test/ui/feature-gate-negate-unsigned.stderr rename to src/test/ui/feature-gates/feature-gate-negate-unsigned.stderr diff --git a/src/test/ui/feature-gate-never_type.rs b/src/test/ui/feature-gates/feature-gate-never_type.rs similarity index 100% rename from src/test/ui/feature-gate-never_type.rs rename to src/test/ui/feature-gates/feature-gate-never_type.rs diff --git a/src/test/ui/feature-gate-never_type.stderr b/src/test/ui/feature-gates/feature-gate-never_type.stderr similarity index 100% rename from src/test/ui/feature-gate-never_type.stderr rename to src/test/ui/feature-gates/feature-gate-never_type.stderr diff --git a/src/test/ui/feature-gate-nll.nll.stderr b/src/test/ui/feature-gates/feature-gate-nll.nll.stderr similarity index 100% rename from src/test/ui/feature-gate-nll.nll.stderr rename to src/test/ui/feature-gates/feature-gate-nll.nll.stderr diff --git a/src/test/ui/feature-gate-nll.rs b/src/test/ui/feature-gates/feature-gate-nll.rs similarity index 100% rename from src/test/ui/feature-gate-nll.rs rename to src/test/ui/feature-gates/feature-gate-nll.rs diff --git a/src/test/ui/feature-gate-nll.stderr b/src/test/ui/feature-gates/feature-gate-nll.stderr similarity index 100% rename from src/test/ui/feature-gate-nll.stderr rename to src/test/ui/feature-gates/feature-gate-nll.stderr diff --git a/src/test/ui/feature-gate-no-debug-2.rs b/src/test/ui/feature-gates/feature-gate-no-debug-2.rs similarity index 100% rename from src/test/ui/feature-gate-no-debug-2.rs rename to src/test/ui/feature-gates/feature-gate-no-debug-2.rs diff --git a/src/test/ui/feature-gate-no-debug-2.stderr b/src/test/ui/feature-gates/feature-gate-no-debug-2.stderr similarity index 100% rename from src/test/ui/feature-gate-no-debug-2.stderr rename to src/test/ui/feature-gates/feature-gate-no-debug-2.stderr diff --git a/src/test/ui/feature-gate-no-debug.rs b/src/test/ui/feature-gates/feature-gate-no-debug.rs similarity index 100% rename from src/test/ui/feature-gate-no-debug.rs rename to src/test/ui/feature-gates/feature-gate-no-debug.rs diff --git a/src/test/ui/feature-gate-no-debug.stderr b/src/test/ui/feature-gates/feature-gate-no-debug.stderr similarity index 100% rename from src/test/ui/feature-gate-no-debug.stderr rename to src/test/ui/feature-gates/feature-gate-no-debug.stderr diff --git a/src/test/ui/feature-gate-no_core.rs b/src/test/ui/feature-gates/feature-gate-no_core.rs similarity index 100% rename from src/test/ui/feature-gate-no_core.rs rename to src/test/ui/feature-gates/feature-gate-no_core.rs diff --git a/src/test/ui/feature-gate-no_core.stderr b/src/test/ui/feature-gates/feature-gate-no_core.stderr similarity index 100% rename from src/test/ui/feature-gate-no_core.stderr rename to src/test/ui/feature-gates/feature-gate-no_core.stderr diff --git a/src/test/ui/feature-gate-non_ascii_idents.rs b/src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs similarity index 100% rename from src/test/ui/feature-gate-non_ascii_idents.rs rename to src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs diff --git a/src/test/ui/feature-gate-non_ascii_idents.stderr b/src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr similarity index 100% rename from src/test/ui/feature-gate-non_ascii_idents.stderr rename to src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr diff --git a/src/test/ui/feature-gate-non_exhaustive.rs b/src/test/ui/feature-gates/feature-gate-non_exhaustive.rs similarity index 100% rename from src/test/ui/feature-gate-non_exhaustive.rs rename to src/test/ui/feature-gates/feature-gate-non_exhaustive.rs diff --git a/src/test/ui/feature-gate-non_exhaustive.stderr b/src/test/ui/feature-gates/feature-gate-non_exhaustive.stderr similarity index 100% rename from src/test/ui/feature-gate-non_exhaustive.stderr rename to src/test/ui/feature-gates/feature-gate-non_exhaustive.stderr diff --git a/src/test/ui/feature-gate-omit-gdb-pretty-printer-section.rs b/src/test/ui/feature-gates/feature-gate-omit-gdb-pretty-printer-section.rs similarity index 100% rename from src/test/ui/feature-gate-omit-gdb-pretty-printer-section.rs rename to src/test/ui/feature-gates/feature-gate-omit-gdb-pretty-printer-section.rs diff --git a/src/test/ui/feature-gate-omit-gdb-pretty-printer-section.stderr b/src/test/ui/feature-gates/feature-gate-omit-gdb-pretty-printer-section.stderr similarity index 100% rename from src/test/ui/feature-gate-omit-gdb-pretty-printer-section.stderr rename to src/test/ui/feature-gates/feature-gate-omit-gdb-pretty-printer-section.stderr diff --git a/src/test/ui/feature-gate-on-unimplemented.rs b/src/test/ui/feature-gates/feature-gate-on-unimplemented.rs similarity index 100% rename from src/test/ui/feature-gate-on-unimplemented.rs rename to src/test/ui/feature-gates/feature-gate-on-unimplemented.rs diff --git a/src/test/ui/feature-gate-on-unimplemented.stderr b/src/test/ui/feature-gates/feature-gate-on-unimplemented.stderr similarity index 100% rename from src/test/ui/feature-gate-on-unimplemented.stderr rename to src/test/ui/feature-gates/feature-gate-on-unimplemented.stderr diff --git a/src/test/ui/feature-gate-optin-builtin-traits.rs b/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.rs similarity index 100% rename from src/test/ui/feature-gate-optin-builtin-traits.rs rename to src/test/ui/feature-gates/feature-gate-optin-builtin-traits.rs diff --git a/src/test/ui/feature-gate-optin-builtin-traits.stderr b/src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr similarity index 100% rename from src/test/ui/feature-gate-optin-builtin-traits.stderr rename to src/test/ui/feature-gates/feature-gate-optin-builtin-traits.stderr diff --git a/src/test/ui/feature-gate-overlapping_marker_traits.rs b/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.rs similarity index 100% rename from src/test/ui/feature-gate-overlapping_marker_traits.rs rename to src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.rs diff --git a/src/test/ui/feature-gate-overlapping_marker_traits.stderr b/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr similarity index 100% rename from src/test/ui/feature-gate-overlapping_marker_traits.stderr rename to src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr diff --git a/src/test/compile-fail/feature-gate-panic-implementation.rs b/src/test/ui/feature-gates/feature-gate-panic-implementation.rs similarity index 100% rename from src/test/compile-fail/feature-gate-panic-implementation.rs rename to src/test/ui/feature-gates/feature-gate-panic-implementation.rs diff --git a/src/test/ui/feature-gates/feature-gate-panic-implementation.stderr b/src/test/ui/feature-gates/feature-gate-panic-implementation.stderr new file mode 100644 index 0000000000000..f99228bef1d62 --- /dev/null +++ b/src/test/ui/feature-gates/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/ui/feature-gate-pattern_parentheses.rs b/src/test/ui/feature-gates/feature-gate-pattern_parentheses.rs similarity index 100% rename from src/test/ui/feature-gate-pattern_parentheses.rs rename to src/test/ui/feature-gates/feature-gate-pattern_parentheses.rs diff --git a/src/test/ui/feature-gate-pattern_parentheses.stderr b/src/test/ui/feature-gates/feature-gate-pattern_parentheses.stderr similarity index 100% rename from src/test/ui/feature-gate-pattern_parentheses.stderr rename to src/test/ui/feature-gates/feature-gate-pattern_parentheses.stderr diff --git a/src/test/ui/feature-gate-plugin.rs b/src/test/ui/feature-gates/feature-gate-plugin.rs similarity index 100% rename from src/test/ui/feature-gate-plugin.rs rename to src/test/ui/feature-gates/feature-gate-plugin.rs diff --git a/src/test/ui/feature-gate-plugin.stderr b/src/test/ui/feature-gates/feature-gate-plugin.stderr similarity index 100% rename from src/test/ui/feature-gate-plugin.stderr rename to src/test/ui/feature-gates/feature-gate-plugin.stderr diff --git a/src/test/ui/feature-gate-plugin_registrar.rs b/src/test/ui/feature-gates/feature-gate-plugin_registrar.rs similarity index 100% rename from src/test/ui/feature-gate-plugin_registrar.rs rename to src/test/ui/feature-gates/feature-gate-plugin_registrar.rs diff --git a/src/test/ui/feature-gate-plugin_registrar.stderr b/src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr similarity index 100% rename from src/test/ui/feature-gate-plugin_registrar.stderr rename to src/test/ui/feature-gates/feature-gate-plugin_registrar.stderr diff --git a/src/test/ui/feature-gate-prelude_import.rs b/src/test/ui/feature-gates/feature-gate-prelude_import.rs similarity index 100% rename from src/test/ui/feature-gate-prelude_import.rs rename to src/test/ui/feature-gates/feature-gate-prelude_import.rs diff --git a/src/test/ui/feature-gate-prelude_import.stderr b/src/test/ui/feature-gates/feature-gate-prelude_import.stderr similarity index 100% rename from src/test/ui/feature-gate-prelude_import.stderr rename to src/test/ui/feature-gates/feature-gate-prelude_import.stderr diff --git a/src/test/ui/feature-gate-profiler-runtime.rs b/src/test/ui/feature-gates/feature-gate-profiler-runtime.rs similarity index 100% rename from src/test/ui/feature-gate-profiler-runtime.rs rename to src/test/ui/feature-gates/feature-gate-profiler-runtime.rs diff --git a/src/test/ui/feature-gate-profiler-runtime.stderr b/src/test/ui/feature-gates/feature-gate-profiler-runtime.stderr similarity index 100% rename from src/test/ui/feature-gate-profiler-runtime.stderr rename to src/test/ui/feature-gates/feature-gate-profiler-runtime.stderr diff --git a/src/test/ui/feature-gate-raw-identifiers.rs b/src/test/ui/feature-gates/feature-gate-raw-identifiers.rs similarity index 100% rename from src/test/ui/feature-gate-raw-identifiers.rs rename to src/test/ui/feature-gates/feature-gate-raw-identifiers.rs diff --git a/src/test/ui/feature-gate-raw-identifiers.stderr b/src/test/ui/feature-gates/feature-gate-raw-identifiers.stderr similarity index 100% rename from src/test/ui/feature-gate-raw-identifiers.stderr rename to src/test/ui/feature-gates/feature-gate-raw-identifiers.stderr diff --git a/src/test/ui/feature-gate-repr-simd.rs b/src/test/ui/feature-gates/feature-gate-repr-simd.rs similarity index 100% rename from src/test/ui/feature-gate-repr-simd.rs rename to src/test/ui/feature-gates/feature-gate-repr-simd.rs diff --git a/src/test/ui/feature-gate-repr-simd.stderr b/src/test/ui/feature-gates/feature-gate-repr-simd.stderr similarity index 100% rename from src/test/ui/feature-gate-repr-simd.stderr rename to src/test/ui/feature-gates/feature-gate-repr-simd.stderr diff --git a/src/test/ui/feature-gate-repr128.rs b/src/test/ui/feature-gates/feature-gate-repr128.rs similarity index 100% rename from src/test/ui/feature-gate-repr128.rs rename to src/test/ui/feature-gates/feature-gate-repr128.rs diff --git a/src/test/ui/feature-gate-repr128.stderr b/src/test/ui/feature-gates/feature-gate-repr128.stderr similarity index 100% rename from src/test/ui/feature-gate-repr128.stderr rename to src/test/ui/feature-gates/feature-gate-repr128.stderr diff --git a/src/test/ui/feature-gate-repr_packed.rs b/src/test/ui/feature-gates/feature-gate-repr_packed.rs similarity index 100% rename from src/test/ui/feature-gate-repr_packed.rs rename to src/test/ui/feature-gates/feature-gate-repr_packed.rs diff --git a/src/test/ui/feature-gate-repr_packed.stderr b/src/test/ui/feature-gates/feature-gate-repr_packed.stderr similarity index 100% rename from src/test/ui/feature-gate-repr_packed.stderr rename to src/test/ui/feature-gates/feature-gate-repr_packed.stderr diff --git a/src/test/ui/feature-gate-rustc-attrs.rs b/src/test/ui/feature-gates/feature-gate-rustc-attrs.rs similarity index 100% rename from src/test/ui/feature-gate-rustc-attrs.rs rename to src/test/ui/feature-gates/feature-gate-rustc-attrs.rs diff --git a/src/test/ui/feature-gate-rustc-attrs.stderr b/src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr similarity index 100% rename from src/test/ui/feature-gate-rustc-attrs.stderr rename to src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr diff --git a/src/test/ui/feature-gate-rustc-diagnostic-macros.rs b/src/test/ui/feature-gates/feature-gate-rustc-diagnostic-macros.rs similarity index 100% rename from src/test/ui/feature-gate-rustc-diagnostic-macros.rs rename to src/test/ui/feature-gates/feature-gate-rustc-diagnostic-macros.rs diff --git a/src/test/ui/feature-gate-rustc-diagnostic-macros.stderr b/src/test/ui/feature-gates/feature-gate-rustc-diagnostic-macros.stderr similarity index 100% rename from src/test/ui/feature-gate-rustc-diagnostic-macros.stderr rename to src/test/ui/feature-gates/feature-gate-rustc-diagnostic-macros.stderr diff --git a/src/test/ui/feature-gate-rustc_const_unstable.rs b/src/test/ui/feature-gates/feature-gate-rustc_const_unstable.rs similarity index 100% rename from src/test/ui/feature-gate-rustc_const_unstable.rs rename to src/test/ui/feature-gates/feature-gate-rustc_const_unstable.rs diff --git a/src/test/ui/feature-gate-rustc_const_unstable.stderr b/src/test/ui/feature-gates/feature-gate-rustc_const_unstable.stderr similarity index 100% rename from src/test/ui/feature-gate-rustc_const_unstable.stderr rename to src/test/ui/feature-gates/feature-gate-rustc_const_unstable.stderr diff --git a/src/test/ui/feature-gate-sanitizer-runtime.rs b/src/test/ui/feature-gates/feature-gate-sanitizer-runtime.rs similarity index 100% rename from src/test/ui/feature-gate-sanitizer-runtime.rs rename to src/test/ui/feature-gates/feature-gate-sanitizer-runtime.rs diff --git a/src/test/ui/feature-gate-sanitizer-runtime.stderr b/src/test/ui/feature-gates/feature-gate-sanitizer-runtime.stderr similarity index 100% rename from src/test/ui/feature-gate-sanitizer-runtime.stderr rename to src/test/ui/feature-gates/feature-gate-sanitizer-runtime.stderr diff --git a/src/test/ui/feature-gate-simd-ffi.rs b/src/test/ui/feature-gates/feature-gate-simd-ffi.rs similarity index 100% rename from src/test/ui/feature-gate-simd-ffi.rs rename to src/test/ui/feature-gates/feature-gate-simd-ffi.rs diff --git a/src/test/ui/feature-gate-simd-ffi.stderr b/src/test/ui/feature-gates/feature-gate-simd-ffi.stderr similarity index 100% rename from src/test/ui/feature-gate-simd-ffi.stderr rename to src/test/ui/feature-gates/feature-gate-simd-ffi.stderr diff --git a/src/test/ui/feature-gate-simd.rs b/src/test/ui/feature-gates/feature-gate-simd.rs similarity index 100% rename from src/test/ui/feature-gate-simd.rs rename to src/test/ui/feature-gates/feature-gate-simd.rs diff --git a/src/test/ui/feature-gate-simd.stderr b/src/test/ui/feature-gates/feature-gate-simd.stderr similarity index 100% rename from src/test/ui/feature-gate-simd.stderr rename to src/test/ui/feature-gates/feature-gate-simd.stderr diff --git a/src/test/ui/feature-gate-slice-patterns.rs b/src/test/ui/feature-gates/feature-gate-slice-patterns.rs similarity index 100% rename from src/test/ui/feature-gate-slice-patterns.rs rename to src/test/ui/feature-gates/feature-gate-slice-patterns.rs diff --git a/src/test/ui/feature-gate-slice-patterns.stderr b/src/test/ui/feature-gates/feature-gate-slice-patterns.stderr similarity index 100% rename from src/test/ui/feature-gate-slice-patterns.stderr rename to src/test/ui/feature-gates/feature-gate-slice-patterns.stderr diff --git a/src/test/ui/feature-gate-staged_api.rs b/src/test/ui/feature-gates/feature-gate-staged_api.rs similarity index 100% rename from src/test/ui/feature-gate-staged_api.rs rename to src/test/ui/feature-gates/feature-gate-staged_api.rs diff --git a/src/test/ui/feature-gate-staged_api.stderr b/src/test/ui/feature-gates/feature-gate-staged_api.stderr similarity index 100% rename from src/test/ui/feature-gate-staged_api.stderr rename to src/test/ui/feature-gates/feature-gate-staged_api.stderr diff --git a/src/test/ui/feature-gate-start.rs b/src/test/ui/feature-gates/feature-gate-start.rs similarity index 100% rename from src/test/ui/feature-gate-start.rs rename to src/test/ui/feature-gates/feature-gate-start.rs diff --git a/src/test/ui/feature-gate-start.stderr b/src/test/ui/feature-gates/feature-gate-start.stderr similarity index 100% rename from src/test/ui/feature-gate-start.stderr rename to src/test/ui/feature-gates/feature-gate-start.stderr diff --git a/src/test/ui/feature-gate-static-nobundle.rs b/src/test/ui/feature-gates/feature-gate-static-nobundle.rs similarity index 100% rename from src/test/ui/feature-gate-static-nobundle.rs rename to src/test/ui/feature-gates/feature-gate-static-nobundle.rs diff --git a/src/test/ui/feature-gate-static-nobundle.stderr b/src/test/ui/feature-gates/feature-gate-static-nobundle.stderr similarity index 100% rename from src/test/ui/feature-gate-static-nobundle.stderr rename to src/test/ui/feature-gates/feature-gate-static-nobundle.stderr diff --git a/src/test/ui/feature-gate-stmt_expr_attributes.rs b/src/test/ui/feature-gates/feature-gate-stmt_expr_attributes.rs similarity index 100% rename from src/test/ui/feature-gate-stmt_expr_attributes.rs rename to src/test/ui/feature-gates/feature-gate-stmt_expr_attributes.rs diff --git a/src/test/ui/feature-gate-stmt_expr_attributes.stderr b/src/test/ui/feature-gates/feature-gate-stmt_expr_attributes.stderr similarity index 100% rename from src/test/ui/feature-gate-stmt_expr_attributes.stderr rename to src/test/ui/feature-gates/feature-gate-stmt_expr_attributes.stderr diff --git a/src/test/ui/feature-gate-thread_local.rs b/src/test/ui/feature-gates/feature-gate-thread_local.rs similarity index 100% rename from src/test/ui/feature-gate-thread_local.rs rename to src/test/ui/feature-gates/feature-gate-thread_local.rs diff --git a/src/test/ui/feature-gate-thread_local.stderr b/src/test/ui/feature-gates/feature-gate-thread_local.stderr similarity index 100% rename from src/test/ui/feature-gate-thread_local.stderr rename to src/test/ui/feature-gates/feature-gate-thread_local.stderr diff --git a/src/test/ui/feature-gate-tool_attributes.rs b/src/test/ui/feature-gates/feature-gate-tool_attributes.rs similarity index 100% rename from src/test/ui/feature-gate-tool_attributes.rs rename to src/test/ui/feature-gates/feature-gate-tool_attributes.rs diff --git a/src/test/ui/feature-gate-tool_attributes.stderr b/src/test/ui/feature-gates/feature-gate-tool_attributes.stderr similarity index 100% rename from src/test/ui/feature-gate-tool_attributes.stderr rename to src/test/ui/feature-gates/feature-gate-tool_attributes.stderr diff --git a/src/test/compile-fail/feature-gate-tool_lints.rs b/src/test/ui/feature-gates/feature-gate-tool_lints-fail.rs similarity index 100% rename from src/test/compile-fail/feature-gate-tool_lints.rs rename to src/test/ui/feature-gates/feature-gate-tool_lints-fail.rs diff --git a/src/test/ui/feature-gates/feature-gate-tool_lints-fail.stderr b/src/test/ui/feature-gates/feature-gate-tool_lints-fail.stderr new file mode 100644 index 0000000000000..33ee79cd2011a --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-tool_lints-fail.stderr @@ -0,0 +1,11 @@ +error[E0658]: scoped lint `clippy::assign_ops` is experimental (see issue #44690) + --> $DIR/feature-gate-tool_lints-fail.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/ui/feature-gate-tool_lints.rs b/src/test/ui/feature-gates/feature-gate-tool_lints.rs similarity index 100% rename from src/test/ui/feature-gate-tool_lints.rs rename to src/test/ui/feature-gates/feature-gate-tool_lints.rs diff --git a/src/test/ui/feature-gate-tool_lints.stderr b/src/test/ui/feature-gates/feature-gate-tool_lints.stderr similarity index 100% rename from src/test/ui/feature-gate-tool_lints.stderr rename to src/test/ui/feature-gates/feature-gate-tool_lints.stderr diff --git a/src/test/ui/feature-gate-trace_macros.rs b/src/test/ui/feature-gates/feature-gate-trace_macros.rs similarity index 100% rename from src/test/ui/feature-gate-trace_macros.rs rename to src/test/ui/feature-gates/feature-gate-trace_macros.rs diff --git a/src/test/ui/feature-gate-trace_macros.stderr b/src/test/ui/feature-gates/feature-gate-trace_macros.stderr similarity index 100% rename from src/test/ui/feature-gate-trace_macros.stderr rename to src/test/ui/feature-gates/feature-gate-trace_macros.stderr diff --git a/src/test/ui/feature-gate-trivial_bounds-lint.rs b/src/test/ui/feature-gates/feature-gate-trivial_bounds-lint.rs similarity index 100% rename from src/test/ui/feature-gate-trivial_bounds-lint.rs rename to src/test/ui/feature-gates/feature-gate-trivial_bounds-lint.rs diff --git a/src/test/ui/feature-gate-trivial_bounds.rs b/src/test/ui/feature-gates/feature-gate-trivial_bounds.rs similarity index 100% rename from src/test/ui/feature-gate-trivial_bounds.rs rename to src/test/ui/feature-gates/feature-gate-trivial_bounds.rs diff --git a/src/test/ui/feature-gate-trivial_bounds.stderr b/src/test/ui/feature-gates/feature-gate-trivial_bounds.stderr similarity index 100% rename from src/test/ui/feature-gate-trivial_bounds.stderr rename to src/test/ui/feature-gates/feature-gate-trivial_bounds.stderr diff --git a/src/test/ui/feature-gate-try_reserve.rs b/src/test/ui/feature-gates/feature-gate-try_reserve.rs similarity index 100% rename from src/test/ui/feature-gate-try_reserve.rs rename to src/test/ui/feature-gates/feature-gate-try_reserve.rs diff --git a/src/test/ui/feature-gate-try_reserve.stderr b/src/test/ui/feature-gates/feature-gate-try_reserve.stderr similarity index 100% rename from src/test/ui/feature-gate-try_reserve.stderr rename to src/test/ui/feature-gates/feature-gate-try_reserve.stderr diff --git a/src/test/ui/feature-gate-type_ascription.rs b/src/test/ui/feature-gates/feature-gate-type_ascription.rs similarity index 100% rename from src/test/ui/feature-gate-type_ascription.rs rename to src/test/ui/feature-gates/feature-gate-type_ascription.rs diff --git a/src/test/ui/feature-gate-type_ascription.stderr b/src/test/ui/feature-gates/feature-gate-type_ascription.stderr similarity index 100% rename from src/test/ui/feature-gate-type_ascription.stderr rename to src/test/ui/feature-gates/feature-gate-type_ascription.stderr diff --git a/src/test/ui/feature-gate-unboxed-closures-manual-impls.rs b/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.rs similarity index 100% rename from src/test/ui/feature-gate-unboxed-closures-manual-impls.rs rename to src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.rs diff --git a/src/test/ui/feature-gate-unboxed-closures-manual-impls.stderr b/src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr similarity index 100% rename from src/test/ui/feature-gate-unboxed-closures-manual-impls.stderr rename to src/test/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr diff --git a/src/test/ui/feature-gate-unboxed-closures-method-calls.rs b/src/test/ui/feature-gates/feature-gate-unboxed-closures-method-calls.rs similarity index 100% rename from src/test/ui/feature-gate-unboxed-closures-method-calls.rs rename to src/test/ui/feature-gates/feature-gate-unboxed-closures-method-calls.rs diff --git a/src/test/ui/feature-gate-unboxed-closures-method-calls.stderr b/src/test/ui/feature-gates/feature-gate-unboxed-closures-method-calls.stderr similarity index 100% rename from src/test/ui/feature-gate-unboxed-closures-method-calls.stderr rename to src/test/ui/feature-gates/feature-gate-unboxed-closures-method-calls.stderr diff --git a/src/test/ui/feature-gate-unboxed-closures-ufcs-calls.rs b/src/test/ui/feature-gates/feature-gate-unboxed-closures-ufcs-calls.rs similarity index 100% rename from src/test/ui/feature-gate-unboxed-closures-ufcs-calls.rs rename to src/test/ui/feature-gates/feature-gate-unboxed-closures-ufcs-calls.rs diff --git a/src/test/ui/feature-gate-unboxed-closures-ufcs-calls.stderr b/src/test/ui/feature-gates/feature-gate-unboxed-closures-ufcs-calls.stderr similarity index 100% rename from src/test/ui/feature-gate-unboxed-closures-ufcs-calls.stderr rename to src/test/ui/feature-gates/feature-gate-unboxed-closures-ufcs-calls.stderr diff --git a/src/test/ui/feature-gate-unboxed-closures.rs b/src/test/ui/feature-gates/feature-gate-unboxed-closures.rs similarity index 100% rename from src/test/ui/feature-gate-unboxed-closures.rs rename to src/test/ui/feature-gates/feature-gate-unboxed-closures.rs diff --git a/src/test/ui/feature-gate-unboxed-closures.stderr b/src/test/ui/feature-gates/feature-gate-unboxed-closures.stderr similarity index 100% rename from src/test/ui/feature-gate-unboxed-closures.stderr rename to src/test/ui/feature-gates/feature-gate-unboxed-closures.stderr diff --git a/src/test/ui/feature-gate-underscore-imports.rs b/src/test/ui/feature-gates/feature-gate-underscore-imports.rs similarity index 100% rename from src/test/ui/feature-gate-underscore-imports.rs rename to src/test/ui/feature-gates/feature-gate-underscore-imports.rs diff --git a/src/test/ui/feature-gate-underscore-imports.stderr b/src/test/ui/feature-gates/feature-gate-underscore-imports.stderr similarity index 100% rename from src/test/ui/feature-gate-underscore-imports.stderr rename to src/test/ui/feature-gates/feature-gate-underscore-imports.stderr diff --git a/src/test/ui/feature-gate-unsized_tuple_coercion.rs b/src/test/ui/feature-gates/feature-gate-unsized_tuple_coercion.rs similarity index 100% rename from src/test/ui/feature-gate-unsized_tuple_coercion.rs rename to src/test/ui/feature-gates/feature-gate-unsized_tuple_coercion.rs diff --git a/src/test/ui/feature-gate-unsized_tuple_coercion.stderr b/src/test/ui/feature-gates/feature-gate-unsized_tuple_coercion.stderr similarity index 100% rename from src/test/ui/feature-gate-unsized_tuple_coercion.stderr rename to src/test/ui/feature-gates/feature-gate-unsized_tuple_coercion.stderr diff --git a/src/test/ui/feature-gate-untagged_unions.rs b/src/test/ui/feature-gates/feature-gate-untagged_unions.rs similarity index 100% rename from src/test/ui/feature-gate-untagged_unions.rs rename to src/test/ui/feature-gates/feature-gate-untagged_unions.rs diff --git a/src/test/ui/feature-gate-untagged_unions.stderr b/src/test/ui/feature-gates/feature-gate-untagged_unions.stderr similarity index 100% rename from src/test/ui/feature-gate-untagged_unions.stderr rename to src/test/ui/feature-gates/feature-gate-untagged_unions.stderr diff --git a/src/test/ui/feature-gate-unwind-attributes.rs b/src/test/ui/feature-gates/feature-gate-unwind-attributes.rs similarity index 100% rename from src/test/ui/feature-gate-unwind-attributes.rs rename to src/test/ui/feature-gates/feature-gate-unwind-attributes.rs diff --git a/src/test/ui/feature-gate-unwind-attributes.stderr b/src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr similarity index 100% rename from src/test/ui/feature-gate-unwind-attributes.stderr rename to src/test/ui/feature-gates/feature-gate-unwind-attributes.stderr diff --git a/src/test/ui/feature-gate-used.rs b/src/test/ui/feature-gates/feature-gate-used.rs similarity index 100% rename from src/test/ui/feature-gate-used.rs rename to src/test/ui/feature-gates/feature-gate-used.rs diff --git a/src/test/ui/feature-gate-used.stderr b/src/test/ui/feature-gates/feature-gate-used.stderr similarity index 100% rename from src/test/ui/feature-gate-used.stderr rename to src/test/ui/feature-gates/feature-gate-used.stderr diff --git a/src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs b/src/test/ui/feature-gates/feature-gate-without_gate_irrefutable_pattern.rs similarity index 100% rename from src/test/compile-fail/feature-gate-without_gate_irrefutable_pattern.rs rename to src/test/ui/feature-gates/feature-gate-without_gate_irrefutable_pattern.rs diff --git a/src/test/ui/feature-gates/feature-gate-without_gate_irrefutable_pattern.stderr b/src/test/ui/feature-gates/feature-gate-without_gate_irrefutable_pattern.stderr new file mode 100644 index 0000000000000..2b23962a3042e --- /dev/null +++ b/src/test/ui/feature-gates/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/float-literal-inference-restrictions.rs b/src/test/ui/float-literal-inference-restrictions.rs similarity index 100% rename from src/test/compile-fail/float-literal-inference-restrictions.rs rename to src/test/ui/float-literal-inference-restrictions.rs diff --git a/src/test/ui/float-literal-inference-restrictions.stderr b/src/test/ui/float-literal-inference-restrictions.stderr new file mode 100644 index 0000000000000..da8f6ed42f9b3 --- /dev/null +++ b/src/test/ui/float-literal-inference-restrictions.stderr @@ -0,0 +1,21 @@ +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 + | help: use a float literal: `1.0` + | + = 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/fn/fn-bad-block-type.rs similarity index 100% rename from src/test/compile-fail/fn-bad-block-type.rs rename to src/test/ui/fn/fn-bad-block-type.rs diff --git a/src/test/ui/fn/fn-bad-block-type.stderr b/src/test/ui/fn/fn-bad-block-type.stderr new file mode 100644 index 0000000000000..23d76e5453156 --- /dev/null +++ b/src/test/ui/fn/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/ui/fn-closure-mutable-capture.nll.stderr b/src/test/ui/fn/fn-closure-mutable-capture.nll.stderr similarity index 100% rename from src/test/ui/fn-closure-mutable-capture.nll.stderr rename to src/test/ui/fn/fn-closure-mutable-capture.nll.stderr diff --git a/src/test/ui/fn-closure-mutable-capture.rs b/src/test/ui/fn/fn-closure-mutable-capture.rs similarity index 100% rename from src/test/ui/fn-closure-mutable-capture.rs rename to src/test/ui/fn/fn-closure-mutable-capture.rs diff --git a/src/test/ui/fn-closure-mutable-capture.stderr b/src/test/ui/fn/fn-closure-mutable-capture.stderr similarity index 100% rename from src/test/ui/fn-closure-mutable-capture.stderr rename to src/test/ui/fn/fn-closure-mutable-capture.stderr diff --git a/src/test/compile-fail/fn-compare-mismatch.rs b/src/test/ui/fn/fn-compare-mismatch.rs similarity index 100% rename from src/test/compile-fail/fn-compare-mismatch.rs rename to src/test/ui/fn/fn-compare-mismatch.rs diff --git a/src/test/ui/fn/fn-compare-mismatch.stderr b/src/test/ui/fn/fn-compare-mismatch.stderr new file mode 100644 index 0000000000000..995a17e01bf15 --- /dev/null +++ b/src/test/ui/fn/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/fn/fn-item-type.rs similarity index 100% rename from src/test/compile-fail/fn-item-type.rs rename to src/test/ui/fn/fn-item-type.rs diff --git a/src/test/ui/fn/fn-item-type.stderr b/src/test/ui/fn/fn-item-type.stderr new file mode 100644 index 0000000000000..59dd4b294aacb --- /dev/null +++ b/src/test/ui/fn/fn-item-type.stderr @@ -0,0 +1,39 @@ +error[E0308]: mismatched types + --> $DIR/fn-item-type.rs:23:19 + | +LL | eq(foo::, bar::); + | ^^^^^^^^^ expected fn item, found a different fn item + | + = note: expected type `fn(isize) -> isize {foo::}` + found type `fn(isize) -> isize {bar::}` + +error[E0308]: mismatched types + --> $DIR/fn-item-type.rs:29:19 + | +LL | eq(foo::, foo::); + | ^^^^^^^^^ expected u8, found i8 + | + = note: expected type `fn(isize) -> isize {foo::}` + found type `fn(isize) -> isize {foo::}` + +error[E0308]: mismatched types + --> $DIR/fn-item-type.rs:33:23 + | +LL | eq(bar::, bar::>); + | ^^^^^^^^^^^^^^ expected struct `std::string::String`, found struct `std::vec::Vec` + | + = note: expected type `fn(isize) -> isize {bar::}` + found type `fn(isize) -> isize {bar::>}` + +error[E0308]: mismatched types + --> $DIR/fn-item-type.rs:40:26 + | +LL | eq(::foo, ::foo); + | ^^^^^^^^^^^^^^^^^ expected u8, found u16 + | + = note: expected type `fn() {::foo}` + found type `fn() {::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/fn/fn-trait-formatting.rs similarity index 100% rename from src/test/compile-fail/fn-trait-formatting.rs rename to src/test/ui/fn/fn-trait-formatting.rs diff --git a/src/test/ui/fn/fn-trait-formatting.stderr b/src/test/ui/fn/fn-trait-formatting.stderr new file mode 100644 index 0000000000000..5bf1ed76d5f46 --- /dev/null +++ b/src/test/ui/fn/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; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` + | + = note: expected type `()` + found type `std::boxed::Box` + +error[E0308]: mismatched types + --> $DIR/fn-trait-formatting.rs:20:17 + | +LL | let _: () = (box |_: isize, isize| {}) as Box; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` + | + = note: expected type `()` + found type `std::boxed::Box` + +error[E0308]: mismatched types + --> $DIR/fn-trait-formatting.rs:24:17 + | +LL | let _: () = (box || -> isize { unimplemented!() }) as Box isize>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` + | + = note: expected type `()` + found type `std::boxed::Box 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> + > +note: required by `needs_fn` + --> $DIR/fn-trait-formatting.rs:13:1 + | +LL | fn needs_fn(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/ui/for-c-in-str.rs b/src/test/ui/for/for-c-in-str.rs similarity index 100% rename from src/test/ui/for-c-in-str.rs rename to src/test/ui/for/for-c-in-str.rs diff --git a/src/test/ui/for-c-in-str.stderr b/src/test/ui/for/for-c-in-str.stderr similarity index 100% rename from src/test/ui/for-c-in-str.stderr rename to src/test/ui/for/for-c-in-str.stderr diff --git a/src/test/compile-fail/for-expn.rs b/src/test/ui/for/for-expn.rs similarity index 100% rename from src/test/compile-fail/for-expn.rs rename to src/test/ui/for/for-expn.rs diff --git a/src/test/ui/for/for-expn.stderr b/src/test/ui/for/for-expn.stderr new file mode 100644 index 0000000000000..14c2c1a6d3d27 --- /dev/null +++ b/src/test/ui/for/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/for/for-loop-bogosity.rs similarity index 100% rename from src/test/compile-fail/for-loop-bogosity.rs rename to src/test/ui/for/for-loop-bogosity.rs diff --git a/src/test/ui/for/for-loop-bogosity.stderr b/src/test/ui/for/for-loop-bogosity.stderr new file mode 100644 index 0000000000000..0476ec06c705a --- /dev/null +++ b/src/test/ui/for/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/for/for-loop-refutable-pattern-error-message.rs similarity index 100% rename from src/test/compile-fail/for-loop-refutable-pattern-error-message.rs rename to src/test/ui/for/for-loop-refutable-pattern-error-message.rs diff --git a/src/test/ui/for/for-loop-refutable-pattern-error-message.stderr b/src/test/ui/for/for-loop-refutable-pattern-error-message.stderr new file mode 100644 index 0000000000000..b76c2ffc240e1 --- /dev/null +++ b/src/test/ui/for/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/for/for-loop-type-error.rs similarity index 100% rename from src/test/compile-fail/for-loop-type-error.rs rename to src/test/ui/for/for-loop-type-error.rs diff --git a/src/test/ui/for/for-loop-type-error.stderr b/src/test/ui/for/for-loop-type-error.stderr new file mode 100644 index 0000000000000..f80a457dce34d --- /dev/null +++ b/src/test/ui/for/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/for/for-loop-unconstrained-element-type.rs similarity index 100% rename from src/test/compile-fail/for-loop-unconstrained-element-type.rs rename to src/test/ui/for/for-loop-unconstrained-element-type.rs diff --git a/src/test/ui/for/for-loop-unconstrained-element-type.stderr b/src/test/ui/for/for-loop-unconstrained-element-type.stderr new file mode 100644 index 0000000000000..c3723c52fda2b --- /dev/null +++ b/src/test/ui/for/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/foreign-fn-return-lifetime.rs similarity index 100% rename from src/test/compile-fail/foreign-fn-return-lifetime.rs rename to src/test/ui/foreign-fn-return-lifetime.rs diff --git a/src/test/ui/foreign-fn-return-lifetime.stderr b/src/test/ui/foreign-fn-return-lifetime.stderr new file mode 100644 index 0000000000000..ea15897b3d694 --- /dev/null +++ b/src/test/ui/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/foreign-unsafe-fn-called.rs similarity index 100% rename from src/test/compile-fail/foreign-unsafe-fn-called.rs rename to src/test/ui/foreign-unsafe-fn-called.rs diff --git a/src/test/ui/foreign-unsafe-fn-called.stderr b/src/test/ui/foreign-unsafe-fn-called.stderr new file mode 100644 index 0000000000000..498dd04e08fe9 --- /dev/null +++ b/src/test/ui/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/fully-qualified-type/fully-qualified-type-name1.rs similarity index 100% rename from src/test/compile-fail/fully-qualified-type-name1.rs rename to src/test/ui/fully-qualified-type/fully-qualified-type-name1.rs diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name1.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name1.stderr new file mode 100644 index 0000000000000..55553c084c9d0 --- /dev/null +++ b/src/test/ui/fully-qualified-type/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` + 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/fully-qualified-type/fully-qualified-type-name2.rs similarity index 100% rename from src/test/compile-fail/fully-qualified-type-name2.rs rename to src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr new file mode 100644 index 0000000000000..f2881894b0a71 --- /dev/null +++ b/src/test/ui/fully-qualified-type/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/fully-qualified-type/fully-qualified-type-name3.rs similarity index 100% rename from src/test/compile-fail/fully-qualified-type-name3.rs rename to src/test/ui/fully-qualified-type/fully-qualified-type-name3.rs diff --git a/src/test/compile-fail/fully-qualified-type-name4.rs b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs similarity index 100% rename from src/test/compile-fail/fully-qualified-type-name4.rs rename to src/test/ui/fully-qualified-type/fully-qualified-type-name4.rs diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name4.stderr new file mode 100644 index 0000000000000..eb855484468d0 --- /dev/null +++ b/src/test/ui/fully-qualified-type/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` + 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/functional-struct-update/functional-struct-update-noncopyable.nll.stderr b/src/test/ui/functional-struct-update/functional-struct-update-noncopyable.nll.stderr new file mode 100644 index 0000000000000..832b570512a45 --- /dev/null +++ b/src/test/ui/functional-struct-update/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/functional-struct-update/functional-struct-update-noncopyable.rs similarity index 100% rename from src/test/compile-fail/functional-struct-update-noncopyable.rs rename to src/test/ui/functional-struct-update/functional-struct-update-noncopyable.rs diff --git a/src/test/ui/functional-struct-update/functional-struct-update-noncopyable.stderr b/src/test/ui/functional-struct-update/functional-struct-update-noncopyable.stderr new file mode 100644 index 0000000000000..ad4fb97ae09ee --- /dev/null +++ b/src/test/ui/functional-struct-update/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/functional-struct-update/functional-struct-update-respects-privacy.rs similarity index 100% rename from src/test/compile-fail/functional-struct-update-respects-privacy.rs rename to src/test/ui/functional-struct-update/functional-struct-update-respects-privacy.rs diff --git a/src/test/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr b/src/test/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr new file mode 100644 index 0000000000000..35a2f8460b64b --- /dev/null +++ b/src/test/ui/functional-struct-update/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/future-incompatible-lint-group.rs similarity index 100% rename from src/test/compile-fail/future-incompatible-lint-group.rs rename to src/test/ui/future-incompatible-lint-group.rs diff --git a/src/test/ui/future-incompatible-lint-group.stderr b/src/test/ui/future-incompatible-lint-group.stderr new file mode 100644 index 0000000000000..56f4ff33eb2d8 --- /dev/null +++ b/src/test/ui/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 + +error: aborting due to previous error + diff --git a/src/test/compile-fail/gated-attr-literals.rs b/src/test/ui/gated-attr-literals.rs similarity index 100% rename from src/test/compile-fail/gated-attr-literals.rs rename to src/test/ui/gated-attr-literals.rs diff --git a/src/test/ui/gated-attr-literals.stderr b/src/test/ui/gated-attr-literals.stderr new file mode 100644 index 0000000000000..e69b6488599f9 --- /dev/null +++ b/src/test/ui/gated-attr-literals.stderr @@ -0,0 +1,91 @@ +error[E0658]: non-string literals in attributes, or string literals in top-level positions, are experimental (see issue #34981) + --> $DIR/gated-attr-literals.rs:18:1 + | +LL | #[fake_attr(100)] + | ^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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:20:1 + | +LL | #[fake_attr(1, 2, 3)] + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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:22:1 + | +LL | #[fake_attr("hello")] + | ^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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(1, "hi", key = 12, true, false)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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:27:1 + | +LL | #[fake_attr(key = "hello", val = 10)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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:29:1 + | +LL | #[fake_attr(key("hello"), val(10))] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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:31:1 + | +LL | #[fake_attr(enabled = true, disabled = false)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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:33:1 + | +LL | #[fake_attr(true)] + | ^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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:35:1 + | +LL | #[fake_attr(pi = 3.14159)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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:37:1 + | +LL | #[fake_attr(b"hi")] + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] 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:39:1 + | +LL | #[fake_doc(r"doc")] + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(attr_literals)] to the crate attributes to enable + +error: aborting due to 11 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/gated-bad-feature.rs similarity index 100% rename from src/test/compile-fail/gated-bad-feature.rs rename to src/test/ui/gated-bad-feature.rs diff --git a/src/test/ui/gated-bad-feature.stderr b/src/test/ui/gated-bad-feature.stderr new file mode 100644 index 0000000000000..2bed241d68cab --- /dev/null +++ b/src/test/ui/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/generator-yielding-or-returning-itself.rs similarity index 100% rename from src/test/compile-fail/generator-yielding-or-returning-itself.rs rename to src/test/ui/generator-yielding-or-returning-itself.rs diff --git a/src/test/ui/generator-yielding-or-returning-itself.stderr b/src/test/ui/generator-yielding-or-returning-itself.stderr new file mode 100644 index 0000000000000..a52e717ebae03 --- /dev/null +++ b/src/test/ui/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) +LL | | where T: Generator +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) +LL | | where T: Generator +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/generic/generic-extern-lifetime.rs similarity index 100% rename from src/test/compile-fail/generic-extern-lifetime.rs rename to src/test/ui/generic/generic-extern-lifetime.rs diff --git a/src/test/ui/generic/generic-extern-lifetime.stderr b/src/test/ui/generic/generic-extern-lifetime.stderr new file mode 100644 index 0000000000000..9276ae0d41253 --- /dev/null +++ b/src/test/ui/generic/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/generic/generic-extern.rs similarity index 100% rename from src/test/compile-fail/generic-extern.rs rename to src/test/ui/generic/generic-extern.rs diff --git a/src/test/ui/generic/generic-extern.stderr b/src/test/ui/generic/generic-extern.stderr new file mode 100644 index 0000000000000..c1ba2cced547a --- /dev/null +++ b/src/test/ui/generic/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(); //~ 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/generic/generic-impl-less-params-with-defaults.rs similarity index 100% rename from src/test/compile-fail/generic-impl-less-params-with-defaults.rs rename to src/test/ui/generic/generic-impl-less-params-with-defaults.rs diff --git a/src/test/ui/generic/generic-impl-less-params-with-defaults.stderr b/src/test/ui/generic/generic-impl-less-params-with-defaults.stderr new file mode 100644 index 0000000000000..a10b500f9f8b8 --- /dev/null +++ b/src/test/ui/generic/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::::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/generic/generic-impl-more-params-with-defaults.rs similarity index 100% rename from src/test/compile-fail/generic-impl-more-params-with-defaults.rs rename to src/test/ui/generic/generic-impl-more-params-with-defaults.rs diff --git a/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr b/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr new file mode 100644 index 0000000000000..6b54baefb1dd3 --- /dev/null +++ b/src/test/ui/generic/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::::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/generic/generic-lifetime-trait-impl.rs similarity index 100% rename from src/test/compile-fail/generic-lifetime-trait-impl.rs rename to src/test/ui/generic/generic-lifetime-trait-impl.rs diff --git a/src/test/ui/generic/generic-lifetime-trait-impl.stderr b/src/test/ui/generic/generic-lifetime-trait-impl.stderr new file mode 100644 index 0000000000000..182eab0a69b21 --- /dev/null +++ b/src/test/ui/generic/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>(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/generic/generic-no-mangle.rs similarity index 100% rename from src/test/compile-fail/generic-no-mangle.rs rename to src/test/ui/generic/generic-no-mangle.rs diff --git a/src/test/ui/generic/generic-no-mangle.stderr b/src/test/ui/generic/generic-no-mangle.stderr new file mode 100644 index 0000000000000..4eaa3973329c9 --- /dev/null +++ b/src/test/ui/generic/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() {} //~ 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() {} //~ 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/generic/generic-non-trailing-defaults.rs similarity index 100% rename from src/test/compile-fail/generic-non-trailing-defaults.rs rename to src/test/ui/generic/generic-non-trailing-defaults.rs diff --git a/src/test/ui/generic/generic-non-trailing-defaults.stderr b/src/test/ui/generic/generic-non-trailing-defaults.stderr new file mode 100644 index 0000000000000..ce8badf6d30bc --- /dev/null +++ b/src/test/ui/generic/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, T); + | ^ + +error: type parameters with a default must be trailing + --> $DIR/generic-non-trailing-defaults.rs:16:15 + | +LL | struct Foo, 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, 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/ui/generic-param-attrs.rs b/src/test/ui/generic/generic-param-attrs.rs similarity index 100% rename from src/test/ui/generic-param-attrs.rs rename to src/test/ui/generic/generic-param-attrs.rs diff --git a/src/test/ui/generic-type-less-params-with-defaults.rs b/src/test/ui/generic/generic-type-less-params-with-defaults.rs similarity index 100% rename from src/test/ui/generic-type-less-params-with-defaults.rs rename to src/test/ui/generic/generic-type-less-params-with-defaults.rs diff --git a/src/test/ui/generic-type-less-params-with-defaults.stderr b/src/test/ui/generic/generic-type-less-params-with-defaults.stderr similarity index 100% rename from src/test/ui/generic-type-less-params-with-defaults.stderr rename to src/test/ui/generic/generic-type-less-params-with-defaults.stderr diff --git a/src/test/ui/generic-type-more-params-with-defaults.rs b/src/test/ui/generic/generic-type-more-params-with-defaults.rs similarity index 100% rename from src/test/ui/generic-type-more-params-with-defaults.rs rename to src/test/ui/generic/generic-type-more-params-with-defaults.rs diff --git a/src/test/ui/generic-type-more-params-with-defaults.stderr b/src/test/ui/generic/generic-type-more-params-with-defaults.stderr similarity index 100% rename from src/test/ui/generic-type-more-params-with-defaults.stderr rename to src/test/ui/generic/generic-type-more-params-with-defaults.stderr diff --git a/src/test/compile-fail/generic-type-params-forward-mention.rs b/src/test/ui/generic/generic-type-params-forward-mention.rs similarity index 100% rename from src/test/compile-fail/generic-type-params-forward-mention.rs rename to src/test/ui/generic/generic-type-params-forward-mention.rs diff --git a/src/test/ui/generic/generic-type-params-forward-mention.stderr b/src/test/ui/generic/generic-type-params-forward-mention.stderr new file mode 100644 index 0000000000000..542716326f1b2 --- /dev/null +++ b/src/test/ui/generic/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, 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/generic/generic-type-params-name-repr.rs similarity index 100% rename from src/test/compile-fail/generic-type-params-name-repr.rs rename to src/test/ui/generic/generic-type-params-name-repr.rs diff --git a/src/test/ui/generic/generic-type-params-name-repr.stderr b/src/test/ui/generic/generic-type-params-name-repr.stderr new file mode 100644 index 0000000000000..1c65aeadae605 --- /dev/null +++ b/src/test/ui/generic/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 = (); + | ^^ expected struct `Foo`, found () + | + = note: expected type `Foo` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:30:31 + | +LL | let _: Foo = (); + | ^^ expected struct `Foo`, found () + | + = note: expected type `Foo` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:37:37 + | +LL | let _: HashMap = (); + | ^^ expected struct `HashMap`, found () + | + = note: expected type `HashMap` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:42:51 + | +LL | let _: HashMap> = (); + | ^^ expected struct `HashMap`, found () + | + = note: expected type `HashMap` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:49:31 + | +LL | let _: Foo = (); + | ^^ expected struct `Foo`, found () + | + = note: expected type `Foo` + found type `()` + +error[E0308]: mismatched types + --> $DIR/generic-type-params-name-repr.rs:56:27 + | +LL | let _: Foo = (); + | ^^ 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/glob-cycles.rs similarity index 100% rename from src/test/compile-fail/glob-cycles.rs rename to src/test/ui/glob-cycles.rs diff --git a/src/test/ui/glob-cycles.stderr b/src/test/ui/glob-cycles.stderr new file mode 100644 index 0000000000000..a9fd9306e2140 --- /dev/null +++ b/src/test/ui/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/glob-resolve1.rs similarity index 100% rename from src/test/compile-fail/glob-resolve1.rs rename to src/test/ui/glob-resolve1.rs diff --git a/src/test/ui/glob-resolve1.stderr b/src/test/ui/glob-resolve1.stderr new file mode 100644 index 0000000000000..650dd2c3b19e3 --- /dev/null +++ b/src/test/ui/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::(); //~ 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::(); //~ 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::(); //~ 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/hashmap-iter-value-lifetime.nll.stderr b/src/test/ui/hashmap-iter-value-lifetime.nll.stderr new file mode 100644 index 0000000000000..ec52d19cd1c58 --- /dev/null +++ b/src/test/ui/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/hashmap-iter-value-lifetime.rs similarity index 100% rename from src/test/compile-fail/hashmap-iter-value-lifetime.rs rename to src/test/ui/hashmap-iter-value-lifetime.rs diff --git a/src/test/ui/hashmap-iter-value-lifetime.stderr b/src/test/ui/hashmap-iter-value-lifetime.stderr new file mode 100644 index 0000000000000..16e9c52739139 --- /dev/null +++ b/src/test/ui/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/hashmap-lifetimes.rs similarity index 95% rename from src/test/compile-fail/hashmap-lifetimes.rs rename to src/test/ui/hashmap-lifetimes.rs index 6858599f63a8a..9418c34cbfdaa 100644 --- a/src/test/compile-fail/hashmap-lifetimes.rs +++ b/src/test/ui/hashmap-lifetimes.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + fn main() { let mut my_stuff = std::collections::HashMap::new(); my_stuff.insert(0, 42); diff --git a/src/test/ui/hashmap-lifetimes.stderr b/src/test/ui/hashmap-lifetimes.stderr new file mode 100644 index 0000000000000..eb129848ed2d6 --- /dev/null +++ b/src/test/ui/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:18: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/hidden-rt-injection.rs similarity index 100% rename from src/test/compile-fail/hidden-rt-injection.rs rename to src/test/ui/hidden-rt-injection.rs diff --git a/src/test/ui/hidden-rt-injection.stderr b/src/test/ui/hidden-rt-injection.stderr new file mode 100644 index 0000000000000..103cdf0548513 --- /dev/null +++ b/src/test/ui/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/hidden-rt-injection2.rs similarity index 100% rename from src/test/compile-fail/hidden-rt-injection2.rs rename to src/test/ui/hidden-rt-injection2.rs diff --git a/src/test/ui/hidden-rt-injection2.stderr b/src/test/ui/hidden-rt-injection2.stderr new file mode 100644 index 0000000000000..df0527f307a56 --- /dev/null +++ b/src/test/ui/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/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.stderr new file mode 100644 index 0000000000000..d668a931459d8 --- /dev/null +++ b/src/test/ui/hr-subtype/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 fn(&'a u32, &'b u32) -> &'a u32>` + found type `std::option::Option 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/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.stderr new file mode 100644 index 0000000000000..23854f9c147a0 --- /dev/null +++ b/src/test/ui/hr-subtype/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 fn(&'a u32, &'b u32)>` + found type `std::option::Option 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/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_a.stderr new file mode 100644 index 0000000000000..01a9f578fbc91 --- /dev/null +++ b/src/test/ui/hr-subtype/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/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_bound_b.stderr new file mode 100644 index 0000000000000..01a9f578fbc91 --- /dev/null +++ b/src/test/ui/hr-subtype/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/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_a_vs_free_x.stderr new file mode 100644 index 0000000000000..14e498593f314 --- /dev/null +++ b/src/test/ui/hr-subtype/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 fn(&'a u32)>` + 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/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.stderr new file mode 100644 index 0000000000000..a66a4ace9103a --- /dev/null +++ b/src/test/ui/hr-subtype/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 fn(Co<'a>, Co<'b>)>` + found type `std::option::Option 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/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.stderr new file mode 100644 index 0000000000000..9f94b45140c06 --- /dev/null +++ b/src/test/ui/hr-subtype/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 fn(Co<'a>, Co<'b>) -> Contra<'a>>` + found type `std::option::Option 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/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.stderr new file mode 100644 index 0000000000000..01a9f578fbc91 --- /dev/null +++ b/src/test/ui/hr-subtype/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/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.stderr new file mode 100644 index 0000000000000..511369703baed --- /dev/null +++ b/src/test/ui/hr-subtype/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 fn(Contra<'a>, Contra<'b>) -> Co<'a>>` + found type `std::option::Option 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/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.stderr new file mode 100644 index 0000000000000..d39d5f76a6e86 --- /dev/null +++ b/src/test/ui/hr-subtype/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 fn(Inv<'a>, Inv<'b>)>` + found type `std::option::Option 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/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr b/src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.stderr new file mode 100644 index 0000000000000..01a9f578fbc91 --- /dev/null +++ b/src/test/ui/hr-subtype/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/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.nll.stderr new file mode 100644 index 0000000000000..1999df909ed2b --- /dev/null +++ b/src/test/ui/hr-subtype/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/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_inv_x_vs_free_inv_y.stderr new file mode 100644 index 0000000000000..bf562700bb4f9 --- /dev/null +++ b/src/test/ui/hr-subtype/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)>` + found type `std::option::Option)>` +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)>` + found type `std::option::Option)>` +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/hr-subtype/hr-subtype.free_x_vs_free_x.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_x.stderr new file mode 100644 index 0000000000000..01a9f578fbc91 --- /dev/null +++ b/src/test/ui/hr-subtype/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/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.nll.stderr new file mode 100644 index 0000000000000..f76b26b5191d3 --- /dev/null +++ b/src/test/ui/hr-subtype/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/hr-subtype/hr-subtype.free_x_vs_free_y.stderr b/src/test/ui/hr-subtype/hr-subtype.free_x_vs_free_y.stderr new file mode 100644 index 0000000000000..228f6db38fb86 --- /dev/null +++ b/src/test/ui/hr-subtype/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` + found type `std::option::Option` +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/hr-subtype/hr-subtype.rs similarity index 100% rename from src/test/compile-fail/hr-subtype.rs rename to src/test/ui/hr-subtype/hr-subtype.rs diff --git a/src/test/compile-fail/hrtb-conflate-regions.rs b/src/test/ui/hrtb/hrtb-conflate-regions.rs similarity index 100% rename from src/test/compile-fail/hrtb-conflate-regions.rs rename to src/test/ui/hrtb/hrtb-conflate-regions.rs diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.stderr new file mode 100644 index 0000000000000..42778c129600c --- /dev/null +++ b/src/test/ui/hrtb/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::(); } //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Foo<(&'a isize, &'b isize)>` is not implemented for `SomeStruct` + | + = help: the following implementations were found: + > +note: required by `want_foo2` + --> $DIR/hrtb-conflate-regions.rs:18:1 + | +LL | / fn want_foo2() +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/hrtb/hrtb-debruijn-in-receiver.nll.stderr b/src/test/ui/hrtb/hrtb-debruijn-in-receiver.nll.stderr new file mode 100644 index 0000000000000..0697022932504 --- /dev/null +++ b/src/test/ui/hrtb/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/hrtb/hrtb-debruijn-in-receiver.rs similarity index 100% rename from src/test/compile-fail/hrtb-debruijn-in-receiver.rs rename to src/test/ui/hrtb/hrtb-debruijn-in-receiver.rs diff --git a/src/test/ui/hrtb/hrtb-debruijn-in-receiver.stderr b/src/test/ui/hrtb/hrtb-debruijn-in-receiver.stderr new file mode 100644 index 0000000000000..9a560caf5e9c1 --- /dev/null +++ b/src/test/ui/hrtb/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/hrtb/hrtb-higher-ranker-supertraits-transitive.rs similarity index 100% rename from src/test/compile-fail/hrtb-higher-ranker-supertraits-transitive.rs rename to src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.rs diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr new file mode 100644 index 0000000000000..dca9feab201e2 --- /dev/null +++ b/src/test/ui/hrtb/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) +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/hrtb/hrtb-higher-ranker-supertraits.rs similarity index 100% rename from src/test/compile-fail/hrtb-higher-ranker-supertraits.rs rename to src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr new file mode 100644 index 0000000000000..ad069e10182c9 --- /dev/null +++ b/src/test/ui/hrtb/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) +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) +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/hrtb/hrtb-identity-fn-borrows.ast.nll.stderr b/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.nll.stderr new file mode 100644 index 0000000000000..e533ecc6eb04f --- /dev/null +++ b/src/test/ui/hrtb/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/hrtb/hrtb-identity-fn-borrows.ast.stderr b/src/test/ui/hrtb/hrtb-identity-fn-borrows.ast.stderr new file mode 100644 index 0000000000000..6888ec9bddbf0 --- /dev/null +++ b/src/test/ui/hrtb/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/hrtb/hrtb-identity-fn-borrows.mir.stderr b/src/test/ui/hrtb/hrtb-identity-fn-borrows.mir.stderr new file mode 100644 index 0000000000000..e533ecc6eb04f --- /dev/null +++ b/src/test/ui/hrtb/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/hrtb/hrtb-identity-fn-borrows.rs similarity index 100% rename from src/test/compile-fail/hrtb-identity-fn-borrows.rs rename to src/test/ui/hrtb/hrtb-identity-fn-borrows.rs diff --git a/src/test/compile-fail/hrtb-just-for-static.rs b/src/test/ui/hrtb/hrtb-just-for-static.rs similarity index 100% rename from src/test/compile-fail/hrtb-just-for-static.rs rename to src/test/ui/hrtb/hrtb-just-for-static.rs diff --git a/src/test/ui/hrtb/hrtb-just-for-static.stderr b/src/test/ui/hrtb/hrtb-just-for-static.stderr new file mode 100644 index 0000000000000..615a8b3bde5b8 --- /dev/null +++ b/src/test/ui/hrtb/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::() //~ 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: + > +note: required by `want_hrtb` + --> $DIR/hrtb-just-for-static.rs:18:1 + | +LL | / fn want_hrtb() +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/hrtb/hrtb-perfect-forwarding.rs similarity index 100% rename from src/test/compile-fail/hrtb-perfect-forwarding.rs rename to src/test/ui/hrtb/hrtb-perfect-forwarding.rs diff --git a/src/test/ui/hrtb/hrtb-perfect-forwarding.stderr b/src/test/ui/hrtb/hrtb-perfect-forwarding.stderr new file mode 100644 index 0000000000000..5e8674df0537d --- /dev/null +++ b/src/test/ui/hrtb/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/huge-array-simple.rs similarity index 100% rename from src/test/compile-fail/huge-array-simple.rs rename to src/test/ui/huge-array-simple.rs diff --git a/src/test/compile-fail/huge-array.rs b/src/test/ui/huge-array.rs similarity index 100% rename from src/test/compile-fail/huge-array.rs rename to src/test/ui/huge-array.rs diff --git a/src/test/ui/huge-array.stderr b/src/test/ui/huge-array.stderr new file mode 100644 index 0000000000000..38d9effcfb527 --- /dev/null +++ b/src/test/ui/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/huge-enum.rs similarity index 92% rename from src/test/compile-fail/huge-enum.rs rename to src/test/ui/huge-enum.rs index 6e7c05370b99d..17e20766bab1b 100644 --- a/src/test/compile-fail/huge-enum.rs +++ b/src/test/ui/huge-enum.rs @@ -9,6 +9,7 @@ // except according to those terms. // error-pattern: Option +// normalize-stderr-test "<\[u32; \d+\]>" -> "<[u32; N]>" // FIXME: work properly with higher limits diff --git a/src/test/ui/huge-enum.stderr b/src/test/ui/huge-enum.stderr new file mode 100644 index 0000000000000..b7cf25504614a --- /dev/null +++ b/src/test/ui/huge-enum.stderr @@ -0,0 +1,4 @@ +error: the type `std::option::Option<[u32; N]>` 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/huge-struct.rs similarity index 92% rename from src/test/compile-fail/huge-struct.rs rename to src/test/ui/huge-struct.rs index a10c61d6606d0..c935ad92e4425 100644 --- a/src/test/compile-fail/huge-struct.rs +++ b/src/test/ui/huge-struct.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test "S32" -> "SXX" +// normalize-stderr-test "S1M" -> "SXX" // error-pattern: too big for the current struct S32 { diff --git a/src/test/ui/huge-struct.stderr b/src/test/ui/huge-struct.stderr new file mode 100644 index 0000000000000..06b084bdc3a39 --- /dev/null +++ b/src/test/ui/huge-struct.stderr @@ -0,0 +1,4 @@ +error: the type `SXX>>` 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/hygiene/hygienic-label-1.rs similarity index 100% rename from src/test/compile-fail/hygienic-label-1.rs rename to src/test/ui/hygiene/hygienic-label-1.rs diff --git a/src/test/ui/hygiene/hygienic-label-1.stderr b/src/test/ui/hygiene/hygienic-label-1.stderr new file mode 100644 index 0000000000000..051466b183d03 --- /dev/null +++ b/src/test/ui/hygiene/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/hygiene/hygienic-label-2.rs similarity index 100% rename from src/test/compile-fail/hygienic-label-2.rs rename to src/test/ui/hygiene/hygienic-label-2.rs diff --git a/src/test/ui/hygiene/hygienic-label-2.stderr b/src/test/ui/hygiene/hygienic-label-2.stderr new file mode 100644 index 0000000000000..081c1c7e69e73 --- /dev/null +++ b/src/test/ui/hygiene/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/hygiene/hygienic-label-3.rs similarity index 100% rename from src/test/compile-fail/hygienic-label-3.rs rename to src/test/ui/hygiene/hygienic-label-3.rs diff --git a/src/test/ui/hygiene/hygienic-label-3.stderr b/src/test/ui/hygiene/hygienic-label-3.stderr new file mode 100644 index 0000000000000..e5593df49f428 --- /dev/null +++ b/src/test/ui/hygiene/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/hygiene/hygienic-label-4.rs similarity index 100% rename from src/test/compile-fail/hygienic-label-4.rs rename to src/test/ui/hygiene/hygienic-label-4.rs diff --git a/src/test/ui/hygiene/hygienic-label-4.stderr b/src/test/ui/hygiene/hygienic-label-4.stderr new file mode 100644 index 0000000000000..60351386a0b0a --- /dev/null +++ b/src/test/ui/hygiene/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/if/if-branch-types.rs similarity index 100% rename from src/test/compile-fail/if-branch-types.rs rename to src/test/ui/if/if-branch-types.rs diff --git a/src/test/ui/if/if-branch-types.stderr b/src/test/ui/if/if-branch-types.stderr new file mode 100644 index 0000000000000..cefd94dc99b6c --- /dev/null +++ b/src/test/ui/if/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/ui/if-let-arm-types.rs b/src/test/ui/if/if-let-arm-types.rs similarity index 100% rename from src/test/ui/if-let-arm-types.rs rename to src/test/ui/if/if-let-arm-types.rs diff --git a/src/test/ui/if-let-arm-types.stderr b/src/test/ui/if/if-let-arm-types.stderr similarity index 100% rename from src/test/ui/if-let-arm-types.stderr rename to src/test/ui/if/if-let-arm-types.stderr diff --git a/src/test/compile-fail/if-let.rs b/src/test/ui/if/if-let.rs similarity index 100% rename from src/test/compile-fail/if-let.rs rename to src/test/ui/if/if-let.rs diff --git a/src/test/ui/if/if-let.stderr b/src/test/ui/if/if-let.stderr new file mode 100644 index 0000000000000..de8d6feb3c4c8 --- /dev/null +++ b/src/test/ui/if/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/if/if-loop.rs similarity index 100% rename from src/test/compile-fail/if-loop.rs rename to src/test/ui/if/if-loop.rs diff --git a/src/test/ui/if/if-loop.stderr b/src/test/ui/if/if-loop.stderr new file mode 100644 index 0000000000000..6862560570d73 --- /dev/null +++ b/src/test/ui/if/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/if/if-typeck.rs similarity index 100% rename from src/test/compile-fail/if-typeck.rs rename to src/test/ui/if/if-typeck.rs diff --git a/src/test/ui/if/if-typeck.stderr b/src/test/ui/if/if-typeck.stderr new file mode 100644 index 0000000000000..6d96f8bf223d0 --- /dev/null +++ b/src/test/ui/if/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/ui/if-without-block.rs b/src/test/ui/if/if-without-block.rs similarity index 100% rename from src/test/ui/if-without-block.rs rename to src/test/ui/if/if-without-block.rs diff --git a/src/test/ui/if-without-block.stderr b/src/test/ui/if/if-without-block.stderr similarity index 100% rename from src/test/ui/if-without-block.stderr rename to src/test/ui/if/if-without-block.stderr diff --git a/src/test/compile-fail/if-without-else-result.rs b/src/test/ui/if/if-without-else-result.rs similarity index 100% rename from src/test/compile-fail/if-without-else-result.rs rename to src/test/ui/if/if-without-else-result.rs diff --git a/src/test/ui/if/if-without-else-result.stderr b/src/test/ui/if/if-without-else-result.stderr new file mode 100644 index 0000000000000..ab97f6c81f79d --- /dev/null +++ b/src/test/ui/if/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/ui/ifmt-bad-arg.rs b/src/test/ui/if/ifmt-bad-arg.rs similarity index 100% rename from src/test/ui/ifmt-bad-arg.rs rename to src/test/ui/if/ifmt-bad-arg.rs diff --git a/src/test/ui/ifmt-bad-arg.stderr b/src/test/ui/if/ifmt-bad-arg.stderr similarity index 100% rename from src/test/ui/ifmt-bad-arg.stderr rename to src/test/ui/if/ifmt-bad-arg.stderr diff --git a/src/test/compile-fail/ifmt-bad-format-args.rs b/src/test/ui/if/ifmt-bad-format-args.rs similarity index 100% rename from src/test/compile-fail/ifmt-bad-format-args.rs rename to src/test/ui/if/ifmt-bad-format-args.rs diff --git a/src/test/ui/if/ifmt-bad-format-args.stderr b/src/test/ui/if/ifmt-bad-format-args.stderr new file mode 100644 index 0000000000000..d2fe12925d78d --- /dev/null +++ b/src/test/ui/if/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/if/ifmt-unimpl.rs similarity index 100% rename from src/test/compile-fail/ifmt-unimpl.rs rename to src/test/ui/if/ifmt-unimpl.rs diff --git a/src/test/ui/if/ifmt-unimpl.stderr b/src/test/ui/if/ifmt-unimpl.stderr new file mode 100644 index 0000000000000..fbb3136693a27 --- /dev/null +++ b/src/test/ui/if/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/if/ifmt-unknown-trait.rs similarity index 100% rename from src/test/compile-fail/ifmt-unknown-trait.rs rename to src/test/ui/if/ifmt-unknown-trait.rs diff --git a/src/test/ui/if/ifmt-unknown-trait.stderr b/src/test/ui/if/ifmt-unknown-trait.stderr new file mode 100644 index 0000000000000..3c746e4c53b51 --- /dev/null +++ b/src/test/ui/if/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/illegal-ufcs-drop.rs similarity index 100% rename from src/test/compile-fail/illegal-ufcs-drop.rs rename to src/test/ui/illegal-ufcs-drop.rs diff --git a/src/test/ui/illegal-ufcs-drop.stderr b/src/test/ui/illegal-ufcs-drop.stderr new file mode 100644 index 0000000000000..f82c54664a9a1 --- /dev/null +++ b/src/test/ui/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/immut-function-arguments.ast.nll.stderr b/src/test/ui/immut-function-arguments.ast.nll.stderr new file mode 100644 index 0000000000000..c823634062740 --- /dev/null +++ b/src/test/ui/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) { + | - 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| { *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/immut-function-arguments.ast.stderr b/src/test/ui/immut-function-arguments.ast.stderr new file mode 100644 index 0000000000000..54125b955cb1f --- /dev/null +++ b/src/test/ui/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) { + | - 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| { *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/immut-function-arguments.mir.stderr b/src/test/ui/immut-function-arguments.mir.stderr new file mode 100644 index 0000000000000..c823634062740 --- /dev/null +++ b/src/test/ui/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) { + | - 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| { *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/immut-function-arguments.rs similarity index 100% rename from src/test/compile-fail/immut-function-arguments.rs rename to src/test/ui/immut-function-arguments.rs diff --git a/src/test/compile-fail/impl-bounds-checking.rs b/src/test/ui/impl-bounds-checking.rs similarity index 100% rename from src/test/compile-fail/impl-bounds-checking.rs rename to src/test/ui/impl-bounds-checking.rs diff --git a/src/test/ui/impl-bounds-checking.stderr b/src/test/ui/impl-bounds-checking.stderr new file mode 100644 index 0000000000000..80666131b2ca6 --- /dev/null +++ b/src/test/ui/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 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/impl-trait/impl-generic-mismatch-ab.rs similarity index 100% rename from src/test/compile-fail/impl-trait/impl-generic-mismatch-ab.rs rename to src/test/ui/impl-trait/impl-generic-mismatch-ab.rs diff --git a/src/test/ui/impl-trait/impl-generic-mismatch-ab.stderr b/src/test/ui/impl-trait/impl-generic-mismatch-ab.stderr new file mode 100644 index 0000000000000..77ecdf2f5acf0 --- /dev/null +++ b/src/test/ui/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(&self, a: &A, b: &impl Debug); + | -- type in trait +... +LL | fn foo(&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/ui/impl_trait_projections.rs b/src/test/ui/impl-trait/impl_trait_projections.rs similarity index 100% rename from src/test/ui/impl_trait_projections.rs rename to src/test/ui/impl-trait/impl_trait_projections.rs diff --git a/src/test/ui/impl_trait_projections.stderr b/src/test/ui/impl-trait/impl_trait_projections.stderr similarity index 100% rename from src/test/ui/impl_trait_projections.stderr rename to src/test/ui/impl-trait/impl_trait_projections.stderr diff --git a/src/test/compile-fail/impl-trait/infinite-impl-trait-issue-38064.rs b/src/test/ui/impl-trait/infinite-impl-trait-issue-38064.rs similarity index 100% rename from src/test/compile-fail/impl-trait/infinite-impl-trait-issue-38064.rs rename to src/test/ui/impl-trait/infinite-impl-trait-issue-38064.rs diff --git a/src/test/ui/impl-trait/infinite-impl-trait-issue-38064.stderr b/src/test/ui/impl-trait/infinite-impl-trait-issue-38064.stderr new file mode 100644 index 0000000000000..f260cce647bd2 --- /dev/null +++ b/src/test/ui/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/impl-trait/must_outlive_least_region_or_bound.nll.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.nll.stderr new file mode 100644 index 0000000000000..6d581952ac944 --- /dev/null +++ b/src/test/ui/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(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/impl-trait/must_outlive_least_region_or_bound.rs similarity index 100% rename from src/test/compile-fail/impl-trait/must_outlive_least_region_or_bound.rs rename to src/test/ui/impl-trait/must_outlive_least_region_or_bound.rs diff --git a/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr b/src/test/ui/impl-trait/must_outlive_least_region_or_bound.stderr new file mode 100644 index 0000000000000..48686cbcaf232 --- /dev/null +++ b/src/test/ui/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(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(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/impl-trait/needs_least_region_or_bound.rs similarity index 100% rename from src/test/compile-fail/impl-trait/needs_least_region_or_bound.rs rename to src/test/ui/impl-trait/needs_least_region_or_bound.rs diff --git a/src/test/ui/impl-trait/needs_least_region_or_bound.stderr b/src/test/ui/impl-trait/needs_least_region_or_bound.stderr new file mode 100644 index 0000000000000..fd2665dc76220 --- /dev/null +++ b/src/test/ui/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/impl-trait/no-trait.rs similarity index 100% rename from src/test/compile-fail/impl-trait/no-trait.rs rename to src/test/ui/impl-trait/no-trait.rs diff --git a/src/test/ui/impl-trait/no-trait.stderr b/src/test/ui/impl-trait/no-trait.stderr new file mode 100644 index 0000000000000..fdd01c87d1c99 --- /dev/null +++ b/src/test/ui/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/impl-trait/type_parameters_captured.nll.stderr b/src/test/ui/impl-trait/type_parameters_captured.nll.stderr new file mode 100644 index 0000000000000..823ee4467299e --- /dev/null +++ b/src/test/ui/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(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/impl-trait/type_parameters_captured.rs similarity index 100% rename from src/test/compile-fail/impl-trait/type_parameters_captured.rs rename to src/test/ui/impl-trait/type_parameters_captured.rs diff --git a/src/test/ui/impl-trait/type_parameters_captured.stderr b/src/test/ui/impl-trait/type_parameters_captured.stderr new file mode 100644 index 0000000000000..3b9b0e08a45a2 --- /dev/null +++ b/src/test/ui/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(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(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/impl-trait/where-allowed.rs similarity index 100% rename from src/test/compile-fail/impl-trait/where-allowed.rs rename to src/test/ui/impl-trait/where-allowed.rs diff --git a/src/test/ui/impl-trait/where-allowed.stderr b/src/test/ui/impl-trait/where-allowed.stderr new file mode 100644 index 0000000000000..b15893e7c28cf --- /dev/null +++ b/src/test/ui/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) { 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 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 } + | ^^^^^^^^^^ + +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 = 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 = 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 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 { + | ^^^^^^^^^^ + +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: 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 + | ^^^^^^^^^^ + +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/impl-unused-tps-inherent.rs similarity index 100% rename from src/test/compile-fail/impl-unused-tps-inherent.rs rename to src/test/ui/impl-unused-tps-inherent.rs diff --git a/src/test/ui/impl-unused-tps-inherent.stderr b/src/test/ui/impl-unused-tps-inherent.stderr new file mode 100644 index 0000000000000..c1f31deb858d9 --- /dev/null +++ b/src/test/ui/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 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 MyType1 { + | ^ 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/impl-unused-tps.rs similarity index 100% rename from src/test/compile-fail/impl-unused-tps.rs rename to src/test/ui/impl-unused-tps.rs diff --git a/src/test/ui/impl-unused-tps.stderr b/src/test/ui/impl-unused-tps.stderr new file mode 100644 index 0000000000000..f50cc00b2f6b6 --- /dev/null +++ b/src/test/ui/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 Foo 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 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 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 Foo 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 Foo 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/implicit-method-bind.rs similarity index 100% rename from src/test/compile-fail/implicit-method-bind.rs rename to src/test/ui/implicit-method-bind.rs diff --git a/src/test/ui/implicit-method-bind.stderr b/src/test/ui/implicit-method-bind.stderr new file mode 100644 index 0000000000000..5de9e58807c4e --- /dev/null +++ b/src/test/ui/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.rs b/src/test/ui/import.rs similarity index 100% rename from src/test/compile-fail/import.rs rename to src/test/ui/import.rs diff --git a/src/test/ui/import.stderr b/src/test/ui/import.stderr new file mode 100644 index 0000000000000..896655868441c --- /dev/null +++ b/src/test/ui/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/import2.rs similarity index 100% rename from src/test/compile-fail/import2.rs rename to src/test/ui/import2.rs diff --git a/src/test/ui/import2.stderr b/src/test/ui/import2.stderr new file mode 100644 index 0000000000000..c07506845c4cc --- /dev/null +++ b/src/test/ui/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/import3.rs similarity index 100% rename from src/test/compile-fail/import3.rs rename to src/test/ui/import3.rs diff --git a/src/test/ui/import3.stderr b/src/test/ui/import3.stderr new file mode 100644 index 0000000000000..5211b862b3dc5 --- /dev/null +++ b/src/test/ui/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/import4.rs similarity index 100% rename from src/test/compile-fail/import4.rs rename to src/test/ui/import4.rs diff --git a/src/test/ui/import4.stderr b/src/test/ui/import4.stderr new file mode 100644 index 0000000000000..d74e781ad4a48 --- /dev/null +++ b/src/test/ui/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/auxiliary/import_crate_var.rs b/src/test/ui/imports/auxiliary/import_crate_var.rs similarity index 100% rename from src/test/compile-fail/auxiliary/import_crate_var.rs rename to src/test/ui/imports/auxiliary/import_crate_var.rs diff --git a/src/test/compile-fail/import-crate-var.rs b/src/test/ui/imports/import-crate-var.rs similarity index 100% rename from src/test/compile-fail/import-crate-var.rs rename to src/test/ui/imports/import-crate-var.rs diff --git a/src/test/ui/imports/import-crate-var.stderr b/src/test/ui/imports/import-crate-var.stderr new file mode 100644 index 0000000000000..3f02223fb67a4 --- /dev/null +++ b/src/test/ui/imports/import-crate-var.stderr @@ -0,0 +1,21 @@ +warning: `$crate` may not be imported + --> $DIR/import-crate-var.rs:19: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:18:1 + | +LL | / fn main() { //~ ERROR compilation successful +LL | | m!(); +LL | | //~^ WARN `$crate` may not be imported +LL | | //~| NOTE `use $crate;` was erroneously allowed and will become a hard error +LL | | } + | |_^ + +error: aborting due to previous error + diff --git a/src/test/compile-fail/import-from-missing.rs b/src/test/ui/imports/import-from-missing.rs similarity index 100% rename from src/test/compile-fail/import-from-missing.rs rename to src/test/ui/imports/import-from-missing.rs diff --git a/src/test/ui/imports/import-from-missing.stderr b/src/test/ui/imports/import-from-missing.stderr new file mode 100644 index 0000000000000..1b40fe45c7f8d --- /dev/null +++ b/src/test/ui/imports/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/imports/import-glob-0.rs similarity index 100% rename from src/test/compile-fail/import-glob-0.rs rename to src/test/ui/imports/import-glob-0.rs diff --git a/src/test/ui/imports/import-glob-0.stderr b/src/test/ui/imports/import-glob-0.stderr new file mode 100644 index 0000000000000..91cae30776da3 --- /dev/null +++ b/src/test/ui/imports/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/imports/import-glob-circular.rs similarity index 100% rename from src/test/compile-fail/import-glob-circular.rs rename to src/test/ui/imports/import-glob-circular.rs diff --git a/src/test/ui/imports/import-glob-circular.stderr b/src/test/ui/imports/import-glob-circular.stderr new file mode 100644 index 0000000000000..078a6a3937a47 --- /dev/null +++ b/src/test/ui/imports/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/imports/import-loop-2.rs similarity index 100% rename from src/test/compile-fail/import-loop-2.rs rename to src/test/ui/imports/import-loop-2.rs diff --git a/src/test/ui/imports/import-loop-2.stderr b/src/test/ui/imports/import-loop-2.stderr new file mode 100644 index 0000000000000..717f74643ebb4 --- /dev/null +++ b/src/test/ui/imports/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/imports/import-loop.rs similarity index 100% rename from src/test/compile-fail/import-loop.rs rename to src/test/ui/imports/import-loop.rs diff --git a/src/test/ui/imports/import-loop.stderr b/src/test/ui/imports/import-loop.stderr new file mode 100644 index 0000000000000..b9a1204bb73ee --- /dev/null +++ b/src/test/ui/imports/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/imports/import-prefix-macro-1.rs similarity index 100% rename from src/test/compile-fail/import-prefix-macro-1.rs rename to src/test/ui/imports/import-prefix-macro-1.rs diff --git a/src/test/ui/imports/import-prefix-macro-1.stderr b/src/test/ui/imports/import-prefix-macro-1.stderr new file mode 100644 index 0000000000000..e3f436e4ea87b --- /dev/null +++ b/src/test/ui/imports/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/imports/import-prefix-macro-2.rs similarity index 100% rename from src/test/compile-fail/import-prefix-macro-2.rs rename to src/test/ui/imports/import-prefix-macro-2.rs diff --git a/src/test/ui/imports/import-prefix-macro-2.stderr b/src/test/ui/imports/import-prefix-macro-2.stderr new file mode 100644 index 0000000000000..ab9e32afdf084 --- /dev/null +++ b/src/test/ui/imports/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/imports/import-trait-method.rs similarity index 100% rename from src/test/compile-fail/import-trait-method.rs rename to src/test/ui/imports/import-trait-method.rs diff --git a/src/test/ui/imports/import-trait-method.stderr b/src/test/ui/imports/import-trait-method.stderr new file mode 100644 index 0000000000000..917a68a7c8b6b --- /dev/null +++ b/src/test/ui/imports/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/imports/reexports.rs b/src/test/ui/imports/reexports.rs similarity index 100% rename from src/test/compile-fail/imports/reexports.rs rename to src/test/ui/imports/reexports.rs diff --git a/src/test/ui/imports/reexports.stderr b/src/test/ui/imports/reexports.stderr new file mode 100644 index 0000000000000..a166344314b90 --- /dev/null +++ b/src/test/ui/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/imports/unused-macro-use.rs similarity index 100% rename from src/test/compile-fail/imports/unused-macro-use.rs rename to src/test/ui/imports/unused-macro-use.rs diff --git a/src/test/ui/imports/unused-macro-use.stderr b/src/test/ui/imports/unused-macro-use.stderr new file mode 100644 index 0000000000000..0920b5c6d1e97 --- /dev/null +++ b/src/test/ui/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/imports/unused.rs similarity index 100% rename from src/test/compile-fail/imports/unused.rs rename to src/test/ui/imports/unused.rs diff --git a/src/test/ui/imports/unused.stderr b/src/test/ui/imports/unused.stderr new file mode 100644 index 0000000000000..ff5c937aa837b --- /dev/null +++ b/src/test/ui/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/inaccessible-test-modules.rs similarity index 100% rename from src/test/compile-fail/inaccessible-test-modules.rs rename to src/test/ui/inaccessible-test-modules.rs diff --git a/src/test/ui/inaccessible-test-modules.stderr b/src/test/ui/inaccessible-test-modules.stderr new file mode 100644 index 0000000000000..ce8eaf590275f --- /dev/null +++ b/src/test/ui/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/index-bot.rs similarity index 100% rename from src/test/compile-fail/index-bot.rs rename to src/test/ui/index-bot.rs diff --git a/src/test/ui/index-bot.stderr b/src/test/ui/index-bot.stderr new file mode 100644 index 0000000000000..1086196d6aec4 --- /dev/null +++ b/src/test/ui/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/index_message.rs similarity index 100% rename from src/test/compile-fail/index_message.rs rename to src/test/ui/index_message.rs diff --git a/src/test/ui/index_message.stderr b/src/test/ui/index_message.stderr new file mode 100644 index 0000000000000..208d33e9cd5d8 --- /dev/null +++ b/src/test/ui/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/indexing-requires-a-uint.rs similarity index 100% rename from src/test/compile-fail/indexing-requires-a-uint.rs rename to src/test/ui/indexing-requires-a-uint.rs diff --git a/src/test/ui/indexing-requires-a-uint.stderr b/src/test/ui/indexing-requires-a-uint.stderr new file mode 100644 index 0000000000000..e9608e0b23519 --- /dev/null +++ b/src/test/ui/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` for `[{integer}]` + +error[E0308]: mismatched types + --> $DIR/indexing-requires-a-uint.rs:22:18 + | +LL | bar::(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/ui/auxiliary/inference_unstable_iterator.rs b/src/test/ui/inference/auxiliary/inference_unstable_iterator.rs similarity index 100% rename from src/test/ui/auxiliary/inference_unstable_iterator.rs rename to src/test/ui/inference/auxiliary/inference_unstable_iterator.rs diff --git a/src/test/ui/auxiliary/inference_unstable_itertools.rs b/src/test/ui/inference/auxiliary/inference_unstable_itertools.rs similarity index 100% rename from src/test/ui/auxiliary/inference_unstable_itertools.rs rename to src/test/ui/inference/auxiliary/inference_unstable_itertools.rs diff --git a/src/test/ui/inference-variable-behind-raw-pointer.rs b/src/test/ui/inference/inference-variable-behind-raw-pointer.rs similarity index 100% rename from src/test/ui/inference-variable-behind-raw-pointer.rs rename to src/test/ui/inference/inference-variable-behind-raw-pointer.rs diff --git a/src/test/ui/inference-variable-behind-raw-pointer.stderr b/src/test/ui/inference/inference-variable-behind-raw-pointer.stderr similarity index 100% rename from src/test/ui/inference-variable-behind-raw-pointer.stderr rename to src/test/ui/inference/inference-variable-behind-raw-pointer.stderr diff --git a/src/test/ui/inference_unstable.rs b/src/test/ui/inference/inference_unstable.rs similarity index 100% rename from src/test/ui/inference_unstable.rs rename to src/test/ui/inference/inference_unstable.rs diff --git a/src/test/ui/inference_unstable.stderr b/src/test/ui/inference/inference_unstable.stderr similarity index 100% rename from src/test/ui/inference_unstable.stderr rename to src/test/ui/inference/inference_unstable.stderr diff --git a/src/test/ui/inference_unstable_featured.rs b/src/test/ui/inference/inference_unstable_featured.rs similarity index 100% rename from src/test/ui/inference_unstable_featured.rs rename to src/test/ui/inference/inference_unstable_featured.rs diff --git a/src/test/ui/inference_unstable_featured.stderr b/src/test/ui/inference/inference_unstable_featured.stderr similarity index 100% rename from src/test/ui/inference_unstable_featured.stderr rename to src/test/ui/inference/inference_unstable_featured.stderr diff --git a/src/test/ui/inference_unstable_forced.rs b/src/test/ui/inference/inference_unstable_forced.rs similarity index 100% rename from src/test/ui/inference_unstable_forced.rs rename to src/test/ui/inference/inference_unstable_forced.rs diff --git a/src/test/ui/inference_unstable_forced.stderr b/src/test/ui/inference/inference_unstable_forced.stderr similarity index 100% rename from src/test/ui/inference_unstable_forced.stderr rename to src/test/ui/inference/inference_unstable_forced.stderr diff --git a/src/test/compile-fail/infinite-autoderef.rs b/src/test/ui/infinite/infinite-autoderef.rs similarity index 100% rename from src/test/compile-fail/infinite-autoderef.rs rename to src/test/ui/infinite/infinite-autoderef.rs diff --git a/src/test/ui/infinite/infinite-autoderef.stderr b/src/test/ui/infinite/infinite-autoderef.stderr new file mode 100644 index 0000000000000..b5e20ea5cbf99 --- /dev/null +++ b/src/test/ui/infinite/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/infinite/infinite-instantiation.rs similarity index 100% rename from src/test/compile-fail/infinite-instantiation.rs rename to src/test/ui/infinite/infinite-instantiation.rs diff --git a/src/test/ui/infinite/infinite-instantiation.stderr b/src/test/ui/infinite/infinite-instantiation.stderr new file mode 100644 index 0000000000000..483605fc38949 --- /dev/null +++ b/src/test/ui/infinite/infinite-instantiation.stderr @@ -0,0 +1,14 @@ +error: reached the recursion limit while instantiating `function::>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/infinite-instantiation.rs:33:1 + | +LL | / fn function(counter: usize, t: T) { +LL | | //~^ ERROR reached the recursion limit while instantiating `function:: 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/infinite/infinite-macro-expansion.rs similarity index 100% rename from src/test/compile-fail/infinite-macro-expansion.rs rename to src/test/ui/infinite/infinite-macro-expansion.rs diff --git a/src/test/ui/infinite/infinite-macro-expansion.stderr b/src/test/ui/infinite/infinite-macro-expansion.stderr new file mode 100644 index 0000000000000..7921669347589 --- /dev/null +++ b/src/test/ui/infinite/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/ui/infinite-recursion-const-fn.rs b/src/test/ui/infinite/infinite-recursion-const-fn.rs similarity index 100% rename from src/test/ui/infinite-recursion-const-fn.rs rename to src/test/ui/infinite/infinite-recursion-const-fn.rs diff --git a/src/test/ui/infinite-recursion-const-fn.stderr b/src/test/ui/infinite/infinite-recursion-const-fn.stderr similarity index 100% rename from src/test/ui/infinite-recursion-const-fn.stderr rename to src/test/ui/infinite/infinite-recursion-const-fn.stderr diff --git a/src/test/compile-fail/infinite-tag-type-recursion.rs b/src/test/ui/infinite/infinite-tag-type-recursion.rs similarity index 100% rename from src/test/compile-fail/infinite-tag-type-recursion.rs rename to src/test/ui/infinite/infinite-tag-type-recursion.rs diff --git a/src/test/ui/infinite/infinite-tag-type-recursion.stderr b/src/test/ui/infinite/infinite-tag-type-recursion.stderr new file mode 100644 index 0000000000000..e1fa3dec64c7f --- /dev/null +++ b/src/test/ui/infinite/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/infinite/infinite-vec-type-recursion.rs similarity index 100% rename from src/test/compile-fail/infinite-vec-type-recursion.rs rename to src/test/ui/infinite/infinite-vec-type-recursion.rs diff --git a/src/test/ui/infinite/infinite-vec-type-recursion.stderr b/src/test/ui/infinite/infinite-vec-type-recursion.stderr new file mode 100644 index 0000000000000..3e2d3d6d726c9 --- /dev/null +++ b/src/test/ui/infinite/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; + | ^ + | + = 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/inhabitedness-infinite-loop.rs similarity index 100% rename from src/test/compile-fail/inhabitedness-infinite-loop.rs rename to src/test/ui/inhabitedness-infinite-loop.rs diff --git a/src/test/ui/inhabitedness-infinite-loop.stderr b/src/test/ui/inhabitedness-infinite-loop.stderr new file mode 100644 index 0000000000000..24237f3a1b64b --- /dev/null +++ b/src/test/ui/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/init-unsafe.rs similarity index 100% rename from src/test/compile-fail/init-unsafe.rs rename to src/test/ui/init-unsafe.rs diff --git a/src/test/ui/init-unsafe.stderr b/src/test/ui/init-unsafe.stderr new file mode 100644 index 0000000000000..f3d041fde0142 --- /dev/null +++ b/src/test/ui/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::(); //~ 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/inner-static-type-parameter.rs similarity index 100% rename from src/test/compile-fail/inner-static-type-parameter.rs rename to src/test/ui/inner-static-type-parameter.rs diff --git a/src/test/ui/inner-static-type-parameter.stderr b/src/test/ui/inner-static-type-parameter.stderr new file mode 100644 index 0000000000000..1820e5c57dd3a --- /dev/null +++ b/src/test/ui/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() { + | --- - type variable from outer function + | | + | try adding a local type parameter in this method instead +LL | static a: Bar = 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 { 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/integer-literal-suffix-inference.rs similarity index 100% rename from src/test/compile-fail/integer-literal-suffix-inference.rs rename to src/test/ui/integer-literal-suffix-inference.rs diff --git a/src/test/ui/integer-literal-suffix-inference.stderr b/src/test/ui/integer-literal-suffix-inference.stderr new file mode 100644 index 0000000000000..1c5d656020c84 --- /dev/null +++ b/src/test/ui/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/integral-indexing.rs similarity index 100% rename from src/test/compile-fail/integral-indexing.rs rename to src/test/ui/integral-indexing.rs diff --git a/src/test/ui/integral-indexing.stderr b/src/test/ui/integral-indexing.stderr new file mode 100644 index 0000000000000..d86421a79856f --- /dev/null +++ b/src/test/ui/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` for `std::vec::Vec` + +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` for `std::vec::Vec` + +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` for `std::vec::Vec` + +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` for `std::vec::Vec` + +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` 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` 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` 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` 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/integral-variable-unification-error.rs similarity index 100% rename from src/test/compile-fail/integral-variable-unification-error.rs rename to src/test/ui/integral-variable-unification-error.rs diff --git a/src/test/ui/integral-variable-unification-error.stderr b/src/test/ui/integral-variable-unification-error.stderr new file mode 100644 index 0000000000000..bbaa60308662f --- /dev/null +++ b/src/test/ui/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/auxiliary/internal_unstable.rs b/src/test/ui/internal/auxiliary/internal_unstable.rs similarity index 100% rename from src/test/compile-fail/auxiliary/internal_unstable.rs rename to src/test/ui/internal/auxiliary/internal_unstable.rs diff --git a/src/test/compile-fail/internal-unstable-noallow.rs b/src/test/ui/internal/internal-unstable-noallow.rs similarity index 100% rename from src/test/compile-fail/internal-unstable-noallow.rs rename to src/test/ui/internal/internal-unstable-noallow.rs diff --git a/src/test/ui/internal/internal-unstable-noallow.stderr b/src/test/ui/internal/internal-unstable-noallow.stderr new file mode 100644 index 0000000000000..fc8100525e9bd --- /dev/null +++ b/src/test/ui/internal/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/internal/internal-unstable-thread-local.rs similarity index 100% rename from src/test/compile-fail/internal-unstable-thread-local.rs rename to src/test/ui/internal/internal-unstable-thread-local.rs diff --git a/src/test/ui/internal/internal-unstable-thread-local.stderr b/src/test/ui/internal/internal-unstable-thread-local.stderr new file mode 100644 index 0000000000000..b77b94663ff09 --- /dev/null +++ b/src/test/ui/internal/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/internal/internal-unstable.rs similarity index 100% rename from src/test/compile-fail/internal-unstable.rs rename to src/test/ui/internal/internal-unstable.rs diff --git a/src/test/ui/internal/internal-unstable.stderr b/src/test/ui/internal/internal-unstable.stderr new file mode 100644 index 0000000000000..ec4f0725c34f4 --- /dev/null +++ b/src/test/ui/internal/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/intrinsic-invalid-number-of-arguments.rs similarity index 100% rename from src/test/compile-fail/intrinsic-invalid-number-of-arguments.rs rename to src/test/ui/intrinsic-invalid-number-of-arguments.rs diff --git a/src/test/ui/intrinsic-invalid-number-of-arguments.stderr b/src/test/ui/intrinsic-invalid-number-of-arguments.stderr new file mode 100644 index 0000000000000..af852b669c42c --- /dev/null +++ b/src/test/ui/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/ui/invalid-module-declaration/invalid-module-declaration.rs b/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs index 18ca5d09798bc..c0a10fe3e60fe 100644 --- a/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs +++ b/src/test/ui/invalid-module-declaration/invalid-module-declaration.rs @@ -11,9 +11,6 @@ // ignore-tidy-linelength // ignore-windows -// error-pattern: cannot declare a new module at this location -// error-pattern: maybe move this module - mod auxiliary { mod foo; } diff --git a/src/test/compile-fail/invalid-crate-type.rs b/src/test/ui/invalid/invalid-crate-type.rs similarity index 100% rename from src/test/compile-fail/invalid-crate-type.rs rename to src/test/ui/invalid/invalid-crate-type.rs diff --git a/src/test/ui/invalid/invalid-crate-type.stderr b/src/test/ui/invalid/invalid-crate-type.stderr new file mode 100644 index 0000000000000..6dc8a0f2bbb04 --- /dev/null +++ b/src/test/ui/invalid/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/invalid/invalid-inline.rs similarity index 100% rename from src/test/compile-fail/invalid-inline.rs rename to src/test/ui/invalid/invalid-inline.rs diff --git a/src/test/ui/invalid/invalid-inline.stderr b/src/test/ui/invalid/invalid-inline.stderr new file mode 100644 index 0000000000000..d4861c23aee20 --- /dev/null +++ b/src/test/ui/invalid/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/invalid/invalid-macro-matcher.rs similarity index 100% rename from src/test/compile-fail/invalid-macro-matcher.rs rename to src/test/ui/invalid/invalid-macro-matcher.rs diff --git a/src/test/ui/invalid/invalid-macro-matcher.stderr b/src/test/ui/invalid/invalid-macro-matcher.stderr new file mode 100644 index 0000000000000..d3ddb613f946b --- /dev/null +++ b/src/test/ui/invalid/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/ui/invalid-path-in-const.rs b/src/test/ui/invalid/invalid-path-in-const.rs similarity index 100% rename from src/test/ui/invalid-path-in-const.rs rename to src/test/ui/invalid/invalid-path-in-const.rs diff --git a/src/test/ui/invalid-path-in-const.stderr b/src/test/ui/invalid/invalid-path-in-const.stderr similarity index 100% rename from src/test/ui/invalid-path-in-const.stderr rename to src/test/ui/invalid/invalid-path-in-const.stderr diff --git a/src/test/compile-fail/invalid-plugin-attr.rs b/src/test/ui/invalid/invalid-plugin-attr.rs similarity index 100% rename from src/test/compile-fail/invalid-plugin-attr.rs rename to src/test/ui/invalid/invalid-plugin-attr.rs diff --git a/src/test/ui/invalid/invalid-plugin-attr.stderr b/src/test/ui/invalid/invalid-plugin-attr.stderr new file mode 100644 index 0000000000000..a5d321ea9bd35 --- /dev/null +++ b/src/test/ui/invalid/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/ui/invalid-variadic-function.rs b/src/test/ui/invalid/invalid-variadic-function.rs similarity index 100% rename from src/test/ui/invalid-variadic-function.rs rename to src/test/ui/invalid/invalid-variadic-function.rs diff --git a/src/test/ui/invalid-variadic-function.stderr b/src/test/ui/invalid/invalid-variadic-function.stderr similarity index 100% rename from src/test/ui/invalid-variadic-function.stderr rename to src/test/ui/invalid/invalid-variadic-function.stderr diff --git a/src/test/compile-fail/invalid_crate_type_syntax.rs b/src/test/ui/invalid_crate_type_syntax.rs similarity index 100% rename from src/test/compile-fail/invalid_crate_type_syntax.rs rename to src/test/ui/invalid_crate_type_syntax.rs diff --git a/src/test/ui/invalid_crate_type_syntax.stderr b/src/test/ui/invalid_crate_type_syntax.stderr new file mode 100644 index 0000000000000..b609695b86ee5 --- /dev/null +++ b/src/test/ui/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/ui/issues/auxiliary/empty-struct.rs b/src/test/ui/issues/auxiliary/empty-struct.rs new file mode 100644 index 0000000000000..4a30286563422 --- /dev/null +++ b/src/test/ui/issues/auxiliary/empty-struct.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct XEmpty1 {} +pub struct XEmpty2; +pub struct XEmpty6(); + +pub enum XE { + XEmpty3 {}, + XEmpty4, + XEmpty5(), +} diff --git a/src/test/compile-fail/auxiliary/issue-19163.rs b/src/test/ui/issues/auxiliary/issue-19163.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue-19163.rs rename to src/test/ui/issues/auxiliary/issue-19163.rs diff --git a/src/test/compile-fail/auxiliary/issue-21146-inc.rs b/src/test/ui/issues/auxiliary/issue-21146-inc.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue-21146-inc.rs rename to src/test/ui/issues/auxiliary/issue-21146-inc.rs diff --git a/src/test/compile-fail/auxiliary/issue-29181.rs b/src/test/ui/issues/auxiliary/issue-29181.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue-29181.rs rename to src/test/ui/issues/auxiliary/issue-29181.rs diff --git a/src/test/compile-fail/auxiliary/issue-30535.rs b/src/test/ui/issues/auxiliary/issue-30535.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue-30535.rs rename to src/test/ui/issues/auxiliary/issue-30535.rs diff --git a/src/test/ui/auxiliary/issue-36708.rs b/src/test/ui/issues/auxiliary/issue-36708.rs similarity index 100% rename from src/test/ui/auxiliary/issue-36708.rs rename to src/test/ui/issues/auxiliary/issue-36708.rs diff --git a/src/test/compile-fail/auxiliary/issue-36881-aux.rs b/src/test/ui/issues/auxiliary/issue-36881-aux.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue-36881-aux.rs rename to src/test/ui/issues/auxiliary/issue-36881-aux.rs diff --git a/src/test/compile-fail/auxiliary/issue-52489.rs b/src/test/ui/issues/auxiliary/issue-52489.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue-52489.rs rename to src/test/ui/issues/auxiliary/issue-52489.rs diff --git a/src/test/compile-fail/auxiliary/issue_11680.rs b/src/test/ui/issues/auxiliary/issue_11680.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue_11680.rs rename to src/test/ui/issues/auxiliary/issue_11680.rs diff --git a/src/test/compile-fail/auxiliary/issue_16725.rs b/src/test/ui/issues/auxiliary/issue_16725.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue_16725.rs rename to src/test/ui/issues/auxiliary/issue_16725.rs diff --git a/src/test/compile-fail/auxiliary/issue_17718_const_privacy.rs b/src/test/ui/issues/auxiliary/issue_17718_const_privacy.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue_17718_const_privacy.rs rename to src/test/ui/issues/auxiliary/issue_17718_const_privacy.rs diff --git a/src/test/compile-fail/auxiliary/issue_1920.rs b/src/test/ui/issues/auxiliary/issue_1920.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue_1920.rs rename to src/test/ui/issues/auxiliary/issue_1920.rs diff --git a/src/test/compile-fail/auxiliary/issue_21202.rs b/src/test/ui/issues/auxiliary/issue_21202.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue_21202.rs rename to src/test/ui/issues/auxiliary/issue_21202.rs diff --git a/src/test/compile-fail/auxiliary/issue_30123_aux.rs b/src/test/ui/issues/auxiliary/issue_30123_aux.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue_30123_aux.rs rename to src/test/ui/issues/auxiliary/issue_30123_aux.rs diff --git a/src/test/compile-fail/auxiliary/issue_41549.rs b/src/test/ui/issues/auxiliary/issue_41549.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue_41549.rs rename to src/test/ui/issues/auxiliary/issue_41549.rs diff --git a/src/test/compile-fail/auxiliary/issue_5844_aux.rs b/src/test/ui/issues/auxiliary/issue_5844_aux.rs similarity index 100% rename from src/test/compile-fail/auxiliary/issue_5844_aux.rs rename to src/test/ui/issues/auxiliary/issue_5844_aux.rs diff --git a/src/test/compile-fail/auxiliary/lint_stability.rs b/src/test/ui/issues/auxiliary/lint_stability.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lint_stability.rs rename to src/test/ui/issues/auxiliary/lint_stability.rs diff --git a/src/test/compile-fail/auxiliary/private_trait_xc.rs b/src/test/ui/issues/auxiliary/private_trait_xc.rs similarity index 100% rename from src/test/compile-fail/auxiliary/private_trait_xc.rs rename to src/test/ui/issues/auxiliary/private_trait_xc.rs diff --git a/src/test/ui/auxiliary/xcrate_issue_43189_a.rs b/src/test/ui/issues/auxiliary/xcrate_issue_43189_a.rs similarity index 100% rename from src/test/ui/auxiliary/xcrate_issue_43189_a.rs rename to src/test/ui/issues/auxiliary/xcrate_issue_43189_a.rs diff --git a/src/test/ui/auxiliary/xcrate_issue_43189_b.rs b/src/test/ui/issues/auxiliary/xcrate_issue_43189_b.rs similarity index 100% rename from src/test/ui/auxiliary/xcrate_issue_43189_b.rs rename to src/test/ui/issues/auxiliary/xcrate_issue_43189_b.rs diff --git a/src/test/ui/auxiliary/xcrate_issue_46112_rexport_core.rs b/src/test/ui/issues/auxiliary/xcrate_issue_46112_rexport_core.rs similarity index 100% rename from src/test/ui/auxiliary/xcrate_issue_46112_rexport_core.rs rename to src/test/ui/issues/auxiliary/xcrate_issue_46112_rexport_core.rs diff --git a/src/test/ui/issue-10176.rs b/src/test/ui/issues/issue-10176.rs similarity index 100% rename from src/test/ui/issue-10176.rs rename to src/test/ui/issues/issue-10176.rs diff --git a/src/test/ui/issue-10176.stderr b/src/test/ui/issues/issue-10176.stderr similarity index 100% rename from src/test/ui/issue-10176.stderr rename to src/test/ui/issues/issue-10176.stderr diff --git a/src/test/ui/issue-10200.rs b/src/test/ui/issues/issue-10200.rs similarity index 100% rename from src/test/ui/issue-10200.rs rename to src/test/ui/issues/issue-10200.rs diff --git a/src/test/ui/issue-10200.stderr b/src/test/ui/issues/issue-10200.stderr similarity index 100% rename from src/test/ui/issue-10200.stderr rename to src/test/ui/issues/issue-10200.stderr diff --git a/src/test/ui/issue-10291.nll.stderr b/src/test/ui/issues/issue-10291.nll.stderr similarity index 100% rename from src/test/ui/issue-10291.nll.stderr rename to src/test/ui/issues/issue-10291.nll.stderr diff --git a/src/test/ui/issue-10291.rs b/src/test/ui/issues/issue-10291.rs similarity index 100% rename from src/test/ui/issue-10291.rs rename to src/test/ui/issues/issue-10291.rs diff --git a/src/test/ui/issue-10291.stderr b/src/test/ui/issues/issue-10291.stderr similarity index 100% rename from src/test/ui/issue-10291.stderr rename to src/test/ui/issues/issue-10291.stderr diff --git a/src/test/ui/issue-10398.nll.stderr b/src/test/ui/issues/issue-10398.nll.stderr similarity index 100% rename from src/test/ui/issue-10398.nll.stderr rename to src/test/ui/issues/issue-10398.nll.stderr diff --git a/src/test/ui/issue-10398.rs b/src/test/ui/issues/issue-10398.rs similarity index 100% rename from src/test/ui/issue-10398.rs rename to src/test/ui/issues/issue-10398.rs diff --git a/src/test/ui/issue-10398.stderr b/src/test/ui/issues/issue-10398.stderr similarity index 100% rename from src/test/ui/issue-10398.stderr rename to src/test/ui/issues/issue-10398.stderr diff --git a/src/test/ui/issue-10401.rs b/src/test/ui/issues/issue-10401.rs similarity index 100% rename from src/test/ui/issue-10401.rs rename to src/test/ui/issues/issue-10401.rs diff --git a/src/test/ui/issue-10401.stderr b/src/test/ui/issues/issue-10401.stderr similarity index 100% rename from src/test/ui/issue-10401.stderr rename to src/test/ui/issues/issue-10401.stderr diff --git a/src/test/ui/issue-10412.rs b/src/test/ui/issues/issue-10412.rs similarity index 100% rename from src/test/ui/issue-10412.rs rename to src/test/ui/issues/issue-10412.rs diff --git a/src/test/ui/issue-10412.stderr b/src/test/ui/issues/issue-10412.stderr similarity index 100% rename from src/test/ui/issue-10412.stderr rename to src/test/ui/issues/issue-10412.stderr diff --git a/src/test/ui/issue-10465.rs b/src/test/ui/issues/issue-10465.rs similarity index 100% rename from src/test/ui/issue-10465.rs rename to src/test/ui/issues/issue-10465.rs diff --git a/src/test/ui/issue-10465.stderr b/src/test/ui/issues/issue-10465.stderr similarity index 100% rename from src/test/ui/issue-10465.stderr rename to src/test/ui/issues/issue-10465.stderr diff --git a/src/test/ui/issue-10536.rs b/src/test/ui/issues/issue-10536.rs similarity index 100% rename from src/test/ui/issue-10536.rs rename to src/test/ui/issues/issue-10536.rs diff --git a/src/test/ui/issue-10536.stderr b/src/test/ui/issues/issue-10536.stderr similarity index 100% rename from src/test/ui/issue-10536.stderr rename to src/test/ui/issues/issue-10536.stderr diff --git a/src/test/ui/issue-10545.rs b/src/test/ui/issues/issue-10545.rs similarity index 100% rename from src/test/ui/issue-10545.rs rename to src/test/ui/issues/issue-10545.rs diff --git a/src/test/ui/issue-10545.stderr b/src/test/ui/issues/issue-10545.stderr similarity index 100% rename from src/test/ui/issue-10545.stderr rename to src/test/ui/issues/issue-10545.stderr diff --git a/src/test/ui/issue-10656.rs b/src/test/ui/issues/issue-10656.rs similarity index 100% rename from src/test/ui/issue-10656.rs rename to src/test/ui/issues/issue-10656.rs diff --git a/src/test/ui/issue-10656.stderr b/src/test/ui/issues/issue-10656.stderr similarity index 100% rename from src/test/ui/issue-10656.stderr rename to src/test/ui/issues/issue-10656.stderr diff --git a/src/test/ui/issue-10764.rs b/src/test/ui/issues/issue-10764.rs similarity index 100% rename from src/test/ui/issue-10764.rs rename to src/test/ui/issues/issue-10764.rs diff --git a/src/test/ui/issue-10764.stderr b/src/test/ui/issues/issue-10764.stderr similarity index 100% rename from src/test/ui/issue-10764.stderr rename to src/test/ui/issues/issue-10764.stderr diff --git a/src/test/ui/issue-10877.rs b/src/test/ui/issues/issue-10877.rs similarity index 100% rename from src/test/ui/issue-10877.rs rename to src/test/ui/issues/issue-10877.rs diff --git a/src/test/ui/issue-10877.stderr b/src/test/ui/issues/issue-10877.stderr similarity index 100% rename from src/test/ui/issue-10877.stderr rename to src/test/ui/issues/issue-10877.stderr diff --git a/src/test/ui/issue-10969.rs b/src/test/ui/issues/issue-10969.rs similarity index 100% rename from src/test/ui/issue-10969.rs rename to src/test/ui/issues/issue-10969.rs diff --git a/src/test/ui/issue-10969.stderr b/src/test/ui/issues/issue-10969.stderr similarity index 100% rename from src/test/ui/issue-10969.stderr rename to src/test/ui/issues/issue-10969.stderr diff --git a/src/test/ui/issue-10991.rs b/src/test/ui/issues/issue-10991.rs similarity index 100% rename from src/test/ui/issue-10991.rs rename to src/test/ui/issues/issue-10991.rs diff --git a/src/test/ui/issue-10991.stderr b/src/test/ui/issues/issue-10991.stderr similarity index 100% rename from src/test/ui/issue-10991.stderr rename to src/test/ui/issues/issue-10991.stderr diff --git a/src/test/ui/issue-11004.rs b/src/test/ui/issues/issue-11004.rs similarity index 100% rename from src/test/ui/issue-11004.rs rename to src/test/ui/issues/issue-11004.rs diff --git a/src/test/ui/issue-11004.stderr b/src/test/ui/issues/issue-11004.stderr similarity index 100% rename from src/test/ui/issue-11004.stderr rename to src/test/ui/issues/issue-11004.stderr diff --git a/src/test/ui/issue-11154.rs b/src/test/ui/issues/issue-11154.rs similarity index 100% rename from src/test/ui/issue-11154.rs rename to src/test/ui/issues/issue-11154.rs diff --git a/src/test/ui/issue-11154.stderr b/src/test/ui/issues/issue-11154.stderr similarity index 100% rename from src/test/ui/issue-11154.stderr rename to src/test/ui/issues/issue-11154.stderr diff --git a/src/test/ui/issue-11192.nll.stderr b/src/test/ui/issues/issue-11192.nll.stderr similarity index 100% rename from src/test/ui/issue-11192.nll.stderr rename to src/test/ui/issues/issue-11192.nll.stderr diff --git a/src/test/ui/issue-11192.rs b/src/test/ui/issues/issue-11192.rs similarity index 100% rename from src/test/ui/issue-11192.rs rename to src/test/ui/issues/issue-11192.rs diff --git a/src/test/ui/issue-11192.stderr b/src/test/ui/issues/issue-11192.stderr similarity index 100% rename from src/test/ui/issue-11192.stderr rename to src/test/ui/issues/issue-11192.stderr diff --git a/src/test/ui/issue-11319.rs b/src/test/ui/issues/issue-11319.rs similarity index 100% rename from src/test/ui/issue-11319.rs rename to src/test/ui/issues/issue-11319.rs diff --git a/src/test/ui/issue-11319.stderr b/src/test/ui/issues/issue-11319.stderr similarity index 100% rename from src/test/ui/issue-11319.stderr rename to src/test/ui/issues/issue-11319.stderr diff --git a/src/test/ui/issue-11374.rs b/src/test/ui/issues/issue-11374.rs similarity index 100% rename from src/test/ui/issue-11374.rs rename to src/test/ui/issues/issue-11374.rs diff --git a/src/test/ui/issue-11374.stderr b/src/test/ui/issues/issue-11374.stderr similarity index 100% rename from src/test/ui/issue-11374.stderr rename to src/test/ui/issues/issue-11374.stderr diff --git a/src/test/ui/issue-11493.ast.stderr b/src/test/ui/issues/issue-11493.ast.stderr similarity index 100% rename from src/test/ui/issue-11493.ast.stderr rename to src/test/ui/issues/issue-11493.ast.stderr diff --git a/src/test/ui/issue-11493.mir.stderr b/src/test/ui/issues/issue-11493.mir.stderr similarity index 100% rename from src/test/ui/issue-11493.mir.stderr rename to src/test/ui/issues/issue-11493.mir.stderr diff --git a/src/test/ui/issue-11493.rs b/src/test/ui/issues/issue-11493.rs similarity index 100% rename from src/test/ui/issue-11493.rs rename to src/test/ui/issues/issue-11493.rs diff --git a/src/test/ui/issue-11515.rs b/src/test/ui/issues/issue-11515.rs similarity index 100% rename from src/test/ui/issue-11515.rs rename to src/test/ui/issues/issue-11515.rs diff --git a/src/test/ui/issue-11515.stderr b/src/test/ui/issues/issue-11515.stderr similarity index 100% rename from src/test/ui/issue-11515.stderr rename to src/test/ui/issues/issue-11515.stderr diff --git a/src/test/compile-fail/issue-11593.rs b/src/test/ui/issues/issue-11593.rs similarity index 100% rename from src/test/compile-fail/issue-11593.rs rename to src/test/ui/issues/issue-11593.rs diff --git a/src/test/ui/issues/issue-11593.stderr b/src/test/ui/issues/issue-11593.stderr new file mode 100644 index 0000000000000..24e1a5eb6f46e --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-11680.rs similarity index 100% rename from src/test/compile-fail/issue-11680.rs rename to src/test/ui/issues/issue-11680.rs diff --git a/src/test/ui/issues/issue-11680.stderr b/src/test/ui/issues/issue-11680.stderr new file mode 100644 index 0000000000000..37cfe960600b0 --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-11681.rs b/src/test/ui/issues/issue-11681.rs similarity index 100% rename from src/test/ui/issue-11681.rs rename to src/test/ui/issues/issue-11681.rs diff --git a/src/test/ui/issue-11681.stderr b/src/test/ui/issues/issue-11681.stderr similarity index 100% rename from src/test/ui/issue-11681.stderr rename to src/test/ui/issues/issue-11681.stderr diff --git a/src/test/ui/issue-11692-1.rs b/src/test/ui/issues/issue-11692-1.rs similarity index 100% rename from src/test/ui/issue-11692-1.rs rename to src/test/ui/issues/issue-11692-1.rs diff --git a/src/test/ui/issue-11692-1.stderr b/src/test/ui/issues/issue-11692-1.stderr similarity index 100% rename from src/test/ui/issue-11692-1.stderr rename to src/test/ui/issues/issue-11692-1.stderr diff --git a/src/test/ui/issue-11692-2.rs b/src/test/ui/issues/issue-11692-2.rs similarity index 100% rename from src/test/ui/issue-11692-2.rs rename to src/test/ui/issues/issue-11692-2.rs diff --git a/src/test/ui/issue-11692-2.stderr b/src/test/ui/issues/issue-11692-2.stderr similarity index 100% rename from src/test/ui/issue-11692-2.stderr rename to src/test/ui/issues/issue-11692-2.stderr diff --git a/src/test/ui/issue-11740.rs b/src/test/ui/issues/issue-11740.rs similarity index 100% rename from src/test/ui/issue-11740.rs rename to src/test/ui/issues/issue-11740.rs diff --git a/src/test/ui/issue-11740.stderr b/src/test/ui/issues/issue-11740.stderr similarity index 100% rename from src/test/ui/issue-11740.stderr rename to src/test/ui/issues/issue-11740.stderr diff --git a/src/test/ui/issue-11771.rs b/src/test/ui/issues/issue-11771.rs similarity index 100% rename from src/test/ui/issue-11771.rs rename to src/test/ui/issues/issue-11771.rs diff --git a/src/test/ui/issue-11771.stderr b/src/test/ui/issues/issue-11771.stderr similarity index 100% rename from src/test/ui/issue-11771.stderr rename to src/test/ui/issues/issue-11771.stderr diff --git a/src/test/ui/issue-11844.rs b/src/test/ui/issues/issue-11844.rs similarity index 100% rename from src/test/ui/issue-11844.rs rename to src/test/ui/issues/issue-11844.rs diff --git a/src/test/ui/issue-11844.stderr b/src/test/ui/issues/issue-11844.stderr similarity index 100% rename from src/test/ui/issue-11844.stderr rename to src/test/ui/issues/issue-11844.stderr diff --git a/src/test/ui/issue-11873.nll.stderr b/src/test/ui/issues/issue-11873.nll.stderr similarity index 100% rename from src/test/ui/issue-11873.nll.stderr rename to src/test/ui/issues/issue-11873.nll.stderr diff --git a/src/test/ui/issue-11873.rs b/src/test/ui/issues/issue-11873.rs similarity index 100% rename from src/test/ui/issue-11873.rs rename to src/test/ui/issues/issue-11873.rs diff --git a/src/test/ui/issue-11873.stderr b/src/test/ui/issues/issue-11873.stderr similarity index 100% rename from src/test/ui/issue-11873.stderr rename to src/test/ui/issues/issue-11873.stderr diff --git a/src/test/ui/issue-12028.rs b/src/test/ui/issues/issue-12028.rs similarity index 100% rename from src/test/ui/issue-12028.rs rename to src/test/ui/issues/issue-12028.rs diff --git a/src/test/ui/issue-12028.stderr b/src/test/ui/issues/issue-12028.stderr similarity index 100% rename from src/test/ui/issue-12028.stderr rename to src/test/ui/issues/issue-12028.stderr diff --git a/src/test/ui/issue-12041.nll.stderr b/src/test/ui/issues/issue-12041.nll.stderr similarity index 100% rename from src/test/ui/issue-12041.nll.stderr rename to src/test/ui/issues/issue-12041.nll.stderr diff --git a/src/test/ui/issue-12041.rs b/src/test/ui/issues/issue-12041.rs similarity index 100% rename from src/test/ui/issue-12041.rs rename to src/test/ui/issues/issue-12041.rs diff --git a/src/test/ui/issue-12041.stderr b/src/test/ui/issues/issue-12041.stderr similarity index 100% rename from src/test/ui/issue-12041.stderr rename to src/test/ui/issues/issue-12041.stderr diff --git a/src/test/ui/issue-12116.rs b/src/test/ui/issues/issue-12116.rs similarity index 100% rename from src/test/ui/issue-12116.rs rename to src/test/ui/issues/issue-12116.rs diff --git a/src/test/ui/issue-12116.stderr b/src/test/ui/issues/issue-12116.stderr similarity index 100% rename from src/test/ui/issue-12116.stderr rename to src/test/ui/issues/issue-12116.stderr diff --git a/src/test/ui/issue-12127.rs b/src/test/ui/issues/issue-12127.rs similarity index 100% rename from src/test/ui/issue-12127.rs rename to src/test/ui/issues/issue-12127.rs diff --git a/src/test/ui/issue-12127.stderr b/src/test/ui/issues/issue-12127.stderr similarity index 100% rename from src/test/ui/issue-12127.stderr rename to src/test/ui/issues/issue-12127.stderr diff --git a/src/test/ui/issue-12187-1.rs b/src/test/ui/issues/issue-12187-1.rs similarity index 100% rename from src/test/ui/issue-12187-1.rs rename to src/test/ui/issues/issue-12187-1.rs diff --git a/src/test/ui/issue-12187-1.stderr b/src/test/ui/issues/issue-12187-1.stderr similarity index 100% rename from src/test/ui/issue-12187-1.stderr rename to src/test/ui/issues/issue-12187-1.stderr diff --git a/src/test/ui/issue-12187-2.rs b/src/test/ui/issues/issue-12187-2.rs similarity index 100% rename from src/test/ui/issue-12187-2.rs rename to src/test/ui/issues/issue-12187-2.rs diff --git a/src/test/ui/issue-12187-2.stderr b/src/test/ui/issues/issue-12187-2.stderr similarity index 100% rename from src/test/ui/issue-12187-2.stderr rename to src/test/ui/issues/issue-12187-2.stderr diff --git a/src/test/ui/issue-12369.rs b/src/test/ui/issues/issue-12369.rs similarity index 100% rename from src/test/ui/issue-12369.rs rename to src/test/ui/issues/issue-12369.rs diff --git a/src/test/ui/issue-12369.stderr b/src/test/ui/issues/issue-12369.stderr similarity index 100% rename from src/test/ui/issue-12369.stderr rename to src/test/ui/issues/issue-12369.stderr diff --git a/src/test/ui/issue-12470.nll.stderr b/src/test/ui/issues/issue-12470.nll.stderr similarity index 100% rename from src/test/ui/issue-12470.nll.stderr rename to src/test/ui/issues/issue-12470.nll.stderr diff --git a/src/test/ui/issue-12470.rs b/src/test/ui/issues/issue-12470.rs similarity index 100% rename from src/test/ui/issue-12470.rs rename to src/test/ui/issues/issue-12470.rs diff --git a/src/test/ui/issue-12470.stderr b/src/test/ui/issues/issue-12470.stderr similarity index 100% rename from src/test/ui/issue-12470.stderr rename to src/test/ui/issues/issue-12470.stderr diff --git a/src/test/ui/issue-12511.rs b/src/test/ui/issues/issue-12511.rs similarity index 100% rename from src/test/ui/issue-12511.rs rename to src/test/ui/issues/issue-12511.rs diff --git a/src/test/ui/issue-12511.stderr b/src/test/ui/issues/issue-12511.stderr similarity index 100% rename from src/test/ui/issue-12511.stderr rename to src/test/ui/issues/issue-12511.stderr diff --git a/src/test/ui/issue-12552.rs b/src/test/ui/issues/issue-12552.rs similarity index 100% rename from src/test/ui/issue-12552.rs rename to src/test/ui/issues/issue-12552.rs diff --git a/src/test/ui/issue-12552.stderr b/src/test/ui/issues/issue-12552.stderr similarity index 100% rename from src/test/ui/issue-12552.stderr rename to src/test/ui/issues/issue-12552.stderr diff --git a/src/test/ui/issue-12567.nll.stderr b/src/test/ui/issues/issue-12567.nll.stderr similarity index 100% rename from src/test/ui/issue-12567.nll.stderr rename to src/test/ui/issues/issue-12567.nll.stderr diff --git a/src/test/ui/issue-12567.rs b/src/test/ui/issues/issue-12567.rs similarity index 100% rename from src/test/ui/issue-12567.rs rename to src/test/ui/issues/issue-12567.rs diff --git a/src/test/ui/issue-12567.stderr b/src/test/ui/issues/issue-12567.stderr similarity index 100% rename from src/test/ui/issue-12567.stderr rename to src/test/ui/issues/issue-12567.stderr diff --git a/src/test/ui/issue-12796.rs b/src/test/ui/issues/issue-12796.rs similarity index 100% rename from src/test/ui/issue-12796.rs rename to src/test/ui/issues/issue-12796.rs diff --git a/src/test/ui/issue-12796.stderr b/src/test/ui/issues/issue-12796.stderr similarity index 100% rename from src/test/ui/issue-12796.stderr rename to src/test/ui/issues/issue-12796.stderr diff --git a/src/test/ui/issue-12863.rs b/src/test/ui/issues/issue-12863.rs similarity index 100% rename from src/test/ui/issue-12863.rs rename to src/test/ui/issues/issue-12863.rs diff --git a/src/test/ui/issue-12863.stderr b/src/test/ui/issues/issue-12863.stderr similarity index 100% rename from src/test/ui/issue-12863.stderr rename to src/test/ui/issues/issue-12863.stderr diff --git a/src/test/ui/issue-12997-1.rs b/src/test/ui/issues/issue-12997-1.rs similarity index 100% rename from src/test/ui/issue-12997-1.rs rename to src/test/ui/issues/issue-12997-1.rs diff --git a/src/test/ui/issue-12997-1.stderr b/src/test/ui/issues/issue-12997-1.stderr similarity index 100% rename from src/test/ui/issue-12997-1.stderr rename to src/test/ui/issues/issue-12997-1.stderr diff --git a/src/test/ui/issue-12997-2.rs b/src/test/ui/issues/issue-12997-2.rs similarity index 100% rename from src/test/ui/issue-12997-2.rs rename to src/test/ui/issues/issue-12997-2.rs diff --git a/src/test/ui/issue-12997-2.stderr b/src/test/ui/issues/issue-12997-2.stderr similarity index 100% rename from src/test/ui/issue-12997-2.stderr rename to src/test/ui/issues/issue-12997-2.stderr diff --git a/src/test/ui/issue-13033.rs b/src/test/ui/issues/issue-13033.rs similarity index 100% rename from src/test/ui/issue-13033.rs rename to src/test/ui/issues/issue-13033.rs diff --git a/src/test/ui/issue-13033.stderr b/src/test/ui/issues/issue-13033.stderr similarity index 100% rename from src/test/ui/issue-13033.stderr rename to src/test/ui/issues/issue-13033.stderr diff --git a/src/test/ui/issue-13058.nll.stderr b/src/test/ui/issues/issue-13058.nll.stderr similarity index 100% rename from src/test/ui/issue-13058.nll.stderr rename to src/test/ui/issues/issue-13058.nll.stderr diff --git a/src/test/ui/issue-13058.rs b/src/test/ui/issues/issue-13058.rs similarity index 100% rename from src/test/ui/issue-13058.rs rename to src/test/ui/issues/issue-13058.rs diff --git a/src/test/ui/issue-13058.stderr b/src/test/ui/issues/issue-13058.stderr similarity index 100% rename from src/test/ui/issue-13058.stderr rename to src/test/ui/issues/issue-13058.stderr diff --git a/src/test/ui/issue-13352.rs b/src/test/ui/issues/issue-13352.rs similarity index 100% rename from src/test/ui/issue-13352.rs rename to src/test/ui/issues/issue-13352.rs diff --git a/src/test/ui/issue-13352.stderr b/src/test/ui/issues/issue-13352.stderr similarity index 100% rename from src/test/ui/issue-13352.stderr rename to src/test/ui/issues/issue-13352.stderr diff --git a/src/test/ui/issue-13359.rs b/src/test/ui/issues/issue-13359.rs similarity index 100% rename from src/test/ui/issue-13359.rs rename to src/test/ui/issues/issue-13359.rs diff --git a/src/test/ui/issue-13359.stderr b/src/test/ui/issues/issue-13359.stderr similarity index 100% rename from src/test/ui/issue-13359.stderr rename to src/test/ui/issues/issue-13359.stderr diff --git a/src/test/ui/issue-13404.rs b/src/test/ui/issues/issue-13404.rs similarity index 100% rename from src/test/ui/issue-13404.rs rename to src/test/ui/issues/issue-13404.rs diff --git a/src/test/ui/issue-13404.stderr b/src/test/ui/issues/issue-13404.stderr similarity index 100% rename from src/test/ui/issue-13404.stderr rename to src/test/ui/issues/issue-13404.stderr diff --git a/src/test/ui/issue-13407.rs b/src/test/ui/issues/issue-13407.rs similarity index 100% rename from src/test/ui/issue-13407.rs rename to src/test/ui/issues/issue-13407.rs diff --git a/src/test/ui/issue-13407.stderr b/src/test/ui/issues/issue-13407.stderr similarity index 100% rename from src/test/ui/issue-13407.stderr rename to src/test/ui/issues/issue-13407.stderr diff --git a/src/test/ui/issue-13446.rs b/src/test/ui/issues/issue-13446.rs similarity index 100% rename from src/test/ui/issue-13446.rs rename to src/test/ui/issues/issue-13446.rs diff --git a/src/test/ui/issue-13446.stderr b/src/test/ui/issues/issue-13446.stderr similarity index 100% rename from src/test/ui/issue-13446.stderr rename to src/test/ui/issues/issue-13446.stderr diff --git a/src/test/ui/issue-13466.rs b/src/test/ui/issues/issue-13466.rs similarity index 100% rename from src/test/ui/issue-13466.rs rename to src/test/ui/issues/issue-13466.rs diff --git a/src/test/ui/issue-13466.stderr b/src/test/ui/issues/issue-13466.stderr similarity index 100% rename from src/test/ui/issue-13466.stderr rename to src/test/ui/issues/issue-13466.stderr diff --git a/src/test/ui/issue-13482-2.rs b/src/test/ui/issues/issue-13482-2.rs similarity index 100% rename from src/test/ui/issue-13482-2.rs rename to src/test/ui/issues/issue-13482-2.rs diff --git a/src/test/ui/issue-13482-2.stderr b/src/test/ui/issues/issue-13482-2.stderr similarity index 100% rename from src/test/ui/issue-13482-2.stderr rename to src/test/ui/issues/issue-13482-2.stderr diff --git a/src/test/ui/issue-13482.rs b/src/test/ui/issues/issue-13482.rs similarity index 100% rename from src/test/ui/issue-13482.rs rename to src/test/ui/issues/issue-13482.rs diff --git a/src/test/ui/issue-13482.stderr b/src/test/ui/issues/issue-13482.stderr similarity index 100% rename from src/test/ui/issue-13482.stderr rename to src/test/ui/issues/issue-13482.stderr diff --git a/src/test/ui/issue-13483.rs b/src/test/ui/issues/issue-13483.rs similarity index 100% rename from src/test/ui/issue-13483.rs rename to src/test/ui/issues/issue-13483.rs diff --git a/src/test/ui/issue-13483.stderr b/src/test/ui/issues/issue-13483.stderr similarity index 100% rename from src/test/ui/issue-13483.stderr rename to src/test/ui/issues/issue-13483.stderr diff --git a/src/test/ui/issue-13497-2.nll.stderr b/src/test/ui/issues/issue-13497-2.nll.stderr similarity index 100% rename from src/test/ui/issue-13497-2.nll.stderr rename to src/test/ui/issues/issue-13497-2.nll.stderr diff --git a/src/test/ui/issue-13497-2.rs b/src/test/ui/issues/issue-13497-2.rs similarity index 100% rename from src/test/ui/issue-13497-2.rs rename to src/test/ui/issues/issue-13497-2.rs diff --git a/src/test/ui/issue-13497-2.stderr b/src/test/ui/issues/issue-13497-2.stderr similarity index 100% rename from src/test/ui/issue-13497-2.stderr rename to src/test/ui/issues/issue-13497-2.stderr diff --git a/src/test/ui/issue-13497.rs b/src/test/ui/issues/issue-13497.rs similarity index 100% rename from src/test/ui/issue-13497.rs rename to src/test/ui/issues/issue-13497.rs diff --git a/src/test/ui/issue-13497.stderr b/src/test/ui/issues/issue-13497.stderr similarity index 100% rename from src/test/ui/issue-13497.stderr rename to src/test/ui/issues/issue-13497.stderr diff --git a/src/test/ui/issue-1362.rs b/src/test/ui/issues/issue-1362.rs similarity index 100% rename from src/test/ui/issue-1362.rs rename to src/test/ui/issues/issue-1362.rs diff --git a/src/test/ui/issue-1362.stderr b/src/test/ui/issues/issue-1362.stderr similarity index 100% rename from src/test/ui/issue-1362.stderr rename to src/test/ui/issues/issue-1362.stderr diff --git a/src/test/ui/issue-13641.rs b/src/test/ui/issues/issue-13641.rs similarity index 100% rename from src/test/ui/issue-13641.rs rename to src/test/ui/issues/issue-13641.rs diff --git a/src/test/ui/issue-13641.stderr b/src/test/ui/issues/issue-13641.stderr similarity index 100% rename from src/test/ui/issue-13641.stderr rename to src/test/ui/issues/issue-13641.stderr diff --git a/src/test/ui/issue-13727.rs b/src/test/ui/issues/issue-13727.rs similarity index 100% rename from src/test/ui/issue-13727.rs rename to src/test/ui/issues/issue-13727.rs diff --git a/src/test/ui/issue-13727.stderr b/src/test/ui/issues/issue-13727.stderr similarity index 100% rename from src/test/ui/issue-13727.stderr rename to src/test/ui/issues/issue-13727.stderr diff --git a/src/test/ui/issue-13847.rs b/src/test/ui/issues/issue-13847.rs similarity index 100% rename from src/test/ui/issue-13847.rs rename to src/test/ui/issues/issue-13847.rs diff --git a/src/test/ui/issue-13847.stderr b/src/test/ui/issues/issue-13847.stderr similarity index 100% rename from src/test/ui/issue-13847.stderr rename to src/test/ui/issues/issue-13847.stderr diff --git a/src/test/ui/issue-13853-2.rs b/src/test/ui/issues/issue-13853-2.rs similarity index 100% rename from src/test/ui/issue-13853-2.rs rename to src/test/ui/issues/issue-13853-2.rs diff --git a/src/test/ui/issue-13853-2.stderr b/src/test/ui/issues/issue-13853-2.stderr similarity index 100% rename from src/test/ui/issue-13853-2.stderr rename to src/test/ui/issues/issue-13853-2.stderr diff --git a/src/test/ui/issue-13853-5.rs b/src/test/ui/issues/issue-13853-5.rs similarity index 100% rename from src/test/ui/issue-13853-5.rs rename to src/test/ui/issues/issue-13853-5.rs diff --git a/src/test/ui/issue-13853-5.stderr b/src/test/ui/issues/issue-13853-5.stderr similarity index 100% rename from src/test/ui/issue-13853-5.stderr rename to src/test/ui/issues/issue-13853-5.stderr diff --git a/src/test/ui/issue-13853.rs b/src/test/ui/issues/issue-13853.rs similarity index 100% rename from src/test/ui/issue-13853.rs rename to src/test/ui/issues/issue-13853.rs diff --git a/src/test/ui/issue-13853.stderr b/src/test/ui/issues/issue-13853.stderr similarity index 100% rename from src/test/ui/issue-13853.stderr rename to src/test/ui/issues/issue-13853.stderr diff --git a/src/test/ui/issue-14091-2.rs b/src/test/ui/issues/issue-14091-2.rs similarity index 100% rename from src/test/ui/issue-14091-2.rs rename to src/test/ui/issues/issue-14091-2.rs diff --git a/src/test/ui/issue-14091-2.stderr b/src/test/ui/issues/issue-14091-2.stderr similarity index 100% rename from src/test/ui/issue-14091-2.stderr rename to src/test/ui/issues/issue-14091-2.stderr diff --git a/src/test/ui/issue-14091.rs b/src/test/ui/issues/issue-14091.rs similarity index 100% rename from src/test/ui/issue-14091.rs rename to src/test/ui/issues/issue-14091.rs diff --git a/src/test/ui/issue-14091.stderr b/src/test/ui/issues/issue-14091.stderr similarity index 100% rename from src/test/ui/issue-14091.stderr rename to src/test/ui/issues/issue-14091.stderr diff --git a/src/test/ui/issue-14092.rs b/src/test/ui/issues/issue-14092.rs similarity index 100% rename from src/test/ui/issue-14092.rs rename to src/test/ui/issues/issue-14092.rs diff --git a/src/test/ui/issue-14092.stderr b/src/test/ui/issues/issue-14092.stderr similarity index 100% rename from src/test/ui/issue-14092.stderr rename to src/test/ui/issues/issue-14092.stderr diff --git a/src/test/ui/issue-14221.rs b/src/test/ui/issues/issue-14221.rs similarity index 100% rename from src/test/ui/issue-14221.rs rename to src/test/ui/issues/issue-14221.rs diff --git a/src/test/ui/issue-14221.stderr b/src/test/ui/issues/issue-14221.stderr similarity index 100% rename from src/test/ui/issue-14221.stderr rename to src/test/ui/issues/issue-14221.stderr diff --git a/src/test/ui/issue-14227.rs b/src/test/ui/issues/issue-14227.rs similarity index 100% rename from src/test/ui/issue-14227.rs rename to src/test/ui/issues/issue-14227.rs diff --git a/src/test/ui/issue-14227.stderr b/src/test/ui/issues/issue-14227.stderr similarity index 100% rename from src/test/ui/issue-14227.stderr rename to src/test/ui/issues/issue-14227.stderr diff --git a/src/test/ui/issue-14285.nll.stderr b/src/test/ui/issues/issue-14285.nll.stderr similarity index 100% rename from src/test/ui/issue-14285.nll.stderr rename to src/test/ui/issues/issue-14285.nll.stderr diff --git a/src/test/ui/issue-14285.rs b/src/test/ui/issues/issue-14285.rs similarity index 100% rename from src/test/ui/issue-14285.rs rename to src/test/ui/issues/issue-14285.rs diff --git a/src/test/ui/issue-14285.stderr b/src/test/ui/issues/issue-14285.stderr similarity index 100% rename from src/test/ui/issue-14285.stderr rename to src/test/ui/issues/issue-14285.stderr diff --git a/src/test/ui/issue-14309.rs b/src/test/ui/issues/issue-14309.rs similarity index 100% rename from src/test/ui/issue-14309.rs rename to src/test/ui/issues/issue-14309.rs diff --git a/src/test/ui/issue-14309.stderr b/src/test/ui/issues/issue-14309.stderr similarity index 100% rename from src/test/ui/issue-14309.stderr rename to src/test/ui/issues/issue-14309.stderr diff --git a/src/test/ui/issue-14366.rs b/src/test/ui/issues/issue-14366.rs similarity index 100% rename from src/test/ui/issue-14366.rs rename to src/test/ui/issues/issue-14366.rs diff --git a/src/test/ui/issue-14366.stderr b/src/test/ui/issues/issue-14366.stderr similarity index 100% rename from src/test/ui/issue-14366.stderr rename to src/test/ui/issues/issue-14366.stderr diff --git a/src/test/ui/issue-1448-2.rs b/src/test/ui/issues/issue-1448-2.rs similarity index 100% rename from src/test/ui/issue-1448-2.rs rename to src/test/ui/issues/issue-1448-2.rs diff --git a/src/test/ui/issue-1448-2.stderr b/src/test/ui/issues/issue-1448-2.stderr similarity index 100% rename from src/test/ui/issue-1448-2.stderr rename to src/test/ui/issues/issue-1448-2.stderr diff --git a/src/test/ui/issue-14541.rs b/src/test/ui/issues/issue-14541.rs similarity index 100% rename from src/test/ui/issue-14541.rs rename to src/test/ui/issues/issue-14541.rs diff --git a/src/test/ui/issue-14541.stderr b/src/test/ui/issues/issue-14541.stderr similarity index 100% rename from src/test/ui/issue-14541.stderr rename to src/test/ui/issues/issue-14541.stderr diff --git a/src/test/ui/issue-14721.rs b/src/test/ui/issues/issue-14721.rs similarity index 100% rename from src/test/ui/issue-14721.rs rename to src/test/ui/issues/issue-14721.rs diff --git a/src/test/ui/issue-14721.stderr b/src/test/ui/issues/issue-14721.stderr similarity index 100% rename from src/test/ui/issue-14721.stderr rename to src/test/ui/issues/issue-14721.stderr diff --git a/src/test/ui/issue-1476.rs b/src/test/ui/issues/issue-1476.rs similarity index 100% rename from src/test/ui/issue-1476.rs rename to src/test/ui/issues/issue-1476.rs diff --git a/src/test/ui/issue-1476.stderr b/src/test/ui/issues/issue-1476.stderr similarity index 100% rename from src/test/ui/issue-1476.stderr rename to src/test/ui/issues/issue-1476.stderr diff --git a/src/test/ui/issue-14772.rs b/src/test/ui/issues/issue-14772.rs similarity index 100% rename from src/test/ui/issue-14772.rs rename to src/test/ui/issues/issue-14772.rs diff --git a/src/test/ui/issue-14772.stderr b/src/test/ui/issues/issue-14772.stderr similarity index 100% rename from src/test/ui/issue-14772.stderr rename to src/test/ui/issues/issue-14772.stderr diff --git a/src/test/ui/issue-14845.rs b/src/test/ui/issues/issue-14845.rs similarity index 100% rename from src/test/ui/issue-14845.rs rename to src/test/ui/issues/issue-14845.rs diff --git a/src/test/ui/issue-14845.stderr b/src/test/ui/issues/issue-14845.stderr similarity index 100% rename from src/test/ui/issue-14845.stderr rename to src/test/ui/issues/issue-14845.stderr diff --git a/src/test/ui/issue-14853.rs b/src/test/ui/issues/issue-14853.rs similarity index 100% rename from src/test/ui/issue-14853.rs rename to src/test/ui/issues/issue-14853.rs diff --git a/src/test/ui/issue-14853.stderr b/src/test/ui/issues/issue-14853.stderr similarity index 100% rename from src/test/ui/issue-14853.stderr rename to src/test/ui/issues/issue-14853.stderr diff --git a/src/test/ui/issue-14915.rs b/src/test/ui/issues/issue-14915.rs similarity index 100% rename from src/test/ui/issue-14915.rs rename to src/test/ui/issues/issue-14915.rs diff --git a/src/test/ui/issue-14915.stderr b/src/test/ui/issues/issue-14915.stderr similarity index 100% rename from src/test/ui/issue-14915.stderr rename to src/test/ui/issues/issue-14915.stderr diff --git a/src/test/ui/issue-15034.nll.stderr b/src/test/ui/issues/issue-15034.nll.stderr similarity index 100% rename from src/test/ui/issue-15034.nll.stderr rename to src/test/ui/issues/issue-15034.nll.stderr diff --git a/src/test/ui/issue-15034.rs b/src/test/ui/issues/issue-15034.rs similarity index 100% rename from src/test/ui/issue-15034.rs rename to src/test/ui/issues/issue-15034.rs diff --git a/src/test/ui/issue-15034.stderr b/src/test/ui/issues/issue-15034.stderr similarity index 100% rename from src/test/ui/issue-15034.stderr rename to src/test/ui/issues/issue-15034.stderr diff --git a/src/test/ui/issue-15094.rs b/src/test/ui/issues/issue-15094.rs similarity index 100% rename from src/test/ui/issue-15094.rs rename to src/test/ui/issues/issue-15094.rs diff --git a/src/test/ui/issue-15094.stderr b/src/test/ui/issues/issue-15094.stderr similarity index 100% rename from src/test/ui/issue-15094.stderr rename to src/test/ui/issues/issue-15094.stderr diff --git a/src/test/ui/issue-15129.rs b/src/test/ui/issues/issue-15129.rs similarity index 100% rename from src/test/ui/issue-15129.rs rename to src/test/ui/issues/issue-15129.rs diff --git a/src/test/ui/issue-15129.stderr b/src/test/ui/issues/issue-15129.stderr similarity index 100% rename from src/test/ui/issue-15129.stderr rename to src/test/ui/issues/issue-15129.stderr diff --git a/src/test/ui/issue-15167.rs b/src/test/ui/issues/issue-15167.rs similarity index 100% rename from src/test/ui/issue-15167.rs rename to src/test/ui/issues/issue-15167.rs diff --git a/src/test/ui/issue-15167.stderr b/src/test/ui/issues/issue-15167.stderr similarity index 100% rename from src/test/ui/issue-15167.stderr rename to src/test/ui/issues/issue-15167.stderr diff --git a/src/test/ui/issue-15207.rs b/src/test/ui/issues/issue-15207.rs similarity index 100% rename from src/test/ui/issue-15207.rs rename to src/test/ui/issues/issue-15207.rs diff --git a/src/test/ui/issue-15207.stderr b/src/test/ui/issues/issue-15207.stderr similarity index 100% rename from src/test/ui/issue-15207.stderr rename to src/test/ui/issues/issue-15207.stderr diff --git a/src/test/ui/issue-15260.rs b/src/test/ui/issues/issue-15260.rs similarity index 100% rename from src/test/ui/issue-15260.rs rename to src/test/ui/issues/issue-15260.rs diff --git a/src/test/ui/issue-15260.stderr b/src/test/ui/issues/issue-15260.stderr similarity index 100% rename from src/test/ui/issue-15260.stderr rename to src/test/ui/issues/issue-15260.stderr diff --git a/src/test/ui/issue-15381.rs b/src/test/ui/issues/issue-15381.rs similarity index 100% rename from src/test/ui/issue-15381.rs rename to src/test/ui/issues/issue-15381.rs diff --git a/src/test/ui/issue-15381.stderr b/src/test/ui/issues/issue-15381.stderr similarity index 100% rename from src/test/ui/issue-15381.stderr rename to src/test/ui/issues/issue-15381.stderr diff --git a/src/test/ui/issue-15524.rs b/src/test/ui/issues/issue-15524.rs similarity index 100% rename from src/test/ui/issue-15524.rs rename to src/test/ui/issues/issue-15524.rs diff --git a/src/test/ui/issue-15524.stderr b/src/test/ui/issues/issue-15524.stderr similarity index 100% rename from src/test/ui/issue-15524.stderr rename to src/test/ui/issues/issue-15524.stderr diff --git a/src/test/ui/issue-15756.rs b/src/test/ui/issues/issue-15756.rs similarity index 100% rename from src/test/ui/issue-15756.rs rename to src/test/ui/issues/issue-15756.rs diff --git a/src/test/ui/issue-15756.stderr b/src/test/ui/issues/issue-15756.stderr similarity index 100% rename from src/test/ui/issue-15756.stderr rename to src/test/ui/issues/issue-15756.stderr diff --git a/src/test/ui/issue-15783.rs b/src/test/ui/issues/issue-15783.rs similarity index 100% rename from src/test/ui/issue-15783.rs rename to src/test/ui/issues/issue-15783.rs diff --git a/src/test/ui/issue-15783.stderr b/src/test/ui/issues/issue-15783.stderr similarity index 100% rename from src/test/ui/issue-15783.stderr rename to src/test/ui/issues/issue-15783.stderr diff --git a/src/test/ui/issue-15896.rs b/src/test/ui/issues/issue-15896.rs similarity index 100% rename from src/test/ui/issue-15896.rs rename to src/test/ui/issues/issue-15896.rs diff --git a/src/test/ui/issue-15896.stderr b/src/test/ui/issues/issue-15896.stderr similarity index 100% rename from src/test/ui/issue-15896.stderr rename to src/test/ui/issues/issue-15896.stderr diff --git a/src/test/compile-fail/issue-15919.rs b/src/test/ui/issues/issue-15919.rs similarity index 92% rename from src/test/compile-fail/issue-15919.rs rename to src/test/ui/issues/issue-15919.rs index df7e7c102b213..f371995190972 100644 --- a/src/test/compile-fail/issue-15919.rs +++ b/src/test/ui/issues/issue-15919.rs @@ -9,6 +9,7 @@ // except according to those terms. // error-pattern: too big for the current architecture +// normalize-stderr-test "\[usize; \d+\]" -> "[usize; N]" #[cfg(target_pointer_width = "32")] fn main() { diff --git a/src/test/ui/issues/issue-15919.stderr b/src/test/ui/issues/issue-15919.stderr new file mode 100644 index 0000000000000..e4e88cc47cfe7 --- /dev/null +++ b/src/test/ui/issues/issue-15919.stderr @@ -0,0 +1,4 @@ +error: the type `[usize; N]` is too big for the current architecture + +error: aborting due to previous error + diff --git a/src/test/ui/issue-15965.rs b/src/test/ui/issues/issue-15965.rs similarity index 100% rename from src/test/ui/issue-15965.rs rename to src/test/ui/issues/issue-15965.rs diff --git a/src/test/ui/issue-15965.stderr b/src/test/ui/issues/issue-15965.stderr similarity index 100% rename from src/test/ui/issue-15965.stderr rename to src/test/ui/issues/issue-15965.stderr diff --git a/src/test/ui/issue-16048.rs b/src/test/ui/issues/issue-16048.rs similarity index 100% rename from src/test/ui/issue-16048.rs rename to src/test/ui/issues/issue-16048.rs diff --git a/src/test/ui/issue-16048.stderr b/src/test/ui/issues/issue-16048.stderr similarity index 100% rename from src/test/ui/issue-16048.stderr rename to src/test/ui/issues/issue-16048.stderr diff --git a/src/test/ui/issue-16098.rs b/src/test/ui/issues/issue-16098.rs similarity index 100% rename from src/test/ui/issue-16098.rs rename to src/test/ui/issues/issue-16098.rs diff --git a/src/test/ui/issue-16098.stderr b/src/test/ui/issues/issue-16098.stderr similarity index 100% rename from src/test/ui/issue-16098.stderr rename to src/test/ui/issues/issue-16098.stderr diff --git a/src/test/ui/issue-16149.rs b/src/test/ui/issues/issue-16149.rs similarity index 100% rename from src/test/ui/issue-16149.rs rename to src/test/ui/issues/issue-16149.rs diff --git a/src/test/ui/issue-16149.stderr b/src/test/ui/issues/issue-16149.stderr similarity index 100% rename from src/test/ui/issue-16149.stderr rename to src/test/ui/issues/issue-16149.stderr diff --git a/src/test/ui/issue-16250.rs b/src/test/ui/issues/issue-16250.rs similarity index 100% rename from src/test/ui/issue-16250.rs rename to src/test/ui/issues/issue-16250.rs diff --git a/src/test/ui/issue-16250.stderr b/src/test/ui/issues/issue-16250.stderr similarity index 100% rename from src/test/ui/issue-16250.stderr rename to src/test/ui/issues/issue-16250.stderr diff --git a/src/test/ui/issue-16338.rs b/src/test/ui/issues/issue-16338.rs similarity index 100% rename from src/test/ui/issue-16338.rs rename to src/test/ui/issues/issue-16338.rs diff --git a/src/test/ui/issue-16338.stderr b/src/test/ui/issues/issue-16338.stderr similarity index 100% rename from src/test/ui/issue-16338.stderr rename to src/test/ui/issues/issue-16338.stderr diff --git a/src/test/ui/issue-16401.rs b/src/test/ui/issues/issue-16401.rs similarity index 100% rename from src/test/ui/issue-16401.rs rename to src/test/ui/issues/issue-16401.rs diff --git a/src/test/ui/issue-16401.stderr b/src/test/ui/issues/issue-16401.stderr similarity index 100% rename from src/test/ui/issue-16401.stderr rename to src/test/ui/issues/issue-16401.stderr diff --git a/src/test/ui/issue-16538.rs b/src/test/ui/issues/issue-16538.rs similarity index 100% rename from src/test/ui/issue-16538.rs rename to src/test/ui/issues/issue-16538.rs diff --git a/src/test/ui/issue-16538.stderr b/src/test/ui/issues/issue-16538.stderr similarity index 100% rename from src/test/ui/issue-16538.stderr rename to src/test/ui/issues/issue-16538.stderr diff --git a/src/test/ui/issue-16562.rs b/src/test/ui/issues/issue-16562.rs similarity index 100% rename from src/test/ui/issue-16562.rs rename to src/test/ui/issues/issue-16562.rs diff --git a/src/test/ui/issue-16562.stderr b/src/test/ui/issues/issue-16562.stderr similarity index 100% rename from src/test/ui/issue-16562.stderr rename to src/test/ui/issues/issue-16562.stderr diff --git a/src/test/ui/issue-16683.nll.stderr b/src/test/ui/issues/issue-16683.nll.stderr similarity index 100% rename from src/test/ui/issue-16683.nll.stderr rename to src/test/ui/issues/issue-16683.nll.stderr diff --git a/src/test/ui/issue-16683.rs b/src/test/ui/issues/issue-16683.rs similarity index 100% rename from src/test/ui/issue-16683.rs rename to src/test/ui/issues/issue-16683.rs diff --git a/src/test/ui/issue-16683.stderr b/src/test/ui/issues/issue-16683.stderr similarity index 100% rename from src/test/ui/issue-16683.stderr rename to src/test/ui/issues/issue-16683.stderr diff --git a/src/test/compile-fail/issue-16725.rs b/src/test/ui/issues/issue-16725.rs similarity index 100% rename from src/test/compile-fail/issue-16725.rs rename to src/test/ui/issues/issue-16725.rs diff --git a/src/test/ui/issues/issue-16725.stderr b/src/test/ui/issues/issue-16725.stderr new file mode 100644 index 0000000000000..709f3cf50b992 --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-16922.nll.stderr b/src/test/ui/issues/issue-16922.nll.stderr similarity index 100% rename from src/test/ui/issue-16922.nll.stderr rename to src/test/ui/issues/issue-16922.nll.stderr diff --git a/src/test/ui/issue-16922.rs b/src/test/ui/issues/issue-16922.rs similarity index 100% rename from src/test/ui/issue-16922.rs rename to src/test/ui/issues/issue-16922.rs diff --git a/src/test/ui/issue-16922.stderr b/src/test/ui/issues/issue-16922.stderr similarity index 100% rename from src/test/ui/issue-16922.stderr rename to src/test/ui/issues/issue-16922.stderr diff --git a/src/test/ui/issue-16939.rs b/src/test/ui/issues/issue-16939.rs similarity index 100% rename from src/test/ui/issue-16939.rs rename to src/test/ui/issues/issue-16939.rs diff --git a/src/test/ui/issue-16939.stderr b/src/test/ui/issues/issue-16939.stderr similarity index 100% rename from src/test/ui/issue-16939.stderr rename to src/test/ui/issues/issue-16939.stderr diff --git a/src/test/ui/issue-16966.rs b/src/test/ui/issues/issue-16966.rs similarity index 100% rename from src/test/ui/issue-16966.rs rename to src/test/ui/issues/issue-16966.rs diff --git a/src/test/ui/issue-16966.stderr b/src/test/ui/issues/issue-16966.stderr similarity index 100% rename from src/test/ui/issue-16966.stderr rename to src/test/ui/issues/issue-16966.stderr diff --git a/src/test/ui/issue-1697.rs b/src/test/ui/issues/issue-1697.rs similarity index 100% rename from src/test/ui/issue-1697.rs rename to src/test/ui/issues/issue-1697.rs diff --git a/src/test/ui/issue-1697.stderr b/src/test/ui/issues/issue-1697.stderr similarity index 100% rename from src/test/ui/issue-1697.stderr rename to src/test/ui/issues/issue-1697.stderr diff --git a/src/test/ui/issue-16994.rs b/src/test/ui/issues/issue-16994.rs similarity index 100% rename from src/test/ui/issue-16994.rs rename to src/test/ui/issues/issue-16994.rs diff --git a/src/test/ui/issue-16994.stderr b/src/test/ui/issues/issue-16994.stderr similarity index 100% rename from src/test/ui/issue-16994.stderr rename to src/test/ui/issues/issue-16994.stderr diff --git a/src/test/ui/issue-17001.rs b/src/test/ui/issues/issue-17001.rs similarity index 100% rename from src/test/ui/issue-17001.rs rename to src/test/ui/issues/issue-17001.rs diff --git a/src/test/ui/issue-17001.stderr b/src/test/ui/issues/issue-17001.stderr similarity index 100% rename from src/test/ui/issue-17001.stderr rename to src/test/ui/issues/issue-17001.stderr diff --git a/src/test/ui/issue-17025.rs b/src/test/ui/issues/issue-17025.rs similarity index 100% rename from src/test/ui/issue-17025.rs rename to src/test/ui/issues/issue-17025.rs diff --git a/src/test/ui/issue-17033.rs b/src/test/ui/issues/issue-17033.rs similarity index 100% rename from src/test/ui/issue-17033.rs rename to src/test/ui/issues/issue-17033.rs diff --git a/src/test/ui/issue-17033.stderr b/src/test/ui/issues/issue-17033.stderr similarity index 100% rename from src/test/ui/issue-17033.stderr rename to src/test/ui/issues/issue-17033.stderr diff --git a/src/test/ui/issue-17252.rs b/src/test/ui/issues/issue-17252.rs similarity index 100% rename from src/test/ui/issue-17252.rs rename to src/test/ui/issues/issue-17252.rs diff --git a/src/test/ui/issue-17252.stderr b/src/test/ui/issues/issue-17252.stderr similarity index 100% rename from src/test/ui/issue-17252.stderr rename to src/test/ui/issues/issue-17252.stderr diff --git a/src/test/ui/issue-17263.nll.stderr b/src/test/ui/issues/issue-17263.nll.stderr similarity index 100% rename from src/test/ui/issue-17263.nll.stderr rename to src/test/ui/issues/issue-17263.nll.stderr diff --git a/src/test/ui/issue-17263.rs b/src/test/ui/issues/issue-17263.rs similarity index 100% rename from src/test/ui/issue-17263.rs rename to src/test/ui/issues/issue-17263.rs diff --git a/src/test/ui/issue-17263.stderr b/src/test/ui/issues/issue-17263.stderr similarity index 100% rename from src/test/ui/issue-17263.stderr rename to src/test/ui/issues/issue-17263.stderr diff --git a/src/test/ui/issue-17337.rs b/src/test/ui/issues/issue-17337.rs similarity index 100% rename from src/test/ui/issue-17337.rs rename to src/test/ui/issues/issue-17337.rs diff --git a/src/test/ui/issue-17337.stderr b/src/test/ui/issues/issue-17337.stderr similarity index 100% rename from src/test/ui/issue-17337.stderr rename to src/test/ui/issues/issue-17337.stderr diff --git a/src/test/ui/issue-17373.rs b/src/test/ui/issues/issue-17373.rs similarity index 100% rename from src/test/ui/issue-17373.rs rename to src/test/ui/issues/issue-17373.rs diff --git a/src/test/ui/issue-17373.stderr b/src/test/ui/issues/issue-17373.stderr similarity index 100% rename from src/test/ui/issue-17373.stderr rename to src/test/ui/issues/issue-17373.stderr diff --git a/src/test/ui/issue-17385.nll.stderr b/src/test/ui/issues/issue-17385.nll.stderr similarity index 100% rename from src/test/ui/issue-17385.nll.stderr rename to src/test/ui/issues/issue-17385.nll.stderr diff --git a/src/test/ui/issue-17385.rs b/src/test/ui/issues/issue-17385.rs similarity index 100% rename from src/test/ui/issue-17385.rs rename to src/test/ui/issues/issue-17385.rs diff --git a/src/test/ui/issue-17385.stderr b/src/test/ui/issues/issue-17385.stderr similarity index 100% rename from src/test/ui/issue-17385.stderr rename to src/test/ui/issues/issue-17385.stderr diff --git a/src/test/ui/issue-17405.rs b/src/test/ui/issues/issue-17405.rs similarity index 100% rename from src/test/ui/issue-17405.rs rename to src/test/ui/issues/issue-17405.rs diff --git a/src/test/ui/issue-17405.stderr b/src/test/ui/issues/issue-17405.stderr similarity index 100% rename from src/test/ui/issue-17405.stderr rename to src/test/ui/issues/issue-17405.stderr diff --git a/src/test/ui/issue-17431-1.rs b/src/test/ui/issues/issue-17431-1.rs similarity index 100% rename from src/test/ui/issue-17431-1.rs rename to src/test/ui/issues/issue-17431-1.rs diff --git a/src/test/ui/issue-17431-1.stderr b/src/test/ui/issues/issue-17431-1.stderr similarity index 100% rename from src/test/ui/issue-17431-1.stderr rename to src/test/ui/issues/issue-17431-1.stderr diff --git a/src/test/ui/issue-17431-2.rs b/src/test/ui/issues/issue-17431-2.rs similarity index 100% rename from src/test/ui/issue-17431-2.rs rename to src/test/ui/issues/issue-17431-2.rs diff --git a/src/test/ui/issue-17431-2.stderr b/src/test/ui/issues/issue-17431-2.stderr similarity index 100% rename from src/test/ui/issue-17431-2.stderr rename to src/test/ui/issues/issue-17431-2.stderr diff --git a/src/test/ui/issue-17431-3.rs b/src/test/ui/issues/issue-17431-3.rs similarity index 100% rename from src/test/ui/issue-17431-3.rs rename to src/test/ui/issues/issue-17431-3.rs diff --git a/src/test/ui/issue-17431-3.stderr b/src/test/ui/issues/issue-17431-3.stderr similarity index 100% rename from src/test/ui/issue-17431-3.stderr rename to src/test/ui/issues/issue-17431-3.stderr diff --git a/src/test/ui/issue-17431-4.rs b/src/test/ui/issues/issue-17431-4.rs similarity index 100% rename from src/test/ui/issue-17431-4.rs rename to src/test/ui/issues/issue-17431-4.rs diff --git a/src/test/ui/issue-17431-4.stderr b/src/test/ui/issues/issue-17431-4.stderr similarity index 100% rename from src/test/ui/issue-17431-4.stderr rename to src/test/ui/issues/issue-17431-4.stderr diff --git a/src/test/ui/issue-17431-5.rs b/src/test/ui/issues/issue-17431-5.rs similarity index 100% rename from src/test/ui/issue-17431-5.rs rename to src/test/ui/issues/issue-17431-5.rs diff --git a/src/test/ui/issue-17431-5.stderr b/src/test/ui/issues/issue-17431-5.stderr similarity index 100% rename from src/test/ui/issue-17431-5.stderr rename to src/test/ui/issues/issue-17431-5.stderr diff --git a/src/test/ui/issue-17431-6.rs b/src/test/ui/issues/issue-17431-6.rs similarity index 100% rename from src/test/ui/issue-17431-6.rs rename to src/test/ui/issues/issue-17431-6.rs diff --git a/src/test/ui/issue-17431-6.stderr b/src/test/ui/issues/issue-17431-6.stderr similarity index 100% rename from src/test/ui/issue-17431-6.stderr rename to src/test/ui/issues/issue-17431-6.stderr diff --git a/src/test/ui/issue-17431-7.rs b/src/test/ui/issues/issue-17431-7.rs similarity index 100% rename from src/test/ui/issue-17431-7.rs rename to src/test/ui/issues/issue-17431-7.rs diff --git a/src/test/ui/issue-17431-7.stderr b/src/test/ui/issues/issue-17431-7.stderr similarity index 100% rename from src/test/ui/issue-17431-7.stderr rename to src/test/ui/issues/issue-17431-7.stderr diff --git a/src/test/ui/issue-17441.rs b/src/test/ui/issues/issue-17441.rs similarity index 100% rename from src/test/ui/issue-17441.rs rename to src/test/ui/issues/issue-17441.rs diff --git a/src/test/ui/issue-17441.stderr b/src/test/ui/issues/issue-17441.stderr similarity index 100% rename from src/test/ui/issue-17441.stderr rename to src/test/ui/issues/issue-17441.stderr diff --git a/src/test/ui/issue-17444.rs b/src/test/ui/issues/issue-17444.rs similarity index 100% rename from src/test/ui/issue-17444.rs rename to src/test/ui/issues/issue-17444.rs diff --git a/src/test/ui/issue-17444.stderr b/src/test/ui/issues/issue-17444.stderr similarity index 100% rename from src/test/ui/issue-17444.stderr rename to src/test/ui/issues/issue-17444.stderr diff --git a/src/test/ui/issue-17458.rs b/src/test/ui/issues/issue-17458.rs similarity index 100% rename from src/test/ui/issue-17458.rs rename to src/test/ui/issues/issue-17458.rs diff --git a/src/test/ui/issue-17458.stderr b/src/test/ui/issues/issue-17458.stderr similarity index 100% rename from src/test/ui/issue-17458.stderr rename to src/test/ui/issues/issue-17458.stderr diff --git a/src/test/ui/issue-17545.nll.stderr b/src/test/ui/issues/issue-17545.nll.stderr similarity index 100% rename from src/test/ui/issue-17545.nll.stderr rename to src/test/ui/issues/issue-17545.nll.stderr diff --git a/src/test/ui/issue-17545.rs b/src/test/ui/issues/issue-17545.rs similarity index 100% rename from src/test/ui/issue-17545.rs rename to src/test/ui/issues/issue-17545.rs diff --git a/src/test/ui/issue-17545.stderr b/src/test/ui/issues/issue-17545.stderr similarity index 100% rename from src/test/ui/issue-17545.stderr rename to src/test/ui/issues/issue-17545.stderr diff --git a/src/test/ui/issue-17546.rs b/src/test/ui/issues/issue-17546.rs similarity index 100% rename from src/test/ui/issue-17546.rs rename to src/test/ui/issues/issue-17546.rs diff --git a/src/test/ui/issue-17546.stderr b/src/test/ui/issues/issue-17546.stderr similarity index 100% rename from src/test/ui/issue-17546.stderr rename to src/test/ui/issues/issue-17546.stderr diff --git a/src/test/ui/issue-17551.rs b/src/test/ui/issues/issue-17551.rs similarity index 100% rename from src/test/ui/issue-17551.rs rename to src/test/ui/issues/issue-17551.rs diff --git a/src/test/ui/issue-17551.stderr b/src/test/ui/issues/issue-17551.stderr similarity index 100% rename from src/test/ui/issue-17551.stderr rename to src/test/ui/issues/issue-17551.stderr diff --git a/src/test/ui/issue-17651.rs b/src/test/ui/issues/issue-17651.rs similarity index 100% rename from src/test/ui/issue-17651.rs rename to src/test/ui/issues/issue-17651.rs diff --git a/src/test/ui/issue-17651.stderr b/src/test/ui/issues/issue-17651.stderr similarity index 100% rename from src/test/ui/issue-17651.stderr rename to src/test/ui/issues/issue-17651.stderr diff --git a/src/test/ui/issue-17718-const-bad-values.rs b/src/test/ui/issues/issue-17718-const-bad-values.rs similarity index 100% rename from src/test/ui/issue-17718-const-bad-values.rs rename to src/test/ui/issues/issue-17718-const-bad-values.rs diff --git a/src/test/ui/issue-17718-const-bad-values.stderr b/src/test/ui/issues/issue-17718-const-bad-values.stderr similarity index 100% rename from src/test/ui/issue-17718-const-bad-values.stderr rename to src/test/ui/issues/issue-17718-const-bad-values.stderr diff --git a/src/test/ui/issue-17718-const-borrow.rs b/src/test/ui/issues/issue-17718-const-borrow.rs similarity index 100% rename from src/test/ui/issue-17718-const-borrow.rs rename to src/test/ui/issues/issue-17718-const-borrow.rs diff --git a/src/test/ui/issue-17718-const-borrow.stderr b/src/test/ui/issues/issue-17718-const-borrow.stderr similarity index 100% rename from src/test/ui/issue-17718-const-borrow.stderr rename to src/test/ui/issues/issue-17718-const-borrow.stderr diff --git a/src/test/ui/issue-17718-const-naming.rs b/src/test/ui/issues/issue-17718-const-naming.rs similarity index 100% rename from src/test/ui/issue-17718-const-naming.rs rename to src/test/ui/issues/issue-17718-const-naming.rs diff --git a/src/test/ui/issue-17718-const-naming.stderr b/src/test/ui/issues/issue-17718-const-naming.stderr similarity index 100% rename from src/test/ui/issue-17718-const-naming.stderr rename to src/test/ui/issues/issue-17718-const-naming.stderr diff --git a/src/test/compile-fail/issue-17718-const-privacy.rs b/src/test/ui/issues/issue-17718-const-privacy.rs similarity index 100% rename from src/test/compile-fail/issue-17718-const-privacy.rs rename to src/test/ui/issues/issue-17718-const-privacy.rs diff --git a/src/test/ui/issues/issue-17718-const-privacy.stderr b/src/test/ui/issues/issue-17718-const-privacy.stderr new file mode 100644 index 0000000000000..a453e599c8b43 --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-17718-constants-not-static.rs b/src/test/ui/issues/issue-17718-constants-not-static.rs similarity index 100% rename from src/test/ui/issue-17718-constants-not-static.rs rename to src/test/ui/issues/issue-17718-constants-not-static.rs diff --git a/src/test/ui/issue-17718-constants-not-static.stderr b/src/test/ui/issues/issue-17718-constants-not-static.stderr similarity index 100% rename from src/test/ui/issue-17718-constants-not-static.stderr rename to src/test/ui/issues/issue-17718-constants-not-static.stderr diff --git a/src/test/ui/issue-17718-patterns.rs b/src/test/ui/issues/issue-17718-patterns.rs similarity index 100% rename from src/test/ui/issue-17718-patterns.rs rename to src/test/ui/issues/issue-17718-patterns.rs diff --git a/src/test/ui/issue-17718-patterns.stderr b/src/test/ui/issues/issue-17718-patterns.stderr similarity index 100% rename from src/test/ui/issue-17718-patterns.stderr rename to src/test/ui/issues/issue-17718-patterns.stderr diff --git a/src/test/ui/issue-17718-references.rs b/src/test/ui/issues/issue-17718-references.rs similarity index 100% rename from src/test/ui/issue-17718-references.rs rename to src/test/ui/issues/issue-17718-references.rs diff --git a/src/test/ui/issue-17718-references.stderr b/src/test/ui/issues/issue-17718-references.stderr similarity index 100% rename from src/test/ui/issue-17718-references.stderr rename to src/test/ui/issues/issue-17718-references.stderr diff --git a/src/test/ui/issue-17718-static-move.rs b/src/test/ui/issues/issue-17718-static-move.rs similarity index 100% rename from src/test/ui/issue-17718-static-move.rs rename to src/test/ui/issues/issue-17718-static-move.rs diff --git a/src/test/ui/issue-17718-static-move.stderr b/src/test/ui/issues/issue-17718-static-move.stderr similarity index 100% rename from src/test/ui/issue-17718-static-move.stderr rename to src/test/ui/issues/issue-17718-static-move.stderr diff --git a/src/test/ui/issue-17718-static-sync.rs b/src/test/ui/issues/issue-17718-static-sync.rs similarity index 100% rename from src/test/ui/issue-17718-static-sync.rs rename to src/test/ui/issues/issue-17718-static-sync.rs diff --git a/src/test/ui/issue-17718-static-sync.stderr b/src/test/ui/issues/issue-17718-static-sync.stderr similarity index 100% rename from src/test/ui/issue-17718-static-sync.stderr rename to src/test/ui/issues/issue-17718-static-sync.stderr diff --git a/src/test/ui/issue-17728.nll.stderr b/src/test/ui/issues/issue-17728.nll.stderr similarity index 100% rename from src/test/ui/issue-17728.nll.stderr rename to src/test/ui/issues/issue-17728.nll.stderr diff --git a/src/test/ui/issue-17728.rs b/src/test/ui/issues/issue-17728.rs similarity index 100% rename from src/test/ui/issue-17728.rs rename to src/test/ui/issues/issue-17728.rs diff --git a/src/test/ui/issue-17728.stderr b/src/test/ui/issues/issue-17728.stderr similarity index 100% rename from src/test/ui/issue-17728.stderr rename to src/test/ui/issues/issue-17728.stderr diff --git a/src/test/ui/issue-17740.rs b/src/test/ui/issues/issue-17740.rs similarity index 100% rename from src/test/ui/issue-17740.rs rename to src/test/ui/issues/issue-17740.rs diff --git a/src/test/ui/issue-17740.stderr b/src/test/ui/issues/issue-17740.stderr similarity index 100% rename from src/test/ui/issue-17740.stderr rename to src/test/ui/issues/issue-17740.stderr diff --git a/src/test/ui/issue-17758.nll.stderr b/src/test/ui/issues/issue-17758.nll.stderr similarity index 100% rename from src/test/ui/issue-17758.nll.stderr rename to src/test/ui/issues/issue-17758.nll.stderr diff --git a/src/test/ui/issue-17758.rs b/src/test/ui/issues/issue-17758.rs similarity index 100% rename from src/test/ui/issue-17758.rs rename to src/test/ui/issues/issue-17758.rs diff --git a/src/test/ui/issue-17758.stderr b/src/test/ui/issues/issue-17758.stderr similarity index 100% rename from src/test/ui/issue-17758.stderr rename to src/test/ui/issues/issue-17758.stderr diff --git a/src/test/ui/issue-17800.rs b/src/test/ui/issues/issue-17800.rs similarity index 100% rename from src/test/ui/issue-17800.rs rename to src/test/ui/issues/issue-17800.rs diff --git a/src/test/ui/issue-17800.stderr b/src/test/ui/issues/issue-17800.stderr similarity index 100% rename from src/test/ui/issue-17800.stderr rename to src/test/ui/issues/issue-17800.stderr diff --git a/src/test/ui/issue-17904-2.rs b/src/test/ui/issues/issue-17904-2.rs similarity index 100% rename from src/test/ui/issue-17904-2.rs rename to src/test/ui/issues/issue-17904-2.rs diff --git a/src/test/ui/issue-17904-2.stderr b/src/test/ui/issues/issue-17904-2.stderr similarity index 100% rename from src/test/ui/issue-17904-2.stderr rename to src/test/ui/issues/issue-17904-2.stderr diff --git a/src/test/ui/issue-17905.rs b/src/test/ui/issues/issue-17905.rs similarity index 100% rename from src/test/ui/issue-17905.rs rename to src/test/ui/issues/issue-17905.rs diff --git a/src/test/ui/issue-17905.stderr b/src/test/ui/issues/issue-17905.stderr similarity index 100% rename from src/test/ui/issue-17905.stderr rename to src/test/ui/issues/issue-17905.stderr diff --git a/src/test/compile-fail/issue-17913.rs b/src/test/ui/issues/issue-17913.rs similarity index 93% rename from src/test/compile-fail/issue-17913.rs rename to src/test/ui/issues/issue-17913.rs index 80e5f2b6e2157..9b9159994aca4 100644 --- a/src/test/compile-fail/issue-17913.rs +++ b/src/test/ui/issues/issue-17913.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. - +// normalize-stderr-test "\[&usize; \d+\]" -> "[&usize; N]" // error-pattern: too big for the current architecture #![feature(box_syntax)] diff --git a/src/test/ui/issues/issue-17913.stderr b/src/test/ui/issues/issue-17913.stderr new file mode 100644 index 0000000000000..ae388c4d491df --- /dev/null +++ b/src/test/ui/issues/issue-17913.stderr @@ -0,0 +1,4 @@ +error: the type `[&usize; N]` is too big for the current architecture + +error: aborting due to previous error + diff --git a/src/test/ui/issue-17933.rs b/src/test/ui/issues/issue-17933.rs similarity index 100% rename from src/test/ui/issue-17933.rs rename to src/test/ui/issues/issue-17933.rs diff --git a/src/test/ui/issue-17933.stderr b/src/test/ui/issues/issue-17933.stderr similarity index 100% rename from src/test/ui/issue-17933.stderr rename to src/test/ui/issues/issue-17933.stderr diff --git a/src/test/ui/issue-17954.nll.stderr b/src/test/ui/issues/issue-17954.nll.stderr similarity index 100% rename from src/test/ui/issue-17954.nll.stderr rename to src/test/ui/issues/issue-17954.nll.stderr diff --git a/src/test/ui/issue-17954.rs b/src/test/ui/issues/issue-17954.rs similarity index 100% rename from src/test/ui/issue-17954.rs rename to src/test/ui/issues/issue-17954.rs diff --git a/src/test/ui/issue-17954.stderr b/src/test/ui/issues/issue-17954.stderr similarity index 100% rename from src/test/ui/issue-17954.stderr rename to src/test/ui/issues/issue-17954.stderr diff --git a/src/test/ui/issue-17959.rs b/src/test/ui/issues/issue-17959.rs similarity index 100% rename from src/test/ui/issue-17959.rs rename to src/test/ui/issues/issue-17959.rs diff --git a/src/test/ui/issue-17959.stderr b/src/test/ui/issues/issue-17959.stderr similarity index 100% rename from src/test/ui/issue-17959.stderr rename to src/test/ui/issues/issue-17959.stderr diff --git a/src/test/ui/issue-17994.rs b/src/test/ui/issues/issue-17994.rs similarity index 100% rename from src/test/ui/issue-17994.rs rename to src/test/ui/issues/issue-17994.rs diff --git a/src/test/ui/issue-17994.stderr b/src/test/ui/issues/issue-17994.stderr similarity index 100% rename from src/test/ui/issue-17994.stderr rename to src/test/ui/issues/issue-17994.stderr diff --git a/src/test/ui/issue-17999.rs b/src/test/ui/issues/issue-17999.rs similarity index 100% rename from src/test/ui/issue-17999.rs rename to src/test/ui/issues/issue-17999.rs diff --git a/src/test/ui/issue-17999.stderr b/src/test/ui/issues/issue-17999.stderr similarity index 100% rename from src/test/ui/issue-17999.stderr rename to src/test/ui/issues/issue-17999.stderr diff --git a/src/test/ui/issue-18058.rs b/src/test/ui/issues/issue-18058.rs similarity index 100% rename from src/test/ui/issue-18058.rs rename to src/test/ui/issues/issue-18058.rs diff --git a/src/test/ui/issue-18058.stderr b/src/test/ui/issues/issue-18058.stderr similarity index 100% rename from src/test/ui/issue-18058.stderr rename to src/test/ui/issues/issue-18058.stderr diff --git a/src/test/ui/issue-18107.rs b/src/test/ui/issues/issue-18107.rs similarity index 100% rename from src/test/ui/issue-18107.rs rename to src/test/ui/issues/issue-18107.rs diff --git a/src/test/ui/issue-18107.stderr b/src/test/ui/issues/issue-18107.stderr similarity index 100% rename from src/test/ui/issue-18107.stderr rename to src/test/ui/issues/issue-18107.stderr diff --git a/src/test/ui/issue-18118-2.rs b/src/test/ui/issues/issue-18118-2.rs similarity index 100% rename from src/test/ui/issue-18118-2.rs rename to src/test/ui/issues/issue-18118-2.rs diff --git a/src/test/ui/issue-18118-2.stderr b/src/test/ui/issues/issue-18118-2.stderr similarity index 100% rename from src/test/ui/issue-18118-2.stderr rename to src/test/ui/issues/issue-18118-2.stderr diff --git a/src/test/ui/issue-18118.nll.stderr b/src/test/ui/issues/issue-18118.nll.stderr similarity index 100% rename from src/test/ui/issue-18118.nll.stderr rename to src/test/ui/issues/issue-18118.nll.stderr diff --git a/src/test/ui/issue-18118.rs b/src/test/ui/issues/issue-18118.rs similarity index 100% rename from src/test/ui/issue-18118.rs rename to src/test/ui/issues/issue-18118.rs diff --git a/src/test/ui/issue-18118.stderr b/src/test/ui/issues/issue-18118.stderr similarity index 100% rename from src/test/ui/issue-18118.stderr rename to src/test/ui/issues/issue-18118.stderr diff --git a/src/test/ui/issue-18119.rs b/src/test/ui/issues/issue-18119.rs similarity index 100% rename from src/test/ui/issue-18119.rs rename to src/test/ui/issues/issue-18119.rs diff --git a/src/test/ui/issue-18119.stderr b/src/test/ui/issues/issue-18119.stderr similarity index 100% rename from src/test/ui/issue-18119.stderr rename to src/test/ui/issues/issue-18119.stderr diff --git a/src/test/ui/issue-18159.rs b/src/test/ui/issues/issue-18159.rs similarity index 100% rename from src/test/ui/issue-18159.rs rename to src/test/ui/issues/issue-18159.rs diff --git a/src/test/ui/issue-18159.stderr b/src/test/ui/issues/issue-18159.stderr similarity index 100% rename from src/test/ui/issue-18159.stderr rename to src/test/ui/issues/issue-18159.stderr diff --git a/src/test/ui/issue-18183.rs b/src/test/ui/issues/issue-18183.rs similarity index 100% rename from src/test/ui/issue-18183.rs rename to src/test/ui/issues/issue-18183.rs diff --git a/src/test/ui/issue-18183.stderr b/src/test/ui/issues/issue-18183.stderr similarity index 100% rename from src/test/ui/issue-18183.stderr rename to src/test/ui/issues/issue-18183.stderr diff --git a/src/test/ui/issue-18294.rs b/src/test/ui/issues/issue-18294.rs similarity index 100% rename from src/test/ui/issue-18294.rs rename to src/test/ui/issues/issue-18294.rs diff --git a/src/test/ui/issue-18294.stderr b/src/test/ui/issues/issue-18294.stderr similarity index 100% rename from src/test/ui/issue-18294.stderr rename to src/test/ui/issues/issue-18294.stderr diff --git a/src/test/ui/issue-18389.rs b/src/test/ui/issues/issue-18389.rs similarity index 100% rename from src/test/ui/issue-18389.rs rename to src/test/ui/issues/issue-18389.rs diff --git a/src/test/ui/issue-18389.stderr b/src/test/ui/issues/issue-18389.stderr similarity index 100% rename from src/test/ui/issue-18389.stderr rename to src/test/ui/issues/issue-18389.stderr diff --git a/src/test/ui/issue-18400.rs b/src/test/ui/issues/issue-18400.rs similarity index 100% rename from src/test/ui/issue-18400.rs rename to src/test/ui/issues/issue-18400.rs diff --git a/src/test/ui/issue-18400.stderr b/src/test/ui/issues/issue-18400.stderr similarity index 100% rename from src/test/ui/issue-18400.stderr rename to src/test/ui/issues/issue-18400.stderr diff --git a/src/test/ui/issue-18423.rs b/src/test/ui/issues/issue-18423.rs similarity index 100% rename from src/test/ui/issue-18423.rs rename to src/test/ui/issues/issue-18423.rs diff --git a/src/test/ui/issue-18423.stderr b/src/test/ui/issues/issue-18423.stderr similarity index 100% rename from src/test/ui/issue-18423.stderr rename to src/test/ui/issues/issue-18423.stderr diff --git a/src/test/ui/issue-18446.rs b/src/test/ui/issues/issue-18446.rs similarity index 100% rename from src/test/ui/issue-18446.rs rename to src/test/ui/issues/issue-18446.rs diff --git a/src/test/ui/issue-18446.stderr b/src/test/ui/issues/issue-18446.stderr similarity index 100% rename from src/test/ui/issue-18446.stderr rename to src/test/ui/issues/issue-18446.stderr diff --git a/src/test/ui/issue-18532.rs b/src/test/ui/issues/issue-18532.rs similarity index 100% rename from src/test/ui/issue-18532.rs rename to src/test/ui/issues/issue-18532.rs diff --git a/src/test/ui/issue-18532.stderr b/src/test/ui/issues/issue-18532.stderr similarity index 100% rename from src/test/ui/issue-18532.stderr rename to src/test/ui/issues/issue-18532.stderr diff --git a/src/test/ui/issue-18566.nll.stderr b/src/test/ui/issues/issue-18566.nll.stderr similarity index 100% rename from src/test/ui/issue-18566.nll.stderr rename to src/test/ui/issues/issue-18566.nll.stderr diff --git a/src/test/ui/issue-18566.rs b/src/test/ui/issues/issue-18566.rs similarity index 100% rename from src/test/ui/issue-18566.rs rename to src/test/ui/issues/issue-18566.rs diff --git a/src/test/ui/issue-18566.stderr b/src/test/ui/issues/issue-18566.stderr similarity index 100% rename from src/test/ui/issue-18566.stderr rename to src/test/ui/issues/issue-18566.stderr diff --git a/src/test/ui/issue-18611.rs b/src/test/ui/issues/issue-18611.rs similarity index 100% rename from src/test/ui/issue-18611.rs rename to src/test/ui/issues/issue-18611.rs diff --git a/src/test/ui/issue-18611.stderr b/src/test/ui/issues/issue-18611.stderr similarity index 100% rename from src/test/ui/issue-18611.stderr rename to src/test/ui/issues/issue-18611.stderr diff --git a/src/test/ui/issue-1871.rs b/src/test/ui/issues/issue-1871.rs similarity index 100% rename from src/test/ui/issue-1871.rs rename to src/test/ui/issues/issue-1871.rs diff --git a/src/test/ui/issue-1871.stderr b/src/test/ui/issues/issue-1871.stderr similarity index 100% rename from src/test/ui/issue-1871.stderr rename to src/test/ui/issues/issue-1871.stderr diff --git a/src/test/ui/issue-18783.nll.stderr b/src/test/ui/issues/issue-18783.nll.stderr similarity index 100% rename from src/test/ui/issue-18783.nll.stderr rename to src/test/ui/issues/issue-18783.nll.stderr diff --git a/src/test/ui/issue-18783.rs b/src/test/ui/issues/issue-18783.rs similarity index 100% rename from src/test/ui/issue-18783.rs rename to src/test/ui/issues/issue-18783.rs diff --git a/src/test/ui/issue-18783.stderr b/src/test/ui/issues/issue-18783.stderr similarity index 100% rename from src/test/ui/issue-18783.stderr rename to src/test/ui/issues/issue-18783.stderr diff --git a/src/test/ui/issue-18819.rs b/src/test/ui/issues/issue-18819.rs similarity index 100% rename from src/test/ui/issue-18819.rs rename to src/test/ui/issues/issue-18819.rs diff --git a/src/test/ui/issue-18819.stderr b/src/test/ui/issues/issue-18819.stderr similarity index 100% rename from src/test/ui/issue-18819.stderr rename to src/test/ui/issues/issue-18819.stderr diff --git a/src/test/ui/issue-18919.rs b/src/test/ui/issues/issue-18919.rs similarity index 100% rename from src/test/ui/issue-18919.rs rename to src/test/ui/issues/issue-18919.rs diff --git a/src/test/ui/issue-18919.stderr b/src/test/ui/issues/issue-18919.stderr similarity index 100% rename from src/test/ui/issue-18919.stderr rename to src/test/ui/issues/issue-18919.stderr diff --git a/src/test/ui/issue-18937.rs b/src/test/ui/issues/issue-18937.rs similarity index 100% rename from src/test/ui/issue-18937.rs rename to src/test/ui/issues/issue-18937.rs diff --git a/src/test/ui/issue-18937.stderr b/src/test/ui/issues/issue-18937.stderr similarity index 100% rename from src/test/ui/issue-18937.stderr rename to src/test/ui/issues/issue-18937.stderr diff --git a/src/test/ui/issue-18959.rs b/src/test/ui/issues/issue-18959.rs similarity index 100% rename from src/test/ui/issue-18959.rs rename to src/test/ui/issues/issue-18959.rs diff --git a/src/test/ui/issue-18959.stderr b/src/test/ui/issues/issue-18959.stderr similarity index 100% rename from src/test/ui/issue-18959.stderr rename to src/test/ui/issues/issue-18959.stderr diff --git a/src/test/ui/issue-1900.rs b/src/test/ui/issues/issue-1900.rs similarity index 100% rename from src/test/ui/issue-1900.rs rename to src/test/ui/issues/issue-1900.rs diff --git a/src/test/ui/issue-1900.stderr b/src/test/ui/issues/issue-1900.stderr similarity index 100% rename from src/test/ui/issue-1900.stderr rename to src/test/ui/issues/issue-1900.stderr diff --git a/src/test/ui/issue-19086.rs b/src/test/ui/issues/issue-19086.rs similarity index 100% rename from src/test/ui/issue-19086.rs rename to src/test/ui/issues/issue-19086.rs diff --git a/src/test/ui/issue-19086.stderr b/src/test/ui/issues/issue-19086.stderr similarity index 100% rename from src/test/ui/issue-19086.stderr rename to src/test/ui/issues/issue-19086.stderr diff --git a/src/test/ui/issue-19100.fixed b/src/test/ui/issues/issue-19100.fixed similarity index 100% rename from src/test/ui/issue-19100.fixed rename to src/test/ui/issues/issue-19100.fixed diff --git a/src/test/ui/issue-19100.rs b/src/test/ui/issues/issue-19100.rs similarity index 100% rename from src/test/ui/issue-19100.rs rename to src/test/ui/issues/issue-19100.rs diff --git a/src/test/ui/issue-19100.stderr b/src/test/ui/issues/issue-19100.stderr similarity index 100% rename from src/test/ui/issue-19100.stderr rename to src/test/ui/issues/issue-19100.stderr diff --git a/src/test/ui/issues/issue-19163.nll.stderr b/src/test/ui/issues/issue-19163.nll.stderr new file mode 100644 index 0000000000000..32059bf0af104 --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-19163.rs similarity index 100% rename from src/test/compile-fail/issue-19163.rs rename to src/test/ui/issues/issue-19163.rs diff --git a/src/test/ui/issues/issue-19163.stderr b/src/test/ui/issues/issue-19163.stderr new file mode 100644 index 0000000000000..f7e65e18326b6 --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-1920-1.rs similarity index 100% rename from src/test/compile-fail/issue-1920-1.rs rename to src/test/ui/issues/issue-1920-1.rs diff --git a/src/test/ui/issues/issue-1920-1.stderr b/src/test/ui/issues/issue-1920-1.stderr new file mode 100644 index 0000000000000..bd823ad6fb6ef --- /dev/null +++ b/src/test/ui/issues/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::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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() 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/issues/issue-1920-2.rs similarity index 100% rename from src/test/compile-fail/issue-1920-2.rs rename to src/test/ui/issues/issue-1920-2.rs diff --git a/src/test/ui/issues/issue-1920-2.stderr b/src/test/ui/issues/issue-1920-2.stderr new file mode 100644 index 0000000000000..cf98a893a189a --- /dev/null +++ b/src/test/ui/issues/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::(); + | ^^^^^^^^^^^^^^^^^^^^^^ 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() 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/issues/issue-1920-3.rs similarity index 100% rename from src/test/compile-fail/issue-1920-3.rs rename to src/test/ui/issues/issue-1920-3.rs diff --git a/src/test/ui/issues/issue-1920-3.stderr b/src/test/ui/issues/issue-1920-3.stderr new file mode 100644 index 0000000000000..6f5efd0dc4ea6 --- /dev/null +++ b/src/test/ui/issues/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::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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() where T : Clone { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-19244-1.rs b/src/test/ui/issues/issue-19244-1.rs similarity index 100% rename from src/test/ui/issue-19244-1.rs rename to src/test/ui/issues/issue-19244-1.rs diff --git a/src/test/ui/issue-19244-1.stderr b/src/test/ui/issues/issue-19244-1.stderr similarity index 100% rename from src/test/ui/issue-19244-1.stderr rename to src/test/ui/issues/issue-19244-1.stderr diff --git a/src/test/ui/issue-19244-2.rs b/src/test/ui/issues/issue-19244-2.rs similarity index 100% rename from src/test/ui/issue-19244-2.rs rename to src/test/ui/issues/issue-19244-2.rs diff --git a/src/test/ui/issue-19244-2.stderr b/src/test/ui/issues/issue-19244-2.stderr similarity index 100% rename from src/test/ui/issue-19244-2.stderr rename to src/test/ui/issues/issue-19244-2.stderr diff --git a/src/test/ui/issue-19380.rs b/src/test/ui/issues/issue-19380.rs similarity index 100% rename from src/test/ui/issue-19380.rs rename to src/test/ui/issues/issue-19380.rs diff --git a/src/test/ui/issue-19380.stderr b/src/test/ui/issues/issue-19380.stderr similarity index 100% rename from src/test/ui/issue-19380.stderr rename to src/test/ui/issues/issue-19380.stderr diff --git a/src/test/ui/issue-19482.rs b/src/test/ui/issues/issue-19482.rs similarity index 100% rename from src/test/ui/issue-19482.rs rename to src/test/ui/issues/issue-19482.rs diff --git a/src/test/ui/issue-19482.stderr b/src/test/ui/issues/issue-19482.stderr similarity index 100% rename from src/test/ui/issue-19482.stderr rename to src/test/ui/issues/issue-19482.stderr diff --git a/src/test/ui/issue-19498.rs b/src/test/ui/issues/issue-19498.rs similarity index 100% rename from src/test/ui/issue-19498.rs rename to src/test/ui/issues/issue-19498.rs diff --git a/src/test/ui/issue-19498.stderr b/src/test/ui/issues/issue-19498.stderr similarity index 100% rename from src/test/ui/issue-19498.stderr rename to src/test/ui/issues/issue-19498.stderr diff --git a/src/test/ui/issue-19521.rs b/src/test/ui/issues/issue-19521.rs similarity index 100% rename from src/test/ui/issue-19521.rs rename to src/test/ui/issues/issue-19521.rs diff --git a/src/test/ui/issue-19521.stderr b/src/test/ui/issues/issue-19521.stderr similarity index 100% rename from src/test/ui/issue-19521.stderr rename to src/test/ui/issues/issue-19521.stderr diff --git a/src/test/ui/issue-19538.rs b/src/test/ui/issues/issue-19538.rs similarity index 100% rename from src/test/ui/issue-19538.rs rename to src/test/ui/issues/issue-19538.rs diff --git a/src/test/ui/issue-19538.stderr b/src/test/ui/issues/issue-19538.stderr similarity index 100% rename from src/test/ui/issue-19538.stderr rename to src/test/ui/issues/issue-19538.stderr diff --git a/src/test/ui/issue-19601.rs b/src/test/ui/issues/issue-19601.rs similarity index 100% rename from src/test/ui/issue-19601.rs rename to src/test/ui/issues/issue-19601.rs diff --git a/src/test/ui/issue-19601.stderr b/src/test/ui/issues/issue-19601.stderr similarity index 100% rename from src/test/ui/issue-19601.stderr rename to src/test/ui/issues/issue-19601.stderr diff --git a/src/test/ui/issue-1962.rs b/src/test/ui/issues/issue-1962.rs similarity index 100% rename from src/test/ui/issue-1962.rs rename to src/test/ui/issues/issue-1962.rs diff --git a/src/test/ui/issue-1962.stderr b/src/test/ui/issues/issue-1962.stderr similarity index 100% rename from src/test/ui/issue-1962.stderr rename to src/test/ui/issues/issue-1962.stderr diff --git a/src/test/ui/issue-19660.rs b/src/test/ui/issues/issue-19660.rs similarity index 100% rename from src/test/ui/issue-19660.rs rename to src/test/ui/issues/issue-19660.rs diff --git a/src/test/ui/issue-19660.stderr b/src/test/ui/issues/issue-19660.stderr similarity index 100% rename from src/test/ui/issue-19660.stderr rename to src/test/ui/issues/issue-19660.stderr diff --git a/src/test/ui/issue-19692.rs b/src/test/ui/issues/issue-19692.rs similarity index 100% rename from src/test/ui/issue-19692.rs rename to src/test/ui/issues/issue-19692.rs diff --git a/src/test/ui/issue-19692.stderr b/src/test/ui/issues/issue-19692.stderr similarity index 100% rename from src/test/ui/issue-19692.stderr rename to src/test/ui/issues/issue-19692.stderr diff --git a/src/test/ui/issue-19707.rs b/src/test/ui/issues/issue-19707.rs similarity index 100% rename from src/test/ui/issue-19707.rs rename to src/test/ui/issues/issue-19707.rs diff --git a/src/test/ui/issue-19707.stderr b/src/test/ui/issues/issue-19707.stderr similarity index 100% rename from src/test/ui/issue-19707.stderr rename to src/test/ui/issues/issue-19707.stderr diff --git a/src/test/ui/issue-19734.rs b/src/test/ui/issues/issue-19734.rs similarity index 100% rename from src/test/ui/issue-19734.rs rename to src/test/ui/issues/issue-19734.rs diff --git a/src/test/ui/issue-19734.stderr b/src/test/ui/issues/issue-19734.stderr similarity index 100% rename from src/test/ui/issue-19734.stderr rename to src/test/ui/issues/issue-19734.stderr diff --git a/src/test/ui/issue-19883.rs b/src/test/ui/issues/issue-19883.rs similarity index 100% rename from src/test/ui/issue-19883.rs rename to src/test/ui/issues/issue-19883.rs diff --git a/src/test/ui/issue-19883.stderr b/src/test/ui/issues/issue-19883.stderr similarity index 100% rename from src/test/ui/issue-19883.stderr rename to src/test/ui/issues/issue-19883.stderr diff --git a/src/test/ui/issue-19922.rs b/src/test/ui/issues/issue-19922.rs similarity index 100% rename from src/test/ui/issue-19922.rs rename to src/test/ui/issues/issue-19922.rs diff --git a/src/test/ui/issue-19922.stderr b/src/test/ui/issues/issue-19922.stderr similarity index 100% rename from src/test/ui/issue-19922.stderr rename to src/test/ui/issues/issue-19922.stderr diff --git a/src/test/ui/issue-19982.rs b/src/test/ui/issues/issue-19982.rs similarity index 100% rename from src/test/ui/issue-19982.rs rename to src/test/ui/issues/issue-19982.rs diff --git a/src/test/ui/issue-19982.stderr b/src/test/ui/issues/issue-19982.stderr similarity index 100% rename from src/test/ui/issue-19982.stderr rename to src/test/ui/issues/issue-19982.stderr diff --git a/src/test/ui/issue-19991.rs b/src/test/ui/issues/issue-19991.rs similarity index 100% rename from src/test/ui/issue-19991.rs rename to src/test/ui/issues/issue-19991.rs diff --git a/src/test/ui/issue-19991.stderr b/src/test/ui/issues/issue-19991.stderr similarity index 100% rename from src/test/ui/issue-19991.stderr rename to src/test/ui/issues/issue-19991.stderr diff --git a/src/test/ui/issue-20005.rs b/src/test/ui/issues/issue-20005.rs similarity index 100% rename from src/test/ui/issue-20005.rs rename to src/test/ui/issues/issue-20005.rs diff --git a/src/test/ui/issue-20005.stderr b/src/test/ui/issues/issue-20005.stderr similarity index 100% rename from src/test/ui/issue-20005.stderr rename to src/test/ui/issues/issue-20005.stderr diff --git a/src/test/ui/issue-20162.rs b/src/test/ui/issues/issue-20162.rs similarity index 100% rename from src/test/ui/issue-20162.rs rename to src/test/ui/issues/issue-20162.rs diff --git a/src/test/ui/issue-20162.stderr b/src/test/ui/issues/issue-20162.stderr similarity index 100% rename from src/test/ui/issue-20162.stderr rename to src/test/ui/issues/issue-20162.stderr diff --git a/src/test/ui/issue-20225.rs b/src/test/ui/issues/issue-20225.rs similarity index 100% rename from src/test/ui/issue-20225.rs rename to src/test/ui/issues/issue-20225.rs diff --git a/src/test/ui/issue-20225.stderr b/src/test/ui/issues/issue-20225.stderr similarity index 100% rename from src/test/ui/issue-20225.stderr rename to src/test/ui/issues/issue-20225.stderr diff --git a/src/test/ui/issue-20261.rs b/src/test/ui/issues/issue-20261.rs similarity index 100% rename from src/test/ui/issue-20261.rs rename to src/test/ui/issues/issue-20261.rs diff --git a/src/test/ui/issue-20261.stderr b/src/test/ui/issues/issue-20261.stderr similarity index 100% rename from src/test/ui/issue-20261.stderr rename to src/test/ui/issues/issue-20261.stderr diff --git a/src/test/ui/issue-20313.rs b/src/test/ui/issues/issue-20313.rs similarity index 100% rename from src/test/ui/issue-20313.rs rename to src/test/ui/issues/issue-20313.rs diff --git a/src/test/ui/issue-20313.stderr b/src/test/ui/issues/issue-20313.stderr similarity index 100% rename from src/test/ui/issue-20313.stderr rename to src/test/ui/issues/issue-20313.stderr diff --git a/src/test/ui/issue-20413.rs b/src/test/ui/issues/issue-20413.rs similarity index 100% rename from src/test/ui/issue-20413.rs rename to src/test/ui/issues/issue-20413.rs diff --git a/src/test/ui/issue-20413.stderr b/src/test/ui/issues/issue-20413.stderr similarity index 100% rename from src/test/ui/issue-20413.stderr rename to src/test/ui/issues/issue-20413.stderr diff --git a/src/test/ui/issue-20433.rs b/src/test/ui/issues/issue-20433.rs similarity index 100% rename from src/test/ui/issue-20433.rs rename to src/test/ui/issues/issue-20433.rs diff --git a/src/test/ui/issue-20433.stderr b/src/test/ui/issues/issue-20433.stderr similarity index 100% rename from src/test/ui/issue-20433.stderr rename to src/test/ui/issues/issue-20433.stderr diff --git a/src/test/ui/issue-20605.rs b/src/test/ui/issues/issue-20605.rs similarity index 100% rename from src/test/ui/issue-20605.rs rename to src/test/ui/issues/issue-20605.rs diff --git a/src/test/ui/issue-20605.stderr b/src/test/ui/issues/issue-20605.stderr similarity index 100% rename from src/test/ui/issue-20605.stderr rename to src/test/ui/issues/issue-20605.stderr diff --git a/src/test/ui/issue-20616-1.rs b/src/test/ui/issues/issue-20616-1.rs similarity index 100% rename from src/test/ui/issue-20616-1.rs rename to src/test/ui/issues/issue-20616-1.rs diff --git a/src/test/ui/issue-20616-1.stderr b/src/test/ui/issues/issue-20616-1.stderr similarity index 100% rename from src/test/ui/issue-20616-1.stderr rename to src/test/ui/issues/issue-20616-1.stderr diff --git a/src/test/ui/issue-20616-2.rs b/src/test/ui/issues/issue-20616-2.rs similarity index 100% rename from src/test/ui/issue-20616-2.rs rename to src/test/ui/issues/issue-20616-2.rs diff --git a/src/test/ui/issue-20616-2.stderr b/src/test/ui/issues/issue-20616-2.stderr similarity index 100% rename from src/test/ui/issue-20616-2.stderr rename to src/test/ui/issues/issue-20616-2.stderr diff --git a/src/test/ui/issue-20616-3.rs b/src/test/ui/issues/issue-20616-3.rs similarity index 100% rename from src/test/ui/issue-20616-3.rs rename to src/test/ui/issues/issue-20616-3.rs diff --git a/src/test/ui/issue-20616-3.stderr b/src/test/ui/issues/issue-20616-3.stderr similarity index 100% rename from src/test/ui/issue-20616-3.stderr rename to src/test/ui/issues/issue-20616-3.stderr diff --git a/src/test/ui/issue-20616-4.rs b/src/test/ui/issues/issue-20616-4.rs similarity index 100% rename from src/test/ui/issue-20616-4.rs rename to src/test/ui/issues/issue-20616-4.rs diff --git a/src/test/ui/issue-20616-4.stderr b/src/test/ui/issues/issue-20616-4.stderr similarity index 100% rename from src/test/ui/issue-20616-4.stderr rename to src/test/ui/issues/issue-20616-4.stderr diff --git a/src/test/ui/issue-20616-5.rs b/src/test/ui/issues/issue-20616-5.rs similarity index 100% rename from src/test/ui/issue-20616-5.rs rename to src/test/ui/issues/issue-20616-5.rs diff --git a/src/test/ui/issue-20616-5.stderr b/src/test/ui/issues/issue-20616-5.stderr similarity index 100% rename from src/test/ui/issue-20616-5.stderr rename to src/test/ui/issues/issue-20616-5.stderr diff --git a/src/test/ui/issue-20616-6.rs b/src/test/ui/issues/issue-20616-6.rs similarity index 100% rename from src/test/ui/issue-20616-6.rs rename to src/test/ui/issues/issue-20616-6.rs diff --git a/src/test/ui/issue-20616-6.stderr b/src/test/ui/issues/issue-20616-6.stderr similarity index 100% rename from src/test/ui/issue-20616-6.stderr rename to src/test/ui/issues/issue-20616-6.stderr diff --git a/src/test/ui/issue-20616-7.rs b/src/test/ui/issues/issue-20616-7.rs similarity index 100% rename from src/test/ui/issue-20616-7.rs rename to src/test/ui/issues/issue-20616-7.rs diff --git a/src/test/ui/issue-20616-7.stderr b/src/test/ui/issues/issue-20616-7.stderr similarity index 100% rename from src/test/ui/issue-20616-7.stderr rename to src/test/ui/issues/issue-20616-7.stderr diff --git a/src/test/ui/issue-20616-8.rs b/src/test/ui/issues/issue-20616-8.rs similarity index 100% rename from src/test/ui/issue-20616-8.rs rename to src/test/ui/issues/issue-20616-8.rs diff --git a/src/test/ui/issue-20616-8.stderr b/src/test/ui/issues/issue-20616-8.stderr similarity index 100% rename from src/test/ui/issue-20616-8.stderr rename to src/test/ui/issues/issue-20616-8.stderr diff --git a/src/test/ui/issue-20616-9.rs b/src/test/ui/issues/issue-20616-9.rs similarity index 100% rename from src/test/ui/issue-20616-9.rs rename to src/test/ui/issues/issue-20616-9.rs diff --git a/src/test/ui/issue-20616-9.stderr b/src/test/ui/issues/issue-20616-9.stderr similarity index 100% rename from src/test/ui/issue-20616-9.stderr rename to src/test/ui/issues/issue-20616-9.stderr diff --git a/src/test/ui/issue-20692.rs b/src/test/ui/issues/issue-20692.rs similarity index 100% rename from src/test/ui/issue-20692.rs rename to src/test/ui/issues/issue-20692.rs diff --git a/src/test/ui/issue-20692.stderr b/src/test/ui/issues/issue-20692.stderr similarity index 100% rename from src/test/ui/issue-20692.stderr rename to src/test/ui/issues/issue-20692.stderr diff --git a/src/test/ui/issue-20714.rs b/src/test/ui/issues/issue-20714.rs similarity index 100% rename from src/test/ui/issue-20714.rs rename to src/test/ui/issues/issue-20714.rs diff --git a/src/test/ui/issue-20714.stderr b/src/test/ui/issues/issue-20714.stderr similarity index 100% rename from src/test/ui/issue-20714.stderr rename to src/test/ui/issues/issue-20714.stderr diff --git a/src/test/ui/issue-20772.rs b/src/test/ui/issues/issue-20772.rs similarity index 100% rename from src/test/ui/issue-20772.rs rename to src/test/ui/issues/issue-20772.rs diff --git a/src/test/ui/issue-20772.stderr b/src/test/ui/issues/issue-20772.stderr similarity index 100% rename from src/test/ui/issue-20772.stderr rename to src/test/ui/issues/issue-20772.stderr diff --git a/src/test/ui/issue-20801.nll.stderr b/src/test/ui/issues/issue-20801.nll.stderr similarity index 100% rename from src/test/ui/issue-20801.nll.stderr rename to src/test/ui/issues/issue-20801.nll.stderr diff --git a/src/test/ui/issue-20801.rs b/src/test/ui/issues/issue-20801.rs similarity index 100% rename from src/test/ui/issue-20801.rs rename to src/test/ui/issues/issue-20801.rs diff --git a/src/test/ui/issue-20801.stderr b/src/test/ui/issues/issue-20801.stderr similarity index 100% rename from src/test/ui/issue-20801.stderr rename to src/test/ui/issues/issue-20801.stderr diff --git a/src/test/ui/issue-20825.rs b/src/test/ui/issues/issue-20825.rs similarity index 100% rename from src/test/ui/issue-20825.rs rename to src/test/ui/issues/issue-20825.rs diff --git a/src/test/ui/issue-20825.stderr b/src/test/ui/issues/issue-20825.stderr similarity index 100% rename from src/test/ui/issue-20825.stderr rename to src/test/ui/issues/issue-20825.stderr diff --git a/src/test/ui/issue-20831-debruijn.rs b/src/test/ui/issues/issue-20831-debruijn.rs similarity index 100% rename from src/test/ui/issue-20831-debruijn.rs rename to src/test/ui/issues/issue-20831-debruijn.rs diff --git a/src/test/ui/issue-20831-debruijn.stderr b/src/test/ui/issues/issue-20831-debruijn.stderr similarity index 100% rename from src/test/ui/issue-20831-debruijn.stderr rename to src/test/ui/issues/issue-20831-debruijn.stderr diff --git a/src/test/ui/issue-20939.rs b/src/test/ui/issues/issue-20939.rs similarity index 100% rename from src/test/ui/issue-20939.rs rename to src/test/ui/issues/issue-20939.rs diff --git a/src/test/ui/issue-20939.stderr b/src/test/ui/issues/issue-20939.stderr similarity index 100% rename from src/test/ui/issue-20939.stderr rename to src/test/ui/issues/issue-20939.stderr diff --git a/src/test/ui/issue-2111.rs b/src/test/ui/issues/issue-2111.rs similarity index 100% rename from src/test/ui/issue-2111.rs rename to src/test/ui/issues/issue-2111.rs diff --git a/src/test/ui/issue-2111.stderr b/src/test/ui/issues/issue-2111.stderr similarity index 100% rename from src/test/ui/issue-2111.stderr rename to src/test/ui/issues/issue-2111.stderr diff --git a/src/test/compile-fail/issue-21146.rs b/src/test/ui/issues/issue-21146.rs similarity index 100% rename from src/test/compile-fail/issue-21146.rs rename to src/test/ui/issues/issue-21146.rs diff --git a/src/test/ui/issues/issue-21146.stderr b/src/test/ui/issues/issue-21146.stderr new file mode 100644 index 0000000000000..fab38123ea871 --- /dev/null +++ b/src/test/ui/issues/issue-21146.stderr @@ -0,0 +1,8 @@ +error: expected one of `!` or `::`, found `` + --> $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/ui/issue-21160.rs b/src/test/ui/issues/issue-21160.rs similarity index 100% rename from src/test/ui/issue-21160.rs rename to src/test/ui/issues/issue-21160.rs diff --git a/src/test/ui/issue-21160.stderr b/src/test/ui/issues/issue-21160.stderr similarity index 100% rename from src/test/ui/issue-21160.stderr rename to src/test/ui/issues/issue-21160.stderr diff --git a/src/test/ui/issue-21174.rs b/src/test/ui/issues/issue-21174.rs similarity index 100% rename from src/test/ui/issue-21174.rs rename to src/test/ui/issues/issue-21174.rs diff --git a/src/test/ui/issue-21174.stderr b/src/test/ui/issues/issue-21174.stderr similarity index 100% rename from src/test/ui/issue-21174.stderr rename to src/test/ui/issues/issue-21174.stderr diff --git a/src/test/ui/issue-21177.rs b/src/test/ui/issues/issue-21177.rs similarity index 100% rename from src/test/ui/issue-21177.rs rename to src/test/ui/issues/issue-21177.rs diff --git a/src/test/ui/issue-21177.stderr b/src/test/ui/issues/issue-21177.stderr similarity index 100% rename from src/test/ui/issue-21177.stderr rename to src/test/ui/issues/issue-21177.stderr diff --git a/src/test/compile-fail/issue-21202.rs b/src/test/ui/issues/issue-21202.rs similarity index 100% rename from src/test/compile-fail/issue-21202.rs rename to src/test/ui/issues/issue-21202.rs diff --git a/src/test/ui/issues/issue-21202.stderr b/src/test/ui/issues/issue-21202.stderr new file mode 100644 index 0000000000000..9d17ff64769c3 --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-21332.rs b/src/test/ui/issues/issue-21332.rs similarity index 100% rename from src/test/ui/issue-21332.rs rename to src/test/ui/issues/issue-21332.rs diff --git a/src/test/ui/issue-21332.stderr b/src/test/ui/issues/issue-21332.stderr similarity index 100% rename from src/test/ui/issue-21332.stderr rename to src/test/ui/issues/issue-21332.stderr diff --git a/src/test/ui/issue-21356.rs b/src/test/ui/issues/issue-21356.rs similarity index 100% rename from src/test/ui/issue-21356.rs rename to src/test/ui/issues/issue-21356.rs diff --git a/src/test/ui/issue-21356.stderr b/src/test/ui/issues/issue-21356.stderr similarity index 100% rename from src/test/ui/issue-21356.stderr rename to src/test/ui/issues/issue-21356.stderr diff --git a/src/test/ui/issue-21449.rs b/src/test/ui/issues/issue-21449.rs similarity index 100% rename from src/test/ui/issue-21449.rs rename to src/test/ui/issues/issue-21449.rs diff --git a/src/test/ui/issue-21449.stderr b/src/test/ui/issues/issue-21449.stderr similarity index 100% rename from src/test/ui/issue-21449.stderr rename to src/test/ui/issues/issue-21449.stderr diff --git a/src/test/ui/issue-2149.rs b/src/test/ui/issues/issue-2149.rs similarity index 100% rename from src/test/ui/issue-2149.rs rename to src/test/ui/issues/issue-2149.rs diff --git a/src/test/ui/issue-2149.stderr b/src/test/ui/issues/issue-2149.stderr similarity index 100% rename from src/test/ui/issue-2149.stderr rename to src/test/ui/issues/issue-2149.stderr diff --git a/src/test/ui/issue-2150.rs b/src/test/ui/issues/issue-2150.rs similarity index 100% rename from src/test/ui/issue-2150.rs rename to src/test/ui/issues/issue-2150.rs diff --git a/src/test/ui/issue-2150.stderr b/src/test/ui/issues/issue-2150.stderr similarity index 100% rename from src/test/ui/issue-2150.stderr rename to src/test/ui/issues/issue-2150.stderr diff --git a/src/test/ui/issue-2151.rs b/src/test/ui/issues/issue-2151.rs similarity index 100% rename from src/test/ui/issue-2151.rs rename to src/test/ui/issues/issue-2151.rs diff --git a/src/test/ui/issue-2151.stderr b/src/test/ui/issues/issue-2151.stderr similarity index 100% rename from src/test/ui/issue-2151.stderr rename to src/test/ui/issues/issue-2151.stderr diff --git a/src/test/ui/issue-21546.rs b/src/test/ui/issues/issue-21546.rs similarity index 100% rename from src/test/ui/issue-21546.rs rename to src/test/ui/issues/issue-21546.rs diff --git a/src/test/ui/issue-21546.stderr b/src/test/ui/issues/issue-21546.stderr similarity index 100% rename from src/test/ui/issue-21546.stderr rename to src/test/ui/issues/issue-21546.stderr diff --git a/src/test/ui/issue-21554.rs b/src/test/ui/issues/issue-21554.rs similarity index 100% rename from src/test/ui/issue-21554.rs rename to src/test/ui/issues/issue-21554.rs diff --git a/src/test/ui/issue-21554.stderr b/src/test/ui/issues/issue-21554.stderr similarity index 100% rename from src/test/ui/issue-21554.stderr rename to src/test/ui/issues/issue-21554.stderr diff --git a/src/test/ui/issue-21600.nll.stderr b/src/test/ui/issues/issue-21600.nll.stderr similarity index 100% rename from src/test/ui/issue-21600.nll.stderr rename to src/test/ui/issues/issue-21600.nll.stderr diff --git a/src/test/ui/issue-21600.rs b/src/test/ui/issues/issue-21600.rs similarity index 100% rename from src/test/ui/issue-21600.rs rename to src/test/ui/issues/issue-21600.rs diff --git a/src/test/ui/issue-21600.stderr b/src/test/ui/issues/issue-21600.stderr similarity index 100% rename from src/test/ui/issue-21600.stderr rename to src/test/ui/issues/issue-21600.stderr diff --git a/src/test/ui/issue-21701.rs b/src/test/ui/issues/issue-21701.rs similarity index 100% rename from src/test/ui/issue-21701.rs rename to src/test/ui/issues/issue-21701.rs diff --git a/src/test/ui/issue-21701.stderr b/src/test/ui/issues/issue-21701.stderr similarity index 100% rename from src/test/ui/issue-21701.stderr rename to src/test/ui/issues/issue-21701.stderr diff --git a/src/test/ui/issue-21763.rs b/src/test/ui/issues/issue-21763.rs similarity index 100% rename from src/test/ui/issue-21763.rs rename to src/test/ui/issues/issue-21763.rs diff --git a/src/test/ui/issue-21763.stderr b/src/test/ui/issues/issue-21763.stderr similarity index 100% rename from src/test/ui/issue-21763.stderr rename to src/test/ui/issues/issue-21763.stderr diff --git a/src/test/ui/issue-21837.rs b/src/test/ui/issues/issue-21837.rs similarity index 100% rename from src/test/ui/issue-21837.rs rename to src/test/ui/issues/issue-21837.rs diff --git a/src/test/ui/issue-21837.stderr b/src/test/ui/issues/issue-21837.stderr similarity index 100% rename from src/test/ui/issue-21837.stderr rename to src/test/ui/issues/issue-21837.stderr diff --git a/src/test/ui/issue-21946.rs b/src/test/ui/issues/issue-21946.rs similarity index 100% rename from src/test/ui/issue-21946.rs rename to src/test/ui/issues/issue-21946.rs diff --git a/src/test/ui/issue-21946.stderr b/src/test/ui/issues/issue-21946.stderr similarity index 100% rename from src/test/ui/issue-21946.stderr rename to src/test/ui/issues/issue-21946.stderr diff --git a/src/test/ui/issue-21950.rs b/src/test/ui/issues/issue-21950.rs similarity index 100% rename from src/test/ui/issue-21950.rs rename to src/test/ui/issues/issue-21950.rs diff --git a/src/test/ui/issue-21950.stderr b/src/test/ui/issues/issue-21950.stderr similarity index 100% rename from src/test/ui/issue-21950.stderr rename to src/test/ui/issues/issue-21950.stderr diff --git a/src/test/ui/issue-21974.rs b/src/test/ui/issues/issue-21974.rs similarity index 100% rename from src/test/ui/issue-21974.rs rename to src/test/ui/issues/issue-21974.rs diff --git a/src/test/ui/issue-21974.stderr b/src/test/ui/issues/issue-21974.stderr similarity index 100% rename from src/test/ui/issue-21974.stderr rename to src/test/ui/issues/issue-21974.stderr diff --git a/src/test/ui/issue-22034.rs b/src/test/ui/issues/issue-22034.rs similarity index 100% rename from src/test/ui/issue-22034.rs rename to src/test/ui/issues/issue-22034.rs diff --git a/src/test/ui/issue-22034.stderr b/src/test/ui/issues/issue-22034.stderr similarity index 100% rename from src/test/ui/issue-22034.stderr rename to src/test/ui/issues/issue-22034.stderr diff --git a/src/test/ui/issue-22037.rs b/src/test/ui/issues/issue-22037.rs similarity index 100% rename from src/test/ui/issue-22037.rs rename to src/test/ui/issues/issue-22037.rs diff --git a/src/test/ui/issue-22037.stderr b/src/test/ui/issues/issue-22037.stderr similarity index 100% rename from src/test/ui/issue-22037.stderr rename to src/test/ui/issues/issue-22037.stderr diff --git a/src/test/ui/issue-22289.rs b/src/test/ui/issues/issue-22289.rs similarity index 100% rename from src/test/ui/issue-22289.rs rename to src/test/ui/issues/issue-22289.rs diff --git a/src/test/ui/issue-22289.stderr b/src/test/ui/issues/issue-22289.stderr similarity index 100% rename from src/test/ui/issue-22289.stderr rename to src/test/ui/issues/issue-22289.stderr diff --git a/src/test/ui/issue-22312.rs b/src/test/ui/issues/issue-22312.rs similarity index 100% rename from src/test/ui/issue-22312.rs rename to src/test/ui/issues/issue-22312.rs diff --git a/src/test/ui/issue-22312.stderr b/src/test/ui/issues/issue-22312.stderr similarity index 100% rename from src/test/ui/issue-22312.stderr rename to src/test/ui/issues/issue-22312.stderr diff --git a/src/test/ui/issue-22370.rs b/src/test/ui/issues/issue-22370.rs similarity index 100% rename from src/test/ui/issue-22370.rs rename to src/test/ui/issues/issue-22370.rs diff --git a/src/test/ui/issue-22370.stderr b/src/test/ui/issues/issue-22370.stderr similarity index 100% rename from src/test/ui/issue-22370.stderr rename to src/test/ui/issues/issue-22370.stderr diff --git a/src/test/ui/issue-22384.rs b/src/test/ui/issues/issue-22384.rs similarity index 100% rename from src/test/ui/issue-22384.rs rename to src/test/ui/issues/issue-22384.rs diff --git a/src/test/ui/issue-22384.stderr b/src/test/ui/issues/issue-22384.stderr similarity index 100% rename from src/test/ui/issue-22384.stderr rename to src/test/ui/issues/issue-22384.stderr diff --git a/src/test/ui/issue-22434.rs b/src/test/ui/issues/issue-22434.rs similarity index 100% rename from src/test/ui/issue-22434.rs rename to src/test/ui/issues/issue-22434.rs diff --git a/src/test/ui/issue-22434.stderr b/src/test/ui/issues/issue-22434.stderr similarity index 100% rename from src/test/ui/issue-22434.stderr rename to src/test/ui/issues/issue-22434.stderr diff --git a/src/test/ui/issue-22468.rs b/src/test/ui/issues/issue-22468.rs similarity index 100% rename from src/test/ui/issue-22468.rs rename to src/test/ui/issues/issue-22468.rs diff --git a/src/test/ui/issue-22468.stderr b/src/test/ui/issues/issue-22468.stderr similarity index 100% rename from src/test/ui/issue-22468.stderr rename to src/test/ui/issues/issue-22468.stderr diff --git a/src/test/ui/issue-22560.rs b/src/test/ui/issues/issue-22560.rs similarity index 100% rename from src/test/ui/issue-22560.rs rename to src/test/ui/issues/issue-22560.rs diff --git a/src/test/ui/issue-22560.stderr b/src/test/ui/issues/issue-22560.stderr similarity index 100% rename from src/test/ui/issue-22560.stderr rename to src/test/ui/issues/issue-22560.stderr diff --git a/src/test/ui/issue-22599.rs b/src/test/ui/issues/issue-22599.rs similarity index 100% rename from src/test/ui/issue-22599.rs rename to src/test/ui/issues/issue-22599.rs diff --git a/src/test/ui/issue-22599.stderr b/src/test/ui/issues/issue-22599.stderr similarity index 100% rename from src/test/ui/issue-22599.stderr rename to src/test/ui/issues/issue-22599.stderr diff --git a/src/test/ui/issue-22603.rs b/src/test/ui/issues/issue-22603.rs similarity index 100% rename from src/test/ui/issue-22603.rs rename to src/test/ui/issues/issue-22603.rs diff --git a/src/test/ui/issue-22603.stderr b/src/test/ui/issues/issue-22603.stderr similarity index 100% rename from src/test/ui/issue-22603.stderr rename to src/test/ui/issues/issue-22603.stderr diff --git a/src/test/compile-fail/issue-22638.rs b/src/test/ui/issues/issue-22638.rs similarity index 96% rename from src/test/compile-fail/issue-22638.rs rename to src/test/ui/issues/issue-22638.rs index 1c534ebbd4350..10ea1077ede53 100644 --- a/src/test/compile-fail/issue-22638.rs +++ b/src/test/ui/issues/issue-22638.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test: "<\[closure@.+`" -> "$$CLOSURE`" + #![allow(unused)] #![recursion_limit = "20"] diff --git a/src/test/ui/issues/issue-22638.stderr b/src/test/ui/issues/issue-22638.stderr new file mode 100644 index 0000000000000..299d74b08b80e --- /dev/null +++ b/src/test/ui/issues/issue-22638.stderr @@ -0,0 +1,14 @@ +error: reached the type-length limit while instantiating `D::matches::$CLOSURE` + --> $DIR/issue-22638.rs:62:5 + | +LL | / pub fn matches(&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/ui/issue-22644.rs b/src/test/ui/issues/issue-22644.rs similarity index 100% rename from src/test/ui/issue-22644.rs rename to src/test/ui/issues/issue-22644.rs diff --git a/src/test/ui/issue-22644.stderr b/src/test/ui/issues/issue-22644.stderr similarity index 100% rename from src/test/ui/issue-22644.stderr rename to src/test/ui/issues/issue-22644.stderr diff --git a/src/test/ui/issue-22673.rs b/src/test/ui/issues/issue-22673.rs similarity index 100% rename from src/test/ui/issue-22673.rs rename to src/test/ui/issues/issue-22673.rs diff --git a/src/test/ui/issue-22673.stderr b/src/test/ui/issues/issue-22673.stderr similarity index 100% rename from src/test/ui/issue-22673.stderr rename to src/test/ui/issues/issue-22673.stderr diff --git a/src/test/ui/issue-22684.rs b/src/test/ui/issues/issue-22684.rs similarity index 100% rename from src/test/ui/issue-22684.rs rename to src/test/ui/issues/issue-22684.rs diff --git a/src/test/ui/issue-22684.stderr b/src/test/ui/issues/issue-22684.stderr similarity index 100% rename from src/test/ui/issue-22684.stderr rename to src/test/ui/issues/issue-22684.stderr diff --git a/src/test/ui/issue-22706.rs b/src/test/ui/issues/issue-22706.rs similarity index 100% rename from src/test/ui/issue-22706.rs rename to src/test/ui/issues/issue-22706.rs diff --git a/src/test/ui/issue-22706.stderr b/src/test/ui/issues/issue-22706.stderr similarity index 100% rename from src/test/ui/issue-22706.stderr rename to src/test/ui/issues/issue-22706.stderr diff --git a/src/test/ui/issue-22789.rs b/src/test/ui/issues/issue-22789.rs similarity index 100% rename from src/test/ui/issue-22789.rs rename to src/test/ui/issues/issue-22789.rs diff --git a/src/test/ui/issue-22789.stderr b/src/test/ui/issues/issue-22789.stderr similarity index 100% rename from src/test/ui/issue-22789.stderr rename to src/test/ui/issues/issue-22789.stderr diff --git a/src/test/ui/issue-2281-part1.rs b/src/test/ui/issues/issue-2281-part1.rs similarity index 100% rename from src/test/ui/issue-2281-part1.rs rename to src/test/ui/issues/issue-2281-part1.rs diff --git a/src/test/ui/issue-2281-part1.stderr b/src/test/ui/issues/issue-2281-part1.stderr similarity index 100% rename from src/test/ui/issue-2281-part1.stderr rename to src/test/ui/issues/issue-2281-part1.stderr diff --git a/src/test/ui/issue-22874.rs b/src/test/ui/issues/issue-22874.rs similarity index 100% rename from src/test/ui/issue-22874.rs rename to src/test/ui/issues/issue-22874.rs diff --git a/src/test/ui/issue-22874.stderr b/src/test/ui/issues/issue-22874.stderr similarity index 100% rename from src/test/ui/issue-22874.stderr rename to src/test/ui/issues/issue-22874.stderr diff --git a/src/test/ui/issue-22886.rs b/src/test/ui/issues/issue-22886.rs similarity index 100% rename from src/test/ui/issue-22886.rs rename to src/test/ui/issues/issue-22886.rs diff --git a/src/test/ui/issue-22886.stderr b/src/test/ui/issues/issue-22886.stderr similarity index 100% rename from src/test/ui/issue-22886.stderr rename to src/test/ui/issues/issue-22886.stderr diff --git a/src/test/ui/issue-22933-1.rs b/src/test/ui/issues/issue-22933-1.rs similarity index 100% rename from src/test/ui/issue-22933-1.rs rename to src/test/ui/issues/issue-22933-1.rs diff --git a/src/test/ui/issue-22933-1.stderr b/src/test/ui/issues/issue-22933-1.stderr similarity index 100% rename from src/test/ui/issue-22933-1.stderr rename to src/test/ui/issues/issue-22933-1.stderr diff --git a/src/test/ui/issue-22933-2.rs b/src/test/ui/issues/issue-22933-2.rs similarity index 100% rename from src/test/ui/issue-22933-2.rs rename to src/test/ui/issues/issue-22933-2.rs diff --git a/src/test/ui/issue-22933-2.stderr b/src/test/ui/issues/issue-22933-2.stderr similarity index 100% rename from src/test/ui/issue-22933-2.stderr rename to src/test/ui/issues/issue-22933-2.stderr diff --git a/src/test/ui/issue-22933-3.rs b/src/test/ui/issues/issue-22933-3.rs similarity index 100% rename from src/test/ui/issue-22933-3.rs rename to src/test/ui/issues/issue-22933-3.rs diff --git a/src/test/ui/issue-22933-3.stderr b/src/test/ui/issues/issue-22933-3.stderr similarity index 100% rename from src/test/ui/issue-22933-3.stderr rename to src/test/ui/issues/issue-22933-3.stderr diff --git a/src/test/ui/issue-23024.rs b/src/test/ui/issues/issue-23024.rs similarity index 100% rename from src/test/ui/issue-23024.rs rename to src/test/ui/issues/issue-23024.rs diff --git a/src/test/ui/issue-23024.stderr b/src/test/ui/issues/issue-23024.stderr similarity index 100% rename from src/test/ui/issue-23024.stderr rename to src/test/ui/issues/issue-23024.stderr diff --git a/src/test/ui/issue-23041.rs b/src/test/ui/issues/issue-23041.rs similarity index 100% rename from src/test/ui/issue-23041.rs rename to src/test/ui/issues/issue-23041.rs diff --git a/src/test/ui/issue-23041.stderr b/src/test/ui/issues/issue-23041.stderr similarity index 100% rename from src/test/ui/issue-23041.stderr rename to src/test/ui/issues/issue-23041.stderr diff --git a/src/test/ui/issue-23046.rs b/src/test/ui/issues/issue-23046.rs similarity index 100% rename from src/test/ui/issue-23046.rs rename to src/test/ui/issues/issue-23046.rs diff --git a/src/test/ui/issue-23046.stderr b/src/test/ui/issues/issue-23046.stderr similarity index 100% rename from src/test/ui/issue-23046.stderr rename to src/test/ui/issues/issue-23046.stderr diff --git a/src/test/ui/issue-23073.rs b/src/test/ui/issues/issue-23073.rs similarity index 100% rename from src/test/ui/issue-23073.rs rename to src/test/ui/issues/issue-23073.rs diff --git a/src/test/ui/issue-23073.stderr b/src/test/ui/issues/issue-23073.stderr similarity index 100% rename from src/test/ui/issue-23073.stderr rename to src/test/ui/issues/issue-23073.stderr diff --git a/src/test/ui/issue-23080-2.rs b/src/test/ui/issues/issue-23080-2.rs similarity index 100% rename from src/test/ui/issue-23080-2.rs rename to src/test/ui/issues/issue-23080-2.rs diff --git a/src/test/ui/issue-23080-2.stderr b/src/test/ui/issues/issue-23080-2.stderr similarity index 100% rename from src/test/ui/issue-23080-2.stderr rename to src/test/ui/issues/issue-23080-2.stderr diff --git a/src/test/ui/issue-23080.rs b/src/test/ui/issues/issue-23080.rs similarity index 100% rename from src/test/ui/issue-23080.rs rename to src/test/ui/issues/issue-23080.rs diff --git a/src/test/ui/issue-23080.stderr b/src/test/ui/issues/issue-23080.stderr similarity index 100% rename from src/test/ui/issue-23080.stderr rename to src/test/ui/issues/issue-23080.stderr diff --git a/src/test/ui/issue-23122-1.rs b/src/test/ui/issues/issue-23122-1.rs similarity index 100% rename from src/test/ui/issue-23122-1.rs rename to src/test/ui/issues/issue-23122-1.rs diff --git a/src/test/ui/issue-23122-1.stderr b/src/test/ui/issues/issue-23122-1.stderr similarity index 100% rename from src/test/ui/issue-23122-1.stderr rename to src/test/ui/issues/issue-23122-1.stderr diff --git a/src/test/ui/issue-23122-2.rs b/src/test/ui/issues/issue-23122-2.rs similarity index 100% rename from src/test/ui/issue-23122-2.rs rename to src/test/ui/issues/issue-23122-2.rs diff --git a/src/test/ui/issue-23122-2.stderr b/src/test/ui/issues/issue-23122-2.stderr similarity index 100% rename from src/test/ui/issue-23122-2.stderr rename to src/test/ui/issues/issue-23122-2.stderr diff --git a/src/test/ui/issue-23173.rs b/src/test/ui/issues/issue-23173.rs similarity index 100% rename from src/test/ui/issue-23173.rs rename to src/test/ui/issues/issue-23173.rs diff --git a/src/test/ui/issue-23173.stderr b/src/test/ui/issues/issue-23173.stderr similarity index 100% rename from src/test/ui/issue-23173.stderr rename to src/test/ui/issues/issue-23173.stderr diff --git a/src/test/ui/issue-23217.rs b/src/test/ui/issues/issue-23217.rs similarity index 100% rename from src/test/ui/issue-23217.rs rename to src/test/ui/issues/issue-23217.rs diff --git a/src/test/ui/issue-23217.stderr b/src/test/ui/issues/issue-23217.stderr similarity index 100% rename from src/test/ui/issue-23217.stderr rename to src/test/ui/issues/issue-23217.stderr diff --git a/src/test/ui/issue-23253.rs b/src/test/ui/issues/issue-23253.rs similarity index 100% rename from src/test/ui/issue-23253.rs rename to src/test/ui/issues/issue-23253.rs diff --git a/src/test/ui/issue-23253.stderr b/src/test/ui/issues/issue-23253.stderr similarity index 100% rename from src/test/ui/issue-23253.stderr rename to src/test/ui/issues/issue-23253.stderr diff --git a/src/test/ui/issue-23281.rs b/src/test/ui/issues/issue-23281.rs similarity index 100% rename from src/test/ui/issue-23281.rs rename to src/test/ui/issues/issue-23281.rs diff --git a/src/test/ui/issue-23281.stderr b/src/test/ui/issues/issue-23281.stderr similarity index 100% rename from src/test/ui/issue-23281.stderr rename to src/test/ui/issues/issue-23281.stderr diff --git a/src/test/ui/issue-2330.rs b/src/test/ui/issues/issue-2330.rs similarity index 100% rename from src/test/ui/issue-2330.rs rename to src/test/ui/issues/issue-2330.rs diff --git a/src/test/ui/issue-2330.stderr b/src/test/ui/issues/issue-2330.stderr similarity index 100% rename from src/test/ui/issue-2330.stderr rename to src/test/ui/issues/issue-2330.stderr diff --git a/src/test/ui/issue-23302-1.rs b/src/test/ui/issues/issue-23302-1.rs similarity index 100% rename from src/test/ui/issue-23302-1.rs rename to src/test/ui/issues/issue-23302-1.rs diff --git a/src/test/ui/issue-23302-1.stderr b/src/test/ui/issues/issue-23302-1.stderr similarity index 100% rename from src/test/ui/issue-23302-1.stderr rename to src/test/ui/issues/issue-23302-1.stderr diff --git a/src/test/ui/issue-23302-2.rs b/src/test/ui/issues/issue-23302-2.rs similarity index 100% rename from src/test/ui/issue-23302-2.rs rename to src/test/ui/issues/issue-23302-2.rs diff --git a/src/test/ui/issue-23302-2.stderr b/src/test/ui/issues/issue-23302-2.stderr similarity index 100% rename from src/test/ui/issue-23302-2.stderr rename to src/test/ui/issues/issue-23302-2.stderr diff --git a/src/test/ui/issue-23302-3.rs b/src/test/ui/issues/issue-23302-3.rs similarity index 100% rename from src/test/ui/issue-23302-3.rs rename to src/test/ui/issues/issue-23302-3.rs diff --git a/src/test/ui/issue-23302-3.stderr b/src/test/ui/issues/issue-23302-3.stderr similarity index 100% rename from src/test/ui/issue-23302-3.stderr rename to src/test/ui/issues/issue-23302-3.stderr diff --git a/src/test/ui/issue-23543.rs b/src/test/ui/issues/issue-23543.rs similarity index 100% rename from src/test/ui/issue-23543.rs rename to src/test/ui/issues/issue-23543.rs diff --git a/src/test/ui/issue-23543.stderr b/src/test/ui/issues/issue-23543.stderr similarity index 100% rename from src/test/ui/issue-23543.stderr rename to src/test/ui/issues/issue-23543.stderr diff --git a/src/test/ui/issue-23544.rs b/src/test/ui/issues/issue-23544.rs similarity index 100% rename from src/test/ui/issue-23544.rs rename to src/test/ui/issues/issue-23544.rs diff --git a/src/test/ui/issue-23544.stderr b/src/test/ui/issues/issue-23544.stderr similarity index 100% rename from src/test/ui/issue-23544.stderr rename to src/test/ui/issues/issue-23544.stderr diff --git a/src/test/ui/issue-23589.rs b/src/test/ui/issues/issue-23589.rs similarity index 100% rename from src/test/ui/issue-23589.rs rename to src/test/ui/issues/issue-23589.rs diff --git a/src/test/ui/issue-23589.stderr b/src/test/ui/issues/issue-23589.stderr similarity index 100% rename from src/test/ui/issue-23589.stderr rename to src/test/ui/issues/issue-23589.stderr diff --git a/src/test/ui/issue-23595-2.rs b/src/test/ui/issues/issue-23595-2.rs similarity index 100% rename from src/test/ui/issue-23595-2.rs rename to src/test/ui/issues/issue-23595-2.rs diff --git a/src/test/ui/issue-23595-2.stderr b/src/test/ui/issues/issue-23595-2.stderr similarity index 100% rename from src/test/ui/issue-23595-2.stderr rename to src/test/ui/issues/issue-23595-2.stderr diff --git a/src/test/ui/issue-23716.rs b/src/test/ui/issues/issue-23716.rs similarity index 100% rename from src/test/ui/issue-23716.rs rename to src/test/ui/issues/issue-23716.rs diff --git a/src/test/ui/issue-23716.stderr b/src/test/ui/issues/issue-23716.stderr similarity index 100% rename from src/test/ui/issue-23716.stderr rename to src/test/ui/issues/issue-23716.stderr diff --git a/src/test/ui/issue-23966.rs b/src/test/ui/issues/issue-23966.rs similarity index 100% rename from src/test/ui/issue-23966.rs rename to src/test/ui/issues/issue-23966.rs diff --git a/src/test/ui/issue-23966.stderr b/src/test/ui/issues/issue-23966.stderr similarity index 100% rename from src/test/ui/issue-23966.stderr rename to src/test/ui/issues/issue-23966.stderr diff --git a/src/test/ui/issue-24013.rs b/src/test/ui/issues/issue-24013.rs similarity index 100% rename from src/test/ui/issue-24013.rs rename to src/test/ui/issues/issue-24013.rs diff --git a/src/test/ui/issue-24013.stderr b/src/test/ui/issues/issue-24013.stderr similarity index 100% rename from src/test/ui/issue-24013.stderr rename to src/test/ui/issues/issue-24013.stderr diff --git a/src/test/ui/issue-24036.rs b/src/test/ui/issues/issue-24036.rs similarity index 100% rename from src/test/ui/issue-24036.rs rename to src/test/ui/issues/issue-24036.rs diff --git a/src/test/ui/issue-24036.stderr b/src/test/ui/issues/issue-24036.stderr similarity index 100% rename from src/test/ui/issue-24036.stderr rename to src/test/ui/issues/issue-24036.stderr diff --git a/src/test/ui/issue-24081.rs b/src/test/ui/issues/issue-24081.rs similarity index 100% rename from src/test/ui/issue-24081.rs rename to src/test/ui/issues/issue-24081.rs diff --git a/src/test/ui/issue-24081.stderr b/src/test/ui/issues/issue-24081.stderr similarity index 100% rename from src/test/ui/issue-24081.stderr rename to src/test/ui/issues/issue-24081.stderr diff --git a/src/test/ui/issue-24204.rs b/src/test/ui/issues/issue-24204.rs similarity index 100% rename from src/test/ui/issue-24204.rs rename to src/test/ui/issues/issue-24204.rs diff --git a/src/test/ui/issue-24204.stderr b/src/test/ui/issues/issue-24204.stderr similarity index 100% rename from src/test/ui/issue-24204.stderr rename to src/test/ui/issues/issue-24204.stderr diff --git a/src/test/ui/issue-24267-flow-exit.nll.stderr b/src/test/ui/issues/issue-24267-flow-exit.nll.stderr similarity index 100% rename from src/test/ui/issue-24267-flow-exit.nll.stderr rename to src/test/ui/issues/issue-24267-flow-exit.nll.stderr diff --git a/src/test/ui/issue-24267-flow-exit.rs b/src/test/ui/issues/issue-24267-flow-exit.rs similarity index 100% rename from src/test/ui/issue-24267-flow-exit.rs rename to src/test/ui/issues/issue-24267-flow-exit.rs diff --git a/src/test/ui/issue-24267-flow-exit.stderr b/src/test/ui/issues/issue-24267-flow-exit.stderr similarity index 100% rename from src/test/ui/issue-24267-flow-exit.stderr rename to src/test/ui/issues/issue-24267-flow-exit.stderr diff --git a/src/test/ui/issue-24322.rs b/src/test/ui/issues/issue-24322.rs similarity index 100% rename from src/test/ui/issue-24322.rs rename to src/test/ui/issues/issue-24322.rs diff --git a/src/test/ui/issue-24322.stderr b/src/test/ui/issues/issue-24322.stderr similarity index 100% rename from src/test/ui/issue-24322.stderr rename to src/test/ui/issues/issue-24322.stderr diff --git a/src/test/ui/issue-24352.rs b/src/test/ui/issues/issue-24352.rs similarity index 100% rename from src/test/ui/issue-24352.rs rename to src/test/ui/issues/issue-24352.rs diff --git a/src/test/ui/issue-24352.stderr b/src/test/ui/issues/issue-24352.stderr similarity index 100% rename from src/test/ui/issue-24352.stderr rename to src/test/ui/issues/issue-24352.stderr diff --git a/src/test/ui/issue-24357.nll.stderr b/src/test/ui/issues/issue-24357.nll.stderr similarity index 100% rename from src/test/ui/issue-24357.nll.stderr rename to src/test/ui/issues/issue-24357.nll.stderr diff --git a/src/test/ui/issue-24357.rs b/src/test/ui/issues/issue-24357.rs similarity index 100% rename from src/test/ui/issue-24357.rs rename to src/test/ui/issues/issue-24357.rs diff --git a/src/test/ui/issue-24357.stderr b/src/test/ui/issues/issue-24357.stderr similarity index 100% rename from src/test/ui/issue-24357.stderr rename to src/test/ui/issues/issue-24357.stderr diff --git a/src/test/ui/issue-24363.rs b/src/test/ui/issues/issue-24363.rs similarity index 100% rename from src/test/ui/issue-24363.rs rename to src/test/ui/issues/issue-24363.rs diff --git a/src/test/ui/issue-24363.stderr b/src/test/ui/issues/issue-24363.stderr similarity index 100% rename from src/test/ui/issue-24363.stderr rename to src/test/ui/issues/issue-24363.stderr diff --git a/src/test/ui/issue-24365.rs b/src/test/ui/issues/issue-24365.rs similarity index 100% rename from src/test/ui/issue-24365.rs rename to src/test/ui/issues/issue-24365.rs diff --git a/src/test/ui/issue-24365.stderr b/src/test/ui/issues/issue-24365.stderr similarity index 100% rename from src/test/ui/issue-24365.stderr rename to src/test/ui/issues/issue-24365.stderr diff --git a/src/test/ui/issue-24424.rs b/src/test/ui/issues/issue-24424.rs similarity index 100% rename from src/test/ui/issue-24424.rs rename to src/test/ui/issues/issue-24424.rs diff --git a/src/test/ui/issue-24424.stderr b/src/test/ui/issues/issue-24424.stderr similarity index 100% rename from src/test/ui/issue-24424.stderr rename to src/test/ui/issues/issue-24424.stderr diff --git a/src/test/ui/issue-24446.rs b/src/test/ui/issues/issue-24446.rs similarity index 100% rename from src/test/ui/issue-24446.rs rename to src/test/ui/issues/issue-24446.rs diff --git a/src/test/ui/issue-24446.stderr b/src/test/ui/issues/issue-24446.stderr similarity index 100% rename from src/test/ui/issue-24446.stderr rename to src/test/ui/issues/issue-24446.stderr diff --git a/src/test/ui/issue-24682.rs b/src/test/ui/issues/issue-24682.rs similarity index 100% rename from src/test/ui/issue-24682.rs rename to src/test/ui/issues/issue-24682.rs diff --git a/src/test/ui/issue-24682.stderr b/src/test/ui/issues/issue-24682.stderr similarity index 100% rename from src/test/ui/issue-24682.stderr rename to src/test/ui/issues/issue-24682.stderr diff --git a/src/test/ui/issue-24819.rs b/src/test/ui/issues/issue-24819.rs similarity index 100% rename from src/test/ui/issue-24819.rs rename to src/test/ui/issues/issue-24819.rs diff --git a/src/test/ui/issue-24819.stderr b/src/test/ui/issues/issue-24819.stderr similarity index 100% rename from src/test/ui/issue-24819.stderr rename to src/test/ui/issues/issue-24819.stderr diff --git a/src/test/ui/issue-24883.rs b/src/test/ui/issues/issue-24883.rs similarity index 100% rename from src/test/ui/issue-24883.rs rename to src/test/ui/issues/issue-24883.rs diff --git a/src/test/ui/issue-24883.stderr b/src/test/ui/issues/issue-24883.stderr similarity index 100% rename from src/test/ui/issue-24883.stderr rename to src/test/ui/issues/issue-24883.stderr diff --git a/src/test/ui/issue-25076.rs b/src/test/ui/issues/issue-25076.rs similarity index 100% rename from src/test/ui/issue-25076.rs rename to src/test/ui/issues/issue-25076.rs diff --git a/src/test/ui/issue-25076.stderr b/src/test/ui/issues/issue-25076.stderr similarity index 100% rename from src/test/ui/issue-25076.stderr rename to src/test/ui/issues/issue-25076.stderr diff --git a/src/test/ui/issue-25368.rs b/src/test/ui/issues/issue-25368.rs similarity index 100% rename from src/test/ui/issue-25368.rs rename to src/test/ui/issues/issue-25368.rs diff --git a/src/test/ui/issue-25368.stderr b/src/test/ui/issues/issue-25368.stderr similarity index 100% rename from src/test/ui/issue-25368.stderr rename to src/test/ui/issues/issue-25368.stderr diff --git a/src/test/ui/issue-25385.rs b/src/test/ui/issues/issue-25385.rs similarity index 100% rename from src/test/ui/issue-25385.rs rename to src/test/ui/issues/issue-25385.rs diff --git a/src/test/ui/issue-25385.stderr b/src/test/ui/issues/issue-25385.stderr similarity index 100% rename from src/test/ui/issue-25385.stderr rename to src/test/ui/issues/issue-25385.stderr diff --git a/src/test/ui/issue-25386.rs b/src/test/ui/issues/issue-25386.rs similarity index 100% rename from src/test/ui/issue-25386.rs rename to src/test/ui/issues/issue-25386.rs diff --git a/src/test/ui/issue-25386.stderr b/src/test/ui/issues/issue-25386.stderr similarity index 100% rename from src/test/ui/issue-25386.stderr rename to src/test/ui/issues/issue-25386.stderr diff --git a/src/test/ui/issue-25396.rs b/src/test/ui/issues/issue-25396.rs similarity index 100% rename from src/test/ui/issue-25396.rs rename to src/test/ui/issues/issue-25396.rs diff --git a/src/test/ui/issue-25396.stderr b/src/test/ui/issues/issue-25396.stderr similarity index 100% rename from src/test/ui/issue-25396.stderr rename to src/test/ui/issues/issue-25396.stderr diff --git a/src/test/ui/issue-25439.rs b/src/test/ui/issues/issue-25439.rs similarity index 100% rename from src/test/ui/issue-25439.rs rename to src/test/ui/issues/issue-25439.rs diff --git a/src/test/ui/issue-25439.stderr b/src/test/ui/issues/issue-25439.stderr similarity index 100% rename from src/test/ui/issue-25439.stderr rename to src/test/ui/issues/issue-25439.stderr diff --git a/src/test/ui/issue-25579.ast.nll.stderr b/src/test/ui/issues/issue-25579.ast.nll.stderr similarity index 100% rename from src/test/ui/issue-25579.ast.nll.stderr rename to src/test/ui/issues/issue-25579.ast.nll.stderr diff --git a/src/test/ui/issue-25579.ast.stderr b/src/test/ui/issues/issue-25579.ast.stderr similarity index 100% rename from src/test/ui/issue-25579.ast.stderr rename to src/test/ui/issues/issue-25579.ast.stderr diff --git a/src/test/ui/issue-25579.mir.stderr b/src/test/ui/issues/issue-25579.mir.stderr similarity index 100% rename from src/test/ui/issue-25579.mir.stderr rename to src/test/ui/issues/issue-25579.mir.stderr diff --git a/src/test/ui/issue-25579.rs b/src/test/ui/issues/issue-25579.rs similarity index 100% rename from src/test/ui/issue-25579.rs rename to src/test/ui/issues/issue-25579.rs diff --git a/src/test/ui/issue-25700.rs b/src/test/ui/issues/issue-25700.rs similarity index 100% rename from src/test/ui/issue-25700.rs rename to src/test/ui/issues/issue-25700.rs diff --git a/src/test/ui/issue-25700.stderr b/src/test/ui/issues/issue-25700.stderr similarity index 100% rename from src/test/ui/issue-25700.stderr rename to src/test/ui/issues/issue-25700.stderr diff --git a/src/test/ui/issue-25793.nll.stderr b/src/test/ui/issues/issue-25793.nll.stderr similarity index 100% rename from src/test/ui/issue-25793.nll.stderr rename to src/test/ui/issues/issue-25793.nll.stderr diff --git a/src/test/ui/issue-25793.rs b/src/test/ui/issues/issue-25793.rs similarity index 100% rename from src/test/ui/issue-25793.rs rename to src/test/ui/issues/issue-25793.rs diff --git a/src/test/ui/issue-25793.stderr b/src/test/ui/issues/issue-25793.stderr similarity index 100% rename from src/test/ui/issue-25793.stderr rename to src/test/ui/issues/issue-25793.stderr diff --git a/src/test/ui/issue-25826.rs b/src/test/ui/issues/issue-25826.rs similarity index 100% rename from src/test/ui/issue-25826.rs rename to src/test/ui/issues/issue-25826.rs diff --git a/src/test/ui/issue-25826.stderr b/src/test/ui/issues/issue-25826.stderr similarity index 100% rename from src/test/ui/issue-25826.stderr rename to src/test/ui/issues/issue-25826.stderr diff --git a/src/test/ui/issue-2590.nll.stderr b/src/test/ui/issues/issue-2590.nll.stderr similarity index 100% rename from src/test/ui/issue-2590.nll.stderr rename to src/test/ui/issues/issue-2590.nll.stderr diff --git a/src/test/ui/issue-2590.rs b/src/test/ui/issues/issue-2590.rs similarity index 100% rename from src/test/ui/issue-2590.rs rename to src/test/ui/issues/issue-2590.rs diff --git a/src/test/ui/issue-2590.stderr b/src/test/ui/issues/issue-2590.stderr similarity index 100% rename from src/test/ui/issue-2590.stderr rename to src/test/ui/issues/issue-2590.stderr diff --git a/src/test/ui/issue-25901.rs b/src/test/ui/issues/issue-25901.rs similarity index 100% rename from src/test/ui/issue-25901.rs rename to src/test/ui/issues/issue-25901.rs diff --git a/src/test/ui/issue-25901.stderr b/src/test/ui/issues/issue-25901.stderr similarity index 100% rename from src/test/ui/issue-25901.stderr rename to src/test/ui/issues/issue-25901.stderr diff --git a/src/test/ui/issue-26056.rs b/src/test/ui/issues/issue-26056.rs similarity index 100% rename from src/test/ui/issue-26056.rs rename to src/test/ui/issues/issue-26056.rs diff --git a/src/test/ui/issue-26056.stderr b/src/test/ui/issues/issue-26056.stderr similarity index 100% rename from src/test/ui/issue-26056.stderr rename to src/test/ui/issues/issue-26056.stderr diff --git a/src/test/ui/issue-26093.rs b/src/test/ui/issues/issue-26093.rs similarity index 100% rename from src/test/ui/issue-26093.rs rename to src/test/ui/issues/issue-26093.rs diff --git a/src/test/ui/issue-26093.stderr b/src/test/ui/issues/issue-26093.stderr similarity index 100% rename from src/test/ui/issue-26093.stderr rename to src/test/ui/issues/issue-26093.stderr diff --git a/src/test/ui/issue-26094.rs b/src/test/ui/issues/issue-26094.rs similarity index 100% rename from src/test/ui/issue-26094.rs rename to src/test/ui/issues/issue-26094.rs diff --git a/src/test/ui/issue-26094.stderr b/src/test/ui/issues/issue-26094.stderr similarity index 100% rename from src/test/ui/issue-26094.stderr rename to src/test/ui/issues/issue-26094.stderr diff --git a/src/test/ui/issue-26158.rs b/src/test/ui/issues/issue-26158.rs similarity index 100% rename from src/test/ui/issue-26158.rs rename to src/test/ui/issues/issue-26158.rs diff --git a/src/test/ui/issue-26158.stderr b/src/test/ui/issues/issue-26158.stderr similarity index 100% rename from src/test/ui/issue-26158.stderr rename to src/test/ui/issues/issue-26158.stderr diff --git a/src/test/ui/issue-26217.nll.stderr b/src/test/ui/issues/issue-26217.nll.stderr similarity index 100% rename from src/test/ui/issue-26217.nll.stderr rename to src/test/ui/issues/issue-26217.nll.stderr diff --git a/src/test/ui/issue-26217.rs b/src/test/ui/issues/issue-26217.rs similarity index 100% rename from src/test/ui/issue-26217.rs rename to src/test/ui/issues/issue-26217.rs diff --git a/src/test/ui/issue-26217.stderr b/src/test/ui/issues/issue-26217.stderr similarity index 100% rename from src/test/ui/issue-26217.stderr rename to src/test/ui/issues/issue-26217.stderr diff --git a/src/test/ui/issue-26237.rs b/src/test/ui/issues/issue-26237.rs similarity index 100% rename from src/test/ui/issue-26237.rs rename to src/test/ui/issues/issue-26237.rs diff --git a/src/test/ui/issue-26237.stderr b/src/test/ui/issues/issue-26237.stderr similarity index 100% rename from src/test/ui/issue-26237.stderr rename to src/test/ui/issues/issue-26237.stderr diff --git a/src/test/ui/issue-26262.rs b/src/test/ui/issues/issue-26262.rs similarity index 100% rename from src/test/ui/issue-26262.rs rename to src/test/ui/issues/issue-26262.rs diff --git a/src/test/ui/issue-26262.stderr b/src/test/ui/issues/issue-26262.stderr similarity index 100% rename from src/test/ui/issue-26262.stderr rename to src/test/ui/issues/issue-26262.stderr diff --git a/src/test/ui/issue-26459.rs b/src/test/ui/issues/issue-26459.rs similarity index 100% rename from src/test/ui/issue-26459.rs rename to src/test/ui/issues/issue-26459.rs diff --git a/src/test/ui/issue-26459.stderr b/src/test/ui/issues/issue-26459.stderr similarity index 100% rename from src/test/ui/issue-26459.stderr rename to src/test/ui/issues/issue-26459.stderr diff --git a/src/test/ui/issue-26472.rs b/src/test/ui/issues/issue-26472.rs similarity index 100% rename from src/test/ui/issue-26472.rs rename to src/test/ui/issues/issue-26472.rs diff --git a/src/test/ui/issue-26472.stderr b/src/test/ui/issues/issue-26472.stderr similarity index 100% rename from src/test/ui/issue-26472.stderr rename to src/test/ui/issues/issue-26472.stderr diff --git a/src/test/compile-fail/issue-26548.rs b/src/test/ui/issues/issue-26548.rs similarity index 100% rename from src/test/compile-fail/issue-26548.rs rename to src/test/ui/issues/issue-26548.rs diff --git a/src/test/ui/issues/issue-26548.stderr b/src/test/ui/issues/issue-26548.stderr new file mode 100644 index 0000000000000..7ebeb76b65710 --- /dev/null +++ b/src/test/ui/issues/issue-26548.stderr @@ -0,0 +1,13 @@ +error[E0391]: cycle detected when computing layout of `std::option::Option` + | +note: ...which requires computing layout of `S`... + = note: ...which again requires computing layout of `std::option::Option`, 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/ui/issue-26614.rs b/src/test/ui/issues/issue-26614.rs similarity index 100% rename from src/test/ui/issue-26614.rs rename to src/test/ui/issues/issue-26614.rs diff --git a/src/test/ui/issue-26614.stderr b/src/test/ui/issues/issue-26614.stderr similarity index 100% rename from src/test/ui/issue-26614.stderr rename to src/test/ui/issues/issue-26614.stderr diff --git a/src/test/ui/issue-26638.rs b/src/test/ui/issues/issue-26638.rs similarity index 100% rename from src/test/ui/issue-26638.rs rename to src/test/ui/issues/issue-26638.rs diff --git a/src/test/ui/issue-26638.stderr b/src/test/ui/issues/issue-26638.stderr similarity index 100% rename from src/test/ui/issue-26638.stderr rename to src/test/ui/issues/issue-26638.stderr diff --git a/src/test/ui/issue-26812.rs b/src/test/ui/issues/issue-26812.rs similarity index 100% rename from src/test/ui/issue-26812.rs rename to src/test/ui/issues/issue-26812.rs diff --git a/src/test/ui/issue-26812.stderr b/src/test/ui/issues/issue-26812.stderr similarity index 100% rename from src/test/ui/issue-26812.stderr rename to src/test/ui/issues/issue-26812.stderr diff --git a/src/test/ui/issue-26886.rs b/src/test/ui/issues/issue-26886.rs similarity index 100% rename from src/test/ui/issue-26886.rs rename to src/test/ui/issues/issue-26886.rs diff --git a/src/test/ui/issue-26886.stderr b/src/test/ui/issues/issue-26886.stderr similarity index 100% rename from src/test/ui/issue-26886.stderr rename to src/test/ui/issues/issue-26886.stderr diff --git a/src/test/ui/issue-26905.rs b/src/test/ui/issues/issue-26905.rs similarity index 100% rename from src/test/ui/issue-26905.rs rename to src/test/ui/issues/issue-26905.rs diff --git a/src/test/ui/issue-26905.stderr b/src/test/ui/issues/issue-26905.stderr similarity index 100% rename from src/test/ui/issue-26905.stderr rename to src/test/ui/issues/issue-26905.stderr diff --git a/src/test/ui/issue-26930.rs b/src/test/ui/issues/issue-26930.rs similarity index 100% rename from src/test/ui/issue-26930.rs rename to src/test/ui/issues/issue-26930.rs diff --git a/src/test/ui/issue-26930.stderr b/src/test/ui/issues/issue-26930.stderr similarity index 100% rename from src/test/ui/issue-26930.stderr rename to src/test/ui/issues/issue-26930.stderr diff --git a/src/test/ui/issue-26948.rs b/src/test/ui/issues/issue-26948.rs similarity index 100% rename from src/test/ui/issue-26948.rs rename to src/test/ui/issues/issue-26948.rs diff --git a/src/test/ui/issue-26948.stderr b/src/test/ui/issues/issue-26948.stderr similarity index 100% rename from src/test/ui/issue-26948.stderr rename to src/test/ui/issues/issue-26948.stderr diff --git a/src/test/ui/issue-27008.rs b/src/test/ui/issues/issue-27008.rs similarity index 100% rename from src/test/ui/issue-27008.rs rename to src/test/ui/issues/issue-27008.rs diff --git a/src/test/ui/issue-27008.stderr b/src/test/ui/issues/issue-27008.stderr similarity index 100% rename from src/test/ui/issue-27008.stderr rename to src/test/ui/issues/issue-27008.stderr diff --git a/src/test/ui/issue-27033.rs b/src/test/ui/issues/issue-27033.rs similarity index 100% rename from src/test/ui/issue-27033.rs rename to src/test/ui/issues/issue-27033.rs diff --git a/src/test/ui/issue-27033.stderr b/src/test/ui/issues/issue-27033.stderr similarity index 100% rename from src/test/ui/issue-27033.stderr rename to src/test/ui/issues/issue-27033.stderr diff --git a/src/test/ui/issue-27042.rs b/src/test/ui/issues/issue-27042.rs similarity index 100% rename from src/test/ui/issue-27042.rs rename to src/test/ui/issues/issue-27042.rs diff --git a/src/test/ui/issue-27042.stderr b/src/test/ui/issues/issue-27042.stderr similarity index 100% rename from src/test/ui/issue-27042.stderr rename to src/test/ui/issues/issue-27042.stderr diff --git a/src/test/ui/issue-27060-2.rs b/src/test/ui/issues/issue-27060-2.rs similarity index 100% rename from src/test/ui/issue-27060-2.rs rename to src/test/ui/issues/issue-27060-2.rs diff --git a/src/test/ui/issue-27060-2.stderr b/src/test/ui/issues/issue-27060-2.stderr similarity index 100% rename from src/test/ui/issue-27060-2.stderr rename to src/test/ui/issues/issue-27060-2.stderr diff --git a/src/test/ui/issue-27060.rs b/src/test/ui/issues/issue-27060.rs similarity index 100% rename from src/test/ui/issue-27060.rs rename to src/test/ui/issues/issue-27060.rs diff --git a/src/test/ui/issue-27060.stderr b/src/test/ui/issues/issue-27060.stderr similarity index 100% rename from src/test/ui/issue-27060.stderr rename to src/test/ui/issues/issue-27060.stderr diff --git a/src/test/ui/issue-27078.rs b/src/test/ui/issues/issue-27078.rs similarity index 100% rename from src/test/ui/issue-27078.rs rename to src/test/ui/issues/issue-27078.rs diff --git a/src/test/ui/issue-27078.stderr b/src/test/ui/issues/issue-27078.stderr similarity index 100% rename from src/test/ui/issue-27078.stderr rename to src/test/ui/issues/issue-27078.stderr diff --git a/src/test/ui/issue-2718-a.rs b/src/test/ui/issues/issue-2718-a.rs similarity index 100% rename from src/test/ui/issue-2718-a.rs rename to src/test/ui/issues/issue-2718-a.rs diff --git a/src/test/ui/issue-2718-a.stderr b/src/test/ui/issues/issue-2718-a.stderr similarity index 100% rename from src/test/ui/issue-2718-a.stderr rename to src/test/ui/issues/issue-2718-a.stderr diff --git a/src/test/ui/issue-27282-move-match-input-into-guard.rs b/src/test/ui/issues/issue-27282-move-match-input-into-guard.rs similarity index 100% rename from src/test/ui/issue-27282-move-match-input-into-guard.rs rename to src/test/ui/issues/issue-27282-move-match-input-into-guard.rs diff --git a/src/test/ui/issue-27282-move-match-input-into-guard.stderr b/src/test/ui/issues/issue-27282-move-match-input-into-guard.stderr similarity index 100% rename from src/test/ui/issue-27282-move-match-input-into-guard.stderr rename to src/test/ui/issues/issue-27282-move-match-input-into-guard.stderr diff --git a/src/test/ui/issue-27282-move-ref-mut-into-guard.rs b/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.rs similarity index 100% rename from src/test/ui/issue-27282-move-ref-mut-into-guard.rs rename to src/test/ui/issues/issue-27282-move-ref-mut-into-guard.rs diff --git a/src/test/ui/issue-27282-move-ref-mut-into-guard.stderr b/src/test/ui/issues/issue-27282-move-ref-mut-into-guard.stderr similarity index 100% rename from src/test/ui/issue-27282-move-ref-mut-into-guard.stderr rename to src/test/ui/issues/issue-27282-move-ref-mut-into-guard.stderr diff --git a/src/test/ui/issue-27282-mutate-before-diverging-arm-1.rs b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.rs similarity index 100% rename from src/test/ui/issue-27282-mutate-before-diverging-arm-1.rs rename to src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.rs diff --git a/src/test/ui/issue-27282-mutate-before-diverging-arm-1.stderr b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.stderr similarity index 100% rename from src/test/ui/issue-27282-mutate-before-diverging-arm-1.stderr rename to src/test/ui/issues/issue-27282-mutate-before-diverging-arm-1.stderr diff --git a/src/test/ui/issue-27282-mutate-before-diverging-arm-2.rs b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.rs similarity index 100% rename from src/test/ui/issue-27282-mutate-before-diverging-arm-2.rs rename to src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.rs diff --git a/src/test/ui/issue-27282-mutate-before-diverging-arm-2.stderr b/src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.stderr similarity index 100% rename from src/test/ui/issue-27282-mutate-before-diverging-arm-2.stderr rename to src/test/ui/issues/issue-27282-mutate-before-diverging-arm-2.stderr diff --git a/src/test/ui/issue-27282-reborrow-ref-mut-in-guard.rs b/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.rs similarity index 100% rename from src/test/ui/issue-27282-reborrow-ref-mut-in-guard.rs rename to src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.rs diff --git a/src/test/ui/issue-27282-reborrow-ref-mut-in-guard.stderr b/src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.stderr similarity index 100% rename from src/test/ui/issue-27282-reborrow-ref-mut-in-guard.stderr rename to src/test/ui/issues/issue-27282-reborrow-ref-mut-in-guard.stderr diff --git a/src/test/ui/issue-27340.rs b/src/test/ui/issues/issue-27340.rs similarity index 100% rename from src/test/ui/issue-27340.rs rename to src/test/ui/issues/issue-27340.rs diff --git a/src/test/ui/issue-27340.stderr b/src/test/ui/issues/issue-27340.stderr similarity index 100% rename from src/test/ui/issue-27340.stderr rename to src/test/ui/issues/issue-27340.stderr diff --git a/src/test/ui/issue-27433.rs b/src/test/ui/issues/issue-27433.rs similarity index 100% rename from src/test/ui/issue-27433.rs rename to src/test/ui/issues/issue-27433.rs diff --git a/src/test/ui/issue-27433.stderr b/src/test/ui/issues/issue-27433.stderr similarity index 100% rename from src/test/ui/issue-27433.stderr rename to src/test/ui/issues/issue-27433.stderr diff --git a/src/test/ui/issue-27592.nll.stderr b/src/test/ui/issues/issue-27592.nll.stderr similarity index 100% rename from src/test/ui/issue-27592.nll.stderr rename to src/test/ui/issues/issue-27592.nll.stderr diff --git a/src/test/ui/issue-27592.rs b/src/test/ui/issues/issue-27592.rs similarity index 100% rename from src/test/ui/issue-27592.rs rename to src/test/ui/issues/issue-27592.rs diff --git a/src/test/ui/issue-27592.stderr b/src/test/ui/issues/issue-27592.stderr similarity index 100% rename from src/test/ui/issue-27592.stderr rename to src/test/ui/issues/issue-27592.stderr diff --git a/src/test/ui/issue-27815.rs b/src/test/ui/issues/issue-27815.rs similarity index 100% rename from src/test/ui/issue-27815.rs rename to src/test/ui/issues/issue-27815.rs diff --git a/src/test/ui/issue-27815.stderr b/src/test/ui/issues/issue-27815.stderr similarity index 100% rename from src/test/ui/issue-27815.stderr rename to src/test/ui/issues/issue-27815.stderr diff --git a/src/test/ui/issue-27842.rs b/src/test/ui/issues/issue-27842.rs similarity index 100% rename from src/test/ui/issue-27842.rs rename to src/test/ui/issues/issue-27842.rs diff --git a/src/test/ui/issue-27842.stderr b/src/test/ui/issues/issue-27842.stderr similarity index 100% rename from src/test/ui/issue-27842.stderr rename to src/test/ui/issues/issue-27842.stderr diff --git a/src/test/ui/issue-27895.rs b/src/test/ui/issues/issue-27895.rs similarity index 100% rename from src/test/ui/issue-27895.rs rename to src/test/ui/issues/issue-27895.rs diff --git a/src/test/ui/issue-27895.stderr b/src/test/ui/issues/issue-27895.stderr similarity index 100% rename from src/test/ui/issue-27895.stderr rename to src/test/ui/issues/issue-27895.stderr diff --git a/src/test/ui/issue-27942.rs b/src/test/ui/issues/issue-27942.rs similarity index 100% rename from src/test/ui/issue-27942.rs rename to src/test/ui/issues/issue-27942.rs diff --git a/src/test/ui/issue-27942.stderr b/src/test/ui/issues/issue-27942.stderr similarity index 100% rename from src/test/ui/issue-27942.stderr rename to src/test/ui/issues/issue-27942.stderr diff --git a/src/test/compile-fail/issue-28075.rs b/src/test/ui/issues/issue-28075.rs similarity index 100% rename from src/test/compile-fail/issue-28075.rs rename to src/test/ui/issues/issue-28075.rs diff --git a/src/test/ui/issues/issue-28075.stderr b/src/test/ui/issues/issue-28075.stderr new file mode 100644 index 0000000000000..b42a322cbb4a4 --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-28098.rs b/src/test/ui/issues/issue-28098.rs similarity index 100% rename from src/test/ui/issue-28098.rs rename to src/test/ui/issues/issue-28098.rs diff --git a/src/test/ui/issue-28098.stderr b/src/test/ui/issues/issue-28098.stderr similarity index 100% rename from src/test/ui/issue-28098.stderr rename to src/test/ui/issues/issue-28098.stderr diff --git a/src/test/ui/issue-28105.rs b/src/test/ui/issues/issue-28105.rs similarity index 100% rename from src/test/ui/issue-28105.rs rename to src/test/ui/issues/issue-28105.rs diff --git a/src/test/ui/issue-28105.stderr b/src/test/ui/issues/issue-28105.stderr similarity index 100% rename from src/test/ui/issue-28105.stderr rename to src/test/ui/issues/issue-28105.stderr diff --git a/src/test/ui/issue-28109.rs b/src/test/ui/issues/issue-28109.rs similarity index 100% rename from src/test/ui/issue-28109.rs rename to src/test/ui/issues/issue-28109.rs diff --git a/src/test/ui/issue-28109.stderr b/src/test/ui/issues/issue-28109.stderr similarity index 100% rename from src/test/ui/issue-28109.stderr rename to src/test/ui/issues/issue-28109.stderr diff --git a/src/test/ui/issue-28113.rs b/src/test/ui/issues/issue-28113.rs similarity index 100% rename from src/test/ui/issue-28113.rs rename to src/test/ui/issues/issue-28113.rs diff --git a/src/test/ui/issue-28113.stderr b/src/test/ui/issues/issue-28113.stderr similarity index 100% rename from src/test/ui/issue-28113.stderr rename to src/test/ui/issues/issue-28113.stderr diff --git a/src/test/ui/issue-2823.rs b/src/test/ui/issues/issue-2823.rs similarity index 100% rename from src/test/ui/issue-2823.rs rename to src/test/ui/issues/issue-2823.rs diff --git a/src/test/ui/issue-2823.stderr b/src/test/ui/issues/issue-2823.stderr similarity index 100% rename from src/test/ui/issue-2823.stderr rename to src/test/ui/issues/issue-2823.stderr diff --git a/src/test/ui/issue-28324.rs b/src/test/ui/issues/issue-28324.rs similarity index 100% rename from src/test/ui/issue-28324.rs rename to src/test/ui/issues/issue-28324.rs diff --git a/src/test/ui/issue-28324.stderr b/src/test/ui/issues/issue-28324.stderr similarity index 100% rename from src/test/ui/issue-28324.stderr rename to src/test/ui/issues/issue-28324.stderr diff --git a/src/test/ui/issue-28344.rs b/src/test/ui/issues/issue-28344.rs similarity index 100% rename from src/test/ui/issue-28344.rs rename to src/test/ui/issues/issue-28344.rs diff --git a/src/test/ui/issue-28344.stderr b/src/test/ui/issues/issue-28344.stderr similarity index 100% rename from src/test/ui/issue-28344.stderr rename to src/test/ui/issues/issue-28344.stderr diff --git a/src/test/compile-fail/issue-28388-1.rs b/src/test/ui/issues/issue-28388-1.rs similarity index 100% rename from src/test/compile-fail/issue-28388-1.rs rename to src/test/ui/issues/issue-28388-1.rs diff --git a/src/test/ui/issues/issue-28388-1.stderr b/src/test/ui/issues/issue-28388-1.stderr new file mode 100644 index 0000000000000..9f4b6cb56e727 --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-28388-2.rs similarity index 100% rename from src/test/compile-fail/issue-28388-2.rs rename to src/test/ui/issues/issue-28388-2.rs diff --git a/src/test/ui/issues/issue-28388-2.stderr b/src/test/ui/issues/issue-28388-2.stderr new file mode 100644 index 0000000000000..7809934942c26 --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-28388-3.rs similarity index 100% rename from src/test/compile-fail/issue-28388-3.rs rename to src/test/ui/issues/issue-28388-3.rs diff --git a/src/test/ui/issues/issue-28388-3.stderr b/src/test/ui/issues/issue-28388-3.stderr new file mode 100644 index 0000000000000..653fdb5a4d43a --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-28433.rs b/src/test/ui/issues/issue-28433.rs similarity index 100% rename from src/test/ui/issue-28433.rs rename to src/test/ui/issues/issue-28433.rs diff --git a/src/test/ui/issue-28433.stderr b/src/test/ui/issues/issue-28433.stderr similarity index 100% rename from src/test/ui/issue-28433.stderr rename to src/test/ui/issues/issue-28433.stderr diff --git a/src/test/ui/issue-28472.rs b/src/test/ui/issues/issue-28472.rs similarity index 100% rename from src/test/ui/issue-28472.rs rename to src/test/ui/issues/issue-28472.rs diff --git a/src/test/ui/issue-28472.stderr b/src/test/ui/issues/issue-28472.stderr similarity index 100% rename from src/test/ui/issue-28472.stderr rename to src/test/ui/issues/issue-28472.stderr diff --git a/src/test/ui/issue-2848.rs b/src/test/ui/issues/issue-2848.rs similarity index 100% rename from src/test/ui/issue-2848.rs rename to src/test/ui/issues/issue-2848.rs diff --git a/src/test/ui/issue-2848.stderr b/src/test/ui/issues/issue-2848.stderr similarity index 100% rename from src/test/ui/issue-2848.stderr rename to src/test/ui/issues/issue-2848.stderr diff --git a/src/test/ui/issue-2849.rs b/src/test/ui/issues/issue-2849.rs similarity index 100% rename from src/test/ui/issue-2849.rs rename to src/test/ui/issues/issue-2849.rs diff --git a/src/test/ui/issue-2849.stderr b/src/test/ui/issues/issue-2849.stderr similarity index 100% rename from src/test/ui/issue-2849.stderr rename to src/test/ui/issues/issue-2849.stderr diff --git a/src/test/ui/issue-28568.rs b/src/test/ui/issues/issue-28568.rs similarity index 100% rename from src/test/ui/issue-28568.rs rename to src/test/ui/issues/issue-28568.rs diff --git a/src/test/ui/issue-28568.stderr b/src/test/ui/issues/issue-28568.stderr similarity index 100% rename from src/test/ui/issue-28568.stderr rename to src/test/ui/issues/issue-28568.stderr diff --git a/src/test/ui/issue-28576.rs b/src/test/ui/issues/issue-28576.rs similarity index 100% rename from src/test/ui/issue-28576.rs rename to src/test/ui/issues/issue-28576.rs diff --git a/src/test/ui/issue-28576.stderr b/src/test/ui/issues/issue-28576.stderr similarity index 100% rename from src/test/ui/issue-28576.stderr rename to src/test/ui/issues/issue-28576.stderr diff --git a/src/test/ui/issue-28586.rs b/src/test/ui/issues/issue-28586.rs similarity index 100% rename from src/test/ui/issue-28586.rs rename to src/test/ui/issues/issue-28586.rs diff --git a/src/test/ui/issue-28586.stderr b/src/test/ui/issues/issue-28586.stderr similarity index 100% rename from src/test/ui/issue-28586.stderr rename to src/test/ui/issues/issue-28586.stderr diff --git a/src/test/compile-fail/issue-28625.rs b/src/test/ui/issues/issue-28625.rs similarity index 94% rename from src/test/compile-fail/issue-28625.rs rename to src/test/ui/issues/issue-28625.rs index dc9155ed66c6e..273629a90fcc3 100644 --- a/src/test/compile-fail/issue-28625.rs +++ b/src/test/ui/issues/issue-28625.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test "\d+ bits" -> "N bits" + trait Bar { type Bar; } diff --git a/src/test/ui/issues/issue-28625.stderr b/src/test/ui/issues/issue-28625.stderr new file mode 100644 index 0000000000000..22f8db4d3870f --- /dev/null +++ b/src/test/ui/issues/issue-28625.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/issue-28625.rs:22:14 + | +LL | unsafe { std::mem::transmute(a) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^^^^^^^^^^^ + | + = note: source type: &ArrayPeano (N bits) + = note: target type: &[T] (N bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/ui/issue-28776.rs b/src/test/ui/issues/issue-28776.rs similarity index 100% rename from src/test/ui/issue-28776.rs rename to src/test/ui/issues/issue-28776.rs diff --git a/src/test/ui/issue-28776.stderr b/src/test/ui/issues/issue-28776.stderr similarity index 100% rename from src/test/ui/issue-28776.stderr rename to src/test/ui/issues/issue-28776.stderr diff --git a/src/test/ui/issue-28837.rs b/src/test/ui/issues/issue-28837.rs similarity index 100% rename from src/test/ui/issue-28837.rs rename to src/test/ui/issues/issue-28837.rs diff --git a/src/test/ui/issue-28837.stderr b/src/test/ui/issues/issue-28837.stderr similarity index 100% rename from src/test/ui/issue-28837.stderr rename to src/test/ui/issues/issue-28837.stderr diff --git a/src/test/compile-fail/issue-28848.rs b/src/test/ui/issues/issue-28848.rs similarity index 96% rename from src/test/compile-fail/issue-28848.rs rename to src/test/ui/issues/issue-28848.rs index 1a06d59f0b191..c13fd5fa71669 100644 --- a/src/test/compile-fail/issue-28848.rs +++ b/src/test/ui/issues/issue-28848.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + struct Foo<'a, 'b: 'a>(&'a &'b ()); impl<'a, 'b> Foo<'a, 'b> { diff --git a/src/test/ui/issues/issue-28848.stderr b/src/test/ui/issues/issue-28848.stderr new file mode 100644 index 0000000000000..dadcff226f53b --- /dev/null +++ b/src/test/ui/issues/issue-28848.stderr @@ -0,0 +1,20 @@ +error[E0478]: lifetime bound not satisfied + --> $DIR/issue-28848.rs:22: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 21:16 + --> $DIR/issue-28848.rs:21: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 21:12 + --> $DIR/issue-28848.rs:21: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/ui/issue-28971.rs b/src/test/ui/issues/issue-28971.rs similarity index 100% rename from src/test/ui/issue-28971.rs rename to src/test/ui/issues/issue-28971.rs diff --git a/src/test/ui/issue-28971.stderr b/src/test/ui/issues/issue-28971.stderr similarity index 100% rename from src/test/ui/issue-28971.stderr rename to src/test/ui/issues/issue-28971.stderr diff --git a/src/test/ui/issue-28992-empty.rs b/src/test/ui/issues/issue-28992-empty.rs similarity index 100% rename from src/test/ui/issue-28992-empty.rs rename to src/test/ui/issues/issue-28992-empty.rs diff --git a/src/test/ui/issue-28992-empty.stderr b/src/test/ui/issues/issue-28992-empty.stderr similarity index 100% rename from src/test/ui/issue-28992-empty.stderr rename to src/test/ui/issues/issue-28992-empty.stderr diff --git a/src/test/ui/issue-29084.rs b/src/test/ui/issues/issue-29084.rs similarity index 100% rename from src/test/ui/issue-29084.rs rename to src/test/ui/issues/issue-29084.rs diff --git a/src/test/ui/issue-29084.stderr b/src/test/ui/issues/issue-29084.stderr similarity index 100% rename from src/test/ui/issue-29084.stderr rename to src/test/ui/issues/issue-29084.stderr diff --git a/src/test/ui/issue-29124.rs b/src/test/ui/issues/issue-29124.rs similarity index 100% rename from src/test/ui/issue-29124.rs rename to src/test/ui/issues/issue-29124.rs diff --git a/src/test/ui/issue-29124.stderr b/src/test/ui/issues/issue-29124.stderr similarity index 100% rename from src/test/ui/issue-29124.stderr rename to src/test/ui/issues/issue-29124.stderr diff --git a/src/test/ui/issue-29147.rs b/src/test/ui/issues/issue-29147.rs similarity index 100% rename from src/test/ui/issue-29147.rs rename to src/test/ui/issues/issue-29147.rs diff --git a/src/test/ui/issue-29147.stderr b/src/test/ui/issues/issue-29147.stderr similarity index 100% rename from src/test/ui/issue-29147.stderr rename to src/test/ui/issues/issue-29147.stderr diff --git a/src/test/ui/issue-29161.rs b/src/test/ui/issues/issue-29161.rs similarity index 100% rename from src/test/ui/issue-29161.rs rename to src/test/ui/issues/issue-29161.rs diff --git a/src/test/ui/issue-29161.stderr b/src/test/ui/issues/issue-29161.stderr similarity index 100% rename from src/test/ui/issue-29161.stderr rename to src/test/ui/issues/issue-29161.stderr diff --git a/src/test/compile-fail/issue-29181.rs b/src/test/ui/issues/issue-29181.rs similarity index 100% rename from src/test/compile-fail/issue-29181.rs rename to src/test/ui/issues/issue-29181.rs diff --git a/src/test/ui/issues/issue-29181.stderr b/src/test/ui/issues/issue-29181.stderr new file mode 100644 index 0000000000000..5dda78489266b --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-29184.rs b/src/test/ui/issues/issue-29184.rs similarity index 100% rename from src/test/ui/issue-29184.rs rename to src/test/ui/issues/issue-29184.rs diff --git a/src/test/ui/issue-29184.stderr b/src/test/ui/issues/issue-29184.stderr similarity index 100% rename from src/test/ui/issue-29184.stderr rename to src/test/ui/issues/issue-29184.stderr diff --git a/src/test/ui/issue-2937.rs b/src/test/ui/issues/issue-2937.rs similarity index 100% rename from src/test/ui/issue-2937.rs rename to src/test/ui/issues/issue-2937.rs diff --git a/src/test/ui/issue-2937.stderr b/src/test/ui/issues/issue-2937.stderr similarity index 100% rename from src/test/ui/issue-2937.stderr rename to src/test/ui/issues/issue-2937.stderr diff --git a/src/test/ui/issue-2951.rs b/src/test/ui/issues/issue-2951.rs similarity index 100% rename from src/test/ui/issue-2951.rs rename to src/test/ui/issues/issue-2951.rs diff --git a/src/test/ui/issue-2951.stderr b/src/test/ui/issues/issue-2951.stderr similarity index 100% rename from src/test/ui/issue-2951.stderr rename to src/test/ui/issues/issue-2951.stderr diff --git a/src/test/ui/issue-29723.rs b/src/test/ui/issues/issue-29723.rs similarity index 100% rename from src/test/ui/issue-29723.rs rename to src/test/ui/issues/issue-29723.rs diff --git a/src/test/ui/issue-29723.stderr b/src/test/ui/issues/issue-29723.stderr similarity index 100% rename from src/test/ui/issue-29723.stderr rename to src/test/ui/issues/issue-29723.stderr diff --git a/src/test/ui/issue-29857.rs b/src/test/ui/issues/issue-29857.rs similarity index 100% rename from src/test/ui/issue-29857.rs rename to src/test/ui/issues/issue-29857.rs diff --git a/src/test/ui/issue-29857.stderr b/src/test/ui/issues/issue-29857.stderr similarity index 100% rename from src/test/ui/issue-29857.stderr rename to src/test/ui/issues/issue-29857.stderr diff --git a/src/test/ui/issue-29861.rs b/src/test/ui/issues/issue-29861.rs similarity index 100% rename from src/test/ui/issue-29861.rs rename to src/test/ui/issues/issue-29861.rs diff --git a/src/test/ui/issue-29861.stderr b/src/test/ui/issues/issue-29861.stderr similarity index 100% rename from src/test/ui/issue-29861.stderr rename to src/test/ui/issues/issue-29861.stderr diff --git a/src/test/ui/issue-2995.rs b/src/test/ui/issues/issue-2995.rs similarity index 100% rename from src/test/ui/issue-2995.rs rename to src/test/ui/issues/issue-2995.rs diff --git a/src/test/ui/issue-2995.stderr b/src/test/ui/issues/issue-2995.stderr similarity index 100% rename from src/test/ui/issue-2995.stderr rename to src/test/ui/issues/issue-2995.stderr diff --git a/src/test/ui/issue-30007.rs b/src/test/ui/issues/issue-30007.rs similarity index 100% rename from src/test/ui/issue-30007.rs rename to src/test/ui/issues/issue-30007.rs diff --git a/src/test/ui/issue-30007.stderr b/src/test/ui/issues/issue-30007.stderr similarity index 100% rename from src/test/ui/issue-30007.stderr rename to src/test/ui/issues/issue-30007.stderr diff --git a/src/test/ui/issue-30079.rs b/src/test/ui/issues/issue-30079.rs similarity index 100% rename from src/test/ui/issue-30079.rs rename to src/test/ui/issues/issue-30079.rs diff --git a/src/test/ui/issue-30079.stderr b/src/test/ui/issues/issue-30079.stderr similarity index 100% rename from src/test/ui/issue-30079.stderr rename to src/test/ui/issues/issue-30079.stderr diff --git a/src/test/ui/issue-3008-1.rs b/src/test/ui/issues/issue-3008-1.rs similarity index 100% rename from src/test/ui/issue-3008-1.rs rename to src/test/ui/issues/issue-3008-1.rs diff --git a/src/test/ui/issue-3008-1.stderr b/src/test/ui/issues/issue-3008-1.stderr similarity index 100% rename from src/test/ui/issue-3008-1.stderr rename to src/test/ui/issues/issue-3008-1.stderr diff --git a/src/test/ui/issue-3008-2.rs b/src/test/ui/issues/issue-3008-2.rs similarity index 100% rename from src/test/ui/issue-3008-2.rs rename to src/test/ui/issues/issue-3008-2.rs diff --git a/src/test/ui/issue-3008-2.stderr b/src/test/ui/issues/issue-3008-2.stderr similarity index 100% rename from src/test/ui/issue-3008-2.stderr rename to src/test/ui/issues/issue-3008-2.stderr diff --git a/src/test/ui/issue-3008-3.rs b/src/test/ui/issues/issue-3008-3.rs similarity index 100% rename from src/test/ui/issue-3008-3.rs rename to src/test/ui/issues/issue-3008-3.rs diff --git a/src/test/ui/issue-3008-3.stderr b/src/test/ui/issues/issue-3008-3.stderr similarity index 100% rename from src/test/ui/issue-3008-3.stderr rename to src/test/ui/issues/issue-3008-3.stderr diff --git a/src/test/compile-fail/issue-30123.rs b/src/test/ui/issues/issue-30123.rs similarity index 100% rename from src/test/compile-fail/issue-30123.rs rename to src/test/ui/issues/issue-30123.rs diff --git a/src/test/ui/issues/issue-30123.stderr b/src/test/ui/issues/issue-30123.stderr new file mode 100644 index 0000000000000..094c962de29ec --- /dev/null +++ b/src/test/ui/issues/issue-30123.stderr @@ -0,0 +1,9 @@ +error[E0599]: no function or associated item named `new_undirected` found for type `issue_30123_aux::Graph` in the current scope + --> $DIR/issue-30123.rs:17:14 + | +LL | let ug = Graph::::new_undirected(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `issue_30123_aux::Graph` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0599`. diff --git a/src/test/ui/issue-3021-b.rs b/src/test/ui/issues/issue-3021-b.rs similarity index 100% rename from src/test/ui/issue-3021-b.rs rename to src/test/ui/issues/issue-3021-b.rs diff --git a/src/test/ui/issue-3021-b.stderr b/src/test/ui/issues/issue-3021-b.stderr similarity index 100% rename from src/test/ui/issue-3021-b.stderr rename to src/test/ui/issues/issue-3021-b.stderr diff --git a/src/test/ui/issue-3021-c.rs b/src/test/ui/issues/issue-3021-c.rs similarity index 100% rename from src/test/ui/issue-3021-c.rs rename to src/test/ui/issues/issue-3021-c.rs diff --git a/src/test/ui/issue-3021-c.stderr b/src/test/ui/issues/issue-3021-c.stderr similarity index 100% rename from src/test/ui/issue-3021-c.stderr rename to src/test/ui/issues/issue-3021-c.stderr diff --git a/src/test/ui/issue-3021-d.rs b/src/test/ui/issues/issue-3021-d.rs similarity index 100% rename from src/test/ui/issue-3021-d.rs rename to src/test/ui/issues/issue-3021-d.rs diff --git a/src/test/ui/issue-3021-d.stderr b/src/test/ui/issues/issue-3021-d.stderr similarity index 100% rename from src/test/ui/issue-3021-d.stderr rename to src/test/ui/issues/issue-3021-d.stderr diff --git a/src/test/ui/issue-3021.rs b/src/test/ui/issues/issue-3021.rs similarity index 100% rename from src/test/ui/issue-3021.rs rename to src/test/ui/issues/issue-3021.rs diff --git a/src/test/ui/issue-3021.stderr b/src/test/ui/issues/issue-3021.stderr similarity index 100% rename from src/test/ui/issue-3021.stderr rename to src/test/ui/issues/issue-3021.stderr diff --git a/src/test/ui/issue-30225.rs b/src/test/ui/issues/issue-30225.rs similarity index 100% rename from src/test/ui/issue-30225.rs rename to src/test/ui/issues/issue-30225.rs diff --git a/src/test/ui/issue-30225.stderr b/src/test/ui/issues/issue-30225.stderr similarity index 100% rename from src/test/ui/issue-30225.stderr rename to src/test/ui/issues/issue-30225.stderr diff --git a/src/test/ui/issue-30236.rs b/src/test/ui/issues/issue-30236.rs similarity index 100% rename from src/test/ui/issue-30236.rs rename to src/test/ui/issues/issue-30236.rs diff --git a/src/test/ui/issue-30236.stderr b/src/test/ui/issues/issue-30236.stderr similarity index 100% rename from src/test/ui/issue-30236.stderr rename to src/test/ui/issues/issue-30236.stderr diff --git a/src/test/ui/issue-30240-b.rs b/src/test/ui/issues/issue-30240-b.rs similarity index 100% rename from src/test/ui/issue-30240-b.rs rename to src/test/ui/issues/issue-30240-b.rs diff --git a/src/test/ui/issue-30240-b.stderr b/src/test/ui/issues/issue-30240-b.stderr similarity index 100% rename from src/test/ui/issue-30240-b.stderr rename to src/test/ui/issues/issue-30240-b.stderr diff --git a/src/test/ui/issue-30240.rs b/src/test/ui/issues/issue-30240.rs similarity index 100% rename from src/test/ui/issue-30240.rs rename to src/test/ui/issues/issue-30240.rs diff --git a/src/test/ui/issue-30240.stderr b/src/test/ui/issues/issue-30240.stderr similarity index 100% rename from src/test/ui/issue-30240.stderr rename to src/test/ui/issues/issue-30240.stderr diff --git a/src/test/ui/issue-30255.rs b/src/test/ui/issues/issue-30255.rs similarity index 100% rename from src/test/ui/issue-30255.rs rename to src/test/ui/issues/issue-30255.rs diff --git a/src/test/ui/issue-30255.stderr b/src/test/ui/issues/issue-30255.stderr similarity index 100% rename from src/test/ui/issue-30255.stderr rename to src/test/ui/issues/issue-30255.stderr diff --git a/src/test/ui/issue-30302.rs b/src/test/ui/issues/issue-30302.rs similarity index 100% rename from src/test/ui/issue-30302.rs rename to src/test/ui/issues/issue-30302.rs diff --git a/src/test/ui/issue-30302.stderr b/src/test/ui/issues/issue-30302.stderr similarity index 100% rename from src/test/ui/issue-30302.stderr rename to src/test/ui/issues/issue-30302.stderr diff --git a/src/test/ui/issue-30355.nll.stderr b/src/test/ui/issues/issue-30355.nll.stderr similarity index 100% rename from src/test/ui/issue-30355.nll.stderr rename to src/test/ui/issues/issue-30355.nll.stderr diff --git a/src/test/ui/issue-30355.rs b/src/test/ui/issues/issue-30355.rs similarity index 100% rename from src/test/ui/issue-30355.rs rename to src/test/ui/issues/issue-30355.rs diff --git a/src/test/ui/issue-30355.stderr b/src/test/ui/issues/issue-30355.stderr similarity index 100% rename from src/test/ui/issue-30355.stderr rename to src/test/ui/issues/issue-30355.stderr diff --git a/src/test/ui/issue-3038.rs b/src/test/ui/issues/issue-3038.rs similarity index 100% rename from src/test/ui/issue-3038.rs rename to src/test/ui/issues/issue-3038.rs diff --git a/src/test/ui/issue-3038.stderr b/src/test/ui/issues/issue-3038.stderr similarity index 100% rename from src/test/ui/issue-3038.stderr rename to src/test/ui/issues/issue-3038.stderr diff --git a/src/test/ui/issue-30438-a.nll.stderr b/src/test/ui/issues/issue-30438-a.nll.stderr similarity index 100% rename from src/test/ui/issue-30438-a.nll.stderr rename to src/test/ui/issues/issue-30438-a.nll.stderr diff --git a/src/test/ui/issue-30438-a.rs b/src/test/ui/issues/issue-30438-a.rs similarity index 100% rename from src/test/ui/issue-30438-a.rs rename to src/test/ui/issues/issue-30438-a.rs diff --git a/src/test/ui/issue-30438-a.stderr b/src/test/ui/issues/issue-30438-a.stderr similarity index 100% rename from src/test/ui/issue-30438-a.stderr rename to src/test/ui/issues/issue-30438-a.stderr diff --git a/src/test/ui/issue-30438-b.rs b/src/test/ui/issues/issue-30438-b.rs similarity index 100% rename from src/test/ui/issue-30438-b.rs rename to src/test/ui/issues/issue-30438-b.rs diff --git a/src/test/ui/issue-30438-b.stderr b/src/test/ui/issues/issue-30438-b.stderr similarity index 100% rename from src/test/ui/issue-30438-b.stderr rename to src/test/ui/issues/issue-30438-b.stderr diff --git a/src/test/ui/issue-30438-c.nll.stderr b/src/test/ui/issues/issue-30438-c.nll.stderr similarity index 100% rename from src/test/ui/issue-30438-c.nll.stderr rename to src/test/ui/issues/issue-30438-c.nll.stderr diff --git a/src/test/ui/issue-30438-c.rs b/src/test/ui/issues/issue-30438-c.rs similarity index 100% rename from src/test/ui/issue-30438-c.rs rename to src/test/ui/issues/issue-30438-c.rs diff --git a/src/test/ui/issue-30438-c.stderr b/src/test/ui/issues/issue-30438-c.stderr similarity index 100% rename from src/test/ui/issue-30438-c.stderr rename to src/test/ui/issues/issue-30438-c.stderr diff --git a/src/test/ui/issue-3044.rs b/src/test/ui/issues/issue-3044.rs similarity index 100% rename from src/test/ui/issue-3044.rs rename to src/test/ui/issues/issue-3044.rs diff --git a/src/test/ui/issue-3044.stderr b/src/test/ui/issues/issue-3044.stderr similarity index 100% rename from src/test/ui/issue-3044.stderr rename to src/test/ui/issues/issue-3044.stderr diff --git a/src/test/compile-fail/issue-30535.rs b/src/test/ui/issues/issue-30535.rs similarity index 100% rename from src/test/compile-fail/issue-30535.rs rename to src/test/ui/issues/issue-30535.rs diff --git a/src/test/ui/issues/issue-30535.stderr b/src/test/ui/issues/issue-30535.stderr new file mode 100644 index 0000000000000..c3838fdb9cf07 --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-30560.rs b/src/test/ui/issues/issue-30560.rs similarity index 100% rename from src/test/ui/issue-30560.rs rename to src/test/ui/issues/issue-30560.rs diff --git a/src/test/ui/issue-30560.stderr b/src/test/ui/issues/issue-30560.stderr similarity index 100% rename from src/test/ui/issue-30560.stderr rename to src/test/ui/issues/issue-30560.stderr diff --git a/src/test/ui/issue-30589.rs b/src/test/ui/issues/issue-30589.rs similarity index 100% rename from src/test/ui/issue-30589.rs rename to src/test/ui/issues/issue-30589.rs diff --git a/src/test/ui/issue-30589.stderr b/src/test/ui/issues/issue-30589.stderr similarity index 100% rename from src/test/ui/issue-30589.stderr rename to src/test/ui/issues/issue-30589.stderr diff --git a/src/test/ui/issue-30730.rs b/src/test/ui/issues/issue-30730.rs similarity index 100% rename from src/test/ui/issue-30730.rs rename to src/test/ui/issues/issue-30730.rs diff --git a/src/test/ui/issue-30730.stderr b/src/test/ui/issues/issue-30730.stderr similarity index 100% rename from src/test/ui/issue-30730.stderr rename to src/test/ui/issues/issue-30730.stderr diff --git a/src/test/ui/issue-3080.rs b/src/test/ui/issues/issue-3080.rs similarity index 100% rename from src/test/ui/issue-3080.rs rename to src/test/ui/issues/issue-3080.rs diff --git a/src/test/ui/issue-3080.stderr b/src/test/ui/issues/issue-3080.stderr similarity index 100% rename from src/test/ui/issue-3080.stderr rename to src/test/ui/issues/issue-3080.stderr diff --git a/src/test/ui/issue-3096-1.rs b/src/test/ui/issues/issue-3096-1.rs similarity index 100% rename from src/test/ui/issue-3096-1.rs rename to src/test/ui/issues/issue-3096-1.rs diff --git a/src/test/ui/issue-3096-1.stderr b/src/test/ui/issues/issue-3096-1.stderr similarity index 100% rename from src/test/ui/issue-3096-1.stderr rename to src/test/ui/issues/issue-3096-1.stderr diff --git a/src/test/ui/issue-3096-2.rs b/src/test/ui/issues/issue-3096-2.rs similarity index 100% rename from src/test/ui/issue-3096-2.rs rename to src/test/ui/issues/issue-3096-2.rs diff --git a/src/test/ui/issue-3096-2.stderr b/src/test/ui/issues/issue-3096-2.stderr similarity index 100% rename from src/test/ui/issue-3096-2.stderr rename to src/test/ui/issues/issue-3096-2.stderr diff --git a/src/test/ui/issue-3099-a.rs b/src/test/ui/issues/issue-3099-a.rs similarity index 100% rename from src/test/ui/issue-3099-a.rs rename to src/test/ui/issues/issue-3099-a.rs diff --git a/src/test/ui/issue-3099-a.stderr b/src/test/ui/issues/issue-3099-a.stderr similarity index 100% rename from src/test/ui/issue-3099-a.stderr rename to src/test/ui/issues/issue-3099-a.stderr diff --git a/src/test/ui/issue-3099-b.rs b/src/test/ui/issues/issue-3099-b.rs similarity index 100% rename from src/test/ui/issue-3099-b.rs rename to src/test/ui/issues/issue-3099-b.rs diff --git a/src/test/ui/issue-3099-b.stderr b/src/test/ui/issues/issue-3099-b.stderr similarity index 100% rename from src/test/ui/issue-3099-b.stderr rename to src/test/ui/issues/issue-3099-b.stderr diff --git a/src/test/ui/issue-3099.rs b/src/test/ui/issues/issue-3099.rs similarity index 100% rename from src/test/ui/issue-3099.rs rename to src/test/ui/issues/issue-3099.rs diff --git a/src/test/ui/issue-3099.stderr b/src/test/ui/issues/issue-3099.stderr similarity index 100% rename from src/test/ui/issue-3099.stderr rename to src/test/ui/issues/issue-3099.stderr diff --git a/src/test/ui/issue-31011.rs b/src/test/ui/issues/issue-31011.rs similarity index 100% rename from src/test/ui/issue-31011.rs rename to src/test/ui/issues/issue-31011.rs diff --git a/src/test/ui/issue-31011.stderr b/src/test/ui/issues/issue-31011.stderr similarity index 100% rename from src/test/ui/issue-31011.stderr rename to src/test/ui/issues/issue-31011.stderr diff --git a/src/test/ui/issue-31109.rs b/src/test/ui/issues/issue-31109.rs similarity index 100% rename from src/test/ui/issue-31109.rs rename to src/test/ui/issues/issue-31109.rs diff --git a/src/test/ui/issue-31109.stderr b/src/test/ui/issues/issue-31109.stderr similarity index 100% rename from src/test/ui/issue-31109.stderr rename to src/test/ui/issues/issue-31109.stderr diff --git a/src/test/ui/issue-31173.rs b/src/test/ui/issues/issue-31173.rs similarity index 100% rename from src/test/ui/issue-31173.rs rename to src/test/ui/issues/issue-31173.rs diff --git a/src/test/ui/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr similarity index 100% rename from src/test/ui/issue-31173.stderr rename to src/test/ui/issues/issue-31173.stderr diff --git a/src/test/ui/issue-31212.rs b/src/test/ui/issues/issue-31212.rs similarity index 100% rename from src/test/ui/issue-31212.rs rename to src/test/ui/issues/issue-31212.rs diff --git a/src/test/ui/issue-31212.stderr b/src/test/ui/issues/issue-31212.stderr similarity index 100% rename from src/test/ui/issue-31212.stderr rename to src/test/ui/issues/issue-31212.stderr diff --git a/src/test/ui/issue-31221.rs b/src/test/ui/issues/issue-31221.rs similarity index 100% rename from src/test/ui/issue-31221.rs rename to src/test/ui/issues/issue-31221.rs diff --git a/src/test/ui/issue-31221.stderr b/src/test/ui/issues/issue-31221.stderr similarity index 100% rename from src/test/ui/issue-31221.stderr rename to src/test/ui/issues/issue-31221.stderr diff --git a/src/test/ui/issue-31495.rs b/src/test/ui/issues/issue-31495.rs similarity index 100% rename from src/test/ui/issue-31495.rs rename to src/test/ui/issues/issue-31495.rs diff --git a/src/test/ui/issue-31511.rs b/src/test/ui/issues/issue-31511.rs similarity index 100% rename from src/test/ui/issue-31511.rs rename to src/test/ui/issues/issue-31511.rs diff --git a/src/test/ui/issue-31511.stderr b/src/test/ui/issues/issue-31511.stderr similarity index 100% rename from src/test/ui/issue-31511.stderr rename to src/test/ui/issues/issue-31511.stderr diff --git a/src/test/ui/issue-3154.nll.stderr b/src/test/ui/issues/issue-3154.nll.stderr similarity index 100% rename from src/test/ui/issue-3154.nll.stderr rename to src/test/ui/issues/issue-3154.nll.stderr diff --git a/src/test/ui/issue-3154.rs b/src/test/ui/issues/issue-3154.rs similarity index 100% rename from src/test/ui/issue-3154.rs rename to src/test/ui/issues/issue-3154.rs diff --git a/src/test/ui/issue-3154.stderr b/src/test/ui/issues/issue-3154.stderr similarity index 100% rename from src/test/ui/issue-3154.stderr rename to src/test/ui/issues/issue-3154.stderr diff --git a/src/test/ui/issue-31561.rs b/src/test/ui/issues/issue-31561.rs similarity index 100% rename from src/test/ui/issue-31561.rs rename to src/test/ui/issues/issue-31561.rs diff --git a/src/test/ui/issue-31561.stderr b/src/test/ui/issues/issue-31561.stderr similarity index 100% rename from src/test/ui/issue-31561.stderr rename to src/test/ui/issues/issue-31561.stderr diff --git a/src/test/ui/issue-31769.rs b/src/test/ui/issues/issue-31769.rs similarity index 100% rename from src/test/ui/issue-31769.rs rename to src/test/ui/issues/issue-31769.rs diff --git a/src/test/ui/issue-31769.stderr b/src/test/ui/issues/issue-31769.stderr similarity index 100% rename from src/test/ui/issue-31769.stderr rename to src/test/ui/issues/issue-31769.stderr diff --git a/src/test/ui/issue-31804.rs b/src/test/ui/issues/issue-31804.rs similarity index 100% rename from src/test/ui/issue-31804.rs rename to src/test/ui/issues/issue-31804.rs diff --git a/src/test/ui/issue-31804.stderr b/src/test/ui/issues/issue-31804.stderr similarity index 100% rename from src/test/ui/issue-31804.stderr rename to src/test/ui/issues/issue-31804.stderr diff --git a/src/test/ui/issue-31845.rs b/src/test/ui/issues/issue-31845.rs similarity index 100% rename from src/test/ui/issue-31845.rs rename to src/test/ui/issues/issue-31845.rs diff --git a/src/test/ui/issue-31845.stderr b/src/test/ui/issues/issue-31845.stderr similarity index 100% rename from src/test/ui/issue-31845.stderr rename to src/test/ui/issues/issue-31845.stderr diff --git a/src/test/ui/issue-31910.rs b/src/test/ui/issues/issue-31910.rs similarity index 100% rename from src/test/ui/issue-31910.rs rename to src/test/ui/issues/issue-31910.rs diff --git a/src/test/ui/issue-31910.stderr b/src/test/ui/issues/issue-31910.stderr similarity index 100% rename from src/test/ui/issue-31910.stderr rename to src/test/ui/issues/issue-31910.stderr diff --git a/src/test/ui/issue-31924-non-snake-ffi.rs b/src/test/ui/issues/issue-31924-non-snake-ffi.rs similarity index 100% rename from src/test/ui/issue-31924-non-snake-ffi.rs rename to src/test/ui/issues/issue-31924-non-snake-ffi.rs diff --git a/src/test/ui/issue-31924-non-snake-ffi.stderr b/src/test/ui/issues/issue-31924-non-snake-ffi.stderr similarity index 100% rename from src/test/ui/issue-31924-non-snake-ffi.stderr rename to src/test/ui/issues/issue-31924-non-snake-ffi.stderr diff --git a/src/test/ui/issue-32004.rs b/src/test/ui/issues/issue-32004.rs similarity index 100% rename from src/test/ui/issue-32004.rs rename to src/test/ui/issues/issue-32004.rs diff --git a/src/test/ui/issue-32004.stderr b/src/test/ui/issues/issue-32004.stderr similarity index 100% rename from src/test/ui/issue-32004.stderr rename to src/test/ui/issues/issue-32004.stderr diff --git a/src/test/ui/issue-32086.rs b/src/test/ui/issues/issue-32086.rs similarity index 100% rename from src/test/ui/issue-32086.rs rename to src/test/ui/issues/issue-32086.rs diff --git a/src/test/ui/issue-32086.stderr b/src/test/ui/issues/issue-32086.stderr similarity index 100% rename from src/test/ui/issue-32086.stderr rename to src/test/ui/issues/issue-32086.stderr diff --git a/src/test/ui/issue-32119.rs b/src/test/ui/issues/issue-32119.rs similarity index 100% rename from src/test/ui/issue-32119.rs rename to src/test/ui/issues/issue-32119.rs diff --git a/src/test/ui/issue-32119.stderr b/src/test/ui/issues/issue-32119.stderr similarity index 100% rename from src/test/ui/issue-32119.stderr rename to src/test/ui/issues/issue-32119.stderr diff --git a/src/test/ui/issue-3214.rs b/src/test/ui/issues/issue-3214.rs similarity index 100% rename from src/test/ui/issue-3214.rs rename to src/test/ui/issues/issue-3214.rs diff --git a/src/test/ui/issue-3214.stderr b/src/test/ui/issues/issue-3214.stderr similarity index 100% rename from src/test/ui/issue-3214.stderr rename to src/test/ui/issues/issue-3214.stderr diff --git a/src/test/ui/issue-32201.rs b/src/test/ui/issues/issue-32201.rs similarity index 100% rename from src/test/ui/issue-32201.rs rename to src/test/ui/issues/issue-32201.rs diff --git a/src/test/ui/issue-32201.stderr b/src/test/ui/issues/issue-32201.stderr similarity index 100% rename from src/test/ui/issue-32201.stderr rename to src/test/ui/issues/issue-32201.stderr diff --git a/src/test/ui/issue-32222.rs b/src/test/ui/issues/issue-32222.rs similarity index 100% rename from src/test/ui/issue-32222.rs rename to src/test/ui/issues/issue-32222.rs diff --git a/src/test/ui/issue-32222.stderr b/src/test/ui/issues/issue-32222.stderr similarity index 100% rename from src/test/ui/issue-32222.stderr rename to src/test/ui/issues/issue-32222.stderr diff --git a/src/test/ui/issue-32323.rs b/src/test/ui/issues/issue-32323.rs similarity index 100% rename from src/test/ui/issue-32323.rs rename to src/test/ui/issues/issue-32323.rs diff --git a/src/test/ui/issue-32323.stderr b/src/test/ui/issues/issue-32323.stderr similarity index 100% rename from src/test/ui/issue-32323.stderr rename to src/test/ui/issues/issue-32323.stderr diff --git a/src/test/ui/issue-32326.rs b/src/test/ui/issues/issue-32326.rs similarity index 100% rename from src/test/ui/issue-32326.rs rename to src/test/ui/issues/issue-32326.rs diff --git a/src/test/ui/issue-32326.stderr b/src/test/ui/issues/issue-32326.stderr similarity index 100% rename from src/test/ui/issue-32326.stderr rename to src/test/ui/issues/issue-32326.stderr diff --git a/src/test/ui/issue-32354-suggest-import-rename.fixed b/src/test/ui/issues/issue-32354-suggest-import-rename.fixed similarity index 100% rename from src/test/ui/issue-32354-suggest-import-rename.fixed rename to src/test/ui/issues/issue-32354-suggest-import-rename.fixed diff --git a/src/test/ui/issue-32354-suggest-import-rename.rs b/src/test/ui/issues/issue-32354-suggest-import-rename.rs similarity index 100% rename from src/test/ui/issue-32354-suggest-import-rename.rs rename to src/test/ui/issues/issue-32354-suggest-import-rename.rs diff --git a/src/test/ui/issue-32354-suggest-import-rename.stderr b/src/test/ui/issues/issue-32354-suggest-import-rename.stderr similarity index 100% rename from src/test/ui/issue-32354-suggest-import-rename.stderr rename to src/test/ui/issues/issue-32354-suggest-import-rename.stderr diff --git a/src/test/compile-fail/issue-32377.rs b/src/test/ui/issues/issue-32377.rs similarity index 93% rename from src/test/compile-fail/issue-32377.rs rename to src/test/ui/issues/issue-32377.rs index 5091ba4ee1aa4..425dcc6b21ea2 100644 --- a/src/test/compile-fail/issue-32377.rs +++ b/src/test/ui/issues/issue-32377.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test "\d+ bits" -> "N bits" + use std::mem; use std::marker::PhantomData; diff --git a/src/test/ui/issues/issue-32377.stderr b/src/test/ui/issues/issue-32377.stderr new file mode 100644 index 0000000000000..7168a000a0207 --- /dev/null +++ b/src/test/ui/issues/issue-32377.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/issue-32377.rs:25:14 + | +LL | unsafe { mem::transmute(x) } + | ^^^^^^^^^^^^^^ + | + = note: source type: [usize; 2] (N bits) + = note: target type: Bar (N bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/ui/issue-32655.rs b/src/test/ui/issues/issue-32655.rs similarity index 100% rename from src/test/ui/issue-32655.rs rename to src/test/ui/issues/issue-32655.rs diff --git a/src/test/ui/issue-32655.stderr b/src/test/ui/issues/issue-32655.stderr similarity index 100% rename from src/test/ui/issue-32655.stderr rename to src/test/ui/issues/issue-32655.stderr diff --git a/src/test/ui/issue-32709.rs b/src/test/ui/issues/issue-32709.rs similarity index 100% rename from src/test/ui/issue-32709.rs rename to src/test/ui/issues/issue-32709.rs diff --git a/src/test/ui/issue-32709.stderr b/src/test/ui/issues/issue-32709.stderr similarity index 100% rename from src/test/ui/issue-32709.stderr rename to src/test/ui/issues/issue-32709.stderr diff --git a/src/test/ui/issue-32782.rs b/src/test/ui/issues/issue-32782.rs similarity index 100% rename from src/test/ui/issue-32782.rs rename to src/test/ui/issues/issue-32782.rs diff --git a/src/test/ui/issue-32782.stderr b/src/test/ui/issues/issue-32782.stderr similarity index 100% rename from src/test/ui/issue-32782.stderr rename to src/test/ui/issues/issue-32782.stderr diff --git a/src/test/ui/issue-32797.rs b/src/test/ui/issues/issue-32797.rs similarity index 100% rename from src/test/ui/issue-32797.rs rename to src/test/ui/issues/issue-32797.rs diff --git a/src/test/ui/issue-32797.stderr b/src/test/ui/issues/issue-32797.stderr similarity index 100% rename from src/test/ui/issue-32797.stderr rename to src/test/ui/issues/issue-32797.stderr diff --git a/src/test/ui/issue-32829.rs b/src/test/ui/issues/issue-32829.rs similarity index 100% rename from src/test/ui/issue-32829.rs rename to src/test/ui/issues/issue-32829.rs diff --git a/src/test/ui/issue-32829.stderr b/src/test/ui/issues/issue-32829.stderr similarity index 100% rename from src/test/ui/issue-32829.stderr rename to src/test/ui/issues/issue-32829.stderr diff --git a/src/test/ui/issue-32833.rs b/src/test/ui/issues/issue-32833.rs similarity index 100% rename from src/test/ui/issue-32833.rs rename to src/test/ui/issues/issue-32833.rs diff --git a/src/test/ui/issue-32833.stderr b/src/test/ui/issues/issue-32833.stderr similarity index 100% rename from src/test/ui/issue-32833.stderr rename to src/test/ui/issues/issue-32833.stderr diff --git a/src/test/ui/issue-32922.rs b/src/test/ui/issues/issue-32922.rs similarity index 100% rename from src/test/ui/issue-32922.rs rename to src/test/ui/issues/issue-32922.rs diff --git a/src/test/ui/issue-32922.stderr b/src/test/ui/issues/issue-32922.stderr similarity index 100% rename from src/test/ui/issue-32922.stderr rename to src/test/ui/issues/issue-32922.stderr diff --git a/src/test/ui/issue-32950.rs b/src/test/ui/issues/issue-32950.rs similarity index 100% rename from src/test/ui/issue-32950.rs rename to src/test/ui/issues/issue-32950.rs diff --git a/src/test/ui/issue-32950.stderr b/src/test/ui/issues/issue-32950.stderr similarity index 100% rename from src/test/ui/issue-32950.stderr rename to src/test/ui/issues/issue-32950.stderr diff --git a/src/test/ui/issue-32963.rs b/src/test/ui/issues/issue-32963.rs similarity index 100% rename from src/test/ui/issue-32963.rs rename to src/test/ui/issues/issue-32963.rs diff --git a/src/test/ui/issue-32963.stderr b/src/test/ui/issues/issue-32963.stderr similarity index 100% rename from src/test/ui/issue-32963.stderr rename to src/test/ui/issues/issue-32963.stderr diff --git a/src/test/ui/issue-32995-2.rs b/src/test/ui/issues/issue-32995-2.rs similarity index 100% rename from src/test/ui/issue-32995-2.rs rename to src/test/ui/issues/issue-32995-2.rs diff --git a/src/test/ui/issue-32995-2.stderr b/src/test/ui/issues/issue-32995-2.stderr similarity index 100% rename from src/test/ui/issue-32995-2.stderr rename to src/test/ui/issues/issue-32995-2.stderr diff --git a/src/test/ui/issue-32995.rs b/src/test/ui/issues/issue-32995.rs similarity index 100% rename from src/test/ui/issue-32995.rs rename to src/test/ui/issues/issue-32995.rs diff --git a/src/test/ui/issue-32995.stderr b/src/test/ui/issues/issue-32995.stderr similarity index 100% rename from src/test/ui/issue-32995.stderr rename to src/test/ui/issues/issue-32995.stderr diff --git a/src/test/ui/issue-33241.rs b/src/test/ui/issues/issue-33241.rs similarity index 100% rename from src/test/ui/issue-33241.rs rename to src/test/ui/issues/issue-33241.rs diff --git a/src/test/ui/issue-33241.stderr b/src/test/ui/issues/issue-33241.stderr similarity index 100% rename from src/test/ui/issue-33241.stderr rename to src/test/ui/issues/issue-33241.stderr diff --git a/src/test/ui/issue-33293.rs b/src/test/ui/issues/issue-33293.rs similarity index 100% rename from src/test/ui/issue-33293.rs rename to src/test/ui/issues/issue-33293.rs diff --git a/src/test/ui/issue-33293.stderr b/src/test/ui/issues/issue-33293.stderr similarity index 100% rename from src/test/ui/issue-33293.stderr rename to src/test/ui/issues/issue-33293.stderr diff --git a/src/test/ui/issue-3344.rs b/src/test/ui/issues/issue-3344.rs similarity index 100% rename from src/test/ui/issue-3344.rs rename to src/test/ui/issues/issue-3344.rs diff --git a/src/test/ui/issue-3344.stderr b/src/test/ui/issues/issue-3344.stderr similarity index 100% rename from src/test/ui/issue-3344.stderr rename to src/test/ui/issues/issue-3344.stderr diff --git a/src/test/ui/issue-33464.rs b/src/test/ui/issues/issue-33464.rs similarity index 100% rename from src/test/ui/issue-33464.rs rename to src/test/ui/issues/issue-33464.rs diff --git a/src/test/ui/issue-33464.stderr b/src/test/ui/issues/issue-33464.stderr similarity index 100% rename from src/test/ui/issue-33464.stderr rename to src/test/ui/issues/issue-33464.stderr diff --git a/src/test/ui/issue-33504.rs b/src/test/ui/issues/issue-33504.rs similarity index 100% rename from src/test/ui/issue-33504.rs rename to src/test/ui/issues/issue-33504.rs diff --git a/src/test/ui/issue-33504.stderr b/src/test/ui/issues/issue-33504.stderr similarity index 100% rename from src/test/ui/issue-33504.stderr rename to src/test/ui/issues/issue-33504.stderr diff --git a/src/test/ui/issue-33525.rs b/src/test/ui/issues/issue-33525.rs similarity index 100% rename from src/test/ui/issue-33525.rs rename to src/test/ui/issues/issue-33525.rs diff --git a/src/test/ui/issue-33525.stderr b/src/test/ui/issues/issue-33525.stderr similarity index 100% rename from src/test/ui/issue-33525.stderr rename to src/test/ui/issues/issue-33525.stderr diff --git a/src/test/ui/issue-33571.rs b/src/test/ui/issues/issue-33571.rs similarity index 100% rename from src/test/ui/issue-33571.rs rename to src/test/ui/issues/issue-33571.rs diff --git a/src/test/ui/issue-33571.stderr b/src/test/ui/issues/issue-33571.stderr similarity index 100% rename from src/test/ui/issue-33571.stderr rename to src/test/ui/issues/issue-33571.stderr diff --git a/src/test/ui/issue-33819.nll.stderr b/src/test/ui/issues/issue-33819.nll.stderr similarity index 100% rename from src/test/ui/issue-33819.nll.stderr rename to src/test/ui/issues/issue-33819.nll.stderr diff --git a/src/test/ui/issue-33819.rs b/src/test/ui/issues/issue-33819.rs similarity index 100% rename from src/test/ui/issue-33819.rs rename to src/test/ui/issues/issue-33819.rs diff --git a/src/test/ui/issue-33819.stderr b/src/test/ui/issues/issue-33819.stderr similarity index 100% rename from src/test/ui/issue-33819.stderr rename to src/test/ui/issues/issue-33819.stderr diff --git a/src/test/ui/issue-33941.rs b/src/test/ui/issues/issue-33941.rs similarity index 100% rename from src/test/ui/issue-33941.rs rename to src/test/ui/issues/issue-33941.rs diff --git a/src/test/ui/issue-33941.stderr b/src/test/ui/issues/issue-33941.stderr similarity index 100% rename from src/test/ui/issue-33941.stderr rename to src/test/ui/issues/issue-33941.stderr diff --git a/src/test/ui/issue-34028.rs b/src/test/ui/issues/issue-34028.rs similarity index 100% rename from src/test/ui/issue-34028.rs rename to src/test/ui/issues/issue-34028.rs diff --git a/src/test/ui/issue-34028.stderr b/src/test/ui/issues/issue-34028.stderr similarity index 100% rename from src/test/ui/issue-34028.stderr rename to src/test/ui/issues/issue-34028.stderr diff --git a/src/test/ui/issue-34047.rs b/src/test/ui/issues/issue-34047.rs similarity index 100% rename from src/test/ui/issue-34047.rs rename to src/test/ui/issues/issue-34047.rs diff --git a/src/test/ui/issue-34047.stderr b/src/test/ui/issues/issue-34047.stderr similarity index 100% rename from src/test/ui/issue-34047.stderr rename to src/test/ui/issues/issue-34047.stderr diff --git a/src/test/ui/issue-34171.rs b/src/test/ui/issues/issue-34171.rs similarity index 100% rename from src/test/ui/issue-34171.rs rename to src/test/ui/issues/issue-34171.rs diff --git a/src/test/ui/issue-34171.stderr b/src/test/ui/issues/issue-34171.stderr similarity index 100% rename from src/test/ui/issue-34171.stderr rename to src/test/ui/issues/issue-34171.stderr diff --git a/src/test/ui/issue-34209.rs b/src/test/ui/issues/issue-34209.rs similarity index 100% rename from src/test/ui/issue-34209.rs rename to src/test/ui/issues/issue-34209.rs diff --git a/src/test/ui/issue-34209.stderr b/src/test/ui/issues/issue-34209.stderr similarity index 100% rename from src/test/ui/issue-34209.stderr rename to src/test/ui/issues/issue-34209.stderr diff --git a/src/test/ui/issue-34222-1.rs b/src/test/ui/issues/issue-34222-1.rs similarity index 100% rename from src/test/ui/issue-34222-1.rs rename to src/test/ui/issues/issue-34222-1.rs diff --git a/src/test/ui/issue-34222-1.stderr b/src/test/ui/issues/issue-34222-1.stderr similarity index 100% rename from src/test/ui/issue-34222-1.stderr rename to src/test/ui/issues/issue-34222-1.stderr diff --git a/src/test/ui/issue-34334.rs b/src/test/ui/issues/issue-34334.rs similarity index 100% rename from src/test/ui/issue-34334.rs rename to src/test/ui/issues/issue-34334.rs diff --git a/src/test/ui/issue-34334.stderr b/src/test/ui/issues/issue-34334.stderr similarity index 100% rename from src/test/ui/issue-34334.stderr rename to src/test/ui/issues/issue-34334.stderr diff --git a/src/test/ui/issue-34349.rs b/src/test/ui/issues/issue-34349.rs similarity index 100% rename from src/test/ui/issue-34349.rs rename to src/test/ui/issues/issue-34349.rs diff --git a/src/test/ui/issue-34349.stderr b/src/test/ui/issues/issue-34349.stderr similarity index 100% rename from src/test/ui/issue-34349.stderr rename to src/test/ui/issues/issue-34349.stderr diff --git a/src/test/ui/issue-34373.rs b/src/test/ui/issues/issue-34373.rs similarity index 100% rename from src/test/ui/issue-34373.rs rename to src/test/ui/issues/issue-34373.rs diff --git a/src/test/ui/issue-34373.stderr b/src/test/ui/issues/issue-34373.stderr similarity index 100% rename from src/test/ui/issue-34373.stderr rename to src/test/ui/issues/issue-34373.stderr diff --git a/src/test/ui/issue-34418.rs b/src/test/ui/issues/issue-34418.rs similarity index 100% rename from src/test/ui/issue-34418.rs rename to src/test/ui/issues/issue-34418.rs diff --git a/src/test/ui/issue-34418.stderr b/src/test/ui/issues/issue-34418.stderr similarity index 100% rename from src/test/ui/issue-34418.stderr rename to src/test/ui/issues/issue-34418.stderr diff --git a/src/test/ui/issue-3477.rs b/src/test/ui/issues/issue-3477.rs similarity index 100% rename from src/test/ui/issue-3477.rs rename to src/test/ui/issues/issue-3477.rs diff --git a/src/test/ui/issue-3477.stderr b/src/test/ui/issues/issue-3477.stderr similarity index 100% rename from src/test/ui/issue-3477.stderr rename to src/test/ui/issues/issue-3477.stderr diff --git a/src/test/ui/issue-34839.rs b/src/test/ui/issues/issue-34839.rs similarity index 100% rename from src/test/ui/issue-34839.rs rename to src/test/ui/issues/issue-34839.rs diff --git a/src/test/ui/issue-34839.stderr b/src/test/ui/issues/issue-34839.stderr similarity index 100% rename from src/test/ui/issue-34839.stderr rename to src/test/ui/issues/issue-34839.stderr diff --git a/src/test/ui/issue-35075.rs b/src/test/ui/issues/issue-35075.rs similarity index 100% rename from src/test/ui/issue-35075.rs rename to src/test/ui/issues/issue-35075.rs diff --git a/src/test/ui/issue-35075.stderr b/src/test/ui/issues/issue-35075.stderr similarity index 100% rename from src/test/ui/issue-35075.stderr rename to src/test/ui/issues/issue-35075.stderr diff --git a/src/test/ui/issue-35139.rs b/src/test/ui/issues/issue-35139.rs similarity index 100% rename from src/test/ui/issue-35139.rs rename to src/test/ui/issues/issue-35139.rs diff --git a/src/test/ui/issue-35139.stderr b/src/test/ui/issues/issue-35139.stderr similarity index 100% rename from src/test/ui/issue-35139.stderr rename to src/test/ui/issues/issue-35139.stderr diff --git a/src/test/ui/issue-3521-2.rs b/src/test/ui/issues/issue-3521-2.rs similarity index 100% rename from src/test/ui/issue-3521-2.rs rename to src/test/ui/issues/issue-3521-2.rs diff --git a/src/test/ui/issue-3521-2.stderr b/src/test/ui/issues/issue-3521-2.stderr similarity index 100% rename from src/test/ui/issue-3521-2.stderr rename to src/test/ui/issues/issue-3521-2.stderr diff --git a/src/test/ui/issue-3521.rs b/src/test/ui/issues/issue-3521.rs similarity index 100% rename from src/test/ui/issue-3521.rs rename to src/test/ui/issues/issue-3521.rs diff --git a/src/test/ui/issue-3521.stderr b/src/test/ui/issues/issue-3521.stderr similarity index 100% rename from src/test/ui/issue-3521.stderr rename to src/test/ui/issues/issue-3521.stderr diff --git a/src/test/ui/issue-35241.rs b/src/test/ui/issues/issue-35241.rs similarity index 100% rename from src/test/ui/issue-35241.rs rename to src/test/ui/issues/issue-35241.rs diff --git a/src/test/ui/issue-35241.stderr b/src/test/ui/issues/issue-35241.stderr similarity index 100% rename from src/test/ui/issue-35241.stderr rename to src/test/ui/issues/issue-35241.stderr diff --git a/src/test/ui/issue-35450.rs b/src/test/ui/issues/issue-35450.rs similarity index 100% rename from src/test/ui/issue-35450.rs rename to src/test/ui/issues/issue-35450.rs diff --git a/src/test/ui/issue-35450.stderr b/src/test/ui/issues/issue-35450.stderr similarity index 100% rename from src/test/ui/issue-35450.stderr rename to src/test/ui/issues/issue-35450.stderr diff --git a/src/test/ui/issue-35570.rs b/src/test/ui/issues/issue-35570.rs similarity index 100% rename from src/test/ui/issue-35570.rs rename to src/test/ui/issues/issue-35570.rs diff --git a/src/test/ui/issue-35570.stderr b/src/test/ui/issues/issue-35570.stderr similarity index 100% rename from src/test/ui/issue-35570.stderr rename to src/test/ui/issues/issue-35570.stderr diff --git a/src/test/ui/issue-35668.rs b/src/test/ui/issues/issue-35668.rs similarity index 100% rename from src/test/ui/issue-35668.rs rename to src/test/ui/issues/issue-35668.rs diff --git a/src/test/ui/issue-35668.stderr b/src/test/ui/issues/issue-35668.stderr similarity index 100% rename from src/test/ui/issue-35668.stderr rename to src/test/ui/issues/issue-35668.stderr diff --git a/src/test/ui/issue-35675.rs b/src/test/ui/issues/issue-35675.rs similarity index 100% rename from src/test/ui/issue-35675.rs rename to src/test/ui/issues/issue-35675.rs diff --git a/src/test/ui/issue-35675.stderr b/src/test/ui/issues/issue-35675.stderr similarity index 100% rename from src/test/ui/issue-35675.stderr rename to src/test/ui/issues/issue-35675.stderr diff --git a/src/test/ui/issue-35869.rs b/src/test/ui/issues/issue-35869.rs similarity index 100% rename from src/test/ui/issue-35869.rs rename to src/test/ui/issues/issue-35869.rs diff --git a/src/test/ui/issue-35869.stderr b/src/test/ui/issues/issue-35869.stderr similarity index 100% rename from src/test/ui/issue-35869.stderr rename to src/test/ui/issues/issue-35869.stderr diff --git a/src/test/ui/issue-35976.rs b/src/test/ui/issues/issue-35976.rs similarity index 100% rename from src/test/ui/issue-35976.rs rename to src/test/ui/issues/issue-35976.rs diff --git a/src/test/ui/issue-35976.stderr b/src/test/ui/issues/issue-35976.stderr similarity index 100% rename from src/test/ui/issue-35976.stderr rename to src/test/ui/issues/issue-35976.stderr diff --git a/src/test/ui/issue-35988.rs b/src/test/ui/issues/issue-35988.rs similarity index 100% rename from src/test/ui/issue-35988.rs rename to src/test/ui/issues/issue-35988.rs diff --git a/src/test/ui/issue-35988.stderr b/src/test/ui/issues/issue-35988.stderr similarity index 100% rename from src/test/ui/issue-35988.stderr rename to src/test/ui/issues/issue-35988.stderr diff --git a/src/test/ui/issue-3601.rs b/src/test/ui/issues/issue-3601.rs similarity index 100% rename from src/test/ui/issue-3601.rs rename to src/test/ui/issues/issue-3601.rs diff --git a/src/test/ui/issue-3601.stderr b/src/test/ui/issues/issue-3601.stderr similarity index 100% rename from src/test/ui/issue-3601.stderr rename to src/test/ui/issues/issue-3601.stderr diff --git a/src/test/ui/issue-36082.ast.nll.stderr b/src/test/ui/issues/issue-36082.ast.nll.stderr similarity index 100% rename from src/test/ui/issue-36082.ast.nll.stderr rename to src/test/ui/issues/issue-36082.ast.nll.stderr diff --git a/src/test/ui/issue-36082.ast.stderr b/src/test/ui/issues/issue-36082.ast.stderr similarity index 100% rename from src/test/ui/issue-36082.ast.stderr rename to src/test/ui/issues/issue-36082.ast.stderr diff --git a/src/test/ui/issue-36082.mir.stderr b/src/test/ui/issues/issue-36082.mir.stderr similarity index 100% rename from src/test/ui/issue-36082.mir.stderr rename to src/test/ui/issues/issue-36082.mir.stderr diff --git a/src/test/ui/issue-36082.rs b/src/test/ui/issues/issue-36082.rs similarity index 100% rename from src/test/ui/issue-36082.rs rename to src/test/ui/issues/issue-36082.rs diff --git a/src/test/ui/issue-36116.rs b/src/test/ui/issues/issue-36116.rs similarity index 100% rename from src/test/ui/issue-36116.rs rename to src/test/ui/issues/issue-36116.rs diff --git a/src/test/ui/issue-36116.stderr b/src/test/ui/issues/issue-36116.stderr similarity index 100% rename from src/test/ui/issue-36116.stderr rename to src/test/ui/issues/issue-36116.stderr diff --git a/src/test/ui/issue-36163.rs b/src/test/ui/issues/issue-36163.rs similarity index 100% rename from src/test/ui/issue-36163.rs rename to src/test/ui/issues/issue-36163.rs diff --git a/src/test/ui/issue-36163.stderr b/src/test/ui/issues/issue-36163.stderr similarity index 100% rename from src/test/ui/issue-36163.stderr rename to src/test/ui/issues/issue-36163.stderr diff --git a/src/test/ui/issue-36299.rs b/src/test/ui/issues/issue-36299.rs similarity index 100% rename from src/test/ui/issue-36299.rs rename to src/test/ui/issues/issue-36299.rs diff --git a/src/test/ui/issue-36299.stderr b/src/test/ui/issues/issue-36299.stderr similarity index 100% rename from src/test/ui/issue-36299.stderr rename to src/test/ui/issues/issue-36299.stderr diff --git a/src/test/ui/issue-36379.rs b/src/test/ui/issues/issue-36379.rs similarity index 100% rename from src/test/ui/issue-36379.rs rename to src/test/ui/issues/issue-36379.rs diff --git a/src/test/ui/issue-36379.stderr b/src/test/ui/issues/issue-36379.stderr similarity index 100% rename from src/test/ui/issue-36379.stderr rename to src/test/ui/issues/issue-36379.stderr diff --git a/src/test/ui/issue-36400.nll.stderr b/src/test/ui/issues/issue-36400.nll.stderr similarity index 100% rename from src/test/ui/issue-36400.nll.stderr rename to src/test/ui/issues/issue-36400.nll.stderr diff --git a/src/test/ui/issue-36400.rs b/src/test/ui/issues/issue-36400.rs similarity index 100% rename from src/test/ui/issue-36400.rs rename to src/test/ui/issues/issue-36400.rs diff --git a/src/test/ui/issue-36400.stderr b/src/test/ui/issues/issue-36400.stderr similarity index 100% rename from src/test/ui/issue-36400.stderr rename to src/test/ui/issues/issue-36400.stderr diff --git a/src/test/ui/issue-36617.rs b/src/test/ui/issues/issue-36617.rs similarity index 100% rename from src/test/ui/issue-36617.rs rename to src/test/ui/issues/issue-36617.rs diff --git a/src/test/ui/issue-36617.stderr b/src/test/ui/issues/issue-36617.stderr similarity index 100% rename from src/test/ui/issue-36617.stderr rename to src/test/ui/issues/issue-36617.stderr diff --git a/src/test/ui/issue-36638.rs b/src/test/ui/issues/issue-36638.rs similarity index 100% rename from src/test/ui/issue-36638.rs rename to src/test/ui/issues/issue-36638.rs diff --git a/src/test/ui/issue-36638.stderr b/src/test/ui/issues/issue-36638.stderr similarity index 100% rename from src/test/ui/issue-36638.stderr rename to src/test/ui/issues/issue-36638.stderr diff --git a/src/test/ui/issue-3668-2.rs b/src/test/ui/issues/issue-3668-2.rs similarity index 100% rename from src/test/ui/issue-3668-2.rs rename to src/test/ui/issues/issue-3668-2.rs diff --git a/src/test/ui/issue-3668-2.stderr b/src/test/ui/issues/issue-3668-2.stderr similarity index 100% rename from src/test/ui/issue-3668-2.stderr rename to src/test/ui/issues/issue-3668-2.stderr diff --git a/src/test/ui/issue-3668.rs b/src/test/ui/issues/issue-3668.rs similarity index 100% rename from src/test/ui/issue-3668.rs rename to src/test/ui/issues/issue-3668.rs diff --git a/src/test/ui/issue-3668.stderr b/src/test/ui/issues/issue-3668.stderr similarity index 100% rename from src/test/ui/issue-3668.stderr rename to src/test/ui/issues/issue-3668.stderr diff --git a/src/test/ui/issue-36708.rs b/src/test/ui/issues/issue-36708.rs similarity index 100% rename from src/test/ui/issue-36708.rs rename to src/test/ui/issues/issue-36708.rs diff --git a/src/test/ui/issue-36708.stderr b/src/test/ui/issues/issue-36708.stderr similarity index 100% rename from src/test/ui/issue-36708.stderr rename to src/test/ui/issues/issue-36708.stderr diff --git a/src/test/ui/issue-3680.rs b/src/test/ui/issues/issue-3680.rs similarity index 100% rename from src/test/ui/issue-3680.rs rename to src/test/ui/issues/issue-3680.rs diff --git a/src/test/ui/issue-3680.stderr b/src/test/ui/issues/issue-3680.stderr similarity index 100% rename from src/test/ui/issue-3680.stderr rename to src/test/ui/issues/issue-3680.stderr diff --git a/src/test/ui/issue-36839.rs b/src/test/ui/issues/issue-36839.rs similarity index 100% rename from src/test/ui/issue-36839.rs rename to src/test/ui/issues/issue-36839.rs diff --git a/src/test/ui/issue-36839.stderr b/src/test/ui/issues/issue-36839.stderr similarity index 100% rename from src/test/ui/issue-36839.stderr rename to src/test/ui/issues/issue-36839.stderr diff --git a/src/test/compile-fail/issue-36881.rs b/src/test/ui/issues/issue-36881.rs similarity index 100% rename from src/test/compile-fail/issue-36881.rs rename to src/test/ui/issues/issue-36881.rs diff --git a/src/test/ui/issues/issue-36881.stderr b/src/test/ui/issues/issue-36881.stderr new file mode 100644 index 0000000000000..39132fde7625c --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-3702-2.rs b/src/test/ui/issues/issue-3702-2.rs similarity index 100% rename from src/test/ui/issue-3702-2.rs rename to src/test/ui/issues/issue-3702-2.rs diff --git a/src/test/ui/issue-3702-2.stderr b/src/test/ui/issues/issue-3702-2.stderr similarity index 100% rename from src/test/ui/issue-3702-2.stderr rename to src/test/ui/issues/issue-3702-2.stderr diff --git a/src/test/ui/issue-37026.rs b/src/test/ui/issues/issue-37026.rs similarity index 100% rename from src/test/ui/issue-37026.rs rename to src/test/ui/issues/issue-37026.rs diff --git a/src/test/ui/issue-37026.stderr b/src/test/ui/issues/issue-37026.stderr similarity index 100% rename from src/test/ui/issue-37026.stderr rename to src/test/ui/issues/issue-37026.stderr diff --git a/src/test/ui/issue-37051.rs b/src/test/ui/issues/issue-37051.rs similarity index 100% rename from src/test/ui/issue-37051.rs rename to src/test/ui/issues/issue-37051.rs diff --git a/src/test/ui/issue-37051.stderr b/src/test/ui/issues/issue-37051.stderr similarity index 100% rename from src/test/ui/issue-37051.stderr rename to src/test/ui/issues/issue-37051.stderr diff --git a/src/test/ui/issue-3707.rs b/src/test/ui/issues/issue-3707.rs similarity index 100% rename from src/test/ui/issue-3707.rs rename to src/test/ui/issues/issue-3707.rs diff --git a/src/test/ui/issue-3707.stderr b/src/test/ui/issues/issue-3707.stderr similarity index 100% rename from src/test/ui/issue-3707.stderr rename to src/test/ui/issues/issue-3707.stderr diff --git a/src/test/compile-fail/issue-37131.rs b/src/test/ui/issues/issue-37131.rs similarity index 100% rename from src/test/compile-fail/issue-37131.rs rename to src/test/ui/issues/issue-37131.rs diff --git a/src/test/ui/issues/issue-37131.stderr b/src/test/ui/issues/issue-37131.stderr new file mode 100644 index 0000000000000..660a6935f36cb --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-37311-type-length-limit/issue-37311.rs b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs similarity index 100% rename from src/test/ui/issue-37311-type-length-limit/issue-37311.rs rename to src/test/ui/issues/issue-37311-type-length-limit/issue-37311.rs diff --git a/src/test/ui/issue-37311-type-length-limit/issue-37311.stderr b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.stderr similarity index 100% rename from src/test/ui/issue-37311-type-length-limit/issue-37311.stderr rename to src/test/ui/issues/issue-37311-type-length-limit/issue-37311.stderr diff --git a/src/test/ui/issue-37323.rs b/src/test/ui/issues/issue-37323.rs similarity index 100% rename from src/test/ui/issue-37323.rs rename to src/test/ui/issues/issue-37323.rs diff --git a/src/test/ui/issue-37323.stderr b/src/test/ui/issues/issue-37323.stderr similarity index 100% rename from src/test/ui/issue-37323.stderr rename to src/test/ui/issues/issue-37323.stderr diff --git a/src/test/ui/issue-37366.rs b/src/test/ui/issues/issue-37366.rs similarity index 100% rename from src/test/ui/issue-37366.rs rename to src/test/ui/issues/issue-37366.rs diff --git a/src/test/ui/issue-37366.stderr b/src/test/ui/issues/issue-37366.stderr similarity index 100% rename from src/test/ui/issue-37366.stderr rename to src/test/ui/issues/issue-37366.stderr diff --git a/src/test/ui/issue-37510.rs b/src/test/ui/issues/issue-37510.rs similarity index 100% rename from src/test/ui/issue-37510.rs rename to src/test/ui/issues/issue-37510.rs diff --git a/src/test/ui/issue-37510.stderr b/src/test/ui/issues/issue-37510.stderr similarity index 100% rename from src/test/ui/issue-37510.stderr rename to src/test/ui/issues/issue-37510.stderr diff --git a/src/test/ui/issue-37515.rs b/src/test/ui/issues/issue-37515.rs similarity index 100% rename from src/test/ui/issue-37515.rs rename to src/test/ui/issues/issue-37515.rs diff --git a/src/test/ui/issue-37515.stderr b/src/test/ui/issues/issue-37515.stderr similarity index 100% rename from src/test/ui/issue-37515.stderr rename to src/test/ui/issues/issue-37515.stderr diff --git a/src/test/ui/issue-37534.rs b/src/test/ui/issues/issue-37534.rs similarity index 100% rename from src/test/ui/issue-37534.rs rename to src/test/ui/issues/issue-37534.rs diff --git a/src/test/ui/issue-37534.stderr b/src/test/ui/issues/issue-37534.stderr similarity index 100% rename from src/test/ui/issue-37534.stderr rename to src/test/ui/issues/issue-37534.stderr diff --git a/src/test/ui/issue-37550.rs b/src/test/ui/issues/issue-37550.rs similarity index 100% rename from src/test/ui/issue-37550.rs rename to src/test/ui/issues/issue-37550.rs diff --git a/src/test/ui/issue-37550.stderr b/src/test/ui/issues/issue-37550.stderr similarity index 100% rename from src/test/ui/issue-37550.stderr rename to src/test/ui/issues/issue-37550.stderr diff --git a/src/test/ui/issue-37576.rs b/src/test/ui/issues/issue-37576.rs similarity index 100% rename from src/test/ui/issue-37576.rs rename to src/test/ui/issues/issue-37576.rs diff --git a/src/test/ui/issue-37576.stderr b/src/test/ui/issues/issue-37576.stderr similarity index 100% rename from src/test/ui/issue-37576.stderr rename to src/test/ui/issues/issue-37576.stderr diff --git a/src/test/ui/issue-3763.rs b/src/test/ui/issues/issue-3763.rs similarity index 100% rename from src/test/ui/issue-3763.rs rename to src/test/ui/issues/issue-3763.rs diff --git a/src/test/ui/issue-3763.stderr b/src/test/ui/issues/issue-3763.stderr similarity index 100% rename from src/test/ui/issue-3763.stderr rename to src/test/ui/issues/issue-3763.stderr diff --git a/src/test/ui/issue-37665.rs b/src/test/ui/issues/issue-37665.rs similarity index 100% rename from src/test/ui/issue-37665.rs rename to src/test/ui/issues/issue-37665.rs diff --git a/src/test/ui/issue-37665.stderr b/src/test/ui/issues/issue-37665.stderr similarity index 100% rename from src/test/ui/issue-37665.stderr rename to src/test/ui/issues/issue-37665.stderr diff --git a/src/test/ui/issue-3779.rs b/src/test/ui/issues/issue-3779.rs similarity index 100% rename from src/test/ui/issue-3779.rs rename to src/test/ui/issues/issue-3779.rs diff --git a/src/test/ui/issue-3779.stderr b/src/test/ui/issues/issue-3779.stderr similarity index 100% rename from src/test/ui/issue-3779.stderr rename to src/test/ui/issues/issue-3779.stderr diff --git a/src/test/ui/issue-37884.rs b/src/test/ui/issues/issue-37884.rs similarity index 100% rename from src/test/ui/issue-37884.rs rename to src/test/ui/issues/issue-37884.rs diff --git a/src/test/ui/issue-37884.stderr b/src/test/ui/issues/issue-37884.stderr similarity index 100% rename from src/test/ui/issue-37884.stderr rename to src/test/ui/issues/issue-37884.stderr diff --git a/src/test/ui/issue-37887.rs b/src/test/ui/issues/issue-37887.rs similarity index 100% rename from src/test/ui/issue-37887.rs rename to src/test/ui/issues/issue-37887.rs diff --git a/src/test/ui/issue-37887.stderr b/src/test/ui/issues/issue-37887.stderr similarity index 100% rename from src/test/ui/issue-37887.stderr rename to src/test/ui/issues/issue-37887.stderr diff --git a/src/test/ui/issue-38160.rs b/src/test/ui/issues/issue-38160.rs similarity index 100% rename from src/test/ui/issue-38160.rs rename to src/test/ui/issues/issue-38160.rs diff --git a/src/test/ui/issue-38160.stderr b/src/test/ui/issues/issue-38160.stderr similarity index 100% rename from src/test/ui/issue-38160.stderr rename to src/test/ui/issues/issue-38160.stderr diff --git a/src/test/ui/issue-3820.rs b/src/test/ui/issues/issue-3820.rs similarity index 100% rename from src/test/ui/issue-3820.rs rename to src/test/ui/issues/issue-3820.rs diff --git a/src/test/ui/issue-3820.stderr b/src/test/ui/issues/issue-3820.stderr similarity index 100% rename from src/test/ui/issue-3820.stderr rename to src/test/ui/issues/issue-3820.stderr diff --git a/src/test/ui/issue-38293.rs b/src/test/ui/issues/issue-38293.rs similarity index 100% rename from src/test/ui/issue-38293.rs rename to src/test/ui/issues/issue-38293.rs diff --git a/src/test/ui/issue-38293.stderr b/src/test/ui/issues/issue-38293.stderr similarity index 100% rename from src/test/ui/issue-38293.stderr rename to src/test/ui/issues/issue-38293.stderr diff --git a/src/test/ui/issue-38381.rs b/src/test/ui/issues/issue-38381.rs similarity index 100% rename from src/test/ui/issue-38381.rs rename to src/test/ui/issues/issue-38381.rs diff --git a/src/test/ui/issue-38381.stderr b/src/test/ui/issues/issue-38381.stderr similarity index 100% rename from src/test/ui/issue-38381.stderr rename to src/test/ui/issues/issue-38381.stderr diff --git a/src/test/ui/issue-38404.rs b/src/test/ui/issues/issue-38404.rs similarity index 100% rename from src/test/ui/issue-38404.rs rename to src/test/ui/issues/issue-38404.rs diff --git a/src/test/ui/issue-38404.stderr b/src/test/ui/issues/issue-38404.stderr similarity index 100% rename from src/test/ui/issue-38404.stderr rename to src/test/ui/issues/issue-38404.stderr diff --git a/src/test/ui/issue-38412.rs b/src/test/ui/issues/issue-38412.rs similarity index 100% rename from src/test/ui/issue-38412.rs rename to src/test/ui/issues/issue-38412.rs diff --git a/src/test/ui/issue-38412.stderr b/src/test/ui/issues/issue-38412.stderr similarity index 100% rename from src/test/ui/issue-38412.stderr rename to src/test/ui/issues/issue-38412.stderr diff --git a/src/test/ui/issue-38458.rs b/src/test/ui/issues/issue-38458.rs similarity index 100% rename from src/test/ui/issue-38458.rs rename to src/test/ui/issues/issue-38458.rs diff --git a/src/test/ui/issue-38458.stderr b/src/test/ui/issues/issue-38458.stderr similarity index 100% rename from src/test/ui/issue-38458.stderr rename to src/test/ui/issues/issue-38458.stderr diff --git a/src/test/ui/issue-38604.rs b/src/test/ui/issues/issue-38604.rs similarity index 100% rename from src/test/ui/issue-38604.rs rename to src/test/ui/issues/issue-38604.rs diff --git a/src/test/ui/issue-38604.stderr b/src/test/ui/issues/issue-38604.stderr similarity index 100% rename from src/test/ui/issue-38604.stderr rename to src/test/ui/issues/issue-38604.stderr diff --git a/src/test/ui/issue-38715.rs b/src/test/ui/issues/issue-38715.rs similarity index 100% rename from src/test/ui/issue-38715.rs rename to src/test/ui/issues/issue-38715.rs diff --git a/src/test/ui/issue-38715.stderr b/src/test/ui/issues/issue-38715.stderr similarity index 100% rename from src/test/ui/issue-38715.stderr rename to src/test/ui/issues/issue-38715.stderr diff --git a/src/test/compile-fail/isssue-38821.rs b/src/test/ui/issues/issue-38821.rs similarity index 100% rename from src/test/compile-fail/isssue-38821.rs rename to src/test/ui/issues/issue-38821.rs diff --git a/src/test/ui/issues/issue-38821.stderr b/src/test/ui/issues/issue-38821.stderr new file mode 100644 index 0000000000000..f23f0ae99e9ab --- /dev/null +++ b/src/test/ui/issues/issue-38821.stderr @@ -0,0 +1,12 @@ +error[E0277]: the trait bound `::SqlType: NotNull` is not satisfied + --> $DIR/issue-38821.rs:33:17 + | +LL | #[derive(Debug, Copy, Clone)] + | ^^^^ the trait `NotNull` is not implemented for `::SqlType` + | + = help: consider adding a `where ::SqlType: NotNull` bound + = note: required because of the requirements on the impl of `IntoNullable` for `::SqlType` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/issue-38857.rs b/src/test/ui/issues/issue-38857.rs similarity index 100% rename from src/test/ui/issue-38857.rs rename to src/test/ui/issues/issue-38857.rs diff --git a/src/test/ui/issue-38857.stderr b/src/test/ui/issues/issue-38857.stderr similarity index 100% rename from src/test/ui/issue-38857.stderr rename to src/test/ui/issues/issue-38857.stderr diff --git a/src/test/ui/issue-38868.rs b/src/test/ui/issues/issue-38868.rs similarity index 100% rename from src/test/ui/issue-38868.rs rename to src/test/ui/issues/issue-38868.rs diff --git a/src/test/ui/issue-38868.stderr b/src/test/ui/issues/issue-38868.stderr similarity index 100% rename from src/test/ui/issue-38868.stderr rename to src/test/ui/issues/issue-38868.stderr diff --git a/src/test/ui/issue-38875/auxiliary/issue_38875_b.rs b/src/test/ui/issues/issue-38875/auxiliary/issue_38875_b.rs similarity index 100% rename from src/test/ui/issue-38875/auxiliary/issue_38875_b.rs rename to src/test/ui/issues/issue-38875/auxiliary/issue_38875_b.rs diff --git a/src/test/ui/issue-38875/issue_38875.rs b/src/test/ui/issues/issue-38875/issue_38875.rs similarity index 100% rename from src/test/ui/issue-38875/issue_38875.rs rename to src/test/ui/issues/issue-38875/issue_38875.rs diff --git a/src/test/ui/issue-38919.rs b/src/test/ui/issues/issue-38919.rs similarity index 100% rename from src/test/ui/issue-38919.rs rename to src/test/ui/issues/issue-38919.rs diff --git a/src/test/ui/issue-38919.stderr b/src/test/ui/issues/issue-38919.stderr similarity index 100% rename from src/test/ui/issue-38919.stderr rename to src/test/ui/issues/issue-38919.stderr diff --git a/src/test/ui/issue-38954.rs b/src/test/ui/issues/issue-38954.rs similarity index 100% rename from src/test/ui/issue-38954.rs rename to src/test/ui/issues/issue-38954.rs diff --git a/src/test/ui/issue-38954.stderr b/src/test/ui/issues/issue-38954.stderr similarity index 100% rename from src/test/ui/issue-38954.stderr rename to src/test/ui/issues/issue-38954.stderr diff --git a/src/test/ui/issue-39211.rs b/src/test/ui/issues/issue-39211.rs similarity index 100% rename from src/test/ui/issue-39211.rs rename to src/test/ui/issues/issue-39211.rs diff --git a/src/test/ui/issue-39211.stderr b/src/test/ui/issues/issue-39211.stderr similarity index 100% rename from src/test/ui/issue-39211.stderr rename to src/test/ui/issues/issue-39211.stderr diff --git a/src/test/ui/issue-39362.rs b/src/test/ui/issues/issue-39362.rs similarity index 100% rename from src/test/ui/issue-39362.rs rename to src/test/ui/issues/issue-39362.rs diff --git a/src/test/ui/issue-39362.stderr b/src/test/ui/issues/issue-39362.stderr similarity index 100% rename from src/test/ui/issue-39362.stderr rename to src/test/ui/issues/issue-39362.stderr diff --git a/src/test/ui/issue-39388.rs b/src/test/ui/issues/issue-39388.rs similarity index 100% rename from src/test/ui/issue-39388.rs rename to src/test/ui/issues/issue-39388.rs diff --git a/src/test/ui/issue-39388.stderr b/src/test/ui/issues/issue-39388.stderr similarity index 100% rename from src/test/ui/issue-39388.stderr rename to src/test/ui/issues/issue-39388.stderr diff --git a/src/test/ui/issue-39404.rs b/src/test/ui/issues/issue-39404.rs similarity index 100% rename from src/test/ui/issue-39404.rs rename to src/test/ui/issues/issue-39404.rs diff --git a/src/test/ui/issue-39404.stderr b/src/test/ui/issues/issue-39404.stderr similarity index 100% rename from src/test/ui/issue-39404.stderr rename to src/test/ui/issues/issue-39404.stderr diff --git a/src/test/ui/issue-39559-2.rs b/src/test/ui/issues/issue-39559-2.rs similarity index 100% rename from src/test/ui/issue-39559-2.rs rename to src/test/ui/issues/issue-39559-2.rs diff --git a/src/test/ui/issue-39559-2.stderr b/src/test/ui/issues/issue-39559-2.stderr similarity index 100% rename from src/test/ui/issue-39559-2.stderr rename to src/test/ui/issues/issue-39559-2.stderr diff --git a/src/test/ui/issue-39559.rs b/src/test/ui/issues/issue-39559.rs similarity index 100% rename from src/test/ui/issue-39559.rs rename to src/test/ui/issues/issue-39559.rs diff --git a/src/test/ui/issue-39559.stderr b/src/test/ui/issues/issue-39559.stderr similarity index 100% rename from src/test/ui/issue-39559.stderr rename to src/test/ui/issues/issue-39559.stderr diff --git a/src/test/ui/issue-39616.rs b/src/test/ui/issues/issue-39616.rs similarity index 100% rename from src/test/ui/issue-39616.rs rename to src/test/ui/issues/issue-39616.rs diff --git a/src/test/ui/issue-39616.stderr b/src/test/ui/issues/issue-39616.stderr similarity index 100% rename from src/test/ui/issue-39616.stderr rename to src/test/ui/issues/issue-39616.stderr diff --git a/src/test/ui/issue-39687.rs b/src/test/ui/issues/issue-39687.rs similarity index 100% rename from src/test/ui/issue-39687.rs rename to src/test/ui/issues/issue-39687.rs diff --git a/src/test/ui/issue-39687.stderr b/src/test/ui/issues/issue-39687.stderr similarity index 100% rename from src/test/ui/issue-39687.stderr rename to src/test/ui/issues/issue-39687.stderr diff --git a/src/test/ui/issue-3973.rs b/src/test/ui/issues/issue-3973.rs similarity index 100% rename from src/test/ui/issue-3973.rs rename to src/test/ui/issues/issue-3973.rs diff --git a/src/test/ui/issue-3973.stderr b/src/test/ui/issues/issue-3973.stderr similarity index 100% rename from src/test/ui/issue-3973.stderr rename to src/test/ui/issues/issue-3973.stderr diff --git a/src/test/ui/issue-39848.rs b/src/test/ui/issues/issue-39848.rs similarity index 100% rename from src/test/ui/issue-39848.rs rename to src/test/ui/issues/issue-39848.rs diff --git a/src/test/ui/issue-39848.stderr b/src/test/ui/issues/issue-39848.stderr similarity index 100% rename from src/test/ui/issue-39848.stderr rename to src/test/ui/issues/issue-39848.stderr diff --git a/src/test/ui/issue-3993.rs b/src/test/ui/issues/issue-3993.rs similarity index 100% rename from src/test/ui/issue-3993.rs rename to src/test/ui/issues/issue-3993.rs diff --git a/src/test/ui/issue-3993.stderr b/src/test/ui/issues/issue-3993.stderr similarity index 100% rename from src/test/ui/issue-3993.stderr rename to src/test/ui/issues/issue-3993.stderr diff --git a/src/test/ui/issue-39970.rs b/src/test/ui/issues/issue-39970.rs similarity index 100% rename from src/test/ui/issue-39970.rs rename to src/test/ui/issues/issue-39970.rs diff --git a/src/test/ui/issue-39970.stderr b/src/test/ui/issues/issue-39970.stderr similarity index 100% rename from src/test/ui/issue-39970.stderr rename to src/test/ui/issues/issue-39970.stderr diff --git a/src/test/ui/issue-39974.rs b/src/test/ui/issues/issue-39974.rs similarity index 100% rename from src/test/ui/issue-39974.rs rename to src/test/ui/issues/issue-39974.rs diff --git a/src/test/ui/issue-39974.stderr b/src/test/ui/issues/issue-39974.stderr similarity index 100% rename from src/test/ui/issue-39974.stderr rename to src/test/ui/issues/issue-39974.stderr diff --git a/src/test/ui/issue-40000.rs b/src/test/ui/issues/issue-40000.rs similarity index 100% rename from src/test/ui/issue-40000.rs rename to src/test/ui/issues/issue-40000.rs diff --git a/src/test/ui/issue-40000.stderr b/src/test/ui/issues/issue-40000.stderr similarity index 100% rename from src/test/ui/issue-40000.stderr rename to src/test/ui/issues/issue-40000.stderr diff --git a/src/test/ui/issue-40288-2.nll.stderr b/src/test/ui/issues/issue-40288-2.nll.stderr similarity index 100% rename from src/test/ui/issue-40288-2.nll.stderr rename to src/test/ui/issues/issue-40288-2.nll.stderr diff --git a/src/test/ui/issue-40288-2.rs b/src/test/ui/issues/issue-40288-2.rs similarity index 100% rename from src/test/ui/issue-40288-2.rs rename to src/test/ui/issues/issue-40288-2.rs diff --git a/src/test/ui/issue-40288-2.stderr b/src/test/ui/issues/issue-40288-2.stderr similarity index 100% rename from src/test/ui/issue-40288-2.stderr rename to src/test/ui/issues/issue-40288-2.stderr diff --git a/src/test/ui/issue-40288.nll.stderr b/src/test/ui/issues/issue-40288.nll.stderr similarity index 100% rename from src/test/ui/issue-40288.nll.stderr rename to src/test/ui/issues/issue-40288.nll.stderr diff --git a/src/test/ui/issue-40288.rs b/src/test/ui/issues/issue-40288.rs similarity index 100% rename from src/test/ui/issue-40288.rs rename to src/test/ui/issues/issue-40288.rs diff --git a/src/test/ui/issue-40288.stderr b/src/test/ui/issues/issue-40288.stderr similarity index 100% rename from src/test/ui/issue-40288.stderr rename to src/test/ui/issues/issue-40288.stderr diff --git a/src/test/ui/issue-40350.rs b/src/test/ui/issues/issue-40350.rs similarity index 100% rename from src/test/ui/issue-40350.rs rename to src/test/ui/issues/issue-40350.rs diff --git a/src/test/ui/issue-40350.stderr b/src/test/ui/issues/issue-40350.stderr similarity index 100% rename from src/test/ui/issue-40350.stderr rename to src/test/ui/issues/issue-40350.stderr diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-1.nll.stderr b/src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.nll.stderr similarity index 100% rename from src/test/ui/issue-40402-ref-hints/issue-40402-1.nll.stderr rename to src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.nll.stderr diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-1.rs b/src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.rs similarity index 100% rename from src/test/ui/issue-40402-ref-hints/issue-40402-1.rs rename to src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.rs diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-1.stderr b/src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.stderr similarity index 100% rename from src/test/ui/issue-40402-ref-hints/issue-40402-1.stderr rename to src/test/ui/issues/issue-40402-ref-hints/issue-40402-1.stderr diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-2.nll.stderr b/src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.nll.stderr similarity index 100% rename from src/test/ui/issue-40402-ref-hints/issue-40402-2.nll.stderr rename to src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.nll.stderr diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-2.rs b/src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.rs similarity index 100% rename from src/test/ui/issue-40402-ref-hints/issue-40402-2.rs rename to src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.rs diff --git a/src/test/ui/issue-40402-ref-hints/issue-40402-2.stderr b/src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.stderr similarity index 100% rename from src/test/ui/issue-40402-ref-hints/issue-40402-2.stderr rename to src/test/ui/issues/issue-40402-ref-hints/issue-40402-2.stderr diff --git a/src/test/ui/issue-40510-1.nll.stderr b/src/test/ui/issues/issue-40510-1.nll.stderr similarity index 100% rename from src/test/ui/issue-40510-1.nll.stderr rename to src/test/ui/issues/issue-40510-1.nll.stderr diff --git a/src/test/ui/issue-40510-1.rs b/src/test/ui/issues/issue-40510-1.rs similarity index 100% rename from src/test/ui/issue-40510-1.rs rename to src/test/ui/issues/issue-40510-1.rs diff --git a/src/test/ui/issue-40510-1.stderr b/src/test/ui/issues/issue-40510-1.stderr similarity index 100% rename from src/test/ui/issue-40510-1.stderr rename to src/test/ui/issues/issue-40510-1.stderr diff --git a/src/test/ui/issue-40510-2.rs b/src/test/ui/issues/issue-40510-2.rs similarity index 100% rename from src/test/ui/issue-40510-2.rs rename to src/test/ui/issues/issue-40510-2.rs diff --git a/src/test/ui/issue-40510-2.stderr b/src/test/ui/issues/issue-40510-2.stderr similarity index 100% rename from src/test/ui/issue-40510-2.stderr rename to src/test/ui/issues/issue-40510-2.stderr diff --git a/src/test/ui/issue-40510-3.nll.stderr b/src/test/ui/issues/issue-40510-3.nll.stderr similarity index 100% rename from src/test/ui/issue-40510-3.nll.stderr rename to src/test/ui/issues/issue-40510-3.nll.stderr diff --git a/src/test/ui/issue-40510-3.rs b/src/test/ui/issues/issue-40510-3.rs similarity index 100% rename from src/test/ui/issue-40510-3.rs rename to src/test/ui/issues/issue-40510-3.rs diff --git a/src/test/ui/issue-40510-3.stderr b/src/test/ui/issues/issue-40510-3.stderr similarity index 100% rename from src/test/ui/issue-40510-3.stderr rename to src/test/ui/issues/issue-40510-3.stderr diff --git a/src/test/ui/issue-40510-4.rs b/src/test/ui/issues/issue-40510-4.rs similarity index 100% rename from src/test/ui/issue-40510-4.rs rename to src/test/ui/issues/issue-40510-4.rs diff --git a/src/test/ui/issue-40510-4.stderr b/src/test/ui/issues/issue-40510-4.stderr similarity index 100% rename from src/test/ui/issue-40510-4.stderr rename to src/test/ui/issues/issue-40510-4.stderr diff --git a/src/test/ui/issue-40610.rs b/src/test/ui/issues/issue-40610.rs similarity index 100% rename from src/test/ui/issue-40610.rs rename to src/test/ui/issues/issue-40610.rs diff --git a/src/test/ui/issue-40610.stderr b/src/test/ui/issues/issue-40610.stderr similarity index 100% rename from src/test/ui/issue-40610.stderr rename to src/test/ui/issues/issue-40610.stderr diff --git a/src/test/ui/issue-40749.rs b/src/test/ui/issues/issue-40749.rs similarity index 100% rename from src/test/ui/issue-40749.rs rename to src/test/ui/issues/issue-40749.rs diff --git a/src/test/ui/issue-40749.stderr b/src/test/ui/issues/issue-40749.stderr similarity index 100% rename from src/test/ui/issue-40749.stderr rename to src/test/ui/issues/issue-40749.stderr diff --git a/src/test/ui/issue-40782.rs b/src/test/ui/issues/issue-40782.rs similarity index 100% rename from src/test/ui/issue-40782.rs rename to src/test/ui/issues/issue-40782.rs diff --git a/src/test/ui/issue-40782.stderr b/src/test/ui/issues/issue-40782.stderr similarity index 100% rename from src/test/ui/issue-40782.stderr rename to src/test/ui/issues/issue-40782.stderr diff --git a/src/test/ui/issue-40845.rs b/src/test/ui/issues/issue-40845.rs similarity index 100% rename from src/test/ui/issue-40845.rs rename to src/test/ui/issues/issue-40845.rs diff --git a/src/test/ui/issue-40845.stderr b/src/test/ui/issues/issue-40845.stderr similarity index 100% rename from src/test/ui/issue-40845.stderr rename to src/test/ui/issues/issue-40845.stderr diff --git a/src/test/ui/issue-40861.rs b/src/test/ui/issues/issue-40861.rs similarity index 100% rename from src/test/ui/issue-40861.rs rename to src/test/ui/issues/issue-40861.rs diff --git a/src/test/ui/issue-40861.stderr b/src/test/ui/issues/issue-40861.stderr similarity index 100% rename from src/test/ui/issue-40861.stderr rename to src/test/ui/issues/issue-40861.stderr diff --git a/src/test/ui/issue-41139.nll.stderr b/src/test/ui/issues/issue-41139.nll.stderr similarity index 100% rename from src/test/ui/issue-41139.nll.stderr rename to src/test/ui/issues/issue-41139.nll.stderr diff --git a/src/test/ui/issue-41139.rs b/src/test/ui/issues/issue-41139.rs similarity index 100% rename from src/test/ui/issue-41139.rs rename to src/test/ui/issues/issue-41139.rs diff --git a/src/test/ui/issue-41139.stderr b/src/test/ui/issues/issue-41139.stderr similarity index 100% rename from src/test/ui/issue-41139.stderr rename to src/test/ui/issues/issue-41139.stderr diff --git a/src/test/ui/issue-41229-ref-str.rs b/src/test/ui/issues/issue-41229-ref-str.rs similarity index 100% rename from src/test/ui/issue-41229-ref-str.rs rename to src/test/ui/issues/issue-41229-ref-str.rs diff --git a/src/test/ui/issue-41229-ref-str.stderr b/src/test/ui/issues/issue-41229-ref-str.stderr similarity index 100% rename from src/test/ui/issue-41229-ref-str.stderr rename to src/test/ui/issues/issue-41229-ref-str.stderr diff --git a/src/test/ui/issue-41255.rs b/src/test/ui/issues/issue-41255.rs similarity index 100% rename from src/test/ui/issue-41255.rs rename to src/test/ui/issues/issue-41255.rs diff --git a/src/test/ui/issue-41255.stderr b/src/test/ui/issues/issue-41255.stderr similarity index 100% rename from src/test/ui/issue-41255.stderr rename to src/test/ui/issues/issue-41255.stderr diff --git a/src/test/ui/issue-41394.rs b/src/test/ui/issues/issue-41394.rs similarity index 100% rename from src/test/ui/issue-41394.rs rename to src/test/ui/issues/issue-41394.rs diff --git a/src/test/ui/issue-41394.stderr b/src/test/ui/issues/issue-41394.stderr similarity index 100% rename from src/test/ui/issue-41394.stderr rename to src/test/ui/issues/issue-41394.stderr diff --git a/src/test/compile-fail/issue-41549.rs b/src/test/ui/issues/issue-41549.rs similarity index 100% rename from src/test/compile-fail/issue-41549.rs rename to src/test/ui/issues/issue-41549.rs diff --git a/src/test/ui/issues/issue-41549.stderr b/src/test/ui/issues/issue-41549.stderr new file mode 100644 index 0000000000000..e5362727d9411 --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-41652/auxiliary/issue_41652_b.rs b/src/test/ui/issues/issue-41652/auxiliary/issue_41652_b.rs similarity index 100% rename from src/test/ui/issue-41652/auxiliary/issue_41652_b.rs rename to src/test/ui/issues/issue-41652/auxiliary/issue_41652_b.rs diff --git a/src/test/ui/issue-41652/issue_41652.rs b/src/test/ui/issues/issue-41652/issue_41652.rs similarity index 100% rename from src/test/ui/issue-41652/issue_41652.rs rename to src/test/ui/issues/issue-41652/issue_41652.rs diff --git a/src/test/ui/issue-41652/issue_41652.stderr b/src/test/ui/issues/issue-41652/issue_41652.stderr similarity index 100% rename from src/test/ui/issue-41652/issue_41652.stderr rename to src/test/ui/issues/issue-41652/issue_41652.stderr diff --git a/src/test/ui/issue-41726.nll.stderr b/src/test/ui/issues/issue-41726.nll.stderr similarity index 100% rename from src/test/ui/issue-41726.nll.stderr rename to src/test/ui/issues/issue-41726.nll.stderr diff --git a/src/test/ui/issue-41726.rs b/src/test/ui/issues/issue-41726.rs similarity index 100% rename from src/test/ui/issue-41726.rs rename to src/test/ui/issues/issue-41726.rs diff --git a/src/test/ui/issue-41726.stderr b/src/test/ui/issues/issue-41726.stderr similarity index 100% rename from src/test/ui/issue-41726.stderr rename to src/test/ui/issues/issue-41726.stderr diff --git a/src/test/ui/issue-41742.rs b/src/test/ui/issues/issue-41742.rs similarity index 100% rename from src/test/ui/issue-41742.rs rename to src/test/ui/issues/issue-41742.rs diff --git a/src/test/ui/issue-41742.stderr b/src/test/ui/issues/issue-41742.stderr similarity index 100% rename from src/test/ui/issue-41742.stderr rename to src/test/ui/issues/issue-41742.stderr diff --git a/src/test/ui/issue-41776.rs b/src/test/ui/issues/issue-41776.rs similarity index 100% rename from src/test/ui/issue-41776.rs rename to src/test/ui/issues/issue-41776.rs diff --git a/src/test/ui/issue-41776.stderr b/src/test/ui/issues/issue-41776.stderr similarity index 100% rename from src/test/ui/issue-41776.stderr rename to src/test/ui/issues/issue-41776.stderr diff --git a/src/test/ui/issue-41880.rs b/src/test/ui/issues/issue-41880.rs similarity index 100% rename from src/test/ui/issue-41880.rs rename to src/test/ui/issues/issue-41880.rs diff --git a/src/test/ui/issue-41880.stderr b/src/test/ui/issues/issue-41880.stderr similarity index 100% rename from src/test/ui/issue-41880.stderr rename to src/test/ui/issues/issue-41880.stderr diff --git a/src/test/ui/issue-41974.rs b/src/test/ui/issues/issue-41974.rs similarity index 100% rename from src/test/ui/issue-41974.rs rename to src/test/ui/issues/issue-41974.rs diff --git a/src/test/ui/issue-41974.stderr b/src/test/ui/issues/issue-41974.stderr similarity index 100% rename from src/test/ui/issue-41974.stderr rename to src/test/ui/issues/issue-41974.stderr diff --git a/src/test/ui/issue-41998.rs b/src/test/ui/issues/issue-41998.rs similarity index 100% rename from src/test/ui/issue-41998.rs rename to src/test/ui/issues/issue-41998.rs diff --git a/src/test/ui/issue-41998.stderr b/src/test/ui/issues/issue-41998.stderr similarity index 100% rename from src/test/ui/issue-41998.stderr rename to src/test/ui/issues/issue-41998.stderr diff --git a/src/test/ui/issue-4201.rs b/src/test/ui/issues/issue-4201.rs similarity index 100% rename from src/test/ui/issue-4201.rs rename to src/test/ui/issues/issue-4201.rs diff --git a/src/test/ui/issue-4201.stderr b/src/test/ui/issues/issue-4201.stderr similarity index 100% rename from src/test/ui/issue-4201.stderr rename to src/test/ui/issues/issue-4201.stderr diff --git a/src/test/ui/issue-42060.rs b/src/test/ui/issues/issue-42060.rs similarity index 100% rename from src/test/ui/issue-42060.rs rename to src/test/ui/issues/issue-42060.rs diff --git a/src/test/ui/issue-42060.stderr b/src/test/ui/issues/issue-42060.stderr similarity index 100% rename from src/test/ui/issue-42060.stderr rename to src/test/ui/issues/issue-42060.stderr diff --git a/src/test/ui/issue-42106.nll.stderr b/src/test/ui/issues/issue-42106.nll.stderr similarity index 100% rename from src/test/ui/issue-42106.nll.stderr rename to src/test/ui/issues/issue-42106.nll.stderr diff --git a/src/test/ui/issue-42106.rs b/src/test/ui/issues/issue-42106.rs similarity index 100% rename from src/test/ui/issue-42106.rs rename to src/test/ui/issues/issue-42106.rs diff --git a/src/test/ui/issue-42106.stderr b/src/test/ui/issues/issue-42106.stderr similarity index 100% rename from src/test/ui/issue-42106.stderr rename to src/test/ui/issues/issue-42106.stderr diff --git a/src/test/ui/issue-42312.rs b/src/test/ui/issues/issue-42312.rs similarity index 100% rename from src/test/ui/issue-42312.rs rename to src/test/ui/issues/issue-42312.rs diff --git a/src/test/ui/issue-42312.stderr b/src/test/ui/issues/issue-42312.stderr similarity index 100% rename from src/test/ui/issue-42312.stderr rename to src/test/ui/issues/issue-42312.stderr diff --git a/src/test/ui/issue-42344.nll.stderr b/src/test/ui/issues/issue-42344.nll.stderr similarity index 100% rename from src/test/ui/issue-42344.nll.stderr rename to src/test/ui/issues/issue-42344.nll.stderr diff --git a/src/test/ui/issue-42344.rs b/src/test/ui/issues/issue-42344.rs similarity index 100% rename from src/test/ui/issue-42344.rs rename to src/test/ui/issues/issue-42344.rs diff --git a/src/test/ui/issue-42344.stderr b/src/test/ui/issues/issue-42344.stderr similarity index 100% rename from src/test/ui/issue-42344.stderr rename to src/test/ui/issues/issue-42344.stderr diff --git a/src/test/ui/issue-4265.rs b/src/test/ui/issues/issue-4265.rs similarity index 100% rename from src/test/ui/issue-4265.rs rename to src/test/ui/issues/issue-4265.rs diff --git a/src/test/ui/issue-4265.stderr b/src/test/ui/issues/issue-4265.stderr similarity index 100% rename from src/test/ui/issue-4265.stderr rename to src/test/ui/issues/issue-4265.stderr diff --git a/src/test/ui/issue-42755.rs b/src/test/ui/issues/issue-42755.rs similarity index 100% rename from src/test/ui/issue-42755.rs rename to src/test/ui/issues/issue-42755.rs diff --git a/src/test/ui/issue-42755.stderr b/src/test/ui/issues/issue-42755.stderr similarity index 100% rename from src/test/ui/issue-42755.stderr rename to src/test/ui/issues/issue-42755.stderr diff --git a/src/test/ui/issue-42796.nll.stderr b/src/test/ui/issues/issue-42796.nll.stderr similarity index 100% rename from src/test/ui/issue-42796.nll.stderr rename to src/test/ui/issues/issue-42796.nll.stderr diff --git a/src/test/ui/issue-42796.rs b/src/test/ui/issues/issue-42796.rs similarity index 100% rename from src/test/ui/issue-42796.rs rename to src/test/ui/issues/issue-42796.rs diff --git a/src/test/ui/issue-42796.stderr b/src/test/ui/issues/issue-42796.stderr similarity index 100% rename from src/test/ui/issue-42796.stderr rename to src/test/ui/issues/issue-42796.stderr diff --git a/src/test/ui/issue-42880.rs b/src/test/ui/issues/issue-42880.rs similarity index 100% rename from src/test/ui/issue-42880.rs rename to src/test/ui/issues/issue-42880.rs diff --git a/src/test/ui/issue-42880.stderr b/src/test/ui/issues/issue-42880.stderr similarity index 100% rename from src/test/ui/issue-42880.stderr rename to src/test/ui/issues/issue-42880.stderr diff --git a/src/test/ui/issue-42954.fixed b/src/test/ui/issues/issue-42954.fixed similarity index 100% rename from src/test/ui/issue-42954.fixed rename to src/test/ui/issues/issue-42954.fixed diff --git a/src/test/ui/issue-42954.rs b/src/test/ui/issues/issue-42954.rs similarity index 100% rename from src/test/ui/issue-42954.rs rename to src/test/ui/issues/issue-42954.rs diff --git a/src/test/ui/issue-42954.stderr b/src/test/ui/issues/issue-42954.stderr similarity index 100% rename from src/test/ui/issue-42954.stderr rename to src/test/ui/issues/issue-42954.stderr diff --git a/src/test/ui/issue-43023.rs b/src/test/ui/issues/issue-43023.rs similarity index 100% rename from src/test/ui/issue-43023.rs rename to src/test/ui/issues/issue-43023.rs diff --git a/src/test/ui/issue-43023.stderr b/src/test/ui/issues/issue-43023.stderr similarity index 100% rename from src/test/ui/issue-43023.stderr rename to src/test/ui/issues/issue-43023.stderr diff --git a/src/test/ui/issue-43105.rs b/src/test/ui/issues/issue-43105.rs similarity index 100% rename from src/test/ui/issue-43105.rs rename to src/test/ui/issues/issue-43105.rs diff --git a/src/test/ui/issue-43105.stderr b/src/test/ui/issues/issue-43105.stderr similarity index 100% rename from src/test/ui/issue-43105.stderr rename to src/test/ui/issues/issue-43105.stderr diff --git a/src/test/ui/issue-43162.rs b/src/test/ui/issues/issue-43162.rs similarity index 100% rename from src/test/ui/issue-43162.rs rename to src/test/ui/issues/issue-43162.rs diff --git a/src/test/ui/issue-43162.stderr b/src/test/ui/issues/issue-43162.stderr similarity index 100% rename from src/test/ui/issue-43162.stderr rename to src/test/ui/issues/issue-43162.stderr diff --git a/src/test/ui/issue-43189.rs b/src/test/ui/issues/issue-43189.rs similarity index 100% rename from src/test/ui/issue-43189.rs rename to src/test/ui/issues/issue-43189.rs diff --git a/src/test/ui/issue-43189.stderr b/src/test/ui/issues/issue-43189.stderr similarity index 100% rename from src/test/ui/issue-43189.stderr rename to src/test/ui/issues/issue-43189.stderr diff --git a/src/test/ui/issue-43196.rs b/src/test/ui/issues/issue-43196.rs similarity index 100% rename from src/test/ui/issue-43196.rs rename to src/test/ui/issues/issue-43196.rs diff --git a/src/test/ui/issue-43196.stderr b/src/test/ui/issues/issue-43196.stderr similarity index 100% rename from src/test/ui/issue-43196.stderr rename to src/test/ui/issues/issue-43196.stderr diff --git a/src/test/ui/issue-4321.rs b/src/test/ui/issues/issue-4321.rs similarity index 100% rename from src/test/ui/issue-4321.rs rename to src/test/ui/issues/issue-4321.rs diff --git a/src/test/ui/issue-4321.stderr b/src/test/ui/issues/issue-4321.stderr similarity index 100% rename from src/test/ui/issue-4321.stderr rename to src/test/ui/issues/issue-4321.stderr diff --git a/src/test/ui/issue-43250.rs b/src/test/ui/issues/issue-43250.rs similarity index 100% rename from src/test/ui/issue-43250.rs rename to src/test/ui/issues/issue-43250.rs diff --git a/src/test/ui/issue-43250.stderr b/src/test/ui/issues/issue-43250.stderr similarity index 100% rename from src/test/ui/issue-43250.stderr rename to src/test/ui/issues/issue-43250.stderr diff --git a/src/test/ui/issue-4335.nll.stderr b/src/test/ui/issues/issue-4335.nll.stderr similarity index 100% rename from src/test/ui/issue-4335.nll.stderr rename to src/test/ui/issues/issue-4335.nll.stderr diff --git a/src/test/ui/issue-4335.rs b/src/test/ui/issues/issue-4335.rs similarity index 100% rename from src/test/ui/issue-4335.rs rename to src/test/ui/issues/issue-4335.rs diff --git a/src/test/ui/issue-4335.stderr b/src/test/ui/issues/issue-4335.stderr similarity index 100% rename from src/test/ui/issue-4335.stderr rename to src/test/ui/issues/issue-4335.stderr diff --git a/src/test/ui/issue-43355.rs b/src/test/ui/issues/issue-43355.rs similarity index 100% rename from src/test/ui/issue-43355.rs rename to src/test/ui/issues/issue-43355.rs diff --git a/src/test/ui/issue-43355.stderr b/src/test/ui/issues/issue-43355.stderr similarity index 100% rename from src/test/ui/issue-43355.stderr rename to src/test/ui/issues/issue-43355.stderr diff --git a/src/test/ui/issue-43420-no-over-suggest.rs b/src/test/ui/issues/issue-43420-no-over-suggest.rs similarity index 100% rename from src/test/ui/issue-43420-no-over-suggest.rs rename to src/test/ui/issues/issue-43420-no-over-suggest.rs diff --git a/src/test/ui/issue-43420-no-over-suggest.stderr b/src/test/ui/issues/issue-43420-no-over-suggest.stderr similarity index 100% rename from src/test/ui/issue-43420-no-over-suggest.stderr rename to src/test/ui/issues/issue-43420-no-over-suggest.stderr diff --git a/src/test/ui/issue-43424.rs b/src/test/ui/issues/issue-43424.rs similarity index 100% rename from src/test/ui/issue-43424.rs rename to src/test/ui/issues/issue-43424.rs diff --git a/src/test/ui/issue-43424.stderr b/src/test/ui/issues/issue-43424.stderr similarity index 100% rename from src/test/ui/issue-43424.stderr rename to src/test/ui/issues/issue-43424.stderr diff --git a/src/test/ui/issue-43431.rs b/src/test/ui/issues/issue-43431.rs similarity index 100% rename from src/test/ui/issue-43431.rs rename to src/test/ui/issues/issue-43431.rs diff --git a/src/test/ui/issue-43431.stderr b/src/test/ui/issues/issue-43431.stderr similarity index 100% rename from src/test/ui/issue-43431.stderr rename to src/test/ui/issues/issue-43431.stderr diff --git a/src/test/ui/issue-4366-2.rs b/src/test/ui/issues/issue-4366-2.rs similarity index 100% rename from src/test/ui/issue-4366-2.rs rename to src/test/ui/issues/issue-4366-2.rs diff --git a/src/test/ui/issue-4366-2.stderr b/src/test/ui/issues/issue-4366-2.stderr similarity index 100% rename from src/test/ui/issue-4366-2.stderr rename to src/test/ui/issues/issue-4366-2.stderr diff --git a/src/test/ui/issue-4366.rs b/src/test/ui/issues/issue-4366.rs similarity index 100% rename from src/test/ui/issue-4366.rs rename to src/test/ui/issues/issue-4366.rs diff --git a/src/test/ui/issue-4366.stderr b/src/test/ui/issues/issue-4366.stderr similarity index 100% rename from src/test/ui/issue-4366.stderr rename to src/test/ui/issues/issue-4366.stderr diff --git a/src/test/ui/issue-43733.rs b/src/test/ui/issues/issue-43733.rs similarity index 100% rename from src/test/ui/issue-43733.rs rename to src/test/ui/issues/issue-43733.rs diff --git a/src/test/ui/issue-43733.stderr b/src/test/ui/issues/issue-43733.stderr similarity index 100% rename from src/test/ui/issue-43733.stderr rename to src/test/ui/issues/issue-43733.stderr diff --git a/src/test/ui/issue-43784-associated-type.rs b/src/test/ui/issues/issue-43784-associated-type.rs similarity index 100% rename from src/test/ui/issue-43784-associated-type.rs rename to src/test/ui/issues/issue-43784-associated-type.rs diff --git a/src/test/ui/issue-43784-associated-type.stderr b/src/test/ui/issues/issue-43784-associated-type.stderr similarity index 100% rename from src/test/ui/issue-43784-associated-type.stderr rename to src/test/ui/issues/issue-43784-associated-type.stderr diff --git a/src/test/ui/issue-43784-supertrait.rs b/src/test/ui/issues/issue-43784-supertrait.rs similarity index 100% rename from src/test/ui/issue-43784-supertrait.rs rename to src/test/ui/issues/issue-43784-supertrait.rs diff --git a/src/test/ui/issue-43784-supertrait.stderr b/src/test/ui/issues/issue-43784-supertrait.stderr similarity index 100% rename from src/test/ui/issue-43784-supertrait.stderr rename to src/test/ui/issues/issue-43784-supertrait.stderr diff --git a/src/test/ui/issue-43806.rs b/src/test/ui/issues/issue-43806.rs similarity index 100% rename from src/test/ui/issue-43806.rs rename to src/test/ui/issues/issue-43806.rs diff --git a/src/test/ui/issue-43925.rs b/src/test/ui/issues/issue-43925.rs similarity index 100% rename from src/test/ui/issue-43925.rs rename to src/test/ui/issues/issue-43925.rs diff --git a/src/test/ui/issue-43925.stderr b/src/test/ui/issues/issue-43925.stderr similarity index 100% rename from src/test/ui/issue-43925.stderr rename to src/test/ui/issues/issue-43925.stderr diff --git a/src/test/ui/issue-43926.rs b/src/test/ui/issues/issue-43926.rs similarity index 100% rename from src/test/ui/issue-43926.rs rename to src/test/ui/issues/issue-43926.rs diff --git a/src/test/ui/issue-43926.stderr b/src/test/ui/issues/issue-43926.stderr similarity index 100% rename from src/test/ui/issue-43926.stderr rename to src/test/ui/issues/issue-43926.stderr diff --git a/src/test/ui/issue-43988.rs b/src/test/ui/issues/issue-43988.rs similarity index 100% rename from src/test/ui/issue-43988.rs rename to src/test/ui/issues/issue-43988.rs diff --git a/src/test/ui/issue-43988.stderr b/src/test/ui/issues/issue-43988.stderr similarity index 100% rename from src/test/ui/issue-43988.stderr rename to src/test/ui/issues/issue-43988.stderr diff --git a/src/test/ui/issue-44021.rs b/src/test/ui/issues/issue-44021.rs similarity index 100% rename from src/test/ui/issue-44021.rs rename to src/test/ui/issues/issue-44021.rs diff --git a/src/test/ui/issue-44021.stderr b/src/test/ui/issues/issue-44021.stderr similarity index 100% rename from src/test/ui/issue-44021.stderr rename to src/test/ui/issues/issue-44021.stderr diff --git a/src/test/ui/issue-44023.rs b/src/test/ui/issues/issue-44023.rs similarity index 100% rename from src/test/ui/issue-44023.rs rename to src/test/ui/issues/issue-44023.rs diff --git a/src/test/ui/issue-44023.stderr b/src/test/ui/issues/issue-44023.stderr similarity index 100% rename from src/test/ui/issue-44023.stderr rename to src/test/ui/issues/issue-44023.stderr diff --git a/src/test/ui/issue-44078.rs b/src/test/ui/issues/issue-44078.rs similarity index 100% rename from src/test/ui/issue-44078.rs rename to src/test/ui/issues/issue-44078.rs diff --git a/src/test/ui/issue-44078.stderr b/src/test/ui/issues/issue-44078.stderr similarity index 100% rename from src/test/ui/issue-44078.stderr rename to src/test/ui/issues/issue-44078.stderr diff --git a/src/test/ui/issue-44239.rs b/src/test/ui/issues/issue-44239.rs similarity index 100% rename from src/test/ui/issue-44239.rs rename to src/test/ui/issues/issue-44239.rs diff --git a/src/test/ui/issue-44239.stderr b/src/test/ui/issues/issue-44239.stderr similarity index 100% rename from src/test/ui/issue-44239.stderr rename to src/test/ui/issues/issue-44239.stderr diff --git a/src/test/ui/issue-44373.rs b/src/test/ui/issues/issue-44373.rs similarity index 100% rename from src/test/ui/issue-44373.rs rename to src/test/ui/issues/issue-44373.rs diff --git a/src/test/ui/issue-44373.stderr b/src/test/ui/issues/issue-44373.stderr similarity index 100% rename from src/test/ui/issue-44373.stderr rename to src/test/ui/issues/issue-44373.stderr diff --git a/src/test/ui/issue-44406.rs b/src/test/ui/issues/issue-44406.rs similarity index 100% rename from src/test/ui/issue-44406.rs rename to src/test/ui/issues/issue-44406.rs diff --git a/src/test/ui/issue-44406.stderr b/src/test/ui/issues/issue-44406.stderr similarity index 100% rename from src/test/ui/issue-44406.stderr rename to src/test/ui/issues/issue-44406.stderr diff --git a/src/test/ui/issue-44415.rs b/src/test/ui/issues/issue-44415.rs similarity index 100% rename from src/test/ui/issue-44415.rs rename to src/test/ui/issues/issue-44415.rs diff --git a/src/test/ui/issue-44415.stderr b/src/test/ui/issues/issue-44415.stderr similarity index 100% rename from src/test/ui/issue-44415.stderr rename to src/test/ui/issues/issue-44415.stderr diff --git a/src/test/ui/issue-45087-unreachable-unsafe.rs b/src/test/ui/issues/issue-45087-unreachable-unsafe.rs similarity index 100% rename from src/test/ui/issue-45087-unreachable-unsafe.rs rename to src/test/ui/issues/issue-45087-unreachable-unsafe.rs diff --git a/src/test/ui/issue-45087-unreachable-unsafe.stderr b/src/test/ui/issues/issue-45087-unreachable-unsafe.stderr similarity index 100% rename from src/test/ui/issue-45087-unreachable-unsafe.stderr rename to src/test/ui/issues/issue-45087-unreachable-unsafe.stderr diff --git a/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.rs b/src/test/ui/issues/issue-45107-unnecessary-unsafe-in-closure.rs similarity index 100% rename from src/test/ui/issue-45107-unnecessary-unsafe-in-closure.rs rename to src/test/ui/issues/issue-45107-unnecessary-unsafe-in-closure.rs diff --git a/src/test/ui/issue-45107-unnecessary-unsafe-in-closure.stderr b/src/test/ui/issues/issue-45107-unnecessary-unsafe-in-closure.stderr similarity index 100% rename from src/test/ui/issue-45107-unnecessary-unsafe-in-closure.stderr rename to src/test/ui/issues/issue-45107-unnecessary-unsafe-in-closure.stderr diff --git a/src/test/ui/issue-45157.rs b/src/test/ui/issues/issue-45157.rs similarity index 100% rename from src/test/ui/issue-45157.rs rename to src/test/ui/issues/issue-45157.rs diff --git a/src/test/ui/issue-45157.stderr b/src/test/ui/issues/issue-45157.stderr similarity index 100% rename from src/test/ui/issue-45157.stderr rename to src/test/ui/issues/issue-45157.stderr diff --git a/src/test/ui/issue-4517.rs b/src/test/ui/issues/issue-4517.rs similarity index 100% rename from src/test/ui/issue-4517.rs rename to src/test/ui/issues/issue-4517.rs diff --git a/src/test/ui/issue-4517.stderr b/src/test/ui/issues/issue-4517.stderr similarity index 100% rename from src/test/ui/issue-4517.stderr rename to src/test/ui/issues/issue-4517.stderr diff --git a/src/test/ui/issue-45199.ast.nll.stderr b/src/test/ui/issues/issue-45199.ast.nll.stderr similarity index 100% rename from src/test/ui/issue-45199.ast.nll.stderr rename to src/test/ui/issues/issue-45199.ast.nll.stderr diff --git a/src/test/ui/issue-45199.ast.stderr b/src/test/ui/issues/issue-45199.ast.stderr similarity index 100% rename from src/test/ui/issue-45199.ast.stderr rename to src/test/ui/issues/issue-45199.ast.stderr diff --git a/src/test/ui/issue-45199.mir.stderr b/src/test/ui/issues/issue-45199.mir.stderr similarity index 100% rename from src/test/ui/issue-45199.mir.stderr rename to src/test/ui/issues/issue-45199.mir.stderr diff --git a/src/test/ui/issue-45199.rs b/src/test/ui/issues/issue-45199.rs similarity index 100% rename from src/test/ui/issue-45199.rs rename to src/test/ui/issues/issue-45199.rs diff --git a/src/test/ui/issue-45296.rs b/src/test/ui/issues/issue-45296.rs similarity index 100% rename from src/test/ui/issue-45296.rs rename to src/test/ui/issues/issue-45296.rs diff --git a/src/test/ui/issue-45296.stderr b/src/test/ui/issues/issue-45296.stderr similarity index 100% rename from src/test/ui/issue-45296.stderr rename to src/test/ui/issues/issue-45296.stderr diff --git a/src/test/ui/issue-45562.fixed b/src/test/ui/issues/issue-45562.fixed similarity index 100% rename from src/test/ui/issue-45562.fixed rename to src/test/ui/issues/issue-45562.fixed diff --git a/src/test/ui/issue-45562.rs b/src/test/ui/issues/issue-45562.rs similarity index 100% rename from src/test/ui/issue-45562.rs rename to src/test/ui/issues/issue-45562.rs diff --git a/src/test/ui/issue-45562.stderr b/src/test/ui/issues/issue-45562.stderr similarity index 100% rename from src/test/ui/issue-45562.stderr rename to src/test/ui/issues/issue-45562.stderr diff --git a/src/test/ui/issue-45696-long-live-borrows-in-boxes.rs b/src/test/ui/issues/issue-45696-long-live-borrows-in-boxes.rs similarity index 100% rename from src/test/ui/issue-45696-long-live-borrows-in-boxes.rs rename to src/test/ui/issues/issue-45696-long-live-borrows-in-boxes.rs diff --git a/src/test/ui/issue-45696-no-variant-box-recur.rs b/src/test/ui/issues/issue-45696-no-variant-box-recur.rs similarity index 100% rename from src/test/ui/issue-45696-no-variant-box-recur.rs rename to src/test/ui/issues/issue-45696-no-variant-box-recur.rs diff --git a/src/test/ui/issue-45696-scribble-on-boxed-borrow.ast.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.ast.stderr similarity index 100% rename from src/test/ui/issue-45696-scribble-on-boxed-borrow.ast.stderr rename to src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.ast.stderr diff --git a/src/test/ui/issue-45696-scribble-on-boxed-borrow.migrate.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr similarity index 100% rename from src/test/ui/issue-45696-scribble-on-boxed-borrow.migrate.stderr rename to src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.migrate.stderr diff --git a/src/test/ui/issue-45696-scribble-on-boxed-borrow.nll.stderr b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr similarity index 100% rename from src/test/ui/issue-45696-scribble-on-boxed-borrow.nll.stderr rename to src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.nll.stderr diff --git a/src/test/ui/issue-45696-scribble-on-boxed-borrow.rs b/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs similarity index 100% rename from src/test/ui/issue-45696-scribble-on-boxed-borrow.rs rename to src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs diff --git a/src/test/ui/issue-45697-1.rs b/src/test/ui/issues/issue-45697-1.rs similarity index 100% rename from src/test/ui/issue-45697-1.rs rename to src/test/ui/issues/issue-45697-1.rs diff --git a/src/test/ui/issue-45697-1.stderr b/src/test/ui/issues/issue-45697-1.stderr similarity index 100% rename from src/test/ui/issue-45697-1.stderr rename to src/test/ui/issues/issue-45697-1.stderr diff --git a/src/test/ui/issue-45697.rs b/src/test/ui/issues/issue-45697.rs similarity index 100% rename from src/test/ui/issue-45697.rs rename to src/test/ui/issues/issue-45697.rs diff --git a/src/test/ui/issue-45697.stderr b/src/test/ui/issues/issue-45697.stderr similarity index 100% rename from src/test/ui/issue-45697.stderr rename to src/test/ui/issues/issue-45697.stderr diff --git a/src/test/ui/issue-45729-unsafe-in-generator.rs b/src/test/ui/issues/issue-45729-unsafe-in-generator.rs similarity index 100% rename from src/test/ui/issue-45729-unsafe-in-generator.rs rename to src/test/ui/issues/issue-45729-unsafe-in-generator.rs diff --git a/src/test/ui/issue-45729-unsafe-in-generator.stderr b/src/test/ui/issues/issue-45729-unsafe-in-generator.stderr similarity index 100% rename from src/test/ui/issue-45729-unsafe-in-generator.stderr rename to src/test/ui/issues/issue-45729-unsafe-in-generator.stderr diff --git a/src/test/ui/issue-45730.rs b/src/test/ui/issues/issue-45730.rs similarity index 100% rename from src/test/ui/issue-45730.rs rename to src/test/ui/issues/issue-45730.rs diff --git a/src/test/ui/issue-45730.stderr b/src/test/ui/issues/issue-45730.stderr similarity index 100% rename from src/test/ui/issue-45730.stderr rename to src/test/ui/issues/issue-45730.stderr diff --git a/src/test/ui/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed b/src/test/ui/issues/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed similarity index 100% rename from src/test/ui/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed rename to src/test/ui/issues/issue-45799-bad-extern-crate-rename-suggestion-formatting.fixed diff --git a/src/test/ui/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs b/src/test/ui/issues/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs similarity index 100% rename from src/test/ui/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs rename to src/test/ui/issues/issue-45799-bad-extern-crate-rename-suggestion-formatting.rs diff --git a/src/test/ui/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr b/src/test/ui/issues/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr similarity index 100% rename from src/test/ui/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr rename to src/test/ui/issues/issue-45799-bad-extern-crate-rename-suggestion-formatting.stderr diff --git a/src/test/ui/issue-45801.rs b/src/test/ui/issues/issue-45801.rs similarity index 100% rename from src/test/ui/issue-45801.rs rename to src/test/ui/issues/issue-45801.rs diff --git a/src/test/ui/issue-45801.stderr b/src/test/ui/issues/issue-45801.stderr similarity index 100% rename from src/test/ui/issue-45801.stderr rename to src/test/ui/issues/issue-45801.stderr diff --git a/src/test/ui/issue-45965.rs b/src/test/ui/issues/issue-45965.rs similarity index 100% rename from src/test/ui/issue-45965.rs rename to src/test/ui/issues/issue-45965.rs diff --git a/src/test/ui/issue-45965.stderr b/src/test/ui/issues/issue-45965.stderr similarity index 100% rename from src/test/ui/issue-45965.stderr rename to src/test/ui/issues/issue-45965.stderr diff --git a/src/test/ui/issue-46023.ast.nll.stderr b/src/test/ui/issues/issue-46023.ast.nll.stderr similarity index 100% rename from src/test/ui/issue-46023.ast.nll.stderr rename to src/test/ui/issues/issue-46023.ast.nll.stderr diff --git a/src/test/ui/issue-46023.ast.stderr b/src/test/ui/issues/issue-46023.ast.stderr similarity index 100% rename from src/test/ui/issue-46023.ast.stderr rename to src/test/ui/issues/issue-46023.ast.stderr diff --git a/src/test/ui/issue-46023.mir.stderr b/src/test/ui/issues/issue-46023.mir.stderr similarity index 100% rename from src/test/ui/issue-46023.mir.stderr rename to src/test/ui/issues/issue-46023.mir.stderr diff --git a/src/test/ui/issue-46023.rs b/src/test/ui/issues/issue-46023.rs similarity index 100% rename from src/test/ui/issue-46023.rs rename to src/test/ui/issues/issue-46023.rs diff --git a/src/test/ui/issue-46036.rs b/src/test/ui/issues/issue-46036.rs similarity index 100% rename from src/test/ui/issue-46036.rs rename to src/test/ui/issues/issue-46036.rs diff --git a/src/test/ui/issue-46036.stderr b/src/test/ui/issues/issue-46036.stderr similarity index 100% rename from src/test/ui/issue-46036.stderr rename to src/test/ui/issues/issue-46036.stderr diff --git a/src/test/ui/issue-46112.rs b/src/test/ui/issues/issue-46112.rs similarity index 100% rename from src/test/ui/issue-46112.rs rename to src/test/ui/issues/issue-46112.rs diff --git a/src/test/ui/issue-46112.stderr b/src/test/ui/issues/issue-46112.stderr similarity index 100% rename from src/test/ui/issue-46112.stderr rename to src/test/ui/issues/issue-46112.stderr diff --git a/src/test/ui/issue-46186.rs b/src/test/ui/issues/issue-46186.rs similarity index 100% rename from src/test/ui/issue-46186.rs rename to src/test/ui/issues/issue-46186.rs diff --git a/src/test/ui/issue-46186.stderr b/src/test/ui/issues/issue-46186.stderr similarity index 100% rename from src/test/ui/issue-46186.stderr rename to src/test/ui/issues/issue-46186.stderr diff --git a/src/test/ui/issue-46302.rs b/src/test/ui/issues/issue-46302.rs similarity index 100% rename from src/test/ui/issue-46302.rs rename to src/test/ui/issues/issue-46302.rs diff --git a/src/test/ui/issue-46302.stderr b/src/test/ui/issues/issue-46302.stderr similarity index 100% rename from src/test/ui/issue-46302.stderr rename to src/test/ui/issues/issue-46302.stderr diff --git a/src/test/ui/issue-46311.rs b/src/test/ui/issues/issue-46311.rs similarity index 100% rename from src/test/ui/issue-46311.rs rename to src/test/ui/issues/issue-46311.rs diff --git a/src/test/ui/issue-46311.stderr b/src/test/ui/issues/issue-46311.stderr similarity index 100% rename from src/test/ui/issue-46311.stderr rename to src/test/ui/issues/issue-46311.stderr diff --git a/src/test/ui/issue-46332.rs b/src/test/ui/issues/issue-46332.rs similarity index 100% rename from src/test/ui/issue-46332.rs rename to src/test/ui/issues/issue-46332.rs diff --git a/src/test/ui/issue-46332.stderr b/src/test/ui/issues/issue-46332.stderr similarity index 100% rename from src/test/ui/issue-46332.stderr rename to src/test/ui/issues/issue-46332.stderr diff --git a/src/test/ui/issue-46438.rs b/src/test/ui/issues/issue-46438.rs similarity index 100% rename from src/test/ui/issue-46438.rs rename to src/test/ui/issues/issue-46438.rs diff --git a/src/test/ui/issue-46438.stderr b/src/test/ui/issues/issue-46438.stderr similarity index 100% rename from src/test/ui/issue-46438.stderr rename to src/test/ui/issues/issue-46438.stderr diff --git a/src/test/ui/issue-46471-1.rs b/src/test/ui/issues/issue-46471-1.rs similarity index 100% rename from src/test/ui/issue-46471-1.rs rename to src/test/ui/issues/issue-46471-1.rs diff --git a/src/test/ui/issue-46471-1.stderr b/src/test/ui/issues/issue-46471-1.stderr similarity index 100% rename from src/test/ui/issue-46471-1.stderr rename to src/test/ui/issues/issue-46471-1.stderr diff --git a/src/test/ui/issue-46471.rs b/src/test/ui/issues/issue-46471.rs similarity index 100% rename from src/test/ui/issue-46471.rs rename to src/test/ui/issues/issue-46471.rs diff --git a/src/test/ui/issue-46471.stderr b/src/test/ui/issues/issue-46471.stderr similarity index 100% rename from src/test/ui/issue-46471.stderr rename to src/test/ui/issues/issue-46471.stderr diff --git a/src/test/ui/issue-46472.rs b/src/test/ui/issues/issue-46472.rs similarity index 100% rename from src/test/ui/issue-46472.rs rename to src/test/ui/issues/issue-46472.rs diff --git a/src/test/ui/issue-46472.stderr b/src/test/ui/issues/issue-46472.stderr similarity index 100% rename from src/test/ui/issue-46472.stderr rename to src/test/ui/issues/issue-46472.stderr diff --git a/src/test/ui/issue-46576.rs b/src/test/ui/issues/issue-46576.rs similarity index 100% rename from src/test/ui/issue-46576.rs rename to src/test/ui/issues/issue-46576.rs diff --git a/src/test/ui/issue-46576.stderr b/src/test/ui/issues/issue-46576.stderr similarity index 100% rename from src/test/ui/issue-46576.stderr rename to src/test/ui/issues/issue-46576.stderr diff --git a/src/test/ui/issue-46604.ast.nll.stderr b/src/test/ui/issues/issue-46604.ast.nll.stderr similarity index 100% rename from src/test/ui/issue-46604.ast.nll.stderr rename to src/test/ui/issues/issue-46604.ast.nll.stderr diff --git a/src/test/ui/issue-46604.ast.stderr b/src/test/ui/issues/issue-46604.ast.stderr similarity index 100% rename from src/test/ui/issue-46604.ast.stderr rename to src/test/ui/issues/issue-46604.ast.stderr diff --git a/src/test/ui/issue-46604.mir.stderr b/src/test/ui/issues/issue-46604.mir.stderr similarity index 100% rename from src/test/ui/issue-46604.mir.stderr rename to src/test/ui/issues/issue-46604.mir.stderr diff --git a/src/test/ui/issue-46604.rs b/src/test/ui/issues/issue-46604.rs similarity index 100% rename from src/test/ui/issue-46604.rs rename to src/test/ui/issues/issue-46604.rs diff --git a/src/test/ui/issue-46756-consider-borrowing-cast-or-binexpr.fixed b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.fixed similarity index 100% rename from src/test/ui/issue-46756-consider-borrowing-cast-or-binexpr.fixed rename to src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.fixed diff --git a/src/test/ui/issue-46756-consider-borrowing-cast-or-binexpr.rs b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.rs similarity index 100% rename from src/test/ui/issue-46756-consider-borrowing-cast-or-binexpr.rs rename to src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.rs diff --git a/src/test/ui/issue-46756-consider-borrowing-cast-or-binexpr.stderr b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr similarity index 100% rename from src/test/ui/issue-46756-consider-borrowing-cast-or-binexpr.stderr rename to src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr diff --git a/src/test/ui/issue-46771.rs b/src/test/ui/issues/issue-46771.rs similarity index 100% rename from src/test/ui/issue-46771.rs rename to src/test/ui/issues/issue-46771.rs diff --git a/src/test/ui/issue-46771.stderr b/src/test/ui/issues/issue-46771.stderr similarity index 100% rename from src/test/ui/issue-46771.stderr rename to src/test/ui/issues/issue-46771.stderr diff --git a/src/test/ui/issue-46843.rs b/src/test/ui/issues/issue-46843.rs similarity index 100% rename from src/test/ui/issue-46843.rs rename to src/test/ui/issues/issue-46843.rs diff --git a/src/test/ui/issue-46843.stderr b/src/test/ui/issues/issue-46843.stderr similarity index 100% rename from src/test/ui/issue-46843.stderr rename to src/test/ui/issues/issue-46843.stderr diff --git a/src/test/ui/issue-46983.rs b/src/test/ui/issues/issue-46983.rs similarity index 100% rename from src/test/ui/issue-46983.rs rename to src/test/ui/issues/issue-46983.rs diff --git a/src/test/ui/issue-46983.stderr b/src/test/ui/issues/issue-46983.stderr similarity index 100% rename from src/test/ui/issue-46983.stderr rename to src/test/ui/issues/issue-46983.stderr diff --git a/src/test/ui/issue-47073-zero-padded-tuple-struct-indices.rs b/src/test/ui/issues/issue-47073-zero-padded-tuple-struct-indices.rs similarity index 100% rename from src/test/ui/issue-47073-zero-padded-tuple-struct-indices.rs rename to src/test/ui/issues/issue-47073-zero-padded-tuple-struct-indices.rs diff --git a/src/test/ui/issue-47073-zero-padded-tuple-struct-indices.stderr b/src/test/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr similarity index 100% rename from src/test/ui/issue-47073-zero-padded-tuple-struct-indices.stderr rename to src/test/ui/issues/issue-47073-zero-padded-tuple-struct-indices.stderr diff --git a/src/test/ui/issue-47094.rs b/src/test/ui/issues/issue-47094.rs similarity index 100% rename from src/test/ui/issue-47094.rs rename to src/test/ui/issues/issue-47094.rs diff --git a/src/test/ui/issue-47094.stderr b/src/test/ui/issues/issue-47094.stderr similarity index 100% rename from src/test/ui/issue-47094.stderr rename to src/test/ui/issues/issue-47094.stderr diff --git a/src/test/ui/issue-47184.rs b/src/test/ui/issues/issue-47184.rs similarity index 100% rename from src/test/ui/issue-47184.rs rename to src/test/ui/issues/issue-47184.rs diff --git a/src/test/ui/issue-47184.stderr b/src/test/ui/issues/issue-47184.stderr similarity index 100% rename from src/test/ui/issue-47184.stderr rename to src/test/ui/issues/issue-47184.stderr diff --git a/src/test/ui/issue-47309.rs b/src/test/ui/issues/issue-47309.rs similarity index 100% rename from src/test/ui/issue-47309.rs rename to src/test/ui/issues/issue-47309.rs diff --git a/src/test/ui/issue-4736.rs b/src/test/ui/issues/issue-4736.rs similarity index 100% rename from src/test/ui/issue-4736.rs rename to src/test/ui/issues/issue-4736.rs diff --git a/src/test/ui/issue-4736.stderr b/src/test/ui/issues/issue-4736.stderr similarity index 100% rename from src/test/ui/issue-4736.stderr rename to src/test/ui/issues/issue-4736.stderr diff --git a/src/test/ui/issue-47377.rs b/src/test/ui/issues/issue-47377.rs similarity index 100% rename from src/test/ui/issue-47377.rs rename to src/test/ui/issues/issue-47377.rs diff --git a/src/test/ui/issue-47377.stderr b/src/test/ui/issues/issue-47377.stderr similarity index 100% rename from src/test/ui/issue-47377.stderr rename to src/test/ui/issues/issue-47377.stderr diff --git a/src/test/ui/issue-47380.rs b/src/test/ui/issues/issue-47380.rs similarity index 100% rename from src/test/ui/issue-47380.rs rename to src/test/ui/issues/issue-47380.rs diff --git a/src/test/ui/issue-47380.stderr b/src/test/ui/issues/issue-47380.stderr similarity index 100% rename from src/test/ui/issue-47380.stderr rename to src/test/ui/issues/issue-47380.stderr diff --git a/src/test/ui/issue-47412.rs b/src/test/ui/issues/issue-47412.rs similarity index 100% rename from src/test/ui/issue-47412.rs rename to src/test/ui/issues/issue-47412.rs diff --git a/src/test/ui/issue-47412.stderr b/src/test/ui/issues/issue-47412.stderr similarity index 100% rename from src/test/ui/issue-47412.stderr rename to src/test/ui/issues/issue-47412.stderr diff --git a/src/test/ui/issue-47511.rs b/src/test/ui/issues/issue-47511.rs similarity index 100% rename from src/test/ui/issue-47511.rs rename to src/test/ui/issues/issue-47511.rs diff --git a/src/test/ui/issue-47511.stderr b/src/test/ui/issues/issue-47511.stderr similarity index 100% rename from src/test/ui/issue-47511.stderr rename to src/test/ui/issues/issue-47511.stderr diff --git a/src/test/ui/issue-47623.rs b/src/test/ui/issues/issue-47623.rs similarity index 100% rename from src/test/ui/issue-47623.rs rename to src/test/ui/issues/issue-47623.rs diff --git a/src/test/ui/issue-47623.stderr b/src/test/ui/issues/issue-47623.stderr similarity index 100% rename from src/test/ui/issue-47623.stderr rename to src/test/ui/issues/issue-47623.stderr diff --git a/src/test/ui/issue-47646.rs b/src/test/ui/issues/issue-47646.rs similarity index 100% rename from src/test/ui/issue-47646.rs rename to src/test/ui/issues/issue-47646.rs diff --git a/src/test/ui/issue-47646.stderr b/src/test/ui/issues/issue-47646.stderr similarity index 100% rename from src/test/ui/issue-47646.stderr rename to src/test/ui/issues/issue-47646.stderr diff --git a/src/test/ui/issue-47706-trait.rs b/src/test/ui/issues/issue-47706-trait.rs similarity index 100% rename from src/test/ui/issue-47706-trait.rs rename to src/test/ui/issues/issue-47706-trait.rs diff --git a/src/test/ui/issue-47706-trait.stderr b/src/test/ui/issues/issue-47706-trait.stderr similarity index 100% rename from src/test/ui/issue-47706-trait.stderr rename to src/test/ui/issues/issue-47706-trait.stderr diff --git a/src/test/ui/issue-47706.rs b/src/test/ui/issues/issue-47706.rs similarity index 100% rename from src/test/ui/issue-47706.rs rename to src/test/ui/issues/issue-47706.rs diff --git a/src/test/ui/issue-47706.stderr b/src/test/ui/issues/issue-47706.stderr similarity index 100% rename from src/test/ui/issue-47706.stderr rename to src/test/ui/issues/issue-47706.stderr diff --git a/src/test/ui/issue-47715.rs b/src/test/ui/issues/issue-47715.rs similarity index 100% rename from src/test/ui/issue-47715.rs rename to src/test/ui/issues/issue-47715.rs diff --git a/src/test/ui/issue-47715.stderr b/src/test/ui/issues/issue-47715.stderr similarity index 100% rename from src/test/ui/issue-47715.stderr rename to src/test/ui/issues/issue-47715.stderr diff --git a/src/test/ui/issue-48131.rs b/src/test/ui/issues/issue-48131.rs similarity index 100% rename from src/test/ui/issue-48131.rs rename to src/test/ui/issues/issue-48131.rs diff --git a/src/test/ui/issue-48131.stderr b/src/test/ui/issues/issue-48131.stderr similarity index 100% rename from src/test/ui/issue-48131.stderr rename to src/test/ui/issues/issue-48131.stderr diff --git a/src/test/ui/issue-48132.rs b/src/test/ui/issues/issue-48132.rs similarity index 100% rename from src/test/ui/issue-48132.rs rename to src/test/ui/issues/issue-48132.rs diff --git a/src/test/ui/issue-48179.rs b/src/test/ui/issues/issue-48179.rs similarity index 100% rename from src/test/ui/issue-48179.rs rename to src/test/ui/issues/issue-48179.rs diff --git a/src/test/ui/issue-48276.rs b/src/test/ui/issues/issue-48276.rs similarity index 100% rename from src/test/ui/issue-48276.rs rename to src/test/ui/issues/issue-48276.rs diff --git a/src/test/ui/issue-48276.stderr b/src/test/ui/issues/issue-48276.stderr similarity index 100% rename from src/test/ui/issue-48276.stderr rename to src/test/ui/issues/issue-48276.stderr diff --git a/src/test/ui/issue-48364.rs b/src/test/ui/issues/issue-48364.rs similarity index 100% rename from src/test/ui/issue-48364.rs rename to src/test/ui/issues/issue-48364.rs diff --git a/src/test/ui/issue-48364.stderr b/src/test/ui/issues/issue-48364.stderr similarity index 100% rename from src/test/ui/issue-48364.stderr rename to src/test/ui/issues/issue-48364.stderr diff --git a/src/test/ui/issue-48636.fixed b/src/test/ui/issues/issue-48636.fixed similarity index 100% rename from src/test/ui/issue-48636.fixed rename to src/test/ui/issues/issue-48636.fixed diff --git a/src/test/ui/issue-48636.rs b/src/test/ui/issues/issue-48636.rs similarity index 100% rename from src/test/ui/issue-48636.rs rename to src/test/ui/issues/issue-48636.rs diff --git a/src/test/ui/issue-48636.stderr b/src/test/ui/issues/issue-48636.stderr similarity index 100% rename from src/test/ui/issue-48636.stderr rename to src/test/ui/issues/issue-48636.stderr diff --git a/src/test/ui/issue-48728.rs b/src/test/ui/issues/issue-48728.rs similarity index 100% rename from src/test/ui/issue-48728.rs rename to src/test/ui/issues/issue-48728.rs diff --git a/src/test/ui/issue-48728.stderr b/src/test/ui/issues/issue-48728.stderr similarity index 100% rename from src/test/ui/issue-48728.stderr rename to src/test/ui/issues/issue-48728.stderr diff --git a/src/test/ui/issue-48803.rs b/src/test/ui/issues/issue-48803.rs similarity index 100% rename from src/test/ui/issue-48803.rs rename to src/test/ui/issues/issue-48803.rs diff --git a/src/test/ui/issue-48803.stderr b/src/test/ui/issues/issue-48803.stderr similarity index 100% rename from src/test/ui/issue-48803.stderr rename to src/test/ui/issues/issue-48803.stderr diff --git a/src/test/ui/issue-48838.rs b/src/test/ui/issues/issue-48838.rs similarity index 100% rename from src/test/ui/issue-48838.rs rename to src/test/ui/issues/issue-48838.rs diff --git a/src/test/ui/issue-48838.stderr b/src/test/ui/issues/issue-48838.stderr similarity index 100% rename from src/test/ui/issue-48838.stderr rename to src/test/ui/issues/issue-48838.stderr diff --git a/src/test/ui/issue-49040.rs b/src/test/ui/issues/issue-49040.rs similarity index 100% rename from src/test/ui/issue-49040.rs rename to src/test/ui/issues/issue-49040.rs diff --git a/src/test/ui/issue-49040.stderr b/src/test/ui/issues/issue-49040.stderr similarity index 100% rename from src/test/ui/issue-49040.stderr rename to src/test/ui/issues/issue-49040.stderr diff --git a/src/test/ui/issue-49074.rs b/src/test/ui/issues/issue-49074.rs similarity index 100% rename from src/test/ui/issue-49074.rs rename to src/test/ui/issues/issue-49074.rs diff --git a/src/test/ui/issue-49074.stderr b/src/test/ui/issues/issue-49074.stderr similarity index 100% rename from src/test/ui/issue-49074.stderr rename to src/test/ui/issues/issue-49074.stderr diff --git a/src/test/ui/issue-49257.rs b/src/test/ui/issues/issue-49257.rs similarity index 100% rename from src/test/ui/issue-49257.rs rename to src/test/ui/issues/issue-49257.rs diff --git a/src/test/ui/issue-49257.stderr b/src/test/ui/issues/issue-49257.stderr similarity index 100% rename from src/test/ui/issue-49257.stderr rename to src/test/ui/issues/issue-49257.stderr diff --git a/src/test/ui/issue-4935.rs b/src/test/ui/issues/issue-4935.rs similarity index 100% rename from src/test/ui/issue-4935.rs rename to src/test/ui/issues/issue-4935.rs diff --git a/src/test/ui/issue-4935.stderr b/src/test/ui/issues/issue-4935.stderr similarity index 100% rename from src/test/ui/issue-4935.stderr rename to src/test/ui/issues/issue-4935.stderr diff --git a/src/test/ui/issue-49579.rs b/src/test/ui/issues/issue-49579.rs similarity index 100% rename from src/test/ui/issue-49579.rs rename to src/test/ui/issues/issue-49579.rs diff --git a/src/test/ui/issue-4968.rs b/src/test/ui/issues/issue-4968.rs similarity index 100% rename from src/test/ui/issue-4968.rs rename to src/test/ui/issues/issue-4968.rs diff --git a/src/test/ui/issue-4968.stderr b/src/test/ui/issues/issue-4968.stderr similarity index 100% rename from src/test/ui/issue-4968.stderr rename to src/test/ui/issues/issue-4968.stderr diff --git a/src/test/ui/issue-4972.rs b/src/test/ui/issues/issue-4972.rs similarity index 100% rename from src/test/ui/issue-4972.rs rename to src/test/ui/issues/issue-4972.rs diff --git a/src/test/ui/issue-4972.stderr b/src/test/ui/issues/issue-4972.stderr similarity index 100% rename from src/test/ui/issue-4972.stderr rename to src/test/ui/issues/issue-4972.stderr diff --git a/src/test/ui/issue-49824.nll.stderr b/src/test/ui/issues/issue-49824.nll.stderr similarity index 100% rename from src/test/ui/issue-49824.nll.stderr rename to src/test/ui/issues/issue-49824.nll.stderr diff --git a/src/test/ui/issue-49824.rs b/src/test/ui/issues/issue-49824.rs similarity index 100% rename from src/test/ui/issue-49824.rs rename to src/test/ui/issues/issue-49824.rs diff --git a/src/test/ui/issue-49824.stderr b/src/test/ui/issues/issue-49824.stderr similarity index 100% rename from src/test/ui/issue-49824.stderr rename to src/test/ui/issues/issue-49824.stderr diff --git a/src/test/ui/issue-49851/compiler-builtins-error.rs b/src/test/ui/issues/issue-49851/compiler-builtins-error.rs similarity index 100% rename from src/test/ui/issue-49851/compiler-builtins-error.rs rename to src/test/ui/issues/issue-49851/compiler-builtins-error.rs diff --git a/src/test/ui/issue-49851/compiler-builtins-error.stderr b/src/test/ui/issues/issue-49851/compiler-builtins-error.stderr similarity index 100% rename from src/test/ui/issue-49851/compiler-builtins-error.stderr rename to src/test/ui/issues/issue-49851/compiler-builtins-error.stderr diff --git a/src/test/ui/issue-49934.rs b/src/test/ui/issues/issue-49934.rs similarity index 100% rename from src/test/ui/issue-49934.rs rename to src/test/ui/issues/issue-49934.rs diff --git a/src/test/ui/issue-49934.stderr b/src/test/ui/issues/issue-49934.stderr similarity index 100% rename from src/test/ui/issue-49934.stderr rename to src/test/ui/issues/issue-49934.stderr diff --git a/src/test/ui/issue-50187.rs b/src/test/ui/issues/issue-50187.rs similarity index 100% rename from src/test/ui/issue-50187.rs rename to src/test/ui/issues/issue-50187.rs diff --git a/src/test/compile-fail/issue-50264-inner-deref-trait/option_deref.rs b/src/test/ui/issues/issue-50264-inner-deref-trait/option_deref.rs similarity index 100% rename from src/test/compile-fail/issue-50264-inner-deref-trait/option_deref.rs rename to src/test/ui/issues/issue-50264-inner-deref-trait/option_deref.rs diff --git a/src/test/ui/issues/issue-50264-inner-deref-trait/option_deref.stderr b/src/test/ui/issues/issue-50264-inner-deref-trait/option_deref.stderr new file mode 100644 index 0000000000000..a56cd6e8d2f53 --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-50264-inner-deref-trait/result_deref.rs similarity index 100% rename from src/test/compile-fail/issue-50264-inner-deref-trait/result_deref.rs rename to src/test/ui/issues/issue-50264-inner-deref-trait/result_deref.rs diff --git a/src/test/ui/issues/issue-50264-inner-deref-trait/result_deref.stderr b/src/test/ui/issues/issue-50264-inner-deref-trait/result_deref.stderr new file mode 100644 index 0000000000000..d3d7c1993ca5a --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-50264-inner-deref-trait/result_deref_err.rs similarity index 100% rename from src/test/compile-fail/issue-50264-inner-deref-trait/result_deref_err.rs rename to src/test/ui/issues/issue-50264-inner-deref-trait/result_deref_err.rs diff --git a/src/test/ui/issues/issue-50264-inner-deref-trait/result_deref_err.stderr b/src/test/ui/issues/issue-50264-inner-deref-trait/result_deref_err.stderr new file mode 100644 index 0000000000000..bf75687b21f74 --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-50264-inner-deref-trait/result_deref_ok.rs similarity index 100% rename from src/test/compile-fail/issue-50264-inner-deref-trait/result_deref_ok.rs rename to src/test/ui/issues/issue-50264-inner-deref-trait/result_deref_ok.rs diff --git a/src/test/ui/issues/issue-50264-inner-deref-trait/result_deref_ok.stderr b/src/test/ui/issues/issue-50264-inner-deref-trait/result_deref_ok.stderr new file mode 100644 index 0000000000000..a77333a756816 --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-50403.rs b/src/test/ui/issues/issue-50403.rs similarity index 100% rename from src/test/ui/issue-50403.rs rename to src/test/ui/issues/issue-50403.rs diff --git a/src/test/ui/issue-50403.stderr b/src/test/ui/issues/issue-50403.stderr similarity index 100% rename from src/test/ui/issue-50403.stderr rename to src/test/ui/issues/issue-50403.stderr diff --git a/src/test/ui/issue-50471.rs b/src/test/ui/issues/issue-50471.rs similarity index 100% rename from src/test/ui/issue-50471.rs rename to src/test/ui/issues/issue-50471.rs diff --git a/src/test/ui/issue-50480.rs b/src/test/ui/issues/issue-50480.rs similarity index 100% rename from src/test/ui/issue-50480.rs rename to src/test/ui/issues/issue-50480.rs diff --git a/src/test/ui/issue-50480.stderr b/src/test/ui/issues/issue-50480.stderr similarity index 100% rename from src/test/ui/issue-50480.stderr rename to src/test/ui/issues/issue-50480.stderr diff --git a/src/test/ui/issue-50576.rs b/src/test/ui/issues/issue-50576.rs similarity index 100% rename from src/test/ui/issue-50576.rs rename to src/test/ui/issues/issue-50576.rs diff --git a/src/test/ui/issue-50576.stderr b/src/test/ui/issues/issue-50576.stderr similarity index 100% rename from src/test/ui/issue-50576.stderr rename to src/test/ui/issues/issue-50576.stderr diff --git a/src/test/ui/issue-50577.rs b/src/test/ui/issues/issue-50577.rs similarity index 100% rename from src/test/ui/issue-50577.rs rename to src/test/ui/issues/issue-50577.rs diff --git a/src/test/ui/issue-50577.stderr b/src/test/ui/issues/issue-50577.stderr similarity index 100% rename from src/test/ui/issue-50577.stderr rename to src/test/ui/issues/issue-50577.stderr diff --git a/src/test/ui/issue-50581.rs b/src/test/ui/issues/issue-50581.rs similarity index 100% rename from src/test/ui/issue-50581.rs rename to src/test/ui/issues/issue-50581.rs diff --git a/src/test/ui/issue-50581.stderr b/src/test/ui/issues/issue-50581.stderr similarity index 100% rename from src/test/ui/issue-50581.stderr rename to src/test/ui/issues/issue-50581.stderr diff --git a/src/test/ui/issue-50585.rs b/src/test/ui/issues/issue-50585.rs similarity index 100% rename from src/test/ui/issue-50585.rs rename to src/test/ui/issues/issue-50585.rs diff --git a/src/test/ui/issue-50585.stderr b/src/test/ui/issues/issue-50585.stderr similarity index 100% rename from src/test/ui/issue-50585.stderr rename to src/test/ui/issues/issue-50585.stderr diff --git a/src/test/ui/issue-50599.rs b/src/test/ui/issues/issue-50599.rs similarity index 100% rename from src/test/ui/issue-50599.rs rename to src/test/ui/issues/issue-50599.rs diff --git a/src/test/ui/issue-50599.stderr b/src/test/ui/issues/issue-50599.stderr similarity index 100% rename from src/test/ui/issue-50599.stderr rename to src/test/ui/issues/issue-50599.stderr diff --git a/src/test/ui/issue-50600.rs b/src/test/ui/issues/issue-50600.rs similarity index 100% rename from src/test/ui/issue-50600.rs rename to src/test/ui/issues/issue-50600.rs diff --git a/src/test/ui/issue-50600.stderr b/src/test/ui/issues/issue-50600.stderr similarity index 100% rename from src/test/ui/issue-50600.stderr rename to src/test/ui/issues/issue-50600.stderr diff --git a/src/test/ui/issue-50618.rs b/src/test/ui/issues/issue-50618.rs similarity index 100% rename from src/test/ui/issue-50618.rs rename to src/test/ui/issues/issue-50618.rs diff --git a/src/test/ui/issue-50618.stderr b/src/test/ui/issues/issue-50618.stderr similarity index 100% rename from src/test/ui/issue-50618.stderr rename to src/test/ui/issues/issue-50618.stderr diff --git a/src/test/ui/issue-5062.rs b/src/test/ui/issues/issue-5062.rs similarity index 100% rename from src/test/ui/issue-5062.rs rename to src/test/ui/issues/issue-5062.rs diff --git a/src/test/ui/issue-5062.stderr b/src/test/ui/issues/issue-5062.stderr similarity index 100% rename from src/test/ui/issue-5062.stderr rename to src/test/ui/issues/issue-5062.stderr diff --git a/src/test/ui/issue-5067.rs b/src/test/ui/issues/issue-5067.rs similarity index 100% rename from src/test/ui/issue-5067.rs rename to src/test/ui/issues/issue-5067.rs diff --git a/src/test/ui/issue-5067.stderr b/src/test/ui/issues/issue-5067.stderr similarity index 100% rename from src/test/ui/issue-5067.stderr rename to src/test/ui/issues/issue-5067.stderr diff --git a/src/test/ui/issue-50688.rs b/src/test/ui/issues/issue-50688.rs similarity index 100% rename from src/test/ui/issue-50688.rs rename to src/test/ui/issues/issue-50688.rs diff --git a/src/test/ui/issue-50688.stderr b/src/test/ui/issues/issue-50688.stderr similarity index 100% rename from src/test/ui/issue-50688.stderr rename to src/test/ui/issues/issue-50688.stderr diff --git a/src/test/ui/issue-50714-1.rs b/src/test/ui/issues/issue-50714-1.rs similarity index 100% rename from src/test/ui/issue-50714-1.rs rename to src/test/ui/issues/issue-50714-1.rs diff --git a/src/test/ui/issue-50714-1.stderr b/src/test/ui/issues/issue-50714-1.stderr similarity index 100% rename from src/test/ui/issue-50714-1.stderr rename to src/test/ui/issues/issue-50714-1.stderr diff --git a/src/test/ui/issue-50714.rs b/src/test/ui/issues/issue-50714.rs similarity index 100% rename from src/test/ui/issue-50714.rs rename to src/test/ui/issues/issue-50714.rs diff --git a/src/test/ui/issue-50714.stderr b/src/test/ui/issues/issue-50714.stderr similarity index 100% rename from src/test/ui/issue-50714.stderr rename to src/test/ui/issues/issue-50714.stderr diff --git a/src/test/ui/issue-50761.rs b/src/test/ui/issues/issue-50761.rs similarity index 100% rename from src/test/ui/issue-50761.rs rename to src/test/ui/issues/issue-50761.rs diff --git a/src/test/ui/issue-50781.rs b/src/test/ui/issues/issue-50781.rs similarity index 100% rename from src/test/ui/issue-50781.rs rename to src/test/ui/issues/issue-50781.rs diff --git a/src/test/ui/issue-50781.stderr b/src/test/ui/issues/issue-50781.stderr similarity index 100% rename from src/test/ui/issue-50781.stderr rename to src/test/ui/issues/issue-50781.stderr diff --git a/src/test/ui/issue-50802.rs b/src/test/ui/issues/issue-50802.rs similarity index 100% rename from src/test/ui/issue-50802.rs rename to src/test/ui/issues/issue-50802.rs diff --git a/src/test/ui/issue-50802.stderr b/src/test/ui/issues/issue-50802.stderr similarity index 100% rename from src/test/ui/issue-50802.stderr rename to src/test/ui/issues/issue-50802.stderr diff --git a/src/test/ui/issue-50825-1.rs b/src/test/ui/issues/issue-50825-1.rs similarity index 100% rename from src/test/ui/issue-50825-1.rs rename to src/test/ui/issues/issue-50825-1.rs diff --git a/src/test/ui/issue-50825.rs b/src/test/ui/issues/issue-50825.rs similarity index 100% rename from src/test/ui/issue-50825.rs rename to src/test/ui/issues/issue-50825.rs diff --git a/src/test/ui/issue-5099.rs b/src/test/ui/issues/issue-5099.rs similarity index 100% rename from src/test/ui/issue-5099.rs rename to src/test/ui/issues/issue-5099.rs diff --git a/src/test/ui/issue-5099.stderr b/src/test/ui/issues/issue-5099.stderr similarity index 100% rename from src/test/ui/issue-5099.stderr rename to src/test/ui/issues/issue-5099.stderr diff --git a/src/test/ui/issue-50993.rs b/src/test/ui/issues/issue-50993.rs similarity index 100% rename from src/test/ui/issue-50993.rs rename to src/test/ui/issues/issue-50993.rs diff --git a/src/test/ui/issue-50993.stderr b/src/test/ui/issues/issue-50993.stderr similarity index 100% rename from src/test/ui/issue-50993.stderr rename to src/test/ui/issues/issue-50993.stderr diff --git a/src/test/ui/issue-5100.rs b/src/test/ui/issues/issue-5100.rs similarity index 100% rename from src/test/ui/issue-5100.rs rename to src/test/ui/issues/issue-5100.rs diff --git a/src/test/ui/issue-5100.stderr b/src/test/ui/issues/issue-5100.stderr similarity index 100% rename from src/test/ui/issue-5100.stderr rename to src/test/ui/issues/issue-5100.stderr diff --git a/src/test/ui/issue-51022.rs b/src/test/ui/issues/issue-51022.rs similarity index 100% rename from src/test/ui/issue-51022.rs rename to src/test/ui/issues/issue-51022.rs diff --git a/src/test/ui/issue-51022.stderr b/src/test/ui/issues/issue-51022.stderr similarity index 100% rename from src/test/ui/issue-51022.stderr rename to src/test/ui/issues/issue-51022.stderr diff --git a/src/test/ui/issue-51044.rs b/src/test/ui/issues/issue-51044.rs similarity index 100% rename from src/test/ui/issue-51044.rs rename to src/test/ui/issues/issue-51044.rs diff --git a/src/test/ui/issue-51102.rs b/src/test/ui/issues/issue-51102.rs similarity index 100% rename from src/test/ui/issue-51102.rs rename to src/test/ui/issues/issue-51102.rs diff --git a/src/test/ui/issue-51102.stderr b/src/test/ui/issues/issue-51102.stderr similarity index 100% rename from src/test/ui/issue-51102.stderr rename to src/test/ui/issues/issue-51102.stderr diff --git a/src/test/ui/issue-51116.rs b/src/test/ui/issues/issue-51116.rs similarity index 100% rename from src/test/ui/issue-51116.rs rename to src/test/ui/issues/issue-51116.rs diff --git a/src/test/ui/issue-51116.stderr b/src/test/ui/issues/issue-51116.stderr similarity index 100% rename from src/test/ui/issue-51116.stderr rename to src/test/ui/issues/issue-51116.stderr diff --git a/src/test/ui/issue-51244.nll.stderr b/src/test/ui/issues/issue-51244.nll.stderr similarity index 100% rename from src/test/ui/issue-51244.nll.stderr rename to src/test/ui/issues/issue-51244.nll.stderr diff --git a/src/test/ui/issue-51244.rs b/src/test/ui/issues/issue-51244.rs similarity index 100% rename from src/test/ui/issue-51244.rs rename to src/test/ui/issues/issue-51244.rs diff --git a/src/test/ui/issue-51244.stderr b/src/test/ui/issues/issue-51244.stderr similarity index 100% rename from src/test/ui/issue-51244.stderr rename to src/test/ui/issues/issue-51244.stderr diff --git a/src/test/ui/issue-51279.rs b/src/test/ui/issues/issue-51279.rs similarity index 100% rename from src/test/ui/issue-51279.rs rename to src/test/ui/issues/issue-51279.rs diff --git a/src/test/ui/issue-51279.stderr b/src/test/ui/issues/issue-51279.stderr similarity index 100% rename from src/test/ui/issue-51279.stderr rename to src/test/ui/issues/issue-51279.stderr diff --git a/src/test/ui/issue-51515.rs b/src/test/ui/issues/issue-51515.rs similarity index 100% rename from src/test/ui/issue-51515.rs rename to src/test/ui/issues/issue-51515.rs diff --git a/src/test/ui/issue-51515.stderr b/src/test/ui/issues/issue-51515.stderr similarity index 100% rename from src/test/ui/issue-51515.stderr rename to src/test/ui/issues/issue-51515.stderr diff --git a/src/test/ui/issue-5153.rs b/src/test/ui/issues/issue-5153.rs similarity index 100% rename from src/test/ui/issue-5153.rs rename to src/test/ui/issues/issue-5153.rs diff --git a/src/test/ui/issue-5153.stderr b/src/test/ui/issues/issue-5153.stderr similarity index 100% rename from src/test/ui/issue-5153.stderr rename to src/test/ui/issues/issue-5153.stderr diff --git a/src/test/ui/issue-51632-try-desugar-incompatible-types.fixed b/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.fixed similarity index 100% rename from src/test/ui/issue-51632-try-desugar-incompatible-types.fixed rename to src/test/ui/issues/issue-51632-try-desugar-incompatible-types.fixed diff --git a/src/test/ui/issue-51632-try-desugar-incompatible-types.rs b/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.rs similarity index 100% rename from src/test/ui/issue-51632-try-desugar-incompatible-types.rs rename to src/test/ui/issues/issue-51632-try-desugar-incompatible-types.rs diff --git a/src/test/ui/issue-51632-try-desugar-incompatible-types.stderr b/src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr similarity index 100% rename from src/test/ui/issue-51632-try-desugar-incompatible-types.stderr rename to src/test/ui/issues/issue-51632-try-desugar-incompatible-types.stderr diff --git a/src/test/ui/issue-51714.rs b/src/test/ui/issues/issue-51714.rs similarity index 100% rename from src/test/ui/issue-51714.rs rename to src/test/ui/issues/issue-51714.rs diff --git a/src/test/ui/issue-51714.stderr b/src/test/ui/issues/issue-51714.stderr similarity index 100% rename from src/test/ui/issue-51714.stderr rename to src/test/ui/issues/issue-51714.stderr diff --git a/src/test/ui/issue-51848.rs b/src/test/ui/issues/issue-51848.rs similarity index 100% rename from src/test/ui/issue-51848.rs rename to src/test/ui/issues/issue-51848.rs diff --git a/src/test/ui/issue-51848.stderr b/src/test/ui/issues/issue-51848.stderr similarity index 100% rename from src/test/ui/issue-51848.stderr rename to src/test/ui/issues/issue-51848.stderr diff --git a/src/test/ui/issue-51874.rs b/src/test/ui/issues/issue-51874.rs similarity index 100% rename from src/test/ui/issue-51874.rs rename to src/test/ui/issues/issue-51874.rs diff --git a/src/test/ui/issue-51874.stderr b/src/test/ui/issues/issue-51874.stderr similarity index 100% rename from src/test/ui/issue-51874.stderr rename to src/test/ui/issues/issue-51874.stderr diff --git a/src/test/ui/issue-52023-array-size-pointer-cast.rs b/src/test/ui/issues/issue-52023-array-size-pointer-cast.rs similarity index 100% rename from src/test/ui/issue-52023-array-size-pointer-cast.rs rename to src/test/ui/issues/issue-52023-array-size-pointer-cast.rs diff --git a/src/test/ui/issue-52023-array-size-pointer-cast.stderr b/src/test/ui/issues/issue-52023-array-size-pointer-cast.stderr similarity index 100% rename from src/test/ui/issue-52023-array-size-pointer-cast.stderr rename to src/test/ui/issues/issue-52023-array-size-pointer-cast.stderr diff --git a/src/test/ui/issue-52049.nll.stderr b/src/test/ui/issues/issue-52049.nll.stderr similarity index 100% rename from src/test/ui/issue-52049.nll.stderr rename to src/test/ui/issues/issue-52049.nll.stderr diff --git a/src/test/ui/issue-52049.rs b/src/test/ui/issues/issue-52049.rs similarity index 100% rename from src/test/ui/issue-52049.rs rename to src/test/ui/issues/issue-52049.rs diff --git a/src/test/ui/issue-52049.stderr b/src/test/ui/issues/issue-52049.stderr similarity index 100% rename from src/test/ui/issue-52049.stderr rename to src/test/ui/issues/issue-52049.stderr diff --git a/src/test/ui/issue-52057.rs b/src/test/ui/issues/issue-52057.rs similarity index 100% rename from src/test/ui/issue-52057.rs rename to src/test/ui/issues/issue-52057.rs diff --git a/src/test/ui/issue-52126-assign-op-invariance.nll.stderr b/src/test/ui/issues/issue-52126-assign-op-invariance.nll.stderr similarity index 100% rename from src/test/ui/issue-52126-assign-op-invariance.nll.stderr rename to src/test/ui/issues/issue-52126-assign-op-invariance.nll.stderr diff --git a/src/test/ui/issue-52126-assign-op-invariance.rs b/src/test/ui/issues/issue-52126-assign-op-invariance.rs similarity index 100% rename from src/test/ui/issue-52126-assign-op-invariance.rs rename to src/test/ui/issues/issue-52126-assign-op-invariance.rs diff --git a/src/test/ui/issue-52126-assign-op-invariance.stderr b/src/test/ui/issues/issue-52126-assign-op-invariance.stderr similarity index 100% rename from src/test/ui/issue-52126-assign-op-invariance.stderr rename to src/test/ui/issues/issue-52126-assign-op-invariance.stderr diff --git a/src/test/ui/issue-5216.rs b/src/test/ui/issues/issue-5216.rs similarity index 100% rename from src/test/ui/issue-5216.rs rename to src/test/ui/issues/issue-5216.rs diff --git a/src/test/ui/issue-5216.stderr b/src/test/ui/issues/issue-5216.stderr similarity index 100% rename from src/test/ui/issue-5216.stderr rename to src/test/ui/issues/issue-5216.stderr diff --git a/src/test/ui/issue-52213.nll.stderr b/src/test/ui/issues/issue-52213.nll.stderr similarity index 100% rename from src/test/ui/issue-52213.nll.stderr rename to src/test/ui/issues/issue-52213.nll.stderr diff --git a/src/test/ui/issue-52213.rs b/src/test/ui/issues/issue-52213.rs similarity index 100% rename from src/test/ui/issue-52213.rs rename to src/test/ui/issues/issue-52213.rs diff --git a/src/test/ui/issue-52213.stderr b/src/test/ui/issues/issue-52213.stderr similarity index 100% rename from src/test/ui/issue-52213.stderr rename to src/test/ui/issues/issue-52213.stderr diff --git a/src/test/ui/issue-5239-1.rs b/src/test/ui/issues/issue-5239-1.rs similarity index 100% rename from src/test/ui/issue-5239-1.rs rename to src/test/ui/issues/issue-5239-1.rs diff --git a/src/test/ui/issue-5239-1.stderr b/src/test/ui/issues/issue-5239-1.stderr similarity index 100% rename from src/test/ui/issue-5239-1.stderr rename to src/test/ui/issues/issue-5239-1.stderr diff --git a/src/test/compile-fail/issue-52489.rs b/src/test/ui/issues/issue-52489.rs similarity index 100% rename from src/test/compile-fail/issue-52489.rs rename to src/test/ui/issues/issue-52489.rs diff --git a/src/test/ui/issues/issue-52489.stderr b/src/test/ui/issues/issue-52489.stderr new file mode 100644 index 0000000000000..5b38a0789ad7f --- /dev/null +++ b/src/test/ui/issues/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/issue-52533-1.nll.stderr b/src/test/ui/issues/issue-52533-1.nll.stderr similarity index 100% rename from src/test/ui/issue-52533-1.nll.stderr rename to src/test/ui/issues/issue-52533-1.nll.stderr diff --git a/src/test/ui/issue-52533-1.rs b/src/test/ui/issues/issue-52533-1.rs similarity index 100% rename from src/test/ui/issue-52533-1.rs rename to src/test/ui/issues/issue-52533-1.rs diff --git a/src/test/ui/issue-52533-1.stderr b/src/test/ui/issues/issue-52533-1.stderr similarity index 100% rename from src/test/ui/issue-52533-1.stderr rename to src/test/ui/issues/issue-52533-1.stderr diff --git a/src/test/ui/issue-52533.nll.stderr b/src/test/ui/issues/issue-52533.nll.stderr similarity index 100% rename from src/test/ui/issue-52533.nll.stderr rename to src/test/ui/issues/issue-52533.nll.stderr diff --git a/src/test/ui/issue-52533.rs b/src/test/ui/issues/issue-52533.rs similarity index 100% rename from src/test/ui/issue-52533.rs rename to src/test/ui/issues/issue-52533.rs diff --git a/src/test/ui/issue-52533.stderr b/src/test/ui/issues/issue-52533.stderr similarity index 100% rename from src/test/ui/issue-52533.stderr rename to src/test/ui/issues/issue-52533.stderr diff --git a/src/test/ui/issue-5358-1.rs b/src/test/ui/issues/issue-5358-1.rs similarity index 100% rename from src/test/ui/issue-5358-1.rs rename to src/test/ui/issues/issue-5358-1.rs diff --git a/src/test/ui/issue-5358-1.stderr b/src/test/ui/issues/issue-5358-1.stderr similarity index 100% rename from src/test/ui/issue-5358-1.stderr rename to src/test/ui/issues/issue-5358-1.stderr diff --git a/src/test/ui/issue-5439.rs b/src/test/ui/issues/issue-5439.rs similarity index 100% rename from src/test/ui/issue-5439.rs rename to src/test/ui/issues/issue-5439.rs diff --git a/src/test/ui/issue-5439.stderr b/src/test/ui/issues/issue-5439.stderr similarity index 100% rename from src/test/ui/issue-5439.stderr rename to src/test/ui/issues/issue-5439.stderr diff --git a/src/test/ui/issues/issue-5500-1.ast.stderr b/src/test/ui/issues/issue-5500-1.ast.stderr new file mode 100644 index 0000000000000..611eea533b296 --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-5500-1.mir.stderr b/src/test/ui/issues/issue-5500-1.mir.stderr new file mode 100644 index 0000000000000..465485e5e290c --- /dev/null +++ b/src/test/ui/issues/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/issues/issue-5500-1.rs similarity index 97% rename from src/test/compile-fail/issue-5500-1.rs rename to src/test/ui/issues/issue-5500-1.rs index 4bd147a5e1c89..8d6efa774a361 100644 --- a/src/test/compile-fail/issue-5500-1.rs +++ b/src/test/ui/issues/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/issues/issue-5844.rs similarity index 100% rename from src/test/compile-fail/issue-5844.rs rename to src/test/ui/issues/issue-5844.rs diff --git a/src/test/ui/issues/issue-5844.stderr b/src/test/ui/issues/issue-5844.stderr new file mode 100644 index 0000000000000..05b0b63439fff --- /dev/null +++ b/src/test/ui/issues/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/ui/issue-5883.rs b/src/test/ui/issues/issue-5883.rs similarity index 100% rename from src/test/ui/issue-5883.rs rename to src/test/ui/issues/issue-5883.rs diff --git a/src/test/ui/issue-5883.stderr b/src/test/ui/issues/issue-5883.stderr similarity index 100% rename from src/test/ui/issue-5883.stderr rename to src/test/ui/issues/issue-5883.stderr diff --git a/src/test/ui/issue-5927.rs b/src/test/ui/issues/issue-5927.rs similarity index 100% rename from src/test/ui/issue-5927.rs rename to src/test/ui/issues/issue-5927.rs diff --git a/src/test/ui/issue-5927.stderr b/src/test/ui/issues/issue-5927.stderr similarity index 100% rename from src/test/ui/issue-5927.stderr rename to src/test/ui/issues/issue-5927.stderr diff --git a/src/test/ui/issue-5997-enum.rs b/src/test/ui/issues/issue-5997-enum.rs similarity index 100% rename from src/test/ui/issue-5997-enum.rs rename to src/test/ui/issues/issue-5997-enum.rs diff --git a/src/test/ui/issue-5997-enum.stderr b/src/test/ui/issues/issue-5997-enum.stderr similarity index 100% rename from src/test/ui/issue-5997-enum.stderr rename to src/test/ui/issues/issue-5997-enum.stderr diff --git a/src/test/ui/issue-5997-struct.rs b/src/test/ui/issues/issue-5997-struct.rs similarity index 100% rename from src/test/ui/issue-5997-struct.rs rename to src/test/ui/issues/issue-5997-struct.rs diff --git a/src/test/ui/issue-5997-struct.stderr b/src/test/ui/issues/issue-5997-struct.stderr similarity index 100% rename from src/test/ui/issue-5997-struct.stderr rename to src/test/ui/issues/issue-5997-struct.stderr diff --git a/src/test/ui/issue-6458-2.rs b/src/test/ui/issues/issue-6458-2.rs similarity index 100% rename from src/test/ui/issue-6458-2.rs rename to src/test/ui/issues/issue-6458-2.rs diff --git a/src/test/ui/issue-6458-2.stderr b/src/test/ui/issues/issue-6458-2.stderr similarity index 100% rename from src/test/ui/issue-6458-2.stderr rename to src/test/ui/issues/issue-6458-2.stderr diff --git a/src/test/ui/issue-6458-3.rs b/src/test/ui/issues/issue-6458-3.rs similarity index 100% rename from src/test/ui/issue-6458-3.rs rename to src/test/ui/issues/issue-6458-3.rs diff --git a/src/test/ui/issue-6458-3.stderr b/src/test/ui/issues/issue-6458-3.stderr similarity index 100% rename from src/test/ui/issue-6458-3.stderr rename to src/test/ui/issues/issue-6458-3.stderr diff --git a/src/test/ui/issue-6458-4.rs b/src/test/ui/issues/issue-6458-4.rs similarity index 100% rename from src/test/ui/issue-6458-4.rs rename to src/test/ui/issues/issue-6458-4.rs diff --git a/src/test/ui/issue-6458-4.stderr b/src/test/ui/issues/issue-6458-4.stderr similarity index 100% rename from src/test/ui/issue-6458-4.stderr rename to src/test/ui/issues/issue-6458-4.stderr diff --git a/src/test/ui/issue-6458.rs b/src/test/ui/issues/issue-6458.rs similarity index 100% rename from src/test/ui/issue-6458.rs rename to src/test/ui/issues/issue-6458.rs diff --git a/src/test/ui/issue-6458.stderr b/src/test/ui/issues/issue-6458.stderr similarity index 100% rename from src/test/ui/issue-6458.stderr rename to src/test/ui/issues/issue-6458.stderr diff --git a/src/test/ui/issue-6596-1.rs b/src/test/ui/issues/issue-6596-1.rs similarity index 100% rename from src/test/ui/issue-6596-1.rs rename to src/test/ui/issues/issue-6596-1.rs diff --git a/src/test/ui/issue-6596-1.stderr b/src/test/ui/issues/issue-6596-1.stderr similarity index 100% rename from src/test/ui/issue-6596-1.stderr rename to src/test/ui/issues/issue-6596-1.stderr diff --git a/src/test/ui/issue-6596-2.rs b/src/test/ui/issues/issue-6596-2.rs similarity index 100% rename from src/test/ui/issue-6596-2.rs rename to src/test/ui/issues/issue-6596-2.rs diff --git a/src/test/ui/issue-6596-2.stderr b/src/test/ui/issues/issue-6596-2.stderr similarity index 100% rename from src/test/ui/issue-6596-2.stderr rename to src/test/ui/issues/issue-6596-2.stderr diff --git a/src/test/ui/issue-6642.rs b/src/test/ui/issues/issue-6642.rs similarity index 100% rename from src/test/ui/issue-6642.rs rename to src/test/ui/issues/issue-6642.rs diff --git a/src/test/ui/issue-6642.stderr b/src/test/ui/issues/issue-6642.stderr similarity index 100% rename from src/test/ui/issue-6642.stderr rename to src/test/ui/issues/issue-6642.stderr diff --git a/src/test/ui/issue-6738.rs b/src/test/ui/issues/issue-6738.rs similarity index 100% rename from src/test/ui/issue-6738.rs rename to src/test/ui/issues/issue-6738.rs diff --git a/src/test/ui/issue-6738.stderr b/src/test/ui/issues/issue-6738.stderr similarity index 100% rename from src/test/ui/issue-6738.stderr rename to src/test/ui/issues/issue-6738.stderr diff --git a/src/test/ui/issue-6801.nll.stderr b/src/test/ui/issues/issue-6801.nll.stderr similarity index 100% rename from src/test/ui/issue-6801.nll.stderr rename to src/test/ui/issues/issue-6801.nll.stderr diff --git a/src/test/ui/issue-6801.rs b/src/test/ui/issues/issue-6801.rs similarity index 100% rename from src/test/ui/issue-6801.rs rename to src/test/ui/issues/issue-6801.rs diff --git a/src/test/ui/issue-6801.stderr b/src/test/ui/issues/issue-6801.stderr similarity index 100% rename from src/test/ui/issue-6801.stderr rename to src/test/ui/issues/issue-6801.stderr diff --git a/src/test/ui/issue-6804.rs b/src/test/ui/issues/issue-6804.rs similarity index 100% rename from src/test/ui/issue-6804.rs rename to src/test/ui/issues/issue-6804.rs diff --git a/src/test/ui/issue-6804.stderr b/src/test/ui/issues/issue-6804.stderr similarity index 100% rename from src/test/ui/issue-6804.stderr rename to src/test/ui/issues/issue-6804.stderr diff --git a/src/test/ui/issue-6936.rs b/src/test/ui/issues/issue-6936.rs similarity index 100% rename from src/test/ui/issue-6936.rs rename to src/test/ui/issues/issue-6936.rs diff --git a/src/test/ui/issue-6936.stderr b/src/test/ui/issues/issue-6936.stderr similarity index 100% rename from src/test/ui/issue-6936.stderr rename to src/test/ui/issues/issue-6936.stderr diff --git a/src/test/ui/issue-7013.rs b/src/test/ui/issues/issue-7013.rs similarity index 100% rename from src/test/ui/issue-7013.rs rename to src/test/ui/issues/issue-7013.rs diff --git a/src/test/ui/issue-7013.stderr b/src/test/ui/issues/issue-7013.stderr similarity index 100% rename from src/test/ui/issue-7013.stderr rename to src/test/ui/issues/issue-7013.stderr diff --git a/src/test/ui/issue-7044.rs b/src/test/ui/issues/issue-7044.rs similarity index 100% rename from src/test/ui/issue-7044.rs rename to src/test/ui/issues/issue-7044.rs diff --git a/src/test/ui/issue-7044.stderr b/src/test/ui/issues/issue-7044.stderr similarity index 100% rename from src/test/ui/issue-7044.stderr rename to src/test/ui/issues/issue-7044.stderr diff --git a/src/test/ui/issue-7061.rs b/src/test/ui/issues/issue-7061.rs similarity index 100% rename from src/test/ui/issue-7061.rs rename to src/test/ui/issues/issue-7061.rs diff --git a/src/test/ui/issue-7061.stderr b/src/test/ui/issues/issue-7061.stderr similarity index 100% rename from src/test/ui/issue-7061.stderr rename to src/test/ui/issues/issue-7061.stderr diff --git a/src/test/ui/issue-7092.rs b/src/test/ui/issues/issue-7092.rs similarity index 100% rename from src/test/ui/issue-7092.rs rename to src/test/ui/issues/issue-7092.rs diff --git a/src/test/ui/issue-7092.stderr b/src/test/ui/issues/issue-7092.stderr similarity index 100% rename from src/test/ui/issue-7092.stderr rename to src/test/ui/issues/issue-7092.stderr diff --git a/src/test/ui/issue-7246.rs b/src/test/ui/issues/issue-7246.rs similarity index 100% rename from src/test/ui/issue-7246.rs rename to src/test/ui/issues/issue-7246.rs diff --git a/src/test/ui/issue-7246.stderr b/src/test/ui/issues/issue-7246.stderr similarity index 100% rename from src/test/ui/issue-7246.stderr rename to src/test/ui/issues/issue-7246.stderr diff --git a/src/test/ui/issue-7364.rs b/src/test/ui/issues/issue-7364.rs similarity index 100% rename from src/test/ui/issue-7364.rs rename to src/test/ui/issues/issue-7364.rs diff --git a/src/test/ui/issue-7364.stderr b/src/test/ui/issues/issue-7364.stderr similarity index 100% rename from src/test/ui/issue-7364.stderr rename to src/test/ui/issues/issue-7364.stderr diff --git a/src/test/ui/issue-7607-1.rs b/src/test/ui/issues/issue-7607-1.rs similarity index 100% rename from src/test/ui/issue-7607-1.rs rename to src/test/ui/issues/issue-7607-1.rs diff --git a/src/test/ui/issue-7607-1.stderr b/src/test/ui/issues/issue-7607-1.stderr similarity index 100% rename from src/test/ui/issue-7607-1.stderr rename to src/test/ui/issues/issue-7607-1.stderr diff --git a/src/test/ui/issue-7813.rs b/src/test/ui/issues/issue-7813.rs similarity index 100% rename from src/test/ui/issue-7813.rs rename to src/test/ui/issues/issue-7813.rs diff --git a/src/test/ui/issue-7813.stderr b/src/test/ui/issues/issue-7813.stderr similarity index 100% rename from src/test/ui/issue-7813.stderr rename to src/test/ui/issues/issue-7813.stderr diff --git a/src/test/ui/issue-7867.rs b/src/test/ui/issues/issue-7867.rs similarity index 100% rename from src/test/ui/issue-7867.rs rename to src/test/ui/issues/issue-7867.rs diff --git a/src/test/ui/issue-7867.stderr b/src/test/ui/issues/issue-7867.stderr similarity index 100% rename from src/test/ui/issue-7867.stderr rename to src/test/ui/issues/issue-7867.stderr diff --git a/src/test/ui/issue-7950.rs b/src/test/ui/issues/issue-7950.rs similarity index 100% rename from src/test/ui/issue-7950.rs rename to src/test/ui/issues/issue-7950.rs diff --git a/src/test/ui/issue-7950.stderr b/src/test/ui/issues/issue-7950.stderr similarity index 100% rename from src/test/ui/issue-7950.stderr rename to src/test/ui/issues/issue-7950.stderr diff --git a/src/test/ui/issue-7970a.rs b/src/test/ui/issues/issue-7970a.rs similarity index 100% rename from src/test/ui/issue-7970a.rs rename to src/test/ui/issues/issue-7970a.rs diff --git a/src/test/ui/issue-7970a.stderr b/src/test/ui/issues/issue-7970a.stderr similarity index 100% rename from src/test/ui/issue-7970a.stderr rename to src/test/ui/issues/issue-7970a.stderr diff --git a/src/test/ui/issue-7970b.rs b/src/test/ui/issues/issue-7970b.rs similarity index 100% rename from src/test/ui/issue-7970b.rs rename to src/test/ui/issues/issue-7970b.rs diff --git a/src/test/ui/issue-7970b.stderr b/src/test/ui/issues/issue-7970b.stderr similarity index 100% rename from src/test/ui/issue-7970b.stderr rename to src/test/ui/issues/issue-7970b.stderr diff --git a/src/test/ui/issue-8153.rs b/src/test/ui/issues/issue-8153.rs similarity index 100% rename from src/test/ui/issue-8153.rs rename to src/test/ui/issues/issue-8153.rs diff --git a/src/test/ui/issue-8153.stderr b/src/test/ui/issues/issue-8153.stderr similarity index 100% rename from src/test/ui/issue-8153.stderr rename to src/test/ui/issues/issue-8153.stderr diff --git a/src/test/ui/issue-8208.rs b/src/test/ui/issues/issue-8208.rs similarity index 100% rename from src/test/ui/issue-8208.rs rename to src/test/ui/issues/issue-8208.rs diff --git a/src/test/ui/issue-8208.stderr b/src/test/ui/issues/issue-8208.stderr similarity index 100% rename from src/test/ui/issue-8208.stderr rename to src/test/ui/issues/issue-8208.stderr diff --git a/src/test/ui/issue-8460-const.rs b/src/test/ui/issues/issue-8460-const.rs similarity index 100% rename from src/test/ui/issue-8460-const.rs rename to src/test/ui/issues/issue-8460-const.rs diff --git a/src/test/ui/issue-8460-const.stderr b/src/test/ui/issues/issue-8460-const.stderr similarity index 100% rename from src/test/ui/issue-8460-const.stderr rename to src/test/ui/issues/issue-8460-const.stderr diff --git a/src/test/ui/issue-8640.rs b/src/test/ui/issues/issue-8640.rs similarity index 100% rename from src/test/ui/issue-8640.rs rename to src/test/ui/issues/issue-8640.rs diff --git a/src/test/ui/issue-8640.stderr b/src/test/ui/issues/issue-8640.stderr similarity index 100% rename from src/test/ui/issue-8640.stderr rename to src/test/ui/issues/issue-8640.stderr diff --git a/src/test/ui/issue-8727.rs b/src/test/ui/issues/issue-8727.rs similarity index 100% rename from src/test/ui/issue-8727.rs rename to src/test/ui/issues/issue-8727.rs diff --git a/src/test/ui/issue-8727.stderr b/src/test/ui/issues/issue-8727.stderr similarity index 100% rename from src/test/ui/issue-8727.stderr rename to src/test/ui/issues/issue-8727.stderr diff --git a/src/test/ui/issue-8761.rs b/src/test/ui/issues/issue-8761.rs similarity index 100% rename from src/test/ui/issue-8761.rs rename to src/test/ui/issues/issue-8761.rs diff --git a/src/test/ui/issue-8761.stderr b/src/test/ui/issues/issue-8761.stderr similarity index 100% rename from src/test/ui/issue-8761.stderr rename to src/test/ui/issues/issue-8761.stderr diff --git a/src/test/ui/issue-8767.rs b/src/test/ui/issues/issue-8767.rs similarity index 100% rename from src/test/ui/issue-8767.rs rename to src/test/ui/issues/issue-8767.rs diff --git a/src/test/ui/issue-8767.stderr b/src/test/ui/issues/issue-8767.stderr similarity index 100% rename from src/test/ui/issue-8767.stderr rename to src/test/ui/issues/issue-8767.stderr diff --git a/src/test/ui/issue-9575.rs b/src/test/ui/issues/issue-9575.rs similarity index 100% rename from src/test/ui/issue-9575.rs rename to src/test/ui/issues/issue-9575.rs diff --git a/src/test/ui/issue-9575.stderr b/src/test/ui/issues/issue-9575.stderr similarity index 100% rename from src/test/ui/issue-9575.stderr rename to src/test/ui/issues/issue-9575.stderr diff --git a/src/test/ui/issue-9725.rs b/src/test/ui/issues/issue-9725.rs similarity index 100% rename from src/test/ui/issue-9725.rs rename to src/test/ui/issues/issue-9725.rs diff --git a/src/test/ui/issue-9725.stderr b/src/test/ui/issues/issue-9725.stderr similarity index 100% rename from src/test/ui/issue-9725.stderr rename to src/test/ui/issues/issue-9725.stderr diff --git a/src/test/ui/issue-9814.rs b/src/test/ui/issues/issue-9814.rs similarity index 100% rename from src/test/ui/issue-9814.rs rename to src/test/ui/issues/issue-9814.rs diff --git a/src/test/ui/issue-9814.stderr b/src/test/ui/issues/issue-9814.stderr similarity index 100% rename from src/test/ui/issue-9814.stderr rename to src/test/ui/issues/issue-9814.stderr diff --git a/src/test/ui/issue-pr29383.rs b/src/test/ui/issues/issue-pr29383.rs similarity index 100% rename from src/test/ui/issue-pr29383.rs rename to src/test/ui/issues/issue-pr29383.rs diff --git a/src/test/ui/issue-pr29383.stderr b/src/test/ui/issues/issue-pr29383.stderr similarity index 100% rename from src/test/ui/issue-pr29383.stderr rename to src/test/ui/issues/issue-pr29383.stderr diff --git a/src/test/compile-fail/issue32829.rs b/src/test/ui/issues/issue32829.rs similarity index 100% rename from src/test/compile-fail/issue32829.rs rename to src/test/ui/issues/issue32829.rs diff --git a/src/test/ui/issues/issue32829.stderr b/src/test/ui/issues/issue32829.stderr new file mode 100644 index 0000000000000..dad0880dbdfd7 --- /dev/null +++ b/src/test/ui/issues/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/keyword/keyword-extern-as-identifier.rs similarity index 100% rename from src/test/compile-fail/keyword-extern-as-identifier.rs rename to src/test/ui/keyword/keyword-extern-as-identifier.rs diff --git a/src/test/ui/keyword/keyword-extern-as-identifier.stderr b/src/test/ui/keyword/keyword-extern-as-identifier.stderr new file mode 100644 index 0000000000000..523da8d32c403 --- /dev/null +++ b/src/test/ui/keyword/keyword-extern-as-identifier.stderr @@ -0,0 +1,9 @@ +error[E0531]: cannot find unit struct/variant or constant `extern` in this scope + --> $DIR/keyword-extern-as-identifier.rs:14:9 + | +LL | let extern = 0; //~ ERROR cannot find unit struct/variant or constant `extern` 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-false-as-identifier.rs b/src/test/ui/keyword/keyword-false-as-identifier.rs similarity index 100% rename from src/test/compile-fail/keyword-false-as-identifier.rs rename to src/test/ui/keyword/keyword-false-as-identifier.rs diff --git a/src/test/ui/keyword/keyword-false-as-identifier.stderr b/src/test/ui/keyword/keyword-false-as-identifier.stderr new file mode 100644 index 0000000000000..13f675404f6b5 --- /dev/null +++ b/src/test/ui/keyword/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/keyword/keyword-self-as-identifier.rs similarity index 100% rename from src/test/compile-fail/keyword-self-as-identifier.rs rename to src/test/ui/keyword/keyword-self-as-identifier.rs diff --git a/src/test/ui/keyword/keyword-self-as-identifier.stderr b/src/test/ui/keyword/keyword-self-as-identifier.stderr new file mode 100644 index 0000000000000..c47f4aeabefd8 --- /dev/null +++ b/src/test/ui/keyword/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/keyword/keyword-super-as-identifier.rs similarity index 100% rename from src/test/compile-fail/keyword-super-as-identifier.rs rename to src/test/ui/keyword/keyword-super-as-identifier.rs diff --git a/src/test/ui/keyword/keyword-super-as-identifier.stderr b/src/test/ui/keyword/keyword-super-as-identifier.stderr new file mode 100644 index 0000000000000..649be45c22459 --- /dev/null +++ b/src/test/ui/keyword/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/keyword/keyword-super.rs similarity index 100% rename from src/test/compile-fail/keyword-super.rs rename to src/test/ui/keyword/keyword-super.rs diff --git a/src/test/ui/keyword/keyword-super.stderr b/src/test/ui/keyword/keyword-super.stderr new file mode 100644 index 0000000000000..ac692ad45d2bd --- /dev/null +++ b/src/test/ui/keyword/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/keyword/keyword-true-as-identifier.rs similarity index 100% rename from src/test/compile-fail/keyword-true-as-identifier.rs rename to src/test/ui/keyword/keyword-true-as-identifier.rs diff --git a/src/test/ui/keyword/keyword-true-as-identifier.stderr b/src/test/ui/keyword/keyword-true-as-identifier.stderr new file mode 100644 index 0000000000000..776470ba77c9e --- /dev/null +++ b/src/test/ui/keyword/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/kindck/kindck-copy.rs similarity index 100% rename from src/test/compile-fail/kindck-copy.rs rename to src/test/ui/kindck/kindck-copy.rs diff --git a/src/test/ui/kindck/kindck-copy.stderr b/src/test/ui/kindck/kindck-copy.stderr new file mode 100644 index 0000000000000..8d72d91268918 --- /dev/null +++ b/src/test/ui/kindck/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: + +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_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: + +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::boxed::Box: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:41:5 + | +LL | assert_copy::>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:42:5 + | +LL | assert_copy::(); //~ 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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::vec::Vec: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:43:5 + | +LL | assert_copy:: >(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::vec::Vec` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_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::>(); //~ 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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::boxed::Box: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:52:5 + | +LL | assert_copy::>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_copy() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::boxed::Box: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:53:5 + | +LL | assert_copy::>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `MyNoncopyStruct: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:74:5 + | +LL | assert_copy::(); //~ 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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::rc::Rc: std::marker::Copy` is not satisfied + --> $DIR/kindck-copy.rs:77:5 + | +LL | assert_copy::>(); //~ ERROR : std::marker::Copy` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::rc::Rc` + | +note: required by `assert_copy` + --> $DIR/kindck-copy.rs:15:1 + | +LL | fn assert_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/kindck/kindck-impl-type-params-2.rs similarity index 100% rename from src/test/compile-fail/kindck-impl-type-params-2.rs rename to src/test/ui/kindck/kindck-impl-type-params-2.rs diff --git a/src/test/ui/kindck/kindck-impl-type-params-2.stderr b/src/test/ui/kindck/kindck-impl-type-params-2.stderr new file mode 100644 index 0000000000000..e4c02085ddb79 --- /dev/null +++ b/src/test/ui/kindck/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(foo: &T) { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-impl-type-params.nll.stderr b/src/test/ui/kindck/kindck-impl-type-params.nll.stderr new file mode 100644 index 0000000000000..8f24baf7fc46f --- /dev/null +++ b/src/test/ui/kindck/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` 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` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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; + | ^^ 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` for `S` + = note: required for the cast to the object type `dyn Gettable` + +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/kindck-impl-type-params.rs:35:27 + | +LL | let a: &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` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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; + | ^^ 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` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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>; + | ^ the trait `std::marker::Copy` is not implemented for `std::string::String` + | + = note: required because of the requirements on the impl of `Gettable` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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> = t; + | ^ the trait `std::marker::Copy` is not implemented for `foo3::Foo` + | + = note: required because of the requirements on the impl of `Gettable` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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/kindck/kindck-impl-type-params.rs similarity index 100% rename from src/test/compile-fail/kindck-impl-type-params.rs rename to src/test/ui/kindck/kindck-impl-type-params.rs diff --git a/src/test/ui/kindck/kindck-impl-type-params.stderr b/src/test/ui/kindck/kindck-impl-type-params.stderr new file mode 100644 index 0000000000000..b938d40c76566 --- /dev/null +++ b/src/test/ui/kindck/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` 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` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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; + | ^^ 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` for `S` + = note: required for the cast to the object type `dyn Gettable` + +error[E0277]: `T` cannot be sent between threads safely + --> $DIR/kindck-impl-type-params.rs:35:27 + | +LL | let a: &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` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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; + | ^^ 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` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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>; + | ^ the trait `std::marker::Copy` is not implemented for `std::string::String` + | + = note: required because of the requirements on the impl of `Gettable` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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> = t; + | ^ the trait `std::marker::Copy` is not implemented for `foo3::Foo` + | + = note: required because of the requirements on the impl of `Gettable` for `S` + = note: required for the cast to the object type `dyn Gettable` + +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/kindck/kindck-inherited-copy-bound.rs similarity index 100% rename from src/test/compile-fail/kindck-inherited-copy-bound.rs rename to src/test/ui/kindck/kindck-inherited-copy-bound.rs diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.stderr new file mode 100644 index 0000000000000..542ecc0c00482 --- /dev/null +++ b/src/test/ui/kindck/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(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/kindck/kindck-nonsendable-1.rs similarity index 100% rename from src/test/compile-fail/kindck-nonsendable-1.rs rename to src/test/ui/kindck/kindck-nonsendable-1.rs diff --git a/src/test/ui/kindck/kindck-nonsendable-1.stderr b/src/test/ui/kindck/kindck-nonsendable-1.stderr new file mode 100644 index 0000000000000..a8aa02e1d627a --- /dev/null +++ b/src/test/ui/kindck/kindck-nonsendable-1.stderr @@ -0,0 +1,17 @@ +error[E0277]: `std::rc::Rc` cannot be sent between threads safely + --> $DIR/kindck-nonsendable-1.rs:20:5 + | +LL | bar(move|| foo(x)); + | ^^^ `std::rc::Rc` cannot be sent between threads safely + | + = help: within `[closure@$DIR/kindck-nonsendable-1.rs:20:9: 20:22 x:std::rc::Rc]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc` + = note: required because it appears within the type `[closure@$DIR/kindck-nonsendable-1.rs:20:9: 20:22 x:std::rc::Rc]` +note: required by `bar` + --> $DIR/kindck-nonsendable-1.rs:16:1 + | +LL | fn bar(_: 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/kindck/kindck-send-object.rs similarity index 100% rename from src/test/compile-fail/kindck-send-object.rs rename to src/test/ui/kindck/kindck-send-object.rs diff --git a/src/test/ui/kindck/kindck-send-object.stderr b/src/test/ui/kindck/kindck-send-object.stderr new file mode 100644 index 0000000000000..e342352d590c8 --- /dev/null +++ b/src/test/ui/kindck/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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `dyn Dummy` cannot be sent between threads safely + --> $DIR/kindck-send-object.rs:27:5 + | +LL | assert_send::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ `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` + = note: required because it appears within the type `std::boxed::Box` +note: required by `assert_send` + --> $DIR/kindck-send-object.rs:15:1 + | +LL | fn assert_send() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/kindck/kindck-send-object1.nll.stderr b/src/test/ui/kindck/kindck-send-object1.nll.stderr new file mode 100644 index 0000000000000..6613a29cd7688 --- /dev/null +++ b/src/test/ui/kindck/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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/kindck/kindck-send-object1.rs similarity index 100% rename from src/test/compile-fail/kindck-send-object1.rs rename to src/test/ui/kindck/kindck-send-object1.rs diff --git a/src/test/ui/kindck/kindck-send-object1.stderr b/src/test/ui/kindck/kindck-send-object1.stderr new file mode 100644 index 0000000000000..d906b7d9e1699 --- /dev/null +++ b/src/test/ui/kindck/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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/kindck/kindck-send-object2.rs similarity index 100% rename from src/test/compile-fail/kindck-send-object2.rs rename to src/test/ui/kindck/kindck-send-object2.rs diff --git a/src/test/ui/kindck/kindck-send-object2.stderr b/src/test/ui/kindck/kindck-send-object2.stderr new file mode 100644 index 0000000000000..475159cd40032 --- /dev/null +++ b/src/test/ui/kindck/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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `dyn Dummy` cannot be sent between threads safely + --> $DIR/kindck-send-object2.rs:22:5 + | +LL | assert_send::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ `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` + = note: required because it appears within the type `std::boxed::Box` +note: required by `assert_send` + --> $DIR/kindck-send-object2.rs:13:1 + | +LL | fn assert_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/kindck/kindck-send-owned.rs similarity index 100% rename from src/test/compile-fail/kindck-send-owned.rs rename to src/test/ui/kindck/kindck-send-owned.rs diff --git a/src/test/ui/kindck/kindck-send-owned.stderr b/src/test/ui/kindck/kindck-send-owned.stderr new file mode 100644 index 0000000000000..f5781bd968e2e --- /dev/null +++ b/src/test/ui/kindck/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::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +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/kindck/kindck-send-unsafe.rs similarity index 100% rename from src/test/compile-fail/kindck-send-unsafe.rs rename to src/test/ui/kindck/kindck-send-unsafe.rs diff --git a/src/test/compile-fail/kindck-send-unsafe.rs~rust-lang_master b/src/test/ui/kindck/kindck-send-unsafe.rs~rust-lang_master similarity index 100% rename from src/test/compile-fail/kindck-send-unsafe.rs~rust-lang_master rename to src/test/ui/kindck/kindck-send-unsafe.rs~rust-lang_master diff --git a/src/test/ui/kindck/kindck-send-unsafe.stderr b/src/test/ui/kindck/kindck-send-unsafe.stderr new file mode 100644 index 0000000000000..846de09ba3cb0 --- /dev/null +++ b/src/test/ui/kindck/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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +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/label/label-static.rs similarity index 100% rename from src/test/compile-fail/label-static.rs rename to src/test/ui/label/label-static.rs diff --git a/src/test/ui/label/label-static.stderr b/src/test/ui/label/label-static.stderr new file mode 100644 index 0000000000000..f5b6eba00899c --- /dev/null +++ b/src/test/ui/label/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/label/label-underscore.rs similarity index 100% rename from src/test/compile-fail/label-underscore.rs rename to src/test/ui/label/label-underscore.rs diff --git a/src/test/ui/label/label-underscore.stderr b/src/test/ui/label/label-underscore.stderr new file mode 100644 index 0000000000000..9a567094c82f1 --- /dev/null +++ b/src/test/ui/label/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/ui/label_break_value_continue.rs b/src/test/ui/label/label_break_value_continue.rs similarity index 100% rename from src/test/ui/label_break_value_continue.rs rename to src/test/ui/label/label_break_value_continue.rs diff --git a/src/test/ui/label_break_value_continue.stderr b/src/test/ui/label/label_break_value_continue.stderr similarity index 100% rename from src/test/ui/label_break_value_continue.stderr rename to src/test/ui/label/label_break_value_continue.stderr diff --git a/src/test/ui/label_break_value_illegal_uses.rs b/src/test/ui/label/label_break_value_illegal_uses.rs similarity index 100% rename from src/test/ui/label_break_value_illegal_uses.rs rename to src/test/ui/label/label_break_value_illegal_uses.rs diff --git a/src/test/ui/label_break_value_illegal_uses.stderr b/src/test/ui/label/label_break_value_illegal_uses.stderr similarity index 100% rename from src/test/ui/label_break_value_illegal_uses.stderr rename to src/test/ui/label/label_break_value_illegal_uses.stderr diff --git a/src/test/ui/label_break_value_unlabeled_break.rs b/src/test/ui/label/label_break_value_unlabeled_break.rs similarity index 100% rename from src/test/ui/label_break_value_unlabeled_break.rs rename to src/test/ui/label/label_break_value_unlabeled_break.rs diff --git a/src/test/ui/label_break_value_unlabeled_break.stderr b/src/test/ui/label/label_break_value_unlabeled_break.stderr similarity index 100% rename from src/test/ui/label_break_value_unlabeled_break.stderr rename to src/test/ui/label/label_break_value_unlabeled_break.stderr diff --git a/src/test/compile-fail/lang-item-missing.rs b/src/test/ui/lang-item-missing.rs similarity index 100% rename from src/test/compile-fail/lang-item-missing.rs rename to src/test/ui/lang-item-missing.rs diff --git a/src/test/ui/lang-item-missing.stderr b/src/test/ui/lang-item-missing.stderr new file mode 100644 index 0000000000000..f7516c7d377da --- /dev/null +++ b/src/test/ui/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/lexical-scopes.rs similarity index 100% rename from src/test/compile-fail/lexical-scopes.rs rename to src/test/ui/lexical-scopes.rs diff --git a/src/test/ui/lexical-scopes.stderr b/src/test/ui/lexical-scopes.stderr new file mode 100644 index 0000000000000..3a6ae52c68dc6 --- /dev/null +++ b/src/test/ui/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/compile-fail/auxiliary/lifetime_bound_will_change_warning_lib.rs b/src/test/ui/lifetimes/auxiliary/lifetime_bound_will_change_warning_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lifetime_bound_will_change_warning_lib.rs rename to src/test/ui/lifetimes/auxiliary/lifetime_bound_will_change_warning_lib.rs diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.nll.stderr new file mode 100644 index 0000000000000..ab9bb19563127 --- /dev/null +++ b/src/test/ui/lifetimes/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) { + | - `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) { + | - `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/lifetimes/lifetime-bound-will-change-warning.rs similarity index 100% rename from src/test/compile-fail/lifetime-bound-will-change-warning.rs rename to src/test/ui/lifetimes/lifetime-bound-will-change-warning.rs diff --git a/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr b/src/test/ui/lifetimes/lifetime-bound-will-change-warning.stderr new file mode 100644 index 0000000000000..01f215c97f2b4 --- /dev/null +++ b/src/test/ui/lifetimes/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) { + | ^^ + = 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) { + | ^^ + = 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/ui/lifetime-elision-return-type-requires-explicit-lifetime.rs b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs similarity index 100% rename from src/test/ui/lifetime-elision-return-type-requires-explicit-lifetime.rs rename to src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.rs diff --git a/src/test/ui/lifetime-elision-return-type-requires-explicit-lifetime.stderr b/src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr similarity index 100% rename from src/test/ui/lifetime-elision-return-type-requires-explicit-lifetime.stderr rename to src/test/ui/lifetimes/lifetime-elision-return-type-requires-explicit-lifetime.stderr diff --git a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.nll.stderr diff --git a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.rs b/src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.rs similarity index 100% rename from src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.rs rename to src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.rs diff --git a/src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr b/src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.stderr similarity index 100% rename from src/test/ui/lifetime-errors/42701_one_named_and_one_anonymous.stderr rename to src/test/ui/lifetimes/lifetime-errors/42701_one_named_and_one_anonymous.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.rs diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-2.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.rs diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-3.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.rs diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-2.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.rs diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.rs diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.rs diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-if-else.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.rs diff --git a/src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.stderr diff --git a/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.rs b/src/test/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.rs rename to src/test/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.rs diff --git a/src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.stderr b/src/test/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex1b-return-no-names-if-else.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex1b-return-no-names-if-else.stderr diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.rs rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.rs diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2a-push-one-existing-name-2.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-2.stderr diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2a-push-one-existing-name.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.rs b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex2a-push-one-existing-name.rs rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.rs diff --git a/src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2a-push-one-existing-name.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2a-push-one-existing-name.stderr diff --git a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2b-push-no-existing-names.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.rs b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex2b-push-no-existing-names.rs rename to src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.rs diff --git a/src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2b-push-no-existing-names.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2b-push-no-existing-names.stderr diff --git a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2c-push-inference-variable.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.rs b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex2c-push-inference-variable.rs rename to src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.rs diff --git a/src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2c-push-inference-variable.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2c-push-inference-variable.stderr diff --git a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.rs rename to src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.rs diff --git a/src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2d-push-inference-variable-2.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2d-push-inference-variable-2.stderr diff --git a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.rs rename to src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.rs diff --git a/src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr b/src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex2e-push-inference-variable-3.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex2e-push-inference-variable-3.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-2.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-2.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-2.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-3.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-3.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-3.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-2.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-3.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-4.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-earlybound-regions.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs-latebound-regions.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-both-are-structs.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-latebound-regions.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-3.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-4.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-self-is-anon.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-fn-items.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-impl-items.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-using-trait-objects.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.nll.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions.nll.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.nll.stderr diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions.rs b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions.rs rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr b/src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions.stderr rename to src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions.stderr diff --git a/src/test/ui/lifetime-errors/liveness-assign-imm-local-notes.rs b/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.rs similarity index 100% rename from src/test/ui/lifetime-errors/liveness-assign-imm-local-notes.rs rename to src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.rs diff --git a/src/test/ui/lifetime-errors/liveness-assign-imm-local-notes.stderr b/src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr similarity index 100% rename from src/test/ui/lifetime-errors/liveness-assign-imm-local-notes.stderr rename to src/test/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr diff --git a/src/test/compile-fail/lifetime-no-keyword.rs b/src/test/ui/lifetimes/lifetime-no-keyword.rs similarity index 100% rename from src/test/compile-fail/lifetime-no-keyword.rs rename to src/test/ui/lifetimes/lifetime-no-keyword.rs diff --git a/src/test/ui/lifetimes/lifetime-no-keyword.stderr b/src/test/ui/lifetimes/lifetime-no-keyword.stderr new file mode 100644 index 0000000000000..1dcbe336c69ae --- /dev/null +++ b/src/test/ui/lifetimes/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/linkage2.rs similarity index 100% rename from src/test/compile-fail/linkage2.rs rename to src/test/ui/linkage2.rs diff --git a/src/test/ui/linkage2.stderr b/src/test/ui/linkage2.stderr new file mode 100644 index 0000000000000..d9edac160da40 --- /dev/null +++ b/src/test/ui/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/linkage3.rs similarity index 100% rename from src/test/compile-fail/linkage3.rs rename to src/test/ui/linkage3.rs diff --git a/src/test/ui/linkage3.stderr b/src/test/ui/linkage3.stderr new file mode 100644 index 0000000000000..3429ced8ce4f5 --- /dev/null +++ b/src/test/ui/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/linkage4.rs similarity index 100% rename from src/test/compile-fail/linkage4.rs rename to src/test/ui/linkage4.rs diff --git a/src/test/ui/linkage4.stderr b/src/test/ui/linkage4.stderr new file mode 100644 index 0000000000000..c04f88d37a5f4 --- /dev/null +++ b/src/test/ui/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/auxiliary/inherited_stability.rs b/src/test/ui/lint/auxiliary/inherited_stability.rs similarity index 100% rename from src/test/compile-fail/auxiliary/inherited_stability.rs rename to src/test/ui/lint/auxiliary/inherited_stability.rs diff --git a/src/test/compile-fail/auxiliary/lint_output_format.rs b/src/test/ui/lint/auxiliary/lint_output_format.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lint_output_format.rs rename to src/test/ui/lint/auxiliary/lint_output_format.rs diff --git a/src/test/ui/lint/auxiliary/lint_stability.rs b/src/test/ui/lint/auxiliary/lint_stability.rs new file mode 100644 index 0000000000000..5547458abbef8 --- /dev/null +++ b/src/test/ui/lint/auxiliary/lint_stability.rs @@ -0,0 +1,198 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_name="lint_stability"] +#![crate_type = "lib"] +#![feature(staged_api)] +#![feature(associated_type_defaults)] +#![stable(feature = "lint_stability", since = "1.0.0")] + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub fn deprecated() {} +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub fn deprecated_text() {} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[rustc_deprecated(since = "99.99.99", reason = "text")] +pub fn deprecated_future() {} + +#[unstable(feature = "unstable_test_feature", issue = "0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub fn deprecated_unstable() {} +#[unstable(feature = "unstable_test_feature", issue = "0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub fn deprecated_unstable_text() {} + +#[unstable(feature = "unstable_test_feature", issue = "0")] +pub fn unstable() {} +#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] +pub fn unstable_text() {} + +#[stable(feature = "rust1", since = "1.0.0")] +pub fn stable() {} +#[stable(feature = "rust1", since = "1.0.0")] +pub fn stable_text() {} + +#[stable(feature = "rust1", since = "1.0.0")] +pub struct MethodTester; + +impl MethodTester { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + pub fn method_deprecated(&self) {} + #[stable(feature = "stable_test_feature", since = "1.0.0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + pub fn method_deprecated_text(&self) {} + + #[unstable(feature = "unstable_test_feature", issue = "0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + pub fn method_deprecated_unstable(&self) {} + #[unstable(feature = "unstable_test_feature", issue = "0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + pub fn method_deprecated_unstable_text(&self) {} + + #[unstable(feature = "unstable_test_feature", issue = "0")] + pub fn method_unstable(&self) {} + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + pub fn method_unstable_text(&self) {} + + #[stable(feature = "rust1", since = "1.0.0")] + pub fn method_stable(&self) {} + #[stable(feature = "rust1", since = "1.0.0")] + pub fn method_stable_text(&self) {} +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub trait Trait { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + fn trait_deprecated(&self) {} + #[stable(feature = "stable_test_feature", since = "1.0.0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + fn trait_deprecated_text(&self) {} + + #[unstable(feature = "unstable_test_feature", issue = "0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + fn trait_deprecated_unstable(&self) {} + #[unstable(feature = "unstable_test_feature", issue = "0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + fn trait_deprecated_unstable_text(&self) {} + + #[unstable(feature = "unstable_test_feature", issue = "0")] + fn trait_unstable(&self) {} + #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")] + fn trait_unstable_text(&self) {} + + #[stable(feature = "rust1", since = "1.0.0")] + fn trait_stable(&self) {} + #[stable(feature = "rust1", since = "1.0.0")] + fn trait_stable_text(&self) {} +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub trait TraitWithAssociatedTypes { + #[unstable(feature = "unstable_test_feature", issue = "0")] + type TypeUnstable = u8; + #[stable(feature = "stable_test_feature", since = "1.0.0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + type TypeDeprecated = u8; +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +impl Trait for MethodTester {} + +#[unstable(feature = "unstable_test_feature", issue = "0")] +pub trait UnstableTrait { fn dummy(&self) { } } + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub trait DeprecatedTrait { + #[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { } +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub struct DeprecatedStruct { + #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize +} +#[unstable(feature = "unstable_test_feature", issue = "0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub struct DeprecatedUnstableStruct { + #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize +} +#[unstable(feature = "unstable_test_feature", issue = "0")] +pub struct UnstableStruct { + #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize +} +#[stable(feature = "rust1", since = "1.0.0")] +pub struct StableStruct { + #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize +} +#[unstable(feature = "unstable_test_feature", issue = "0")] +pub enum UnstableEnum {} +#[stable(feature = "rust1", since = "1.0.0")] +pub enum StableEnum {} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub struct DeprecatedUnitStruct; +#[unstable(feature = "unstable_test_feature", issue = "0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub struct DeprecatedUnstableUnitStruct; +#[unstable(feature = "unstable_test_feature", issue = "0")] +pub struct UnstableUnitStruct; +#[stable(feature = "rust1", since = "1.0.0")] +pub struct StableUnitStruct; + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +pub enum Enum { + #[stable(feature = "stable_test_feature", since = "1.0.0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + DeprecatedVariant, + #[unstable(feature = "unstable_test_feature", issue = "0")] + #[rustc_deprecated(since = "1.0.0", reason = "text")] + DeprecatedUnstableVariant, + #[unstable(feature = "unstable_test_feature", issue = "0")] + UnstableVariant, + + #[stable(feature = "rust1", since = "1.0.0")] + StableVariant, +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); +#[unstable(feature = "unstable_test_feature", issue = "0")] +#[rustc_deprecated(since = "1.0.0", reason = "text")] +pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); +#[unstable(feature = "unstable_test_feature", issue = "0")] +pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); +#[stable(feature = "rust1", since = "1.0.0")] +pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize); + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[macro_export] +macro_rules! macro_test { + () => (deprecated()); +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[macro_export] +macro_rules! macro_test_arg { + ($func:expr) => ($func); +} + +#[stable(feature = "stable_test_feature", since = "1.0.0")] +#[macro_export] +macro_rules! macro_test_arg_nested { + ($func:ident) => (macro_test_arg!($func())); +} diff --git a/src/test/compile-fail/auxiliary/lint_stability_fields.rs b/src/test/ui/lint/auxiliary/lint_stability_fields.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lint_stability_fields.rs rename to src/test/ui/lint/auxiliary/lint_stability_fields.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate.rs b/src/test/ui/lint/auxiliary/lint_unused_extern_crate.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lint_unused_extern_crate.rs rename to src/test/ui/lint/auxiliary/lint_unused_extern_crate.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate2.rs b/src/test/ui/lint/auxiliary/lint_unused_extern_crate2.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lint_unused_extern_crate2.rs rename to src/test/ui/lint/auxiliary/lint_unused_extern_crate2.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate3.rs b/src/test/ui/lint/auxiliary/lint_unused_extern_crate3.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lint_unused_extern_crate3.rs rename to src/test/ui/lint/auxiliary/lint_unused_extern_crate3.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate4.rs b/src/test/ui/lint/auxiliary/lint_unused_extern_crate4.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lint_unused_extern_crate4.rs rename to src/test/ui/lint/auxiliary/lint_unused_extern_crate4.rs diff --git a/src/test/compile-fail/auxiliary/lint_unused_extern_crate5.rs b/src/test/ui/lint/auxiliary/lint_unused_extern_crate5.rs similarity index 100% rename from src/test/compile-fail/auxiliary/lint_unused_extern_crate5.rs rename to src/test/ui/lint/auxiliary/lint_unused_extern_crate5.rs diff --git a/src/test/compile-fail/auxiliary/stability_cfg1.rs b/src/test/ui/lint/auxiliary/stability_cfg1.rs similarity index 100% rename from src/test/compile-fail/auxiliary/stability_cfg1.rs rename to src/test/ui/lint/auxiliary/stability_cfg1.rs diff --git a/src/test/ui/auxiliary/lint_output_format.rs b/src/test/ui/lint/auxiliary/stability_cfg2.rs similarity index 51% rename from src/test/ui/auxiliary/lint_output_format.rs rename to src/test/ui/lint/auxiliary/stability_cfg2.rs index 6ba66f3e45fec..a59f4b4e8f44b 100644 --- a/src/test/ui/auxiliary/lint_output_format.rs +++ b/src/test/ui/lint/auxiliary/stability_cfg2.rs @@ -8,23 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_name="lint_output_format"] -#![crate_type = "lib"] -#![feature(staged_api)] -#![unstable(feature = "unstable_test_feature", issue = "0")] - -#[stable(feature = "stable_test_feature", since = "1.0.0")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] -pub fn foo() -> usize { - 20 -} +// compile-flags:--cfg foo -#[unstable(feature = "unstable_test_feature", issue = "0")] -pub fn bar() -> usize { - 40 -} - -#[unstable(feature = "unstable_test_feature", issue = "0")] -pub fn baz() -> usize { - 30 -} +#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))] +#![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] +#![feature(staged_api)] diff --git a/src/test/ui/lint-anon-param-edition.fixed b/src/test/ui/lint/lint-anon-param-edition.fixed similarity index 100% rename from src/test/ui/lint-anon-param-edition.fixed rename to src/test/ui/lint/lint-anon-param-edition.fixed diff --git a/src/test/ui/lint-anon-param-edition.rs b/src/test/ui/lint/lint-anon-param-edition.rs similarity index 100% rename from src/test/ui/lint-anon-param-edition.rs rename to src/test/ui/lint/lint-anon-param-edition.rs diff --git a/src/test/ui/lint-anon-param-edition.stderr b/src/test/ui/lint/lint-anon-param-edition.stderr similarity index 100% rename from src/test/ui/lint-anon-param-edition.stderr rename to src/test/ui/lint/lint-anon-param-edition.stderr diff --git a/src/test/compile-fail/lint-attr-non-item-node.rs b/src/test/ui/lint/lint-attr-non-item-node.rs similarity index 100% rename from src/test/compile-fail/lint-attr-non-item-node.rs rename to src/test/ui/lint/lint-attr-non-item-node.rs diff --git a/src/test/ui/lint/lint-attr-non-item-node.stderr b/src/test/ui/lint/lint-attr-non-item-node.stderr new file mode 100644 index 0000000000000..33d096c5bcfb5 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-change-warnings.rs similarity index 100% rename from src/test/compile-fail/lint-change-warnings.rs rename to src/test/ui/lint/lint-change-warnings.rs diff --git a/src/test/ui/lint/lint-change-warnings.stderr b/src/test/ui/lint/lint-change-warnings.stderr new file mode 100644 index 0000000000000..353802f5c283b --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-ctypes-enum.rs similarity index 100% rename from src/test/compile-fail/lint-ctypes-enum.rs rename to src/test/ui/lint/lint-ctypes-enum.rs diff --git a/src/test/ui/lint/lint-ctypes-enum.stderr b/src/test/ui/lint/lint-ctypes-enum.stderr new file mode 100644 index 0000000000000..9b1c04b2a1dd1 --- /dev/null +++ b/src/test/ui/lint/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/ui/lint-ctypes.rs b/src/test/ui/lint/lint-ctypes.rs similarity index 100% rename from src/test/ui/lint-ctypes.rs rename to src/test/ui/lint/lint-ctypes.rs diff --git a/src/test/ui/lint-ctypes.stderr b/src/test/ui/lint/lint-ctypes.stderr similarity index 100% rename from src/test/ui/lint-ctypes.stderr rename to src/test/ui/lint/lint-ctypes.stderr diff --git a/src/test/compile-fail/lint-dead-code-1.rs b/src/test/ui/lint/lint-dead-code-1.rs similarity index 100% rename from src/test/compile-fail/lint-dead-code-1.rs rename to src/test/ui/lint/lint-dead-code-1.rs diff --git a/src/test/ui/lint/lint-dead-code-1.stderr b/src/test/ui/lint/lint-dead-code-1.stderr new file mode 100644 index 0000000000000..9802b7e8f383b --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-dead-code-2.rs similarity index 100% rename from src/test/compile-fail/lint-dead-code-2.rs rename to src/test/ui/lint/lint-dead-code-2.rs diff --git a/src/test/ui/lint/lint-dead-code-2.stderr b/src/test/ui/lint/lint-dead-code-2.stderr new file mode 100644 index 0000000000000..6e713c84f16fe --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-dead-code-3.rs similarity index 100% rename from src/test/compile-fail/lint-dead-code-3.rs rename to src/test/ui/lint/lint-dead-code-3.rs diff --git a/src/test/ui/lint/lint-dead-code-3.stderr b/src/test/ui/lint/lint-dead-code-3.stderr new file mode 100644 index 0000000000000..994e93e855764 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-dead-code-4.rs similarity index 100% rename from src/test/compile-fail/lint-dead-code-4.rs rename to src/test/ui/lint/lint-dead-code-4.rs diff --git a/src/test/ui/lint/lint-dead-code-4.stderr b/src/test/ui/lint/lint-dead-code-4.stderr new file mode 100644 index 0000000000000..fce2cf768987e --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-dead-code-5.rs similarity index 100% rename from src/test/compile-fail/lint-dead-code-5.rs rename to src/test/ui/lint/lint-dead-code-5.rs diff --git a/src/test/ui/lint/lint-dead-code-5.stderr b/src/test/ui/lint/lint-dead-code-5.stderr new file mode 100644 index 0000000000000..37ca0f479f59b --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-dead-code-type-alias.rs similarity index 100% rename from src/test/compile-fail/lint-dead-code-type-alias.rs rename to src/test/ui/lint/lint-dead-code-type-alias.rs diff --git a/src/test/ui/lint/lint-dead-code-type-alias.stderr b/src/test/ui/lint/lint-dead-code-type-alias.stderr new file mode 100644 index 0000000000000..bd11e64c7814c --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-dead-code-variant.rs similarity index 100% rename from src/test/compile-fail/lint-dead-code-variant.rs rename to src/test/ui/lint/lint-dead-code-variant.rs diff --git a/src/test/ui/lint/lint-dead-code-variant.stderr b/src/test/ui/lint/lint-dead-code-variant.stderr new file mode 100644 index 0000000000000..05b7e35337aaf --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-directives-on-use-items-issue-10534.rs similarity index 100% rename from src/test/compile-fail/lint-directives-on-use-items-issue-10534.rs rename to src/test/ui/lint/lint-directives-on-use-items-issue-10534.rs diff --git a/src/test/ui/lint/lint-directives-on-use-items-issue-10534.stderr b/src/test/ui/lint/lint-directives-on-use-items-issue-10534.stderr new file mode 100644 index 0000000000000..2c4602ae20bde --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-exceeding-bitshifts.rs similarity index 100% rename from src/test/compile-fail/lint-exceeding-bitshifts.rs rename to src/test/ui/lint/lint-exceeding-bitshifts.rs diff --git a/src/test/ui/lint/lint-exceeding-bitshifts.stderr b/src/test/ui/lint/lint-exceeding-bitshifts.stderr new file mode 100644 index 0000000000000..5124a69195a34 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-exceeding-bitshifts2.rs similarity index 100% rename from src/test/compile-fail/lint-exceeding-bitshifts2.rs rename to src/test/ui/lint/lint-exceeding-bitshifts2.rs diff --git a/src/test/ui/lint/lint-exceeding-bitshifts2.stderr b/src/test/ui/lint/lint-exceeding-bitshifts2.stderr new file mode 100644 index 0000000000000..17b4235a73f22 --- /dev/null +++ b/src/test/ui/lint/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/ui/lint-forbid-attr.rs b/src/test/ui/lint/lint-forbid-attr.rs similarity index 100% rename from src/test/ui/lint-forbid-attr.rs rename to src/test/ui/lint/lint-forbid-attr.rs diff --git a/src/test/ui/lint-forbid-attr.stderr b/src/test/ui/lint/lint-forbid-attr.stderr similarity index 100% rename from src/test/ui/lint-forbid-attr.stderr rename to src/test/ui/lint/lint-forbid-attr.stderr diff --git a/src/test/compile-fail/lint-forbid-cmdline.rs b/src/test/ui/lint/lint-forbid-cmdline.rs similarity index 100% rename from src/test/compile-fail/lint-forbid-cmdline.rs rename to src/test/ui/lint/lint-forbid-cmdline.rs diff --git a/src/test/ui/lint/lint-forbid-cmdline.stderr b/src/test/ui/lint/lint-forbid-cmdline.stderr new file mode 100644 index 0000000000000..37a2699e89866 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-impl-fn.rs similarity index 100% rename from src/test/compile-fail/lint-impl-fn.rs rename to src/test/ui/lint/lint-impl-fn.rs diff --git a/src/test/ui/lint/lint-impl-fn.stderr b/src/test/ui/lint/lint-impl-fn.stderr new file mode 100644 index 0000000000000..ed37e8778759e --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-malformed.rs similarity index 100% rename from src/test/compile-fail/lint-malformed.rs rename to src/test/ui/lint/lint-malformed.rs diff --git a/src/test/ui/lint/lint-malformed.stderr b/src/test/ui/lint/lint-malformed.stderr new file mode 100644 index 0000000000000..7b8155cb41066 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-misplaced-attr.rs similarity index 100% rename from src/test/compile-fail/lint-misplaced-attr.rs rename to src/test/ui/lint/lint-misplaced-attr.rs diff --git a/src/test/ui/lint/lint-misplaced-attr.stderr b/src/test/ui/lint/lint-misplaced-attr.stderr new file mode 100644 index 0000000000000..17f29a6ba79ed --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-missing-copy-implementations.rs similarity index 100% rename from src/test/compile-fail/lint-missing-copy-implementations.rs rename to src/test/ui/lint/lint-missing-copy-implementations.rs diff --git a/src/test/ui/lint/lint-missing-copy-implementations.stderr b/src/test/ui/lint/lint-missing-copy-implementations.stderr new file mode 100644 index 0000000000000..3cb89ef794a49 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-missing-doc.rs similarity index 100% rename from src/test/compile-fail/lint-missing-doc.rs rename to src/test/ui/lint/lint-missing-doc.rs diff --git a/src/test/ui/lint/lint-missing-doc.stderr b/src/test/ui/lint/lint-missing-doc.stderr new file mode 100644 index 0000000000000..e61d56d851875 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-non-camel-case-types.rs similarity index 100% rename from src/test/compile-fail/lint-non-camel-case-types.rs rename to src/test/ui/lint/lint-non-camel-case-types.rs diff --git a/src/test/ui/lint/lint-non-camel-case-types.stderr b/src/test/ui/lint/lint-non-camel-case-types.stderr new file mode 100644 index 0000000000000..85610dc7fa379 --- /dev/null +++ b/src/test/ui/lint/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) {} //~ 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/lint/lint-non-snake-case-crate-2.rs similarity index 100% rename from src/test/compile-fail/lint-non-snake-case-crate-2.rs rename to src/test/ui/lint/lint-non-snake-case-crate-2.rs diff --git a/src/test/ui/lint/lint-non-snake-case-crate-2.stderr b/src/test/ui/lint/lint-non-snake-case-crate-2.stderr new file mode 100644 index 0000000000000..ce49d9a0b8074 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-non-snake-case-crate.rs similarity index 100% rename from src/test/compile-fail/lint-non-snake-case-crate.rs rename to src/test/ui/lint/lint-non-snake-case-crate.rs diff --git a/src/test/ui/lint/lint-non-snake-case-crate.stderr b/src/test/ui/lint/lint-non-snake-case-crate.stderr new file mode 100644 index 0000000000000..4d55661daa0ec --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-non-snake-case-functions.rs similarity index 100% rename from src/test/compile-fail/lint-non-snake-case-functions.rs rename to src/test/ui/lint/lint-non-snake-case-functions.rs diff --git a/src/test/ui/lint/lint-non-snake-case-functions.stderr b/src/test/ui/lint/lint-non-snake-case-functions.stderr new file mode 100644 index 0000000000000..f7ac48da90118 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-non-snake-case-lifetimes.rs similarity index 100% rename from src/test/compile-fail/lint-non-snake-case-lifetimes.rs rename to src/test/ui/lint/lint-non-snake-case-lifetimes.rs diff --git a/src/test/ui/lint/lint-non-snake-case-lifetimes.stderr b/src/test/ui/lint/lint-non-snake-case-lifetimes.stderr new file mode 100644 index 0000000000000..dc9b5b8cd75ba --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-non-snake-case-modules.rs similarity index 100% rename from src/test/compile-fail/lint-non-snake-case-modules.rs rename to src/test/ui/lint/lint-non-snake-case-modules.rs diff --git a/src/test/ui/lint/lint-non-snake-case-modules.stderr b/src/test/ui/lint/lint-non-snake-case-modules.stderr new file mode 100644 index 0000000000000..d55d80f31b523 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-non-uppercase-statics.rs similarity index 100% rename from src/test/compile-fail/lint-non-uppercase-statics.rs rename to src/test/ui/lint/lint-non-uppercase-statics.rs diff --git a/src/test/ui/lint/lint-non-uppercase-statics.stderr b/src/test/ui/lint/lint-non-uppercase-statics.stderr new file mode 100644 index 0000000000000..0d56c577734ab --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-obsolete-attr.rs similarity index 100% rename from src/test/compile-fail/lint-obsolete-attr.rs rename to src/test/ui/lint/lint-obsolete-attr.rs diff --git a/src/test/ui/lint/lint-obsolete-attr.stderr b/src/test/ui/lint/lint-obsolete-attr.stderr new file mode 100644 index 0000000000000..4a8a55e260efa --- /dev/null +++ b/src/test/ui/lint/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/ui/lint-output-format-2.rs b/src/test/ui/lint/lint-output-format-2.rs similarity index 100% rename from src/test/ui/lint-output-format-2.rs rename to src/test/ui/lint/lint-output-format-2.rs diff --git a/src/test/ui/lint-output-format-2.stderr b/src/test/ui/lint/lint-output-format-2.stderr similarity index 100% rename from src/test/ui/lint-output-format-2.stderr rename to src/test/ui/lint/lint-output-format-2.stderr diff --git a/src/test/compile-fail/lint-output-format.rs b/src/test/ui/lint/lint-output-format.rs similarity index 100% rename from src/test/compile-fail/lint-output-format.rs rename to src/test/ui/lint/lint-output-format.rs diff --git a/src/test/ui/lint/lint-output-format.stderr b/src/test/ui/lint/lint-output-format.stderr new file mode 100644 index 0000000000000..bcc279929c657 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-owned-heap-memory.rs similarity index 100% rename from src/test/compile-fail/lint-owned-heap-memory.rs rename to src/test/ui/lint/lint-owned-heap-memory.rs diff --git a/src/test/ui/lint/lint-owned-heap-memory.stderr b/src/test/ui/lint/lint-owned-heap-memory.stderr new file mode 100644 index 0000000000000..5b61d30fd3923 --- /dev/null +++ b/src/test/ui/lint/lint-owned-heap-memory.stderr @@ -0,0 +1,20 @@ +error: type uses owned (Box type) pointers: std::boxed::Box + --> $DIR/lint-owned-heap-memory.rs:16:5 + | +LL | x: Box //~ 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 + --> $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/lint/lint-qualification.rs similarity index 100% rename from src/test/compile-fail/lint-qualification.rs rename to src/test/ui/lint/lint-qualification.rs diff --git a/src/test/ui/lint/lint-qualification.stderr b/src/test/ui/lint/lint-qualification.stderr new file mode 100644 index 0000000000000..f4c8186caf704 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-removed-allow.rs similarity index 100% rename from src/test/compile-fail/lint-removed-allow.rs rename to src/test/ui/lint/lint-removed-allow.rs diff --git a/src/test/ui/lint/lint-removed-allow.stderr b/src/test/ui/lint/lint-removed-allow.stderr new file mode 100644 index 0000000000000..8f4c757e54be2 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-removed-cmdline.rs similarity index 100% rename from src/test/compile-fail/lint-removed-cmdline.rs rename to src/test/ui/lint/lint-removed-cmdline.rs diff --git a/src/test/ui/lint/lint-removed-cmdline.stderr b/src/test/ui/lint/lint-removed-cmdline.stderr new file mode 100644 index 0000000000000..86faeec954228 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-removed.rs similarity index 100% rename from src/test/compile-fail/lint-removed.rs rename to src/test/ui/lint/lint-removed.rs diff --git a/src/test/ui/lint/lint-removed.stderr b/src/test/ui/lint/lint-removed.stderr new file mode 100644 index 0000000000000..7d66186f34969 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-renamed-allow.rs similarity index 100% rename from src/test/compile-fail/lint-renamed-allow.rs rename to src/test/ui/lint/lint-renamed-allow.rs diff --git a/src/test/ui/lint/lint-renamed-allow.stderr b/src/test/ui/lint/lint-renamed-allow.stderr new file mode 100644 index 0000000000000..6b2eb27270131 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-renamed-cmdline.rs similarity index 100% rename from src/test/compile-fail/lint-renamed-cmdline.rs rename to src/test/ui/lint/lint-renamed-cmdline.rs diff --git a/src/test/ui/lint/lint-renamed-cmdline.stderr b/src/test/ui/lint/lint-renamed-cmdline.stderr new file mode 100644 index 0000000000000..5e154a0033db7 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-renamed.rs similarity index 100% rename from src/test/compile-fail/lint-renamed.rs rename to src/test/ui/lint/lint-renamed.rs diff --git a/src/test/ui/lint/lint-renamed.stderr b/src/test/ui/lint/lint-renamed.stderr new file mode 100644 index 0000000000000..a87efc9e92c4b --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-shorthand-field.rs similarity index 100% rename from src/test/compile-fail/lint-shorthand-field.rs rename to src/test/ui/lint/lint-shorthand-field.rs diff --git a/src/test/ui/lint/lint-shorthand-field.stderr b/src/test/ui/lint/lint-shorthand-field.stderr new file mode 100644 index 0000000000000..516be532f5d63 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-stability-2.rs similarity index 100% rename from src/test/compile-fail/lint-stability-2.rs rename to src/test/ui/lint/lint-stability-2.rs diff --git a/src/test/ui/lint/lint-stability-2.stderr b/src/test/ui/lint/lint-stability-2.stderr new file mode 100644 index 0000000000000..e87e051443360 --- /dev/null +++ b/src/test/ui/lint/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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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/lint/lint-stability-deprecated.rs similarity index 100% rename from src/test/compile-fail/lint-stability-deprecated.rs rename to src/test/ui/lint/lint-stability-deprecated.rs diff --git a/src/test/ui/lint/lint-stability-deprecated.stderr b/src/test/ui/lint/lint-stability-deprecated.stderr new file mode 100644 index 0000000000000..afebb4f36a4ad --- /dev/null +++ b/src/test/ui/lint/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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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/lint/lint-stability-fields-deprecated.rs similarity index 100% rename from src/test/compile-fail/lint-stability-fields-deprecated.rs rename to src/test/ui/lint/lint-stability-fields-deprecated.rs diff --git a/src/test/ui/lint/lint-stability-fields-deprecated.stderr b/src/test/ui/lint/lint-stability-fields-deprecated.stderr new file mode 100644 index 0000000000000..f7bc87ee9d914 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-stability-fields.rs similarity index 100% rename from src/test/compile-fail/lint-stability-fields.rs rename to src/test/ui/lint/lint-stability-fields.rs diff --git a/src/test/ui/lint/lint-stability-fields.stderr b/src/test/ui/lint/lint-stability-fields.stderr new file mode 100644 index 0000000000000..2f176062c305d --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-stability.rs similarity index 100% rename from src/test/compile-fail/lint-stability.rs rename to src/test/ui/lint/lint-stability.rs diff --git a/src/test/ui/lint/lint-stability.stderr b/src/test/ui/lint/lint-stability.stderr new file mode 100644 index 0000000000000..893c70f85f13f --- /dev/null +++ b/src/test/ui/lint/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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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 | ::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::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/lint/lint-stability2.rs similarity index 100% rename from src/test/compile-fail/lint-stability2.rs rename to src/test/ui/lint/lint-stability2.rs diff --git a/src/test/ui/lint/lint-stability2.stderr b/src/test/ui/lint/lint-stability2.stderr new file mode 100644 index 0000000000000..5585fc9f83a19 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-stability3.rs similarity index 100% rename from src/test/compile-fail/lint-stability3.rs rename to src/test/ui/lint/lint-stability3.rs diff --git a/src/test/ui/lint/lint-stability3.stderr b/src/test/ui/lint/lint-stability3.stderr new file mode 100644 index 0000000000000..722223f624354 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-type-limits.rs similarity index 100% rename from src/test/compile-fail/lint-type-limits.rs rename to src/test/ui/lint/lint-type-limits.rs diff --git a/src/test/ui/lint/lint-type-limits.stderr b/src/test/ui/lint/lint-type-limits.stderr new file mode 100644 index 0000000000000..49b379a9901d0 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-type-limits2.rs similarity index 100% rename from src/test/compile-fail/lint-type-limits2.rs rename to src/test/ui/lint/lint-type-limits2.rs diff --git a/src/test/ui/lint/lint-type-limits2.stderr b/src/test/ui/lint/lint-type-limits2.stderr new file mode 100644 index 0000000000000..a7abf7ad36494 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-type-limits3.rs similarity index 100% rename from src/test/compile-fail/lint-type-limits3.rs rename to src/test/ui/lint/lint-type-limits3.rs diff --git a/src/test/ui/lint/lint-type-limits3.stderr b/src/test/ui/lint/lint-type-limits3.stderr new file mode 100644 index 0000000000000..b6e14ac64e506 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-type-overflow.rs similarity index 100% rename from src/test/compile-fail/lint-type-overflow.rs rename to src/test/ui/lint/lint-type-overflow.rs diff --git a/src/test/ui/lint/lint-type-overflow.stderr b/src/test/ui/lint/lint-type-overflow.stderr new file mode 100644 index 0000000000000..67f4537e1e64f --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-type-overflow2.rs similarity index 100% rename from src/test/compile-fail/lint-type-overflow2.rs rename to src/test/ui/lint/lint-type-overflow2.rs diff --git a/src/test/ui/lint/lint-type-overflow2.stderr b/src/test/ui/lint/lint-type-overflow2.stderr new file mode 100644 index 0000000000000..ecfd2584bba42 --- /dev/null +++ b/src/test/ui/lint/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/ui/lint-unconditional-recursion.rs b/src/test/ui/lint/lint-unconditional-recursion.rs similarity index 100% rename from src/test/ui/lint-unconditional-recursion.rs rename to src/test/ui/lint/lint-unconditional-recursion.rs diff --git a/src/test/ui/lint-unconditional-recursion.stderr b/src/test/ui/lint/lint-unconditional-recursion.stderr similarity index 100% rename from src/test/ui/lint-unconditional-recursion.stderr rename to src/test/ui/lint/lint-unconditional-recursion.stderr diff --git a/src/test/compile-fail/lint-unexported-no-mangle.rs b/src/test/ui/lint/lint-unexported-no-mangle.rs similarity index 100% rename from src/test/compile-fail/lint-unexported-no-mangle.rs rename to src/test/ui/lint/lint-unexported-no-mangle.rs diff --git a/src/test/ui/lint/lint-unexported-no-mangle.stderr b/src/test/ui/lint/lint-unexported-no-mangle.stderr new file mode 100644 index 0000000000000..e7d49f339e6d8 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unknown-attr.rs similarity index 100% rename from src/test/compile-fail/lint-unknown-attr.rs rename to src/test/ui/lint/lint-unknown-attr.rs diff --git a/src/test/ui/lint/lint-unknown-attr.stderr b/src/test/ui/lint/lint-unknown-attr.stderr new file mode 100644 index 0000000000000..5f915232c14c3 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unknown-feature-default.rs similarity index 100% rename from src/test/compile-fail/lint-unknown-feature-default.rs rename to src/test/ui/lint/lint-unknown-feature-default.rs diff --git a/src/test/ui/lint/lint-unknown-feature-default.stderr b/src/test/ui/lint/lint-unknown-feature-default.stderr new file mode 100644 index 0000000000000..bd4079ffd2e09 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unknown-feature.rs similarity index 100% rename from src/test/compile-fail/lint-unknown-feature.rs rename to src/test/ui/lint/lint-unknown-feature.rs diff --git a/src/test/ui/lint/lint-unknown-feature.stderr b/src/test/ui/lint/lint-unknown-feature.stderr new file mode 100644 index 0000000000000..e2744c03872a4 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unknown-lint-cmdline.rs similarity index 100% rename from src/test/compile-fail/lint-unknown-lint-cmdline.rs rename to src/test/ui/lint/lint-unknown-lint-cmdline.rs diff --git a/src/test/ui/lint/lint-unknown-lint-cmdline.stderr b/src/test/ui/lint/lint-unknown-lint-cmdline.stderr new file mode 100644 index 0000000000000..8636004102618 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unknown-lint.rs similarity index 100% rename from src/test/compile-fail/lint-unknown-lint.rs rename to src/test/ui/lint/lint-unknown-lint.rs diff --git a/src/test/ui/lint/lint-unknown-lint.stderr b/src/test/ui/lint/lint-unknown-lint.stderr new file mode 100644 index 0000000000000..b398a2f3690fb --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unnecessary-import-braces.rs similarity index 100% rename from src/test/compile-fail/lint-unnecessary-import-braces.rs rename to src/test/ui/lint/lint-unnecessary-import-braces.rs diff --git a/src/test/ui/lint/lint-unnecessary-import-braces.stderr b/src/test/ui/lint/lint-unnecessary-import-braces.stderr new file mode 100644 index 0000000000000..a4fd474e5cced --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unnecessary-parens.rs similarity index 100% rename from src/test/compile-fail/lint-unnecessary-parens.rs rename to src/test/ui/lint/lint-unnecessary-parens.rs diff --git a/src/test/ui/lint/lint-unnecessary-parens.stderr b/src/test/ui/lint/lint-unnecessary-parens.stderr new file mode 100644 index 0000000000000..8861524b18584 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unsafe-code.rs similarity index 100% rename from src/test/compile-fail/lint-unsafe-code.rs rename to src/test/ui/lint/lint-unsafe-code.rs diff --git a/src/test/ui/lint/lint-unsafe-code.stderr b/src/test/ui/lint/lint-unsafe-code.stderr new file mode 100644 index 0000000000000..ee2aba066ecac --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unused-extern-crate.rs similarity index 100% rename from src/test/compile-fail/lint-unused-extern-crate.rs rename to src/test/ui/lint/lint-unused-extern-crate.rs diff --git a/src/test/ui/lint/lint-unused-extern-crate.stderr b/src/test/ui/lint/lint-unused-extern-crate.stderr new file mode 100644 index 0000000000000..3a488b1e073a5 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unused-imports.rs similarity index 100% rename from src/test/compile-fail/lint-unused-imports.rs rename to src/test/ui/lint/lint-unused-imports.rs diff --git a/src/test/ui/lint/lint-unused-imports.stderr b/src/test/ui/lint/lint-unused-imports.stderr new file mode 100644 index 0000000000000..a0292b6907ed3 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unused-mut-self.rs similarity index 100% rename from src/test/compile-fail/lint-unused-mut-self.rs rename to src/test/ui/lint/lint-unused-mut-self.rs diff --git a/src/test/ui/lint/lint-unused-mut-self.stderr b/src/test/ui/lint/lint-unused-mut-self.stderr new file mode 100644 index 0000000000000..af2baaa2e0a33 --- /dev/null +++ b/src/test/ui/lint/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) {} //~ 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/lint/lint-unused-mut-variables.lexical.stderr b/src/test/ui/lint/lint-unused-mut-variables.lexical.stderr new file mode 100644 index 0000000000000..40f68c6782781 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unused-mut-variables.nll.stderr b/src/test/ui/lint/lint-unused-mut-variables.nll.stderr new file mode 100644 index 0000000000000..40f68c6782781 --- /dev/null +++ b/src/test/ui/lint/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/lint/lint-unused-mut-variables.rs similarity index 100% rename from src/test/compile-fail/lint-unused-mut-variables.rs rename to src/test/ui/lint/lint-unused-mut-variables.rs diff --git a/src/test/compile-fail/lint-uppercase-variables.rs b/src/test/ui/lint/lint-uppercase-variables.rs similarity index 100% rename from src/test/compile-fail/lint-uppercase-variables.rs rename to src/test/ui/lint/lint-uppercase-variables.rs diff --git a/src/test/ui/lint/lint-uppercase-variables.stderr b/src/test/ui/lint/lint-uppercase-variables.stderr new file mode 100644 index 0000000000000..c8381d89adc61 --- /dev/null +++ b/src/test/ui/lint/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/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.nll.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.nll.stderr new file mode 100644 index 0000000000000..58a76bd2cf385 --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.ast.stderr new file mode 100644 index 0000000000000..54419fd5b256c --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-in-loop.mir.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.mir.stderr new file mode 100644 index 0000000000000..58a76bd2cf385 --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-in-loop.rs similarity index 100% rename from src/test/compile-fail/liveness-assign-imm-local-in-loop.rs rename to src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.rs diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.nll.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.nll.stderr new file mode 100644 index 0000000000000..091547ed1228a --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.ast.stderr new file mode 100644 index 0000000000000..a98c3c29bd2e8 --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.mir.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.mir.stderr new file mode 100644 index 0000000000000..091547ed1228a --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.rs similarity index 100% rename from src/test/compile-fail/liveness-assign-imm-local-in-op-eq.rs rename to src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.rs diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.nll.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.nll.stderr new file mode 100644 index 0000000000000..e954b1f5e0f8b --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.ast.stderr new file mode 100644 index 0000000000000..6abcf175f488a --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-with-drop.mir.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.mir.stderr new file mode 100644 index 0000000000000..e954b1f5e0f8b --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs similarity index 100% rename from src/test/compile-fail/liveness-assign-imm-local-with-drop.rs rename to src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.rs diff --git a/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.nll.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.nll.stderr new file mode 100644 index 0000000000000..70a6ab3edf803 --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.ast.stderr new file mode 100644 index 0000000000000..47c780e83e8c2 --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-with-init.mir.stderr b/src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.mir.stderr new file mode 100644 index 0000000000000..70a6ab3edf803 --- /dev/null +++ b/src/test/ui/liveness/liveness-assign/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/liveness/liveness-assign/liveness-assign-imm-local-with-init.rs similarity index 100% rename from src/test/compile-fail/liveness-assign-imm-local-with-init.rs rename to src/test/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.rs diff --git a/src/test/compile-fail/liveness-closure-require-ret.rs b/src/test/ui/liveness/liveness-closure-require-ret.rs similarity index 100% rename from src/test/compile-fail/liveness-closure-require-ret.rs rename to src/test/ui/liveness/liveness-closure-require-ret.rs diff --git a/src/test/ui/liveness/liveness-closure-require-ret.stderr b/src/test/ui/liveness/liveness-closure-require-ret.stderr new file mode 100644 index 0000000000000..569640c9e20ce --- /dev/null +++ b/src/test/ui/liveness/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/liveness/liveness-dead.rs similarity index 100% rename from src/test/compile-fail/liveness-dead.rs rename to src/test/ui/liveness/liveness-dead.rs diff --git a/src/test/ui/liveness/liveness-dead.stderr b/src/test/ui/liveness/liveness-dead.stderr new file mode 100644 index 0000000000000..6709fee0abb72 --- /dev/null +++ b/src/test/ui/liveness/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/liveness/liveness-forgot-ret.rs similarity index 100% rename from src/test/compile-fail/liveness-forgot-ret.rs rename to src/test/ui/liveness/liveness-forgot-ret.rs diff --git a/src/test/ui/liveness/liveness-forgot-ret.stderr b/src/test/ui/liveness/liveness-forgot-ret.stderr new file mode 100644 index 0000000000000..8da489bc9ab89 --- /dev/null +++ b/src/test/ui/liveness/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/liveness/liveness-issue-2163.rs similarity index 100% rename from src/test/compile-fail/liveness-issue-2163.rs rename to src/test/ui/liveness/liveness-issue-2163.rs diff --git a/src/test/ui/liveness/liveness-issue-2163.stderr b/src/test/ui/liveness/liveness-issue-2163.stderr new file mode 100644 index 0000000000000..66cd67821be30 --- /dev/null +++ b/src/test/ui/liveness/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/liveness/liveness-missing-ret2.rs similarity index 100% rename from src/test/compile-fail/liveness-missing-ret2.rs rename to src/test/ui/liveness/liveness-missing-ret2.rs diff --git a/src/test/ui/liveness/liveness-missing-ret2.stderr b/src/test/ui/liveness/liveness-missing-ret2.stderr new file mode 100644 index 0000000000000..b7bbea6225dea --- /dev/null +++ b/src/test/ui/liveness/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/liveness/liveness-move-call-arg.rs similarity index 100% rename from src/test/compile-fail/liveness-move-call-arg.rs rename to src/test/ui/liveness/liveness-move-call-arg.rs diff --git a/src/test/ui/liveness/liveness-move-call-arg.stderr b/src/test/ui/liveness/liveness-move-call-arg.stderr new file mode 100644 index 0000000000000..f3423b8f5faa2 --- /dev/null +++ b/src/test/ui/liveness/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`, 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/liveness/liveness-move-in-loop.rs similarity index 100% rename from src/test/compile-fail/liveness-move-in-loop.rs rename to src/test/ui/liveness/liveness-move-in-loop.rs diff --git a/src/test/ui/liveness/liveness-move-in-loop.stderr b/src/test/ui/liveness/liveness-move-in-loop.stderr new file mode 100644 index 0000000000000..decc7659a644f --- /dev/null +++ b/src/test/ui/liveness/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`, 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/liveness/liveness-move-in-while.nll.stderr b/src/test/ui/liveness/liveness-move-in-while.nll.stderr new file mode 100644 index 0000000000000..5ca5dc647090d --- /dev/null +++ b/src/test/ui/liveness/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`, 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`, 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/liveness/liveness-move-in-while.rs similarity index 100% rename from src/test/compile-fail/liveness-move-in-while.rs rename to src/test/ui/liveness/liveness-move-in-while.rs diff --git a/src/test/ui/liveness/liveness-move-in-while.stderr b/src/test/ui/liveness/liveness-move-in-while.stderr new file mode 100644 index 0000000000000..7ac3ea38cb5ce --- /dev/null +++ b/src/test/ui/liveness/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`, 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`, 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/liveness-return-last-stmt-semi.rs b/src/test/ui/liveness/liveness-return-last-stmt-semi.rs similarity index 100% rename from src/test/ui/liveness-return-last-stmt-semi.rs rename to src/test/ui/liveness/liveness-return-last-stmt-semi.rs diff --git a/src/test/ui/liveness-return-last-stmt-semi.stderr b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr similarity index 100% rename from src/test/ui/liveness-return-last-stmt-semi.stderr rename to src/test/ui/liveness/liveness-return-last-stmt-semi.stderr diff --git a/src/test/compile-fail/liveness-unused.rs b/src/test/ui/liveness/liveness-unused.rs similarity index 100% rename from src/test/compile-fail/liveness-unused.rs rename to src/test/ui/liveness/liveness-unused.rs diff --git a/src/test/ui/liveness/liveness-unused.stderr b/src/test/ui/liveness/liveness-unused.stderr new file mode 100644 index 0000000000000..2846f242fbe4c --- /dev/null +++ b/src/test/ui/liveness/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/liveness/liveness-use-after-move.nll.stderr b/src/test/ui/liveness/liveness-use-after-move.nll.stderr new file mode 100644 index 0000000000000..62d9a8b115a19 --- /dev/null +++ b/src/test/ui/liveness/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/liveness/liveness-use-after-move.rs similarity index 100% rename from src/test/compile-fail/liveness-use-after-move.rs rename to src/test/ui/liveness/liveness-use-after-move.rs diff --git a/src/test/ui/liveness/liveness-use-after-move.stderr b/src/test/ui/liveness/liveness-use-after-move.stderr new file mode 100644 index 0000000000000..be6f89c735788 --- /dev/null +++ b/src/test/ui/liveness/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`, 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/liveness/liveness-use-after-send.nll.stderr b/src/test/ui/liveness/liveness-use-after-send.nll.stderr new file mode 100644 index 0000000000000..dbffe6c9135da --- /dev/null +++ b/src/test/ui/liveness/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`, 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/liveness/liveness-use-after-send.rs similarity index 100% rename from src/test/compile-fail/liveness-use-after-send.rs rename to src/test/ui/liveness/liveness-use-after-send.rs diff --git a/src/test/ui/liveness/liveness-use-after-send.stderr b/src/test/ui/liveness/liveness-use-after-send.stderr new file mode 100644 index 0000000000000..94499aabb9709 --- /dev/null +++ b/src/test/ui/liveness/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`, 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/loop-break-value-no-repeat.rs b/src/test/ui/loops/loop-break-value-no-repeat.rs similarity index 100% rename from src/test/ui/loop-break-value-no-repeat.rs rename to src/test/ui/loops/loop-break-value-no-repeat.rs diff --git a/src/test/ui/loop-break-value-no-repeat.stderr b/src/test/ui/loops/loop-break-value-no-repeat.stderr similarity index 100% rename from src/test/ui/loop-break-value-no-repeat.stderr rename to src/test/ui/loops/loop-break-value-no-repeat.stderr diff --git a/src/test/compile-fail/loop-break-value.rs b/src/test/ui/loops/loop-break-value.rs similarity index 100% rename from src/test/compile-fail/loop-break-value.rs rename to src/test/ui/loops/loop-break-value.rs diff --git a/src/test/ui/loops/loop-break-value.stderr b/src/test/ui/loops/loop-break-value.stderr new file mode 100644 index 0000000000000..ca286285c3857 --- /dev/null +++ b/src/test/ui/loops/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/loops/loop-labeled-break-value.rs similarity index 100% rename from src/test/compile-fail/loop-labeled-break-value.rs rename to src/test/ui/loops/loop-labeled-break-value.rs diff --git a/src/test/ui/loops/loop-labeled-break-value.stderr b/src/test/ui/loops/loop-labeled-break-value.stderr new file mode 100644 index 0000000000000..7d140aa8aac4d --- /dev/null +++ b/src/test/ui/loops/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/loops/loop-proper-liveness.nll.stderr b/src/test/ui/loops/loop-proper-liveness.nll.stderr new file mode 100644 index 0000000000000..cbf7094d83743 --- /dev/null +++ b/src/test/ui/loops/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/loops/loop-proper-liveness.rs similarity index 100% rename from src/test/compile-fail/loop-proper-liveness.rs rename to src/test/ui/loops/loop-proper-liveness.rs diff --git a/src/test/ui/loops/loop-proper-liveness.stderr b/src/test/ui/loops/loop-proper-liveness.stderr new file mode 100644 index 0000000000000..554abea91e320 --- /dev/null +++ b/src/test/ui/loops/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/loops/loop-properly-diverging-2.rs similarity index 100% rename from src/test/compile-fail/loop-properly-diverging-2.rs rename to src/test/ui/loops/loop-properly-diverging-2.rs diff --git a/src/test/ui/loops/loop-properly-diverging-2.stderr b/src/test/ui/loops/loop-properly-diverging-2.stderr new file mode 100644 index 0000000000000..f9836538382a3 --- /dev/null +++ b/src/test/ui/loops/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/ui/loops-reject-duplicate-labels-2.rs b/src/test/ui/loops/loops-reject-duplicate-labels-2.rs similarity index 100% rename from src/test/ui/loops-reject-duplicate-labels-2.rs rename to src/test/ui/loops/loops-reject-duplicate-labels-2.rs diff --git a/src/test/ui/loops-reject-duplicate-labels-2.stderr b/src/test/ui/loops/loops-reject-duplicate-labels-2.stderr similarity index 100% rename from src/test/ui/loops-reject-duplicate-labels-2.stderr rename to src/test/ui/loops/loops-reject-duplicate-labels-2.stderr diff --git a/src/test/ui/loops-reject-duplicate-labels.rs b/src/test/ui/loops/loops-reject-duplicate-labels.rs similarity index 100% rename from src/test/ui/loops-reject-duplicate-labels.rs rename to src/test/ui/loops/loops-reject-duplicate-labels.rs diff --git a/src/test/ui/loops-reject-duplicate-labels.stderr b/src/test/ui/loops/loops-reject-duplicate-labels.stderr similarity index 100% rename from src/test/ui/loops-reject-duplicate-labels.stderr rename to src/test/ui/loops/loops-reject-duplicate-labels.stderr diff --git a/src/test/ui/loops-reject-labels-shadowing-lifetimes.rs b/src/test/ui/loops/loops-reject-labels-shadowing-lifetimes.rs similarity index 100% rename from src/test/ui/loops-reject-labels-shadowing-lifetimes.rs rename to src/test/ui/loops/loops-reject-labels-shadowing-lifetimes.rs diff --git a/src/test/ui/loops-reject-labels-shadowing-lifetimes.stderr b/src/test/ui/loops/loops-reject-labels-shadowing-lifetimes.stderr similarity index 100% rename from src/test/ui/loops-reject-labels-shadowing-lifetimes.stderr rename to src/test/ui/loops/loops-reject-labels-shadowing-lifetimes.stderr diff --git a/src/test/ui/loops-reject-lifetime-shadowing-label.rs b/src/test/ui/loops/loops-reject-lifetime-shadowing-label.rs similarity index 100% rename from src/test/ui/loops-reject-lifetime-shadowing-label.rs rename to src/test/ui/loops/loops-reject-lifetime-shadowing-label.rs diff --git a/src/test/ui/loops-reject-lifetime-shadowing-label.stderr b/src/test/ui/loops/loops-reject-lifetime-shadowing-label.stderr similarity index 100% rename from src/test/ui/loops-reject-lifetime-shadowing-label.stderr rename to src/test/ui/loops/loops-reject-lifetime-shadowing-label.stderr diff --git a/src/test/compile-fail/lto-duplicate-symbols.rs b/src/test/ui/lto-duplicate-symbols.rs similarity index 100% rename from src/test/compile-fail/lto-duplicate-symbols.rs rename to src/test/ui/lto-duplicate-symbols.rs diff --git a/src/test/ui/lto-duplicate-symbols.stderr b/src/test/ui/lto-duplicate-symbols.stderr new file mode 100644 index 0000000000000..2f0e57199bbc2 --- /dev/null +++ b/src/test/ui/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/lub-if.nll.stderr b/src/test/ui/lub-if.nll.stderr new file mode 100644 index 0000000000000..a34e280bfa601 --- /dev/null +++ b/src/test/ui/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) -> &'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) -> &'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/lub-if.rs similarity index 100% rename from src/test/compile-fail/lub-if.rs rename to src/test/ui/lub-if.rs diff --git a/src/test/ui/lub-if.stderr b/src/test/ui/lub-if.stderr new file mode 100644 index 0000000000000..4a436810170d5 --- /dev/null +++ b/src/test/ui/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) -> &'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) -> &'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/lub-match.nll.stderr b/src/test/ui/lub-match.nll.stderr new file mode 100644 index 0000000000000..22bd6ea4081b4 --- /dev/null +++ b/src/test/ui/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) -> &'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) -> &'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/lub-match.rs similarity index 100% rename from src/test/compile-fail/lub-match.rs rename to src/test/ui/lub-match.rs diff --git a/src/test/ui/lub-match.stderr b/src/test/ui/lub-match.stderr new file mode 100644 index 0000000000000..3543676ad2f2e --- /dev/null +++ b/src/test/ui/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) -> &'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) -> &'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/auxiliary/macro-in-other-crate.rs b/src/test/ui/macros/auxiliary/macro-in-other-crate.rs similarity index 100% rename from src/test/ui/auxiliary/macro-in-other-crate.rs rename to src/test/ui/macros/auxiliary/macro-in-other-crate.rs diff --git a/src/test/compile-fail/auxiliary/macro_crate_nonterminal.rs b/src/test/ui/macros/auxiliary/macro_crate_nonterminal.rs similarity index 100% rename from src/test/compile-fail/auxiliary/macro_crate_nonterminal.rs rename to src/test/ui/macros/auxiliary/macro_crate_nonterminal.rs diff --git a/src/test/ui/auxiliary/two_macros.rs b/src/test/ui/macros/auxiliary/two_macros.rs similarity index 100% rename from src/test/ui/auxiliary/two_macros.rs rename to src/test/ui/macros/auxiliary/two_macros.rs diff --git a/src/test/compile-fail/auxiliary/unstable-macros.rs b/src/test/ui/macros/auxiliary/unstable-macros.rs similarity index 100% rename from src/test/compile-fail/auxiliary/unstable-macros.rs rename to src/test/ui/macros/auxiliary/unstable-macros.rs diff --git a/src/test/compile-fail/macro-attribute.rs b/src/test/ui/macros/macro-attribute.rs similarity index 100% rename from src/test/compile-fail/macro-attribute.rs rename to src/test/ui/macros/macro-attribute.rs diff --git a/src/test/ui/macros/macro-attribute.stderr b/src/test/ui/macros/macro-attribute.stderr new file mode 100644 index 0000000000000..48132dddf1a42 --- /dev/null +++ b/src/test/ui/macros/macro-attribute.stderr @@ -0,0 +1,11 @@ +error[E0658]: arbitrary tokens in non-macro attributes are unstable (see issue #44690) + --> $DIR/macro-attribute.rs:11:1 + | +LL | #[doc = $not_there] //~ ERROR arbitrary tokens in non-macro attributes are unstable + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add #![feature(unrestricted_attribute_tokens)] 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/macros/macro-comma-behavior.core.stderr b/src/test/ui/macros/macro-comma-behavior.core.stderr new file mode 100644 index 0000000000000..5ff31f050790e --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-comma-behavior.rs similarity index 100% rename from src/test/compile-fail/macro-comma-behavior.rs rename to src/test/ui/macros/macro-comma-behavior.rs diff --git a/src/test/ui/macros/macro-comma-behavior.std.stderr b/src/test/ui/macros/macro-comma-behavior.std.stderr new file mode 100644 index 0000000000000..a87271ed026f9 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-comma-support.rs similarity index 100% rename from src/test/compile-fail/macro-comma-support.rs rename to src/test/ui/macros/macro-comma-support.rs diff --git a/src/test/ui/macros/macro-comma-support.stderr b/src/test/ui/macros/macro-comma-support.stderr new file mode 100644 index 0000000000000..2ebba22d7a1ca --- /dev/null +++ b/src/test/ui/macros/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/ui/macro-context.rs b/src/test/ui/macros/macro-context.rs similarity index 100% rename from src/test/ui/macro-context.rs rename to src/test/ui/macros/macro-context.rs diff --git a/src/test/ui/macro-context.stderr b/src/test/ui/macros/macro-context.stderr similarity index 100% rename from src/test/ui/macro-context.stderr rename to src/test/ui/macros/macro-context.stderr diff --git a/src/test/compile-fail/macro-crate-nonterminal-non-root.rs b/src/test/ui/macros/macro-crate-nonterminal-non-root.rs similarity index 100% rename from src/test/compile-fail/macro-crate-nonterminal-non-root.rs rename to src/test/ui/macros/macro-crate-nonterminal-non-root.rs diff --git a/src/test/ui/macros/macro-crate-nonterminal-non-root.stderr b/src/test/ui/macros/macro-crate-nonterminal-non-root.stderr new file mode 100644 index 0000000000000..029128ae92a9f --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-error.rs similarity index 100% rename from src/test/compile-fail/macro-error.rs rename to src/test/ui/macros/macro-error.rs diff --git a/src/test/ui/macros/macro-error.stderr b/src/test/ui/macros/macro-error.stderr new file mode 100644 index 0000000000000..42808eb2a6b0d --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-expanded-include/file.txt similarity index 100% rename from src/test/compile-fail/macro-expanded-include/file.txt rename to src/test/ui/macros/macro-expanded-include/file.txt diff --git a/src/test/compile-fail/macro-expanded-include/foo/mod.rs b/src/test/ui/macros/macro-expanded-include/foo/mod.rs similarity index 100% rename from src/test/compile-fail/macro-expanded-include/foo/mod.rs rename to src/test/ui/macros/macro-expanded-include/foo/mod.rs diff --git a/src/test/compile-fail/macro-expanded-include/test.rs b/src/test/ui/macros/macro-expanded-include/test.rs similarity index 100% rename from src/test/compile-fail/macro-expanded-include/test.rs rename to src/test/ui/macros/macro-expanded-include/test.rs diff --git a/src/test/ui/macros/macro-expanded-include/test.stderr b/src/test/ui/macros/macro-expanded-include/test.stderr new file mode 100644 index 0000000000000..3ef0275cfbeec --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-expansion-tests.rs similarity index 100% rename from src/test/compile-fail/macro-expansion-tests.rs rename to src/test/ui/macros/macro-expansion-tests.rs diff --git a/src/test/ui/macros/macro-expansion-tests.stderr b/src/test/ui/macros/macro-expansion-tests.stderr new file mode 100644 index 0000000000000..a3d4f3cd3489f --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-follow.rs similarity index 100% rename from src/test/compile-fail/macro-follow.rs rename to src/test/ui/macros/macro-follow.rs diff --git a/src/test/ui/macros/macro-follow.stderr b/src/test/ui/macros/macro-follow.stderr new file mode 100644 index 0000000000000..ccd658af89fbb --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-followed-by-seq-bad.rs similarity index 100% rename from src/test/compile-fail/macro-followed-by-seq-bad.rs rename to src/test/ui/macros/macro-followed-by-seq-bad.rs diff --git a/src/test/ui/macros/macro-followed-by-seq-bad.stderr b/src/test/ui/macros/macro-followed-by-seq-bad.stderr new file mode 100644 index 0000000000000..bb070334d36e9 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-inner-attributes.rs similarity index 100% rename from src/test/compile-fail/macro-inner-attributes.rs rename to src/test/ui/macros/macro-inner-attributes.rs diff --git a/src/test/ui/macros/macro-inner-attributes.stderr b/src/test/ui/macros/macro-inner-attributes.stderr new file mode 100644 index 0000000000000..11922bc448bc4 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-input-future-proofing.rs similarity index 100% rename from src/test/compile-fail/macro-input-future-proofing.rs rename to src/test/ui/macros/macro-input-future-proofing.rs diff --git a/src/test/ui/macros/macro-input-future-proofing.stderr b/src/test/ui/macros/macro-input-future-proofing.stderr new file mode 100644 index 0000000000000..aed7a8a119ced --- /dev/null +++ b/src/test/ui/macros/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/ui/macro-invalid-fragment-spec.rs b/src/test/ui/macros/macro-invalid-fragment-spec.rs similarity index 100% rename from src/test/ui/macro-invalid-fragment-spec.rs rename to src/test/ui/macros/macro-invalid-fragment-spec.rs diff --git a/src/test/ui/macro-invalid-fragment-spec.stderr b/src/test/ui/macros/macro-invalid-fragment-spec.stderr similarity index 100% rename from src/test/ui/macro-invalid-fragment-spec.stderr rename to src/test/ui/macros/macro-invalid-fragment-spec.stderr diff --git a/src/test/compile-fail/macro-local-data-key-priv.rs b/src/test/ui/macros/macro-local-data-key-priv.rs similarity index 100% rename from src/test/compile-fail/macro-local-data-key-priv.rs rename to src/test/ui/macros/macro-local-data-key-priv.rs diff --git a/src/test/ui/macros/macro-local-data-key-priv.stderr b/src/test/ui/macros/macro-local-data-key-priv.stderr new file mode 100644 index 0000000000000..57f4f790cb11c --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-match-nonterminal.rs similarity index 100% rename from src/test/compile-fail/macro-match-nonterminal.rs rename to src/test/ui/macros/macro-match-nonterminal.rs diff --git a/src/test/ui/macros/macro-match-nonterminal.stderr b/src/test/ui/macros/macro-match-nonterminal.stderr new file mode 100644 index 0000000000000..26648c443cb12 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-missing-delimiters.rs similarity index 100% rename from src/test/compile-fail/macro-missing-delimiters.rs rename to src/test/ui/macros/macro-missing-delimiters.rs diff --git a/src/test/ui/macros/macro-missing-delimiters.stderr b/src/test/ui/macros/macro-missing-delimiters.stderr new file mode 100644 index 0000000000000..eb43e39ea56bb --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-missing-fragment.rs similarity index 100% rename from src/test/compile-fail/macro-missing-fragment.rs rename to src/test/ui/macros/macro-missing-fragment.rs diff --git a/src/test/ui/macros/macro-missing-fragment.stderr b/src/test/ui/macros/macro-missing-fragment.stderr new file mode 100644 index 0000000000000..48e07ed9dbdbb --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-non-lifetime.rs similarity index 100% rename from src/test/compile-fail/macro-non-lifetime.rs rename to src/test/ui/macros/macro-non-lifetime.rs diff --git a/src/test/ui/macros/macro-non-lifetime.stderr b/src/test/ui/macros/macro-non-lifetime.stderr new file mode 100644 index 0000000000000..93b7f481842ac --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-outer-attributes.rs similarity index 100% rename from src/test/compile-fail/macro-outer-attributes.rs rename to src/test/ui/macros/macro-outer-attributes.rs diff --git a/src/test/ui/macros/macro-outer-attributes.stderr b/src/test/ui/macros/macro-outer-attributes.stderr new file mode 100644 index 0000000000000..4cc8cd5dc90e8 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-parameter-span.rs similarity index 100% rename from src/test/compile-fail/macro-parameter-span.rs rename to src/test/ui/macros/macro-parameter-span.rs diff --git a/src/test/ui/macros/macro-parameter-span.stderr b/src/test/ui/macros/macro-parameter-span.stderr new file mode 100644 index 0000000000000..749221e9bf0b5 --- /dev/null +++ b/src/test/ui/macros/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/ui/macro-path-prelude-fail-1.rs b/src/test/ui/macros/macro-path-prelude-fail-1.rs similarity index 100% rename from src/test/ui/macro-path-prelude-fail-1.rs rename to src/test/ui/macros/macro-path-prelude-fail-1.rs diff --git a/src/test/ui/macro-path-prelude-fail-1.stderr b/src/test/ui/macros/macro-path-prelude-fail-1.stderr similarity index 100% rename from src/test/ui/macro-path-prelude-fail-1.stderr rename to src/test/ui/macros/macro-path-prelude-fail-1.stderr diff --git a/src/test/ui/macro-path-prelude-fail-2.rs b/src/test/ui/macros/macro-path-prelude-fail-2.rs similarity index 100% rename from src/test/ui/macro-path-prelude-fail-2.rs rename to src/test/ui/macros/macro-path-prelude-fail-2.rs diff --git a/src/test/ui/macro-path-prelude-fail-2.stderr b/src/test/ui/macros/macro-path-prelude-fail-2.stderr similarity index 100% rename from src/test/ui/macro-path-prelude-fail-2.stderr rename to src/test/ui/macros/macro-path-prelude-fail-2.stderr diff --git a/src/test/ui/macro-path-prelude-fail-3.rs b/src/test/ui/macros/macro-path-prelude-fail-3.rs similarity index 100% rename from src/test/ui/macro-path-prelude-fail-3.rs rename to src/test/ui/macros/macro-path-prelude-fail-3.rs diff --git a/src/test/ui/macro-path-prelude-fail-3.stderr b/src/test/ui/macros/macro-path-prelude-fail-3.stderr similarity index 100% rename from src/test/ui/macro-path-prelude-fail-3.stderr rename to src/test/ui/macros/macro-path-prelude-fail-3.stderr diff --git a/src/test/ui/macro-path-prelude-pass.rs b/src/test/ui/macros/macro-path-prelude-pass.rs similarity index 100% rename from src/test/ui/macro-path-prelude-pass.rs rename to src/test/ui/macros/macro-path-prelude-pass.rs diff --git a/src/test/ui/macro-path-prelude-shadowing.rs b/src/test/ui/macros/macro-path-prelude-shadowing.rs similarity index 100% rename from src/test/ui/macro-path-prelude-shadowing.rs rename to src/test/ui/macros/macro-path-prelude-shadowing.rs diff --git a/src/test/ui/macro-path-prelude-shadowing.stderr b/src/test/ui/macros/macro-path-prelude-shadowing.stderr similarity index 100% rename from src/test/ui/macro-path-prelude-shadowing.stderr rename to src/test/ui/macros/macro-path-prelude-shadowing.stderr diff --git a/src/test/ui/macro-reexport-removed.rs b/src/test/ui/macros/macro-reexport-removed.rs similarity index 100% rename from src/test/ui/macro-reexport-removed.rs rename to src/test/ui/macros/macro-reexport-removed.rs diff --git a/src/test/ui/macro-reexport-removed.stderr b/src/test/ui/macros/macro-reexport-removed.stderr similarity index 100% rename from src/test/ui/macro-reexport-removed.stderr rename to src/test/ui/macros/macro-reexport-removed.stderr diff --git a/src/test/ui/macro-shadowing.rs b/src/test/ui/macros/macro-shadowing.rs similarity index 100% rename from src/test/ui/macro-shadowing.rs rename to src/test/ui/macros/macro-shadowing.rs diff --git a/src/test/ui/macro-shadowing.stderr b/src/test/ui/macros/macro-shadowing.stderr similarity index 100% rename from src/test/ui/macro-shadowing.stderr rename to src/test/ui/macros/macro-shadowing.stderr diff --git a/src/test/compile-fail/macro-stability.rs b/src/test/ui/macros/macro-stability.rs similarity index 100% rename from src/test/compile-fail/macro-stability.rs rename to src/test/ui/macros/macro-stability.rs diff --git a/src/test/ui/macros/macro-stability.stderr b/src/test/ui/macros/macro-stability.stderr new file mode 100644 index 0000000000000..947133f287d06 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-stmt-matchers.rs similarity index 100% rename from src/test/compile-fail/macro-stmt-matchers.rs rename to src/test/ui/macros/macro-stmt-matchers.rs diff --git a/src/test/ui/macros/macro-stmt-matchers.stderr b/src/test/ui/macros/macro-stmt-matchers.stderr new file mode 100644 index 0000000000000..ef6210bb6f7e8 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-tt-matchers.rs similarity index 100% rename from src/test/compile-fail/macro-tt-matchers.rs rename to src/test/ui/macros/macro-tt-matchers.rs diff --git a/src/test/ui/macros/macro-tt-matchers.stderr b/src/test/ui/macros/macro-tt-matchers.stderr new file mode 100644 index 0000000000000..b7551c1bd93b1 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-use-bad-args-1.rs similarity index 100% rename from src/test/compile-fail/macro-use-bad-args-1.rs rename to src/test/ui/macros/macro-use-bad-args-1.rs diff --git a/src/test/ui/macros/macro-use-bad-args-1.stderr b/src/test/ui/macros/macro-use-bad-args-1.stderr new file mode 100644 index 0000000000000..19a8c7c0382d1 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-use-bad-args-2.rs similarity index 100% rename from src/test/compile-fail/macro-use-bad-args-2.rs rename to src/test/ui/macros/macro-use-bad-args-2.rs diff --git a/src/test/ui/macros/macro-use-bad-args-2.stderr b/src/test/ui/macros/macro-use-bad-args-2.stderr new file mode 100644 index 0000000000000..0ac18201d791e --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-use-scope.rs similarity index 100% rename from src/test/compile-fail/macro-use-scope.rs rename to src/test/ui/macros/macro-use-scope.rs diff --git a/src/test/ui/macros/macro-use-scope.stderr b/src/test/ui/macros/macro-use-scope.stderr new file mode 100644 index 0000000000000..2e81750d43bbc --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-use-undef.rs similarity index 100% rename from src/test/compile-fail/macro-use-undef.rs rename to src/test/ui/macros/macro-use-undef.rs diff --git a/src/test/ui/macros/macro-use-undef.stderr b/src/test/ui/macros/macro-use-undef.stderr new file mode 100644 index 0000000000000..6fc57a34794d5 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-use-wrong-name.rs similarity index 100% rename from src/test/compile-fail/macro-use-wrong-name.rs rename to src/test/ui/macros/macro-use-wrong-name.rs diff --git a/src/test/ui/macros/macro-use-wrong-name.stderr b/src/test/ui/macros/macro-use-wrong-name.stderr new file mode 100644 index 0000000000000..26271a2162352 --- /dev/null +++ b/src/test/ui/macros/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/macros/macro-with-seps-err-msg.rs similarity index 100% rename from src/test/compile-fail/macro-with-seps-err-msg.rs rename to src/test/ui/macros/macro-with-seps-err-msg.rs diff --git a/src/test/ui/macros/macro-with-seps-err-msg.stderr b/src/test/ui/macros/macro-with-seps-err-msg.stderr new file mode 100644 index 0000000000000..0b6d186b2368d --- /dev/null +++ b/src/test/ui/macros/macro-with-seps-err-msg.stderr @@ -0,0 +1,11 @@ +error[E0658]: non-ident macro paths are experimental (see issue #35896) + --> $DIR/macro-with-seps-err-msg.rs:14:5 + | +LL | globnar::brotz!(); //~ ERROR non-ident macro paths are experimental + | ^^^^^^^^^^^^^^ + | + = help: add #![feature(use_extern_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/macros-in-extern.rs b/src/test/ui/macros/macros-in-extern.rs similarity index 100% rename from src/test/compile-fail/macros-in-extern.rs rename to src/test/ui/macros/macros-in-extern.rs diff --git a/src/test/ui/macros/macros-in-extern.stderr b/src/test/ui/macros/macros-in-extern.stderr new file mode 100644 index 0000000000000..60492d34451c8 --- /dev/null +++ b/src/test/ui/macros/macros-in-extern.stderr @@ -0,0 +1,27 @@ +error[E0658]: 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 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 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/macros/macros-nonfatal-errors.rs similarity index 91% rename from src/test/compile-fail/macros-nonfatal-errors.rs rename to src/test/ui/macros/macros-nonfatal-errors.rs index 7046ee12b50e5..2815e1be70983 100644 --- a/src/test/compile-fail/macros-nonfatal-errors.rs +++ b/src/test/ui/macros/macros-nonfatal-errors.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test: "The system cannot find the file specified\." -> "No such file or directory" +// ignore-tidy-linelength + // test that errors in a (selection) of macros don't kill compilation // immediately, so that we get more errors listed at a time. diff --git a/src/test/ui/macros/macros-nonfatal-errors.stderr b/src/test/ui/macros/macros-nonfatal-errors.stderr new file mode 100644 index 0000000000000..084042acc974d --- /dev/null +++ b/src/test/ui/macros/macros-nonfatal-errors.stderr @@ -0,0 +1,100 @@ +error[E0665]: `Default` cannot be derived for enums, only structs + --> $DIR/macros-nonfatal-errors.rs:20:10 + | +LL | #[derive(Default)] //~ ERROR + | ^^^^^^^ + +error: inline assembly must be a string literal + --> $DIR/macros-nonfatal-errors.rs:24:10 + | +LL | asm!(invalid); //~ ERROR + | ^^^^^^^ + +error: concat_idents! requires ident args. + --> $DIR/macros-nonfatal-errors.rs:26:5 + | +LL | concat_idents!("not", "idents"); //~ ERROR + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: argument must be a string literal + --> $DIR/macros-nonfatal-errors.rs:28:17 + | +LL | option_env!(invalid); //~ ERROR + | ^^^^^^^ + +error: expected string literal + --> $DIR/macros-nonfatal-errors.rs:29:10 + | +LL | env!(invalid); //~ ERROR + | ^^^^^^^ + +error: expected string literal + --> $DIR/macros-nonfatal-errors.rs:30:10 + | +LL | env!(foo, abr, baz); //~ ERROR + | ^^^ + +error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined + --> $DIR/macros-nonfatal-errors.rs:31: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:33: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:35: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:37:14 + | +LL | include!(invalid); //~ ERROR + | ^^^^^^^ + +error: argument must be a string literal + --> $DIR/macros-nonfatal-errors.rs:39: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:40: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:41: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:42: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:44: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/main-wrong-type.rs similarity index 100% rename from src/test/compile-fail/main-wrong-type.rs rename to src/test/ui/main-wrong-type.rs diff --git a/src/test/ui/main-wrong-type.stderr b/src/test/ui/main-wrong-type.stderr new file mode 100644 index 0000000000000..15094bd1fbb41 --- /dev/null +++ b/src/test/ui/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/malformed/malformed-derive-entry.rs similarity index 100% rename from src/test/compile-fail/malformed-derive-entry.rs rename to src/test/ui/malformed/malformed-derive-entry.rs diff --git a/src/test/ui/malformed/malformed-derive-entry.stderr b/src/test/ui/malformed/malformed-derive-entry.stderr new file mode 100644 index 0000000000000..b1984f5243043 --- /dev/null +++ b/src/test/ui/malformed/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/malformed/malformed-plugin-1.rs similarity index 100% rename from src/test/compile-fail/malformed-plugin-1.rs rename to src/test/ui/malformed/malformed-plugin-1.rs diff --git a/src/test/ui/malformed/malformed-plugin-1.stderr b/src/test/ui/malformed/malformed-plugin-1.stderr new file mode 100644 index 0000000000000..5ceabc3b8ba1e --- /dev/null +++ b/src/test/ui/malformed/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/malformed/malformed-plugin-2.rs similarity index 100% rename from src/test/compile-fail/malformed-plugin-2.rs rename to src/test/ui/malformed/malformed-plugin-2.rs diff --git a/src/test/ui/malformed/malformed-plugin-2.stderr b/src/test/ui/malformed/malformed-plugin-2.stderr new file mode 100644 index 0000000000000..56c87f9f8dd8c --- /dev/null +++ b/src/test/ui/malformed/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/malformed/malformed-plugin-3.rs similarity index 100% rename from src/test/compile-fail/malformed-plugin-3.rs rename to src/test/ui/malformed/malformed-plugin-3.rs diff --git a/src/test/ui/malformed/malformed-plugin-3.stderr b/src/test/ui/malformed/malformed-plugin-3.stderr new file mode 100644 index 0000000000000..fff52c649e8eb --- /dev/null +++ b/src/test/ui/malformed/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/malformed_macro_lhs.rs similarity index 100% rename from src/test/compile-fail/malformed_macro_lhs.rs rename to src/test/ui/malformed_macro_lhs.rs diff --git a/src/test/ui/malformed_macro_lhs.stderr b/src/test/ui/malformed_macro_lhs.stderr new file mode 100644 index 0000000000000..6b4241890b12b --- /dev/null +++ b/src/test/ui/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/manual/manual-link-bad-form.rs similarity index 100% rename from src/test/compile-fail/manual-link-bad-form.rs rename to src/test/ui/manual/manual-link-bad-form.rs diff --git a/src/test/ui/manual/manual-link-bad-form.stderr b/src/test/ui/manual/manual-link-bad-form.stderr new file mode 100644 index 0000000000000..ed3c4c4fc4d5d --- /dev/null +++ b/src/test/ui/manual/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/manual/manual-link-bad-kind.rs similarity index 100% rename from src/test/compile-fail/manual-link-bad-kind.rs rename to src/test/ui/manual/manual-link-bad-kind.rs diff --git a/src/test/ui/manual/manual-link-bad-kind.stderr b/src/test/ui/manual/manual-link-bad-kind.stderr new file mode 100644 index 0000000000000..03c33a9751208 --- /dev/null +++ b/src/test/ui/manual/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/manual/manual-link-bad-search-path.rs similarity index 100% rename from src/test/compile-fail/manual-link-bad-search-path.rs rename to src/test/ui/manual/manual-link-bad-search-path.rs diff --git a/src/test/ui/manual/manual-link-bad-search-path.stderr b/src/test/ui/manual/manual-link-bad-search-path.stderr new file mode 100644 index 0000000000000..2c0649ea152e6 --- /dev/null +++ b/src/test/ui/manual/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/manual/manual-link-framework.rs similarity index 100% rename from src/test/compile-fail/manual-link-framework.rs rename to src/test/ui/manual/manual-link-framework.rs diff --git a/src/test/ui/manual/manual-link-framework.stderr b/src/test/ui/manual/manual-link-framework.stderr new file mode 100644 index 0000000000000..3e8da8b2f931f --- /dev/null +++ b/src/test/ui/manual/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/map-types.rs similarity index 100% rename from src/test/compile-fail/map-types.rs rename to src/test/ui/map-types.rs diff --git a/src/test/ui/map-types.stderr b/src/test/ui/map-types.stderr new file mode 100644 index 0000000000000..722113c752548 --- /dev/null +++ b/src/test/ui/map-types.stderr @@ -0,0 +1,11 @@ +error[E0277]: the trait bound `std::boxed::Box>: Map` is not satisfied + --> $DIR/map-types.rs:27:37 + | +LL | let y: Box> = Box::new(x); + | ^^^^^^^^^^^ the trait `Map` is not implemented for `std::boxed::Box>` + | + = note: required for the cast to the object type `dyn Map` + +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/match/match-argm-statics-2.rs similarity index 100% rename from src/test/compile-fail/match-argm-statics-2.rs rename to src/test/ui/match/match-argm-statics-2.rs diff --git a/src/test/ui/match/match-argm-statics-2.stderr b/src/test/ui/match/match-argm-statics-2.stderr new file mode 100644 index 0000000000000..485b2a3202fff --- /dev/null +++ b/src/test/ui/match/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/match/match-arm-statics.rs similarity index 100% rename from src/test/compile-fail/match-arm-statics.rs rename to src/test/ui/match/match-arm-statics.rs diff --git a/src/test/ui/match/match-arm-statics.stderr b/src/test/ui/match/match-arm-statics.stderr new file mode 100644 index 0000000000000..8862be2254f02 --- /dev/null +++ b/src/test/ui/match/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/match/match-byte-array-patterns-2.rs similarity index 100% rename from src/test/compile-fail/match-byte-array-patterns-2.rs rename to src/test/ui/match/match-byte-array-patterns-2.rs diff --git a/src/test/ui/match/match-byte-array-patterns-2.stderr b/src/test/ui/match/match-byte-array-patterns-2.stderr new file mode 100644 index 0000000000000..bc52376d82441 --- /dev/null +++ b/src/test/ui/match/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/match/match-byte-array-patterns.rs similarity index 100% rename from src/test/compile-fail/match-byte-array-patterns.rs rename to src/test/ui/match/match-byte-array-patterns.rs diff --git a/src/test/ui/match/match-byte-array-patterns.stderr b/src/test/ui/match/match-byte-array-patterns.stderr new file mode 100644 index 0000000000000..da3d57743aabd --- /dev/null +++ b/src/test/ui/match/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/match/match-ill-type2.rs similarity index 100% rename from src/test/compile-fail/match-ill-type2.rs rename to src/test/ui/match/match-ill-type2.rs diff --git a/src/test/ui/match/match-ill-type2.stderr b/src/test/ui/match/match-ill-type2.stderr new file mode 100644 index 0000000000000..b649a38476eb2 --- /dev/null +++ b/src/test/ui/match/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/match/match-join.rs similarity index 100% rename from src/test/compile-fail/match-join.rs rename to src/test/ui/match/match-join.rs diff --git a/src/test/ui/match/match-join.stderr b/src/test/ui/match/match-join.stderr new file mode 100644 index 0000000000000..a4a8a9d717409 --- /dev/null +++ b/src/test/ui/match/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/match/match-no-arms-unreachable-after.rs similarity index 100% rename from src/test/compile-fail/match-no-arms-unreachable-after.rs rename to src/test/ui/match/match-no-arms-unreachable-after.rs diff --git a/src/test/ui/match/match-no-arms-unreachable-after.stderr b/src/test/ui/match/match-no-arms-unreachable-after.stderr new file mode 100644 index 0000000000000..35fae051870e0 --- /dev/null +++ b/src/test/ui/match/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/match/match-non-exhaustive.rs similarity index 100% rename from src/test/compile-fail/match-non-exhaustive.rs rename to src/test/ui/match/match-non-exhaustive.rs diff --git a/src/test/ui/match/match-non-exhaustive.stderr b/src/test/ui/match/match-non-exhaustive.stderr new file mode 100644 index 0000000000000..04f09caceed3d --- /dev/null +++ b/src/test/ui/match/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/match/match-pattern-field-mismatch-2.rs similarity index 100% rename from src/test/compile-fail/match-pattern-field-mismatch-2.rs rename to src/test/ui/match/match-pattern-field-mismatch-2.rs diff --git a/src/test/ui/match/match-pattern-field-mismatch-2.stderr b/src/test/ui/match/match-pattern-field-mismatch-2.stderr new file mode 100644 index 0000000000000..b43fa9149bd2b --- /dev/null +++ b/src/test/ui/match/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/match/match-pattern-field-mismatch.rs similarity index 100% rename from src/test/compile-fail/match-pattern-field-mismatch.rs rename to src/test/ui/match/match-pattern-field-mismatch.rs diff --git a/src/test/ui/match/match-pattern-field-mismatch.stderr b/src/test/ui/match/match-pattern-field-mismatch.stderr new file mode 100644 index 0000000000000..d975f9afc7c0b --- /dev/null +++ b/src/test/ui/match/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/match/match-privately-empty.rs similarity index 100% rename from src/test/compile-fail/match-privately-empty.rs rename to src/test/ui/match/match-privately-empty.rs diff --git a/src/test/ui/match/match-privately-empty.stderr b/src/test/ui/match/match-privately-empty.stderr new file mode 100644 index 0000000000000..04b4ce00e9b82 --- /dev/null +++ b/src/test/ui/match/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/match/match-range-fail-2.rs similarity index 100% rename from src/test/compile-fail/match-range-fail-2.rs rename to src/test/ui/match/match-range-fail-2.rs diff --git a/src/test/ui/match/match-range-fail-2.stderr b/src/test/ui/match/match-range-fail-2.stderr new file mode 100644 index 0000000000000..616f74ed858ba --- /dev/null +++ b/src/test/ui/match/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/match/match-range-fail-dominate.rs similarity index 100% rename from src/test/compile-fail/match-range-fail-dominate.rs rename to src/test/ui/match/match-range-fail-dominate.rs diff --git a/src/test/ui/match/match-range-fail-dominate.stderr b/src/test/ui/match/match-range-fail-dominate.stderr new file mode 100644 index 0000000000000..d75630e09c507 --- /dev/null +++ b/src/test/ui/match/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 + +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 + +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 + +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/match/match-range-fail.rs similarity index 100% rename from src/test/compile-fail/match-range-fail.rs rename to src/test/ui/match/match-range-fail.rs diff --git a/src/test/ui/match/match-range-fail.stderr b/src/test/ui/match/match-range-fail.stderr new file mode 100644 index 0000000000000..dbc251020a930 --- /dev/null +++ b/src/test/ui/match/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/match/match-ref-ice.rs similarity index 100% rename from src/test/compile-fail/match-ref-ice.rs rename to src/test/ui/match/match-ref-ice.rs diff --git a/src/test/ui/match/match-ref-ice.stderr b/src/test/ui/match/match-ref-ice.stderr new file mode 100644 index 0000000000000..1dc87afddea6d --- /dev/null +++ b/src/test/ui/match/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/match/match-ref-mut-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-invariance.nll.stderr new file mode 100644 index 0000000000000..cabf933bb81da --- /dev/null +++ b/src/test/ui/match/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/match/match-ref-mut-invariance.rs similarity index 100% rename from src/test/compile-fail/match-ref-mut-invariance.rs rename to src/test/ui/match/match-ref-mut-invariance.rs diff --git a/src/test/ui/match/match-ref-mut-invariance.stderr b/src/test/ui/match/match-ref-mut-invariance.stderr new file mode 100644 index 0000000000000..24677fe859727 --- /dev/null +++ b/src/test/ui/match/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/match/match-ref-mut-let-invariance.nll.stderr b/src/test/ui/match/match-ref-mut-let-invariance.nll.stderr new file mode 100644 index 0000000000000..f01a9f3a3b0b3 --- /dev/null +++ b/src/test/ui/match/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/match/match-ref-mut-let-invariance.rs similarity index 100% rename from src/test/compile-fail/match-ref-mut-let-invariance.rs rename to src/test/ui/match/match-ref-mut-let-invariance.rs diff --git a/src/test/ui/match/match-ref-mut-let-invariance.stderr b/src/test/ui/match/match-ref-mut-let-invariance.stderr new file mode 100644 index 0000000000000..cc096d68ebdcc --- /dev/null +++ b/src/test/ui/match/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/match/match-slice-patterns.rs similarity index 100% rename from src/test/compile-fail/match-slice-patterns.rs rename to src/test/ui/match/match-slice-patterns.rs diff --git a/src/test/ui/match/match-slice-patterns.stderr b/src/test/ui/match/match-slice-patterns.stderr new file mode 100644 index 0000000000000..cefd7df8b78d0 --- /dev/null +++ b/src/test/ui/match/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/match/match-static-const-lc.rs similarity index 100% rename from src/test/compile-fail/match-static-const-lc.rs rename to src/test/ui/match/match-static-const-lc.rs diff --git a/src/test/ui/match/match-static-const-lc.stderr b/src/test/ui/match/match-static-const-lc.stderr new file mode 100644 index 0000000000000..08eb5712875e8 --- /dev/null +++ b/src/test/ui/match/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/match/match-struct.rs similarity index 100% rename from src/test/compile-fail/match-struct.rs rename to src/test/ui/match/match-struct.rs diff --git a/src/test/ui/match/match-struct.stderr b/src/test/ui/match/match-struct.stderr new file mode 100644 index 0000000000000..43f17b2d747b3 --- /dev/null +++ b/src/test/ui/match/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/match/match-tag-nullary.rs similarity index 100% rename from src/test/compile-fail/match-tag-nullary.rs rename to src/test/ui/match/match-tag-nullary.rs diff --git a/src/test/ui/match/match-tag-nullary.stderr b/src/test/ui/match/match-tag-nullary.stderr new file mode 100644 index 0000000000000..869d8ac7747c4 --- /dev/null +++ b/src/test/ui/match/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/match/match-tag-unary.rs similarity index 100% rename from src/test/compile-fail/match-tag-unary.rs rename to src/test/ui/match/match-tag-unary.rs diff --git a/src/test/ui/match/match-tag-unary.stderr b/src/test/ui/match/match-tag-unary.stderr new file mode 100644 index 0000000000000..bb4deee2569d1 --- /dev/null +++ b/src/test/ui/match/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/match/match-unreachable-warning-with-diverging-discrim.rs similarity index 100% rename from src/test/compile-fail/match-unreachable-warning-with-diverging-discrim.rs rename to src/test/ui/match/match-unreachable-warning-with-diverging-discrim.rs diff --git a/src/test/ui/match/match-unreachable-warning-with-diverging-discrim.stderr b/src/test/ui/match/match-unreachable-warning-with-diverging-discrim.stderr new file mode 100644 index 0000000000000..10a86f92fe151 --- /dev/null +++ b/src/test/ui/match/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/match/match-unresolved-one-arm.rs similarity index 100% rename from src/test/compile-fail/match-unresolved-one-arm.rs rename to src/test/ui/match/match-unresolved-one-arm.rs diff --git a/src/test/ui/match/match-unresolved-one-arm.stderr b/src/test/ui/match/match-unresolved-one-arm.stderr new file mode 100644 index 0000000000000..fa689a8092b7a --- /dev/null +++ b/src/test/ui/match/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/match/match-vec-fixed.rs similarity index 100% rename from src/test/compile-fail/match-vec-fixed.rs rename to src/test/ui/match/match-vec-fixed.rs diff --git a/src/test/ui/match/match-vec-fixed.stderr b/src/test/ui/match/match-vec-fixed.stderr new file mode 100644 index 0000000000000..1b85034ef6bc3 --- /dev/null +++ b/src/test/ui/match/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/match/match-vec-mismatch-2.rs similarity index 100% rename from src/test/compile-fail/match-vec-mismatch-2.rs rename to src/test/ui/match/match-vec-mismatch-2.rs diff --git a/src/test/ui/match/match-vec-mismatch-2.stderr b/src/test/ui/match/match-vec-mismatch-2.stderr new file mode 100644 index 0000000000000..66f58bdff3253 --- /dev/null +++ b/src/test/ui/match/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/match/match-vec-mismatch.rs similarity index 100% rename from src/test/compile-fail/match-vec-mismatch.rs rename to src/test/ui/match/match-vec-mismatch.rs diff --git a/src/test/ui/match/match-vec-mismatch.stderr b/src/test/ui/match/match-vec-mismatch.stderr new file mode 100644 index 0000000000000..c30ddf9d0fa54 --- /dev/null +++ b/src/test/ui/match/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/match/match-vec-unreachable.rs similarity index 100% rename from src/test/compile-fail/match-vec-unreachable.rs rename to src/test/ui/match/match-vec-unreachable.rs diff --git a/src/test/ui/match/match-vec-unreachable.stderr b/src/test/ui/match/match-vec-unreachable.stderr new file mode 100644 index 0000000000000..e8869e86bf957 --- /dev/null +++ b/src/test/ui/match/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/maybe-bounds-where-cpass.rs similarity index 100% rename from src/test/compile-fail/maybe-bounds-where-cpass.rs rename to src/test/ui/maybe-bounds-where-cpass.rs diff --git a/src/test/ui/maybe-bounds-where-cpass.stderr b/src/test/ui/maybe-bounds-where-cpass.stderr new file mode 100644 index 0000000000000..d60e4cdffb4f5 --- /dev/null +++ b/src/test/ui/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/maybe-bounds-where.rs similarity index 100% rename from src/test/compile-fail/maybe-bounds-where.rs rename to src/test/ui/maybe-bounds-where.rs diff --git a/src/test/ui/maybe-bounds-where.stderr b/src/test/ui/maybe-bounds-where.stderr new file mode 100644 index 0000000000000..02aafecb7a4f4 --- /dev/null +++ b/src/test/ui/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) 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) 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) 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) 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(*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(*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/meta-expected-error-correct-rev.a.stderr b/src/test/ui/meta-expected-error-correct-rev.a.stderr new file mode 100644 index 0000000000000..20b93068c648f --- /dev/null +++ b/src/test/ui/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/meta-expected-error-correct-rev.rs similarity index 100% rename from src/test/compile-fail/meta-expected-error-correct-rev.rs rename to src/test/ui/meta-expected-error-correct-rev.rs diff --git a/src/test/compile-fail/auxiliary/ambig_impl_2_lib.rs b/src/test/ui/methods/auxiliary/ambig_impl_2_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/ambig_impl_2_lib.rs rename to src/test/ui/methods/auxiliary/ambig_impl_2_lib.rs diff --git a/src/test/ui/methods/auxiliary/macro-in-other-crate.rs b/src/test/ui/methods/auxiliary/macro-in-other-crate.rs new file mode 100644 index 0000000000000..c787cedc2d0ea --- /dev/null +++ b/src/test/ui/methods/auxiliary/macro-in-other-crate.rs @@ -0,0 +1,19 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[macro_export] +macro_rules! mac { + ($ident:ident) => { let $ident = 42; } +} + +#[macro_export] +macro_rules! inline { + () => () +} diff --git a/src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.rs similarity index 100% rename from src/test/compile-fail/method-ambig-one-trait-unknown-int-type.rs rename to src/test/ui/methods/method-ambig-one-trait-unknown-int-type.rs diff --git a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr new file mode 100644 index 0000000000000..7f034b9e53d80 --- /dev/null +++ b/src/test/ui/methods/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/methods/method-ambig-two-traits-cross-crate.rs similarity index 100% rename from src/test/compile-fail/method-ambig-two-traits-cross-crate.rs rename to src/test/ui/methods/method-ambig-two-traits-cross-crate.rs diff --git a/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr b/src/test/ui/methods/method-ambig-two-traits-cross-crate.stderr new file mode 100644 index 0000000000000..7a75f20f65a49 --- /dev/null +++ b/src/test/ui/methods/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/methods/method-ambig-two-traits-from-bounds.rs similarity index 100% rename from src/test/compile-fail/method-ambig-two-traits-from-bounds.rs rename to src/test/ui/methods/method-ambig-two-traits-from-bounds.rs diff --git a/src/test/ui/methods/method-ambig-two-traits-from-bounds.stderr b/src/test/ui/methods/method-ambig-two-traits-from-bounds.stderr new file mode 100644 index 0000000000000..06003d900b798 --- /dev/null +++ b/src/test/ui/methods/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/methods/method-ambig-two-traits-with-default-method.rs similarity index 100% rename from src/test/compile-fail/method-ambig-two-traits-with-default-method.rs rename to src/test/ui/methods/method-ambig-two-traits-with-default-method.rs diff --git a/src/test/ui/methods/method-ambig-two-traits-with-default-method.stderr b/src/test/ui/methods/method-ambig-two-traits-with-default-method.stderr new file mode 100644 index 0000000000000..d67e17d228f78 --- /dev/null +++ b/src/test/ui/methods/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/ui/method-call-err-msg.rs b/src/test/ui/methods/method-call-err-msg.rs similarity index 100% rename from src/test/ui/method-call-err-msg.rs rename to src/test/ui/methods/method-call-err-msg.rs diff --git a/src/test/ui/method-call-err-msg.stderr b/src/test/ui/methods/method-call-err-msg.stderr similarity index 100% rename from src/test/ui/method-call-err-msg.stderr rename to src/test/ui/methods/method-call-err-msg.stderr diff --git a/src/test/compile-fail/method-call-lifetime-args.rs b/src/test/ui/methods/method-call-lifetime-args-fail.rs similarity index 100% rename from src/test/compile-fail/method-call-lifetime-args.rs rename to src/test/ui/methods/method-call-lifetime-args-fail.rs diff --git a/src/test/ui/methods/method-call-lifetime-args-fail.stderr b/src/test/ui/methods/method-call-lifetime-args-fail.stderr new file mode 100644 index 0000000000000..3814f4b5065ba --- /dev/null +++ b/src/test/ui/methods/method-call-lifetime-args-fail.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-fail.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-fail.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-fail.rs:37:15 + | +LL | S::late::<'static>(S, &0, &0); + | ^^^^^^^ + | +note: the late bound lifetime parameter is introduced here + --> $DIR/method-call-lifetime-args-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-fail.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-lifetime-args-lint.rs b/src/test/ui/methods/method-call-lifetime-args-lint-fail.rs similarity index 100% rename from src/test/compile-fail/method-call-lifetime-args-lint.rs rename to src/test/ui/methods/method-call-lifetime-args-lint-fail.rs diff --git a/src/test/ui/methods/method-call-lifetime-args-lint-fail.stderr b/src/test/ui/methods/method-call-lifetime-args-lint-fail.stderr new file mode 100644 index 0000000000000..34747edc2a0ae --- /dev/null +++ b/src/test/ui/methods/method-call-lifetime-args-lint-fail.stderr @@ -0,0 +1,187 @@ +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present + --> $DIR/method-call-lifetime-args-lint-fail.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 + +error: aborting due to 15 previous errors + diff --git a/src/test/ui/method-call-lifetime-args-lint.rs b/src/test/ui/methods/method-call-lifetime-args-lint.rs similarity index 100% rename from src/test/ui/method-call-lifetime-args-lint.rs rename to src/test/ui/methods/method-call-lifetime-args-lint.rs diff --git a/src/test/ui/method-call-lifetime-args-lint.stderr b/src/test/ui/methods/method-call-lifetime-args-lint.stderr similarity index 100% rename from src/test/ui/method-call-lifetime-args-lint.stderr rename to src/test/ui/methods/method-call-lifetime-args-lint.stderr diff --git a/src/test/compile-fail/method-call-lifetime-args-subst-index.rs b/src/test/ui/methods/method-call-lifetime-args-subst-index.rs similarity index 100% rename from src/test/compile-fail/method-call-lifetime-args-subst-index.rs rename to src/test/ui/methods/method-call-lifetime-args-subst-index.rs diff --git a/src/test/ui/methods/method-call-lifetime-args-subst-index.stderr b/src/test/ui/methods/method-call-lifetime-args-subst-index.stderr new file mode 100644 index 0000000000000..2848ff88c174c --- /dev/null +++ b/src/test/ui/methods/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/methods/method-call-lifetime-args-unresolved.rs similarity index 100% rename from src/test/compile-fail/method-call-lifetime-args-unresolved.rs rename to src/test/ui/methods/method-call-lifetime-args-unresolved.rs diff --git a/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr b/src/test/ui/methods/method-call-lifetime-args-unresolved.stderr new file mode 100644 index 0000000000000..8eb860d947435 --- /dev/null +++ b/src/test/ui/methods/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/ui/method-call-lifetime-args.rs b/src/test/ui/methods/method-call-lifetime-args.rs similarity index 100% rename from src/test/ui/method-call-lifetime-args.rs rename to src/test/ui/methods/method-call-lifetime-args.rs diff --git a/src/test/ui/method-call-lifetime-args.stderr b/src/test/ui/methods/method-call-lifetime-args.stderr similarity index 100% rename from src/test/ui/method-call-lifetime-args.stderr rename to src/test/ui/methods/method-call-lifetime-args.stderr diff --git a/src/test/compile-fail/method-call-type-binding.rs b/src/test/ui/methods/method-call-type-binding.rs similarity index 100% rename from src/test/compile-fail/method-call-type-binding.rs rename to src/test/ui/methods/method-call-type-binding.rs diff --git a/src/test/ui/methods/method-call-type-binding.stderr b/src/test/ui/methods/method-call-type-binding.stderr new file mode 100644 index 0000000000000..aafc84804b5e3 --- /dev/null +++ b/src/test/ui/methods/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::(); //~ 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/methods/method-macro-backtrace.rs similarity index 100% rename from src/test/compile-fail/method-macro-backtrace.rs rename to src/test/ui/methods/method-macro-backtrace.rs diff --git a/src/test/ui/methods/method-macro-backtrace.stderr b/src/test/ui/methods/method-macro-backtrace.stderr new file mode 100644 index 0000000000000..28f46dba1ccab --- /dev/null +++ b/src/test/ui/methods/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/ui/method-missing-call.rs b/src/test/ui/methods/method-missing-call.rs similarity index 100% rename from src/test/ui/method-missing-call.rs rename to src/test/ui/methods/method-missing-call.rs diff --git a/src/test/ui/method-missing-call.stderr b/src/test/ui/methods/method-missing-call.stderr similarity index 100% rename from src/test/ui/method-missing-call.stderr rename to src/test/ui/methods/method-missing-call.stderr diff --git a/src/test/ui/method-on-ambiguous-numeric-type.rs b/src/test/ui/methods/method-on-ambiguous-numeric-type.rs similarity index 100% rename from src/test/ui/method-on-ambiguous-numeric-type.rs rename to src/test/ui/methods/method-on-ambiguous-numeric-type.rs diff --git a/src/test/ui/method-on-ambiguous-numeric-type.stderr b/src/test/ui/methods/method-on-ambiguous-numeric-type.stderr similarity index 100% rename from src/test/ui/method-on-ambiguous-numeric-type.stderr rename to src/test/ui/methods/method-on-ambiguous-numeric-type.stderr diff --git a/src/test/compile-fail/method-path-in-pattern.rs b/src/test/ui/methods/method-path-in-pattern.rs similarity index 100% rename from src/test/compile-fail/method-path-in-pattern.rs rename to src/test/ui/methods/method-path-in-pattern.rs diff --git a/src/test/ui/methods/method-path-in-pattern.stderr b/src/test/ui/methods/method-path-in-pattern.stderr new file mode 100644 index 0000000000000..1fae336c79c58 --- /dev/null +++ b/src/test/ui/methods/method-path-in-pattern.stderr @@ -0,0 +1,21 @@ +error[E0533]: expected unit struct/variant or constant, found method `::bar` + --> $DIR/method-path-in-pattern.rs:25:9 + | +LL | Foo::bar => {} + | ^^^^^^^^ + +error[E0533]: expected unit struct/variant or constant, found method `::bar` + --> $DIR/method-path-in-pattern.rs:29:9 + | +LL | ::bar => {} + | ^^^^^^^^^^ + +error[E0533]: expected unit struct/variant or constant, found method `::trait_bar` + --> $DIR/method-path-in-pattern.rs:33:9 + | +LL | ::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/methods/method-resolvable-path-in-pattern.rs similarity index 100% rename from src/test/compile-fail/method-resolvable-path-in-pattern.rs rename to src/test/ui/methods/method-resolvable-path-in-pattern.rs diff --git a/src/test/ui/methods/method-resolvable-path-in-pattern.stderr b/src/test/ui/methods/method-resolvable-path-in-pattern.stderr new file mode 100644 index 0000000000000..c86367dac087b --- /dev/null +++ b/src/test/ui/methods/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 | ::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/methods/method-self-arg-1.rs similarity index 100% rename from src/test/compile-fail/method-self-arg-1.rs rename to src/test/ui/methods/method-self-arg-1.rs diff --git a/src/test/ui/methods/method-self-arg-1.stderr b/src/test/ui/methods/method-self-arg-1.stderr new file mode 100644 index 0000000000000..4a5ac2b5aed81 --- /dev/null +++ b/src/test/ui/methods/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/methods/method-self-arg-2.rs similarity index 96% rename from src/test/compile-fail/method-self-arg-2.rs rename to src/test/ui/methods/method-self-arg-2.rs index dd5b2004145c2..397c6eab536c5 100644 --- a/src/test/compile-fail/method-self-arg-2.rs +++ b/src/test/ui/methods/method-self-arg-2.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test method calls with self as an argument cannot subvert borrow checking. struct Foo; diff --git a/src/test/ui/methods/method-self-arg-2.stderr b/src/test/ui/methods/method-self-arg-2.stderr new file mode 100644 index 0000000000000..4fe2da4164fa7 --- /dev/null +++ b/src/test/ui/methods/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:25: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:29: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/minus-string.rs similarity index 100% rename from src/test/compile-fail/minus-string.rs rename to src/test/ui/minus-string.rs diff --git a/src/test/ui/minus-string.stderr b/src/test/ui/minus-string.stderr new file mode 100644 index 0000000000000..cbbb11ae33a15 --- /dev/null +++ b/src/test/ui/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/mir-dataflow/README.md similarity index 100% rename from src/test/compile-fail/mir-dataflow/README.md rename to src/test/ui/mir-dataflow/README.md diff --git a/src/test/compile-fail/mir-dataflow/def-inits-1.rs b/src/test/ui/mir-dataflow/def-inits-1.rs similarity index 100% rename from src/test/compile-fail/mir-dataflow/def-inits-1.rs rename to src/test/ui/mir-dataflow/def-inits-1.rs diff --git a/src/test/ui/mir-dataflow/def-inits-1.stderr b/src/test/ui/mir-dataflow/def-inits-1.stderr new file mode 100644 index 0000000000000..84d3c66ac33f9 --- /dev/null +++ b/src/test/ui/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/mir-dataflow/inits-1.rs similarity index 100% rename from src/test/compile-fail/mir-dataflow/inits-1.rs rename to src/test/ui/mir-dataflow/inits-1.rs diff --git a/src/test/ui/mir-dataflow/inits-1.stderr b/src/test/ui/mir-dataflow/inits-1.stderr new file mode 100644 index 0000000000000..c39c9c8efba3e --- /dev/null +++ b/src/test/ui/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/mir-dataflow/uninits-1.rs similarity index 100% rename from src/test/compile-fail/mir-dataflow/uninits-1.rs rename to src/test/ui/mir-dataflow/uninits-1.rs diff --git a/src/test/ui/mir-dataflow/uninits-1.stderr b/src/test/ui/mir-dataflow/uninits-1.stderr new file mode 100644 index 0000000000000..c76012404ef82 --- /dev/null +++ b/src/test/ui/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/mir-dataflow/uninits-2.rs similarity index 100% rename from src/test/compile-fail/mir-dataflow/uninits-2.rs rename to src/test/ui/mir-dataflow/uninits-2.rs diff --git a/src/test/ui/mir-dataflow/uninits-2.stderr b/src/test/ui/mir-dataflow/uninits-2.stderr new file mode 100644 index 0000000000000..8ed735111bd2f --- /dev/null +++ b/src/test/ui/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/mir-unpretty.rs similarity index 100% rename from src/test/compile-fail/mir-unpretty.rs rename to src/test/ui/mir-unpretty.rs diff --git a/src/test/ui/mir-unpretty.stderr b/src/test/ui/mir-unpretty.stderr new file mode 100644 index 0000000000000..5a53b69ebbb59 --- /dev/null +++ b/src/test/ui/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/ui/missing/auxiliary/two_macros.rs b/src/test/ui/missing/auxiliary/two_macros.rs new file mode 100644 index 0000000000000..060960f0dbc88 --- /dev/null +++ b/src/test/ui/missing/auxiliary/two_macros.rs @@ -0,0 +1,15 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[macro_export] +macro_rules! macro_one { () => ("one") } + +#[macro_export] +macro_rules! macro_two { () => ("two") } diff --git a/src/test/ui/missing-alloc_error_handler.rs b/src/test/ui/missing/missing-alloc_error_handler.rs similarity index 100% rename from src/test/ui/missing-alloc_error_handler.rs rename to src/test/ui/missing/missing-alloc_error_handler.rs diff --git a/src/test/ui/missing-alloc_error_handler.stderr b/src/test/ui/missing/missing-alloc_error_handler.stderr similarity index 100% rename from src/test/ui/missing-alloc_error_handler.stderr rename to src/test/ui/missing/missing-alloc_error_handler.stderr diff --git a/src/test/ui/missing-allocator.rs b/src/test/ui/missing/missing-allocator.rs similarity index 100% rename from src/test/ui/missing-allocator.rs rename to src/test/ui/missing/missing-allocator.rs diff --git a/src/test/ui/missing-allocator.stderr b/src/test/ui/missing/missing-allocator.stderr similarity index 100% rename from src/test/ui/missing-allocator.stderr rename to src/test/ui/missing/missing-allocator.stderr diff --git a/src/test/ui/missing-block-hint.rs b/src/test/ui/missing/missing-block-hint.rs similarity index 100% rename from src/test/ui/missing-block-hint.rs rename to src/test/ui/missing/missing-block-hint.rs diff --git a/src/test/ui/missing-block-hint.stderr b/src/test/ui/missing/missing-block-hint.stderr similarity index 100% rename from src/test/ui/missing-block-hint.stderr rename to src/test/ui/missing/missing-block-hint.stderr diff --git a/src/test/ui/missing-comma-in-match.fixed b/src/test/ui/missing/missing-comma-in-match.fixed similarity index 100% rename from src/test/ui/missing-comma-in-match.fixed rename to src/test/ui/missing/missing-comma-in-match.fixed diff --git a/src/test/ui/missing-comma-in-match.rs b/src/test/ui/missing/missing-comma-in-match.rs similarity index 100% rename from src/test/ui/missing-comma-in-match.rs rename to src/test/ui/missing/missing-comma-in-match.rs diff --git a/src/test/ui/missing-comma-in-match.stderr b/src/test/ui/missing/missing-comma-in-match.stderr similarity index 100% rename from src/test/ui/missing-comma-in-match.stderr rename to src/test/ui/missing/missing-comma-in-match.stderr diff --git a/src/test/compile-fail/missing-derivable-attr.rs b/src/test/ui/missing/missing-derivable-attr.rs similarity index 100% rename from src/test/compile-fail/missing-derivable-attr.rs rename to src/test/ui/missing/missing-derivable-attr.rs diff --git a/src/test/ui/missing/missing-derivable-attr.stderr b/src/test/ui/missing/missing-derivable-attr.stderr new file mode 100644 index 0000000000000..cccba2f5f3f2f --- /dev/null +++ b/src/test/ui/missing/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/ui/missing-fields-in-struct-pattern.rs b/src/test/ui/missing/missing-fields-in-struct-pattern.rs similarity index 100% rename from src/test/ui/missing-fields-in-struct-pattern.rs rename to src/test/ui/missing/missing-fields-in-struct-pattern.rs diff --git a/src/test/ui/missing-fields-in-struct-pattern.stderr b/src/test/ui/missing/missing-fields-in-struct-pattern.stderr similarity index 100% rename from src/test/ui/missing-fields-in-struct-pattern.stderr rename to src/test/ui/missing/missing-fields-in-struct-pattern.stderr diff --git a/src/test/ui/missing-items/auxiliary/m1.rs b/src/test/ui/missing/missing-items/auxiliary/m1.rs similarity index 100% rename from src/test/ui/missing-items/auxiliary/m1.rs rename to src/test/ui/missing/missing-items/auxiliary/m1.rs diff --git a/src/test/ui/missing-items/issue-40221.rs b/src/test/ui/missing/missing-items/issue-40221.rs similarity index 100% rename from src/test/ui/missing-items/issue-40221.rs rename to src/test/ui/missing/missing-items/issue-40221.rs diff --git a/src/test/ui/missing-items/issue-40221.stderr b/src/test/ui/missing/missing-items/issue-40221.stderr similarity index 100% rename from src/test/ui/missing-items/issue-40221.stderr rename to src/test/ui/missing/missing-items/issue-40221.stderr diff --git a/src/test/ui/missing-items/m2.rs b/src/test/ui/missing/missing-items/m2.rs similarity index 100% rename from src/test/ui/missing-items/m2.rs rename to src/test/ui/missing/missing-items/m2.rs diff --git a/src/test/ui/missing-items/m2.stderr b/src/test/ui/missing/missing-items/m2.stderr similarity index 100% rename from src/test/ui/missing-items/m2.stderr rename to src/test/ui/missing/missing-items/m2.stderr diff --git a/src/test/ui/missing-items/missing-type-parameter.rs b/src/test/ui/missing/missing-items/missing-type-parameter.rs similarity index 100% rename from src/test/ui/missing-items/missing-type-parameter.rs rename to src/test/ui/missing/missing-items/missing-type-parameter.rs diff --git a/src/test/ui/missing-items/missing-type-parameter.stderr b/src/test/ui/missing/missing-items/missing-type-parameter.stderr similarity index 100% rename from src/test/ui/missing-items/missing-type-parameter.stderr rename to src/test/ui/missing/missing-items/missing-type-parameter.stderr diff --git a/src/test/compile-fail/missing-macro-use.rs b/src/test/ui/missing/missing-macro-use.rs similarity index 100% rename from src/test/compile-fail/missing-macro-use.rs rename to src/test/ui/missing/missing-macro-use.rs diff --git a/src/test/ui/missing/missing-macro-use.stderr b/src/test/ui/missing/missing-macro-use.stderr new file mode 100644 index 0000000000000..6986b4d57338a --- /dev/null +++ b/src/test/ui/missing/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/missing/missing-main.rs similarity index 100% rename from src/test/compile-fail/missing-main.rs rename to src/test/ui/missing/missing-main.rs diff --git a/src/test/ui/missing/missing-main.stderr b/src/test/ui/missing/missing-main.stderr new file mode 100644 index 0000000000000..34b03ada3d295 --- /dev/null +++ b/src/test/ui/missing/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/missing/missing-return.rs similarity index 100% rename from src/test/compile-fail/missing-return.rs rename to src/test/ui/missing/missing-return.rs diff --git a/src/test/ui/missing/missing-return.stderr b/src/test/ui/missing/missing-return.stderr new file mode 100644 index 0000000000000..d12a5832877d2 --- /dev/null +++ b/src/test/ui/missing/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/missing/missing-semicolon-warning.rs similarity index 100% rename from src/test/compile-fail/missing-semicolon-warning.rs rename to src/test/ui/missing/missing-semicolon-warning.rs diff --git a/src/test/ui/missing/missing-semicolon-warning.stderr b/src/test/ui/missing/missing-semicolon-warning.stderr new file mode 100644 index 0000000000000..72319a257d85d --- /dev/null +++ b/src/test/ui/missing/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/missing/missing-stability.rs similarity index 100% rename from src/test/compile-fail/missing-stability.rs rename to src/test/ui/missing/missing-stability.rs diff --git a/src/test/ui/missing/missing-stability.stderr b/src/test/ui/missing/missing-stability.stderr new file mode 100644 index 0000000000000..6e2802e43c5a2 --- /dev/null +++ b/src/test/ui/missing/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/missing_debug_impls.rs similarity index 100% rename from src/test/compile-fail/missing_debug_impls.rs rename to src/test/ui/missing_debug_impls.rs diff --git a/src/test/ui/missing_debug_impls.stderr b/src/test/ui/missing_debug_impls.stderr new file mode 100644 index 0000000000000..4b4c05f79f055 --- /dev/null +++ b/src/test/ui/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/mod/mod_file_aux.rs similarity index 100% rename from src/test/compile-fail/mod_file_aux.rs rename to src/test/ui/mod/mod_file_aux.rs diff --git a/src/test/compile-fail/mod_file_correct_spans.rs b/src/test/ui/mod/mod_file_correct_spans.rs similarity index 100% rename from src/test/compile-fail/mod_file_correct_spans.rs rename to src/test/ui/mod/mod_file_correct_spans.rs diff --git a/src/test/ui/mod/mod_file_correct_spans.stderr b/src/test/ui/mod/mod_file_correct_spans.stderr new file mode 100644 index 0000000000000..6f5e4cc51eb83 --- /dev/null +++ b/src/test/ui/mod/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/mod/mod_file_disambig.rs similarity index 100% rename from src/test/compile-fail/mod_file_disambig.rs rename to src/test/ui/mod/mod_file_disambig.rs diff --git a/src/test/ui/mod/mod_file_disambig.stderr b/src/test/ui/mod/mod_file_disambig.stderr new file mode 100644 index 0000000000000..16a013ebfdb28 --- /dev/null +++ b/src/test/ui/mod/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/mod/mod_file_disambig_aux.rs similarity index 100% rename from src/test/compile-fail/mod_file_disambig_aux.rs rename to src/test/ui/mod/mod_file_disambig_aux.rs diff --git a/src/test/compile-fail/mod_file_disambig_aux/mod.rs b/src/test/ui/mod/mod_file_disambig_aux/mod.rs similarity index 100% rename from src/test/compile-fail/mod_file_disambig_aux/mod.rs rename to src/test/ui/mod/mod_file_disambig_aux/mod.rs diff --git a/src/test/compile-fail/module-macro_use-arguments.rs b/src/test/ui/module-macro_use-arguments.rs similarity index 100% rename from src/test/compile-fail/module-macro_use-arguments.rs rename to src/test/ui/module-macro_use-arguments.rs diff --git a/src/test/ui/module-macro_use-arguments.stderr b/src/test/ui/module-macro_use-arguments.stderr new file mode 100644 index 0000000000000..c61288776dd3a --- /dev/null +++ b/src/test/ui/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/moves/move-guard-same-consts.rs similarity index 100% rename from src/test/compile-fail/move-guard-same-consts.rs rename to src/test/ui/moves/move-guard-same-consts.rs diff --git a/src/test/ui/moves/move-guard-same-consts.stderr b/src/test/ui/moves/move-guard-same-consts.stderr new file mode 100644 index 0000000000000..71f90ee7e5457 --- /dev/null +++ b/src/test/ui/moves/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`, 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/moves/move-in-guard-1.rs similarity index 100% rename from src/test/compile-fail/move-in-guard-1.rs rename to src/test/ui/moves/move-in-guard-1.rs diff --git a/src/test/ui/moves/move-in-guard-1.stderr b/src/test/ui/moves/move-in-guard-1.stderr new file mode 100644 index 0000000000000..5dd46a61176a5 --- /dev/null +++ b/src/test/ui/moves/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`, 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/moves/move-in-guard-2.rs similarity index 100% rename from src/test/compile-fail/move-in-guard-2.rs rename to src/test/ui/moves/move-in-guard-2.rs diff --git a/src/test/ui/moves/move-in-guard-2.stderr b/src/test/ui/moves/move-in-guard-2.stderr new file mode 100644 index 0000000000000..a12d9e98b1bd9 --- /dev/null +++ b/src/test/ui/moves/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`, 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/moves/move-into-dead-array-1.nll.stderr b/src/test/ui/moves/move-into-dead-array-1.nll.stderr new file mode 100644 index 0000000000000..42f43d3f661f4 --- /dev/null +++ b/src/test/ui/moves/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/moves/move-into-dead-array-1.rs similarity index 100% rename from src/test/compile-fail/move-into-dead-array-1.rs rename to src/test/ui/moves/move-into-dead-array-1.rs diff --git a/src/test/ui/moves/move-into-dead-array-1.stderr b/src/test/ui/moves/move-into-dead-array-1.stderr new file mode 100644 index 0000000000000..ac18565f1946e --- /dev/null +++ b/src/test/ui/moves/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/moves/move-into-dead-array-2.nll.stderr b/src/test/ui/moves/move-into-dead-array-2.nll.stderr new file mode 100644 index 0000000000000..cc6cc4211c067 --- /dev/null +++ b/src/test/ui/moves/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/moves/move-into-dead-array-2.rs similarity index 100% rename from src/test/compile-fail/move-into-dead-array-2.rs rename to src/test/ui/moves/move-into-dead-array-2.rs diff --git a/src/test/ui/moves/move-into-dead-array-2.stderr b/src/test/ui/moves/move-into-dead-array-2.stderr new file mode 100644 index 0000000000000..0d999e67f9868 --- /dev/null +++ b/src/test/ui/moves/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/moves/move-out-of-array-1.rs similarity index 100% rename from src/test/compile-fail/move-out-of-array-1.rs rename to src/test/ui/moves/move-out-of-array-1.rs diff --git a/src/test/ui/moves/move-out-of-array-1.stderr b/src/test/ui/moves/move-out-of-array-1.stderr new file mode 100644 index 0000000000000..d015505a46b18 --- /dev/null +++ b/src/test/ui/moves/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/moves/move-out-of-slice-1.nll.stderr b/src/test/ui/moves/move-out-of-slice-1.nll.stderr new file mode 100644 index 0000000000000..b061b6a796385 --- /dev/null +++ b/src/test/ui/moves/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/moves/move-out-of-slice-1.rs similarity index 100% rename from src/test/compile-fail/move-out-of-slice-1.rs rename to src/test/ui/moves/move-out-of-slice-1.rs diff --git a/src/test/ui/moves/move-out-of-slice-1.stderr b/src/test/ui/moves/move-out-of-slice-1.stderr new file mode 100644 index 0000000000000..87e68140774f3 --- /dev/null +++ b/src/test/ui/moves/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/moves/move-out-of-tuple-field.nll.stderr b/src/test/ui/moves/move-out-of-tuple-field.nll.stderr new file mode 100644 index 0000000000000..e18db1b48a1ac --- /dev/null +++ b/src/test/ui/moves/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`, 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`, 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/moves/move-out-of-tuple-field.rs similarity index 100% rename from src/test/compile-fail/move-out-of-tuple-field.rs rename to src/test/ui/moves/move-out-of-tuple-field.rs diff --git a/src/test/ui/moves/move-out-of-tuple-field.stderr b/src/test/ui/moves/move-out-of-tuple-field.stderr new file mode 100644 index 0000000000000..1e8acf5a64b21 --- /dev/null +++ b/src/test/ui/moves/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`, 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`, 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/moves/moves-based-on-type-access-to-field.nll.stderr b/src/test/ui/moves/moves-based-on-type-access-to-field.nll.stderr new file mode 100644 index 0000000000000..39c7f0633e37a --- /dev/null +++ b/src/test/ui/moves/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`, 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/moves/moves-based-on-type-access-to-field.rs similarity index 100% rename from src/test/compile-fail/moves-based-on-type-access-to-field.rs rename to src/test/ui/moves/moves-based-on-type-access-to-field.rs diff --git a/src/test/ui/moves/moves-based-on-type-access-to-field.stderr b/src/test/ui/moves/moves-based-on-type-access-to-field.stderr new file mode 100644 index 0000000000000..81546511e0340 --- /dev/null +++ b/src/test/ui/moves/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`, 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/moves-based-on-type-block-bad.nll.stderr b/src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr similarity index 100% rename from src/test/ui/moves-based-on-type-block-bad.nll.stderr rename to src/test/ui/moves/moves-based-on-type-block-bad.nll.stderr diff --git a/src/test/ui/moves-based-on-type-block-bad.rs b/src/test/ui/moves/moves-based-on-type-block-bad.rs similarity index 100% rename from src/test/ui/moves-based-on-type-block-bad.rs rename to src/test/ui/moves/moves-based-on-type-block-bad.rs diff --git a/src/test/ui/moves-based-on-type-block-bad.stderr b/src/test/ui/moves/moves-based-on-type-block-bad.stderr similarity index 100% rename from src/test/ui/moves-based-on-type-block-bad.stderr rename to src/test/ui/moves/moves-based-on-type-block-bad.stderr diff --git a/src/test/ui/moves/moves-based-on-type-capture-clause-bad.nll.stderr b/src/test/ui/moves/moves-based-on-type-capture-clause-bad.nll.stderr new file mode 100644 index 0000000000000..0081fa67b9d3b --- /dev/null +++ b/src/test/ui/moves/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/moves/moves-based-on-type-capture-clause-bad.rs similarity index 100% rename from src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs rename to src/test/ui/moves/moves-based-on-type-capture-clause-bad.rs diff --git a/src/test/ui/moves/moves-based-on-type-capture-clause-bad.stderr b/src/test/ui/moves/moves-based-on-type-capture-clause-bad.stderr new file mode 100644 index 0000000000000..54b25678819ea --- /dev/null +++ b/src/test/ui/moves/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/moves/moves-based-on-type-cyclic-types-issue-4821.nll.stderr b/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.nll.stderr new file mode 100644 index 0000000000000..50b51c6f3971c --- /dev/null +++ b/src/test/ui/moves/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`, 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/moves/moves-based-on-type-cyclic-types-issue-4821.rs similarity index 100% rename from src/test/compile-fail/moves-based-on-type-cyclic-types-issue-4821.rs rename to src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.rs diff --git a/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr b/src/test/ui/moves/moves-based-on-type-cyclic-types-issue-4821.stderr new file mode 100644 index 0000000000000..421d25721e490 --- /dev/null +++ b/src/test/ui/moves/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`, 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/moves/moves-based-on-type-distribute-copy-over-paren.nll.stderr b/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.nll.stderr new file mode 100644 index 0000000000000..82420730644c1 --- /dev/null +++ b/src/test/ui/moves/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/moves/moves-based-on-type-distribute-copy-over-paren.rs similarity index 100% rename from src/test/compile-fail/moves-based-on-type-distribute-copy-over-paren.rs rename to src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.rs diff --git a/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.stderr b/src/test/ui/moves/moves-based-on-type-distribute-copy-over-paren.stderr new file mode 100644 index 0000000000000..8c40b4db4f791 --- /dev/null +++ b/src/test/ui/moves/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/moves/moves-based-on-type-exprs.nll.stderr b/src/test/ui/moves/moves-based-on-type-exprs.nll.stderr new file mode 100644 index 0000000000000..aa248dab85ced --- /dev/null +++ b/src/test/ui/moves/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`, 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`, 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/moves/moves-based-on-type-exprs.rs similarity index 100% rename from src/test/compile-fail/moves-based-on-type-exprs.rs rename to src/test/ui/moves/moves-based-on-type-exprs.rs diff --git a/src/test/ui/moves/moves-based-on-type-exprs.stderr b/src/test/ui/moves/moves-based-on-type-exprs.stderr new file mode 100644 index 0000000000000..003ae017b5812 --- /dev/null +++ b/src/test/ui/moves/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`, 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`, 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/moves-based-on-type-match-bindings.nll.stderr b/src/test/ui/moves/moves-based-on-type-match-bindings.nll.stderr similarity index 100% rename from src/test/ui/moves-based-on-type-match-bindings.nll.stderr rename to src/test/ui/moves/moves-based-on-type-match-bindings.nll.stderr diff --git a/src/test/ui/moves-based-on-type-match-bindings.rs b/src/test/ui/moves/moves-based-on-type-match-bindings.rs similarity index 100% rename from src/test/ui/moves-based-on-type-match-bindings.rs rename to src/test/ui/moves/moves-based-on-type-match-bindings.rs diff --git a/src/test/ui/moves-based-on-type-match-bindings.stderr b/src/test/ui/moves/moves-based-on-type-match-bindings.stderr similarity index 100% rename from src/test/ui/moves-based-on-type-match-bindings.stderr rename to src/test/ui/moves/moves-based-on-type-match-bindings.stderr diff --git a/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr b/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.nll.stderr new file mode 100644 index 0000000000000..4f2220b0de341 --- /dev/null +++ b/src/test/ui/moves/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/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.rs similarity index 100% rename from src/test/compile-fail/moves-based-on-type-move-out-of-closure-env-issue-1965.rs rename to src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.rs diff --git a/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr b/src/test/ui/moves/moves-based-on-type-move-out-of-closure-env-issue-1965.stderr new file mode 100644 index 0000000000000..43de9016a7d1f --- /dev/null +++ b/src/test/ui/moves/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/moves/moves-based-on-type-no-recursive-stack-closure.nll.stderr b/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.nll.stderr new file mode 100644 index 0000000000000..e23a6beb87eaf --- /dev/null +++ b/src/test/ui/moves/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/moves/moves-based-on-type-no-recursive-stack-closure.rs similarity index 100% rename from src/test/compile-fail/moves-based-on-type-no-recursive-stack-closure.rs rename to src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.rs diff --git a/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr b/src/test/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr new file mode 100644 index 0000000000000..65cea57f0ed54 --- /dev/null +++ b/src/test/ui/moves/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/moves-based-on-type-tuple.rs b/src/test/ui/moves/moves-based-on-type-tuple.rs similarity index 100% rename from src/test/ui/moves-based-on-type-tuple.rs rename to src/test/ui/moves/moves-based-on-type-tuple.rs diff --git a/src/test/ui/moves-based-on-type-tuple.stderr b/src/test/ui/moves/moves-based-on-type-tuple.stderr similarity index 100% rename from src/test/ui/moves-based-on-type-tuple.stderr rename to src/test/ui/moves/moves-based-on-type-tuple.stderr diff --git a/src/test/ui/moves/moves-sru-moved-field.nll.stderr b/src/test/ui/moves/moves-sru-moved-field.nll.stderr new file mode 100644 index 0000000000000..d1a528c50a1ac --- /dev/null +++ b/src/test/ui/moves/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`, 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/moves/moves-sru-moved-field.rs similarity index 100% rename from src/test/compile-fail/moves-sru-moved-field.rs rename to src/test/ui/moves/moves-sru-moved-field.rs diff --git a/src/test/ui/moves/moves-sru-moved-field.stderr b/src/test/ui/moves/moves-sru-moved-field.stderr new file mode 100644 index 0000000000000..878dd7ba8302c --- /dev/null +++ b/src/test/ui/moves/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`, 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/multiple-main-2.rs similarity index 100% rename from src/test/compile-fail/multiple-main-2.rs rename to src/test/ui/multiple-main-2.rs diff --git a/src/test/ui/multiple-main-2.stderr b/src/test/ui/multiple-main-2.stderr new file mode 100644 index 0000000000000..e63bbc5cc4306 --- /dev/null +++ b/src/test/ui/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/multiple-main-3.rs similarity index 100% rename from src/test/compile-fail/multiple-main-3.rs rename to src/test/ui/multiple-main-3.rs diff --git a/src/test/ui/multiple-main-3.stderr b/src/test/ui/multiple-main-3.stderr new file mode 100644 index 0000000000000..d489e34b8756c --- /dev/null +++ b/src/test/ui/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/multiple-plugin-registrars.rs similarity index 100% rename from src/test/compile-fail/multiple-plugin-registrars.rs rename to src/test/ui/multiple-plugin-registrars.rs diff --git a/src/test/ui/multiple-plugin-registrars.stderr b/src/test/ui/multiple-plugin-registrars.stderr new file mode 100644 index 0000000000000..f1370df0f8b15 --- /dev/null +++ b/src/test/ui/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/mut/mut-cant-alias.rs similarity index 95% rename from src/test/compile-fail/mut-cant-alias.rs rename to src/test/ui/mut/mut-cant-alias.rs index 99d7258477ace..15e1be66e78f8 100644 --- a/src/test/compile-fail/mut-cant-alias.rs +++ b/src/test/ui/mut/mut-cant-alias.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + use std::cell::RefCell; fn main() { diff --git a/src/test/ui/mut/mut-cant-alias.stderr b/src/test/ui/mut/mut-cant-alias.stderr new file mode 100644 index 0000000000000..b9497940301c6 --- /dev/null +++ b/src/test/ui/mut/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:19: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/mut/mut-cross-borrowing.rs similarity index 100% rename from src/test/compile-fail/mut-cross-borrowing.rs rename to src/test/ui/mut/mut-cross-borrowing.rs diff --git a/src/test/ui/mut/mut-cross-borrowing.stderr b/src/test/ui/mut/mut-cross-borrowing.stderr new file mode 100644 index 0000000000000..be32f235be303 --- /dev/null +++ b/src/test/ui/mut/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/mut/mut-pattern-internal-mutability.ast.nll.stderr b/src/test/ui/mut/mut-pattern-internal-mutability.ast.nll.stderr new file mode 100644 index 0000000000000..0df303eed779a --- /dev/null +++ b/src/test/ui/mut/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/mut/mut-pattern-internal-mutability.ast.stderr b/src/test/ui/mut/mut-pattern-internal-mutability.ast.stderr new file mode 100644 index 0000000000000..47a33e320bd78 --- /dev/null +++ b/src/test/ui/mut/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/mut/mut-pattern-internal-mutability.mir.stderr b/src/test/ui/mut/mut-pattern-internal-mutability.mir.stderr new file mode 100644 index 0000000000000..0df303eed779a --- /dev/null +++ b/src/test/ui/mut/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/mut/mut-pattern-internal-mutability.rs similarity index 100% rename from src/test/compile-fail/mut-pattern-internal-mutability.rs rename to src/test/ui/mut/mut-pattern-internal-mutability.rs diff --git a/src/test/compile-fail/mut-pattern-mismatched.rs b/src/test/ui/mut/mut-pattern-mismatched.rs similarity index 100% rename from src/test/compile-fail/mut-pattern-mismatched.rs rename to src/test/ui/mut/mut-pattern-mismatched.rs diff --git a/src/test/ui/mut/mut-pattern-mismatched.stderr b/src/test/ui/mut/mut-pattern-mismatched.stderr new file mode 100644 index 0000000000000..20bd804addc8f --- /dev/null +++ b/src/test/ui/mut/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/mut-ref.rs b/src/test/ui/mut/mut-ref.rs similarity index 100% rename from src/test/ui/mut-ref.rs rename to src/test/ui/mut/mut-ref.rs diff --git a/src/test/ui/mut-ref.stderr b/src/test/ui/mut/mut-ref.stderr similarity index 100% rename from src/test/ui/mut-ref.stderr rename to src/test/ui/mut/mut-ref.stderr diff --git a/src/test/ui/mut/mut-suggestion.nll.stderr b/src/test/ui/mut/mut-suggestion.nll.stderr new file mode 100644 index 0000000000000..39a1e93d61975 --- /dev/null +++ b/src/test/ui/mut/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/mut/mut-suggestion.rs similarity index 100% rename from src/test/compile-fail/mut-suggestion.rs rename to src/test/ui/mut/mut-suggestion.rs diff --git a/src/test/ui/mut/mut-suggestion.stderr b/src/test/ui/mut/mut-suggestion.stderr new file mode 100644 index 0000000000000..4aa964903f59d --- /dev/null +++ b/src/test/ui/mut/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/mut/mutable-class-fields-2.nll.stderr b/src/test/ui/mut/mutable-class-fields-2.nll.stderr new file mode 100644 index 0000000000000..3433f9f0b2107 --- /dev/null +++ b/src/test/ui/mut/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/mut/mutable-class-fields-2.rs similarity index 100% rename from src/test/compile-fail/mutable-class-fields-2.rs rename to src/test/ui/mut/mutable-class-fields-2.rs diff --git a/src/test/ui/mut/mutable-class-fields-2.stderr b/src/test/ui/mut/mutable-class-fields-2.stderr new file mode 100644 index 0000000000000..aa588d8acaf71 --- /dev/null +++ b/src/test/ui/mut/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/mut/mutable-class-fields.ast.nll.stderr b/src/test/ui/mut/mutable-class-fields.ast.nll.stderr new file mode 100644 index 0000000000000..1d1e58de587d4 --- /dev/null +++ b/src/test/ui/mut/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/mut/mutable-class-fields.ast.stderr b/src/test/ui/mut/mutable-class-fields.ast.stderr new file mode 100644 index 0000000000000..0a4d3a0e96881 --- /dev/null +++ b/src/test/ui/mut/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/mut/mutable-class-fields.mir.stderr b/src/test/ui/mut/mutable-class-fields.mir.stderr new file mode 100644 index 0000000000000..1d1e58de587d4 --- /dev/null +++ b/src/test/ui/mut/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/mut/mutable-class-fields.rs similarity index 100% rename from src/test/compile-fail/mutable-class-fields.rs rename to src/test/ui/mut/mutable-class-fields.rs diff --git a/src/test/compile-fail/mutable-enum-indirect.rs b/src/test/ui/mut/mutable-enum-indirect.rs similarity index 100% rename from src/test/compile-fail/mutable-enum-indirect.rs rename to src/test/ui/mut/mutable-enum-indirect.rs diff --git a/src/test/ui/mut/mutable-enum-indirect.stderr b/src/test/ui/mut/mutable-enum-indirect.stderr new file mode 100644 index 0000000000000..1ad4b6a151737 --- /dev/null +++ b/src/test/ui/mut/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) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +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/mutexguard-sync.rs similarity index 100% rename from src/test/compile-fail/mutexguard-sync.rs rename to src/test/ui/mutexguard-sync.rs diff --git a/src/test/ui/mutexguard-sync.stderr b/src/test/ui/mutexguard-sync.stderr new file mode 100644 index 0000000000000..709829e484b45 --- /dev/null +++ b/src/test/ui/mutexguard-sync.stderr @@ -0,0 +1,17 @@ +error[E0277]: `std::cell::Cell` cannot be shared between threads safely + --> $DIR/mutexguard-sync.rs:21:5 + | +LL | test_sync(guard); + | ^^^^^^^^^ `std::cell::Cell` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::Cell` + = note: required because of the requirements on the impl of `std::marker::Sync` for `std::sync::MutexGuard<'_, std::cell::Cell>` +note: required by `test_sync` + --> $DIR/mutexguard-sync.rs:15:1 + | +LL | fn test_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/auxiliary/namespace-mix.rs b/src/test/ui/namespace/auxiliary/namespace-mix.rs similarity index 100% rename from src/test/compile-fail/auxiliary/namespace-mix.rs rename to src/test/ui/namespace/auxiliary/namespace-mix.rs diff --git a/src/test/ui/namespace/auxiliary/namespaced_enums.rs b/src/test/ui/namespace/auxiliary/namespaced_enums.rs new file mode 100644 index 0000000000000..3bf39b788db6e --- /dev/null +++ b/src/test/ui/namespace/auxiliary/namespaced_enums.rs @@ -0,0 +1,20 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub enum Foo { + A, + B(isize), + C { a: isize }, +} + +impl Foo { + pub fn foo() {} + pub fn bar(&self) {} +} diff --git a/src/test/compile-fail/namespace-mix.rs b/src/test/ui/namespace/namespace-mix.rs similarity index 100% rename from src/test/compile-fail/namespace-mix.rs rename to src/test/ui/namespace/namespace-mix.rs diff --git a/src/test/ui/namespace/namespace-mix.stderr b/src/test/ui/namespace/namespace-mix.stderr new file mode 100644 index 0000000000000..6d72b6044aebe --- /dev/null +++ b/src/test/ui/namespace/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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/namespace/namespaced-enum-glob-import-no-impls-xcrate.rs similarity index 100% rename from src/test/compile-fail/namespaced-enum-glob-import-no-impls-xcrate.rs rename to src/test/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.rs diff --git a/src/test/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr b/src/test/ui/namespace/namespaced-enum-glob-import-no-impls-xcrate.stderr new file mode 100644 index 0000000000000..47ecb1248b287 --- /dev/null +++ b/src/test/ui/namespace/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/namespace/namespaced-enum-glob-import-no-impls.rs similarity index 100% rename from src/test/compile-fail/namespaced-enum-glob-import-no-impls.rs rename to src/test/ui/namespace/namespaced-enum-glob-import-no-impls.rs diff --git a/src/test/ui/namespace/namespaced-enum-glob-import-no-impls.stderr b/src/test/ui/namespace/namespaced-enum-glob-import-no-impls.stderr new file mode 100644 index 0000000000000..916801df2e858 --- /dev/null +++ b/src/test/ui/namespace/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/nested-cfg-attrs.rs similarity index 100% rename from src/test/compile-fail/nested-cfg-attrs.rs rename to src/test/ui/nested-cfg-attrs.rs diff --git a/src/test/ui/nested-cfg-attrs.stderr b/src/test/ui/nested-cfg-attrs.stderr new file mode 100644 index 0000000000000..5501dc8c6ad55 --- /dev/null +++ b/src/test/ui/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/nested-ty-params.rs similarity index 100% rename from src/test/compile-fail/nested-ty-params.rs rename to src/test/ui/nested-ty-params.rs diff --git a/src/test/ui/nested-ty-params.stderr b/src/test/ui/nested-ty-params.stderr new file mode 100644 index 0000000000000..93b934f610f8c --- /dev/null +++ b/src/test/ui/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(v: Vec ) -> 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` + +error[E0401]: can't use type parameters from outer function + --> $DIR/nested-ty-params.rs:13:23 + | +LL | fn hd(v: Vec ) -> 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` + +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/never-assign-dead-code.rs similarity index 100% rename from src/test/compile-fail/never-assign-dead-code.rs rename to src/test/ui/never-assign-dead-code.rs diff --git a/src/test/ui/never-assign-dead-code.stderr b/src/test/ui/never-assign-dead-code.stderr new file mode 100644 index 0000000000000..7c7126c93c673 --- /dev/null +++ b/src/test/ui/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/never-assign-wrong-type.rs similarity index 100% rename from src/test/compile-fail/never-assign-wrong-type.rs rename to src/test/ui/never-assign-wrong-type.rs diff --git a/src/test/ui/never-assign-wrong-type.stderr b/src/test/ui/never-assign-wrong-type.stderr new file mode 100644 index 0000000000000..41afe88b3847c --- /dev/null +++ b/src/test/ui/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/never_transmute_never.rs similarity index 100% rename from src/test/compile-fail/never_transmute_never.rs rename to src/test/ui/never_transmute_never.rs diff --git a/src/test/compile-fail/nll/constant-thread-locals-issue-47053.rs b/src/test/ui/nll/constant-thread-locals-issue-47053.rs similarity index 100% rename from src/test/compile-fail/nll/constant-thread-locals-issue-47053.rs rename to src/test/ui/nll/constant-thread-locals-issue-47053.rs diff --git a/src/test/ui/nll/constant-thread-locals-issue-47053.stderr b/src/test/ui/nll/constant-thread-locals-issue-47053.stderr new file mode 100644 index 0000000000000..3aa95fcad0156 --- /dev/null +++ b/src/test/ui/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/nll/do-not-ignore-lifetime-bounds-in-copy.rs similarity index 100% rename from src/test/compile-fail/nll/do-not-ignore-lifetime-bounds-in-copy.rs rename to src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.rs diff --git a/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.stderr b/src/test/ui/nll/do-not-ignore-lifetime-bounds-in-copy.stderr new file mode 100644 index 0000000000000..edf32d3d22318 --- /dev/null +++ b/src/test/ui/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/nll/loan_ends_mid_block_pair.rs similarity index 100% rename from src/test/compile-fail/nll/loan_ends_mid_block_pair.rs rename to src/test/ui/nll/loan_ends_mid_block_pair.rs diff --git a/src/test/ui/nll/loan_ends_mid_block_pair.stderr b/src/test/ui/nll/loan_ends_mid_block_pair.stderr new file mode 100644 index 0000000000000..9afae71edbe11 --- /dev/null +++ b/src/test/ui/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/nll/loan_ends_mid_block_vec.rs similarity index 100% rename from src/test/compile-fail/nll/loan_ends_mid_block_vec.rs rename to src/test/ui/nll/loan_ends_mid_block_vec.rs diff --git a/src/test/ui/nll/loan_ends_mid_block_vec.stderr b/src/test/ui/nll/loan_ends_mid_block_vec.stderr new file mode 100644 index 0000000000000..4c739cfe978f9 --- /dev/null +++ b/src/test/ui/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/nll/match-guards-always-borrow.ast.nll.stderr b/src/test/ui/nll/match-guards-always-borrow.ast.nll.stderr new file mode 100644 index 0000000000000..54b1fcbd5bbf6 --- /dev/null +++ b/src/test/ui/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/nll/match-guards-always-borrow.ast.stderr b/src/test/ui/nll/match-guards-always-borrow.ast.stderr new file mode 100644 index 0000000000000..d6186d7561a59 --- /dev/null +++ b/src/test/ui/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/nll/match-guards-always-borrow.mir.stderr b/src/test/ui/nll/match-guards-always-borrow.mir.stderr new file mode 100644 index 0000000000000..54b1fcbd5bbf6 --- /dev/null +++ b/src/test/ui/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/nll/match-guards-always-borrow.rs similarity index 100% rename from src/test/compile-fail/nll/match-guards-always-borrow.rs rename to src/test/ui/nll/match-guards-always-borrow.rs diff --git a/src/test/ui/nll/reference-carried-through-struct-field.ast.nll.stderr b/src/test/ui/nll/reference-carried-through-struct-field.ast.nll.stderr new file mode 100644 index 0000000000000..caa3173d74610 --- /dev/null +++ b/src/test/ui/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/nll/reference-carried-through-struct-field.ast.stderr b/src/test/ui/nll/reference-carried-through-struct-field.ast.stderr new file mode 100644 index 0000000000000..c1022d66070e0 --- /dev/null +++ b/src/test/ui/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/nll/reference-carried-through-struct-field.mir.stderr b/src/test/ui/nll/reference-carried-through-struct-field.mir.stderr new file mode 100644 index 0000000000000..caa3173d74610 --- /dev/null +++ b/src/test/ui/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/nll/reference-carried-through-struct-field.rs similarity index 100% rename from src/test/compile-fail/nll/reference-carried-through-struct-field.rs rename to src/test/ui/nll/reference-carried-through-struct-field.rs diff --git a/src/test/ui/nll/region-ends-after-if-condition.nll.stderr b/src/test/ui/nll/region-ends-after-if-condition.nll.stderr new file mode 100644 index 0000000000000..fa3a5e0c0d733 --- /dev/null +++ b/src/test/ui/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/nll/region-ends-after-if-condition.rs similarity index 100% rename from src/test/compile-fail/nll/region-ends-after-if-condition.rs rename to src/test/ui/nll/region-ends-after-if-condition.rs diff --git a/src/test/ui/nll/region-ends-after-if-condition.stderr b/src/test/ui/nll/region-ends-after-if-condition.stderr new file mode 100644 index 0000000000000..d966c62c85f90 --- /dev/null +++ b/src/test/ui/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/nll/return_from_loop.rs similarity index 100% rename from src/test/compile-fail/nll/return_from_loop.rs rename to src/test/ui/nll/return_from_loop.rs diff --git a/src/test/ui/nll/return_from_loop.stderr b/src/test/ui/nll/return_from_loop.stderr new file mode 100644 index 0000000000000..7130aa64daba3 --- /dev/null +++ b/src/test/ui/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/nll/unused-mut-issue-50343.rs similarity index 100% rename from src/test/compile-fail/nll/unused-mut-issue-50343.rs rename to src/test/ui/nll/unused-mut-issue-50343.rs diff --git a/src/test/ui/nll/unused-mut-issue-50343.stderr b/src/test/ui/nll/unused-mut-issue-50343.stderr new file mode 100644 index 0000000000000..bfc67e213ecf4 --- /dev/null +++ b/src/test/ui/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/nll/where_clauses_in_functions.rs similarity index 100% rename from src/test/compile-fail/nll/where_clauses_in_functions.rs rename to src/test/ui/nll/where_clauses_in_functions.rs diff --git a/src/test/ui/nll/where_clauses_in_functions.stderr b/src/test/ui/nll/where_clauses_in_functions.stderr new file mode 100644 index 0000000000000..3d5dd4beb04f6 --- /dev/null +++ b/src/test/ui/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/nll/where_clauses_in_structs.rs similarity index 100% rename from src/test/compile-fail/nll/where_clauses_in_structs.rs rename to src/test/ui/nll/where_clauses_in_structs.rs diff --git a/src/test/ui/nll/where_clauses_in_structs.stderr b/src/test/ui/nll/where_clauses_in_structs.stderr new file mode 100644 index 0000000000000..c7ad9879b29cf --- /dev/null +++ b/src/test/ui/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/no-capture-arc.nll.stderr b/src/test/ui/no-capture-arc.nll.stderr new file mode 100644 index 0000000000000..a58d5ad6fa723 --- /dev/null +++ b/src/test/ui/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>`, 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>`, 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/no-capture-arc.rs similarity index 100% rename from src/test/compile-fail/no-capture-arc.rs rename to src/test/ui/no-capture-arc.rs diff --git a/src/test/ui/no-capture-arc.stderr b/src/test/ui/no-capture-arc.stderr new file mode 100644 index 0000000000000..d6801d7e6e1ca --- /dev/null +++ b/src/test/ui/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>`, 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>`, 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/no-implicit-prelude-nested.rs similarity index 100% rename from src/test/compile-fail/no-implicit-prelude-nested.rs rename to src/test/ui/no-implicit-prelude-nested.rs diff --git a/src/test/ui/no-implicit-prelude-nested.stderr b/src/test/ui/no-implicit-prelude-nested.stderr new file mode 100644 index 0000000000000..dd0666a6fd469 --- /dev/null +++ b/src/test/ui/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/no-implicit-prelude.rs similarity index 100% rename from src/test/compile-fail/no-implicit-prelude.rs rename to src/test/ui/no-implicit-prelude.rs diff --git a/src/test/ui/no-implicit-prelude.stderr b/src/test/ui/no-implicit-prelude.stderr new file mode 100644 index 0000000000000..ae1098585b7ae --- /dev/null +++ b/src/test/ui/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/no-link.rs similarity index 100% rename from src/test/compile-fail/no-link.rs rename to src/test/ui/no-link.rs diff --git a/src/test/ui/no-link.stderr b/src/test/ui/no-link.stderr new file mode 100644 index 0000000000000..3af7968f64043 --- /dev/null +++ b/src/test/ui/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/no-patterns-in-args-2.rs similarity index 100% rename from src/test/compile-fail/no-patterns-in-args-2.rs rename to src/test/ui/no-patterns-in-args-2.rs diff --git a/src/test/ui/no-patterns-in-args-2.stderr b/src/test/ui/no-patterns-in-args-2.stderr new file mode 100644 index 0000000000000..11476169c7d0f --- /dev/null +++ b/src/test/ui/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 + +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/no-patterns-in-args-macro.rs similarity index 100% rename from src/test/compile-fail/no-patterns-in-args-macro.rs rename to src/test/ui/no-patterns-in-args-macro.rs diff --git a/src/test/ui/no-patterns-in-args-macro.stderr b/src/test/ui/no-patterns-in-args-macro.stderr new file mode 100644 index 0000000000000..57af3178439e5 --- /dev/null +++ b/src/test/ui/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/no-reuse-move-arc.nll.stderr b/src/test/ui/no-reuse-move-arc.nll.stderr new file mode 100644 index 0000000000000..902affc80462c --- /dev/null +++ b/src/test/ui/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>`, 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>`, 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/no-reuse-move-arc.rs similarity index 100% rename from src/test/compile-fail/no-reuse-move-arc.rs rename to src/test/ui/no-reuse-move-arc.rs diff --git a/src/test/ui/no-reuse-move-arc.stderr b/src/test/ui/no-reuse-move-arc.stderr new file mode 100644 index 0000000000000..91cba6e76ef12 --- /dev/null +++ b/src/test/ui/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>`, 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>`, 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/no-send-res-ports.rs similarity index 100% rename from src/test/compile-fail/no-send-res-ports.rs rename to src/test/ui/no-send-res-ports.rs diff --git a/src/test/ui/no-send-res-ports.stderr b/src/test/ui/no-send-res-ports.stderr new file mode 100644 index 0000000000000..936b95413ce34 --- /dev/null +++ b/src/test/ui/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/no-std-inject.rs similarity index 100% rename from src/test/compile-fail/no-std-inject.rs rename to src/test/ui/no-std-inject.rs diff --git a/src/test/ui/no-std-inject.stderr b/src/test/ui/no-std-inject.stderr new file mode 100644 index 0000000000000..c1ea823a9bda0 --- /dev/null +++ b/src/test/ui/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/no-type-for-node-ice.rs similarity index 100% rename from src/test/compile-fail/no-type-for-node-ice.rs rename to src/test/ui/no-type-for-node-ice.rs diff --git a/src/test/ui/no-type-for-node-ice.stderr b/src/test/ui/no-type-for-node-ice.stderr new file mode 100644 index 0000000000000..c9de7d28af0da --- /dev/null +++ b/src/test/ui/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/no-warn-on-field-replace-issue-34101.rs similarity index 100% rename from src/test/compile-fail/no-warn-on-field-replace-issue-34101.rs rename to src/test/ui/no-warn-on-field-replace-issue-34101.rs diff --git a/src/test/ui/no-warn-on-field-replace-issue-34101.stderr b/src/test/ui/no-warn-on-field-replace-issue-34101.stderr new file mode 100644 index 0000000000000..91a90266e5e96 --- /dev/null +++ b/src/test/ui/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/no_crate_type.rs similarity index 100% rename from src/test/compile-fail/no_crate_type.rs rename to src/test/ui/no_crate_type.rs diff --git a/src/test/ui/no_crate_type.stderr b/src/test/ui/no_crate_type.stderr new file mode 100644 index 0000000000000..87f83f2d8df1c --- /dev/null +++ b/src/test/ui/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/no_owned_box_lang_item.rs similarity index 100% rename from src/test/compile-fail/no_owned_box_lang_item.rs rename to src/test/ui/no_owned_box_lang_item.rs diff --git a/src/test/ui/no_owned_box_lang_item.stderr b/src/test/ui/no_owned_box_lang_item.stderr new file mode 100644 index 0000000000000..c55c246b5e157 --- /dev/null +++ b/src/test/ui/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/no_send-enum.rs similarity index 100% rename from src/test/compile-fail/no_send-enum.rs rename to src/test/ui/no_send-enum.rs diff --git a/src/test/ui/no_send-enum.stderr b/src/test/ui/no_send-enum.stderr new file mode 100644 index 0000000000000..4d53c5f301306 --- /dev/null +++ b/src/test/ui/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) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +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/no_send-rc.rs similarity index 100% rename from src/test/compile-fail/no_send-rc.rs rename to src/test/ui/no_send-rc.rs diff --git a/src/test/ui/no_send-rc.stderr b/src/test/ui/no_send-rc.stderr new file mode 100644 index 0000000000000..a0dce6c817c9d --- /dev/null +++ b/src/test/ui/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) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +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/no_send-struct.rs similarity index 100% rename from src/test/compile-fail/no_send-struct.rs rename to src/test/ui/no_send-struct.rs diff --git a/src/test/ui/no_send-struct.stderr b/src/test/ui/no_send-struct.stderr new file mode 100644 index 0000000000000..dc7b5ec67f232 --- /dev/null +++ b/src/test/ui/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) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +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/no_share-enum.rs similarity index 100% rename from src/test/compile-fail/no_share-enum.rs rename to src/test/ui/no_share-enum.rs diff --git a/src/test/ui/no_share-enum.stderr b/src/test/ui/no_share-enum.stderr new file mode 100644 index 0000000000000..57b889158d01c --- /dev/null +++ b/src/test/ui/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) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +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/no_share-struct.rs similarity index 100% rename from src/test/compile-fail/no_share-struct.rs rename to src/test/ui/no_share-struct.rs diff --git a/src/test/ui/no_share-struct.stderr b/src/test/ui/no_share-struct.stderr new file mode 100644 index 0000000000000..66291db5e53e7 --- /dev/null +++ b/src/test/ui/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) {} + | ^^^^^^^^^^^^^^^^^^^^^ + +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/noexporttypeexe.rs similarity index 100% rename from src/test/compile-fail/noexporttypeexe.rs rename to src/test/ui/noexporttypeexe.rs diff --git a/src/test/ui/noexporttypeexe.stderr b/src/test/ui/noexporttypeexe.stderr new file mode 100644 index 0000000000000..1671b3eae4965 --- /dev/null +++ b/src/test/ui/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` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/compile-fail/non-constant-in-const-path.rs b/src/test/ui/non-constant-in-const-path.rs similarity index 100% rename from src/test/compile-fail/non-constant-in-const-path.rs rename to src/test/ui/non-constant-in-const-path.rs diff --git a/src/test/ui/non-constant-in-const-path.stderr b/src/test/ui/non-constant-in-const-path.stderr new file mode 100644 index 0000000000000..91ef9fd81e822 --- /dev/null +++ b/src/test/ui/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/non-copyable-void.rs similarity index 100% rename from src/test/compile-fail/non-copyable-void.rs rename to src/test/ui/non-copyable-void.rs diff --git a/src/test/ui/non-copyable-void.stderr b/src/test/ui/non-copyable-void.stderr new file mode 100644 index 0000000000000..b5c83ec2289a6 --- /dev/null +++ b/src/test/ui/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/non-exhaustive/non-exhaustive-match-nested.rs similarity index 100% rename from src/test/compile-fail/non-exhaustive-match-nested.rs rename to src/test/ui/non-exhaustive/non-exhaustive-match-nested.rs diff --git a/src/test/ui/non-exhaustive/non-exhaustive-match-nested.stderr b/src/test/ui/non-exhaustive/non-exhaustive-match-nested.stderr new file mode 100644 index 0000000000000..6fb9788139f8f --- /dev/null +++ b/src/test/ui/non-exhaustive/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/non-exhaustive/non-exhaustive-match.rs similarity index 100% rename from src/test/compile-fail/non-exhaustive-match.rs rename to src/test/ui/non-exhaustive/non-exhaustive-match.rs diff --git a/src/test/ui/non-exhaustive/non-exhaustive-match.stderr b/src/test/ui/non-exhaustive/non-exhaustive-match.stderr new file mode 100644 index 0000000000000..f48a0bc15eb6f --- /dev/null +++ b/src/test/ui/non-exhaustive/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/ui/non-exhaustive-pattern-witness.rs b/src/test/ui/non-exhaustive/non-exhaustive-pattern-witness.rs similarity index 100% rename from src/test/ui/non-exhaustive-pattern-witness.rs rename to src/test/ui/non-exhaustive/non-exhaustive-pattern-witness.rs diff --git a/src/test/ui/non-exhaustive-pattern-witness.stderr b/src/test/ui/non-exhaustive/non-exhaustive-pattern-witness.stderr similarity index 100% rename from src/test/ui/non-exhaustive-pattern-witness.stderr rename to src/test/ui/non-exhaustive/non-exhaustive-pattern-witness.stderr diff --git a/src/test/compile-fail/non-interger-atomic.rs b/src/test/ui/non-interger-atomic.rs similarity index 100% rename from src/test/compile-fail/non-interger-atomic.rs rename to src/test/ui/non-interger-atomic.rs diff --git a/src/test/ui/non-interger-atomic.stderr b/src/test/ui/non-interger-atomic.stderr new file mode 100644 index 0000000000000..8cb114dd42c81 --- /dev/null +++ b/src/test/ui/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/noncopyable-class.rs similarity index 100% rename from src/test/compile-fail/noncopyable-class.rs rename to src/test/ui/noncopyable-class.rs diff --git a/src/test/ui/noncopyable-class.stderr b/src/test/ui/noncopyable-class.stderr new file mode 100644 index 0000000000000..49ad30e56afd8 --- /dev/null +++ b/src/test/ui/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/nonscalar-cast.rs similarity index 100% rename from src/test/compile-fail/nonscalar-cast.rs rename to src/test/ui/nonscalar-cast.rs diff --git a/src/test/ui/nonscalar-cast.stderr b/src/test/ui/nonscalar-cast.stderr new file mode 100644 index 0000000000000..d66ccd08f557e --- /dev/null +++ b/src/test/ui/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/not-clone-closure.rs similarity index 100% rename from src/test/compile-fail/not-clone-closure.rs rename to src/test/ui/not-clone-closure.rs diff --git a/src/test/ui/not-clone-closure.stderr b/src/test/ui/not-clone-closure.stderr new file mode 100644 index 0000000000000..eda9b1c495e70 --- /dev/null +++ b/src/test/ui/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/not-copy-closure.nll.stderr b/src/test/ui/not-copy-closure.nll.stderr new file mode 100644 index 0000000000000..b278df5e4b4cf --- /dev/null +++ b/src/test/ui/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/not-copy-closure.rs similarity index 100% rename from src/test/compile-fail/not-copy-closure.rs rename to src/test/ui/not-copy-closure.rs diff --git a/src/test/ui/not-copy-closure.stderr b/src/test/ui/not-copy-closure.stderr new file mode 100644 index 0000000000000..7193a3ed02782 --- /dev/null +++ b/src/test/ui/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/not-panic/not-panic-safe-2.rs similarity index 100% rename from src/test/compile-fail/not-panic-safe-2.rs rename to src/test/ui/not-panic/not-panic-safe-2.rs diff --git a/src/test/ui/not-panic/not-panic-safe-2.stderr b/src/test/ui/not-panic/not-panic-safe-2.stderr new file mode 100644 index 0000000000000..19408623ea391 --- /dev/null +++ b/src/test/ui/not-panic/not-panic-safe-2.stderr @@ -0,0 +1,34 @@ +error[E0277]: the type `std::cell::UnsafeCell` 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::>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` + = note: required because it appears within the type `std::cell::RefCell` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `std::rc::Rc>` +note: required by `assert` + --> $DIR/not-panic-safe-2.rs:17:1 + | +LL | fn assert() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the type `std::cell::UnsafeCell` 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::>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` + = note: required because it appears within the type `std::cell::Cell` + = note: required because it appears within the type `std::cell::RefCell` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `std::rc::Rc>` +note: required by `assert` + --> $DIR/not-panic-safe-2.rs:17:1 + | +LL | fn assert() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/not-panic/not-panic-safe-3.rs similarity index 100% rename from src/test/compile-fail/not-panic-safe-3.rs rename to src/test/ui/not-panic/not-panic-safe-3.rs diff --git a/src/test/ui/not-panic/not-panic-safe-3.stderr b/src/test/ui/not-panic/not-panic-safe-3.stderr new file mode 100644 index 0000000000000..a353c82c68780 --- /dev/null +++ b/src/test/ui/not-panic/not-panic-safe-3.stderr @@ -0,0 +1,34 @@ +error[E0277]: the type `std::cell::UnsafeCell` 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::>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` + = note: required because it appears within the type `std::cell::RefCell` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `std::sync::Arc>` +note: required by `assert` + --> $DIR/not-panic-safe-3.rs:17:1 + | +LL | fn assert() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the type `std::cell::UnsafeCell` 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::>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` + = note: required because it appears within the type `std::cell::Cell` + = note: required because it appears within the type `std::cell::RefCell` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `std::sync::Arc>` +note: required by `assert` + --> $DIR/not-panic-safe-3.rs:17:1 + | +LL | fn assert() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/not-panic/not-panic-safe-4.rs similarity index 100% rename from src/test/compile-fail/not-panic-safe-4.rs rename to src/test/ui/not-panic/not-panic-safe-4.rs diff --git a/src/test/ui/not-panic/not-panic-safe-4.stderr b/src/test/ui/not-panic/not-panic-safe-4.stderr new file mode 100644 index 0000000000000..27d3defe123fe --- /dev/null +++ b/src/test/ui/not-panic/not-panic-safe-4.stderr @@ -0,0 +1,34 @@ +error[E0277]: the type `std::cell::UnsafeCell` 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>(); + | ^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` + = note: required because it appears within the type `std::cell::RefCell` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&std::cell::RefCell` +note: required by `assert` + --> $DIR/not-panic-safe-4.rs:16:1 + | +LL | fn assert() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the type `std::cell::UnsafeCell` 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>(); + | ^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` + = note: required because it appears within the type `std::cell::Cell` + = note: required because it appears within the type `std::cell::RefCell` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&std::cell::RefCell` +note: required by `assert` + --> $DIR/not-panic-safe-4.rs:16:1 + | +LL | fn assert() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/not-panic/not-panic-safe-5.rs similarity index 100% rename from src/test/compile-fail/not-panic-safe-5.rs rename to src/test/ui/not-panic/not-panic-safe-5.rs diff --git a/src/test/ui/not-panic/not-panic-safe-5.stderr b/src/test/ui/not-panic/not-panic-safe-5.stderr new file mode 100644 index 0000000000000..ba3b3fadb6a1b --- /dev/null +++ b/src/test/ui/not-panic/not-panic-safe-5.stderr @@ -0,0 +1,17 @@ +error[E0277]: the type `std::cell::UnsafeCell` 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>(); //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` 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` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `*const std::cell::UnsafeCell` +note: required by `assert` + --> $DIR/not-panic-safe-5.rs:16:1 + | +LL | fn assert() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/not-panic/not-panic-safe-6.rs similarity index 100% rename from src/test/compile-fail/not-panic-safe-6.rs rename to src/test/ui/not-panic/not-panic-safe-6.rs diff --git a/src/test/ui/not-panic/not-panic-safe-6.stderr b/src/test/ui/not-panic/not-panic-safe-6.stderr new file mode 100644 index 0000000000000..da6c2a5829480 --- /dev/null +++ b/src/test/ui/not-panic/not-panic-safe-6.stderr @@ -0,0 +1,34 @@ +error[E0277]: the type `std::cell::UnsafeCell` 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>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` + = note: required because it appears within the type `std::cell::RefCell` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `*mut std::cell::RefCell` +note: required by `assert` + --> $DIR/not-panic-safe-6.rs:16:1 + | +LL | fn assert() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the type `std::cell::UnsafeCell` 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>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + = help: within `std::cell::RefCell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` + = note: required because it appears within the type `std::cell::Cell` + = note: required because it appears within the type `std::cell::RefCell` + = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `*mut std::cell::RefCell` +note: required by `assert` + --> $DIR/not-panic-safe-6.rs:16:1 + | +LL | fn assert() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/not-panic/not-panic-safe.rs similarity index 100% rename from src/test/compile-fail/not-panic-safe.rs rename to src/test/ui/not-panic/not-panic-safe.rs diff --git a/src/test/ui/not-panic/not-panic-safe.stderr b/src/test/ui/not-panic/not-panic-safe.stderr new file mode 100644 index 0000000000000..f349b5d2e2622 --- /dev/null +++ b/src/test/ui/not-panic/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() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/not-sync.rs similarity index 100% rename from src/test/compile-fail/not-sync.rs rename to src/test/ui/not-sync.rs diff --git a/src/test/ui/not-sync.stderr b/src/test/ui/not-sync.stderr new file mode 100644 index 0000000000000..026fd5dd713e8 --- /dev/null +++ b/src/test/ui/not-sync.stderr @@ -0,0 +1,81 @@ +error[E0277]: `std::cell::Cell` cannot be shared between threads safely + --> $DIR/not-sync.rs:18:5 + | +LL | test::>(); + | ^^^^^^^^^^^^^^^^^ `std::cell::Cell` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::Cell` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::cell::RefCell` cannot be shared between threads safely + --> $DIR/not-sync.rs:20:5 + | +LL | test::>(); + | ^^^^^^^^^^^^^^^^^^^^ `std::cell::RefCell` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::RefCell` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::rc::Rc` cannot be shared between threads safely + --> $DIR/not-sync.rs:23:5 + | +LL | test::>(); + | ^^^^^^^^^^^^^^^ `std::rc::Rc` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::rc::Rc` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::rc::Weak` cannot be shared between threads safely + --> $DIR/not-sync.rs:25:5 + | +LL | test::>(); + | ^^^^^^^^^^^^^^^^^ `std::rc::Weak` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::rc::Weak` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::sync::mpsc::Receiver` cannot be shared between threads safely + --> $DIR/not-sync.rs:28:5 + | +LL | test::>(); + | ^^^^^^^^^^^^^^^^^^^^^ `std::sync::mpsc::Receiver` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test() {} + | ^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::sync::mpsc::Sender` cannot be shared between threads safely + --> $DIR/not-sync.rs:30:5 + | +LL | test::>(); + | ^^^^^^^^^^^^^^^^^^^ `std::sync::mpsc::Sender` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender` +note: required by `test` + --> $DIR/not-sync.rs:15:1 + | +LL | fn test() {} + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/numeric-cast-2.rs b/src/test/ui/numeric/numeric-cast-2.rs similarity index 100% rename from src/test/ui/numeric-cast-2.rs rename to src/test/ui/numeric/numeric-cast-2.rs diff --git a/src/test/ui/numeric-cast-2.stderr b/src/test/ui/numeric/numeric-cast-2.stderr similarity index 100% rename from src/test/ui/numeric-cast-2.stderr rename to src/test/ui/numeric/numeric-cast-2.stderr diff --git a/src/test/ui/numeric-cast.rs b/src/test/ui/numeric/numeric-cast.rs similarity index 100% rename from src/test/ui/numeric-cast.rs rename to src/test/ui/numeric/numeric-cast.rs diff --git a/src/test/ui/numeric-cast.stderr b/src/test/ui/numeric/numeric-cast.stderr similarity index 100% rename from src/test/ui/numeric-cast.stderr rename to src/test/ui/numeric/numeric-cast.stderr diff --git a/src/test/ui/numeric-fields.rs b/src/test/ui/numeric/numeric-fields.rs similarity index 100% rename from src/test/ui/numeric-fields.rs rename to src/test/ui/numeric/numeric-fields.rs diff --git a/src/test/ui/numeric-fields.stderr b/src/test/ui/numeric/numeric-fields.stderr similarity index 100% rename from src/test/ui/numeric-fields.stderr rename to src/test/ui/numeric/numeric-fields.stderr diff --git a/src/test/compile-fail/object-does-not-impl-trait.rs b/src/test/ui/object-does-not-impl-trait.rs similarity index 100% rename from src/test/compile-fail/object-does-not-impl-trait.rs rename to src/test/ui/object-does-not-impl-trait.rs diff --git a/src/test/ui/object-does-not-impl-trait.stderr b/src/test/ui/object-does-not-impl-trait.stderr new file mode 100644 index 0000000000000..a1ebdf3e66664 --- /dev/null +++ b/src/test/ui/object-does-not-impl-trait.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `std::boxed::Box: Foo` is not satisfied + --> $DIR/object-does-not-impl-trait.rs:16:31 + | +LL | fn take_object(f: Box) { take_foo(f); } + | ^^^^^^^^ the trait `Foo` is not implemented for `std::boxed::Box` + | +note: required by `take_foo` + --> $DIR/object-does-not-impl-trait.rs:15:1 + | +LL | fn take_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/object-lifetime/object-lifetime-default-ambiguous.rs similarity index 100% rename from src/test/compile-fail/object-lifetime-default-ambiguous.rs rename to src/test/ui/object-lifetime/object-lifetime-default-ambiguous.rs diff --git a/src/test/ui/object-lifetime/object-lifetime-default-ambiguous.stderr b/src/test/ui/object-lifetime/object-lifetime-default-ambiguous.stderr new file mode 100644 index 0000000000000..cb603f2c4724a --- /dev/null +++ b/src/test/ui/object-lifetime/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) { + | ^^^^ + +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) { + | ^^^^ + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0228`. diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.nll.stderr new file mode 100644 index 0000000000000..509d35a94332f --- /dev/null +++ b/src/test/ui/object-lifetime/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/object-lifetime/object-lifetime-default-elision.rs similarity index 100% rename from src/test/compile-fail/object-lifetime-default-elision.rs rename to src/test/ui/object-lifetime/object-lifetime-default-elision.rs diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr new file mode 100644 index 0000000000000..45e7d8451f71c --- /dev/null +++ b/src/test/ui/object-lifetime/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/object-lifetime/object-lifetime-default-from-box-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.nll.stderr new file mode 100644 index 0000000000000..5cfced1a72fbe --- /dev/null +++ b/src/test/ui/object-lifetime/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 { + | _____________---------------____________________^ + | | | + | | help: add explicit lifetime `'static` to the type of `ss`: `&mut SomeStruct<'static>` +LL | | // `Box` 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) { + | --------------- 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/object-lifetime/object-lifetime-default-from-box-error.rs similarity index 100% rename from src/test/compile-fail/object-lifetime-default-from-box-error.rs rename to src/test/ui/object-lifetime/object-lifetime-default-from-box-error.rs diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-box-error.stderr new file mode 100644 index 0000000000000..9972930c13eae --- /dev/null +++ b/src/test/ui/object-lifetime/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 { + | --------------- 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) { + | --------------- 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/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.nll.stderr new file mode 100644 index 0000000000000..42bcdf2bd8c55 --- /dev/null +++ b/src/test/ui/object-lifetime/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, 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/object-lifetime/object-lifetime-default-from-rptr-box-error.rs similarity index 100% rename from src/test/compile-fail/object-lifetime-default-from-rptr-box-error.rs rename to src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.rs diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box-error.stderr new file mode 100644 index 0000000000000..a59d8090baf14 --- /dev/null +++ b/src/test/ui/object-lifetime/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, 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/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.nll.stderr new file mode 100644 index 0000000000000..73b419d511343 --- /dev/null +++ b/src/test/ui/object-lifetime/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, 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/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs similarity index 100% rename from src/test/compile-fail/object-lifetime-default-from-rptr-struct-error.rs rename to src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.rs diff --git a/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct-error.stderr new file mode 100644 index 0000000000000..beda4df5295f1 --- /dev/null +++ b/src/test/ui/object-lifetime/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, 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/object-lifetime/object-lifetime-default-mybox.nll.stderr b/src/test/ui/object-lifetime/object-lifetime-default-mybox.nll.stderr new file mode 100644 index 0000000000000..f76a03d078b9e --- /dev/null +++ b/src/test/ui/object-lifetime/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, + | -- -- 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) -> MyBox { + | -- `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/object-lifetime/object-lifetime-default-mybox.rs similarity index 100% rename from src/test/compile-fail/object-lifetime-default-mybox.rs rename to src/test/ui/object-lifetime/object-lifetime-default-mybox.rs diff --git a/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr b/src/test/ui/object-lifetime/object-lifetime-default-mybox.stderr new file mode 100644 index 0000000000000..ec00369361750 --- /dev/null +++ b/src/test/ui/object-lifetime/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, + | -------------------- this parameter and the return type are declared with different lifetimes... +LL | b: &'b MyBox) +LL | -> &'b MyBox + | -------------------- +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) -> MyBox { + | ^^ + = 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/object-lifetime/object-lifetime-default.rs similarity index 97% rename from src/test/compile-fail/object-lifetime-default.rs rename to src/test/ui/object-lifetime/object-lifetime-default.rs index 104e10f3207db..746a656edb4c9 100644 --- a/src/test/compile-fail/object-lifetime-default.rs +++ b/src/test/ui/object-lifetime/object-lifetime-default.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![feature(rustc_attrs)] #[rustc_object_lifetime_default] diff --git a/src/test/ui/object-lifetime/object-lifetime-default.stderr b/src/test/ui/object-lifetime/object-lifetime-default.stderr new file mode 100644 index 0000000000000..567ab72e56ad3 --- /dev/null +++ b/src/test/ui/object-lifetime/object-lifetime-default.stderr @@ -0,0 +1,44 @@ +error: BaseDefault + --> $DIR/object-lifetime-default.rs:16:1 + | +LL | struct A(T); //~ ERROR BaseDefault + | ^^^^^^^^^^^^^^^ + +error: BaseDefault + --> $DIR/object-lifetime-default.rs:19:1 + | +LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: 'a + --> $DIR/object-lifetime-default.rs:22:1 + | +LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: Ambiguous + --> $DIR/object-lifetime-default.rs:25:1 + | +LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T); //~ ERROR Ambiguous + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: 'b + --> $DIR/object-lifetime-default.rs:28:1 + | +LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: 'a,'b + --> $DIR/object-lifetime-default.rs:31: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:34: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/object-pointer-types.rs similarity index 100% rename from src/test/compile-fail/object-pointer-types.rs rename to src/test/ui/object-pointer-types.rs diff --git a/src/test/ui/object-pointer-types.stderr b/src/test/ui/object-pointer-types.stderr new file mode 100644 index 0000000000000..5d8679b8aa532 --- /dev/null +++ b/src/test/ui/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/object-safety-associated-consts.rs b/src/test/ui/object-safety/object-safety-associated-consts.rs similarity index 100% rename from src/test/ui/object-safety-associated-consts.rs rename to src/test/ui/object-safety/object-safety-associated-consts.rs diff --git a/src/test/ui/object-safety-associated-consts.stderr b/src/test/ui/object-safety/object-safety-associated-consts.stderr similarity index 100% rename from src/test/ui/object-safety-associated-consts.stderr rename to src/test/ui/object-safety/object-safety-associated-consts.stderr diff --git a/src/test/ui/object-safety/object-safety-by-value-self-use.nll.stderr b/src/test/ui/object-safety/object-safety-by-value-self-use.nll.stderr new file mode 100644 index 0000000000000..cf0ee5882632f --- /dev/null +++ b/src/test/ui/object-safety/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/object-safety/object-safety-by-value-self-use.rs similarity index 100% rename from src/test/compile-fail/object-safety-by-value-self-use.rs rename to src/test/ui/object-safety/object-safety-by-value-self-use.rs diff --git a/src/test/ui/object-safety/object-safety-by-value-self-use.stderr b/src/test/ui/object-safety/object-safety-by-value-self-use.stderr new file mode 100644 index 0000000000000..015284657af78 --- /dev/null +++ b/src/test/ui/object-safety/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/object-safety/object-safety-by-value-self.rs similarity index 100% rename from src/test/compile-fail/object-safety-by-value-self.rs rename to src/test/ui/object-safety/object-safety-by-value-self.rs diff --git a/src/test/ui/object-safety/object-safety-by-value-self.stderr b/src/test/ui/object-safety/object-safety-by-value-self.stderr new file mode 100644 index 0000000000000..61259641c0e84 --- /dev/null +++ b/src/test/ui/object-safety/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/ui/object-safety-generics.rs b/src/test/ui/object-safety/object-safety-generics.rs similarity index 100% rename from src/test/ui/object-safety-generics.rs rename to src/test/ui/object-safety/object-safety-generics.rs diff --git a/src/test/ui/object-safety-generics.stderr b/src/test/ui/object-safety/object-safety-generics.stderr similarity index 100% rename from src/test/ui/object-safety-generics.stderr rename to src/test/ui/object-safety/object-safety-generics.stderr diff --git a/src/test/compile-fail/object-safety-issue-22040.rs b/src/test/ui/object-safety/object-safety-issue-22040.rs similarity index 100% rename from src/test/compile-fail/object-safety-issue-22040.rs rename to src/test/ui/object-safety/object-safety-issue-22040.rs diff --git a/src/test/ui/object-safety/object-safety-issue-22040.stderr b/src/test/ui/object-safety/object-safety-issue-22040.stderr new file mode 100644 index 0000000000000..b718e92fc472a --- /dev/null +++ b/src/test/ui/object-safety/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>, + | ^^^^^^^^ 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/ui/object-safety-mentions-Self.rs b/src/test/ui/object-safety/object-safety-mentions-Self.rs similarity index 100% rename from src/test/ui/object-safety-mentions-Self.rs rename to src/test/ui/object-safety/object-safety-mentions-Self.rs diff --git a/src/test/ui/object-safety-mentions-Self.stderr b/src/test/ui/object-safety/object-safety-mentions-Self.stderr similarity index 100% rename from src/test/ui/object-safety-mentions-Self.stderr rename to src/test/ui/object-safety/object-safety-mentions-Self.stderr diff --git a/src/test/compile-fail/object-safety-no-static.rs b/src/test/ui/object-safety/object-safety-no-static.rs similarity index 100% rename from src/test/compile-fail/object-safety-no-static.rs rename to src/test/ui/object-safety/object-safety-no-static.rs diff --git a/src/test/ui/object-safety/object-safety-no-static.stderr b/src/test/ui/object-safety/object-safety-no-static.stderr new file mode 100644 index 0000000000000..f17d2907148cf --- /dev/null +++ b/src/test/ui/object-safety/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(b: Box) -> Box { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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/object-safety/object-safety-phantom-fn.rs similarity index 100% rename from src/test/compile-fail/object-safety-phantom-fn.rs rename to src/test/ui/object-safety/object-safety-phantom-fn.rs diff --git a/src/test/ui/object-safety/object-safety-phantom-fn.stderr b/src/test/ui/object-safety/object-safety-phantom-fn.stderr new file mode 100644 index 0000000000000..645867f460638 --- /dev/null +++ b/src/test/ui/object-safety/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/object-safety/object-safety-sized-2.rs similarity index 100% rename from src/test/compile-fail/object-safety-sized-2.rs rename to src/test/ui/object-safety/object-safety-sized-2.rs diff --git a/src/test/ui/object-safety/object-safety-sized-2.stderr b/src/test/ui/object-safety/object-safety-sized-2.stderr new file mode 100644 index 0000000000000..1e179b662b9ad --- /dev/null +++ b/src/test/ui/object-safety/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: &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/ui/object-safety-sized.rs b/src/test/ui/object-safety/object-safety-sized.rs similarity index 100% rename from src/test/ui/object-safety-sized.rs rename to src/test/ui/object-safety/object-safety-sized.rs diff --git a/src/test/ui/object-safety-sized.stderr b/src/test/ui/object-safety/object-safety-sized.stderr similarity index 100% rename from src/test/ui/object-safety-sized.stderr rename to src/test/ui/object-safety/object-safety-sized.stderr diff --git a/src/test/ui/object-safety-supertrait-mentions-Self.rs b/src/test/ui/object-safety/object-safety-supertrait-mentions-Self.rs similarity index 100% rename from src/test/ui/object-safety-supertrait-mentions-Self.rs rename to src/test/ui/object-safety/object-safety-supertrait-mentions-Self.rs diff --git a/src/test/ui/object-safety-supertrait-mentions-Self.stderr b/src/test/ui/object-safety/object-safety-supertrait-mentions-Self.stderr similarity index 100% rename from src/test/ui/object-safety-supertrait-mentions-Self.stderr rename to src/test/ui/object-safety/object-safety-supertrait-mentions-Self.stderr diff --git a/src/test/compile-fail/occurs-check-2.rs b/src/test/ui/occurs-check-2.rs similarity index 100% rename from src/test/compile-fail/occurs-check-2.rs rename to src/test/ui/occurs-check-2.rs diff --git a/src/test/ui/occurs-check-2.stderr b/src/test/ui/occurs-check-2.stderr new file mode 100644 index 0000000000000..547491c395b35 --- /dev/null +++ b/src/test/ui/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/occurs-check-3.rs similarity index 100% rename from src/test/compile-fail/occurs-check-3.rs rename to src/test/ui/occurs-check-3.rs diff --git a/src/test/ui/occurs-check-3.stderr b/src/test/ui/occurs-check-3.stderr new file mode 100644 index 0000000000000..1483d41d72326 --- /dev/null +++ b/src/test/ui/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::(_) => { } } } + | ^^^^^^^^^^ 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/occurs-check.rs similarity index 100% rename from src/test/compile-fail/occurs-check.rs rename to src/test/ui/occurs-check.rs diff --git a/src/test/ui/occurs-check.stderr b/src/test/ui/occurs-check.stderr new file mode 100644 index 0000000000000..c6994d0c5376a --- /dev/null +++ b/src/test/ui/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/old-suffixes-are-really-forbidden.rs similarity index 100% rename from src/test/compile-fail/old-suffixes-are-really-forbidden.rs rename to src/test/ui/old-suffixes-are-really-forbidden.rs diff --git a/src/test/ui/old-suffixes-are-really-forbidden.stderr b/src/test/ui/old-suffixes-are-really-forbidden.stderr new file mode 100644 index 0000000000000..d580a18f46b9b --- /dev/null +++ b/src/test/ui/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/once-cant-call-twice-on-heap.rs similarity index 100% rename from src/test/compile-fail/once-cant-call-twice-on-heap.rs rename to src/test/ui/once-cant-call-twice-on-heap.rs diff --git a/src/test/ui/once-cant-call-twice-on-heap.stderr b/src/test/ui/once-cant-call-twice-on-heap.stderr new file mode 100644 index 0000000000000..81a501f568023 --- /dev/null +++ b/src/test/ui/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/opt-in-copy.rs similarity index 100% rename from src/test/compile-fail/opt-in-copy.rs rename to src/test/ui/opt-in-copy.rs diff --git a/src/test/ui/opt-in-copy.stderr b/src/test/ui/opt-in-copy.stderr new file mode 100644 index 0000000000000..c6440804be600 --- /dev/null +++ b/src/test/ui/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/or-patter-mismatch.rs similarity index 100% rename from src/test/compile-fail/or-patter-mismatch.rs rename to src/test/ui/or-patter-mismatch.rs diff --git a/src/test/ui/or-patter-mismatch.stderr b/src/test/ui/or-patter-mismatch.stderr new file mode 100644 index 0000000000000..8bf4d2e5332ef --- /dev/null +++ b/src/test/ui/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/orphan-check-diagnostics.rs similarity index 100% rename from src/test/compile-fail/orphan-check-diagnostics.rs rename to src/test/ui/orphan-check-diagnostics.rs diff --git a/src/test/ui/orphan-check-diagnostics.stderr b/src/test/ui/orphan-check-diagnostics.stderr new file mode 100644 index 0000000000000..dc134dd8d6f54 --- /dev/null +++ b/src/test/ui/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`) + --> $DIR/orphan-check-diagnostics.rs:20:1 + | +LL | impl 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/osx-frameworks.rs similarity index 100% rename from src/test/compile-fail/osx-frameworks.rs rename to src/test/ui/osx-frameworks.rs diff --git a/src/test/ui/osx-frameworks.stderr b/src/test/ui/osx-frameworks.stderr new file mode 100644 index 0000000000000..cdc2357c36ce3 --- /dev/null +++ b/src/test/ui/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/out-of-order-shadowing.rs similarity index 100% rename from src/test/compile-fail/out-of-order-shadowing.rs rename to src/test/ui/out-of-order-shadowing.rs diff --git a/src/test/ui/out-of-order-shadowing.stderr b/src/test/ui/out-of-order-shadowing.stderr new file mode 100644 index 0000000000000..78e32e23ff636 --- /dev/null +++ b/src/test/ui/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/output-type-mismatch.rs similarity index 100% rename from src/test/compile-fail/output-type-mismatch.rs rename to src/test/ui/output-type-mismatch.rs diff --git a/src/test/ui/output-type-mismatch.stderr b/src/test/ui/output-type-mismatch.stderr new file mode 100644 index 0000000000000..e869dfa78a067 --- /dev/null +++ b/src/test/ui/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/overlap-marker-trait.rs similarity index 100% rename from src/test/compile-fail/overlap-marker-trait.rs rename to src/test/ui/overlap-marker-trait.rs diff --git a/src/test/ui/overlap-marker-trait.stderr b/src/test/ui/overlap-marker-trait.stderr new file mode 100644 index 0000000000000..d739dfc59d27b --- /dev/null +++ b/src/test/ui/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::(); //~ 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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/overloaded-calls-nontuple.rs similarity index 100% rename from src/test/compile-fail/overloaded-calls-nontuple.rs rename to src/test/ui/overloaded-calls-nontuple.rs diff --git a/src/test/ui/overloaded-calls-nontuple.stderr b/src/test/ui/overloaded-calls-nontuple.stderr new file mode 100644 index 0000000000000..78b86889553f6 --- /dev/null +++ b/src/test/ui/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/packed-struct/packed-struct-generic-transmute.rs similarity index 100% rename from src/test/compile-fail/packed-struct-generic-transmute.rs rename to src/test/ui/packed-struct/packed-struct-generic-transmute.rs diff --git a/src/test/ui/packed-struct/packed-struct-generic-transmute.stderr b/src/test/ui/packed-struct/packed-struct-generic-transmute.stderr new file mode 100644 index 0000000000000..397b1ddba717b --- /dev/null +++ b/src/test/ui/packed-struct/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/packed-struct/packed-struct-transmute.rs similarity index 95% rename from src/test/compile-fail/packed-struct-transmute.rs rename to src/test/ui/packed-struct/packed-struct-transmute.rs index abb02dd39e67d..695ffbdb2af9f 100644 --- a/src/test/compile-fail/packed-struct-transmute.rs +++ b/src/test/ui/packed-struct/packed-struct-transmute.rs @@ -13,6 +13,7 @@ // the error points to the start of the file, not the line with the // transmute +// normalize-stderr-test "\d+ bits" -> "N bits" // error-pattern: transmute called with types of different sizes use std::mem; diff --git a/src/test/ui/packed-struct/packed-struct-transmute.stderr b/src/test/ui/packed-struct/packed-struct-transmute.stderr new file mode 100644 index 0000000000000..5da7d8f7b7e2a --- /dev/null +++ b/src/test/ui/packed-struct/packed-struct-transmute.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/packed-struct-transmute.rs:36:24 + | +LL | let oof: Oof = mem::transmute(foo); + | ^^^^^^^^^^^^^^ + | + = note: source type: Foo (N bits) + = note: target type: Oof (N bits) + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0512`. diff --git a/src/test/ui/panic-implementation/auxiliary/some-panic-impl.rs b/src/test/ui/panic-implementation/auxiliary/some-panic-impl.rs new file mode 100644 index 0000000000000..db16ac325ac59 --- /dev/null +++ b/src/test/ui/panic-implementation/auxiliary/some-panic-impl.rs @@ -0,0 +1,22 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// no-prefer-dynamic + +#![crate_type = "rlib"] +#![feature(panic_implementation)] +#![no_std] + +use core::panic::PanicInfo; + +#[panic_implementation] +fn panic(info: &PanicInfo) -> ! { + loop {} +} diff --git a/src/test/compile-fail/panic-implementation-bad-signature-1.rs b/src/test/ui/panic-implementation/panic-implementation-bad-signature-1.rs similarity index 100% rename from src/test/compile-fail/panic-implementation-bad-signature-1.rs rename to src/test/ui/panic-implementation/panic-implementation-bad-signature-1.rs diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-1.stderr b/src/test/ui/panic-implementation/panic-implementation-bad-signature-1.stderr new file mode 100644 index 0000000000000..0e020fbc78b81 --- /dev/null +++ b/src/test/ui/panic-implementation/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/panic-implementation/panic-implementation-bad-signature-2.rs similarity index 100% rename from src/test/compile-fail/panic-implementation-bad-signature-2.rs rename to src/test/ui/panic-implementation/panic-implementation-bad-signature-2.rs diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-2.stderr b/src/test/ui/panic-implementation/panic-implementation-bad-signature-2.stderr new file mode 100644 index 0000000000000..71ed1efdcf2b8 --- /dev/null +++ b/src/test/ui/panic-implementation/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/panic-implementation/panic-implementation-bad-signature-3.rs similarity index 100% rename from src/test/compile-fail/panic-implementation-bad-signature-3.rs rename to src/test/ui/panic-implementation/panic-implementation-bad-signature-3.rs diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-3.stderr b/src/test/ui/panic-implementation/panic-implementation-bad-signature-3.stderr new file mode 100644 index 0000000000000..3fd29bcd3e998 --- /dev/null +++ b/src/test/ui/panic-implementation/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/panic-implementation/panic-implementation-bad-signature-4.rs similarity index 100% rename from src/test/compile-fail/panic-implementation-bad-signature-4.rs rename to src/test/ui/panic-implementation/panic-implementation-bad-signature-4.rs diff --git a/src/test/ui/panic-implementation/panic-implementation-bad-signature-4.stderr b/src/test/ui/panic-implementation/panic-implementation-bad-signature-4.stderr new file mode 100644 index 0000000000000..362be2fc3b91e --- /dev/null +++ b/src/test/ui/panic-implementation/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(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/panic-implementation/panic-implementation-duplicate.rs similarity index 100% rename from src/test/compile-fail/panic-implementation-duplicate.rs rename to src/test/ui/panic-implementation/panic-implementation-duplicate.rs diff --git a/src/test/ui/panic-implementation/panic-implementation-duplicate.stderr b/src/test/ui/panic-implementation/panic-implementation-duplicate.stderr new file mode 100644 index 0000000000000..d553c02379c37 --- /dev/null +++ b/src/test/ui/panic-implementation/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-requires-panic-info.rs b/src/test/ui/panic-implementation/panic-implementation-requires-panic-info.rs similarity index 100% rename from src/test/compile-fail/panic-implementation-requires-panic-info.rs rename to src/test/ui/panic-implementation/panic-implementation-requires-panic-info.rs diff --git a/src/test/ui/panic-implementation/panic-implementation-requires-panic-info.stderr b/src/test/ui/panic-implementation/panic-implementation-requires-panic-info.stderr new file mode 100644 index 0000000000000..2bae12efbde38 --- /dev/null +++ b/src/test/ui/panic-implementation/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/panic-implementation/panic-implementation-std.rs similarity index 100% rename from src/test/compile-fail/panic-implementation-std.rs rename to src/test/ui/panic-implementation/panic-implementation-std.rs diff --git a/src/test/ui/panic-implementation/panic-implementation-std.stderr b/src/test/ui/panic-implementation/panic-implementation-std.stderr new file mode 100644 index 0000000000000..5016d502cee31 --- /dev/null +++ b/src/test/ui/panic-implementation/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-runtime/abort-link-to-unwind-dylib.rs b/src/test/ui/panic-runtime/abort-link-to-unwind-dylib.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/abort-link-to-unwind-dylib.rs rename to src/test/ui/panic-runtime/abort-link-to-unwind-dylib.rs diff --git a/src/test/ui/panic-runtime/abort-link-to-unwind-dylib.stderr b/src/test/ui/panic-runtime/abort-link-to-unwind-dylib.stderr new file mode 100644 index 0000000000000..704b81ae1ce08 --- /dev/null +++ b/src/test/ui/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/panic-runtime/auxiliary/depends.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/auxiliary/depends.rs rename to src/test/ui/panic-runtime/auxiliary/depends.rs diff --git a/src/test/compile-fail/panic-runtime/auxiliary/needs-panic-runtime.rs b/src/test/ui/panic-runtime/auxiliary/needs-panic-runtime.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/auxiliary/needs-panic-runtime.rs rename to src/test/ui/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/panic-runtime/auxiliary/panic-runtime-abort.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/auxiliary/panic-runtime-abort.rs rename to src/test/ui/panic-runtime/auxiliary/panic-runtime-abort.rs diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-lang-items.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-lang-items.rs new file mode 100644 index 0000000000000..d9848a554aba5 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-lang-items.rs @@ -0,0 +1,25 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// no-prefer-dynamic + +#![crate_type = "rlib"] + +#![no_std] +#![feature(lang_items)] + +use core::panic::PanicInfo; + +#[lang = "panic_impl"] +fn panic_impl(info: &PanicInfo) -> ! { loop {} } +#[lang = "eh_personality"] +fn eh_personality() {} +#[lang = "eh_unwind_resume"] +fn eh_unwind_resume() {} diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs new file mode 100644 index 0000000000000..4bb36839d988b --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind.rs @@ -0,0 +1,27 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags:-C panic=unwind +// no-prefer-dynamic + +#![feature(panic_runtime)] +#![crate_type = "rlib"] + +#![no_std] +#![panic_runtime] + +#[no_mangle] +pub extern fn __rust_maybe_catch_panic() {} + +#[no_mangle] +pub extern fn __rust_start_panic() {} + +#[no_mangle] +pub extern fn rust_eh_personality() {} diff --git a/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs new file mode 100644 index 0000000000000..4bb36839d988b --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/panic-runtime-unwind2.rs @@ -0,0 +1,27 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags:-C panic=unwind +// no-prefer-dynamic + +#![feature(panic_runtime)] +#![crate_type = "rlib"] + +#![no_std] +#![panic_runtime] + +#[no_mangle] +pub extern fn __rust_maybe_catch_panic() {} + +#[no_mangle] +pub extern fn __rust_start_panic() {} + +#[no_mangle] +pub extern fn rust_eh_personality() {} diff --git a/src/test/compile-fail/panic-runtime/auxiliary/wants-panic-runtime-abort.rs b/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-abort.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/auxiliary/wants-panic-runtime-abort.rs rename to src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-abort.rs diff --git a/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs b/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs new file mode 100644 index 0000000000000..2183338b24985 --- /dev/null +++ b/src/test/ui/panic-runtime/auxiliary/wants-panic-runtime-unwind.rs @@ -0,0 +1,16 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// no-prefer-dynamic + +#![crate_type = "rlib"] +#![no_std] + +extern crate panic_runtime_unwind; diff --git a/src/test/compile-fail/panic-runtime/bad-panic-flag1.rs b/src/test/ui/panic-runtime/bad-panic-flag1.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/bad-panic-flag1.rs rename to src/test/ui/panic-runtime/bad-panic-flag1.rs diff --git a/src/test/ui/panic-runtime/bad-panic-flag1.stderr b/src/test/ui/panic-runtime/bad-panic-flag1.stderr new file mode 100644 index 0000000000000..3a65419c98fb7 --- /dev/null +++ b/src/test/ui/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/panic-runtime/bad-panic-flag2.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/bad-panic-flag2.rs rename to src/test/ui/panic-runtime/bad-panic-flag2.rs diff --git a/src/test/ui/panic-runtime/bad-panic-flag2.stderr b/src/test/ui/panic-runtime/bad-panic-flag2.stderr new file mode 100644 index 0000000000000..8d919e55c9068 --- /dev/null +++ b/src/test/ui/panic-runtime/bad-panic-flag2.stderr @@ -0,0 +1,2 @@ +error: codegen option `panic` requires either `panic` or `abort` (C panic=) + diff --git a/src/test/compile-fail/panic-runtime/libtest-unwinds.rs b/src/test/ui/panic-runtime/libtest-unwinds.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/libtest-unwinds.rs rename to src/test/ui/panic-runtime/libtest-unwinds.rs diff --git a/src/test/ui/panic-runtime/libtest-unwinds.stderr b/src/test/ui/panic-runtime/libtest-unwinds.stderr new file mode 100644 index 0000000000000..704b81ae1ce08 --- /dev/null +++ b/src/test/ui/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/panic-runtime/needs-gate.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/needs-gate.rs rename to src/test/ui/panic-runtime/needs-gate.rs diff --git a/src/test/ui/panic-runtime/needs-gate.stderr b/src/test/ui/panic-runtime/needs-gate.stderr new file mode 100644 index 0000000000000..aa2b97556dce8 --- /dev/null +++ b/src/test/ui/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/panic-runtime/runtime-depend-on-needs-runtime.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/runtime-depend-on-needs-runtime.rs rename to src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.rs diff --git a/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.stderr b/src/test/ui/panic-runtime/runtime-depend-on-needs-runtime.stderr new file mode 100644 index 0000000000000..0e68c9b806d1d --- /dev/null +++ b/src/test/ui/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/panic-runtime/transitive-link-a-bunch.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/transitive-link-a-bunch.rs rename to src/test/ui/panic-runtime/transitive-link-a-bunch.rs diff --git a/src/test/ui/panic-runtime/transitive-link-a-bunch.stderr b/src/test/ui/panic-runtime/transitive-link-a-bunch.stderr new file mode 100644 index 0000000000000..4af754c81f97c --- /dev/null +++ b/src/test/ui/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/want-unwind-got-abort.rs b/src/test/ui/panic-runtime/want-unwind-got-abort.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/want-unwind-got-abort.rs rename to src/test/ui/panic-runtime/want-unwind-got-abort.rs diff --git a/src/test/ui/panic-runtime/want-unwind-got-abort.stderr b/src/test/ui/panic-runtime/want-unwind-got-abort.stderr new file mode 100644 index 0000000000000..d4fd2cca81fdc --- /dev/null +++ b/src/test/ui/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/panic-runtime/want-unwind-got-abort2.rs similarity index 100% rename from src/test/compile-fail/panic-runtime/want-unwind-got-abort2.rs rename to src/test/ui/panic-runtime/want-unwind-got-abort2.rs diff --git a/src/test/ui/panic-runtime/want-unwind-got-abort2.stderr b/src/test/ui/panic-runtime/want-unwind-got-abort2.stderr new file mode 100644 index 0000000000000..364a27a24eb70 --- /dev/null +++ b/src/test/ui/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/panic_implementation-closures.rs similarity index 100% rename from src/test/compile-fail/panic_implementation-closures.rs rename to src/test/ui/panic_implementation-closures.rs diff --git a/src/test/compile-fail/paren-span.rs b/src/test/ui/paren-span.rs similarity index 100% rename from src/test/compile-fail/paren-span.rs rename to src/test/ui/paren-span.rs diff --git a/src/test/ui/paren-span.stderr b/src/test/ui/paren-span.stderr new file mode 100644 index 0000000000000..df6881a1af312 --- /dev/null +++ b/src/test/ui/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/parse-error-correct.rs similarity index 100% rename from src/test/compile-fail/parse-error-correct.rs rename to src/test/ui/parse-error-correct.rs diff --git a/src/test/ui/parse-error-correct.stderr b/src/test/ui/parse-error-correct.stderr new file mode 100644 index 0000000000000..3eb0b19a6aaea --- /dev/null +++ b/src/test/ui/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/parser-recovery-1.rs similarity index 100% rename from src/test/compile-fail/parser-recovery-1.rs rename to src/test/ui/parser-recovery-1.rs diff --git a/src/test/ui/parser-recovery-1.stderr b/src/test/ui/parser-recovery-1.stderr new file mode 100644 index 0000000000000..bf4070682fbb3 --- /dev/null +++ b/src/test/ui/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/parser-recovery-2.rs similarity index 100% rename from src/test/compile-fail/parser-recovery-2.rs rename to src/test/ui/parser-recovery-2.rs diff --git a/src/test/ui/parser-recovery-2.stderr b/src/test/ui/parser-recovery-2.stderr new file mode 100644 index 0000000000000..7b5206073522f --- /dev/null +++ b/src/test/ui/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/pattern/pat-shadow-in-nested-binding.rs similarity index 100% rename from src/test/compile-fail/pat-shadow-in-nested-binding.rs rename to src/test/ui/pattern/pat-shadow-in-nested-binding.rs diff --git a/src/test/ui/pattern/pat-shadow-in-nested-binding.stderr b/src/test/ui/pattern/pat-shadow-in-nested-binding.stderr new file mode 100644 index 0000000000000..9dd6a318e98df --- /dev/null +++ b/src/test/ui/pattern/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/pattern/pat-tuple-bad-type.rs similarity index 100% rename from src/test/compile-fail/pat-tuple-bad-type.rs rename to src/test/ui/pattern/pat-tuple-bad-type.rs diff --git a/src/test/ui/pattern/pat-tuple-bad-type.stderr b/src/test/ui/pattern/pat-tuple-bad-type.stderr new file mode 100644 index 0000000000000..d4f80550b3e84 --- /dev/null +++ b/src/test/ui/pattern/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/pattern/pat-tuple-overfield.rs similarity index 100% rename from src/test/compile-fail/pat-tuple-overfield.rs rename to src/test/ui/pattern/pat-tuple-overfield.rs diff --git a/src/test/ui/pattern/pat-tuple-overfield.stderr b/src/test/ui/pattern/pat-tuple-overfield.stderr new file mode 100644 index 0000000000000..2802b42f313d5 --- /dev/null +++ b/src/test/ui/pattern/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/pattern/patkind-litrange-no-expr.rs similarity index 100% rename from src/test/compile-fail/patkind-litrange-no-expr.rs rename to src/test/ui/pattern/patkind-litrange-no-expr.rs diff --git a/src/test/ui/pattern/patkind-litrange-no-expr.stderr b/src/test/ui/pattern/patkind-litrange-no-expr.stderr new file mode 100644 index 0000000000000..f22870fb029a1 --- /dev/null +++ b/src/test/ui/pattern/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/pattern/pattern-binding-disambiguation.rs similarity index 100% rename from src/test/compile-fail/pattern-binding-disambiguation.rs rename to src/test/ui/pattern/pattern-binding-disambiguation.rs diff --git a/src/test/ui/pattern/pattern-binding-disambiguation.stderr b/src/test/ui/pattern/pattern-binding-disambiguation.stderr new file mode 100644 index 0000000000000..7acdb07e10da6 --- /dev/null +++ b/src/test/ui/pattern/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/pattern/pattern-bindings-after-at.rs similarity index 100% rename from src/test/compile-fail/pattern-bindings-after-at.rs rename to src/test/ui/pattern/pattern-bindings-after-at.rs diff --git a/src/test/ui/pattern/pattern-bindings-after-at.stderr b/src/test/ui/pattern/pattern-bindings-after-at.stderr new file mode 100644 index 0000000000000..8c715001baa09 --- /dev/null +++ b/src/test/ui/pattern/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/pattern/pattern-error-continue.rs similarity index 100% rename from src/test/compile-fail/pattern-error-continue.rs rename to src/test/ui/pattern/pattern-error-continue.rs diff --git a/src/test/ui/pattern/pattern-error-continue.stderr b/src/test/ui/pattern/pattern-error-continue.stderr new file mode 100644 index 0000000000000..b24366c48bcbf --- /dev/null +++ b/src/test/ui/pattern/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/pattern/pattern-ident-path-generics.rs similarity index 100% rename from src/test/compile-fail/pattern-ident-path-generics.rs rename to src/test/ui/pattern/pattern-ident-path-generics.rs diff --git a/src/test/ui/pattern/pattern-ident-path-generics.stderr b/src/test/ui/pattern/pattern-ident-path-generics.stderr new file mode 100644 index 0000000000000..cd205956571f8 --- /dev/null +++ b/src/test/ui/pattern/pattern-ident-path-generics.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/pattern-ident-path-generics.rs:13:9 + | +LL | None:: => {} //~ ERROR mismatched types + | ^^^^^^^^^^^^^ expected &str, found isize + | + = note: expected type `std::option::Option<&str>` + 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/pattern-tyvar-2.rs b/src/test/ui/pattern/pattern-tyvar-2.rs similarity index 100% rename from src/test/compile-fail/pattern-tyvar-2.rs rename to src/test/ui/pattern/pattern-tyvar-2.rs diff --git a/src/test/ui/pattern/pattern-tyvar-2.stderr b/src/test/ui/pattern/pattern-tyvar-2.stderr new file mode 100644 index 0000000000000..fd7ab84cc562a --- /dev/null +++ b/src/test/ui/pattern/pattern-tyvar-2.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `*` cannot be applied to type `std::vec::Vec` + --> $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` + +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/pattern/pattern-tyvar.rs similarity index 100% rename from src/test/compile-fail/pattern-tyvar.rs rename to src/test/ui/pattern/pattern-tyvar.rs diff --git a/src/test/ui/pattern/pattern-tyvar.stderr b/src/test/ui/pattern/pattern-tyvar.stderr new file mode 100644 index 0000000000000..55e09e02a1d8f --- /dev/null +++ b/src/test/ui/pattern/pattern-tyvar.stderr @@ -0,0 +1,12 @@ +error[E0308]: mismatched types + --> $DIR/pattern-tyvar.rs:17:18 + | +LL | bar::t1(_, Some::(x)) => { + | ^^^^^^^^^^^^^^^^ expected struct `std::vec::Vec`, found isize + | + = note: expected type `std::option::Option>` + 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/phantom-oibit.rs b/src/test/ui/phantom-oibit.rs similarity index 100% rename from src/test/compile-fail/phantom-oibit.rs rename to src/test/ui/phantom-oibit.rs diff --git a/src/test/ui/phantom-oibit.stderr b/src/test/ui/phantom-oibit.stderr new file mode 100644 index 0000000000000..5156ba94cef6e --- /dev/null +++ b/src/test/ui/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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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>` +note: required by `is_zen` + --> $DIR/phantom-oibit.rs:28:1 + | +LL | fn is_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/platform-intrinsic-params.rs similarity index 100% rename from src/test/compile-fail/platform-intrinsic-params.rs rename to src/test/ui/platform-intrinsic-params.rs diff --git a/src/test/ui/platform-intrinsic-params.stderr b/src/test/ui/platform-intrinsic-params.stderr new file mode 100644 index 0000000000000..e41de9fe02d7c --- /dev/null +++ b/src/test/ui/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/pptypedef.rs similarity index 100% rename from src/test/compile-fail/pptypedef.rs rename to src/test/ui/pptypedef.rs diff --git a/src/test/ui/pptypedef.stderr b/src/test/ui/pptypedef.stderr new file mode 100644 index 0000000000000..bde48d86ba56e --- /dev/null +++ b/src/test/ui/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/prim-with-args.rs similarity index 100% rename from src/test/compile-fail/prim-with-args.rs rename to src/test/ui/prim-with-args.rs diff --git a/src/test/ui/prim-with-args.stderr b/src/test/ui/prim-with-args.stderr new file mode 100644 index 0000000000000..bfe7256f8a20e --- /dev/null +++ b/src/test/ui/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; //~ 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; //~ 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; //~ 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; //~ 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; //~ 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; //~ 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; //~ 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; //~ 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; //~ 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; //~ 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; //~ 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/priv-in-bad-locations.rs similarity index 100% rename from src/test/compile-fail/priv-in-bad-locations.rs rename to src/test/ui/priv-in-bad-locations.rs diff --git a/src/test/ui/priv-in-bad-locations.stderr b/src/test/ui/priv-in-bad-locations.stderr new file mode 100644 index 0000000000000..e395a2243df0e --- /dev/null +++ b/src/test/ui/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/associated-item-privacy-inherent.rs b/src/test/ui/privacy/associated-item-privacy-inherent.rs similarity index 100% rename from src/test/compile-fail/privacy/associated-item-privacy-inherent.rs rename to src/test/ui/privacy/associated-item-privacy-inherent.rs diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.stderr b/src/test/ui/privacy/associated-item-privacy-inherent.stderr new file mode 100644 index 0000000000000..391e5bbb4c012 --- /dev/null +++ b/src/test/ui/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::; + | ^^^^^^^^^^^^^^^^^^^ +... +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::(); + | ^^^^^^^^^^^^^^^^^^^^ +... +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 = ::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 = ::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 | ::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/privacy/associated-item-privacy-trait.rs similarity index 100% rename from src/test/compile-fail/privacy/associated-item-privacy-trait.rs rename to src/test/ui/privacy/associated-item-privacy-trait.rs diff --git a/src/test/ui/privacy/associated-item-privacy-trait.stderr b/src/test/ui/privacy/associated-item-privacy-trait.stderr new file mode 100644 index 0000000000000..5aac27346f344 --- /dev/null +++ b/src/test/ui/privacy/associated-item-privacy-trait.stderr @@ -0,0 +1,317 @@ +error: type `for<'r> fn(&'r priv_trait::Pub) {::method}` is private + --> $DIR/associated-item-privacy-trait.rs:27:21 + | +LL | let value = ::method; + | ^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac!(); + | ------------------- in this macro invocation + +error: type `for<'r> fn(&'r priv_trait::Pub) {::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) {::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 | ::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 _: ::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 _: ::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 = ::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 = ::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 = ::method::; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +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::(); + | ^^^^^^^^^^^^^^^^^^^^ +... +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 = ::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 = >::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 = >::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 | ::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 | >::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 | >::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 _: ::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 _: ::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 _: >::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 _: >::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 _: >::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 _: >::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 = ::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 = >::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/privacy/associated-item-privacy-type-binding.rs similarity index 100% rename from src/test/compile-fail/privacy/associated-item-privacy-type-binding.rs rename to src/test/ui/privacy/associated-item-privacy-type-binding.rs diff --git a/src/test/ui/privacy/associated-item-privacy-type-binding.stderr b/src/test/ui/privacy/associated-item-privacy-type-binding.stderr new file mode 100644 index 0000000000000..e762dc62853b0 --- /dev/null +++ b/src/test/ui/privacy/associated-item-privacy-type-binding.stderr @@ -0,0 +1,146 @@ +error: type `(dyn priv_trait::PubTr + ')` is private + --> $DIR/associated-item-privacy-type-binding.rs:21:13 + | +LL | let _: Box>; + | ^ +... +LL | priv_trait::mac1!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PubTr + ')` is private + --> $DIR/associated-item-privacy-type-binding.rs:21:16 + | +LL | let _: Box>; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac1!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PubTr + 'static)` is private + --> $DIR/associated-item-privacy-type-binding.rs:24:31 + | +LL | type InSignatureTy2 = Box>; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +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 {} + | ^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac1!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PrivTr + ')` is private + --> $DIR/associated-item-privacy-type-binding.rs:30:13 + | +LL | let _: Box>; + | ^ +... +LL | priv_trait::mac2!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PrivTr + ')` is private + --> $DIR/associated-item-privacy-type-binding.rs:30:16 + | +LL | let _: Box>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | priv_trait::mac2!(); + | -------------------- in this macro invocation + +error: type `(dyn priv_trait::PrivTr + 'static)` is private + --> $DIR/associated-item-privacy-type-binding.rs:33:31 + | +LL | type InSignatureTy1 = Box>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^ +... +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 {} + | ^^^^^^^^^^^^^^^^^^^^ +... +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>; + | ^ +... +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>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +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>; + | ^ +... +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>; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +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>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +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>; + | ^^^^^^^^^^^^^^^^^^^^^^^^ +... +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 {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... +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 {} + | ^^^^^^^^^^^^^^^^^^^ +... +LL | priv_parent_substs::mac!(); + | --------------------------- in this macro invocation + +error: aborting due to 16 previous errors + diff --git a/src/test/compile-fail/auxiliary/cci_class.rs b/src/test/ui/privacy/auxiliary/cci_class.rs similarity index 100% rename from src/test/compile-fail/auxiliary/cci_class.rs rename to src/test/ui/privacy/auxiliary/cci_class.rs diff --git a/src/test/compile-fail/auxiliary/cci_class_5.rs b/src/test/ui/privacy/auxiliary/cci_class_5.rs similarity index 100% rename from src/test/compile-fail/auxiliary/cci_class_5.rs rename to src/test/ui/privacy/auxiliary/cci_class_5.rs diff --git a/src/test/compile-fail/auxiliary/privacy_tuple_struct.rs b/src/test/ui/privacy/auxiliary/privacy_tuple_struct.rs similarity index 100% rename from src/test/compile-fail/auxiliary/privacy_tuple_struct.rs rename to src/test/ui/privacy/auxiliary/privacy_tuple_struct.rs diff --git a/src/test/compile-fail/auxiliary/private-inferred-type.rs b/src/test/ui/privacy/auxiliary/private-inferred-type.rs similarity index 100% rename from src/test/compile-fail/auxiliary/private-inferred-type.rs rename to src/test/ui/privacy/auxiliary/private-inferred-type.rs diff --git a/src/test/compile-fail/privacy/legacy-ctor-visibility.rs b/src/test/ui/privacy/legacy-ctor-visibility.rs similarity index 100% rename from src/test/compile-fail/privacy/legacy-ctor-visibility.rs rename to src/test/ui/privacy/legacy-ctor-visibility.rs diff --git a/src/test/ui/privacy/legacy-ctor-visibility.stderr b/src/test/ui/privacy/legacy-ctor-visibility.stderr new file mode 100644 index 0000000000000..7652d65a3a4a6 --- /dev/null +++ b/src/test/ui/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 + +error: aborting due to previous error + diff --git a/src/test/compile-fail/privacy-in-paths.rs b/src/test/ui/privacy/privacy-in-paths.rs similarity index 100% rename from src/test/compile-fail/privacy-in-paths.rs rename to src/test/ui/privacy/privacy-in-paths.rs diff --git a/src/test/ui/privacy/privacy-in-paths.stderr b/src/test/ui/privacy/privacy-in-paths.stderr new file mode 100644 index 0000000000000..f0aa3d36479e4 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/privacy-ns1.rs similarity index 100% rename from src/test/compile-fail/privacy-ns1.rs rename to src/test/ui/privacy/privacy-ns1.rs diff --git a/src/test/ui/privacy/privacy-ns1.stderr b/src/test/ui/privacy/privacy-ns1.stderr new file mode 100644 index 0000000000000..503cfbfaa2dc7 --- /dev/null +++ b/src/test/ui/privacy/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; //~ 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; //~ 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/privacy/privacy-ns2.rs similarity index 100% rename from src/test/compile-fail/privacy-ns2.rs rename to src/test/ui/privacy/privacy-ns2.rs diff --git a/src/test/ui/privacy/privacy-ns2.stderr b/src/test/ui/privacy/privacy-ns2.stderr new file mode 100644 index 0000000000000..0cd341d9a58b5 --- /dev/null +++ b/src/test/ui/privacy/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; //~ 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; //~ 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/privacy/privacy-sanity.rs similarity index 100% rename from src/test/compile-fail/privacy-sanity.rs rename to src/test/ui/privacy/privacy-sanity.rs diff --git a/src/test/ui/privacy/privacy-sanity.stderr b/src/test/ui/privacy/privacy-sanity.stderr new file mode 100644 index 0000000000000..fbfa15f8cb020 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/privacy-ufcs.rs similarity index 100% rename from src/test/compile-fail/privacy-ufcs.rs rename to src/test/ui/privacy/privacy-ufcs.rs diff --git a/src/test/ui/privacy/privacy-ufcs.stderr b/src/test/ui/privacy/privacy-ufcs.stderr new file mode 100644 index 0000000000000..2030e2e0f1b9e --- /dev/null +++ b/src/test/ui/privacy/privacy-ufcs.stderr @@ -0,0 +1,9 @@ +error[E0603]: trait `Bar` is private + --> $DIR/privacy-ufcs.rs:22:5 + | +LL | ::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/privacy1.rs b/src/test/ui/privacy/privacy1.rs similarity index 100% rename from src/test/compile-fail/privacy1.rs rename to src/test/ui/privacy/privacy1.rs diff --git a/src/test/ui/privacy/privacy1.stderr b/src/test/ui/privacy/privacy1.stderr new file mode 100644 index 0000000000000..344f990699f45 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/privacy2.rs similarity index 100% rename from src/test/compile-fail/privacy2.rs rename to src/test/ui/privacy/privacy2.rs diff --git a/src/test/ui/privacy/privacy2.stderr b/src/test/ui/privacy/privacy2.stderr new file mode 100644 index 0000000000000..ec5567b25e443 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/privacy3.rs similarity index 100% rename from src/test/compile-fail/privacy3.rs rename to src/test/ui/privacy/privacy3.rs diff --git a/src/test/ui/privacy/privacy3.stderr b/src/test/ui/privacy/privacy3.stderr new file mode 100644 index 0000000000000..11c71616d9071 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/privacy4.rs similarity index 100% rename from src/test/compile-fail/privacy4.rs rename to src/test/ui/privacy/privacy4.rs diff --git a/src/test/ui/privacy/privacy4.stderr b/src/test/ui/privacy/privacy4.stderr new file mode 100644 index 0000000000000..811f5d5942a7a --- /dev/null +++ b/src/test/ui/privacy/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/privacy/privacy5.rs similarity index 100% rename from src/test/compile-fail/privacy5.rs rename to src/test/ui/privacy/privacy5.rs diff --git a/src/test/ui/privacy/privacy5.stderr b/src/test/ui/privacy/privacy5.stderr new file mode 100644 index 0000000000000..bcb6315136273 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-impl-method.rs similarity index 100% rename from src/test/compile-fail/private-impl-method.rs rename to src/test/ui/privacy/private-impl-method.rs diff --git a/src/test/ui/privacy/private-impl-method.stderr b/src/test/ui/privacy/private-impl-method.stderr new file mode 100644 index 0000000000000..0e36c7003ee50 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-in-public-assoc-ty.rs similarity index 100% rename from src/test/compile-fail/private-in-public-assoc-ty.rs rename to src/test/ui/privacy/private-in-public-assoc-ty.rs diff --git a/src/test/ui/privacy/private-in-public-assoc-ty.stderr b/src/test/ui/privacy/private-in-public-assoc-ty.stderr new file mode 100644 index 0000000000000..a95547bc5079e --- /dev/null +++ b/src/test/ui/privacy/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 + +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 + +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/privacy/private-in-public-ill-formed.rs similarity index 100% rename from src/test/compile-fail/private-in-public-ill-formed.rs rename to src/test/ui/privacy/private-in-public-ill-formed.rs diff --git a/src/test/ui/privacy/private-in-public-ill-formed.stderr b/src/test/ui/privacy/private-in-public-ill-formed.stderr new file mode 100644 index 0000000000000..649f5fc2fcaf9 --- /dev/null +++ b/src/test/ui/privacy/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 ::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 ::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/privacy/private-in-public-lint.rs similarity index 100% rename from src/test/compile-fail/private-in-public-lint.rs rename to src/test/ui/privacy/private-in-public-lint.rs diff --git a/src/test/ui/privacy/private-in-public-lint.stderr b/src/test/ui/privacy/private-in-public-lint.stderr new file mode 100644 index 0000000000000..202cb342d8c7f --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-in-public-warn.rs similarity index 100% rename from src/test/compile-fail/private-in-public-warn.rs rename to src/test/ui/privacy/private-in-public-warn.rs diff --git a/src/test/ui/privacy/private-in-public-warn.stderr b/src/test/ui/privacy/private-in-public-warn.stderr new file mode 100644 index 0000000000000..04e743a5b0ebf --- /dev/null +++ b/src/test/ui/privacy/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 + +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 + +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 + +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 + +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 + +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 + +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 + +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 + +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 + +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; //~ 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 + +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 + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:64:5 + | +LL | pub trait Tr2 {} //~ 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 + +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(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 + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:70:9 + | +LL | fn f(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 + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:73:5 + | +LL | impl Pub {} //~ 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 + +error: private trait `traits::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:75:5 + | +LL | impl PubTr for Pub {} //~ 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 + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:84:5 + | +LL | pub type Alias 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 + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:87:5 + | +LL | pub trait Tr2 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 + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:91:9 + | +LL | fn f(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 + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:95:5 + | +LL | impl Pub 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 + +error: private trait `traits_where::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:98:5 + | +LL | impl PubTr for Pub 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 + +error: private trait `generics::PrivTr` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:109:5 + | +LL | pub trait Tr1: 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 + +error: private type `generics::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:112:5 + | +LL | pub trait Tr2: PubTr {} //~ 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 + +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 + +error: private type `generics::Priv` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:116:5 + | +LL | pub trait Tr4: PubTr> {} //~ 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 + +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 + +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 + +error: private type `aliases_priv::Priv2` in public interface (error E0446) + --> $DIR/private-in-public-warn.rs:251:5 + | +LL | pub trait Tr2: 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 + +error: private trait `aliases_priv::PrivTr1` in public interface (error E0445) + --> $DIR/private-in-public-warn.rs:251:5 + | +LL | pub trait Tr2: 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 + +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/privacy/private-in-public.rs similarity index 100% rename from src/test/compile-fail/private-in-public.rs rename to src/test/ui/privacy/private-in-public.rs diff --git a/src/test/ui/privacy/private-in-public.stderr b/src/test/ui/privacy/private-in-public.stderr new file mode 100644 index 0000000000000..586327fbf2664 --- /dev/null +++ b/src/test/ui/privacy/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 { 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(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); //~ 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 Pub { //~ ERROR private trait `traits::PrivTr` in public interface +LL | | pub fn f(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(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 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(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) 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 Pub where T: PrivTr { +LL | | //~^ ERROR private trait `traits_where::PrivTr` in public interface +LL | | pub fn f(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(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); + | - `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); + | - `generics::Priv` declared as private +... +LL | pub fn f2(arg: Pub) {} //~ 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:75:5 + | +LL | struct Priv(T); + | - `generics::Priv` declared as private +... +LL | pub fn f3(arg: Priv) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 `::Assoc` in public interface + --> $DIR/private-in-public.rs:114:5 + | +LL | trait PrivTr { + | - `::Assoc` declared as private +... +LL | pub fn f3(arg: ::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: ::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 `::Assoc` in public interface + --> $DIR/private-in-public.rs:143:5 + | +LL | trait PrivTr { + | - `::Assoc` declared as private +... +LL | pub fn f3(arg: ::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: ::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) {} //~ 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/privacy/private-inferred-type-1.rs similarity index 100% rename from src/test/compile-fail/private-inferred-type-1.rs rename to src/test/ui/privacy/private-inferred-type-1.rs diff --git a/src/test/ui/privacy/private-inferred-type-1.stderr b/src/test/ui/privacy/private-inferred-type-1.stderr new file mode 100644 index 0000000000000..4036152c27fc9 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-inferred-type-2.rs similarity index 100% rename from src/test/compile-fail/private-inferred-type-2.rs rename to src/test/ui/privacy/private-inferred-type-2.rs diff --git a/src/test/ui/privacy/private-inferred-type-2.stderr b/src/test/ui/privacy/private-inferred-type-2.stderr new file mode 100644 index 0000000000000..0559473e3616f --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-inferred-type-3.rs similarity index 100% rename from src/test/compile-fail/private-inferred-type-3.rs rename to src/test/ui/privacy/private-inferred-type-3.rs diff --git a/src/test/ui/privacy/private-inferred-type-3.stderr b/src/test/ui/privacy/private-inferred-type-3.stderr new file mode 100644 index 0000000000000..3c37a7ee1e8d2 --- /dev/null +++ b/src/test/ui/privacy/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() {::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) {>::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/privacy/private-inferred-type.rs similarity index 100% rename from src/test/compile-fail/private-inferred-type.rs rename to src/test/ui/privacy/private-inferred-type.rs diff --git a/src/test/ui/privacy/private-inferred-type.stderr b/src/test/ui/privacy/private-inferred-type.stderr new file mode 100644 index 0000000000000..abbe43fe384cb --- /dev/null +++ b/src/test/ui/privacy/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 _: ::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::(); //~ 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 | ::TRAIT_ASSOC_CONST; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:118:6 + | +LL | >::INHERENT_ASSOC_CONST; //~ ERROR type `m::Priv` is private + | ^^^^^^^^^^^^^^^^ + +error: type `m::Priv` is private + --> $DIR/private-inferred-type.rs:119:5 + | +LL | >::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 | >::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() {::method}` is private + --> $DIR/private-inferred-type.rs:53:9 + | +LL | ::method; //~ ERROR type `fn() {::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) {>::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/privacy/private-item-simple.rs similarity index 100% rename from src/test/compile-fail/private-item-simple.rs rename to src/test/ui/privacy/private-item-simple.rs diff --git a/src/test/ui/privacy/private-item-simple.stderr b/src/test/ui/privacy/private-item-simple.stderr new file mode 100644 index 0000000000000..811b026eab9e3 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-method-cross-crate.rs similarity index 100% rename from src/test/compile-fail/private-method-cross-crate.rs rename to src/test/ui/privacy/private-method-cross-crate.rs diff --git a/src/test/ui/privacy/private-method-cross-crate.stderr b/src/test/ui/privacy/private-method-cross-crate.stderr new file mode 100644 index 0000000000000..27d398c016613 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-method-inherited.rs similarity index 100% rename from src/test/compile-fail/private-method-inherited.rs rename to src/test/ui/privacy/private-method-inherited.rs diff --git a/src/test/ui/privacy/private-method-inherited.stderr b/src/test/ui/privacy/private-method-inherited.stderr new file mode 100644 index 0000000000000..3f10750e46ffe --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-method.rs similarity index 100% rename from src/test/compile-fail/private-method.rs rename to src/test/ui/privacy/private-method.rs diff --git a/src/test/ui/privacy/private-method.stderr b/src/test/ui/privacy/private-method.stderr new file mode 100644 index 0000000000000..fce03d35e39c0 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-struct-field-cross-crate.rs similarity index 100% rename from src/test/compile-fail/private-struct-field-cross-crate.rs rename to src/test/ui/privacy/private-struct-field-cross-crate.rs diff --git a/src/test/ui/privacy/private-struct-field-cross-crate.stderr b/src/test/ui/privacy/private-struct-field-cross-crate.stderr new file mode 100644 index 0000000000000..b9401baf0d00d --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-struct-field-ctor.rs similarity index 100% rename from src/test/compile-fail/private-struct-field-ctor.rs rename to src/test/ui/privacy/private-struct-field-ctor.rs diff --git a/src/test/ui/privacy/private-struct-field-ctor.stderr b/src/test/ui/privacy/private-struct-field-ctor.stderr new file mode 100644 index 0000000000000..711d265c559b2 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-struct-field-pattern.rs similarity index 100% rename from src/test/compile-fail/private-struct-field-pattern.rs rename to src/test/ui/privacy/private-struct-field-pattern.rs diff --git a/src/test/ui/privacy/private-struct-field-pattern.stderr b/src/test/ui/privacy/private-struct-field-pattern.stderr new file mode 100644 index 0000000000000..bc09a2a6dafbf --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-struct-field.rs similarity index 100% rename from src/test/compile-fail/private-struct-field.rs rename to src/test/ui/privacy/private-struct-field.rs diff --git a/src/test/ui/privacy/private-struct-field.stderr b/src/test/ui/privacy/private-struct-field.stderr new file mode 100644 index 0000000000000..db16e1ba1fcee --- /dev/null +++ b/src/test/ui/privacy/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/privacy/private-type-in-interface.rs similarity index 100% rename from src/test/compile-fail/private-type-in-interface.rs rename to src/test/ui/privacy/private-type-in-interface.rs diff --git a/src/test/ui/privacy/private-type-in-interface.stderr b/src/test/ui/privacy/private-type-in-interface.stderr new file mode 100644 index 0000000000000..5b12ed5e5f473 --- /dev/null +++ b/src/test/ui/privacy/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 = ::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 { 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 { 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 { 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 { 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/privacy/private-variant-reexport.rs similarity index 100% rename from src/test/compile-fail/private-variant-reexport.rs rename to src/test/ui/privacy/private-variant-reexport.rs diff --git a/src/test/ui/privacy/private-variant-reexport.stderr b/src/test/ui/privacy/private-variant-reexport.stderr new file mode 100644 index 0000000000000..11e13ab9ba8f1 --- /dev/null +++ b/src/test/ui/privacy/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/privacy/restricted/auxiliary/pub_restricted.rs b/src/test/ui/privacy/restricted/auxiliary/pub_restricted.rs similarity index 100% rename from src/test/compile-fail/privacy/restricted/auxiliary/pub_restricted.rs rename to src/test/ui/privacy/restricted/auxiliary/pub_restricted.rs diff --git a/src/test/compile-fail/privacy/restricted/lookup-ignores-private.rs b/src/test/ui/privacy/restricted/lookup-ignores-private.rs similarity index 100% rename from src/test/compile-fail/privacy/restricted/lookup-ignores-private.rs rename to src/test/ui/privacy/restricted/lookup-ignores-private.rs diff --git a/src/test/ui/privacy/restricted/lookup-ignores-private.stderr b/src/test/ui/privacy/restricted/lookup-ignores-private.stderr new file mode 100644 index 0000000000000..7fc53e8c324a0 --- /dev/null +++ b/src/test/ui/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/privacy/restricted/private-in-public.rs similarity index 100% rename from src/test/compile-fail/privacy/restricted/private-in-public.rs rename to src/test/ui/privacy/restricted/private-in-public.rs diff --git a/src/test/ui/privacy/restricted/private-in-public.stderr b/src/test/ui/privacy/restricted/private-in-public.stderr new file mode 100644 index 0000000000000..e0d3abdc213f6 --- /dev/null +++ b/src/test/ui/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/privacy/restricted/struct-literal-field.rs similarity index 100% rename from src/test/compile-fail/privacy/restricted/struct-literal-field.rs rename to src/test/ui/privacy/restricted/struct-literal-field.rs diff --git a/src/test/ui/privacy/restricted/struct-literal-field.stderr b/src/test/ui/privacy/restricted/struct-literal-field.stderr new file mode 100644 index 0000000000000..6d668c8767a93 --- /dev/null +++ b/src/test/ui/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/privacy/restricted/test.rs similarity index 100% rename from src/test/compile-fail/privacy/restricted/test.rs rename to src/test/ui/privacy/restricted/test.rs diff --git a/src/test/ui/privacy/restricted/test.stderr b/src/test/ui/privacy/restricted/test.stderr new file mode 100644 index 0000000000000..67a95c3559018 --- /dev/null +++ b/src/test/ui/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/privacy/union-field-privacy-1.rs similarity index 100% rename from src/test/compile-fail/privacy/union-field-privacy-1.rs rename to src/test/ui/privacy/union-field-privacy-1.rs diff --git a/src/test/ui/privacy/union-field-privacy-1.stderr b/src/test/ui/privacy/union-field-privacy-1.stderr new file mode 100644 index 0000000000000..c93760a1b89cd --- /dev/null +++ b/src/test/ui/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/privacy/union-field-privacy-2.rs similarity index 100% rename from src/test/compile-fail/privacy/union-field-privacy-2.rs rename to src/test/ui/privacy/union-field-privacy-2.rs diff --git a/src/test/ui/privacy/union-field-privacy-2.stderr b/src/test/ui/privacy/union-field-privacy-2.stderr new file mode 100644 index 0000000000000..cc12483a653b0 --- /dev/null +++ b/src/test/ui/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/ptr-coercion.rs b/src/test/ui/ptr-coercion.rs similarity index 100% rename from src/test/compile-fail/ptr-coercion.rs rename to src/test/ui/ptr-coercion.rs diff --git a/src/test/ui/ptr-coercion.stderr b/src/test/ui/ptr-coercion.stderr new file mode 100644 index 0000000000000..c5ed80db1a84a --- /dev/null +++ b/src/test/ui/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/ui/pub-ident-fn-2.rs b/src/test/ui/pub/pub-ident-fn-2.rs similarity index 100% rename from src/test/ui/pub-ident-fn-2.rs rename to src/test/ui/pub/pub-ident-fn-2.rs diff --git a/src/test/ui/pub-ident-fn-2.stderr b/src/test/ui/pub/pub-ident-fn-2.stderr similarity index 100% rename from src/test/ui/pub-ident-fn-2.stderr rename to src/test/ui/pub/pub-ident-fn-2.stderr diff --git a/src/test/ui/pub-ident-fn-or-struct-2.rs b/src/test/ui/pub/pub-ident-fn-or-struct-2.rs similarity index 100% rename from src/test/ui/pub-ident-fn-or-struct-2.rs rename to src/test/ui/pub/pub-ident-fn-or-struct-2.rs diff --git a/src/test/ui/pub-ident-fn-or-struct-2.stderr b/src/test/ui/pub/pub-ident-fn-or-struct-2.stderr similarity index 100% rename from src/test/ui/pub-ident-fn-or-struct-2.stderr rename to src/test/ui/pub/pub-ident-fn-or-struct-2.stderr diff --git a/src/test/ui/pub-ident-fn-or-struct.rs b/src/test/ui/pub/pub-ident-fn-or-struct.rs similarity index 100% rename from src/test/ui/pub-ident-fn-or-struct.rs rename to src/test/ui/pub/pub-ident-fn-or-struct.rs diff --git a/src/test/ui/pub-ident-fn-or-struct.stderr b/src/test/ui/pub/pub-ident-fn-or-struct.stderr similarity index 100% rename from src/test/ui/pub-ident-fn-or-struct.stderr rename to src/test/ui/pub/pub-ident-fn-or-struct.stderr diff --git a/src/test/ui/pub-ident-fn.fixed b/src/test/ui/pub/pub-ident-fn.fixed similarity index 100% rename from src/test/ui/pub-ident-fn.fixed rename to src/test/ui/pub/pub-ident-fn.fixed diff --git a/src/test/ui/pub-ident-fn.rs b/src/test/ui/pub/pub-ident-fn.rs similarity index 100% rename from src/test/ui/pub-ident-fn.rs rename to src/test/ui/pub/pub-ident-fn.rs diff --git a/src/test/ui/pub-ident-fn.stderr b/src/test/ui/pub/pub-ident-fn.stderr similarity index 100% rename from src/test/ui/pub-ident-fn.stderr rename to src/test/ui/pub/pub-ident-fn.stderr diff --git a/src/test/ui/pub-ident-struct.rs b/src/test/ui/pub/pub-ident-struct.rs similarity index 100% rename from src/test/ui/pub-ident-struct.rs rename to src/test/ui/pub/pub-ident-struct.rs diff --git a/src/test/ui/pub-ident-struct.stderr b/src/test/ui/pub/pub-ident-struct.stderr similarity index 100% rename from src/test/ui/pub-ident-struct.stderr rename to src/test/ui/pub/pub-ident-struct.stderr diff --git a/src/test/compile-fail/pub-reexport-priv-extern-crate.rs b/src/test/ui/pub/pub-reexport-priv-extern-crate.rs similarity index 100% rename from src/test/compile-fail/pub-reexport-priv-extern-crate.rs rename to src/test/ui/pub/pub-reexport-priv-extern-crate.rs diff --git a/src/test/ui/pub/pub-reexport-priv-extern-crate.stderr b/src/test/ui/pub/pub-reexport-priv-extern-crate.stderr new file mode 100644 index 0000000000000..d298542bd5da3 --- /dev/null +++ b/src/test/ui/pub/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 + +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 + +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 + +error: aborting due to 3 previous errors + diff --git a/src/test/ui/qualified-path-params-2.rs b/src/test/ui/qualified/qualified-path-params-2.rs similarity index 100% rename from src/test/ui/qualified-path-params-2.rs rename to src/test/ui/qualified/qualified-path-params-2.rs diff --git a/src/test/ui/qualified-path-params-2.stderr b/src/test/ui/qualified/qualified-path-params-2.stderr similarity index 100% rename from src/test/ui/qualified-path-params-2.stderr rename to src/test/ui/qualified/qualified-path-params-2.stderr diff --git a/src/test/compile-fail/qualified-path-params.rs b/src/test/ui/qualified/qualified-path-params.rs similarity index 100% rename from src/test/compile-fail/qualified-path-params.rs rename to src/test/ui/qualified/qualified-path-params.rs diff --git a/src/test/ui/qualified/qualified-path-params.stderr b/src/test/ui/qualified/qualified-path-params.stderr new file mode 100644 index 0000000000000..e76c373eec5a0 --- /dev/null +++ b/src/test/ui/qualified/qualified-path-params.stderr @@ -0,0 +1,19 @@ +error[E0533]: expected unit struct/variant or constant, found method `<::A>::f` + --> $DIR/qualified-path-params.rs:30:9 + | +LL | ::A::f:: => {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0029]: only char and numeric types are allowed in range patterns + --> $DIR/qualified-path-params.rs:32:15 + | +LL | 0 ..= ::A::f:: => {} //~ 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::} + +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/question-mark-type-infer.rs similarity index 100% rename from src/test/compile-fail/question-mark-type-infer.rs rename to src/test/ui/question-mark-type-infer.rs diff --git a/src/test/ui/question-mark-type-infer.stderr b/src/test/ui/question-mark-type-infer.stderr new file mode 100644 index 0000000000000..53848ed072772 --- /dev/null +++ b/src/test/ui/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/quote-with-interpolated.rs similarity index 100% rename from src/test/compile-fail/quote-with-interpolated.rs rename to src/test/ui/quote-with-interpolated.rs diff --git a/src/test/ui/quote-with-interpolated.stderr b/src/test/ui/quote-with-interpolated.stderr new file mode 100644 index 0000000000000..10b3fc0a9ae80 --- /dev/null +++ b/src/test/ui/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/range/range-1.rs similarity index 100% rename from src/test/compile-fail/range-1.rs rename to src/test/ui/range/range-1.rs diff --git a/src/test/ui/range/range-1.stderr b/src/test/ui/range/range-1.stderr new file mode 100644 index 0000000000000..2e83bab4e8d9b --- /dev/null +++ b/src/test/ui/range/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` + +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 + = 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/ui/range-inclusive-pattern-precedence.rs b/src/test/ui/range/range-inclusive-pattern-precedence.rs similarity index 100% rename from src/test/ui/range-inclusive-pattern-precedence.rs rename to src/test/ui/range/range-inclusive-pattern-precedence.rs diff --git a/src/test/ui/range-inclusive-pattern-precedence.stderr b/src/test/ui/range/range-inclusive-pattern-precedence.stderr similarity index 100% rename from src/test/ui/range-inclusive-pattern-precedence.stderr rename to src/test/ui/range/range-inclusive-pattern-precedence.stderr diff --git a/src/test/compile-fail/range_traits-1.rs b/src/test/ui/range/range_traits-1.rs similarity index 100% rename from src/test/compile-fail/range_traits-1.rs rename to src/test/ui/range/range_traits-1.rs diff --git a/src/test/ui/range/range_traits-1.stderr b/src/test/ui/range/range_traits-1.stderr new file mode 100644 index 0000000000000..ee72dfe13d44e --- /dev/null +++ b/src/test/ui/range/range_traits-1.stderr @@ -0,0 +1,105 @@ +error[E0277]: can't compare `std::ops::Range` with `std::ops::Range` + --> $DIR/range_traits-1.rs:15:5 + | +LL | a: Range, + | ^^^^^^^^^^^^^^^ no implementation for `std::ops::Range < std::ops::Range` and `std::ops::Range > std::ops::Range` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::Range` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: can't compare `std::ops::RangeTo` with `std::ops::RangeTo` + --> $DIR/range_traits-1.rs:18:5 + | +LL | b: RangeTo, + | ^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeTo < std::ops::RangeTo` and `std::ops::RangeTo > std::ops::RangeTo` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeTo` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: can't compare `std::ops::RangeFrom` with `std::ops::RangeFrom` + --> $DIR/range_traits-1.rs:21:5 + | +LL | c: RangeFrom, + | ^^^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeFrom < std::ops::RangeFrom` and `std::ops::RangeFrom > std::ops::RangeFrom` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeFrom` + = 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` with `std::ops::RangeInclusive` + --> $DIR/range_traits-1.rs:27:5 + | +LL | e: RangeInclusive, + | ^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeInclusive < std::ops::RangeInclusive` and `std::ops::RangeInclusive > std::ops::RangeInclusive` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeInclusive` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: can't compare `std::ops::RangeToInclusive` with `std::ops::RangeToInclusive` + --> $DIR/range_traits-1.rs:30:5 + | +LL | f: RangeToInclusive, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ no implementation for `std::ops::RangeToInclusive < std::ops::RangeToInclusive` and `std::ops::RangeToInclusive > std::ops::RangeToInclusive` + | + = help: the trait `std::cmp::PartialOrd` is not implemented for `std::ops::RangeToInclusive` + = note: required by `std::cmp::PartialOrd::partial_cmp` + +error[E0277]: the trait bound `std::ops::Range: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:15:5 + | +LL | a: Range, + | ^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::Range` + | + = note: required by `std::cmp::Ord::cmp` + +error[E0277]: the trait bound `std::ops::RangeTo: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:18:5 + | +LL | b: RangeTo, + | ^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeTo` + | + = note: required by `std::cmp::Ord::cmp` + +error[E0277]: the trait bound `std::ops::RangeFrom: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:21:5 + | +LL | c: RangeFrom, + | ^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeFrom` + | + = 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: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:27:5 + | +LL | e: RangeInclusive, + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeInclusive` + | + = note: required by `std::cmp::Ord::cmp` + +error[E0277]: the trait bound `std::ops::RangeToInclusive: std::cmp::Ord` is not satisfied + --> $DIR/range_traits-1.rs:30:5 + | +LL | f: RangeToInclusive, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::cmp::Ord` is not implemented for `std::ops::RangeToInclusive` + | + = 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/range/range_traits-2.rs similarity index 100% rename from src/test/compile-fail/range_traits-2.rs rename to src/test/ui/range/range_traits-2.rs diff --git a/src/test/ui/range/range_traits-2.stderr b/src/test/ui/range/range_traits-2.stderr new file mode 100644 index 0000000000000..0151ede2164f4 --- /dev/null +++ b/src/test/ui/range/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); + | ------------ 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/range/range_traits-3.rs similarity index 100% rename from src/test/compile-fail/range_traits-3.rs rename to src/test/ui/range/range_traits-3.rs diff --git a/src/test/ui/range/range_traits-3.stderr b/src/test/ui/range/range_traits-3.stderr new file mode 100644 index 0000000000000..a625fda2bc204 --- /dev/null +++ b/src/test/ui/range/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); + | ---------------- 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/range/range_traits-4.rs similarity index 100% rename from src/test/compile-fail/range_traits-4.rs rename to src/test/ui/range/range_traits-4.rs diff --git a/src/test/ui/range/range_traits-4.stderr b/src/test/ui/range/range_traits-4.stderr new file mode 100644 index 0000000000000..cf8ae671ffc74 --- /dev/null +++ b/src/test/ui/range/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/range/range_traits-5.rs similarity index 100% rename from src/test/compile-fail/range_traits-5.rs rename to src/test/ui/range/range_traits-5.rs diff --git a/src/test/ui/range/range_traits-5.stderr b/src/test/ui/range/range_traits-5.stderr new file mode 100644 index 0000000000000..eadb3a08ba02a --- /dev/null +++ b/src/test/ui/range/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/range/range_traits-6.rs similarity index 100% rename from src/test/compile-fail/range_traits-6.rs rename to src/test/ui/range/range_traits-6.rs diff --git a/src/test/ui/range/range_traits-6.stderr b/src/test/ui/range/range_traits-6.stderr new file mode 100644 index 0000000000000..9470540cc5fde --- /dev/null +++ b/src/test/ui/range/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); + | --------------------- 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/range/range_traits-7.rs similarity index 100% rename from src/test/compile-fail/range_traits-7.rs rename to src/test/ui/range/range_traits-7.rs diff --git a/src/test/ui/range/range_traits-7.stderr b/src/test/ui/range/range_traits-7.stderr new file mode 100644 index 0000000000000..516667a11cd34 --- /dev/null +++ b/src/test/ui/range/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/ui/raw-literal-keywords.rs b/src/test/ui/raw/raw-literal-keywords.rs similarity index 100% rename from src/test/ui/raw-literal-keywords.rs rename to src/test/ui/raw/raw-literal-keywords.rs diff --git a/src/test/ui/raw-literal-keywords.stderr b/src/test/ui/raw/raw-literal-keywords.stderr similarity index 100% rename from src/test/ui/raw-literal-keywords.stderr rename to src/test/ui/raw/raw-literal-keywords.stderr diff --git a/src/test/ui/raw-literal-self.rs b/src/test/ui/raw/raw-literal-self.rs similarity index 100% rename from src/test/ui/raw-literal-self.rs rename to src/test/ui/raw/raw-literal-self.rs diff --git a/src/test/ui/raw-literal-self.stderr b/src/test/ui/raw/raw-literal-self.stderr similarity index 100% rename from src/test/ui/raw-literal-self.stderr rename to src/test/ui/raw/raw-literal-self.stderr diff --git a/src/test/ui/raw-literal-underscore.rs b/src/test/ui/raw/raw-literal-underscore.rs similarity index 100% rename from src/test/ui/raw-literal-underscore.rs rename to src/test/ui/raw/raw-literal-underscore.rs diff --git a/src/test/ui/raw-literal-underscore.stderr b/src/test/ui/raw/raw-literal-underscore.stderr similarity index 100% rename from src/test/ui/raw-literal-underscore.stderr rename to src/test/ui/raw/raw-literal-underscore.stderr diff --git a/src/test/ui/raw_string.rs b/src/test/ui/raw/raw_string.rs similarity index 100% rename from src/test/ui/raw_string.rs rename to src/test/ui/raw/raw_string.rs diff --git a/src/test/ui/raw_string.stderr b/src/test/ui/raw/raw_string.stderr similarity index 100% rename from src/test/ui/raw_string.stderr rename to src/test/ui/raw/raw_string.stderr diff --git a/src/test/compile-fail/auxiliary/recursive_reexports.rs b/src/test/ui/recursion/auxiliary/recursive_reexports.rs similarity index 100% rename from src/test/compile-fail/auxiliary/recursive_reexports.rs rename to src/test/ui/recursion/auxiliary/recursive_reexports.rs diff --git a/src/test/compile-fail/recursion.rs b/src/test/ui/recursion/recursion.rs similarity index 100% rename from src/test/compile-fail/recursion.rs rename to src/test/ui/recursion/recursion.rs diff --git a/src/test/ui/recursion/recursion.stderr b/src/test/ui/recursion/recursion.stderr new file mode 100644 index 0000000000000..5953e5c408777 --- /dev/null +++ b/src/test/ui/recursion/recursion.stderr @@ -0,0 +1,14 @@ +error: reached the recursion limit while instantiating `test::>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/recursion.rs:22:1 + | +LL | / fn test (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/recursion/recursive-enum.rs similarity index 100% rename from src/test/compile-fail/recursive-enum.rs rename to src/test/ui/recursion/recursive-enum.rs diff --git a/src/test/ui/recursion/recursive-enum.stderr b/src/test/ui/recursion/recursive-enum.stderr new file mode 100644 index 0000000000000..c06058b2b595d --- /dev/null +++ b/src/test/ui/recursion/recursive-enum.stderr @@ -0,0 +1,13 @@ +error[E0072]: recursive type `list` has infinite size + --> $DIR/recursive-enum.rs:11:1 + | +LL | enum list { cons(T, list), 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/recursion/recursive-reexports.rs similarity index 100% rename from src/test/compile-fail/recursive-reexports.rs rename to src/test/ui/recursion/recursive-reexports.rs diff --git a/src/test/ui/recursion/recursive-reexports.stderr b/src/test/ui/recursion/recursive-reexports.stderr new file mode 100644 index 0000000000000..e6b8647a981ad --- /dev/null +++ b/src/test/ui/recursion/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/ui/recursive-requirements.rs b/src/test/ui/recursion/recursive-requirements.rs similarity index 100% rename from src/test/ui/recursive-requirements.rs rename to src/test/ui/recursion/recursive-requirements.rs diff --git a/src/test/ui/recursive-requirements.stderr b/src/test/ui/recursion/recursive-requirements.stderr similarity index 100% rename from src/test/ui/recursive-requirements.stderr rename to src/test/ui/recursion/recursive-requirements.stderr diff --git a/src/test/compile-fail/recursive-static-definition.rs b/src/test/ui/recursion/recursive-static-definition.rs similarity index 100% rename from src/test/compile-fail/recursive-static-definition.rs rename to src/test/ui/recursion/recursive-static-definition.rs diff --git a/src/test/ui/recursion/recursive-static-definition.stderr b/src/test/ui/recursion/recursive-static-definition.stderr new file mode 100644 index 0000000000000..2ab93bfd685c8 --- /dev/null +++ b/src/test/ui/recursion/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/recursion/recursive-types-are-not-uninhabited.rs similarity index 100% rename from src/test/compile-fail/recursive-types-are-not-uninhabited.rs rename to src/test/ui/recursion/recursive-types-are-not-uninhabited.rs diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr new file mode 100644 index 0000000000000..c4d404127601b --- /dev/null +++ b/src/test/ui/recursion/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/ref-suggestion.nll.stderr b/src/test/ui/ref-suggestion.nll.stderr new file mode 100644 index 0000000000000..3fbd497c7aeec --- /dev/null +++ b/src/test/ui/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`, 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`, 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`, 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/ref-suggestion.rs similarity index 100% rename from src/test/compile-fail/ref-suggestion.rs rename to src/test/ui/ref-suggestion.rs diff --git a/src/test/ui/ref-suggestion.stderr b/src/test/ui/ref-suggestion.stderr new file mode 100644 index 0000000000000..63ee203ed24fe --- /dev/null +++ b/src/test/ui/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`, 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`, 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`, 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/refutable-pattern-errors.rs similarity index 100% rename from src/test/compile-fail/refutable-pattern-errors.rs rename to src/test/ui/refutable-pattern-errors.rs diff --git a/src/test/ui/refutable-pattern-errors.stderr b/src/test/ui/refutable-pattern-errors.stderr new file mode 100644 index 0000000000000..c2d5fe001fc10 --- /dev/null +++ b/src/test/ui/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))) { } + | ^^^^^^^^^^^^^^^^^^^^^ 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/refutable-pattern-in-fn-arg.rs similarity index 100% rename from src/test/compile-fail/refutable-pattern-in-fn-arg.rs rename to src/test/ui/refutable-pattern-in-fn-arg.rs diff --git a/src/test/ui/refutable-pattern-in-fn-arg.stderr b/src/test/ui/refutable-pattern-in-fn-arg.stderr new file mode 100644 index 0000000000000..e03532667f502 --- /dev/null +++ b/src/test/ui/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/compile-fail/regions-fn-subtyping-return-static.rs b/src/test/ui/regions-fn-subtyping-return-static-fail.rs similarity index 100% rename from src/test/compile-fail/regions-fn-subtyping-return-static.rs rename to src/test/ui/regions-fn-subtyping-return-static-fail.rs diff --git a/src/test/ui/regions-fn-subtyping-return-static-fail.stderr b/src/test/ui/regions-fn-subtyping-return-static-fail.stderr new file mode 100644 index 0000000000000..ff4d00ae66b7c --- /dev/null +++ b/src/test/ui/regions-fn-subtyping-return-static-fail.stderr @@ -0,0 +1,21 @@ +error[E0308]: mismatched types + --> $DIR/regions-fn-subtyping-return-static-fail.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-fail.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/auxiliary/rbmtp_cross_crate_lib.rs b/src/test/ui/regions/auxiliary/rbmtp_cross_crate_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/rbmtp_cross_crate_lib.rs rename to src/test/ui/regions/auxiliary/rbmtp_cross_crate_lib.rs diff --git a/src/test/ui/regions/region-borrow-params-issue-29793-big.ast.nll.stderr b/src/test/ui/regions/region-borrow-params-issue-29793-big.ast.nll.stderr new file mode 100644 index 0000000000000..5f386e58fac7d --- /dev/null +++ b/src/test/ui/regions/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/regions/region-borrow-params-issue-29793-big.ast.stderr b/src/test/ui/regions/region-borrow-params-issue-29793-big.ast.stderr new file mode 100644 index 0000000000000..23dc39db129ee --- /dev/null +++ b/src/test/ui/regions/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/regions/region-borrow-params-issue-29793-big.mir.stderr b/src/test/ui/regions/region-borrow-params-issue-29793-big.mir.stderr new file mode 100644 index 0000000000000..5f386e58fac7d --- /dev/null +++ b/src/test/ui/regions/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/regions/region-borrow-params-issue-29793-big.rs similarity index 100% rename from src/test/compile-fail/region-borrow-params-issue-29793-big.rs rename to src/test/ui/regions/region-borrow-params-issue-29793-big.rs diff --git a/src/test/ui/region-borrow-params-issue-29793-small.nll.stderr b/src/test/ui/regions/region-borrow-params-issue-29793-small.nll.stderr similarity index 100% rename from src/test/ui/region-borrow-params-issue-29793-small.nll.stderr rename to src/test/ui/regions/region-borrow-params-issue-29793-small.nll.stderr diff --git a/src/test/ui/region-borrow-params-issue-29793-small.rs b/src/test/ui/regions/region-borrow-params-issue-29793-small.rs similarity index 100% rename from src/test/ui/region-borrow-params-issue-29793-small.rs rename to src/test/ui/regions/region-borrow-params-issue-29793-small.rs diff --git a/src/test/ui/region-borrow-params-issue-29793-small.stderr b/src/test/ui/regions/region-borrow-params-issue-29793-small.stderr similarity index 100% rename from src/test/ui/region-borrow-params-issue-29793-small.stderr rename to src/test/ui/regions/region-borrow-params-issue-29793-small.stderr diff --git a/src/test/compile-fail/region-bound-extra-bound-in-inherent-impl.rs b/src/test/ui/regions/region-bound-extra-bound-in-inherent-impl.rs similarity index 100% rename from src/test/compile-fail/region-bound-extra-bound-in-inherent-impl.rs rename to src/test/ui/regions/region-bound-extra-bound-in-inherent-impl.rs diff --git a/src/test/ui/regions/region-bound-extra-bound-in-inherent-impl.stderr b/src/test/ui/regions/region-bound-extra-bound-in-inherent-impl.stderr new file mode 100644 index 0000000000000..585ccf465d8f4 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-bound-on-closure-outlives-call.nll.stderr b/src/test/ui/regions/region-bound-on-closure-outlives-call.nll.stderr new file mode 100644 index 0000000000000..da6ebaaefadf1 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-bound-on-closure-outlives-call.rs similarity index 100% rename from src/test/compile-fail/region-bound-on-closure-outlives-call.rs rename to src/test/ui/regions/region-bound-on-closure-outlives-call.rs diff --git a/src/test/ui/regions/region-bound-on-closure-outlives-call.stderr b/src/test/ui/regions/region-bound-on-closure-outlives-call.stderr new file mode 100644 index 0000000000000..7adf68ee9b6d1 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-bound-same-bounds-in-trait-and-impl.rs similarity index 100% rename from src/test/compile-fail/region-bound-same-bounds-in-trait-and-impl.rs rename to src/test/ui/regions/region-bound-same-bounds-in-trait-and-impl.rs diff --git a/src/test/ui/regions/region-bound-same-bounds-in-trait-and-impl.stderr b/src/test/ui/regions/region-bound-same-bounds-in-trait-and-impl.stderr new file mode 100644 index 0000000000000..ce9dd59bbf525 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-bounds-on-objects-and-type-parameters.rs similarity index 100% rename from src/test/compile-fail/region-bounds-on-objects-and-type-parameters.rs rename to src/test/ui/regions/region-bounds-on-objects-and-type-parameters.rs diff --git a/src/test/ui/regions/region-bounds-on-objects-and-type-parameters.stderr b/src/test/ui/regions/region-bounds-on-objects-and-type-parameters.stderr new file mode 100644 index 0000000000000..7d1a836c67455 --- /dev/null +++ b/src/test/ui/regions/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+'b+'c>, + | ^^ + +error[E0478]: lifetime bound not satisfied + --> $DIR/region-bounds-on-objects-and-type-parameters.rs:31:5 + | +LL | z: Box+'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/regions/region-invariant-static-error-reporting.nll.stderr b/src/test/ui/regions/region-invariant-static-error-reporting.nll.stderr new file mode 100644 index 0000000000000..9fc12ae05b44f --- /dev/null +++ b/src/test/ui/regions/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>, 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/regions/region-invariant-static-error-reporting.rs similarity index 100% rename from src/test/compile-fail/region-invariant-static-error-reporting.rs rename to src/test/ui/regions/region-invariant-static-error-reporting.rs diff --git a/src/test/ui/regions/region-invariant-static-error-reporting.stderr b/src/test/ui/regions/region-invariant-static-error-reporting.stderr new file mode 100644 index 0000000000000..a1f65561d3e3c --- /dev/null +++ b/src/test/ui/regions/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>, 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/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.nll.stderr new file mode 100644 index 0000000000000..9124347831344 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-lifetime-bounds-on-fns-where-clause.rs similarity index 100% rename from src/test/compile-fail/region-lifetime-bounds-on-fns-where-clause.rs rename to src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.rs diff --git a/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-lifetime-bounds-on-fns-where-clause.stderr new file mode 100644 index 0000000000000..0ca7ee8d8a560 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.nll.stderr new file mode 100644 index 0000000000000..655b199fc65a8 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs similarity index 100% rename from src/test/compile-fail/region-multiple-lifetime-bounds-on-fns-where-clause.rs rename to src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.rs diff --git a/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr b/src/test/ui/regions/region-multiple-lifetime-bounds-on-fns-where-clause.stderr new file mode 100644 index 0000000000000..26e24b2ed1626 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-object-lifetime-1.rs similarity index 100% rename from src/test/compile-fail/region-object-lifetime-1.rs rename to src/test/ui/regions/region-object-lifetime-1.rs diff --git a/src/test/ui/regions/region-object-lifetime-1.stderr b/src/test/ui/regions/region-object-lifetime-1.stderr new file mode 100644 index 0000000000000..39deed32c7659 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-object-lifetime-2.nll.stderr b/src/test/ui/regions/region-object-lifetime-2.nll.stderr new file mode 100644 index 0000000000000..4395fee02c4ee --- /dev/null +++ b/src/test/ui/regions/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/regions/region-object-lifetime-2.rs similarity index 100% rename from src/test/compile-fail/region-object-lifetime-2.rs rename to src/test/ui/regions/region-object-lifetime-2.rs diff --git a/src/test/ui/regions/region-object-lifetime-2.stderr b/src/test/ui/regions/region-object-lifetime-2.stderr new file mode 100644 index 0000000000000..e396680f99b4b --- /dev/null +++ b/src/test/ui/regions/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/regions/region-object-lifetime-3.rs similarity index 100% rename from src/test/compile-fail/region-object-lifetime-3.rs rename to src/test/ui/regions/region-object-lifetime-3.rs diff --git a/src/test/ui/regions/region-object-lifetime-3.stderr b/src/test/ui/regions/region-object-lifetime-3.stderr new file mode 100644 index 0000000000000..9431e8f529139 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-object-lifetime-4.nll.stderr b/src/test/ui/regions/region-object-lifetime-4.nll.stderr new file mode 100644 index 0000000000000..7bae6ccb37c92 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-object-lifetime-4.rs similarity index 100% rename from src/test/compile-fail/region-object-lifetime-4.rs rename to src/test/ui/regions/region-object-lifetime-4.rs diff --git a/src/test/ui/regions/region-object-lifetime-4.stderr b/src/test/ui/regions/region-object-lifetime-4.stderr new file mode 100644 index 0000000000000..ef62afbef3bd6 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-object-lifetime-5.nll.stderr b/src/test/ui/regions/region-object-lifetime-5.nll.stderr new file mode 100644 index 0000000000000..3bfa5ec3941a2 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-object-lifetime-5.rs similarity index 100% rename from src/test/compile-fail/region-object-lifetime-5.rs rename to src/test/ui/regions/region-object-lifetime-5.rs diff --git a/src/test/ui/regions/region-object-lifetime-5.stderr b/src/test/ui/regions/region-object-lifetime-5.stderr new file mode 100644 index 0000000000000..2dbdacfacdcc0 --- /dev/null +++ b/src/test/ui/regions/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/regions/region-object-lifetime-in-coercion.nll.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.nll.stderr new file mode 100644 index 0000000000000..87a0a3267ef8a --- /dev/null +++ b/src/test/ui/regions/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 = 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 { + | ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]` +LL | let x: Box = 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 { + | _________-----________________________^ + | | | + | | 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 { + | _________-----______________^ + | | | + | | 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 { + | ______--_--______________________________^ + | | | | + | | | 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/regions/region-object-lifetime-in-coercion.rs similarity index 100% rename from src/test/compile-fail/region-object-lifetime-in-coercion.rs rename to src/test/ui/regions/region-object-lifetime-in-coercion.rs diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr new file mode 100644 index 0000000000000..ac8c4d3a16af7 --- /dev/null +++ b/src/test/ui/regions/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 { + | ----- help: add explicit lifetime `'static` to the type of `v`: `&'static [u8]` +LL | let x: Box = 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 { + | ----- 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 { + | ----- 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 { + | ^^ + = 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 { + | ^^ + = note: ...so that the expression is assignable: + expected std::boxed::Box<(dyn Foo + 'b)> + found std::boxed::Box + +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/regions/regions-addr-of-arg.nll.stderr b/src/test/ui/regions/regions-addr-of-arg.nll.stderr new file mode 100644 index 0000000000000..9bfc80c94595a --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-addr-of-arg.rs similarity index 100% rename from src/test/compile-fail/regions-addr-of-arg.rs rename to src/test/ui/regions/regions-addr-of-arg.rs diff --git a/src/test/ui/regions/regions-addr-of-arg.stderr b/src/test/ui/regions/regions-addr-of-arg.stderr new file mode 100644 index 0000000000000..9158a4ac7a74c --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-addr-of-self.nll.stderr b/src/test/ui/regions/regions-addr-of-self.nll.stderr new file mode 100644 index 0000000000000..cad1384f198f7 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-addr-of-self.rs similarity index 100% rename from src/test/compile-fail/regions-addr-of-self.rs rename to src/test/ui/regions/regions-addr-of-self.rs diff --git a/src/test/ui/regions/regions-addr-of-self.stderr b/src/test/ui/regions/regions-addr-of-self.stderr new file mode 100644 index 0000000000000..387aeeb8a5bb5 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-addr-of-upvar-self.nll.stderr b/src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr new file mode 100644 index 0000000000000..0ee86172368cf --- /dev/null +++ b/src/test/ui/regions/regions-addr-of-upvar-self.nll.stderr @@ -0,0 +1,40 @@ +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 = || { + | -- lifetime `'1` represents this closure's body +LL | let p: &'static mut usize = &mut self.food; //~ ERROR cannot infer + | ^^^^^^^^^^^^^^ requires that `'1` must outlive `'static` + | + = note: closure implements `FnMut`, so references to captured variables can't escape the closure + +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/regions/regions-addr-of-upvar-self.rs similarity index 100% rename from src/test/compile-fail/regions-addr-of-upvar-self.rs rename to src/test/ui/regions/regions-addr-of-upvar-self.rs diff --git a/src/test/ui/regions/regions-addr-of-upvar-self.stderr b/src/test/ui/regions/regions-addr-of-upvar-self.stderr new file mode 100644 index 0000000000000..35e721288cdda --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-adjusted-lvalue-op.nll.stderr b/src/test/ui/regions/regions-adjusted-lvalue-op.nll.stderr new file mode 100644 index 0000000000000..f342155c8b141 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-adjusted-lvalue-op.rs similarity index 100% rename from src/test/compile-fail/regions-adjusted-lvalue-op.rs rename to src/test/ui/regions/regions-adjusted-lvalue-op.rs diff --git a/src/test/ui/regions/regions-adjusted-lvalue-op.stderr b/src/test/ui/regions/regions-adjusted-lvalue-op.stderr new file mode 100644 index 0000000000000..95228d9ccbbae --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-assoc-type-in-supertrait-outlives-container.rs similarity index 98% rename from src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs rename to src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs index f2ff877cd8236..96eb65daaffef 100644 --- a/src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs +++ b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that we are imposing the requirement that every associated // type of a bound that appears in the where clause on a struct must // outlive the location in which the type appears, even when the diff --git a/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.stderr b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.stderr new file mode 100644 index 0000000000000..7b7881d6ea7ca --- /dev/null +++ b/src/test/ui/regions/regions-assoc-type-in-supertrait-outlives-container.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a WithAssoc>`, reference has a longer lifetime than the data it references + --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:52:12 + | +LL | let _: &'a WithAssoc> = loop { }; //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 46:15 + --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:46: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 46:18 + --> $DIR/regions-assoc-type-in-supertrait-outlives-container.rs:46: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/regions/regions-assoc-type-region-bound-in-trait-not-met.rs similarity index 100% rename from src/test/compile-fail/regions-assoc-type-region-bound-in-trait-not-met.rs rename to src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.rs diff --git a/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr new file mode 100644 index 0000000000000..2261e92166e2b --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-assoc-type-static-bound-in-trait-not-met.rs similarity index 100% rename from src/test/compile-fail/regions-assoc-type-static-bound-in-trait-not-met.rs rename to src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.rs diff --git a/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr new file mode 100644 index 0000000000000..a7ae685c3a4f7 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-bounded-by-trait-requiring-static.rs similarity index 98% rename from src/test/compile-fail/regions-bounded-by-trait-requiring-static.rs rename to src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs index 19c50d57e1b39..8a15656f8a721 100644 --- a/src/test/compile-fail/regions-bounded-by-trait-requiring-static.rs +++ b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test which of the builtin types are considered sendable. The tests // in this file all test region bound and lifetime violations that are // detected during type check. diff --git a/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr b/src/test/ui/regions/regions-bounded-by-trait-requiring-static.stderr new file mode 100644 index 0000000000000..2cd82707a2af4 --- /dev/null +++ b/src/test/ui/regions/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:34: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:38: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:42: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:56:5 + | +LL | assert_send::>(); //~ 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:67: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:71: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/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.nll.stderr new file mode 100644 index 0000000000000..553eedec398ce --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-bounded-method-type-parameters-cross-crate.rs similarity index 100% rename from src/test/compile-fail/regions-bounded-method-type-parameters-cross-crate.rs rename to src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.rs diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-cross-crate.stderr new file mode 100644 index 0000000000000..898629d8ab982 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.nll.stderr new file mode 100644 index 0000000000000..adcf4921e539d --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-bounded-method-type-parameters-trait-bound.rs similarity index 100% rename from src/test/compile-fail/regions-bounded-method-type-parameters-trait-bound.rs rename to src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.rs diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters-trait-bound.stderr new file mode 100644 index 0000000000000..f9f9c38b1b617 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-bounded-method-type-parameters.rs similarity index 96% rename from src/test/compile-fail/regions-bounded-method-type-parameters.rs rename to src/test/ui/regions/regions-bounded-method-type-parameters.rs index da4e8231a239f..b53c80c39630a 100644 --- a/src/test/compile-fail/regions-bounded-method-type-parameters.rs +++ b/src/test/ui/regions/regions-bounded-method-type-parameters.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Check that explicit region bounds are allowed on the various // nominal types (but not on other types) and that they are type // checked. diff --git a/src/test/ui/regions/regions-bounded-method-type-parameters.stderr b/src/test/ui/regions/regions-bounded-method-type-parameters.stderr new file mode 100644 index 0000000000000..b8953a1719c01 --- /dev/null +++ b/src/test/ui/regions/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:24: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/regions/regions-bounds.nll.stderr b/src/test/ui/regions/regions-bounds.nll.stderr new file mode 100644 index 0000000000000..4d4a30a88c63e --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-bounds.rs similarity index 100% rename from src/test/compile-fail/regions-bounds.rs rename to src/test/ui/regions/regions-bounds.rs diff --git a/src/test/ui/regions/regions-bounds.stderr b/src/test/ui/regions/regions-bounds.stderr new file mode 100644 index 0000000000000..7d5a47c0df39e --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-close-associated-type-into-object.nll.stderr b/src/test/ui/regions/regions-close-associated-type-into-object.nll.stderr new file mode 100644 index 0000000000000..5bec650a41d11 --- /dev/null +++ b/src/test/ui/regions/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 `::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 `::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 `::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 `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +error[E0310]: the associated type `::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:25:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `::Item: 'static`... + +error[E0310]: the associated type `::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:32:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `::Item: 'static`... + +error[E0309]: the associated type `::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:38:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `::Item: 'a`... + +error[E0309]: the associated type `::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:45:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `::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/regions/regions-close-associated-type-into-object.rs similarity index 100% rename from src/test/compile-fail/regions-close-associated-type-into-object.rs rename to src/test/ui/regions/regions-close-associated-type-into-object.rs diff --git a/src/test/ui/regions/regions-close-associated-type-into-object.stderr b/src/test/ui/regions/regions-close-associated-type-into-object.stderr new file mode 100644 index 0000000000000..9d56de4c152e7 --- /dev/null +++ b/src/test/ui/regions/regions-close-associated-type-into-object.stderr @@ -0,0 +1,56 @@ +error[E0310]: the associated type `::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:25:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `::Item: 'static`... +note: ...so that the type `::Item` will meet its required lifetime bounds + --> $DIR/regions-close-associated-type-into-object.rs:25:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +error[E0310]: the associated type `::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:32:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `::Item: 'static`... +note: ...so that the type `std::boxed::Box<::Item>` will meet its required lifetime bounds + --> $DIR/regions-close-associated-type-into-object.rs:32:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +error[E0309]: the associated type `::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:38:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `::Item: 'a`... +note: ...so that the type `::Item` will meet its required lifetime bounds + --> $DIR/regions-close-associated-type-into-object.rs:38:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + +error[E0309]: the associated type `::Item` may not live long enough + --> $DIR/regions-close-associated-type-into-object.rs:45:5 + | +LL | Box::new(item) //~ ERROR associated type `::Item` may not live long enough + | ^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `::Item: 'a`... +note: ...so that the type `std::boxed::Box<::Item>` will meet its required lifetime bounds + --> $DIR/regions-close-associated-type-into-object.rs:45:5 + | +LL | Box::new(item) //~ ERROR associated type `::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/regions/regions-close-object-into-object-1.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-1.nll.stderr new file mode 100644 index 0000000000000..84e486872a705 --- /dev/null +++ b/src/test/ui/regions/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 //~ 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/regions/regions-close-object-into-object-1.rs similarity index 100% rename from src/test/compile-fail/regions-close-object-into-object-1.rs rename to src/test/ui/regions/regions-close-object-into-object-1.rs diff --git a/src/test/ui/regions/regions-close-object-into-object-1.stderr b/src/test/ui/regions/regions-close-object-into-object-1.stderr new file mode 100644 index 0000000000000..bd05a63c3984e --- /dev/null +++ b/src/test/ui/regions/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 //~ 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/regions/regions-close-object-into-object-2.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-2.nll.stderr new file mode 100644 index 0000000000000..5258dbe793ae2 --- /dev/null +++ b/src/test/ui/regions/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 //~ 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>) -> Box { + | ______--_________________________________________________^ + | | | + | | lifetime `'a` defined here +LL | | box B(&*v) as Box //~ 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 //~ 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/regions/regions-close-object-into-object-2.rs similarity index 100% rename from src/test/compile-fail/regions-close-object-into-object-2.rs rename to src/test/ui/regions/regions-close-object-into-object-2.rs diff --git a/src/test/ui/regions/regions-close-object-into-object-2.stderr b/src/test/ui/regions/regions-close-object-into-object-2.stderr new file mode 100644 index 0000000000000..b2e44cd2c77e3 --- /dev/null +++ b/src/test/ui/regions/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 //~ 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>) -> Box { + | ^^ +note: ...so that the type `(dyn A + 'a)` is not borrowed for too long + --> $DIR/regions-close-object-into-object-2.rs:20:11 + | +LL | box B(&*v) as Box //~ 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 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-close-object-into-object-3.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-3.nll.stderr new file mode 100644 index 0000000000000..62504ab8d8025 --- /dev/null +++ b/src/test/ui/regions/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 //~ 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/regions/regions-close-object-into-object-3.rs similarity index 100% rename from src/test/compile-fail/regions-close-object-into-object-3.rs rename to src/test/ui/regions/regions-close-object-into-object-3.rs diff --git a/src/test/ui/regions/regions-close-object-into-object-3.stderr b/src/test/ui/regions/regions-close-object-into-object-3.stderr new file mode 100644 index 0000000000000..9e412e50da993 --- /dev/null +++ b/src/test/ui/regions/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 //~ 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/regions/regions-close-object-into-object-4.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-4.nll.stderr new file mode 100644 index 0000000000000..62146778f68a2 --- /dev/null +++ b/src/test/ui/regions/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 //~ 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 //~ 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 //~ 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 //~ 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 //~ 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>) -> Box { + | ______--___________________________________________^ + | | | + | | lifetime `'a` defined here +LL | | box B(&*v) as Box //~ 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 //~ 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 //~ 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 //~ 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/regions/regions-close-object-into-object-4.rs similarity index 100% rename from src/test/compile-fail/regions-close-object-into-object-4.rs rename to src/test/ui/regions/regions-close-object-into-object-4.rs diff --git a/src/test/ui/regions/regions-close-object-into-object-4.stderr b/src/test/ui/regions/regions-close-object-into-object-4.stderr new file mode 100644 index 0000000000000..15e53f1b54de5 --- /dev/null +++ b/src/test/ui/regions/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 //~ 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>) -> Box { + | ^^ +note: ...so that the type `(dyn A + 'a)` is not borrowed for too long + --> $DIR/regions-close-object-into-object-4.rs:20:11 + | +LL | box B(&*v) as Box //~ 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 + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr b/src/test/ui/regions/regions-close-object-into-object-5.nll.stderr new file mode 100644 index 0000000000000..d7f9253d0b4d2 --- /dev/null +++ b/src/test/ui/regions/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 + | ^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-5.rs:27:11 + | +LL | box B(&*v) as Box + | ^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | box B(&*v) as Box + | ^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | box B(&*v) as Box + | ^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-object-into-object-5.rs:27:5 + | +LL | box B(&*v) as Box + | ^^^^^^^^^^ + +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 + | ^^^^^^^^^^ + | + = 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 + | ^^^^^^ + | + = 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 + | ^^^ 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/regions/regions-close-object-into-object-5.rs similarity index 100% rename from src/test/compile-fail/regions-close-object-into-object-5.rs rename to src/test/ui/regions/regions-close-object-into-object-5.rs diff --git a/src/test/ui/regions/regions-close-object-into-object-5.stderr b/src/test/ui/regions/regions-close-object-into-object-5.stderr new file mode 100644 index 0000000000000..2c3cc603e04c7 --- /dev/null +++ b/src/test/ui/regions/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+'static>) -> Box { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box + | ^^^^^^^^^^ + | +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 + | ^^^^^^^^^^ + +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+'static>) -> Box { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box + | ^^^^^^^^^^^^^^^^^^^^ + | +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 + | ^^^^^^^^^^^^^^^^^^^^ + +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+'static>) -> Box { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box + | ^ + | +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 + | ^ + +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+'static>) -> Box { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box + | ^^^^^^ + | +note: ...so that the reference type `&dyn A` does not outlive the data it points at + --> $DIR/regions-close-object-into-object-5.rs:27:9 + | +LL | box B(&*v) as Box + | ^^^^^^ + +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+'static>) -> Box { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box + | ^^^^^^ + | +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 + | ^^^^^^ + +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+'static>) -> Box { + | - help: consider adding an explicit lifetime bound `T: 'static`... +LL | // oh dear! +LL | box B(&*v) as Box + | ^^^ + | +note: ...so that the type `(dyn A + 'static)` is not borrowed for too long + --> $DIR/regions-close-object-into-object-5.rs:27:11 + | +LL | box B(&*v) as Box + | ^^^ + +error: aborting due to 6 previous errors + +For more information about this error, try `rustc --explain E0310`. diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr b/src/test/ui/regions/regions-close-over-type-parameter-1.nll.stderr new file mode 100644 index 0000000000000..ff74d46b011ff --- /dev/null +++ b/src/test/ui/regions/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 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-over-type-parameter-1.rs:20:5 + | +LL | box v as Box + | ^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-over-type-parameter-1.rs:30:5 + | +LL | box v as Box + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-close-over-type-parameter-1.rs:30:5 + | +LL | box v as Box + | ^^^^^ + +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 + | ^^^^^ + | + = 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 + | ^^^^^ + | + = 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/regions/regions-close-over-type-parameter-1.rs similarity index 100% rename from src/test/compile-fail/regions-close-over-type-parameter-1.rs rename to src/test/ui/regions/regions-close-over-type-parameter-1.rs diff --git a/src/test/ui/regions/regions-close-over-type-parameter-1.stderr b/src/test/ui/regions/regions-close-over-type-parameter-1.stderr new file mode 100644 index 0000000000000..9158cf2683808 --- /dev/null +++ b/src/test/ui/regions/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(v: A) -> Box { + | -- help: consider adding an explicit lifetime bound `A: 'static`... +LL | box v as Box + | ^^^^^ + | +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 + | ^^^^^ + +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(v: A) -> Box { + | -- help: consider adding an explicit lifetime bound `A: 'static`... +LL | box v as Box + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +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 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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 { + | -- help: consider adding an explicit lifetime bound `A: 'b`... +LL | box v as Box + | ^^^^^ + | +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 + | ^^^^^ + +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 { + | -- help: consider adding an explicit lifetime bound `A: 'b`... +LL | box v as Box + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +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 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/regions/regions-close-over-type-parameter-multiple.nll.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.nll.stderr new file mode 100644 index 0000000000000..9e0dd9da0e4bf --- /dev/null +++ b/src/test/ui/regions/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 //~ 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 //~ 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/regions/regions-close-over-type-parameter-multiple.rs similarity index 100% rename from src/test/compile-fail/regions-close-over-type-parameter-multiple.rs rename to src/test/ui/regions/regions-close-over-type-parameter-multiple.rs diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr new file mode 100644 index 0000000000000..f85041e8cedea --- /dev/null +++ b/src/test/ui/regions/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 //~ 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 { + | ^^ +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 //~ 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 { + | ^^ + = note: ...so that the expression is assignable: + expected std::boxed::Box<(dyn SomeTrait + 'c)> + found std::boxed::Box + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0495`. diff --git a/src/test/ui/regions/regions-close-param-into-object.nll.stderr b/src/test/ui/regions/regions-close-param-into-object.nll.stderr new file mode 100644 index 0000000000000..260a4067e100d --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-close-param-into-object.rs similarity index 100% rename from src/test/compile-fail/regions-close-param-into-object.rs rename to src/test/ui/regions/regions-close-param-into-object.rs diff --git a/src/test/ui/regions/regions-close-param-into-object.stderr b/src/test/ui/regions/regions-close-param-into-object.stderr new file mode 100644 index 0000000000000..72ed7ac944803 --- /dev/null +++ b/src/test/ui/regions/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(v: T) -> Box + | - 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(v: Box) -> Box + | - 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` 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 + | - 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) -> Box + | - 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` 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/regions/regions-creating-enums.nll.stderr b/src/test/ui/regions/regions-creating-enums.nll.stderr new file mode 100644 index 0000000000000..58dff9c6c37c7 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-creating-enums.rs similarity index 100% rename from src/test/compile-fail/regions-creating-enums.rs rename to src/test/ui/regions/regions-creating-enums.rs diff --git a/src/test/ui/regions/regions-creating-enums.stderr b/src/test/ui/regions/regions-creating-enums.stderr new file mode 100644 index 0000000000000..7b0847739d7f5 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-creating-enums3.nll.stderr b/src/test/ui/regions/regions-creating-enums3.nll.stderr new file mode 100644 index 0000000000000..9b327100667fa --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-creating-enums3.rs similarity index 100% rename from src/test/compile-fail/regions-creating-enums3.rs rename to src/test/ui/regions/regions-creating-enums3.rs diff --git a/src/test/ui/regions/regions-creating-enums3.stderr b/src/test/ui/regions/regions-creating-enums3.stderr new file mode 100644 index 0000000000000..b2cca9a3c627d --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-creating-enums4.nll.stderr b/src/test/ui/regions/regions-creating-enums4.nll.stderr new file mode 100644 index 0000000000000..6a3554b41a77d --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-creating-enums4.rs similarity index 100% rename from src/test/compile-fail/regions-creating-enums4.rs rename to src/test/ui/regions/regions-creating-enums4.rs diff --git a/src/test/ui/regions/regions-creating-enums4.stderr b/src/test/ui/regions/regions-creating-enums4.stderr new file mode 100644 index 0000000000000..729dc2f107a4f --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-early-bound-error-method.nll.stderr b/src/test/ui/regions/regions-early-bound-error-method.nll.stderr new file mode 100644 index 0000000000000..0319d63d596d6 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-early-bound-error-method.rs similarity index 100% rename from src/test/compile-fail/regions-early-bound-error-method.rs rename to src/test/ui/regions/regions-early-bound-error-method.rs diff --git a/src/test/ui/regions/regions-early-bound-error-method.stderr b/src/test/ui/regions/regions-early-bound-error-method.stderr new file mode 100644 index 0000000000000..6c542ef5ddfbf --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-early-bound-error.nll.stderr b/src/test/ui/regions/regions-early-bound-error.nll.stderr new file mode 100644 index 0000000000000..b19de2201f70c --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-early-bound-error.rs similarity index 100% rename from src/test/compile-fail/regions-early-bound-error.rs rename to src/test/ui/regions/regions-early-bound-error.rs diff --git a/src/test/ui/regions/regions-early-bound-error.stderr b/src/test/ui/regions/regions-early-bound-error.stderr new file mode 100644 index 0000000000000..579a7c91e437e --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-enum-not-wf.rs similarity index 100% rename from src/test/compile-fail/regions-enum-not-wf.rs rename to src/test/ui/regions/regions-enum-not-wf.rs diff --git a/src/test/ui/regions/regions-enum-not-wf.stderr b/src/test/ui/regions/regions-enum-not-wf.stderr new file mode 100644 index 0000000000000..381a8aada5a3f --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-escape-method.nll.stderr b/src/test/ui/regions/regions-escape-method.nll.stderr new file mode 100644 index 0000000000000..aedb93032bd5d --- /dev/null +++ b/src/test/ui/regions/regions-escape-method.nll.stderr @@ -0,0 +1,17 @@ +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` + | || + | |return type of closure is &'2 i32 + | has type `&'1 i32` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-escape-method.rs b/src/test/ui/regions/regions-escape-method.rs similarity index 100% rename from src/test/compile-fail/regions-escape-method.rs rename to src/test/ui/regions/regions-escape-method.rs diff --git a/src/test/ui/regions/regions-escape-method.stderr b/src/test/ui/regions/regions-escape-method.stderr new file mode 100644 index 0000000000000..fb0bf845f3bd8 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-escape-via-trait-or-not.nll.stderr b/src/test/ui/regions/regions-escape-via-trait-or-not.nll.stderr new file mode 100644 index 0000000000000..e2a05a141a826 --- /dev/null +++ b/src/test/ui/regions/regions-escape-via-trait-or-not.nll.stderr @@ -0,0 +1,17 @@ +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` + | || + | |return type of closure is &'2 isize + | has type `&'1 isize` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-escape-via-trait-or-not.rs b/src/test/ui/regions/regions-escape-via-trait-or-not.rs similarity index 100% rename from src/test/compile-fail/regions-escape-via-trait-or-not.rs rename to src/test/ui/regions/regions-escape-via-trait-or-not.rs diff --git a/src/test/ui/regions/regions-escape-via-trait-or-not.stderr b/src/test/ui/regions/regions-escape-via-trait-or-not.stderr new file mode 100644 index 0000000000000..60bd14ba4d79c --- /dev/null +++ b/src/test/ui/regions/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/ui/regions-fn-subtyping-return-static.rs b/src/test/ui/regions/regions-fn-subtyping-return-static.rs similarity index 100% rename from src/test/ui/regions-fn-subtyping-return-static.rs rename to src/test/ui/regions/regions-fn-subtyping-return-static.rs diff --git a/src/test/ui/regions-fn-subtyping-return-static.stderr b/src/test/ui/regions/regions-fn-subtyping-return-static.stderr similarity index 100% rename from src/test/ui/regions-fn-subtyping-return-static.stderr rename to src/test/ui/regions/regions-fn-subtyping-return-static.stderr diff --git a/src/test/compile-fail/regions-free-region-ordering-callee-4.rs b/src/test/ui/regions/regions-free-region-ordering-callee-4.rs similarity index 100% rename from src/test/compile-fail/regions-free-region-ordering-callee-4.rs rename to src/test/ui/regions/regions-free-region-ordering-callee-4.rs diff --git a/src/test/ui/regions/regions-free-region-ordering-callee-4.stderr b/src/test/ui/regions/regions-free-region-ordering-callee-4.stderr new file mode 100644 index 0000000000000..70970a9cf3b7a --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-free-region-ordering-callee.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-callee.nll.stderr new file mode 100644 index 0000000000000..25f2e1a56573b --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-free-region-ordering-callee.rs similarity index 100% rename from src/test/compile-fail/regions-free-region-ordering-callee.rs rename to src/test/ui/regions/regions-free-region-ordering-callee.rs diff --git a/src/test/ui/regions/regions-free-region-ordering-callee.stderr b/src/test/ui/regions/regions-free-region-ordering-callee.stderr new file mode 100644 index 0000000000000..13d94f91c6d84 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-free-region-ordering-caller.rs similarity index 97% rename from src/test/compile-fail/regions-free-region-ordering-caller.rs rename to src/test/ui/regions/regions-free-region-ordering-caller.rs index 66b16744cc7df..ee6cd6c4b1523 100644 --- a/src/test/compile-fail/regions-free-region-ordering-caller.rs +++ b/src/test/ui/regions/regions-free-region-ordering-caller.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test various ways to construct a pointer with a longer lifetime // than the thing it points at and ensure that they result in // errors. See also regions-free-region-ordering-callee.rs diff --git a/src/test/ui/regions/regions-free-region-ordering-caller.stderr b/src/test/ui/regions/regions-free-region-ordering-caller.stderr new file mode 100644 index 0000000000000..96502b69c0819 --- /dev/null +++ b/src/test/ui/regions/regions-free-region-ordering-caller.stderr @@ -0,0 +1,32 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-free-region-ordering-caller.rs:20: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:25: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:29: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/regions/regions-free-region-ordering-caller1.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-caller1.nll.stderr new file mode 100644 index 0000000000000..acf7a033ade17 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-free-region-ordering-caller1.rs similarity index 100% rename from src/test/compile-fail/regions-free-region-ordering-caller1.rs rename to src/test/ui/regions/regions-free-region-ordering-caller1.rs diff --git a/src/test/ui/regions/regions-free-region-ordering-caller1.stderr b/src/test/ui/regions/regions-free-region-ordering-caller1.stderr new file mode 100644 index 0000000000000..c0dff6ec384e5 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-free-region-ordering-incorrect.nll.stderr b/src/test/ui/regions/regions-free-region-ordering-incorrect.nll.stderr new file mode 100644 index 0000000000000..34fcd91b319ba --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-free-region-ordering-incorrect.rs similarity index 100% rename from src/test/compile-fail/regions-free-region-ordering-incorrect.rs rename to src/test/ui/regions/regions-free-region-ordering-incorrect.rs diff --git a/src/test/ui/regions/regions-free-region-ordering-incorrect.stderr b/src/test/ui/regions/regions-free-region-ordering-incorrect.stderr new file mode 100644 index 0000000000000..3dce04e2452ad --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-glb-free-free.nll.stderr b/src/test/ui/regions/regions-glb-free-free.nll.stderr new file mode 100644 index 0000000000000..93e8bd75bdb0f --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-glb-free-free.rs similarity index 100% rename from src/test/compile-fail/regions-glb-free-free.rs rename to src/test/ui/regions/regions-glb-free-free.rs diff --git a/src/test/ui/regions/regions-glb-free-free.stderr b/src/test/ui/regions/regions-glb-free-free.stderr new file mode 100644 index 0000000000000..48c95a88654e8 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-implied-bounds-projection-gap-1.rs similarity index 97% rename from src/test/compile-fail/regions-implied-bounds-projection-gap-1.rs rename to src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs index 65594ab8f2e29..01de3ddcdf8d9 100644 --- a/src/test/compile-fail/regions-implied-bounds-projection-gap-1.rs +++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Illustrates the "projection gap": in this test, even though we know // that `T::Foo: 'x`, that does not tell us that `T: 'x`, because // there might be other ways for the caller of `func` to show that diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-1.stderr new file mode 100644 index 0000000000000..e6efb4d5c6b5d --- /dev/null +++ b/src/test/ui/regions/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:28: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:28: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/regions/regions-implied-bounds-projection-gap-2.rs similarity index 100% rename from src/test/compile-fail/regions-implied-bounds-projection-gap-2.rs rename to src/test/ui/regions/regions-implied-bounds-projection-gap-2.rs diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-2.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-2.stderr new file mode 100644 index 0000000000000..7a38797e469bc --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-implied-bounds-projection-gap-3.rs similarity index 100% rename from src/test/compile-fail/regions-implied-bounds-projection-gap-3.rs rename to src/test/ui/regions/regions-implied-bounds-projection-gap-3.rs diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-3.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-3.stderr new file mode 100644 index 0000000000000..1a12697a474ae --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-implied-bounds-projection-gap-4.rs similarity index 100% rename from src/test/compile-fail/regions-implied-bounds-projection-gap-4.rs rename to src/test/ui/regions/regions-implied-bounds-projection-gap-4.rs diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-4.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-4.stderr new file mode 100644 index 0000000000000..85b1702e2a096 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-implied-bounds-projection-gap-hr-1.rs similarity index 100% rename from src/test/compile-fail/regions-implied-bounds-projection-gap-hr-1.rs rename to src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.rs diff --git a/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr new file mode 100644 index 0000000000000..172a3cdeadea7 --- /dev/null +++ b/src/test/ui/regions/regions-implied-bounds-projection-gap-hr-1.stderr @@ -0,0 +1,23 @@ +error[E0491]: in type `&'x (dyn for<'z> Trait1<>::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< >::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< >::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< >::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/regions/regions-in-enums-anon.rs similarity index 100% rename from src/test/compile-fail/regions-in-enums-anon.rs rename to src/test/ui/regions/regions-in-enums-anon.rs diff --git a/src/test/ui/regions/regions-in-enums-anon.stderr b/src/test/ui/regions/regions-in-enums-anon.stderr new file mode 100644 index 0000000000000..f5630f84aed0a --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-in-enums.rs similarity index 100% rename from src/test/compile-fail/regions-in-enums.rs rename to src/test/ui/regions/regions-in-enums.rs diff --git a/src/test/ui/regions/regions-in-enums.stderr b/src/test/ui/regions/regions-in-enums.stderr new file mode 100644 index 0000000000000..cdc0b6ca122ad --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-in-structs-anon.rs similarity index 100% rename from src/test/compile-fail/regions-in-structs-anon.rs rename to src/test/ui/regions/regions-in-structs-anon.rs diff --git a/src/test/ui/regions/regions-in-structs-anon.stderr b/src/test/ui/regions/regions-in-structs-anon.stderr new file mode 100644 index 0000000000000..ecfac87c6c0cf --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-in-structs.rs similarity index 100% rename from src/test/compile-fail/regions-in-structs.rs rename to src/test/ui/regions/regions-in-structs.rs diff --git a/src/test/ui/regions/regions-in-structs.stderr b/src/test/ui/regions/regions-in-structs.stderr new file mode 100644 index 0000000000000..679a219fbb1c7 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-at-fn-not-param.nll.stderr b/src/test/ui/regions/regions-infer-at-fn-not-param.nll.stderr new file mode 100644 index 0000000000000..6bc3dafea51f4 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-at-fn-not-param.rs similarity index 100% rename from src/test/compile-fail/regions-infer-at-fn-not-param.rs rename to src/test/ui/regions/regions-infer-at-fn-not-param.rs diff --git a/src/test/ui/regions/regions-infer-at-fn-not-param.stderr b/src/test/ui/regions/regions-infer-at-fn-not-param.stderr new file mode 100644 index 0000000000000..f129ffae23aaa --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-borrow-scope-too-big.nll.stderr b/src/test/ui/regions/regions-infer-borrow-scope-too-big.nll.stderr new file mode 100644 index 0000000000000..28bf252bc9570 --- /dev/null +++ b/src/test/ui/regions/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) -> &'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/regions/regions-infer-borrow-scope-too-big.rs similarity index 100% rename from src/test/compile-fail/regions-infer-borrow-scope-too-big.rs rename to src/test/ui/regions/regions-infer-borrow-scope-too-big.rs diff --git a/src/test/ui/regions/regions-infer-borrow-scope-too-big.stderr b/src/test/ui/regions/regions-infer-borrow-scope-too-big.stderr new file mode 100644 index 0000000000000..4c4a9b9195872 --- /dev/null +++ b/src/test/ui/regions/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) -> &'a isize { + | ^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. diff --git a/src/test/ui/regions/regions-infer-bound-from-trait-self.nll.stderr b/src/test/ui/regions/regions-infer-bound-from-trait-self.nll.stderr new file mode 100644 index 0000000000000..c71bd17ac7839 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-bound-from-trait-self.rs similarity index 100% rename from src/test/compile-fail/regions-infer-bound-from-trait-self.rs rename to src/test/ui/regions/regions-infer-bound-from-trait-self.rs diff --git a/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr b/src/test/ui/regions/regions-infer-bound-from-trait-self.stderr new file mode 100644 index 0000000000000..7b30f9a58f57d --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-bound-from-trait.nll.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.nll.stderr new file mode 100644 index 0000000000000..25f69031507ec --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-bound-from-trait.rs similarity index 100% rename from src/test/compile-fail/regions-infer-bound-from-trait.rs rename to src/test/ui/regions/regions-infer-bound-from-trait.rs diff --git a/src/test/ui/regions/regions-infer-bound-from-trait.stderr b/src/test/ui/regions/regions-infer-bound-from-trait.stderr new file mode 100644 index 0000000000000..4c89f4bd8a8f5 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-call-3.nll.stderr b/src/test/ui/regions/regions-infer-call-3.nll.stderr new file mode 100644 index 0000000000000..c8665fe6a1155 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-call-3.rs similarity index 100% rename from src/test/compile-fail/regions-infer-call-3.rs rename to src/test/ui/regions/regions-infer-call-3.rs diff --git a/src/test/ui/regions/regions-infer-call-3.stderr b/src/test/ui/regions/regions-infer-call-3.stderr new file mode 100644 index 0000000000000..d42e5bfc7dd75 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-contravariance-due-to-decl.rs similarity index 98% rename from src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs rename to src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs index 6e1c765724b0b..a16001b5788b3 100644 --- a/src/test/compile-fail/regions-infer-contravariance-due-to-decl.rs +++ b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that a type which is contravariant with respect to its region // parameter yields an error when used in a covariant way. // diff --git a/src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr new file mode 100644 index 0000000000000..675cbc5858348 --- /dev/null +++ b/src/test/ui/regions/regions-infer-contravariance-due-to-decl.stderr @@ -0,0 +1,15 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-infer-contravariance-due-to-decl.rs:37: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/regions/regions-infer-covariance-due-to-decl.rs similarity index 97% rename from src/test/compile-fail/regions-infer-covariance-due-to-decl.rs rename to src/test/ui/regions/regions-infer-covariance-due-to-decl.rs index 1ab8ba4439b5d..f794063610ae0 100644 --- a/src/test/compile-fail/regions-infer-covariance-due-to-decl.rs +++ b/src/test/ui/regions/regions-infer-covariance-due-to-decl.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that a type which is covariant with respect to its region // parameter yields an error when used in a contravariant way. // diff --git a/src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr b/src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr new file mode 100644 index 0000000000000..6b3673a800284 --- /dev/null +++ b/src/test/ui/regions/regions-infer-covariance-due-to-decl.stderr @@ -0,0 +1,14 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-infer-covariance-due-to-decl.rs:34: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/regions/regions-infer-invariance-due-to-decl.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-decl.nll.stderr new file mode 100644 index 0000000000000..86a7e1f2c48e4 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-invariance-due-to-decl.rs similarity index 100% rename from src/test/compile-fail/regions-infer-invariance-due-to-decl.rs rename to src/test/ui/regions/regions-infer-invariance-due-to-decl.rs diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-decl.stderr new file mode 100644 index 0000000000000..edd37b1622afd --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.nll.stderr new file mode 100644 index 0000000000000..a021239af1e3e --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-invariance-due-to-mutability-3.rs similarity index 100% rename from src/test/compile-fail/regions-infer-invariance-due-to-mutability-3.rs rename to src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.rs diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-3.stderr new file mode 100644 index 0000000000000..3a807b755afe3 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.nll.stderr new file mode 100644 index 0000000000000..20e0e730c026f --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-invariance-due-to-mutability-4.rs similarity index 100% rename from src/test/compile-fail/regions-infer-invariance-due-to-mutability-4.rs rename to src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.rs diff --git a/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr b/src/test/ui/regions/regions-infer-invariance-due-to-mutability-4.stderr new file mode 100644 index 0000000000000..fb47433ba1779 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-not-param.nll.stderr b/src/test/ui/regions/regions-infer-not-param.nll.stderr new file mode 100644 index 0000000000000..deeca293a1af6 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-not-param.rs similarity index 100% rename from src/test/compile-fail/regions-infer-not-param.rs rename to src/test/ui/regions/regions-infer-not-param.rs diff --git a/src/test/ui/regions/regions-infer-not-param.stderr b/src/test/ui/regions/regions-infer-not-param.stderr new file mode 100644 index 0000000000000..2a029518953d3 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-paramd-indirect.nll.stderr b/src/test/ui/regions/regions-infer-paramd-indirect.nll.stderr new file mode 100644 index 0000000000000..01ae2910bd591 --- /dev/null +++ b/src/test/ui/regions/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` 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/regions/regions-infer-paramd-indirect.rs similarity index 100% rename from src/test/compile-fail/regions-infer-paramd-indirect.rs rename to src/test/ui/regions/regions-infer-paramd-indirect.rs diff --git a/src/test/ui/regions/regions-infer-paramd-indirect.stderr b/src/test/ui/regions/regions-infer-paramd-indirect.stderr new file mode 100644 index 0000000000000..602f30957f129 --- /dev/null +++ b/src/test/ui/regions/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>` + found type `std::boxed::Box>` +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) { +LL | | self.f = b; +LL | | //~^ ERROR mismatched types +LL | | //~| expected type `std::boxed::Box>` +LL | | //~| found type `std::boxed::Box>` +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/regions/regions-infer-proc-static-upvar.nll.stderr b/src/test/ui/regions/regions-infer-proc-static-upvar.nll.stderr new file mode 100644 index 0000000000000..fa358a9cc45c2 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-infer-proc-static-upvar.rs similarity index 100% rename from src/test/compile-fail/regions-infer-proc-static-upvar.rs rename to src/test/ui/regions/regions-infer-proc-static-upvar.rs diff --git a/src/test/ui/regions/regions-infer-proc-static-upvar.stderr b/src/test/ui/regions/regions-infer-proc-static-upvar.stderr new file mode 100644 index 0000000000000..93fe45ed300d2 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-lifetime-bounds-on-fns.nll.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.nll.stderr new file mode 100644 index 0000000000000..01f0cfa4a7186 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-lifetime-bounds-on-fns.rs similarity index 100% rename from src/test/compile-fail/regions-lifetime-bounds-on-fns.rs rename to src/test/ui/regions/regions-lifetime-bounds-on-fns.rs diff --git a/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr b/src/test/ui/regions/regions-lifetime-bounds-on-fns.stderr new file mode 100644 index 0000000000000..1b600ef905f43 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-lifetime-of-struct-or-enum-variant.rs similarity index 100% rename from src/test/compile-fail/regions-lifetime-of-struct-or-enum-variant.rs rename to src/test/ui/regions/regions-lifetime-of-struct-or-enum-variant.rs diff --git a/src/test/ui/regions/regions-lifetime-of-struct-or-enum-variant.stderr b/src/test/ui/regions/regions-lifetime-of-struct-or-enum-variant.stderr new file mode 100644 index 0000000000000..390173ed749a9 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-name-duplicated.rs similarity index 100% rename from src/test/compile-fail/regions-name-duplicated.rs rename to src/test/ui/regions/regions-name-duplicated.rs diff --git a/src/test/ui/regions/regions-name-duplicated.stderr b/src/test/ui/regions/regions-name-duplicated.stderr new file mode 100644 index 0000000000000..ad945d54ad14d --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-name-static.rs similarity index 100% rename from src/test/compile-fail/regions-name-static.rs rename to src/test/ui/regions/regions-name-static.rs diff --git a/src/test/ui/regions/regions-name-static.stderr b/src/test/ui/regions/regions-name-static.stderr new file mode 100644 index 0000000000000..48077d61c455c --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-name-undeclared.rs similarity index 100% rename from src/test/compile-fail/regions-name-undeclared.rs rename to src/test/ui/regions/regions-name-undeclared.rs diff --git a/src/test/ui/regions/regions-name-undeclared.stderr b/src/test/ui/regions/regions-name-undeclared.stderr new file mode 100644 index 0000000000000..62fc5f5c7f785 --- /dev/null +++ b/src/test/ui/regions/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/regions-nested-fns-2.nll.stderr b/src/test/ui/regions/regions-nested-fns-2.nll.stderr similarity index 100% rename from src/test/ui/regions-nested-fns-2.nll.stderr rename to src/test/ui/regions/regions-nested-fns-2.nll.stderr diff --git a/src/test/ui/regions-nested-fns-2.rs b/src/test/ui/regions/regions-nested-fns-2.rs similarity index 100% rename from src/test/ui/regions-nested-fns-2.rs rename to src/test/ui/regions/regions-nested-fns-2.rs diff --git a/src/test/ui/regions-nested-fns-2.stderr b/src/test/ui/regions/regions-nested-fns-2.stderr similarity index 100% rename from src/test/ui/regions-nested-fns-2.stderr rename to src/test/ui/regions/regions-nested-fns-2.stderr diff --git a/src/test/ui/regions/regions-nested-fns.nll.stderr b/src/test/ui/regions/regions-nested-fns.nll.stderr new file mode 100644 index 0000000000000..d90015b1b2157 --- /dev/null +++ b/src/test/ui/regions/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:: 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:: 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/regions/regions-nested-fns.rs similarity index 100% rename from src/test/compile-fail/regions-nested-fns.rs rename to src/test/ui/regions/regions-nested-fns.rs diff --git a/src/test/ui/regions/regions-nested-fns.stderr b/src/test/ui/regions/regions-nested-fns.stderr new file mode 100644 index 0000000000000..93004b4c3bf6b --- /dev/null +++ b/src/test/ui/regions/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:: 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 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 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/regions/regions-normalize-in-where-clause-list.rs similarity index 100% rename from src/test/compile-fail/regions-normalize-in-where-clause-list.rs rename to src/test/ui/regions/regions-normalize-in-where-clause-list.rs diff --git a/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr b/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr new file mode 100644 index 0000000000000..ec153f111d64b --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-nominal-type-enum-region-rev.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-nominal-type-enum-region-rev.rs rename to src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.rs diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-region-rev.stderr new file mode 100644 index 0000000000000..5084097e30d11 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-nominal-type-enum-region.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-nominal-type-enum-region.rs rename to src/test/ui/regions/regions-outlives-nominal-type-enum-region.rs diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-region.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-region.stderr new file mode 100644 index 0000000000000..ce187eddfa9d6 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-nominal-type-enum-type-rev.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-nominal-type-enum-type-rev.rs rename to src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.rs diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-type-rev.stderr new file mode 100644 index 0000000000000..8636b89b71abe --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-nominal-type-enum-type.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-nominal-type-enum-type.rs rename to src/test/ui/regions/regions-outlives-nominal-type-enum-type.rs diff --git a/src/test/ui/regions/regions-outlives-nominal-type-enum-type.stderr b/src/test/ui/regions/regions-outlives-nominal-type-enum-type.stderr new file mode 100644 index 0000000000000..c209547e20c84 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-nominal-type-struct-region-rev.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-nominal-type-struct-region-rev.rs rename to src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.rs diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-region-rev.stderr new file mode 100644 index 0000000000000..48980bdf8320e --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-nominal-type-struct-region.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-nominal-type-struct-region.rs rename to src/test/ui/regions/regions-outlives-nominal-type-struct-region.rs diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-region.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-region.stderr new file mode 100644 index 0000000000000..e2b328886b334 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-nominal-type-struct-type-rev.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-nominal-type-struct-type-rev.rs rename to src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.rs diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-type-rev.stderr new file mode 100644 index 0000000000000..2bf04ffa64afb --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-nominal-type-struct-type.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-nominal-type-struct-type.rs rename to src/test/ui/regions/regions-outlives-nominal-type-struct-type.rs diff --git a/src/test/ui/regions/regions-outlives-nominal-type-struct-type.stderr b/src/test/ui/regions/regions-outlives-nominal-type-struct-type.stderr new file mode 100644 index 0000000000000..af9f1d3722aeb --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-projection-container-hrtb.nll.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.nll.stderr new file mode 100644 index 0000000000000..db1508a8c8b14 --- /dev/null +++ b/src/test/ui/regions/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> = loop { }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +warning: not reporting region error due to nll + --> $DIR/regions-outlives-projection-container-hrtb.rs:63:12 + | +LL | let _: &'a WithHrAssocSub> = 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/regions/regions-outlives-projection-container-hrtb.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-projection-container-hrtb.rs rename to src/test/ui/regions/regions-outlives-projection-container-hrtb.rs diff --git a/src/test/ui/regions/regions-outlives-projection-container-hrtb.stderr b/src/test/ui/regions/regions-outlives-projection-container-hrtb.stderr new file mode 100644 index 0000000000000..32c9359b684e5 --- /dev/null +++ b/src/test/ui/regions/regions-outlives-projection-container-hrtb.stderr @@ -0,0 +1,37 @@ +error[E0491]: in type `&'a WithHrAssoc>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container-hrtb.rs:42:12 + | +LL | let _: &'a WithHrAssoc> = 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>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container-hrtb.rs:63:12 + | +LL | let _: &'a WithHrAssocSub> = 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/regions/regions-outlives-projection-container-wc.rs similarity index 98% rename from src/test/compile-fail/regions-outlives-projection-container-wc.rs rename to src/test/ui/regions/regions-outlives-projection-container-wc.rs index 71606ba812fac..79300d5176ecc 100644 --- a/src/test/compile-fail/regions-outlives-projection-container-wc.rs +++ b/src/test/ui/regions/regions-outlives-projection-container-wc.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that we are imposing the requirement that every associated // type of a bound that appears in the where clause on a struct must // outlive the location in which the type appears, even when the diff --git a/src/test/ui/regions/regions-outlives-projection-container-wc.stderr b/src/test/ui/regions/regions-outlives-projection-container-wc.stderr new file mode 100644 index 0000000000000..d0680ecbb99a2 --- /dev/null +++ b/src/test/ui/regions/regions-outlives-projection-container-wc.stderr @@ -0,0 +1,20 @@ +error[E0491]: in type `&'a WithAssoc>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container-wc.rs:46:12 + | +LL | let _: &'a WithAssoc> = loop { }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 40:15 + --> $DIR/regions-outlives-projection-container-wc.rs:40: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 40:18 + --> $DIR/regions-outlives-projection-container-wc.rs:40: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/regions/regions-outlives-projection-container.rs similarity index 97% rename from src/test/compile-fail/regions-outlives-projection-container.rs rename to src/test/ui/regions/regions-outlives-projection-container.rs index 957e56fe5109f..180a8b052442c 100644 --- a/src/test/compile-fail/regions-outlives-projection-container.rs +++ b/src/test/ui/regions/regions-outlives-projection-container.rs @@ -8,10 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that we are imposing the requirement that every associated // type of a bound that appears in the where clause on a struct must // outlive the location in which the type appears. Issue #22246. +// ignore-compare-mode-nll + #![allow(dead_code)] #![feature(rustc_attrs)] diff --git a/src/test/ui/regions/regions-outlives-projection-container.stderr b/src/test/ui/regions/regions-outlives-projection-container.stderr new file mode 100644 index 0000000000000..4b8d445ff4a9c --- /dev/null +++ b/src/test/ui/regions/regions-outlives-projection-container.stderr @@ -0,0 +1,71 @@ +error[E0491]: in type `&'a WithAssoc>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container.rs:52:12 + | +LL | let _: &'a WithAssoc> = loop { }; //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 46:15 + --> $DIR/regions-outlives-projection-container.rs:46: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 46:18 + --> $DIR/regions-outlives-projection-container.rs:46:18 + | +LL | fn with_assoc<'a,'b>() { + | ^^ + +error[E0491]: in type `&'a WithoutAssoc>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container.rs:69:12 + | +LL | let _: &'a WithoutAssoc> = loop { }; //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 65:18 + --> $DIR/regions-outlives-projection-container.rs:65: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 65:21 + --> $DIR/regions-outlives-projection-container.rs:65:21 + | +LL | fn without_assoc<'a,'b>() { + | ^^ + +error[E0491]: in type `&'a WithAssoc>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container.rs:77:12 + | +LL | call::<&'a WithAssoc>>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 72:20 + --> $DIR/regions-outlives-projection-container.rs:72: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 72:23 + --> $DIR/regions-outlives-projection-container.rs:72:23 + | +LL | fn call_with_assoc<'a,'b>() { + | ^^ + +error[E0491]: in type `&'a WithoutAssoc>`, reference has a longer lifetime than the data it references + --> $DIR/regions-outlives-projection-container.rs:84:12 + | +LL | call::<&'a WithoutAssoc>>(); //~ ERROR reference has a longer lifetime + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: the pointer is valid for the lifetime 'a as defined on the function body at 81:23 + --> $DIR/regions-outlives-projection-container.rs:81: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 81:26 + --> $DIR/regions-outlives-projection-container.rs:81: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/regions/regions-outlives-projection-hrtype.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-projection-hrtype.rs rename to src/test/ui/regions/regions-outlives-projection-hrtype.rs diff --git a/src/test/ui/regions/regions-outlives-projection-hrtype.stderr b/src/test/ui/regions/regions-outlives-projection-hrtype.stderr new file mode 100644 index 0000000000000..ba4e318957e60 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-projection-trait-def.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-projection-trait-def.rs rename to src/test/ui/regions/regions-outlives-projection-trait-def.rs diff --git a/src/test/ui/regions/regions-outlives-projection-trait-def.stderr b/src/test/ui/regions/regions-outlives-projection-trait-def.stderr new file mode 100644 index 0000000000000..0a4cbe64d4638 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-outlives-scalar.rs similarity index 100% rename from src/test/compile-fail/regions-outlives-scalar.rs rename to src/test/ui/regions/regions-outlives-scalar.rs diff --git a/src/test/ui/regions/regions-outlives-scalar.stderr b/src/test/ui/regions/regions-outlives-scalar.stderr new file mode 100644 index 0000000000000..d754bdd60320e --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-pattern-typing-issue-19552.nll.stderr b/src/test/ui/regions/regions-pattern-typing-issue-19552.nll.stderr new file mode 100644 index 0000000000000..c39d007312fef --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-pattern-typing-issue-19552.rs similarity index 100% rename from src/test/compile-fail/regions-pattern-typing-issue-19552.rs rename to src/test/ui/regions/regions-pattern-typing-issue-19552.rs diff --git a/src/test/ui/regions/regions-pattern-typing-issue-19552.stderr b/src/test/ui/regions/regions-pattern-typing-issue-19552.stderr new file mode 100644 index 0000000000000..cefedefa2435d --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-pattern-typing-issue-19997.ast.nll.stderr b/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.nll.stderr new file mode 100644 index 0000000000000..2acac5d5cf8a6 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-pattern-typing-issue-19997.ast.stderr b/src/test/ui/regions/regions-pattern-typing-issue-19997.ast.stderr new file mode 100644 index 0000000000000..c26a03697400a --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-pattern-typing-issue-19997.mir.stderr b/src/test/ui/regions/regions-pattern-typing-issue-19997.mir.stderr new file mode 100644 index 0000000000000..2acac5d5cf8a6 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-pattern-typing-issue-19997.rs similarity index 100% rename from src/test/compile-fail/regions-pattern-typing-issue-19997.rs rename to src/test/ui/regions/regions-pattern-typing-issue-19997.rs diff --git a/src/test/ui/regions/regions-proc-bound-capture.nll.stderr b/src/test/ui/regions/regions-proc-bound-capture.nll.stderr new file mode 100644 index 0000000000000..00728aa4783d4 --- /dev/null +++ b/src/test/ui/regions/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(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/regions/regions-proc-bound-capture.rs similarity index 100% rename from src/test/compile-fail/regions-proc-bound-capture.rs rename to src/test/ui/regions/regions-proc-bound-capture.rs diff --git a/src/test/ui/regions/regions-proc-bound-capture.stderr b/src/test/ui/regions/regions-proc-bound-capture.stderr new file mode 100644 index 0000000000000..b38543bdc4340 --- /dev/null +++ b/src/test/ui/regions/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(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/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.nll.stderr new file mode 100644 index 0000000000000..761fa6f32ff17 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs similarity index 100% rename from src/test/compile-fail/regions-reborrow-from-shorter-mut-ref-mut-ref.rs rename to src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.rs diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref-mut-ref.stderr new file mode 100644 index 0000000000000..cddb60a433767 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.nll.stderr new file mode 100644 index 0000000000000..c3eb6fd909721 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-reborrow-from-shorter-mut-ref.rs similarity index 100% rename from src/test/compile-fail/regions-reborrow-from-shorter-mut-ref.rs rename to src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.rs diff --git a/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.stderr b/src/test/ui/regions/regions-reborrow-from-shorter-mut-ref.stderr new file mode 100644 index 0000000000000..9f8d0168edeee --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-ref-in-fn-arg.nll.stderr b/src/test/ui/regions/regions-ref-in-fn-arg.nll.stderr new file mode 100644 index 0000000000000..87fe858769d18 --- /dev/null +++ b/src/test/ui/regions/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) -> &'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/regions/regions-ref-in-fn-arg.rs similarity index 100% rename from src/test/compile-fail/regions-ref-in-fn-arg.rs rename to src/test/ui/regions/regions-ref-in-fn-arg.rs diff --git a/src/test/ui/regions/regions-ref-in-fn-arg.stderr b/src/test/ui/regions/regions-ref-in-fn-arg.stderr new file mode 100644 index 0000000000000..0250f6e26fea9 --- /dev/null +++ b/src/test/ui/regions/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) -> &'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/regions/regions-ret-borrowed-1.nll.stderr b/src/test/ui/regions/regions-ret-borrowed-1.nll.stderr new file mode 100644 index 0000000000000..6a18436654635 --- /dev/null +++ b/src/test/ui/regions/regions-ret-borrowed-1.nll.stderr @@ -0,0 +1,17 @@ +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` + | || + | |return type of closure is &'2 isize + | has type `&'1 isize` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-ret-borrowed-1.rs b/src/test/ui/regions/regions-ret-borrowed-1.rs similarity index 100% rename from src/test/compile-fail/regions-ret-borrowed-1.rs rename to src/test/ui/regions/regions-ret-borrowed-1.rs diff --git a/src/test/ui/regions/regions-ret-borrowed-1.stderr b/src/test/ui/regions/regions-ret-borrowed-1.stderr new file mode 100644 index 0000000000000..ac886bcbc7cb9 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-ret-borrowed.nll.stderr b/src/test/ui/regions/regions-ret-borrowed.nll.stderr new file mode 100644 index 0000000000000..57c81f45fd004 --- /dev/null +++ b/src/test/ui/regions/regions-ret-borrowed.nll.stderr @@ -0,0 +1,17 @@ +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` + | || + | |return type of closure is &'2 isize + | has type `&'1 isize` + +error: aborting due to previous error + diff --git a/src/test/compile-fail/regions-ret-borrowed.rs b/src/test/ui/regions/regions-ret-borrowed.rs similarity index 100% rename from src/test/compile-fail/regions-ret-borrowed.rs rename to src/test/ui/regions/regions-ret-borrowed.rs diff --git a/src/test/ui/regions/regions-ret-borrowed.stderr b/src/test/ui/regions/regions-ret-borrowed.stderr new file mode 100644 index 0000000000000..36c4ce7e1740d --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-ret.nll.stderr b/src/test/ui/regions/regions-ret.nll.stderr new file mode 100644 index 0000000000000..cacc119d41013 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-ret.rs similarity index 100% rename from src/test/compile-fail/regions-ret.rs rename to src/test/ui/regions/regions-ret.rs diff --git a/src/test/ui/regions/regions-ret.stderr b/src/test/ui/regions/regions-ret.stderr new file mode 100644 index 0000000000000..84515a9b44cc1 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr b/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr new file mode 100644 index 0000000000000..eb84dca83c6da --- /dev/null +++ b/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.nll.stderr @@ -0,0 +1,19 @@ +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` + | || + | |return type of closure is &'2 mut i32 + | lifetime `'1` represents this closure's body + | + = note: closure implements `FnMut`, so references to captured variables can't escape the closure + +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/regions/regions-return-ref-to-upvar-issue-17403.rs similarity index 100% rename from src/test/compile-fail/regions-return-ref-to-upvar-issue-17403.rs rename to src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.rs diff --git a/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.stderr b/src/test/ui/regions/regions-return-ref-to-upvar-issue-17403.stderr new file mode 100644 index 0000000000000..c841c9605bd5f --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-return-stack-allocated-vec.rs similarity index 100% rename from src/test/compile-fail/regions-return-stack-allocated-vec.rs rename to src/test/ui/regions/regions-return-stack-allocated-vec.rs diff --git a/src/test/ui/regions/regions-return-stack-allocated-vec.stderr b/src/test/ui/regions/regions-return-stack-allocated-vec.stderr new file mode 100644 index 0000000000000..77c1d177acbc6 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-static-bound.ll.nll.stderr b/src/test/ui/regions/regions-static-bound.ll.nll.stderr new file mode 100644 index 0000000000000..aaae14fede62e --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-static-bound.ll.stderr b/src/test/ui/regions/regions-static-bound.ll.stderr new file mode 100644 index 0000000000000..4a11677765d14 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-static-bound.nll.stderr b/src/test/ui/regions/regions-static-bound.nll.stderr new file mode 100644 index 0000000000000..aaae14fede62e --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-static-bound.rs similarity index 100% rename from src/test/compile-fail/regions-static-bound.rs rename to src/test/ui/regions/regions-static-bound.rs diff --git a/src/test/ui/regions/regions-steal-closure.nll.stderr b/src/test/ui/regions/regions-steal-closure.nll.stderr new file mode 100644 index 0000000000000..ed70e38362dac --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-steal-closure.rs similarity index 100% rename from src/test/compile-fail/regions-steal-closure.rs rename to src/test/ui/regions/regions-steal-closure.rs diff --git a/src/test/ui/regions/regions-steal-closure.stderr b/src/test/ui/regions/regions-steal-closure.stderr new file mode 100644 index 0000000000000..44843d19e92a4 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-struct-not-wf.lexical.stderr b/src/test/ui/regions/regions-struct-not-wf.lexical.stderr new file mode 100644 index 0000000000000..9433b8b1952f2 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-struct-not-wf.nll.stderr b/src/test/ui/regions/regions-struct-not-wf.nll.stderr new file mode 100644 index 0000000000000..9433b8b1952f2 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-struct-not-wf.rs similarity index 100% rename from src/test/compile-fail/regions-struct-not-wf.rs rename to src/test/ui/regions/regions-struct-not-wf.rs diff --git a/src/test/compile-fail/regions-trait-1.rs b/src/test/ui/regions/regions-trait-1.rs similarity index 100% rename from src/test/compile-fail/regions-trait-1.rs rename to src/test/ui/regions/regions-trait-1.rs diff --git a/src/test/ui/regions/regions-trait-1.stderr b/src/test/ui/regions/regions-trait-1.stderr new file mode 100644 index 0000000000000..dbc47a55950b7 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-trait-object-subtyping.nll.stderr b/src/test/ui/regions/regions-trait-object-subtyping.nll.stderr new file mode 100644 index 0000000000000..3d884f6fc5f97 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-trait-object-subtyping.rs similarity index 100% rename from src/test/compile-fail/regions-trait-object-subtyping.rs rename to src/test/ui/regions/regions-trait-object-subtyping.rs diff --git a/src/test/ui/regions/regions-trait-object-subtyping.stderr b/src/test/ui/regions/regions-trait-object-subtyping.stderr new file mode 100644 index 0000000000000..1b078855efdbb --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-trait-variance.nll.stderr b/src/test/ui/regions/regions-trait-variance.nll.stderr new file mode 100644 index 0000000000000..c610394c51b7a --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-trait-variance.rs similarity index 100% rename from src/test/compile-fail/regions-trait-variance.rs rename to src/test/ui/regions/regions-trait-variance.rs diff --git a/src/test/ui/regions/regions-trait-variance.stderr b/src/test/ui/regions/regions-trait-variance.stderr new file mode 100644 index 0000000000000..cd48d6bf8afe4 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-undeclared.rs similarity index 100% rename from src/test/compile-fail/regions-undeclared.rs rename to src/test/ui/regions/regions-undeclared.rs diff --git a/src/test/ui/regions/regions-undeclared.stderr b/src/test/ui/regions/regions-undeclared.stderr new file mode 100644 index 0000000000000..9870f328abe58 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-var-type-out-of-scope.nll.stderr b/src/test/ui/regions/regions-var-type-out-of-scope.nll.stderr new file mode 100644 index 0000000000000..54b1a6fa970b7 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-var-type-out-of-scope.rs similarity index 100% rename from src/test/compile-fail/regions-var-type-out-of-scope.rs rename to src/test/ui/regions/regions-var-type-out-of-scope.rs diff --git a/src/test/ui/regions/regions-var-type-out-of-scope.stderr b/src/test/ui/regions/regions-var-type-out-of-scope.stderr new file mode 100644 index 0000000000000..92a6451c3bd62 --- /dev/null +++ b/src/test/ui/regions/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/regions/regions-variance-contravariant-use-covariant-in-second-position.rs similarity index 97% rename from src/test/compile-fail/regions-variance-contravariant-use-covariant-in-second-position.rs rename to src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs index 1dfebd54ec3b3..a028bae40013d 100644 --- a/src/test/compile-fail/regions-variance-contravariant-use-covariant-in-second-position.rs +++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that a type which is covariant with respect to its region // parameter yields an error when used in a contravariant way. // diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant-in-second-position.stderr new file mode 100644 index 0000000000000..fd1d3ab99f38a --- /dev/null +++ b/src/test/ui/regions/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:37: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/regions/regions-variance-contravariant-use-covariant.rs similarity index 97% rename from src/test/compile-fail/regions-variance-contravariant-use-covariant.rs rename to src/test/ui/regions/regions-variance-contravariant-use-covariant.rs index caf6a86fc0b26..84c4e52a9c07f 100644 --- a/src/test/compile-fail/regions-variance-contravariant-use-covariant.rs +++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that a type which is covariant with respect to its region // parameter yields an error when used in a contravariant way. // diff --git a/src/test/ui/regions/regions-variance-contravariant-use-covariant.stderr b/src/test/ui/regions/regions-variance-contravariant-use-covariant.stderr new file mode 100644 index 0000000000000..a1e4913aa3a30 --- /dev/null +++ b/src/test/ui/regions/regions-variance-contravariant-use-covariant.stderr @@ -0,0 +1,15 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-variance-contravariant-use-covariant.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-variance-covariant-use-contravariant.rs b/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs similarity index 97% rename from src/test/compile-fail/regions-variance-covariant-use-contravariant.rs rename to src/test/ui/regions/regions-variance-covariant-use-contravariant.rs index 60dc3d94a2edb..824a442c87d54 100644 --- a/src/test/compile-fail/regions-variance-covariant-use-contravariant.rs +++ b/src/test/ui/regions/regions-variance-covariant-use-contravariant.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that a type which is covariant with respect to its region // parameter yields an error when used in a contravariant way. // diff --git a/src/test/ui/regions/regions-variance-covariant-use-contravariant.stderr b/src/test/ui/regions/regions-variance-covariant-use-contravariant.stderr new file mode 100644 index 0000000000000..fc1c6c304f8ad --- /dev/null +++ b/src/test/ui/regions/regions-variance-covariant-use-contravariant.stderr @@ -0,0 +1,14 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-variance-covariant-use-contravariant.rs:35: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/regions/regions-variance-invariant-use-contravariant.rs similarity index 97% rename from src/test/compile-fail/regions-variance-invariant-use-contravariant.rs rename to src/test/ui/regions/regions-variance-invariant-use-contravariant.rs index 96478fa590979..9c6db331c0173 100644 --- a/src/test/compile-fail/regions-variance-invariant-use-contravariant.rs +++ b/src/test/ui/regions/regions-variance-invariant-use-contravariant.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that an invariant region parameter used in a contravariant way // yields an error. // diff --git a/src/test/ui/regions/regions-variance-invariant-use-contravariant.stderr b/src/test/ui/regions/regions-variance-invariant-use-contravariant.stderr new file mode 100644 index 0000000000000..6b67e6b192e9c --- /dev/null +++ b/src/test/ui/regions/regions-variance-invariant-use-contravariant.stderr @@ -0,0 +1,14 @@ +error[E0623]: lifetime mismatch + --> $DIR/regions-variance-invariant-use-contravariant.rs:32: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/regions/regions-variance-invariant-use-covariant.rs similarity index 97% rename from src/test/compile-fail/regions-variance-invariant-use-covariant.rs rename to src/test/ui/regions/regions-variance-invariant-use-covariant.rs index bd944a8b52cfb..ed393de357a3f 100644 --- a/src/test/compile-fail/regions-variance-invariant-use-covariant.rs +++ b/src/test/ui/regions/regions-variance-invariant-use-covariant.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that a type which is invariant with respect to its region // parameter used in a covariant way yields an error. // diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr b/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr new file mode 100644 index 0000000000000..5b50f4bd51373 --- /dev/null +++ b/src/test/ui/regions/regions-variance-invariant-use-covariant.stderr @@ -0,0 +1,18 @@ +error[E0308]: mismatched types + --> $DIR/regions-variance-invariant-use-covariant.rs:29: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 23:9... + --> $DIR/regions-variance-invariant-use-covariant.rs:23: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/regions/regions-wf-trait-object.rs similarity index 100% rename from src/test/compile-fail/regions-wf-trait-object.rs rename to src/test/ui/regions/regions-wf-trait-object.rs diff --git a/src/test/ui/regions/regions-wf-trait-object.stderr b/src/test/ui/regions/regions-wf-trait-object.stderr new file mode 100644 index 0000000000000..caaa902abbe4c --- /dev/null +++ b/src/test/ui/regions/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+'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/reject-specialized-drops-8142.rs similarity index 100% rename from src/test/compile-fail/reject-specialized-drops-8142.rs rename to src/test/ui/reject-specialized-drops-8142.rs diff --git a/src/test/ui/reject-specialized-drops-8142.stderr b/src/test/ui/reject-specialized-drops-8142.stderr new file mode 100644 index 0000000000000..c0f1525a761bb --- /dev/null +++ b/src/test/ui/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 { 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 { 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 Drop for Q { 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 { 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 { 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 { x: *const Tr } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0366]: Implementations of Drop cannot be specialized + --> $DIR/reject-specialized-drops-8142.rs:61:1 + | +LL | impl Drop for V { 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 { 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/repeat-to-run-dtor-twice.rs similarity index 100% rename from src/test/compile-fail/repeat-to-run-dtor-twice.rs rename to src/test/ui/repeat-to-run-dtor-twice.rs diff --git a/src/test/ui/repeat-to-run-dtor-twice.stderr b/src/test/ui/repeat-to-run-dtor-twice.stderr new file mode 100644 index 0000000000000..408c28af10e09 --- /dev/null +++ b/src/test/ui/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/repeat_count.rs similarity index 100% rename from src/test/compile-fail/repeat_count.rs rename to src/test/ui/repeat_count.rs diff --git a/src/test/ui/repeat_count.stderr b/src/test/ui/repeat_count.stderr new file mode 100644 index 0000000000000..4852023ec8b03 --- /dev/null +++ b/src/test/ui/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/ui/repr-align-assign.fixed b/src/test/ui/repr/repr-align-assign.fixed similarity index 100% rename from src/test/ui/repr-align-assign.fixed rename to src/test/ui/repr/repr-align-assign.fixed diff --git a/src/test/ui/repr-align-assign.rs b/src/test/ui/repr/repr-align-assign.rs similarity index 100% rename from src/test/ui/repr-align-assign.rs rename to src/test/ui/repr/repr-align-assign.rs diff --git a/src/test/ui/repr-align-assign.stderr b/src/test/ui/repr/repr-align-assign.stderr similarity index 100% rename from src/test/ui/repr-align-assign.stderr rename to src/test/ui/repr/repr-align-assign.stderr diff --git a/src/test/compile-fail/repr-align.rs b/src/test/ui/repr/repr-align.rs similarity index 100% rename from src/test/compile-fail/repr-align.rs rename to src/test/ui/repr/repr-align.rs diff --git a/src/test/ui/repr/repr-align.stderr b/src/test/ui/repr/repr-align.stderr new file mode 100644 index 0000000000000..2195789bd6915 --- /dev/null +++ b/src/test/ui/repr/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/repr/repr-packed-contains-align.rs similarity index 100% rename from src/test/compile-fail/repr-packed-contains-align.rs rename to src/test/ui/repr/repr-packed-contains-align.rs diff --git a/src/test/ui/repr/repr-packed-contains-align.stderr b/src/test/ui/repr/repr-packed-contains-align.stderr new file mode 100644 index 0000000000000..4558cf2e10415 --- /dev/null +++ b/src/test/ui/repr/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/repr/repr-transparent-other-items.rs similarity index 100% rename from src/test/compile-fail/repr-transparent-other-items.rs rename to src/test/ui/repr/repr-transparent-other-items.rs diff --git a/src/test/ui/repr/repr-transparent-other-items.stderr b/src/test/ui/repr/repr-transparent-other-items.stderr new file mode 100644 index 0000000000000..e5889cf53e58a --- /dev/null +++ b/src/test/ui/repr/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/repr/repr-transparent-other-reprs.rs similarity index 100% rename from src/test/compile-fail/repr-transparent-other-reprs.rs rename to src/test/ui/repr/repr-transparent-other-reprs.rs diff --git a/src/test/ui/repr/repr-transparent-other-reprs.stderr b/src/test/ui/repr/repr-transparent-other-reprs.stderr new file mode 100644 index 0000000000000..40f41c474dbda --- /dev/null +++ b/src/test/ui/repr/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/repr/repr-transparent.rs similarity index 100% rename from src/test/compile-fail/repr-transparent.rs rename to src/test/ui/repr/repr-transparent.rs diff --git a/src/test/ui/repr/repr-transparent.stderr b/src/test/ui/repr/repr-transparent.stderr new file mode 100644 index 0000000000000..0f620880fa9d3 --- /dev/null +++ b/src/test/ui/repr/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, ::It); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: non-zero-sized field + --> $DIR/repr-transparent.rs:40:33 + | +LL | pub struct StructWithProjection(f32, ::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(ZstAlign32, 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/required-lang-item.rs similarity index 100% rename from src/test/compile-fail/required-lang-item.rs rename to src/test/ui/required-lang-item.rs diff --git a/src/test/ui/required-lang-item.stderr b/src/test/ui/required-lang-item.stderr new file mode 100644 index 0000000000000..83764a91ac780 --- /dev/null +++ b/src/test/ui/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/reserved/reserved-attr-on-macro.rs similarity index 100% rename from src/test/compile-fail/reserved-attr-on-macro.rs rename to src/test/ui/reserved/reserved-attr-on-macro.rs diff --git a/src/test/ui/reserved/reserved-attr-on-macro.stderr b/src/test/ui/reserved/reserved-attr-on-macro.stderr new file mode 100644 index 0000000000000..e8bfcc04f48b9 --- /dev/null +++ b/src/test/ui/reserved/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/reserved/reserved-become.rs similarity index 100% rename from src/test/compile-fail/reserved-become.rs rename to src/test/ui/reserved/reserved-become.rs diff --git a/src/test/ui/reserved/reserved-become.stderr b/src/test/ui/reserved/reserved-become.stderr new file mode 100644 index 0000000000000..fa9a960120858 --- /dev/null +++ b/src/test/ui/reserved/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/resolve/resolve-bad-import-prefix.rs similarity index 100% rename from src/test/compile-fail/resolve-bad-import-prefix.rs rename to src/test/ui/resolve/resolve-bad-import-prefix.rs diff --git a/src/test/ui/resolve/resolve-bad-import-prefix.stderr b/src/test/ui/resolve/resolve-bad-import-prefix.stderr new file mode 100644 index 0000000000000..76d0c035335c5 --- /dev/null +++ b/src/test/ui/resolve/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/resolve/resolve-bad-visibility.rs similarity index 100% rename from src/test/compile-fail/resolve-bad-visibility.rs rename to src/test/ui/resolve/resolve-bad-visibility.rs diff --git a/src/test/ui/resolve/resolve-bad-visibility.stderr b/src/test/ui/resolve/resolve-bad-visibility.stderr new file mode 100644 index 0000000000000..aa4817163e31e --- /dev/null +++ b/src/test/ui/resolve/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/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs similarity index 100% rename from src/test/compile-fail/resolve-conflict-extern-crate-vs-extern-crate.rs rename to src/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.rs diff --git a/src/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr b/src/test/ui/resolve/resolve-conflict-extern-crate-vs-extern-crate.stderr new file mode 100644 index 0000000000000..5f21b4413e71b --- /dev/null +++ b/src/test/ui/resolve/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/resolve/resolve-conflict-import-vs-extern-crate.rs similarity index 100% rename from src/test/compile-fail/resolve-conflict-import-vs-extern-crate.rs rename to src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.rs diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr b/src/test/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr new file mode 100644 index 0000000000000..9978e75af30b7 --- /dev/null +++ b/src/test/ui/resolve/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/resolve/resolve-conflict-import-vs-import.rs similarity index 100% rename from src/test/compile-fail/resolve-conflict-import-vs-import.rs rename to src/test/ui/resolve/resolve-conflict-import-vs-import.rs diff --git a/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-import-vs-import.stderr new file mode 100644 index 0000000000000..80ccb9aa2b3c3 --- /dev/null +++ b/src/test/ui/resolve/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/resolve/resolve-conflict-item-vs-extern-crate.rs similarity index 100% rename from src/test/compile-fail/resolve-conflict-item-vs-extern-crate.rs rename to src/test/ui/resolve/resolve-conflict-item-vs-extern-crate.rs diff --git a/src/test/ui/resolve/resolve-conflict-item-vs-extern-crate.stderr b/src/test/ui/resolve/resolve-conflict-item-vs-extern-crate.stderr new file mode 100644 index 0000000000000..d9ad248c01337 --- /dev/null +++ b/src/test/ui/resolve/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/ui/resolve-conflict-item-vs-import.rs b/src/test/ui/resolve/resolve-conflict-item-vs-import.rs similarity index 100% rename from src/test/ui/resolve-conflict-item-vs-import.rs rename to src/test/ui/resolve/resolve-conflict-item-vs-import.rs diff --git a/src/test/ui/resolve-conflict-item-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-item-vs-import.stderr similarity index 100% rename from src/test/ui/resolve-conflict-item-vs-import.stderr rename to src/test/ui/resolve/resolve-conflict-item-vs-import.stderr diff --git a/src/test/compile-fail/resolve-conflict-type-vs-import.rs b/src/test/ui/resolve/resolve-conflict-type-vs-import.rs similarity index 100% rename from src/test/compile-fail/resolve-conflict-type-vs-import.rs rename to src/test/ui/resolve/resolve-conflict-type-vs-import.rs diff --git a/src/test/ui/resolve/resolve-conflict-type-vs-import.stderr b/src/test/ui/resolve/resolve-conflict-type-vs-import.stderr new file mode 100644 index 0000000000000..1e8df8f8ea78c --- /dev/null +++ b/src/test/ui/resolve/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/resolve/resolve-inconsistent-binding-mode.rs similarity index 100% rename from src/test/compile-fail/resolve-inconsistent-binding-mode.rs rename to src/test/ui/resolve/resolve-inconsistent-binding-mode.rs diff --git a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr new file mode 100644 index 0000000000000..e36eea26fcfd6 --- /dev/null +++ b/src/test/ui/resolve/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/ui/resolve-inconsistent-names.rs b/src/test/ui/resolve/resolve-inconsistent-names.rs similarity index 100% rename from src/test/ui/resolve-inconsistent-names.rs rename to src/test/ui/resolve/resolve-inconsistent-names.rs diff --git a/src/test/ui/resolve-inconsistent-names.stderr b/src/test/ui/resolve/resolve-inconsistent-names.stderr similarity index 100% rename from src/test/ui/resolve-inconsistent-names.stderr rename to src/test/ui/resolve/resolve-inconsistent-names.stderr diff --git a/src/test/compile-fail/resolve-label.rs b/src/test/ui/resolve/resolve-label.rs similarity index 100% rename from src/test/compile-fail/resolve-label.rs rename to src/test/ui/resolve/resolve-label.rs diff --git a/src/test/ui/resolve/resolve-label.stderr b/src/test/ui/resolve/resolve-label.stderr new file mode 100644 index 0000000000000..a7b89752f5e04 --- /dev/null +++ b/src/test/ui/resolve/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/resolve/resolve-primitive-fallback.rs similarity index 100% rename from src/test/compile-fail/resolve-primitive-fallback.rs rename to src/test/ui/resolve/resolve-primitive-fallback.rs diff --git a/src/test/ui/resolve/resolve-primitive-fallback.stderr b/src/test/ui/resolve/resolve-primitive-fallback.stderr new file mode 100644 index 0000000000000..2d852369afc92 --- /dev/null +++ b/src/test/ui/resolve/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/resolve/resolve-self-in-impl-2.rs similarity index 100% rename from src/test/compile-fail/resolve-self-in-impl-2.rs rename to src/test/ui/resolve/resolve-self-in-impl-2.rs diff --git a/src/test/ui/resolve/resolve-self-in-impl-2.stderr b/src/test/ui/resolve/resolve-self-in-impl-2.stderr new file mode 100644 index 0000000000000..183b9b66327b4 --- /dev/null +++ b/src/test/ui/resolve/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/resolve/resolve-self-in-impl.rs similarity index 100% rename from src/test/compile-fail/resolve-self-in-impl.rs rename to src/test/ui/resolve/resolve-self-in-impl.rs diff --git a/src/test/ui/resolve/resolve-self-in-impl.stderr b/src/test/ui/resolve/resolve-self-in-impl.stderr new file mode 100644 index 0000000000000..3fa384808dbd4 --- /dev/null +++ b/src/test/ui/resolve/resolve-self-in-impl.stderr @@ -0,0 +1,43 @@ +error[E0391]: cycle detected when processing `` + --> $DIR/resolve-self-in-impl.rs:24:13 + | +LL | impl Tr for Self {} //~ ERROR cycle detected + | ^^^^ + | + = note: ...which again requires processing ``, completing the cycle + +error[E0391]: cycle detected when processing `` + --> $DIR/resolve-self-in-impl.rs:25:15 + | +LL | impl Tr for S {} //~ ERROR cycle detected + | ^^^^ + | + = note: ...which again requires processing ``, completing the cycle + +error[E0391]: cycle detected when processing `` + --> $DIR/resolve-self-in-impl.rs:26:6 + | +LL | impl Self {} //~ ERROR cycle detected + | ^^^^ + | + = note: ...which again requires processing ``, completing the cycle + +error[E0391]: cycle detected when processing `` + --> $DIR/resolve-self-in-impl.rs:27:8 + | +LL | impl S {} //~ ERROR cycle detected + | ^^^^ + | + = note: ...which again requires processing ``, completing the cycle + +error[E0391]: cycle detected when processing `` + --> $DIR/resolve-self-in-impl.rs:28:1 + | +LL | impl Tr for S {} //~ ERROR cycle detected + | ^^^^^^^^^^^^^^^^^^^^^^ + | + = note: ...which again requires processing ``, 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/resolve/resolve-type-param-in-item-in-trait.rs similarity index 100% rename from src/test/compile-fail/resolve-type-param-in-item-in-trait.rs rename to src/test/ui/resolve/resolve-type-param-in-item-in-trait.rs diff --git a/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr b/src/test/ui/resolve/resolve-type-param-in-item-in-trait.stderr new file mode 100644 index 0000000000000..73ee7102e6e2c --- /dev/null +++ b/src/test/ui/resolve/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 { + | - type variable from outer function +LL | fn outer(&self) { + | ----- try adding a local type parameter in this method instead +LL | enum Foo { +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 { + | - type variable from outer function +LL | fn outer(&self) { + | ----- try adding a local type parameter in this method instead +LL | struct Foo(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 { + | - type variable from outer function +LL | fn outer(&self) { + | ----- try adding a local type parameter in this method instead +LL | struct Foo { 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 { + | - type variable from outer function +LL | fn outer(&self) { +LL | fn foo(a: A) { } + | ------ ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `foo` + +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/resolve/resolve-unknown-trait.rs similarity index 100% rename from src/test/compile-fail/resolve-unknown-trait.rs rename to src/test/ui/resolve/resolve-unknown-trait.rs diff --git a/src/test/ui/resolve/resolve-unknown-trait.stderr b/src/test/ui/resolve/resolve-unknown-trait.stderr new file mode 100644 index 0000000000000..8a2d791654d2f --- /dev/null +++ b/src/test/ui/resolve/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() {} + | ^^^^^^^^^^^^^^^^^^^^ 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/resolve/resolve-variant-assoc-item.rs similarity index 100% rename from src/test/compile-fail/resolve-variant-assoc-item.rs rename to src/test/ui/resolve/resolve-variant-assoc-item.rs diff --git a/src/test/ui/resolve/resolve-variant-assoc-item.stderr b/src/test/ui/resolve/resolve-variant-assoc-item.stderr new file mode 100644 index 0000000000000..a80a7c392496b --- /dev/null +++ b/src/test/ui/resolve/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/resolve_self_super_hint.rs similarity index 100% rename from src/test/compile-fail/resolve_self_super_hint.rs rename to src/test/ui/resolve_self_super_hint.rs diff --git a/src/test/ui/resolve_self_super_hint.stderr b/src/test/ui/resolve_self_super_hint.stderr new file mode 100644 index 0000000000000..8538da06baf64 --- /dev/null +++ b/src/test/ui/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/ret-non-nil.rs similarity index 100% rename from src/test/compile-fail/ret-non-nil.rs rename to src/test/ui/ret-non-nil.rs diff --git a/src/test/ui/ret-non-nil.stderr b/src/test/ui/ret-non-nil.stderr new file mode 100644 index 0000000000000..01f126bd11ea2 --- /dev/null +++ b/src/test/ui/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/retslot-cast.rs similarity index 100% rename from src/test/compile-fail/retslot-cast.rs rename to src/test/ui/retslot-cast.rs diff --git a/src/test/ui/retslot-cast.stderr b/src/test/ui/retslot-cast.stderr new file mode 100644 index 0000000000000..34f6e11f61419 --- /dev/null +++ b/src/test/ui/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`, found trait `std::iter::Iterator + std::marker::Send` + | + = note: expected type `std::option::Option<&dyn std::iter::Iterator>` + found type `std::option::Option<&dyn std::iter::Iterator + 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/return/return-from-diverging.rs similarity index 100% rename from src/test/compile-fail/return-from-diverging.rs rename to src/test/ui/return/return-from-diverging.rs diff --git a/src/test/ui/return/return-from-diverging.stderr b/src/test/ui/return/return-from-diverging.stderr new file mode 100644 index 0000000000000..d965d734327bc --- /dev/null +++ b/src/test/ui/return/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/ui/return-match-array-const.rs b/src/test/ui/return/return-match-array-const.rs similarity index 100% rename from src/test/ui/return-match-array-const.rs rename to src/test/ui/return/return-match-array-const.rs diff --git a/src/test/ui/return-match-array-const.stderr b/src/test/ui/return/return-match-array-const.stderr similarity index 100% rename from src/test/ui/return-match-array-const.stderr rename to src/test/ui/return/return-match-array-const.stderr diff --git a/src/test/ui/return-type.rs b/src/test/ui/return/return-type.rs similarity index 100% rename from src/test/ui/return-type.rs rename to src/test/ui/return/return-type.rs diff --git a/src/test/ui/return-type.stderr b/src/test/ui/return/return-type.stderr similarity index 100% rename from src/test/ui/return-type.stderr rename to src/test/ui/return/return-type.stderr diff --git a/src/test/compile-fail/return-unit-from-diverging.rs b/src/test/ui/return/return-unit-from-diverging.rs similarity index 100% rename from src/test/compile-fail/return-unit-from-diverging.rs rename to src/test/ui/return/return-unit-from-diverging.rs diff --git a/src/test/ui/return/return-unit-from-diverging.stderr b/src/test/ui/return/return-unit-from-diverging.stderr new file mode 100644 index 0000000000000..38d4ca37366ff --- /dev/null +++ b/src/test/ui/return/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/rfc-1937-termination-trait/termination-trait-main-i32.rs similarity index 100% rename from src/test/compile-fail/rfc-1937-termination-trait/termination-trait-main-i32.rs rename to src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr new file mode 100644 index 0000000000000..6f780d1cf1de8 --- /dev/null +++ b/src/test/ui/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/rfc-1937-termination-trait/termination-trait-not-satisfied.rs similarity index 100% rename from src/test/compile-fail/rfc-1937-termination-trait/termination-trait-not-satisfied.rs rename to src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr new file mode 100644 index 0000000000000..e1b173725d428 --- /dev/null +++ b/src/test/ui/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/rfc-2008-non-exhaustive/auxiliary/enums.rs similarity index 100% rename from src/test/compile-fail/rfc-2008-non-exhaustive/auxiliary/enums.rs rename to src/test/ui/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/rfc-2008-non-exhaustive/auxiliary/structs.rs similarity index 100% rename from src/test/compile-fail/rfc-2008-non-exhaustive/auxiliary/structs.rs rename to src/test/ui/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/rfc-2008-non-exhaustive/auxiliary/variants.rs similarity index 100% rename from src/test/compile-fail/rfc-2008-non-exhaustive/auxiliary/variants.rs rename to src/test/ui/rfc-2008-non-exhaustive/auxiliary/variants.rs diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/enum.rs b/src/test/ui/rfc-2008-non-exhaustive/enum.rs similarity index 100% rename from src/test/compile-fail/rfc-2008-non-exhaustive/enum.rs rename to src/test/ui/rfc-2008-non-exhaustive/enum.rs diff --git a/src/test/ui/rfc-2008-non-exhaustive/enum.stderr b/src/test/ui/rfc-2008-non-exhaustive/enum.stderr new file mode 100644 index 0000000000000..5276746734df4 --- /dev/null +++ b/src/test/ui/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/rfc-2008-non-exhaustive/invalid-attribute.rs similarity index 100% rename from src/test/compile-fail/rfc-2008-non-exhaustive/invalid-attribute.rs rename to src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.rs diff --git a/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr b/src/test/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr new file mode 100644 index 0000000000000..d75ad9ec2649f --- /dev/null +++ b/src/test/ui/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/rfc-2008-non-exhaustive/structs.rs similarity index 100% rename from src/test/compile-fail/rfc-2008-non-exhaustive/structs.rs rename to src/test/ui/rfc-2008-non-exhaustive/structs.rs diff --git a/src/test/ui/rfc-2008-non-exhaustive/structs.stderr b/src/test/ui/rfc-2008-non-exhaustive/structs.stderr new file mode 100644 index 0000000000000..c0f7e2786716e --- /dev/null +++ b/src/test/ui/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/rfc-2008-non-exhaustive/variants.rs similarity index 100% rename from src/test/compile-fail/rfc-2008-non-exhaustive/variants.rs rename to src/test/ui/rfc-2008-non-exhaustive/variants.rs diff --git a/src/test/compile-fail/rfc-2008-non-exhaustive/variants_create.rs b/src/test/ui/rfc-2008-non-exhaustive/variants_create.rs similarity index 100% rename from src/test/compile-fail/rfc-2008-non-exhaustive/variants_create.rs rename to src/test/ui/rfc-2008-non-exhaustive/variants_create.rs diff --git a/src/test/ui/rfc-2008-non-exhaustive/variants_create.stderr b/src/test/ui/rfc-2008-non-exhaustive/variants_create.stderr new file mode 100644 index 0000000000000..1e4e0943a699d --- /dev/null +++ b/src/test/ui/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/rfc-2126-crate-paths/crate-path-non-absolute.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-crate-paths/crate-path-non-absolute.rs rename to src/test/ui/rfc-2126-crate-paths/crate-path-non-absolute.rs diff --git a/src/test/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr b/src/test/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr new file mode 100644 index 0000000000000..f4d33e0b9db2f --- /dev/null +++ b/src/test/ui/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/rfc-2126-crate-paths/keyword-crate-as-identifier.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-crate-paths/keyword-crate-as-identifier.rs rename to src/test/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.rs diff --git a/src/test/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr b/src/test/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr new file mode 100644 index 0000000000000..e4d2db057f272 --- /dev/null +++ b/src/test/ui/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/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs rename to src/test/ui/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/rfc-2126-extern-absolute-paths/non-existent-1.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-1.rs rename to src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.rs diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr new file mode 100644 index 0000000000000..27a69ec1b1faf --- /dev/null +++ b/src/test/ui/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/rfc-2126-extern-absolute-paths/non-existent-2.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-2.rs rename to src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr new file mode 100644 index 0000000000000..eb96d5f05d7a6 --- /dev/null +++ b/src/test/ui/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/rfc-2126-extern-absolute-paths/non-existent-3.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-absolute-paths/non-existent-3.rs rename to src/test/ui/rfc-2126-extern-absolute-paths/non-existent-3.rs diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr new file mode 100644 index 0000000000000..434bde79a8322 --- /dev/null +++ b/src/test/ui/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/rfc-2126-extern-absolute-paths/single-segment.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-absolute-paths/single-segment.rs rename to src/test/ui/rfc-2126-extern-absolute-paths/single-segment.rs diff --git a/src/test/ui/rfc-2126-extern-absolute-paths/single-segment.stderr b/src/test/ui/rfc-2126-extern-absolute-paths/single-segment.stderr new file mode 100644 index 0000000000000..cfb1a0ac39ac2 --- /dev/null +++ b/src/test/ui/rfc-2126-extern-absolute-paths/single-segment.stderr @@ -0,0 +1,21 @@ +error: crate root imports need to be explicitly named: `use crate as name;` + --> $DIR/single-segment.rs:14:5 + | +LL | use crate; //~ ERROR crate root imports need to be explicitly named: `use crate as name;` + | ^^^^^ + +error: cannot glob-import all possible crates + --> $DIR/single-segment.rs:15:5 + | +LL | use *; //~ ERROR cannot glob-import all possible crates + | ^ + +error[E0423]: expected value, found module `xcrate` + --> $DIR/single-segment.rs:18:13 + | +LL | let s = ::xcrate; //~ ERROR expected value, found module `xcrate` + | ^^^^^^^^ not a value + +error: aborting due to 3 previous errors + +For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/compile-fail/rfc-2126-extern-in-paths/auxiliary/xcrate.rs b/src/test/ui/rfc-2126-extern-in-paths/auxiliary/xcrate.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-in-paths/auxiliary/xcrate.rs rename to src/test/ui/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/rfc-2126-extern-in-paths/non-existent-1.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-in-paths/non-existent-1.rs rename to src/test/ui/rfc-2126-extern-in-paths/non-existent-1.rs diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr b/src/test/ui/rfc-2126-extern-in-paths/non-existent-1.stderr new file mode 100644 index 0000000000000..c25698c395e1c --- /dev/null +++ b/src/test/ui/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/rfc-2126-extern-in-paths/non-existent-2.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-in-paths/non-existent-2.rs rename to src/test/ui/rfc-2126-extern-in-paths/non-existent-2.rs diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr b/src/test/ui/rfc-2126-extern-in-paths/non-existent-2.stderr new file mode 100644 index 0000000000000..b7ca8890c1942 --- /dev/null +++ b/src/test/ui/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/rfc-2126-extern-in-paths/non-existent-3.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-in-paths/non-existent-3.rs rename to src/test/ui/rfc-2126-extern-in-paths/non-existent-3.rs diff --git a/src/test/ui/rfc-2126-extern-in-paths/non-existent-3.stderr b/src/test/ui/rfc-2126-extern-in-paths/non-existent-3.stderr new file mode 100644 index 0000000000000..fbea89ae93a97 --- /dev/null +++ b/src/test/ui/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:13 + | +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/rfc-2126-extern-in-paths/single-segment.rs similarity index 100% rename from src/test/compile-fail/rfc-2126-extern-in-paths/single-segment.rs rename to src/test/ui/rfc-2126-extern-in-paths/single-segment.rs diff --git a/src/test/ui/rfc-2126-extern-in-paths/single-segment.stderr b/src/test/ui/rfc-2126-extern-in-paths/single-segment.stderr new file mode 100644 index 0000000000000..8b1dd89fe3ca7 --- /dev/null +++ b/src/test/ui/rfc-2126-extern-in-paths/single-segment.stderr @@ -0,0 +1,22 @@ +error: cannot glob-import all possible crates + --> $DIR/single-segment.rs:17:5 + | +LL | use extern::*; //~ ERROR 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:20: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/rfc1445/feature-gate.no_gate.stderr b/src/test/ui/rfc1445/feature-gate.no_gate.stderr new file mode 100644 index 0000000000000..1141b79c7c69f --- /dev/null +++ b/src/test/ui/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/rfc1445/feature-gate.rs similarity index 100% rename from src/test/compile-fail/rfc1445/feature-gate.rs rename to src/test/ui/rfc1445/feature-gate.rs diff --git a/src/test/ui/rfc1445/feature-gate.with_gate.stderr b/src/test/ui/rfc1445/feature-gate.with_gate.stderr new file mode 100644 index 0000000000000..87835162c93f6 --- /dev/null +++ b/src/test/ui/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/rfc1445/match-forbidden-without-eq.rs similarity index 100% rename from src/test/compile-fail/rfc1445/match-forbidden-without-eq.rs rename to src/test/ui/rfc1445/match-forbidden-without-eq.rs diff --git a/src/test/ui/rfc1445/match-forbidden-without-eq.stderr b/src/test/ui/rfc1445/match-forbidden-without-eq.stderr new file mode 100644 index 0000000000000..a2cb536b2127d --- /dev/null +++ b/src/test/ui/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 + +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/rfc1445/match-requires-both-partialeq-and-eq.rs similarity index 100% rename from src/test/compile-fail/rfc1445/match-requires-both-partialeq-and-eq.rs rename to src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.rs diff --git a/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.stderr b/src/test/ui/rfc1445/match-requires-both-partialeq-and-eq.stderr new file mode 100644 index 0000000000000..60f3191cd2767 --- /dev/null +++ b/src/test/ui/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/rfc1623.rs similarity index 100% rename from src/test/compile-fail/rfc1623.rs rename to src/test/ui/rfc1623.rs diff --git a/src/test/ui/rfc1623.stderr b/src/test/ui/rfc1623.stderr new file mode 100644 index 0000000000000..3815558fb257b --- /dev/null +++ b/src/test/ui/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/rfc1717/missing-link-attr.rs similarity index 100% rename from src/test/compile-fail/rfc1717/missing-link-attr.rs rename to src/test/ui/rfc1717/missing-link-attr.rs diff --git a/src/test/ui/rfc1717/missing-link-attr.stderr b/src/test/ui/rfc1717/missing-link-attr.stderr new file mode 100644 index 0000000000000..30555e8094435 --- /dev/null +++ b/src/test/ui/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/rfc1717/multiple-renames.rs similarity index 100% rename from src/test/compile-fail/rfc1717/multiple-renames.rs rename to src/test/ui/rfc1717/multiple-renames.rs diff --git a/src/test/ui/rfc1717/multiple-renames.stderr b/src/test/ui/rfc1717/multiple-renames.stderr new file mode 100644 index 0000000000000..4e5a3647fa2d2 --- /dev/null +++ b/src/test/ui/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/rfc1717/rename-to-empty.rs similarity index 100% rename from src/test/compile-fail/rfc1717/rename-to-empty.rs rename to src/test/ui/rfc1717/rename-to-empty.rs diff --git a/src/test/ui/rfc1717/rename-to-empty.stderr b/src/test/ui/rfc1717/rename-to-empty.stderr new file mode 100644 index 0000000000000..aca839d804fc9 --- /dev/null +++ b/src/test/ui/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/rmeta-lib-pass.rs similarity index 100% rename from src/test/compile-fail/rmeta-lib-pass.rs rename to src/test/ui/rmeta-lib-pass.rs diff --git a/src/test/compile-fail/rmeta-pass.rs b/src/test/ui/rmeta-pass.rs similarity index 100% rename from src/test/compile-fail/rmeta-pass.rs rename to src/test/ui/rmeta-pass.rs diff --git a/src/test/compile-fail/rmeta-priv-warn.rs b/src/test/ui/rmeta-priv-warn.rs similarity index 100% rename from src/test/compile-fail/rmeta-priv-warn.rs rename to src/test/ui/rmeta-priv-warn.rs diff --git a/src/test/compile-fail/rmeta.rs b/src/test/ui/rmeta.rs similarity index 100% rename from src/test/compile-fail/rmeta.rs rename to src/test/ui/rmeta.rs diff --git a/src/test/ui/rmeta.stderr b/src/test/ui/rmeta.stderr new file mode 100644 index 0000000000000..fa154f81b2971 --- /dev/null +++ b/src/test/ui/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/rmeta_lib.rs similarity index 100% rename from src/test/compile-fail/rmeta_lib.rs rename to src/test/ui/rmeta_lib.rs diff --git a/src/test/ui/rmeta_lib.stderr b/src/test/ui/rmeta_lib.stderr new file mode 100644 index 0000000000000..8a9179cca6bc3 --- /dev/null +++ b/src/test/ui/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/rmeta_meta_main.rs similarity index 100% rename from src/test/compile-fail/rmeta_meta_main.rs rename to src/test/ui/rmeta_meta_main.rs diff --git a/src/test/ui/rmeta_meta_main.stderr b/src/test/ui/rmeta_meta_main.stderr new file mode 100644 index 0000000000000..f246a8b5f6383 --- /dev/null +++ b/src/test/ui/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/rust-unstable-column-gated.rs similarity index 100% rename from src/test/compile-fail/rust-unstable-column-gated.rs rename to src/test/ui/rust-unstable-column-gated.rs diff --git a/src/test/ui/rust-unstable-column-gated.stderr b/src/test/ui/rust-unstable-column-gated.stderr new file mode 100644 index 0000000000000..785fcd7af42ad --- /dev/null +++ b/src/test/ui/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/rustc-args-required-const.rs similarity index 100% rename from src/test/compile-fail/rustc-args-required-const.rs rename to src/test/ui/rustc-args-required-const.rs diff --git a/src/test/ui/rustc-args-required-const.stderr b/src/test/ui/rustc-args-required-const.stderr new file mode 100644 index 0000000000000..07f2d880c82b4 --- /dev/null +++ b/src/test/ui/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/rustc-args-required-const2.rs similarity index 100% rename from src/test/compile-fail/rustc-args-required-const2.rs rename to src/test/ui/rustc-args-required-const2.rs diff --git a/src/test/ui/rustc-args-required-const2.stderr b/src/test/ui/rustc-args-required-const2.stderr new file mode 100644 index 0000000000000..766f8adb0b44a --- /dev/null +++ b/src/test/ui/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/rustc-error.rs similarity index 100% rename from src/test/compile-fail/rustc-error.rs rename to src/test/ui/rustc-error.rs diff --git a/src/test/ui/rustc-error.stderr b/src/test/ui/rustc-error.stderr new file mode 100644 index 0000000000000..7456d2af51f82 --- /dev/null +++ b/src/test/ui/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/safe-extern-statics-mut.rs similarity index 100% rename from src/test/compile-fail/safe-extern-statics-mut.rs rename to src/test/ui/safe-extern-statics-mut.rs diff --git a/src/test/ui/safe-extern-statics-mut.stderr b/src/test/ui/safe-extern-statics-mut.stderr new file mode 100644 index 0000000000000..f48dce65afabe --- /dev/null +++ b/src/test/ui/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/safe-extern-statics.rs similarity index 100% rename from src/test/compile-fail/safe-extern-statics.rs rename to src/test/ui/safe-extern-statics.rs diff --git a/src/test/ui/safe-extern-statics.stderr b/src/test/ui/safe-extern-statics.stderr new file mode 100644 index 0000000000000..657d57967bbf1 --- /dev/null +++ b/src/test/ui/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 + = 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 + = 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 + = 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 + = 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/ui/self-impl.rs b/src/test/ui/self/self-impl.rs similarity index 100% rename from src/test/ui/self-impl.rs rename to src/test/ui/self/self-impl.rs diff --git a/src/test/ui/self-impl.stderr b/src/test/ui/self/self-impl.stderr similarity index 100% rename from src/test/ui/self-impl.stderr rename to src/test/ui/self/self-impl.stderr diff --git a/src/test/compile-fail/self-infer.rs b/src/test/ui/self/self-infer.rs similarity index 100% rename from src/test/compile-fail/self-infer.rs rename to src/test/ui/self/self-infer.rs diff --git a/src/test/ui/self/self-infer.stderr b/src/test/ui/self/self-infer.stderr new file mode 100644 index 0000000000000..642e0de52905f --- /dev/null +++ b/src/test/ui/self/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/self/self-vs-path-ambiguity.rs similarity index 100% rename from src/test/compile-fail/self-vs-path-ambiguity.rs rename to src/test/ui/self/self-vs-path-ambiguity.rs diff --git a/src/test/ui/self/self-vs-path-ambiguity.stderr b/src/test/ui/self/self-vs-path-ambiguity.stderr new file mode 100644 index 0000000000000..765174331706a --- /dev/null +++ b/src/test/ui/self/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/self/self_type_keyword-2.rs similarity index 100% rename from src/test/compile-fail/self_type_keyword-2.rs rename to src/test/ui/self/self_type_keyword-2.rs diff --git a/src/test/ui/self/self_type_keyword-2.stderr b/src/test/ui/self/self_type_keyword-2.stderr new file mode 100644 index 0000000000000..972e5bdddc673 --- /dev/null +++ b/src/test/ui/self/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/self/self_type_keyword.rs similarity index 100% rename from src/test/compile-fail/self_type_keyword.rs rename to src/test/ui/self/self_type_keyword.rs diff --git a/src/test/ui/self/self_type_keyword.stderr b/src/test/ui/self/self_type_keyword.stderr new file mode 100644 index 0000000000000..4a7b9a6ce2cee --- /dev/null +++ b/src/test/ui/self/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/seq-args.rs similarity index 100% rename from src/test/compile-fail/seq-args.rs rename to src/test/ui/seq-args.rs diff --git a/src/test/ui/seq-args.stderr b/src/test/ui/seq-args.stderr new file mode 100644 index 0000000000000..dc9d0a7fc0baf --- /dev/null +++ b/src/test/ui/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 seq for Vec { //~ 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 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/ui/shadowed-lifetime.rs b/src/test/ui/shadowed/shadowed-lifetime.rs similarity index 100% rename from src/test/ui/shadowed-lifetime.rs rename to src/test/ui/shadowed/shadowed-lifetime.rs diff --git a/src/test/ui/shadowed-lifetime.stderr b/src/test/ui/shadowed/shadowed-lifetime.stderr similarity index 100% rename from src/test/ui/shadowed-lifetime.stderr rename to src/test/ui/shadowed/shadowed-lifetime.stderr diff --git a/src/test/compile-fail/shadowed-trait-methods.rs b/src/test/ui/shadowed/shadowed-trait-methods.rs similarity index 100% rename from src/test/compile-fail/shadowed-trait-methods.rs rename to src/test/ui/shadowed/shadowed-trait-methods.rs diff --git a/src/test/ui/shadowed/shadowed-trait-methods.stderr b/src/test/ui/shadowed/shadowed-trait-methods.stderr new file mode 100644 index 0000000000000..910f125a14838 --- /dev/null +++ b/src/test/ui/shadowed/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/ui/shadowed-type-parameter.rs b/src/test/ui/shadowed/shadowed-type-parameter.rs similarity index 100% rename from src/test/ui/shadowed-type-parameter.rs rename to src/test/ui/shadowed/shadowed-type-parameter.rs diff --git a/src/test/ui/shadowed-type-parameter.stderr b/src/test/ui/shadowed/shadowed-type-parameter.stderr similarity index 100% rename from src/test/ui/shadowed-type-parameter.stderr rename to src/test/ui/shadowed/shadowed-type-parameter.stderr diff --git a/src/test/compile-fail/shadowed-use-visibility.rs b/src/test/ui/shadowed/shadowed-use-visibility.rs similarity index 100% rename from src/test/compile-fail/shadowed-use-visibility.rs rename to src/test/ui/shadowed/shadowed-use-visibility.rs diff --git a/src/test/ui/shadowed/shadowed-use-visibility.stderr b/src/test/ui/shadowed/shadowed-use-visibility.stderr new file mode 100644 index 0000000000000..5764ed76ef418 --- /dev/null +++ b/src/test/ui/shadowed/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/shadowed/shadowing-in-the-same-pattern.rs similarity index 100% rename from src/test/compile-fail/shadowing-in-the-same-pattern.rs rename to src/test/ui/shadowed/shadowing-in-the-same-pattern.rs diff --git a/src/test/ui/shadowed/shadowing-in-the-same-pattern.stderr b/src/test/ui/shadowed/shadowing-in-the-same-pattern.stderr new file mode 100644 index 0000000000000..4672289147605 --- /dev/null +++ b/src/test/ui/shadowed/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/shift-various-bad-types.rs similarity index 100% rename from src/test/compile-fail/shift-various-bad-types.rs rename to src/test/ui/shift-various-bad-types.rs diff --git a/src/test/ui/shift-various-bad-types.stderr b/src/test/ui/shift-various-bad-types.stderr new file mode 100644 index 0000000000000..7798b619cd9f3 --- /dev/null +++ b/src/test/ui/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` 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/should-fail-no_gate_irrefutable_if_let_pattern.rs similarity index 100% rename from src/test/compile-fail/should-fail-no_gate_irrefutable_if_let_pattern.rs rename to src/test/ui/should-fail-no_gate_irrefutable_if_let_pattern.rs diff --git a/src/test/ui/should-fail-no_gate_irrefutable_if_let_pattern.stderr b/src/test/ui/should-fail-no_gate_irrefutable_if_let_pattern.stderr new file mode 100644 index 0000000000000..d8570ad4e83e4 --- /dev/null +++ b/src/test/ui/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/should-fail-with_gate_irrefutable_pattern_deny.rs similarity index 100% rename from src/test/compile-fail/should-fail-with_gate_irrefutable_pattern_deny.rs rename to src/test/ui/should-fail-with_gate_irrefutable_pattern_deny.rs diff --git a/src/test/ui/should-fail-with_gate_irrefutable_pattern_deny.stderr b/src/test/ui/should-fail-with_gate_irrefutable_pattern_deny.stderr new file mode 100644 index 0000000000000..9dc0d1968e601 --- /dev/null +++ b/src/test/ui/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/simd-intrinsic/simd-intrinsic-declaration-type.rs similarity index 100% rename from src/test/compile-fail/simd-intrinsic-declaration-type.rs rename to src/test/ui/simd-intrinsic/simd-intrinsic-declaration-type.rs diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-declaration-type.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-declaration-type.stderr new file mode 100644 index 0000000000000..4a8fd2d1befc2 --- /dev/null +++ b/src/test/ui/simd-intrinsic/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/simd-intrinsic/simd-intrinsic-generic-arithmetic.rs similarity index 100% rename from src/test/compile-fail/simd-intrinsic-generic-arithmetic.rs rename to src/test/ui/simd-intrinsic/simd-intrinsic-generic-arithmetic.rs diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-arithmetic.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-arithmetic.stderr new file mode 100644 index 0000000000000..f81fa75c56b3f --- /dev/null +++ b/src/test/ui/simd-intrinsic/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/simd-intrinsic/simd-intrinsic-generic-cast.rs similarity index 100% rename from src/test/compile-fail/simd-intrinsic-generic-cast.rs rename to src/test/ui/simd-intrinsic/simd-intrinsic-generic-cast.rs diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-cast.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-cast.stderr new file mode 100644 index 0000000000000..6ad5ac7dbfde4 --- /dev/null +++ b/src/test/ui/simd-intrinsic/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::(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::(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::(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/simd-intrinsic/simd-intrinsic-generic-comparison.rs similarity index 100% rename from src/test/compile-fail/simd-intrinsic-generic-comparison.rs rename to src/test/ui/simd-intrinsic/simd-intrinsic-generic-comparison.rs diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-comparison.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-comparison.stderr new file mode 100644 index 0000000000000..06eb94a4f97c6 --- /dev/null +++ b/src/test/ui/simd-intrinsic/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::(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::(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::(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::(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::(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::(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/simd-intrinsic/simd-intrinsic-generic-elements.rs similarity index 100% rename from src/test/compile-fail/simd-intrinsic-generic-elements.rs rename to src/test/ui/simd-intrinsic/simd-intrinsic-generic-elements.rs diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-elements.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-elements.stderr new file mode 100644 index 0000000000000..5a2def2c8c7d2 --- /dev/null +++ b/src/test/ui/simd-intrinsic/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::(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::(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::(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::(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/simd-intrinsic/simd-intrinsic-generic-reduction.rs similarity index 100% rename from src/test/compile-fail/simd-intrinsic-generic-reduction.rs rename to src/test/ui/simd-intrinsic/simd-intrinsic-generic-reduction.rs diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-reduction.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-reduction.stderr new file mode 100644 index 0000000000000..47b1e9dac7828 --- /dev/null +++ b/src/test/ui/simd-intrinsic/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/simd-intrinsic/simd-intrinsic-generic-select.rs similarity index 100% rename from src/test/compile-fail/simd-intrinsic-generic-select.rs rename to src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr new file mode 100644 index 0000000000000..61e42027039dd --- /dev/null +++ b/src/test/ui/simd-intrinsic/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/simd-intrinsic/simd-intrinsic-single-nominal-type.rs similarity index 100% rename from src/test/compile-fail/simd-intrinsic-single-nominal-type.rs rename to src/test/ui/simd-intrinsic/simd-intrinsic-single-nominal-type.rs diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-single-nominal-type.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-single-nominal-type.stderr new file mode 100644 index 0000000000000..0692aa7275b3f --- /dev/null +++ b/src/test/ui/simd-intrinsic/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/simd-type-generic-monomorphisation.rs similarity index 100% rename from src/test/compile-fail/simd-type-generic-monomorphisation.rs rename to src/test/ui/simd-type-generic-monomorphisation.rs diff --git a/src/test/ui/simd-type-generic-monomorphisation.stderr b/src/test/ui/simd-type-generic-monomorphisation.stderr new file mode 100644 index 0000000000000..2a74506e80ea5 --- /dev/null +++ b/src/test/ui/simd-type-generic-monomorphisation.stderr @@ -0,0 +1,4 @@ +error: monomorphising SIMD type `Simd2` 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/simd-type.rs similarity index 100% rename from src/test/compile-fail/simd-type.rs rename to src/test/ui/simd-type.rs diff --git a/src/test/ui/simd-type.stderr b/src/test/ui/simd-type.stderr new file mode 100644 index 0000000000000..5899f4aacc0ba --- /dev/null +++ b/src/test/ui/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/single-primitive-inherent-impl.rs similarity index 100% rename from src/test/compile-fail/single-primitive-inherent-impl.rs rename to src/test/ui/single-primitive-inherent-impl.rs diff --git a/src/test/ui/single-primitive-inherent-impl.stderr b/src/test/ui/single-primitive-inherent-impl.stderr new file mode 100644 index 0000000000000..b781ee866c0bd --- /dev/null +++ b/src/test/ui/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/sized-cycle-note.rs similarity index 100% rename from src/test/compile-fail/sized-cycle-note.rs rename to src/test/ui/sized-cycle-note.rs diff --git a/src/test/ui/sized-cycle-note.stderr b/src/test/ui/sized-cycle-note.stderr new file mode 100644 index 0000000000000..9665715203860 --- /dev/null +++ b/src/test/ui/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 } + | ^^^^^^^^^^ -------------- 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 } + | ^^^^^^^^^^ -------------- 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/slice-2.rs similarity index 100% rename from src/test/compile-fail/slice-2.rs rename to src/test/ui/slice-2.rs diff --git a/src/test/ui/slice-2.stderr b/src/test/ui/slice-2.stderr new file mode 100644 index 0000000000000..e0f34daf51333 --- /dev/null +++ b/src/test/ui/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/slice-mut-2.nll.stderr b/src/test/ui/slice-mut-2.nll.stderr new file mode 100644 index 0000000000000..98d9297e112a4 --- /dev/null +++ b/src/test/ui/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/slice-mut-2.rs similarity index 100% rename from src/test/compile-fail/slice-mut-2.rs rename to src/test/ui/slice-mut-2.rs diff --git a/src/test/ui/slice-mut-2.stderr b/src/test/ui/slice-mut-2.stderr new file mode 100644 index 0000000000000..4483c6f1a8a2e --- /dev/null +++ b/src/test/ui/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/slice-mut.rs similarity index 100% rename from src/test/compile-fail/slice-mut.rs rename to src/test/ui/slice-mut.rs diff --git a/src/test/ui/slice-mut.stderr b/src/test/ui/slice-mut.stderr new file mode 100644 index 0000000000000..59b70959d86e9 --- /dev/null +++ b/src/test/ui/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/slightly-nice-generic-literal-messages.rs similarity index 100% rename from src/test/compile-fail/slightly-nice-generic-literal-messages.rs rename to src/test/ui/slightly-nice-generic-literal-messages.rs diff --git a/src/test/ui/slightly-nice-generic-literal-messages.stderr b/src/test/ui/slightly-nice-generic-literal-messages.stderr new file mode 100644 index 0000000000000..463eb98b4eeb7 --- /dev/null +++ b/src/test/ui/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/specialization/README.md similarity index 100% rename from src/test/compile-fail/specialization/README.md rename to src/test/ui/specialization/README.md diff --git a/src/test/compile-fail/specialization/defaultimpl/specialization-feature-gate-default.rs b/src/test/ui/specialization/defaultimpl/specialization-feature-gate-default.rs similarity index 100% rename from src/test/compile-fail/specialization/defaultimpl/specialization-feature-gate-default.rs rename to src/test/ui/specialization/defaultimpl/specialization-feature-gate-default.rs diff --git a/src/test/ui/specialization/defaultimpl/specialization-feature-gate-default.stderr b/src/test/ui/specialization/defaultimpl/specialization-feature-gate-default.stderr new file mode 100644 index 0000000000000..d92466967e11a --- /dev/null +++ b/src/test/ui/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 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/specialization/defaultimpl/specialization-no-default.rs similarity index 100% rename from src/test/compile-fail/specialization/defaultimpl/specialization-no-default.rs rename to src/test/ui/specialization/defaultimpl/specialization-no-default.rs diff --git a/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr b/src/test/ui/specialization/defaultimpl/specialization-no-default.stderr new file mode 100644 index 0000000000000..98f5e6d619e9c --- /dev/null +++ b/src/test/ui/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 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 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 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 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 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/specialization/defaultimpl/specialization-trait-item-not-implemented.rs similarity index 100% rename from src/test/compile-fail/specialization/defaultimpl/specialization-trait-item-not-implemented.rs rename to src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented.rs diff --git a/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-item-not-implemented.stderr new file mode 100644 index 0000000000000..c3c2a9840ad5c --- /dev/null +++ b/src/test/ui/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/specialization/defaultimpl/specialization-trait-not-implemented.rs similarity index 100% rename from src/test/compile-fail/specialization/defaultimpl/specialization-trait-not-implemented.rs rename to src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.rs diff --git a/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr b/src/test/ui/specialization/defaultimpl/specialization-trait-not-implemented.stderr new file mode 100644 index 0000000000000..bc597e9f30c00 --- /dev/null +++ b/src/test/ui/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/specialization/defaultimpl/specialization-wfcheck.rs similarity index 100% rename from src/test/compile-fail/specialization/defaultimpl/specialization-wfcheck.rs rename to src/test/ui/specialization/defaultimpl/specialization-wfcheck.rs diff --git a/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr b/src/test/ui/specialization/defaultimpl/specialization-wfcheck.stderr new file mode 100644 index 0000000000000..a623e9708cde7 --- /dev/null +++ b/src/test/ui/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 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/specialization/defaultimpl/validation.rs similarity index 100% rename from src/test/compile-fail/specialization/defaultimpl/validation.rs rename to src/test/ui/specialization/defaultimpl/validation.rs diff --git a/src/test/ui/specialization/defaultimpl/validation.stderr b/src/test/ui/specialization/defaultimpl/validation.stderr new file mode 100644 index 0000000000000..54b92da7b2192 --- /dev/null +++ b/src/test/ui/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/specialization/issue-52050.rs similarity index 100% rename from src/test/compile-fail/specialization/issue-52050.rs rename to src/test/ui/specialization/issue-52050.rs diff --git a/src/test/ui/specialization/issue-52050.stderr b/src/test/ui/specialization/issue-52050.stderr new file mode 100644 index 0000000000000..eee571f8f46cf --- /dev/null +++ b/src/test/ui/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 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/specialization/specialization-default-projection.rs similarity index 100% rename from src/test/compile-fail/specialization/specialization-default-projection.rs rename to src/test/ui/specialization/specialization-default-projection.rs diff --git a/src/test/ui/specialization/specialization-default-projection.stderr b/src/test/ui/specialization/specialization-default-projection.stderr new file mode 100644 index 0000000000000..38b51394711a3 --- /dev/null +++ b/src/test/ui/specialization/specialization-default-projection.stderr @@ -0,0 +1,29 @@ +error[E0308]: mismatched types + --> $DIR/specialization-default-projection.rs:31:5 + | +LL | fn generic() -> ::Assoc { + | ----------------- expected `::Assoc` because of return type +... +LL | () //~ ERROR mismatched types + | ^^ expected associated type, found () + | + = note: expected type `::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/specialization/specialization-default-types.rs similarity index 100% rename from src/test/compile-fail/specialization/specialization-default-types.rs rename to src/test/ui/specialization/specialization-default-types.rs diff --git a/src/test/ui/specialization/specialization-default-types.stderr b/src/test/ui/specialization/specialization-default-types.stderr new file mode 100644 index 0000000000000..a9abc1f6ab57b --- /dev/null +++ b/src/test/ui/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 `::Output` because of return type +LL | Box::new(self) //~ ERROR mismatched types + | ^^^^^^^^^^^^^^ expected associated type, found struct `std::boxed::Box` + | + = note: expected type `::Output` + found type `std::boxed::Box` + +error[E0308]: mismatched types + --> $DIR/specialization-default-types.rs:35:5 + | +LL | fn trouble(t: T) -> Box { + | ------ expected `std::boxed::Box` 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` + found type `::Output` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/specialization-feature-gate-default.rs b/src/test/ui/specialization/specialization-feature-gate-default.rs similarity index 100% rename from src/test/ui/specialization-feature-gate-default.rs rename to src/test/ui/specialization/specialization-feature-gate-default.rs diff --git a/src/test/ui/specialization-feature-gate-default.stderr b/src/test/ui/specialization/specialization-feature-gate-default.stderr similarity index 100% rename from src/test/ui/specialization-feature-gate-default.stderr rename to src/test/ui/specialization/specialization-feature-gate-default.stderr diff --git a/src/test/ui/specialization-feature-gate-overlap.rs b/src/test/ui/specialization/specialization-feature-gate-overlap.rs similarity index 100% rename from src/test/ui/specialization-feature-gate-overlap.rs rename to src/test/ui/specialization/specialization-feature-gate-overlap.rs diff --git a/src/test/ui/specialization-feature-gate-overlap.stderr b/src/test/ui/specialization/specialization-feature-gate-overlap.stderr similarity index 100% rename from src/test/ui/specialization-feature-gate-overlap.stderr rename to src/test/ui/specialization/specialization-feature-gate-overlap.stderr diff --git a/src/test/compile-fail/specialization/specialization-no-default.rs b/src/test/ui/specialization/specialization-no-default.rs similarity index 100% rename from src/test/compile-fail/specialization/specialization-no-default.rs rename to src/test/ui/specialization/specialization-no-default.rs diff --git a/src/test/ui/specialization/specialization-no-default.stderr b/src/test/ui/specialization/specialization-no-default.stderr new file mode 100644 index 0000000000000..880c2e5d6f456 --- /dev/null +++ b/src/test/ui/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 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 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 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 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 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/specialization/specialization-overlap-negative.rs similarity index 100% rename from src/test/compile-fail/specialization/specialization-overlap-negative.rs rename to src/test/ui/specialization/specialization-overlap-negative.rs diff --git a/src/test/ui/specialization/specialization-overlap-negative.stderr b/src/test/ui/specialization/specialization-overlap-negative.stderr new file mode 100644 index 0000000000000..2b85ba54e90df --- /dev/null +++ b/src/test/ui/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 Send for TestType {} + | ------------------------------------------ first implementation here +LL | impl !Send for TestType {} //~ 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/specialization/specialization-overlap.rs similarity index 100% rename from src/test/compile-fail/specialization/specialization-overlap.rs rename to src/test/ui/specialization/specialization-overlap.rs diff --git a/src/test/ui/specialization/specialization-overlap.stderr b/src/test/ui/specialization/specialization-overlap.stderr new file mode 100644 index 0000000000000..6830b7de473fe --- /dev/null +++ b/src/test/ui/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 Foo for T {} + | ------------------------ first implementation here +LL | impl Foo for Vec {} //~ 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 Bar for (T, u8) {} + | ----------------------- first implementation here +LL | impl Bar for (u8, T) {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)` + +error[E0119]: conflicting implementations of trait `Baz` for type `u8`: + --> $DIR/specialization-overlap.rs:23:1 + | +LL | impl Baz for u8 {} + | --------------------- first implementation here +LL | impl Baz for T {} //~ ERROR E0119 + | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8` + +error[E0119]: conflicting implementations of trait `Qux`: + --> $DIR/specialization-overlap.rs:27:1 + | +LL | impl Qux for T {} + | ------------------------ first implementation here +LL | impl 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/specialization/specialization-polarity.rs similarity index 100% rename from src/test/compile-fail/specialization/specialization-polarity.rs rename to src/test/ui/specialization/specialization-polarity.rs diff --git a/src/test/ui/specialization/specialization-polarity.stderr b/src/test/ui/specialization/specialization-polarity.stderr new file mode 100644 index 0000000000000..a4627305885bf --- /dev/null +++ b/src/test/ui/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 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 !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/auxiliary/stability_attribute_issue.rs b/src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs similarity index 100% rename from src/test/compile-fail/auxiliary/stability_attribute_issue.rs rename to src/test/ui/stability-attribute/auxiliary/stability_attribute_issue.rs diff --git a/src/test/compile-fail/stability-attribute-issue-43027.rs b/src/test/ui/stability-attribute/stability-attribute-issue-43027.rs similarity index 100% rename from src/test/compile-fail/stability-attribute-issue-43027.rs rename to src/test/ui/stability-attribute/stability-attribute-issue-43027.rs diff --git a/src/test/ui/stability-attribute/stability-attribute-issue-43027.stderr b/src/test/ui/stability-attribute/stability-attribute-issue-43027.stderr new file mode 100644 index 0000000000000..bdfdd9ccc8780 --- /dev/null +++ b/src/test/ui/stability-attribute/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(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/stability-attribute/stability-attribute-issue.rs similarity index 100% rename from src/test/compile-fail/stability-attribute-issue.rs rename to src/test/ui/stability-attribute/stability-attribute-issue.rs diff --git a/src/test/ui/stability-attribute/stability-attribute-issue.stderr b/src/test/ui/stability-attribute/stability-attribute-issue.stderr new file mode 100644 index 0000000000000..15e91926a7373 --- /dev/null +++ b/src/test/ui/stability-attribute/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/stability-attribute/stability-attribute-non-staged-force-unstable.rs similarity index 100% rename from src/test/compile-fail/stability-attribute-non-staged-force-unstable.rs rename to src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.rs diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr b/src/test/ui/stability-attribute/stability-attribute-non-staged-force-unstable.stderr new file mode 100644 index 0000000000000..479f2ff509521 --- /dev/null +++ b/src/test/ui/stability-attribute/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/stability-attribute/stability-attribute-non-staged.rs similarity index 100% rename from src/test/compile-fail/stability-attribute-non-staged.rs rename to src/test/ui/stability-attribute/stability-attribute-non-staged.rs diff --git a/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr b/src/test/ui/stability-attribute/stability-attribute-non-staged.stderr new file mode 100644 index 0000000000000..f2a9879bd1031 --- /dev/null +++ b/src/test/ui/stability-attribute/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/stability-attribute/stability-attribute-sanity-2.rs similarity index 100% rename from src/test/compile-fail/stability-attribute-sanity-2.rs rename to src/test/ui/stability-attribute/stability-attribute-sanity-2.rs diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity-2.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity-2.stderr new file mode 100644 index 0000000000000..a9d70e2530270 --- /dev/null +++ b/src/test/ui/stability-attribute/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/stability-attribute/stability-attribute-sanity-3.rs similarity index 100% rename from src/test/compile-fail/stability-attribute-sanity-3.rs rename to src/test/ui/stability-attribute/stability-attribute-sanity-3.rs diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity-3.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity-3.stderr new file mode 100644 index 0000000000000..b5b5847e8e1ef --- /dev/null +++ b/src/test/ui/stability-attribute/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/stability-attribute/stability-attribute-sanity.rs similarity index 100% rename from src/test/compile-fail/stability-attribute-sanity.rs rename to src/test/ui/stability-attribute/stability-attribute-sanity.rs diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr new file mode 100644 index 0000000000000..f9d301f643d88 --- /dev/null +++ b/src/test/ui/stability-attribute/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/stable-features.rs similarity index 100% rename from src/test/compile-fail/stable-features.rs rename to src/test/ui/stable-features.rs diff --git a/src/test/ui/stable-features.stderr b/src/test/ui/stable-features.stderr new file mode 100644 index 0000000000000..53d642c07e6be --- /dev/null +++ b/src/test/ui/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-priv-by-default.rs b/src/test/ui/static/auxiliary/static-priv-by-default.rs similarity index 100% rename from src/test/compile-fail/static-priv-by-default.rs rename to src/test/ui/static/auxiliary/static-priv-by-default.rs diff --git a/src/test/compile-fail/auxiliary/static_priv_by_default.rs b/src/test/ui/static/auxiliary/static_priv_by_default.rs similarity index 100% rename from src/test/compile-fail/auxiliary/static_priv_by_default.rs rename to src/test/ui/static/auxiliary/static_priv_by_default.rs diff --git a/src/test/compile-fail/static-closures.rs b/src/test/ui/static/static-closures.rs similarity index 100% rename from src/test/compile-fail/static-closures.rs rename to src/test/ui/static/static-closures.rs diff --git a/src/test/ui/static/static-closures.stderr b/src/test/ui/static/static-closures.stderr new file mode 100644 index 0000000000000..761d8374bcce3 --- /dev/null +++ b/src/test/ui/static/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/static/static-drop-scope.rs similarity index 100% rename from src/test/compile-fail/static-drop-scope.rs rename to src/test/ui/static/static-drop-scope.rs diff --git a/src/test/ui/static/static-drop-scope.stderr b/src/test/ui/static/static-drop-scope.stderr new file mode 100644 index 0000000000000..ce1582393703a --- /dev/null +++ b/src/test/ui/static/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) {} + | ^ 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/static/static-items-cant-move.rs similarity index 100% rename from src/test/compile-fail/static-items-cant-move.rs rename to src/test/ui/static/static-items-cant-move.rs diff --git a/src/test/ui/static/static-items-cant-move.stderr b/src/test/ui/static/static-items-cant-move.stderr new file mode 100644 index 0000000000000..254710b6b2e2f --- /dev/null +++ b/src/test/ui/static/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/static/static-lifetime-bound.nll.stderr b/src/test/ui/static/static-lifetime-bound.nll.stderr new file mode 100644 index 0000000000000..ad4d04343fefb --- /dev/null +++ b/src/test/ui/static/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/static/static-lifetime-bound.rs similarity index 100% rename from src/test/compile-fail/static-lifetime-bound.rs rename to src/test/ui/static/static-lifetime-bound.rs diff --git a/src/test/ui/static/static-lifetime-bound.stderr b/src/test/ui/static/static-lifetime-bound.stderr new file mode 100644 index 0000000000000..0ee2b665cf137 --- /dev/null +++ b/src/test/ui/static/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/ui/static-lifetime.rs b/src/test/ui/static/static-lifetime.rs similarity index 100% rename from src/test/ui/static-lifetime.rs rename to src/test/ui/static/static-lifetime.rs diff --git a/src/test/ui/static-lifetime.stderr b/src/test/ui/static/static-lifetime.stderr similarity index 100% rename from src/test/ui/static-lifetime.stderr rename to src/test/ui/static/static-lifetime.stderr diff --git a/src/test/compile-fail/static-method-privacy.rs b/src/test/ui/static/static-method-privacy.rs similarity index 100% rename from src/test/compile-fail/static-method-privacy.rs rename to src/test/ui/static/static-method-privacy.rs diff --git a/src/test/ui/static/static-method-privacy.stderr b/src/test/ui/static/static-method-privacy.stderr new file mode 100644 index 0000000000000..783b72c8ed27e --- /dev/null +++ b/src/test/ui/static/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/static/static-mut-bad-types.rs similarity index 100% rename from src/test/compile-fail/static-mut-bad-types.rs rename to src/test/ui/static/static-mut-bad-types.rs diff --git a/src/test/ui/static/static-mut-bad-types.stderr b/src/test/ui/static/static-mut-bad-types.stderr new file mode 100644 index 0000000000000..f8bee22b1810b --- /dev/null +++ b/src/test/ui/static/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/static/static-mut-foreign-requires-unsafe.rs similarity index 100% rename from src/test/compile-fail/static-mut-foreign-requires-unsafe.rs rename to src/test/ui/static/static-mut-foreign-requires-unsafe.rs diff --git a/src/test/ui/static/static-mut-foreign-requires-unsafe.stderr b/src/test/ui/static/static-mut-foreign-requires-unsafe.stderr new file mode 100644 index 0000000000000..01cbe784b45be --- /dev/null +++ b/src/test/ui/static/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/static/static-mut-not-constant.rs similarity index 100% rename from src/test/compile-fail/static-mut-not-constant.rs rename to src/test/ui/static/static-mut-not-constant.rs diff --git a/src/test/ui/static/static-mut-not-constant.stderr b/src/test/ui/static/static-mut-not-constant.stderr new file mode 100644 index 0000000000000..ad44121e76316 --- /dev/null +++ b/src/test/ui/static/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 = 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/static/static-mut-not-pat.rs similarity index 100% rename from src/test/compile-fail/static-mut-not-pat.rs rename to src/test/ui/static/static-mut-not-pat.rs diff --git a/src/test/ui/static/static-mut-not-pat.stderr b/src/test/ui/static/static-mut-not-pat.stderr new file mode 100644 index 0000000000000..123cf7b3ac6bd --- /dev/null +++ b/src/test/ui/static/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/static/static-mut-requires-unsafe.rs similarity index 100% rename from src/test/compile-fail/static-mut-requires-unsafe.rs rename to src/test/ui/static/static-mut-requires-unsafe.rs diff --git a/src/test/ui/static/static-mut-requires-unsafe.stderr b/src/test/ui/static/static-mut-requires-unsafe.stderr new file mode 100644 index 0000000000000..310da8f67f371 --- /dev/null +++ b/src/test/ui/static/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-default2.rs b/src/test/ui/static/static-priv-by-default2.rs similarity index 100% rename from src/test/compile-fail/static-priv-by-default2.rs rename to src/test/ui/static/static-priv-by-default2.rs diff --git a/src/test/ui/static/static-priv-by-default2.stderr b/src/test/ui/static/static-priv-by-default2.stderr new file mode 100644 index 0000000000000..0f749b0e4f37a --- /dev/null +++ b/src/test/ui/static/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/static/static-reference-to-fn-1.rs similarity index 100% rename from src/test/compile-fail/static-reference-to-fn-1.rs rename to src/test/ui/static/static-reference-to-fn-1.rs diff --git a/src/test/ui/static/static-reference-to-fn-1.stderr b/src/test/ui/static/static-reference-to-fn-1.stderr new file mode 100644 index 0000000000000..609319f3b7881 --- /dev/null +++ b/src/test/ui/static/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` + found type `&fn() -> std::option::Option {foo}` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/static/static-reference-to-fn-2.nll.stderr b/src/test/ui/static/static-reference-to-fn-2.nll.stderr new file mode 100644 index 0000000000000..9ef94189e90ca --- /dev/null +++ b/src/test/ui/static/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/static/static-reference-to-fn-2.rs similarity index 100% rename from src/test/compile-fail/static-reference-to-fn-2.rs rename to src/test/ui/static/static-reference-to-fn-2.rs diff --git a/src/test/ui/static/static-reference-to-fn-2.stderr b/src/test/ui/static/static-reference-to-fn-2.stderr new file mode 100644 index 0000000000000..a01ab4cef8185 --- /dev/null +++ b/src/test/ui/static/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/static/static-region-bound.rs similarity index 100% rename from src/test/compile-fail/static-region-bound.rs rename to src/test/ui/static/static-region-bound.rs diff --git a/src/test/ui/static/static-region-bound.stderr b/src/test/ui/static/static-region-bound.stderr new file mode 100644 index 0000000000000..ee3398b96d916 --- /dev/null +++ b/src/test/ui/static/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/static/static-vec-repeat-not-constant.rs similarity index 100% rename from src/test/compile-fail/static-vec-repeat-not-constant.rs rename to src/test/ui/static/static-vec-repeat-not-constant.rs diff --git a/src/test/ui/static/static-vec-repeat-not-constant.stderr b/src/test/ui/static/static-vec-repeat-not-constant.stderr new file mode 100644 index 0000000000000..27d1b41ed0b72 --- /dev/null +++ b/src/test/ui/static/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/staticness-mismatch.rs similarity index 100% rename from src/test/compile-fail/staticness-mismatch.rs rename to src/test/ui/staticness-mismatch.rs diff --git a/src/test/ui/staticness-mismatch.stderr b/src/test/ui/staticness-mismatch.stderr new file mode 100644 index 0000000000000..31c06ae8a8892 --- /dev/null +++ b/src/test/ui/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/std-uncopyable-atomics.rs similarity index 100% rename from src/test/compile-fail/std-uncopyable-atomics.rs rename to src/test/ui/std-uncopyable-atomics.rs diff --git a/src/test/ui/std-uncopyable-atomics.stderr b/src/test/ui/std-uncopyable-atomics.stderr new file mode 100644 index 0000000000000..4452bfa95d87e --- /dev/null +++ b/src/test/ui/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/stmt_expr_attrs_no_feature.rs similarity index 100% rename from src/test/compile-fail/stmt_expr_attrs_no_feature.rs rename to src/test/ui/stmt_expr_attrs_no_feature.rs diff --git a/src/test/ui/stmt_expr_attrs_no_feature.stderr b/src/test/ui/stmt_expr_attrs_no_feature.stderr new file mode 100644 index 0000000000000..dc114cef2e52e --- /dev/null +++ b/src/test/ui/stmt_expr_attrs_no_feature.stderr @@ -0,0 +1,75 @@ +error[E0658]: attributes on expressions are experimental. (see issue #15701) + --> $DIR/stmt_expr_attrs_no_feature.rs:23:5 + | +LL | #[attr] //~ ERROR attributes on expressions are experimental + | ^^^^^^^ + | + = 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: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 9 previous errors + +For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/str-array-assignment.rs b/src/test/ui/str/str-array-assignment.rs similarity index 100% rename from src/test/ui/str-array-assignment.rs rename to src/test/ui/str/str-array-assignment.rs diff --git a/src/test/ui/str-array-assignment.stderr b/src/test/ui/str/str-array-assignment.stderr similarity index 100% rename from src/test/ui/str-array-assignment.stderr rename to src/test/ui/str/str-array-assignment.stderr diff --git a/src/test/ui/str-as-char.fixed b/src/test/ui/str/str-as-char.fixed similarity index 100% rename from src/test/ui/str-as-char.fixed rename to src/test/ui/str/str-as-char.fixed diff --git a/src/test/ui/str-as-char.rs b/src/test/ui/str/str-as-char.rs similarity index 100% rename from src/test/ui/str-as-char.rs rename to src/test/ui/str/str-as-char.rs diff --git a/src/test/ui/str-as-char.stderr b/src/test/ui/str/str-as-char.stderr similarity index 100% rename from src/test/ui/str-as-char.stderr rename to src/test/ui/str/str-as-char.stderr diff --git a/src/test/ui/str-concat-on-double-ref.rs b/src/test/ui/str/str-concat-on-double-ref.rs similarity index 100% rename from src/test/ui/str-concat-on-double-ref.rs rename to src/test/ui/str/str-concat-on-double-ref.rs diff --git a/src/test/ui/str-concat-on-double-ref.stderr b/src/test/ui/str/str-concat-on-double-ref.stderr similarity index 100% rename from src/test/ui/str-concat-on-double-ref.stderr rename to src/test/ui/str/str-concat-on-double-ref.stderr diff --git a/src/test/compile-fail/str-idx.rs b/src/test/ui/str/str-idx.rs similarity index 100% rename from src/test/compile-fail/str-idx.rs rename to src/test/ui/str/str-idx.rs diff --git a/src/test/ui/str/str-idx.stderr b/src/test/ui/str/str-idx.stderr new file mode 100644 index 0000000000000..496187c92f187 --- /dev/null +++ b/src/test/ui/str/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/ui/str-lit-type-mismatch.rs b/src/test/ui/str/str-lit-type-mismatch.rs similarity index 100% rename from src/test/ui/str-lit-type-mismatch.rs rename to src/test/ui/str/str-lit-type-mismatch.rs diff --git a/src/test/ui/str-lit-type-mismatch.stderr b/src/test/ui/str/str-lit-type-mismatch.stderr similarity index 100% rename from src/test/ui/str-lit-type-mismatch.stderr rename to src/test/ui/str/str-lit-type-mismatch.stderr diff --git a/src/test/compile-fail/str-mut-idx.rs b/src/test/ui/str/str-mut-idx.rs similarity index 100% rename from src/test/compile-fail/str-mut-idx.rs rename to src/test/ui/str/str-mut-idx.rs diff --git a/src/test/ui/str/str-mut-idx.stderr b/src/test/ui/str/str-mut-idx.stderr new file mode 100644 index 0000000000000..df21ea2b274b6 --- /dev/null +++ b/src/test/ui/str/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 +note: required by `bot` + --> $DIR/str-mut-idx.rs:11:1 + | +LL | fn bot() -> 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 + = 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` 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/auxiliary/struct_field_privacy.rs b/src/test/ui/structs/auxiliary/struct_field_privacy.rs similarity index 100% rename from src/test/compile-fail/auxiliary/struct_field_privacy.rs rename to src/test/ui/structs/auxiliary/struct_field_privacy.rs diff --git a/src/test/compile-fail/auxiliary/struct_variant_privacy.rs b/src/test/ui/structs/auxiliary/struct_variant_privacy.rs similarity index 100% rename from src/test/compile-fail/auxiliary/struct_variant_privacy.rs rename to src/test/ui/structs/auxiliary/struct_variant_privacy.rs diff --git a/src/test/compile-fail/struct-base-wrong-type-2.rs b/src/test/ui/structs/struct-base-wrong-type-2.rs similarity index 100% rename from src/test/compile-fail/struct-base-wrong-type-2.rs rename to src/test/ui/structs/struct-base-wrong-type-2.rs diff --git a/src/test/ui/structs/struct-base-wrong-type-2.stderr b/src/test/ui/structs/struct-base-wrong-type-2.stderr new file mode 100644 index 0000000000000..aab5ed0a74ad6 --- /dev/null +++ b/src/test/ui/structs/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/structs/struct-base-wrong-type.rs similarity index 100% rename from src/test/compile-fail/struct-base-wrong-type.rs rename to src/test/ui/structs/struct-base-wrong-type.rs diff --git a/src/test/ui/structs/struct-base-wrong-type.stderr b/src/test/ui/structs/struct-base-wrong-type.stderr new file mode 100644 index 0000000000000..2c87f52ee04ea --- /dev/null +++ b/src/test/ui/structs/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/ui/struct-duplicate-comma.rs b/src/test/ui/structs/struct-duplicate-comma.rs similarity index 100% rename from src/test/ui/struct-duplicate-comma.rs rename to src/test/ui/structs/struct-duplicate-comma.rs diff --git a/src/test/ui/struct-duplicate-comma.stderr b/src/test/ui/structs/struct-duplicate-comma.stderr similarity index 100% rename from src/test/ui/struct-duplicate-comma.stderr rename to src/test/ui/structs/struct-duplicate-comma.stderr diff --git a/src/test/compile-fail/struct-field-cfg.rs b/src/test/ui/structs/struct-field-cfg.rs similarity index 100% rename from src/test/compile-fail/struct-field-cfg.rs rename to src/test/ui/structs/struct-field-cfg.rs diff --git a/src/test/ui/structs/struct-field-cfg.stderr b/src/test/ui/structs/struct-field-cfg.stderr new file mode 100644 index 0000000000000..db4790659c37b --- /dev/null +++ b/src/test/ui/structs/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/ui/struct-field-init-syntax.rs b/src/test/ui/structs/struct-field-init-syntax.rs similarity index 100% rename from src/test/ui/struct-field-init-syntax.rs rename to src/test/ui/structs/struct-field-init-syntax.rs diff --git a/src/test/ui/struct-field-init-syntax.stderr b/src/test/ui/structs/struct-field-init-syntax.stderr similarity index 100% rename from src/test/ui/struct-field-init-syntax.stderr rename to src/test/ui/structs/struct-field-init-syntax.stderr diff --git a/src/test/compile-fail/struct-field-privacy.rs b/src/test/ui/structs/struct-field-privacy.rs similarity index 100% rename from src/test/compile-fail/struct-field-privacy.rs rename to src/test/ui/structs/struct-field-privacy.rs diff --git a/src/test/ui/structs/struct-field-privacy.stderr b/src/test/ui/structs/struct-field-privacy.stderr new file mode 100644 index 0000000000000..ad3ee12637a35 --- /dev/null +++ b/src/test/ui/structs/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/ui/struct-fields-decl-dupe.rs b/src/test/ui/structs/struct-fields-decl-dupe.rs similarity index 100% rename from src/test/ui/struct-fields-decl-dupe.rs rename to src/test/ui/structs/struct-fields-decl-dupe.rs diff --git a/src/test/ui/struct-fields-decl-dupe.stderr b/src/test/ui/structs/struct-fields-decl-dupe.stderr similarity index 100% rename from src/test/ui/struct-fields-decl-dupe.stderr rename to src/test/ui/structs/struct-fields-decl-dupe.stderr diff --git a/src/test/compile-fail/struct-fields-dupe.rs b/src/test/ui/structs/struct-fields-dupe.rs similarity index 100% rename from src/test/compile-fail/struct-fields-dupe.rs rename to src/test/ui/structs/struct-fields-dupe.rs diff --git a/src/test/ui/structs/struct-fields-dupe.stderr b/src/test/ui/structs/struct-fields-dupe.stderr new file mode 100644 index 0000000000000..fa2079317e094 --- /dev/null +++ b/src/test/ui/structs/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/ui/struct-fields-hints-no-dupe.rs b/src/test/ui/structs/struct-fields-hints-no-dupe.rs similarity index 100% rename from src/test/ui/struct-fields-hints-no-dupe.rs rename to src/test/ui/structs/struct-fields-hints-no-dupe.rs diff --git a/src/test/ui/struct-fields-hints-no-dupe.stderr b/src/test/ui/structs/struct-fields-hints-no-dupe.stderr similarity index 100% rename from src/test/ui/struct-fields-hints-no-dupe.stderr rename to src/test/ui/structs/struct-fields-hints-no-dupe.stderr diff --git a/src/test/ui/struct-fields-hints.rs b/src/test/ui/structs/struct-fields-hints.rs similarity index 100% rename from src/test/ui/struct-fields-hints.rs rename to src/test/ui/structs/struct-fields-hints.rs diff --git a/src/test/ui/struct-fields-hints.stderr b/src/test/ui/structs/struct-fields-hints.stderr similarity index 100% rename from src/test/ui/struct-fields-hints.stderr rename to src/test/ui/structs/struct-fields-hints.stderr diff --git a/src/test/compile-fail/struct-fields-missing.rs b/src/test/ui/structs/struct-fields-missing.rs similarity index 100% rename from src/test/compile-fail/struct-fields-missing.rs rename to src/test/ui/structs/struct-fields-missing.rs diff --git a/src/test/ui/structs/struct-fields-missing.stderr b/src/test/ui/structs/struct-fields-missing.stderr new file mode 100644 index 0000000000000..606288ef27738 --- /dev/null +++ b/src/test/ui/structs/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/structs/struct-fields-shorthand-unresolved.rs similarity index 100% rename from src/test/compile-fail/struct-fields-shorthand-unresolved.rs rename to src/test/ui/structs/struct-fields-shorthand-unresolved.rs diff --git a/src/test/ui/structs/struct-fields-shorthand-unresolved.stderr b/src/test/ui/structs/struct-fields-shorthand-unresolved.stderr new file mode 100644 index 0000000000000..f66ac96e0b756 --- /dev/null +++ b/src/test/ui/structs/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/structs/struct-fields-shorthand.rs similarity index 100% rename from src/test/compile-fail/struct-fields-shorthand.rs rename to src/test/ui/structs/struct-fields-shorthand.rs diff --git a/src/test/ui/structs/struct-fields-shorthand.stderr b/src/test/ui/structs/struct-fields-shorthand.stderr new file mode 100644 index 0000000000000..a65a9c8658177 --- /dev/null +++ b/src/test/ui/structs/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/ui/struct-fields-too-many.rs b/src/test/ui/structs/struct-fields-too-many.rs similarity index 100% rename from src/test/ui/struct-fields-too-many.rs rename to src/test/ui/structs/struct-fields-too-many.rs diff --git a/src/test/ui/struct-fields-too-many.stderr b/src/test/ui/structs/struct-fields-too-many.stderr similarity index 100% rename from src/test/ui/struct-fields-too-many.stderr rename to src/test/ui/structs/struct-fields-too-many.stderr diff --git a/src/test/compile-fail/struct-fields-typo.rs b/src/test/ui/structs/struct-fields-typo.rs similarity index 100% rename from src/test/compile-fail/struct-fields-typo.rs rename to src/test/ui/structs/struct-fields-typo.rs diff --git a/src/test/ui/structs/struct-fields-typo.stderr b/src/test/ui/structs/struct-fields-typo.stderr new file mode 100644 index 0000000000000..9f2f97a6c09c0 --- /dev/null +++ b/src/test/ui/structs/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/structs/struct-like-enum-nonexhaustive.rs similarity index 100% rename from src/test/compile-fail/struct-like-enum-nonexhaustive.rs rename to src/test/ui/structs/struct-like-enum-nonexhaustive.rs diff --git a/src/test/ui/structs/struct-like-enum-nonexhaustive.stderr b/src/test/ui/structs/struct-like-enum-nonexhaustive.stderr new file mode 100644 index 0000000000000..56dbf0c93baf0 --- /dev/null +++ b/src/test/ui/structs/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/ui/struct-missing-comma.rs b/src/test/ui/structs/struct-missing-comma.rs similarity index 100% rename from src/test/ui/struct-missing-comma.rs rename to src/test/ui/structs/struct-missing-comma.rs diff --git a/src/test/ui/struct-missing-comma.stderr b/src/test/ui/structs/struct-missing-comma.stderr similarity index 100% rename from src/test/ui/struct-missing-comma.stderr rename to src/test/ui/structs/struct-missing-comma.stderr diff --git a/src/test/compile-fail/struct-pat-derived-error.rs b/src/test/ui/structs/struct-pat-derived-error.rs similarity index 100% rename from src/test/compile-fail/struct-pat-derived-error.rs rename to src/test/ui/structs/struct-pat-derived-error.rs diff --git a/src/test/ui/structs/struct-pat-derived-error.stderr b/src/test/ui/structs/struct-pat-derived-error.stderr new file mode 100644 index 0000000000000..68b71efc106c2 --- /dev/null +++ b/src/test/ui/structs/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/structs/struct-path-alias-bounds.rs similarity index 100% rename from src/test/compile-fail/struct-path-alias-bounds.rs rename to src/test/ui/structs/struct-path-alias-bounds.rs diff --git a/src/test/ui/structs/struct-path-alias-bounds.stderr b/src/test/ui/structs/struct-path-alias-bounds.stderr new file mode 100644 index 0000000000000..f8e2fe1410f6c --- /dev/null +++ b/src/test/ui/structs/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 { 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/structs/struct-path-associated-type.rs similarity index 100% rename from src/test/compile-fail/struct-path-associated-type.rs rename to src/test/ui/structs/struct-path-associated-type.rs diff --git a/src/test/ui/structs/struct-path-associated-type.stderr b/src/test/ui/structs/struct-path-associated-type.stderr new file mode 100644 index 0000000000000..1364b2a6b0c86 --- /dev/null +++ b/src/test/ui/structs/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:: {}; + | ^^ 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:: {}; + | ^^^^^^^^^^ 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:: {}; //~ 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 `::A` + +error[E0109]: type parameters are not allowed on this type + --> $DIR/struct-path-associated-type.rs:43:20 + | +LL | let z = S::A:: {}; //~ 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:: {}; //~ ERROR ambiguous associated type + | ^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `::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 `::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/ui/struct-path-self-type-mismatch.rs b/src/test/ui/structs/struct-path-self-type-mismatch.rs similarity index 100% rename from src/test/ui/struct-path-self-type-mismatch.rs rename to src/test/ui/structs/struct-path-self-type-mismatch.rs diff --git a/src/test/ui/struct-path-self-type-mismatch.stderr b/src/test/ui/structs/struct-path-self-type-mismatch.stderr similarity index 100% rename from src/test/ui/struct-path-self-type-mismatch.stderr rename to src/test/ui/structs/struct-path-self-type-mismatch.stderr diff --git a/src/test/compile-fail/struct-path-self.rs b/src/test/ui/structs/struct-path-self.rs similarity index 100% rename from src/test/compile-fail/struct-path-self.rs rename to src/test/ui/structs/struct-path-self.rs diff --git a/src/test/ui/structs/struct-path-self.stderr b/src/test/ui/structs/struct-path-self.stderr new file mode 100644 index 0000000000000..1b5506072e81c --- /dev/null +++ b/src/test/ui/structs/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:: {}; + | ^^ 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:: {}; + | ^^^^^^^^^^ 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:: {}; //~ 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:: {}; //~ 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/structs/struct-pattern-match-useless.rs similarity index 100% rename from src/test/compile-fail/struct-pattern-match-useless.rs rename to src/test/ui/structs/struct-pattern-match-useless.rs diff --git a/src/test/ui/structs/struct-pattern-match-useless.stderr b/src/test/ui/structs/struct-pattern-match-useless.stderr new file mode 100644 index 0000000000000..60f17d1d906d2 --- /dev/null +++ b/src/test/ui/structs/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/structs/struct-variant-privacy-xc.rs similarity index 100% rename from src/test/compile-fail/struct-variant-privacy-xc.rs rename to src/test/ui/structs/struct-variant-privacy-xc.rs diff --git a/src/test/ui/structs/struct-variant-privacy-xc.stderr b/src/test/ui/structs/struct-variant-privacy-xc.stderr new file mode 100644 index 0000000000000..731d23e6a978d --- /dev/null +++ b/src/test/ui/structs/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/structs/struct-variant-privacy.rs similarity index 100% rename from src/test/compile-fail/struct-variant-privacy.rs rename to src/test/ui/structs/struct-variant-privacy.rs diff --git a/src/test/ui/structs/struct-variant-privacy.stderr b/src/test/ui/structs/struct-variant-privacy.stderr new file mode 100644 index 0000000000000..a82ac8ab31867 --- /dev/null +++ b/src/test/ui/structs/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/structs/structure-constructor-type-mismatch.rs similarity index 100% rename from src/test/compile-fail/structure-constructor-type-mismatch.rs rename to src/test/ui/structs/structure-constructor-type-mismatch.rs diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.stderr b/src/test/ui/structs/structure-constructor-type-mismatch.stderr new file mode 100644 index 0000000000000..1a88bc09dd6e9 --- /dev/null +++ b/src/test/ui/structs/structure-constructor-type-mismatch.stderr @@ -0,0 +1,139 @@ +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:27:12 + | +LL | x: 1, + | ^ + | | + | expected f32, found integral variable + | help: use a float literal: `1.0` + | + = 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 + | help: use a float literal: `2.0` + | + = 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 + | help: use a float literal: `3.0` + | + = 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 + | help: use a float literal: `4.0` + | + = 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 + | help: use a float literal: `5.0` + | + = 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 + | help: use a float literal: `7.0` + | + = 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:: { //~ 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 + | help: use a float literal: `9.0` + | + = 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 + | help: use a float literal: `10.0` + | + = 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:: { .. } => {} //~ ERROR wrong number of type arguments + | ^^^^^^^^^^^^^ expected no type arguments + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:64:9 + | +LL | PointF:: { .. } => {} //~ ERROR wrong number of type arguments + | ^^^^^^^^^^^^^^^^^^^^ expected integral variable, found f32 + | + = note: expected type `Point<{integer}>` + found type `Point` + +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` + +error[E0308]: mismatched types + --> $DIR/structure-constructor-type-mismatch.rs:77:9 + | +LL | PairF:: { .. } => {} //~ ERROR mismatched types + | ^^^^^^^^^^^^^^^^^^^ expected integral variable, found f32 + | + = note: expected type `Pair<{integer}, {integer}>` + found type `Pair` + +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/substs-ppaux.normal.stderr b/src/test/ui/substs-ppaux.normal.stderr new file mode 100644 index 0000000000000..9f87329fb34ed --- /dev/null +++ b/src/test/ui/substs-ppaux.normal.stderr @@ -0,0 +1,55 @@ +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:25:17 + | +LL | let x: () = >::bar::<'static, char>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {>::bar::<'static, char>}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:34:17 + | +LL | let x: () = >::bar::<'static, char>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {>::bar::<'static, char>}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:42:17 + | +LL | let x: () = >::baz; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {>::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 | >::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 + = 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/substs-ppaux.rs similarity index 100% rename from src/test/compile-fail/substs-ppaux.rs rename to src/test/ui/substs-ppaux.rs diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/substs-ppaux.verbose.stderr new file mode 100644 index 0000000000000..2daa960be3af8 --- /dev/null +++ b/src/test/ui/substs-ppaux.verbose.stderr @@ -0,0 +1,55 @@ +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:25:17 + | +LL | let x: () = >::bar::<'static, char>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {>::bar::}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:34:17 + | +LL | let x: () = >::bar::<'static, char>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {>::bar::}` + +error[E0308]: mismatched types + --> $DIR/substs-ppaux.rs:42:17 + | +LL | let x: () = >::baz; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found fn item + | + = note: expected type `()` + found type `fn() {>::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::}` + +error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/substs-ppaux.rs:58:5 + | +LL | >::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 + = 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/suffixed-literal-meta.rs similarity index 100% rename from src/test/compile-fail/suffixed-literal-meta.rs rename to src/test/ui/suffixed-literal-meta.rs diff --git a/src/test/ui/suffixed-literal-meta.stderr b/src/test/ui/suffixed-literal-meta.stderr new file mode 100644 index 0000000000000..6d88ab1df16b4 --- /dev/null +++ b/src/test/ui/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/ui/auxiliary/struct_field_privacy.rs b/src/test/ui/suggestions/auxiliary/struct_field_privacy.rs similarity index 100% rename from src/test/ui/auxiliary/struct_field_privacy.rs rename to src/test/ui/suggestions/auxiliary/struct_field_privacy.rs diff --git a/src/test/ui/suggest-labels.rs b/src/test/ui/suggestions/suggest-labels.rs similarity index 100% rename from src/test/ui/suggest-labels.rs rename to src/test/ui/suggestions/suggest-labels.rs diff --git a/src/test/ui/suggest-labels.stderr b/src/test/ui/suggestions/suggest-labels.stderr similarity index 100% rename from src/test/ui/suggest-labels.stderr rename to src/test/ui/suggestions/suggest-labels.stderr diff --git a/src/test/ui/suggest-methods.rs b/src/test/ui/suggestions/suggest-methods.rs similarity index 100% rename from src/test/ui/suggest-methods.rs rename to src/test/ui/suggestions/suggest-methods.rs diff --git a/src/test/ui/suggest-methods.stderr b/src/test/ui/suggestions/suggest-methods.stderr similarity index 100% rename from src/test/ui/suggest-methods.stderr rename to src/test/ui/suggestions/suggest-methods.stderr diff --git a/src/test/ui/suggest-private-fields.rs b/src/test/ui/suggestions/suggest-private-fields.rs similarity index 100% rename from src/test/ui/suggest-private-fields.rs rename to src/test/ui/suggestions/suggest-private-fields.rs diff --git a/src/test/ui/suggest-private-fields.stderr b/src/test/ui/suggestions/suggest-private-fields.stderr similarity index 100% rename from src/test/ui/suggest-private-fields.stderr rename to src/test/ui/suggestions/suggest-private-fields.stderr diff --git a/src/test/ui/suggest-ref-mut.rs b/src/test/ui/suggestions/suggest-ref-mut.rs similarity index 100% rename from src/test/ui/suggest-ref-mut.rs rename to src/test/ui/suggestions/suggest-ref-mut.rs diff --git a/src/test/ui/suggest-ref-mut.stderr b/src/test/ui/suggestions/suggest-ref-mut.stderr similarity index 100% rename from src/test/ui/suggest-ref-mut.stderr rename to src/test/ui/suggestions/suggest-ref-mut.stderr diff --git a/src/test/ui/suggest-remove-refs-1.rs b/src/test/ui/suggestions/suggest-remove-refs-1.rs similarity index 100% rename from src/test/ui/suggest-remove-refs-1.rs rename to src/test/ui/suggestions/suggest-remove-refs-1.rs diff --git a/src/test/ui/suggest-remove-refs-1.stderr b/src/test/ui/suggestions/suggest-remove-refs-1.stderr similarity index 100% rename from src/test/ui/suggest-remove-refs-1.stderr rename to src/test/ui/suggestions/suggest-remove-refs-1.stderr diff --git a/src/test/ui/suggest-remove-refs-2.rs b/src/test/ui/suggestions/suggest-remove-refs-2.rs similarity index 100% rename from src/test/ui/suggest-remove-refs-2.rs rename to src/test/ui/suggestions/suggest-remove-refs-2.rs diff --git a/src/test/ui/suggest-remove-refs-2.stderr b/src/test/ui/suggestions/suggest-remove-refs-2.stderr similarity index 100% rename from src/test/ui/suggest-remove-refs-2.stderr rename to src/test/ui/suggestions/suggest-remove-refs-2.stderr diff --git a/src/test/ui/suggest-remove-refs-3.rs b/src/test/ui/suggestions/suggest-remove-refs-3.rs similarity index 100% rename from src/test/ui/suggest-remove-refs-3.rs rename to src/test/ui/suggestions/suggest-remove-refs-3.rs diff --git a/src/test/ui/suggest-remove-refs-3.stderr b/src/test/ui/suggestions/suggest-remove-refs-3.stderr similarity index 100% rename from src/test/ui/suggest-remove-refs-3.stderr rename to src/test/ui/suggestions/suggest-remove-refs-3.stderr diff --git a/src/test/compile-fail/super-at-top-level.rs b/src/test/ui/super-at-top-level.rs similarity index 100% rename from src/test/compile-fail/super-at-top-level.rs rename to src/test/ui/super-at-top-level.rs diff --git a/src/test/ui/super-at-top-level.stderr b/src/test/ui/super-at-top-level.stderr new file mode 100644 index 0000000000000..b4af73055a01d --- /dev/null +++ b/src/test/ui/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/suppressed-error.rs similarity index 100% rename from src/test/compile-fail/suppressed-error.rs rename to src/test/ui/suppressed-error.rs diff --git a/src/test/ui/suppressed-error.stderr b/src/test/ui/suppressed-error.stderr new file mode 100644 index 0000000000000..d17e7cb689117 --- /dev/null +++ b/src/test/ui/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/ui/auxiliary/svh-a-base.rs b/src/test/ui/svh/auxiliary/svh-a-base.rs similarity index 100% rename from src/test/ui/auxiliary/svh-a-base.rs rename to src/test/ui/svh/auxiliary/svh-a-base.rs diff --git a/src/test/ui/auxiliary/svh-a-change-lit.rs b/src/test/ui/svh/auxiliary/svh-a-change-lit.rs similarity index 100% rename from src/test/ui/auxiliary/svh-a-change-lit.rs rename to src/test/ui/svh/auxiliary/svh-a-change-lit.rs diff --git a/src/test/ui/auxiliary/svh-a-change-significant-cfg.rs b/src/test/ui/svh/auxiliary/svh-a-change-significant-cfg.rs similarity index 100% rename from src/test/ui/auxiliary/svh-a-change-significant-cfg.rs rename to src/test/ui/svh/auxiliary/svh-a-change-significant-cfg.rs diff --git a/src/test/ui/auxiliary/svh-a-change-trait-bound.rs b/src/test/ui/svh/auxiliary/svh-a-change-trait-bound.rs similarity index 100% rename from src/test/ui/auxiliary/svh-a-change-trait-bound.rs rename to src/test/ui/svh/auxiliary/svh-a-change-trait-bound.rs diff --git a/src/test/ui/auxiliary/svh-a-change-type-arg.rs b/src/test/ui/svh/auxiliary/svh-a-change-type-arg.rs similarity index 100% rename from src/test/ui/auxiliary/svh-a-change-type-arg.rs rename to src/test/ui/svh/auxiliary/svh-a-change-type-arg.rs diff --git a/src/test/ui/auxiliary/svh-a-change-type-ret.rs b/src/test/ui/svh/auxiliary/svh-a-change-type-ret.rs similarity index 100% rename from src/test/ui/auxiliary/svh-a-change-type-ret.rs rename to src/test/ui/svh/auxiliary/svh-a-change-type-ret.rs diff --git a/src/test/ui/auxiliary/svh-a-change-type-static.rs b/src/test/ui/svh/auxiliary/svh-a-change-type-static.rs similarity index 100% rename from src/test/ui/auxiliary/svh-a-change-type-static.rs rename to src/test/ui/svh/auxiliary/svh-a-change-type-static.rs diff --git a/src/test/ui/auxiliary/svh-b.rs b/src/test/ui/svh/auxiliary/svh-b.rs similarity index 100% rename from src/test/ui/auxiliary/svh-b.rs rename to src/test/ui/svh/auxiliary/svh-b.rs diff --git a/src/test/ui/auxiliary/svh-uta-base.rs b/src/test/ui/svh/auxiliary/svh-uta-base.rs similarity index 100% rename from src/test/ui/auxiliary/svh-uta-base.rs rename to src/test/ui/svh/auxiliary/svh-uta-base.rs diff --git a/src/test/ui/auxiliary/svh-uta-change-use-trait.rs b/src/test/ui/svh/auxiliary/svh-uta-change-use-trait.rs similarity index 100% rename from src/test/ui/auxiliary/svh-uta-change-use-trait.rs rename to src/test/ui/svh/auxiliary/svh-uta-change-use-trait.rs diff --git a/src/test/ui/auxiliary/svh-utb.rs b/src/test/ui/svh/auxiliary/svh-utb.rs similarity index 100% rename from src/test/ui/auxiliary/svh-utb.rs rename to src/test/ui/svh/auxiliary/svh-utb.rs diff --git a/src/test/ui/svh-change-lit.rs b/src/test/ui/svh/svh-change-lit.rs similarity index 100% rename from src/test/ui/svh-change-lit.rs rename to src/test/ui/svh/svh-change-lit.rs diff --git a/src/test/ui/svh-change-lit.stderr b/src/test/ui/svh/svh-change-lit.stderr similarity index 100% rename from src/test/ui/svh-change-lit.stderr rename to src/test/ui/svh/svh-change-lit.stderr diff --git a/src/test/ui/svh-change-significant-cfg.rs b/src/test/ui/svh/svh-change-significant-cfg.rs similarity index 100% rename from src/test/ui/svh-change-significant-cfg.rs rename to src/test/ui/svh/svh-change-significant-cfg.rs diff --git a/src/test/ui/svh-change-significant-cfg.stderr b/src/test/ui/svh/svh-change-significant-cfg.stderr similarity index 100% rename from src/test/ui/svh-change-significant-cfg.stderr rename to src/test/ui/svh/svh-change-significant-cfg.stderr diff --git a/src/test/ui/svh-change-trait-bound.rs b/src/test/ui/svh/svh-change-trait-bound.rs similarity index 100% rename from src/test/ui/svh-change-trait-bound.rs rename to src/test/ui/svh/svh-change-trait-bound.rs diff --git a/src/test/ui/svh-change-trait-bound.stderr b/src/test/ui/svh/svh-change-trait-bound.stderr similarity index 100% rename from src/test/ui/svh-change-trait-bound.stderr rename to src/test/ui/svh/svh-change-trait-bound.stderr diff --git a/src/test/ui/svh-change-type-arg.rs b/src/test/ui/svh/svh-change-type-arg.rs similarity index 100% rename from src/test/ui/svh-change-type-arg.rs rename to src/test/ui/svh/svh-change-type-arg.rs diff --git a/src/test/ui/svh-change-type-arg.stderr b/src/test/ui/svh/svh-change-type-arg.stderr similarity index 100% rename from src/test/ui/svh-change-type-arg.stderr rename to src/test/ui/svh/svh-change-type-arg.stderr diff --git a/src/test/ui/svh-change-type-ret.rs b/src/test/ui/svh/svh-change-type-ret.rs similarity index 100% rename from src/test/ui/svh-change-type-ret.rs rename to src/test/ui/svh/svh-change-type-ret.rs diff --git a/src/test/ui/svh-change-type-ret.stderr b/src/test/ui/svh/svh-change-type-ret.stderr similarity index 100% rename from src/test/ui/svh-change-type-ret.stderr rename to src/test/ui/svh/svh-change-type-ret.stderr diff --git a/src/test/ui/svh-change-type-static.rs b/src/test/ui/svh/svh-change-type-static.rs similarity index 100% rename from src/test/ui/svh-change-type-static.rs rename to src/test/ui/svh/svh-change-type-static.rs diff --git a/src/test/ui/svh-change-type-static.stderr b/src/test/ui/svh/svh-change-type-static.stderr similarity index 100% rename from src/test/ui/svh-change-type-static.stderr rename to src/test/ui/svh/svh-change-type-static.stderr diff --git a/src/test/ui/svh-use-trait.rs b/src/test/ui/svh/svh-use-trait.rs similarity index 100% rename from src/test/ui/svh-use-trait.rs rename to src/test/ui/svh/svh-use-trait.rs diff --git a/src/test/ui/svh-use-trait.stderr b/src/test/ui/svh/svh-use-trait.stderr similarity index 100% rename from src/test/ui/svh-use-trait.stderr rename to src/test/ui/svh/svh-use-trait.stderr diff --git a/src/test/compile-fail/symbol-names/basic.rs b/src/test/ui/symbol-names/basic.rs similarity index 100% rename from src/test/compile-fail/symbol-names/basic.rs rename to src/test/ui/symbol-names/basic.rs diff --git a/src/test/ui/symbol-names/basic.stderr b/src/test/ui/symbol-names/basic.stderr new file mode 100644 index 0000000000000..eeeb1b5e34d8b --- /dev/null +++ b/src/test/ui/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/symbol-names/impl1.rs similarity index 100% rename from src/test/compile-fail/symbol-names/impl1.rs rename to src/test/ui/symbol-names/impl1.rs diff --git a/src/test/ui/symbol-names/impl1.stderr b/src/test/ui/symbol-names/impl1.stderr new file mode 100644 index 0000000000000..edce692969556 --- /dev/null +++ b/src/test/ui/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::::baz) + --> $DIR/impl1.rs:29:9 + | +LL | #[rustc_item_path] //~ ERROR item-path(bar::::baz) + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + diff --git a/src/test/compile-fail/syntax-extension-minor.rs b/src/test/ui/syntax-extension-minor.rs similarity index 100% rename from src/test/compile-fail/syntax-extension-minor.rs rename to src/test/ui/syntax-extension-minor.rs diff --git a/src/test/ui/syntax-extension-minor.stderr b/src/test/ui/syntax-extension-minor.stderr new file mode 100644 index 0000000000000..7df1f30314678 --- /dev/null +++ b/src/test/ui/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/syntax-trait-polarity-feature-gate.rs similarity index 100% rename from src/test/compile-fail/syntax-trait-polarity-feature-gate.rs rename to src/test/ui/syntax-trait-polarity-feature-gate.rs diff --git a/src/test/ui/syntax-trait-polarity-feature-gate.stderr b/src/test/ui/syntax-trait-polarity-feature-gate.stderr new file mode 100644 index 0000000000000..eebd018b8873c --- /dev/null +++ b/src/test/ui/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/syntax-trait-polarity.rs similarity index 100% rename from src/test/compile-fail/syntax-trait-polarity.rs rename to src/test/ui/syntax-trait-polarity.rs diff --git a/src/test/ui/syntax-trait-polarity.stderr b/src/test/ui/syntax-trait-polarity.stderr new file mode 100644 index 0000000000000..724ac60ed91a2 --- /dev/null +++ b/src/test/ui/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 !TestType2 {} + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0198]: negative impls cannot be unsafe + --> $DIR/syntax-trait-polarity.rs:32:1 + | +LL | unsafe impl !Send for TestType2 {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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 !TestTrait for TestType2 {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/synthetic-param.rs similarity index 100% rename from src/test/compile-fail/synthetic-param.rs rename to src/test/ui/synthetic-param.rs diff --git a/src/test/ui/synthetic-param.stderr b/src/test/ui/synthetic-param.stderr new file mode 100644 index 0000000000000..2711f6f8bdc49 --- /dev/null +++ b/src/test/ui/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::(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::(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::::func::(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/tag-that-dare-not-speak-its-name.rs similarity index 100% rename from src/test/compile-fail/tag-that-dare-not-speak-its-name.rs rename to src/test/ui/tag-that-dare-not-speak-its-name.rs diff --git a/src/test/ui/tag-that-dare-not-speak-its-name.stderr b/src/test/ui/tag-that-dare-not-speak-its-name.stderr new file mode 100644 index 0000000000000..b9580eafc33c9 --- /dev/null +++ b/src/test/ui/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/tag-type-args.rs similarity index 100% rename from src/test/compile-fail/tag-type-args.rs rename to src/test/ui/tag-type-args.rs diff --git a/src/test/ui/tag-type-args.stderr b/src/test/ui/tag-type-args.stderr new file mode 100644 index 0000000000000..1431ee9cc8647 --- /dev/null +++ b/src/test/ui/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/tag-variant-cast-non-nullary.rs similarity index 100% rename from src/test/compile-fail/tag-variant-cast-non-nullary.rs rename to src/test/ui/tag-variant-cast-non-nullary.rs diff --git a/src/test/ui/tag-variant-cast-non-nullary.stderr b/src/test/ui/tag-variant-cast-non-nullary.stderr new file mode 100644 index 0000000000000..1e64c74d1212f --- /dev/null +++ b/src/test/ui/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/tag-variant-disr-dup.rs similarity index 100% rename from src/test/compile-fail/tag-variant-disr-dup.rs rename to src/test/ui/tag-variant-disr-dup.rs diff --git a/src/test/ui/tag-variant-disr-dup.stderr b/src/test/ui/tag-variant-disr-dup.stderr new file mode 100644 index 0000000000000..de5a0fac54fee --- /dev/null +++ b/src/test/ui/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/tail-typeck.rs similarity index 100% rename from src/test/compile-fail/tail-typeck.rs rename to src/test/ui/tail-typeck.rs diff --git a/src/test/ui/tail-typeck.stderr b/src/test/ui/tail-typeck.stderr new file mode 100644 index 0000000000000..302bd6aa2d84d --- /dev/null +++ b/src/test/ui/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/terr-in-field.rs similarity index 100% rename from src/test/compile-fail/terr-in-field.rs rename to src/test/ui/terr-in-field.rs diff --git a/src/test/ui/terr-in-field.stderr b/src/test/ui/terr-in-field.stderr new file mode 100644 index 0000000000000..5d06eef90be40 --- /dev/null +++ b/src/test/ui/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/terr-sorts.rs similarity index 100% rename from src/test/compile-fail/terr-sorts.rs rename to src/test/ui/terr-sorts.rs diff --git a/src/test/ui/terr-sorts.stderr b/src/test/ui/terr-sorts.stderr new file mode 100644 index 0000000000000..a16216c842e49 --- /dev/null +++ b/src/test/ui/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` + +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/test-cfg.rs similarity index 100% rename from src/test/compile-fail/test-cfg.rs rename to src/test/ui/test-cfg.rs diff --git a/src/test/ui/test-cfg.stderr b/src/test/ui/test-cfg.stderr new file mode 100644 index 0000000000000..1db6d5eccbeb5 --- /dev/null +++ b/src/test/ui/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/test-warns-dead-code.rs similarity index 100% rename from src/test/compile-fail/test-warns-dead-code.rs rename to src/test/ui/test-warns-dead-code.rs diff --git a/src/test/ui/test-warns-dead-code.stderr b/src/test/ui/test-warns-dead-code.stderr new file mode 100644 index 0000000000000..46ff31c65d6d0 --- /dev/null +++ b/src/test/ui/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/thread-local-in-ctfe.nll.stderr b/src/test/ui/thread-local-in-ctfe.nll.stderr new file mode 100644 index 0000000000000..c9c0ac2b2d94b --- /dev/null +++ b/src/test/ui/thread-local-in-ctfe.nll.stderr @@ -0,0 +1,50 @@ +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[E0712]: thread-local variable borrowed past end of function + --> $DIR/thread-local-in-ctfe.rs:19:18 + | +LL | static C: &u32 = &A; + | ^^- end of enclosing function is here + | | + | thread-local variables cannot be borrowed beyond the end of the function + +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[E0712]: thread-local variable borrowed past end of function + --> $DIR/thread-local-in-ctfe.rs:25:17 + | +LL | const E: &u32 = &A; + | ^^- end of enclosing function is here + | | + | thread-local variables cannot be borrowed beyond the end of the function + +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: E0625, E0712. +For more information about an error, try `rustc --explain E0625`. diff --git a/src/test/compile-fail/thread-local-in-ctfe.rs b/src/test/ui/thread-local-in-ctfe.rs similarity index 100% rename from src/test/compile-fail/thread-local-in-ctfe.rs rename to src/test/ui/thread-local-in-ctfe.rs diff --git a/src/test/ui/thread-local-in-ctfe.stderr b/src/test/ui/thread-local-in-ctfe.stderr new file mode 100644 index 0000000000000..76079d9a9ee88 --- /dev/null +++ b/src/test/ui/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/ui/tool-attributes-disabled-1.rs b/src/test/ui/tool-attributes/tool-attributes-disabled-1.rs similarity index 100% rename from src/test/ui/tool-attributes-disabled-1.rs rename to src/test/ui/tool-attributes/tool-attributes-disabled-1.rs diff --git a/src/test/ui/tool-attributes-disabled-1.stderr b/src/test/ui/tool-attributes/tool-attributes-disabled-1.stderr similarity index 100% rename from src/test/ui/tool-attributes-disabled-1.stderr rename to src/test/ui/tool-attributes/tool-attributes-disabled-1.stderr diff --git a/src/test/ui/tool-attributes-disabled-2.rs b/src/test/ui/tool-attributes/tool-attributes-disabled-2.rs similarity index 100% rename from src/test/ui/tool-attributes-disabled-2.rs rename to src/test/ui/tool-attributes/tool-attributes-disabled-2.rs diff --git a/src/test/ui/tool-attributes-disabled-2.stderr b/src/test/ui/tool-attributes/tool-attributes-disabled-2.stderr similarity index 100% rename from src/test/ui/tool-attributes-disabled-2.stderr rename to src/test/ui/tool-attributes/tool-attributes-disabled-2.stderr diff --git a/src/test/ui/tool-attributes-misplaced-1.rs b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs similarity index 100% rename from src/test/ui/tool-attributes-misplaced-1.rs rename to src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs diff --git a/src/test/ui/tool-attributes-misplaced-1.stderr b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr similarity index 100% rename from src/test/ui/tool-attributes-misplaced-1.stderr rename to src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr diff --git a/src/test/ui/tool-attributes-misplaced-2.rs b/src/test/ui/tool-attributes/tool-attributes-misplaced-2.rs similarity index 100% rename from src/test/ui/tool-attributes-misplaced-2.rs rename to src/test/ui/tool-attributes/tool-attributes-misplaced-2.rs diff --git a/src/test/ui/tool-attributes-misplaced-2.stderr b/src/test/ui/tool-attributes/tool-attributes-misplaced-2.stderr similarity index 100% rename from src/test/ui/tool-attributes-misplaced-2.stderr rename to src/test/ui/tool-attributes/tool-attributes-misplaced-2.stderr diff --git a/src/test/ui/tool-attributes-shadowing.rs b/src/test/ui/tool-attributes/tool-attributes-shadowing.rs similarity index 100% rename from src/test/ui/tool-attributes-shadowing.rs rename to src/test/ui/tool-attributes/tool-attributes-shadowing.rs diff --git a/src/test/ui/tool-attributes-shadowing.stderr b/src/test/ui/tool-attributes/tool-attributes-shadowing.stderr similarity index 100% rename from src/test/ui/tool-attributes-shadowing.stderr rename to src/test/ui/tool-attributes/tool-attributes-shadowing.stderr diff --git a/src/test/compile-fail/tool_lints.rs b/src/test/ui/tool_lints-fail.rs similarity index 100% rename from src/test/compile-fail/tool_lints.rs rename to src/test/ui/tool_lints-fail.rs diff --git a/src/test/ui/tool_lints-fail.stderr b/src/test/ui/tool_lints-fail.stderr new file mode 100644 index 0000000000000..735673b5785e8 --- /dev/null +++ b/src/test/ui/tool_lints-fail.stderr @@ -0,0 +1,14 @@ +error: unknown lint: `clippy` + --> $DIR/tool_lints-fail.rs:16:9 + | +LL | #![deny(clippy)] //~ ERROR: unknown lint: `clippy` + | ^^^^^^ + | +note: lint level defined here + --> $DIR/tool_lints-fail.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/trace_macros-format.rs similarity index 100% rename from src/test/compile-fail/trace_macros-format.rs rename to src/test/ui/trace_macros-format.rs diff --git a/src/test/ui/trace_macros-format.stderr b/src/test/ui/trace_macros-format.stderr new file mode 100644 index 0000000000000..8dad041e9fe4a --- /dev/null +++ b/src/test/ui/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/trace_macros-gate.rs similarity index 100% rename from src/test/compile-fail/trace_macros-gate.rs rename to src/test/ui/trace_macros-gate.rs diff --git a/src/test/ui/trace_macros-gate.stderr b/src/test/ui/trace_macros-gate.stderr new file mode 100644 index 0000000000000..ed92e1227baf5 --- /dev/null +++ b/src/test/ui/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/trait-alias-fail.rs similarity index 100% rename from src/test/compile-fail/trait-alias.rs rename to src/test/ui/trait-alias-fail.rs diff --git a/src/test/ui/trait-alias-fail.stderr b/src/test/ui/trait-alias-fail.stderr new file mode 100644 index 0000000000000..f7b144c06f80a --- /dev/null +++ b/src/test/ui/trait-alias-fail.stderr @@ -0,0 +1,44 @@ +error: type parameters on the left side of a trait alias cannot be bounded + --> $DIR/trait-alias-fail.rs:15:14 + | +LL | trait Alias2 = Default; + | ^ + +error: type parameters on the left side of a trait alias cannot have defaults + --> $DIR/trait-alias-fail.rs:15:14 + | +LL | trait Alias2 = Default; + | ^ + +error[E0573]: expected type, found trait alias `Alias1` + --> $DIR/trait-alias-fail.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-fail.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-fail.rs:13:1 + | +LL | trait Alias1 = 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-fail.rs:15:1 + | +LL | trait Alias2 = 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/auxiliary/crate_a1.rs b/src/test/ui/traits/auxiliary/crate_a1.rs similarity index 100% rename from src/test/compile-fail/auxiliary/crate_a1.rs rename to src/test/ui/traits/auxiliary/crate_a1.rs diff --git a/src/test/compile-fail/auxiliary/trait_bounds_on_structs_and_enums_xc.rs b/src/test/ui/traits/auxiliary/trait_bounds_on_structs_and_enums_xc.rs similarity index 100% rename from src/test/compile-fail/auxiliary/trait_bounds_on_structs_and_enums_xc.rs rename to src/test/ui/traits/auxiliary/trait_bounds_on_structs_and_enums_xc.rs diff --git a/src/test/compile-fail/auxiliary/trait_safety_lib.rs b/src/test/ui/traits/auxiliary/trait_safety_lib.rs similarity index 100% rename from src/test/compile-fail/auxiliary/trait_safety_lib.rs rename to src/test/ui/traits/auxiliary/trait_safety_lib.rs diff --git a/src/test/ui/trait-alias.rs b/src/test/ui/traits/trait-alias.rs similarity index 100% rename from src/test/ui/trait-alias.rs rename to src/test/ui/traits/trait-alias.rs diff --git a/src/test/ui/trait-alias.stderr b/src/test/ui/traits/trait-alias.stderr similarity index 100% rename from src/test/ui/trait-alias.stderr rename to src/test/ui/traits/trait-alias.stderr diff --git a/src/test/compile-fail/trait-as-struct-constructor.rs b/src/test/ui/traits/trait-as-struct-constructor.rs similarity index 100% rename from src/test/compile-fail/trait-as-struct-constructor.rs rename to src/test/ui/traits/trait-as-struct-constructor.rs diff --git a/src/test/ui/traits/trait-as-struct-constructor.stderr b/src/test/ui/traits/trait-as-struct-constructor.stderr new file mode 100644 index 0000000000000..ecb4e5d44c9f3 --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-bounds-not-on-bare-trait.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-not-on-bare-trait.rs rename to src/test/ui/traits/trait-bounds-not-on-bare-trait.rs diff --git a/src/test/ui/traits/trait-bounds-not-on-bare-trait.stderr b/src/test/ui/traits/trait-bounds-not-on-bare-trait.stderr new file mode 100644 index 0000000000000..b0c1c284f5ad0 --- /dev/null +++ b/src/test/ui/traits/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 + = 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/traits/trait-bounds-not-on-struct.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-not-on-struct.rs rename to src/test/ui/traits/trait-bounds-not-on-struct.rs diff --git a/src/test/ui/traits/trait-bounds-not-on-struct.stderr b/src/test/ui/traits/trait-bounds-not-on-struct.stderr new file mode 100644 index 0000000000000..929a1bfaa15c3 --- /dev/null +++ b/src/test/ui/traits/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) { } //~ 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 = Box>; //~ 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/traits/trait-bounds-on-structs-and-enums-in-fns.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-on-structs-and-enums-in-fns.rs rename to src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-fns.stderr new file mode 100644 index 0000000000000..6dd4d1fca86e3 --- /dev/null +++ b/src/test/ui/traits/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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 { + | ^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ 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 { + | ^^^^^^^^^^^^^^^^^ + +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/traits/trait-bounds-on-structs-and-enums-in-impls.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-on-structs-and-enums-in-impls.rs rename to src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-in-impls.stderr new file mode 100644 index 0000000000000..6f91770687352 --- /dev/null +++ b/src/test/ui/traits/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> 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 { + | ^^^^^^^^^^^^^^^^^^^ + +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/traits/trait-bounds-on-structs-and-enums-locals.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-on-structs-and-enums-locals.rs rename to src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-locals.stderr new file mode 100644 index 0000000000000..cdaa12428ae32 --- /dev/null +++ b/src/test/ui/traits/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 = 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 { + | ^^^^^^^^^^^^^^^^^^^ + +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 { + | ^^^^^^^^^^^^^^^^^^^ + +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/traits/trait-bounds-on-structs-and-enums-static.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-on-structs-and-enums-static.rs rename to src/test/ui/traits/trait-bounds-on-structs-and-enums-static.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-static.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-static.stderr new file mode 100644 index 0000000000000..28d4257a9fba9 --- /dev/null +++ b/src/test/ui/traits/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 = 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 { + | ^^^^^^^^^^^^^^^^^^^ + +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/traits/trait-bounds-on-structs-and-enums-xc.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-on-structs-and-enums-xc.rs rename to src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc.stderr new file mode 100644 index 0000000000000..b798ccfc7a40a --- /dev/null +++ b/src/test/ui/traits/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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ 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/traits/trait-bounds-on-structs-and-enums-xc1.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-on-structs-and-enums-xc1.rs rename to src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums-xc1.stderr new file mode 100644 index 0000000000000..0b0bd4f6ab15b --- /dev/null +++ b/src/test/ui/traits/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 = 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/traits/trait-bounds-on-structs-and-enums.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-on-structs-and-enums.rs rename to src/test/ui/traits/trait-bounds-on-structs-and-enums.rs diff --git a/src/test/ui/traits/trait-bounds-on-structs-and-enums.stderr b/src/test/ui/traits/trait-bounds-on-structs-and-enums.stderr new file mode 100644 index 0000000000000..5686e62c8b924 --- /dev/null +++ b/src/test/ui/traits/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 Foo { + | ^^^^^^ 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 { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `isize: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:29:5 + | +LL | a: Foo, //~ 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 { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `usize: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:33:10 + | +LL | Quux(Bar), //~ 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 { + | ^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `U: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:37:5 + | +LL | b: Foo, //~ 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 { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `V: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:41:21 + | +LL | EvenMoreBadness(Bar), //~ 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 { + | ^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `i32: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:45:5 + | +LL | Foo, //~ 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 { + | ^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `u8: Trait` is not satisfied + --> $DIR/trait-bounds-on-structs-and-enums.rs:49:22 + | +LL | DictionaryLike { field: Bar }, //~ 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 { + | ^^^^^^^^^^^^^^^^^ + +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/traits/trait-bounds-sugar.rs similarity index 100% rename from src/test/compile-fail/trait-bounds-sugar.rs rename to src/test/ui/traits/trait-bounds-sugar.rs diff --git a/src/test/ui/traits/trait-bounds-sugar.stderr b/src/test/ui/traits/trait-bounds-sugar.stderr new file mode 100644 index 0000000000000..bd899e065452e --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-coercion-generic-bad.rs similarity index 100% rename from src/test/compile-fail/trait-coercion-generic-bad.rs rename to src/test/ui/traits/trait-coercion-generic-bad.rs diff --git a/src/test/ui/traits/trait-coercion-generic-bad.stderr b/src/test/ui/traits/trait-coercion-generic-bad.stderr new file mode 100644 index 0000000000000..a186877e57bc3 --- /dev/null +++ b/src/test/ui/traits/trait-coercion-generic-bad.stderr @@ -0,0 +1,13 @@ +error[E0277]: the trait bound `Struct: Trait` is not satisfied + --> $DIR/trait-coercion-generic-bad.rs:26:32 + | +LL | let s: Box> = Box::new(Struct { person: "Fred" }); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `Struct` + | + = help: the following implementations were found: + > + = note: required for the cast to the object type `dyn Trait` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/traits/trait-coercion-generic-regions.nll.stderr b/src/test/ui/traits/trait-coercion-generic-regions.nll.stderr new file mode 100644 index 0000000000000..c6a7482c29f6d --- /dev/null +++ b/src/test/ui/traits/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> = 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/traits/trait-coercion-generic-regions.rs similarity index 100% rename from src/test/compile-fail/trait-coercion-generic-regions.rs rename to src/test/ui/traits/trait-coercion-generic-regions.rs diff --git a/src/test/ui/traits/trait-coercion-generic-regions.stderr b/src/test/ui/traits/trait-coercion-generic-regions.stderr new file mode 100644 index 0000000000000..8eaf7e9c1ef4d --- /dev/null +++ b/src/test/ui/traits/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> = 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/ui/trait-duplicate-methods.rs b/src/test/ui/traits/trait-duplicate-methods.rs similarity index 100% rename from src/test/ui/trait-duplicate-methods.rs rename to src/test/ui/traits/trait-duplicate-methods.rs diff --git a/src/test/ui/trait-duplicate-methods.stderr b/src/test/ui/traits/trait-duplicate-methods.stderr similarity index 100% rename from src/test/ui/trait-duplicate-methods.stderr rename to src/test/ui/traits/trait-duplicate-methods.stderr diff --git a/src/test/compile-fail/trait-impl-1.rs b/src/test/ui/traits/trait-impl-1.rs similarity index 100% rename from src/test/compile-fail/trait-impl-1.rs rename to src/test/ui/traits/trait-impl-1.rs diff --git a/src/test/ui/traits/trait-impl-1.stderr b/src/test/ui/traits/trait-impl-1.stderr new file mode 100644 index 0000000000000..b80339005055c --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-impl-can-not-have-untraitful-items.rs similarity index 100% rename from src/test/compile-fail/trait-impl-can-not-have-untraitful-items.rs rename to src/test/ui/traits/trait-impl-can-not-have-untraitful-items.rs diff --git a/src/test/ui/traits/trait-impl-can-not-have-untraitful-items.stderr b/src/test/ui/traits/trait-impl-can-not-have-untraitful-items.stderr new file mode 100644 index 0000000000000..e23225bc12416 --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-impl-different-num-params.rs similarity index 100% rename from src/test/compile-fail/trait-impl-different-num-params.rs rename to src/test/ui/traits/trait-impl-different-num-params.rs diff --git a/src/test/ui/traits/trait-impl-different-num-params.stderr b/src/test/ui/traits/trait-impl-different-num-params.stderr new file mode 100644 index 0000000000000..c3bbf99b06a7e --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-impl-for-module.rs similarity index 100% rename from src/test/compile-fail/trait-impl-for-module.rs rename to src/test/ui/traits/trait-impl-for-module.rs diff --git a/src/test/ui/traits/trait-impl-for-module.stderr b/src/test/ui/traits/trait-impl-for-module.stderr new file mode 100644 index 0000000000000..62ae84da99ec8 --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-impl-method-mismatch.rs similarity index 100% rename from src/test/compile-fail/trait-impl-method-mismatch.rs rename to src/test/ui/traits/trait-impl-method-mismatch.rs diff --git a/src/test/ui/traits/trait-impl-method-mismatch.stderr b/src/test/ui/traits/trait-impl-method-mismatch.stderr new file mode 100644 index 0000000000000..526a37f765128 --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs similarity index 100% rename from src/test/compile-fail/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs rename to src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs diff --git a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr b/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr new file mode 100644 index 0000000000000..6a97a4eccbb76 --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-item-privacy.rs similarity index 100% rename from src/test/compile-fail/trait-item-privacy.rs rename to src/test/ui/traits/trait-item-privacy.rs diff --git a/src/test/ui/traits/trait-item-privacy.stderr b/src/test/ui/traits/trait-item-privacy.stderr new file mode 100644 index 0000000000000..a3747bcee5d5c --- /dev/null +++ b/src/test/ui/traits/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 `::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 `::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 `::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/traits/trait-matching-lifetimes.rs similarity index 100% rename from src/test/compile-fail/trait-matching-lifetimes.rs rename to src/test/ui/traits/trait-matching-lifetimes.rs diff --git a/src/test/ui/traits/trait-matching-lifetimes.stderr b/src/test/ui/traits/trait-matching-lifetimes.stderr new file mode 100644 index 0000000000000..8f27947ff2a8a --- /dev/null +++ b/src/test/ui/traits/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/ui/trait-method-private.rs b/src/test/ui/traits/trait-method-private.rs similarity index 100% rename from src/test/ui/trait-method-private.rs rename to src/test/ui/traits/trait-method-private.rs diff --git a/src/test/ui/trait-method-private.stderr b/src/test/ui/traits/trait-method-private.stderr similarity index 100% rename from src/test/ui/trait-method-private.stderr rename to src/test/ui/traits/trait-method-private.stderr diff --git a/src/test/ui/trait-object-auto-dedup-in-impl.rs b/src/test/ui/traits/trait-object-auto-dedup-in-impl.rs similarity index 100% rename from src/test/ui/trait-object-auto-dedup-in-impl.rs rename to src/test/ui/traits/trait-object-auto-dedup-in-impl.rs diff --git a/src/test/ui/trait-object-auto-dedup-in-impl.stderr b/src/test/ui/traits/trait-object-auto-dedup-in-impl.stderr similarity index 100% rename from src/test/ui/trait-object-auto-dedup-in-impl.stderr rename to src/test/ui/traits/trait-object-auto-dedup-in-impl.stderr diff --git a/src/test/compile-fail/trait-object-macro-matcher.rs b/src/test/ui/traits/trait-object-macro-matcher.rs similarity index 100% rename from src/test/compile-fail/trait-object-macro-matcher.rs rename to src/test/ui/traits/trait-object-macro-matcher.rs diff --git a/src/test/ui/traits/trait-object-macro-matcher.stderr b/src/test/ui/traits/trait-object-macro-matcher.stderr new file mode 100644 index 0000000000000..05511b554cc4c --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-object-safety.rs similarity index 100% rename from src/test/compile-fail/trait-object-safety.rs rename to src/test/ui/traits/trait-object-safety.rs diff --git a/src/test/ui/traits/trait-object-safety.stderr b/src/test/ui/traits/trait-object-safety.stderr new file mode 100644 index 0000000000000..be0440db4daa3 --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-object-vs-lifetime-2.rs similarity index 100% rename from src/test/compile-fail/trait-object-vs-lifetime-2.rs rename to src/test/ui/traits/trait-object-vs-lifetime-2.rs diff --git a/src/test/ui/traits/trait-object-vs-lifetime-2.stderr b/src/test/ui/traits/trait-object-vs-lifetime-2.stderr new file mode 100644 index 0000000000000..db38aca2383fe --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-object-vs-lifetime.rs similarity index 100% rename from src/test/compile-fail/trait-object-vs-lifetime.rs rename to src/test/ui/traits/trait-object-vs-lifetime.rs diff --git a/src/test/ui/traits/trait-object-vs-lifetime.stderr b/src/test/ui/traits/trait-object-vs-lifetime.stderr new file mode 100644 index 0000000000000..d875e7d48450d --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-or-new-type-instead.rs similarity index 100% rename from src/test/compile-fail/trait-or-new-type-instead.rs rename to src/test/ui/traits/trait-or-new-type-instead.rs diff --git a/src/test/ui/traits/trait-or-new-type-instead.stderr b/src/test/ui/traits/trait-or-new-type-instead.stderr new file mode 100644 index 0000000000000..1b4d173c312e6 --- /dev/null +++ b/src/test/ui/traits/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 Option { +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/traits/trait-privacy.rs similarity index 100% rename from src/test/compile-fail/trait-privacy.rs rename to src/test/ui/traits/trait-privacy.rs diff --git a/src/test/ui/traits/trait-privacy.stderr b/src/test/ui/traits/trait-privacy.stderr new file mode 100644 index 0000000000000..d38e869df8f51 --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-resolution-in-overloaded-op.rs similarity index 100% rename from src/test/compile-fail/trait-resolution-in-overloaded-op.rs rename to src/test/ui/traits/trait-resolution-in-overloaded-op.rs diff --git a/src/test/ui/traits/trait-resolution-in-overloaded-op.stderr b/src/test/ui/traits/trait-resolution-in-overloaded-op.stderr new file mode 100644 index 0000000000000..ba20eae56c743 --- /dev/null +++ b/src/test/ui/traits/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/ui/trait-safety-fn-body.rs b/src/test/ui/traits/trait-safety-fn-body.rs similarity index 100% rename from src/test/ui/trait-safety-fn-body.rs rename to src/test/ui/traits/trait-safety-fn-body.rs diff --git a/src/test/ui/trait-safety-fn-body.stderr b/src/test/ui/traits/trait-safety-fn-body.stderr similarity index 100% rename from src/test/ui/trait-safety-fn-body.stderr rename to src/test/ui/traits/trait-safety-fn-body.stderr diff --git a/src/test/compile-fail/trait-safety-inherent-impl.rs b/src/test/ui/traits/trait-safety-inherent-impl.rs similarity index 100% rename from src/test/compile-fail/trait-safety-inherent-impl.rs rename to src/test/ui/traits/trait-safety-inherent-impl.rs diff --git a/src/test/ui/traits/trait-safety-inherent-impl.stderr b/src/test/ui/traits/trait-safety-inherent-impl.stderr new file mode 100644 index 0000000000000..5154a591c4c16 --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-safety-trait-impl-cc.rs similarity index 100% rename from src/test/compile-fail/trait-safety-trait-impl-cc.rs rename to src/test/ui/traits/trait-safety-trait-impl-cc.rs diff --git a/src/test/ui/traits/trait-safety-trait-impl-cc.stderr b/src/test/ui/traits/trait-safety-trait-impl-cc.stderr new file mode 100644 index 0000000000000..0611d2da02aeb --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-safety-trait-impl.rs similarity index 100% rename from src/test/compile-fail/trait-safety-trait-impl.rs rename to src/test/ui/traits/trait-safety-trait-impl.rs diff --git a/src/test/ui/traits/trait-safety-trait-impl.stderr b/src/test/ui/traits/trait-safety-trait-impl.stderr new file mode 100644 index 0000000000000..137e9f7c04339 --- /dev/null +++ b/src/test/ui/traits/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/traits/trait-static-method-generic-inference.rs similarity index 100% rename from src/test/compile-fail/trait-static-method-generic-inference.rs rename to src/test/ui/traits/trait-static-method-generic-inference.rs diff --git a/src/test/ui/traits/trait-static-method-generic-inference.stderr b/src/test/ui/traits/trait-static-method-generic-inference.stderr new file mode 100644 index 0000000000000..a903bd998f23d --- /dev/null +++ b/src/test/ui/traits/trait-static-method-generic-inference.stderr @@ -0,0 +1,15 @@ +error[E0283]: type annotations required: cannot resolve `_: base::HasNew` + --> $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/ui/trait-suggest-where-clause.rs b/src/test/ui/traits/trait-suggest-where-clause.rs similarity index 100% rename from src/test/ui/trait-suggest-where-clause.rs rename to src/test/ui/traits/trait-suggest-where-clause.rs diff --git a/src/test/ui/trait-suggest-where-clause.stderr b/src/test/ui/traits/trait-suggest-where-clause.stderr similarity index 100% rename from src/test/ui/trait-suggest-where-clause.stderr rename to src/test/ui/traits/trait-suggest-where-clause.stderr diff --git a/src/test/compile-fail/trait-test-2.rs b/src/test/ui/traits/trait-test-2.rs similarity index 100% rename from src/test/compile-fail/trait-test-2.rs rename to src/test/ui/traits/trait-test-2.rs diff --git a/src/test/ui/traits/trait-test-2.stderr b/src/test/ui/traits/trait-test-2.stderr new file mode 100644 index 0000000000000..58e914479637a --- /dev/null +++ b/src/test/ui/traits/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::(); //~ 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::(); //~ 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).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).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).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>` 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/traits/trait-test.rs similarity index 100% rename from src/test/compile-fail/trait-test.rs rename to src/test/ui/traits/trait-test.rs diff --git a/src/test/ui/traits/trait-test.stderr b/src/test/ui/traits/trait-test.stderr new file mode 100644 index 0000000000000..89dbb3dee8744 --- /dev/null +++ b/src/test/ui/traits/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/traits/traits-assoc-type-in-supertrait-bad.rs similarity index 100% rename from src/test/compile-fail/traits-assoc-type-in-supertrait-bad.rs rename to src/test/ui/traits/traits-assoc-type-in-supertrait-bad.rs diff --git a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr b/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr new file mode 100644 index 0000000000000..bf5e8a77f838f --- /dev/null +++ b/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr @@ -0,0 +1,12 @@ +error[E0271]: type mismatch resolving ` as std::iter::Iterator>::Item == u32` + --> $DIR/traits-assoc-type-in-supertrait-bad.rs:21:6 + | +LL | impl Foo for IntoIter { //~ 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/traits/traits-inductive-overflow-simultaneous.rs similarity index 100% rename from src/test/compile-fail/traits-inductive-overflow-simultaneous.rs rename to src/test/ui/traits/traits-inductive-overflow-simultaneous.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-simultaneous.stderr b/src/test/ui/traits/traits-inductive-overflow-simultaneous.stderr new file mode 100644 index 0000000000000..7eabb00935cf9 --- /dev/null +++ b/src/test/ui/traits/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: 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/traits/traits-inductive-overflow-supertrait-oibit.rs similarity index 100% rename from src/test/compile-fail/traits-inductive-overflow-supertrait-oibit.rs rename to src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.stderr b/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.stderr new file mode 100644 index 0000000000000..5438cc54dc62c --- /dev/null +++ b/src/test/ui/traits/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(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/traits/traits-inductive-overflow-supertrait.rs similarity index 100% rename from src/test/compile-fail/traits-inductive-overflow-supertrait.rs rename to src/test/ui/traits/traits-inductive-overflow-supertrait.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-supertrait.stderr b/src/test/ui/traits/traits-inductive-overflow-supertrait.stderr new file mode 100644 index 0000000000000..6f0929d696ff5 --- /dev/null +++ b/src/test/ui/traits/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(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/traits/traits-inductive-overflow-two-traits.rs similarity index 100% rename from src/test/compile-fail/traits-inductive-overflow-two-traits.rs rename to src/test/ui/traits/traits-inductive-overflow-two-traits.rs diff --git a/src/test/ui/traits/traits-inductive-overflow-two-traits.stderr b/src/test/ui/traits/traits-inductive-overflow-two-traits.stderr new file mode 100644 index 0000000000000..900ed1b2e8bc1 --- /dev/null +++ b/src/test/ui/traits/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() { check::<::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/traits/traits-issue-23003-overflow.rs similarity index 100% rename from src/test/compile-fail/traits-issue-23003-overflow.rs rename to src/test/ui/traits/traits-issue-23003-overflow.rs diff --git a/src/test/ui/traits/traits-issue-23003-overflow.stderr b/src/test/ui/traits/traits-issue-23003-overflow.stderr new file mode 100644 index 0000000000000..3c26e426a4e52 --- /dev/null +++ b/src/test/ui/traits/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/traits/traits-multidispatch-bad.rs similarity index 100% rename from src/test/compile-fail/traits-multidispatch-bad.rs rename to src/test/ui/traits/traits-multidispatch-bad.rs diff --git a/src/test/ui/traits/traits-multidispatch-bad.stderr b/src/test/ui/traits/traits-multidispatch-bad.stderr new file mode 100644 index 0000000000000..6068edea5859d --- /dev/null +++ b/src/test/ui/traits/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/ui/traits-multidispatch-convert-ambig-dest.rs b/src/test/ui/traits/traits-multidispatch-convert-ambig-dest.rs similarity index 100% rename from src/test/ui/traits-multidispatch-convert-ambig-dest.rs rename to src/test/ui/traits/traits-multidispatch-convert-ambig-dest.rs diff --git a/src/test/ui/traits-multidispatch-convert-ambig-dest.stderr b/src/test/ui/traits/traits-multidispatch-convert-ambig-dest.stderr similarity index 100% rename from src/test/ui/traits-multidispatch-convert-ambig-dest.stderr rename to src/test/ui/traits/traits-multidispatch-convert-ambig-dest.stderr diff --git a/src/test/compile-fail/traits-negative-impls.rs b/src/test/ui/traits/traits-negative-impls.rs similarity index 100% rename from src/test/compile-fail/traits-negative-impls.rs rename to src/test/ui/traits/traits-negative-impls.rs diff --git a/src/test/ui/traits/traits-negative-impls.stderr b/src/test/ui/traits/traits-negative-impls.stderr new file mode 100644 index 0000000000000..0d10f4863d395 --- /dev/null +++ b/src/test/ui/traits/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); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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` + = note: required because it appears within the type `std::boxed::Box` +note: required by `is_send` + --> $DIR/traits-negative-impls.rs:26:1 + | +LL | fn is_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`, the trait `std::marker::Send` is not implemented for `dummy3::TestType` + = note: required because it appears within the type `Outer2` + = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique>` + = note: required because it appears within the type `std::boxed::Box>` +note: required by `is_send` + --> $DIR/traits-negative-impls.rs:26:1 + | +LL | fn is_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` +note: required by `is_sync` + --> $DIR/traits-negative-impls.rs:27:1 + | +LL | fn is_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/traits/traits-repeated-supertrait-ambig.rs similarity index 100% rename from src/test/compile-fail/traits-repeated-supertrait-ambig.rs rename to src/test/ui/traits/traits-repeated-supertrait-ambig.rs diff --git a/src/test/ui/traits/traits-repeated-supertrait-ambig.stderr b/src/test/ui/traits/traits-repeated-supertrait-ambig.stderr new file mode 100644 index 0000000000000..87d3c8117d3dd --- /dev/null +++ b/src/test/ui/traits/traits-repeated-supertrait-ambig.stderr @@ -0,0 +1,52 @@ +error[E0277]: the trait bound `dyn CompareToInts: CompareTo` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:36:7 + | +LL | c.same_as(22) //~ ERROR `dyn CompareToInts: CompareTo` is not satisfied + | ^^^^^^^ the trait `CompareTo` is not implemented for `dyn CompareToInts` + +error[E0277]: the trait bound `C: CompareTo` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:40:7 + | +LL | c.same_as(22) //~ ERROR `C: CompareTo` is not satisfied + | ^^^^^^^ the trait `CompareTo` is not implemented for `C` + | + = help: consider adding a `where C: CompareTo` bound + +error[E0277]: the trait bound `dyn CompareToInts: CompareTo` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:44:5 + | +LL | CompareToInts::same_as(c, 22) //~ ERROR `dyn CompareToInts: CompareTo` is not satisfied + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `CompareTo` 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` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:48:5 + | +LL | CompareTo::same_as(c, 22) //~ ERROR `C: CompareTo` is not satisfied + | ^^^^^^^^^^^^^^^^^^ the trait `CompareTo` is not implemented for `C` + | + = help: consider adding a `where C: CompareTo` 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` is not satisfied + --> $DIR/traits-repeated-supertrait-ambig.rs:52:23 + | +LL | assert_eq!(22_i64.same_as(22), true); //~ ERROR `i64: CompareTo` is not satisfied + | ^^^^^^^ the trait `CompareTo` is not implemented for `i64` + | + = help: the following implementations were found: + > + > + +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/transmute/transmute-different-sizes.rs similarity index 95% rename from src/test/compile-fail/transmute-different-sizes.rs rename to src/test/ui/transmute/transmute-different-sizes.rs index 113e2ed4c80f4..62e9ceb2b2f46 100644 --- a/src/test/compile-fail/transmute-different-sizes.rs +++ b/src/test/ui/transmute/transmute-different-sizes.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test "\d+ bits" -> "N bits" + // Tests that `transmute` cannot be called on types of different size. #![allow(warnings)] diff --git a/src/test/ui/transmute/transmute-different-sizes.stderr b/src/test/ui/transmute/transmute-different-sizes.stderr new file mode 100644 index 0000000000000..a07b75e29d5bd --- /dev/null +++ b/src/test/ui/transmute/transmute-different-sizes.stderr @@ -0,0 +1,30 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-different-sizes.rs:21:17 + | +LL | let _: i8 = transmute(16i16); + | ^^^^^^^^^ + | + = note: source type: i16 (N bits) + = note: target type: i8 (N bits) + +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-different-sizes.rs:26:17 + | +LL | let _: i8 = transmute(x); + | ^^^^^^^^^ + | + = note: source type: &T (N bits) + = note: target type: i8 (N bits) + +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-different-sizes.rs:37:5 + | +LL | transmute(x) + | ^^^^^^^^^ + | + = note: source type: u16 (N bits) + = note: target type: ::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/transmute/transmute-fat-pointers.rs similarity index 96% rename from src/test/compile-fail/transmute-fat-pointers.rs rename to src/test/ui/transmute/transmute-fat-pointers.rs index 59027fc7787f8..c1e6ee3ddcc3b 100644 --- a/src/test/compile-fail/transmute-fat-pointers.rs +++ b/src/test/ui/transmute/transmute-fat-pointers.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test "\d+ bits" -> "N bits" + // Tests that are conservative around thin/fat pointer mismatches. #![allow(dead_code)] diff --git a/src/test/ui/transmute/transmute-fat-pointers.stderr b/src/test/ui/transmute/transmute-fat-pointers.stderr new file mode 100644 index 0000000000000..8ea71e101c031 --- /dev/null +++ b/src/test/ui/transmute/transmute-fat-pointers.stderr @@ -0,0 +1,39 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-fat-pointers.rs:20:14 + | +LL | unsafe { transmute(x) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^ + | + = note: source type: &[T] (N bits) + = note: target type: &U (pointer to U) + +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-fat-pointers.rs:24: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:36:14 + | +LL | unsafe { transmute(x) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^ + | + = note: source type: &T (pointer to T) + = note: target type: &U (N bits) + +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-fat-pointers.rs:40:14 + | +LL | unsafe { transmute(x) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^ + | + = note: source type: &T (N 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/transmute/transmute-impl.rs similarity index 95% rename from src/test/compile-fail/transmute-impl.rs rename to src/test/ui/transmute/transmute-impl.rs index 2f8f9e46e1aee..3bf4ca5b9e039 100644 --- a/src/test/compile-fail/transmute-impl.rs +++ b/src/test/ui/transmute/transmute-impl.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test "\d+ bits" -> "N bits" + // Tests that are conservative around thin/fat pointer mismatches. #![allow(dead_code)] diff --git a/src/test/ui/transmute/transmute-impl.stderr b/src/test/ui/transmute/transmute-impl.stderr new file mode 100644 index 0000000000000..21f272b0cc181 --- /dev/null +++ b/src/test/ui/transmute/transmute-impl.stderr @@ -0,0 +1,12 @@ +error[E0512]: transmute called with types of different sizes + --> $DIR/transmute-impl.rs:31:18 + | +LL | unsafe { transmute(x) } //~ ERROR transmute called with types of different sizes + | ^^^^^^^^^ + | + = note: source type: &T (pointer to T) + = note: target type: &isize (N 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/transmute/transmute-imut-to-mut.rs similarity index 100% rename from src/test/compile-fail/transmute-imut-to-mut.rs rename to src/test/ui/transmute/transmute-imut-to-mut.rs diff --git a/src/test/ui/transmute/transmute-imut-to-mut.stderr b/src/test/ui/transmute/transmute-imut-to-mut.stderr new file mode 100644 index 0000000000000..4434e35af7ff1 --- /dev/null +++ b/src/test/ui/transmute/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/ui/trivial-bounds-inconsistent-associated-functions.rs b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-associated-functions.rs similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-associated-functions.rs rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-associated-functions.rs diff --git a/src/test/ui/trivial-bounds-inconsistent-copy-reborrow.nll.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.nll.stderr similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-copy-reborrow.nll.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.nll.stderr diff --git a/src/test/ui/trivial-bounds-inconsistent-copy-reborrow.rs b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.rs similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-copy-reborrow.rs rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.rs diff --git a/src/test/ui/trivial-bounds-inconsistent-copy-reborrow.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-copy-reborrow.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr diff --git a/src/test/ui/trivial-bounds-inconsistent-copy.rs b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy.rs similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-copy.rs rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy.rs diff --git a/src/test/ui/trivial-bounds-inconsistent-copy.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-copy.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr diff --git a/src/test/ui/trivial-bounds-inconsistent-projection-error.rs b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.rs similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-projection-error.rs rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.rs diff --git a/src/test/ui/trivial-bounds-inconsistent-projection-error.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-projection-error.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection-error.stderr diff --git a/src/test/ui/trivial-bounds-inconsistent-projection.rs b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection.rs similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-projection.rs rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection.rs diff --git a/src/test/ui/trivial-bounds-inconsistent-projection.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection.stderr similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-projection.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-projection.stderr diff --git a/src/test/ui/trivial-bounds-inconsistent-sized.rs b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-sized.rs similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-sized.rs rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-sized.rs diff --git a/src/test/ui/trivial-bounds-inconsistent-sized.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-sized.stderr similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-sized.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-sized.stderr diff --git a/src/test/ui/trivial-bounds-inconsistent-well-formed.rs b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-well-formed.rs similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-well-formed.rs rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-well-formed.rs diff --git a/src/test/ui/trivial-bounds-inconsistent-well-formed.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent-well-formed.stderr similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent-well-formed.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent-well-formed.stderr diff --git a/src/test/ui/trivial-bounds-inconsistent.rs b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.rs similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent.rs rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent.rs diff --git a/src/test/ui/trivial-bounds-inconsistent.stderr b/src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr similarity index 100% rename from src/test/ui/trivial-bounds-inconsistent.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-inconsistent.stderr diff --git a/src/test/ui/trivial-bounds-leak-copy.rs b/src/test/ui/trivial-bounds/trivial-bounds-leak-copy.rs similarity index 100% rename from src/test/ui/trivial-bounds-leak-copy.rs rename to src/test/ui/trivial-bounds/trivial-bounds-leak-copy.rs diff --git a/src/test/ui/trivial-bounds-leak-copy.stderr b/src/test/ui/trivial-bounds/trivial-bounds-leak-copy.stderr similarity index 100% rename from src/test/ui/trivial-bounds-leak-copy.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-leak-copy.stderr diff --git a/src/test/ui/trivial-bounds-leak.rs b/src/test/ui/trivial-bounds/trivial-bounds-leak.rs similarity index 100% rename from src/test/ui/trivial-bounds-leak.rs rename to src/test/ui/trivial-bounds/trivial-bounds-leak.rs diff --git a/src/test/ui/trivial-bounds-leak.stderr b/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr similarity index 100% rename from src/test/ui/trivial-bounds-leak.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-leak.stderr diff --git a/src/test/ui/trivial-bounds-lint.rs b/src/test/ui/trivial-bounds/trivial-bounds-lint.rs similarity index 100% rename from src/test/ui/trivial-bounds-lint.rs rename to src/test/ui/trivial-bounds/trivial-bounds-lint.rs diff --git a/src/test/ui/trivial-bounds-lint.stderr b/src/test/ui/trivial-bounds/trivial-bounds-lint.stderr similarity index 100% rename from src/test/ui/trivial-bounds-lint.stderr rename to src/test/ui/trivial-bounds/trivial-bounds-lint.stderr diff --git a/src/test/ui/trivial-bounds-object.rs b/src/test/ui/trivial-bounds/trivial-bounds-object.rs similarity index 100% rename from src/test/ui/trivial-bounds-object.rs rename to src/test/ui/trivial-bounds/trivial-bounds-object.rs diff --git a/src/test/compile-fail/trivial_casts.rs b/src/test/ui/trivial_casts.rs similarity index 100% rename from src/test/compile-fail/trivial_casts.rs rename to src/test/ui/trivial_casts.rs diff --git a/src/test/ui/trivial_casts.stderr b/src/test/ui/trivial_casts.stderr new file mode 100644 index 0000000000000..dc2a6a058bd7e --- /dev/null +++ b/src/test/ui/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` as `std::boxed::Box` + --> $DIR/trivial_casts.rs:74:13 + | +LL | let _ = x as Box; //~ERROR `std::boxed::Box` as `std::boxed::Box` + | ^^^^^^^^^^^^^ + | + = 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/tuple/tuple-arity-mismatch.rs similarity index 100% rename from src/test/compile-fail/tuple-arity-mismatch.rs rename to src/test/ui/tuple/tuple-arity-mismatch.rs diff --git a/src/test/ui/tuple/tuple-arity-mismatch.stderr b/src/test/ui/tuple/tuple-arity-mismatch.stderr new file mode 100644 index 0000000000000..574a1f0a5c948 --- /dev/null +++ b/src/test/ui/tuple/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/ui/tuple-float-index.fixed b/src/test/ui/tuple/tuple-float-index.fixed similarity index 100% rename from src/test/ui/tuple-float-index.fixed rename to src/test/ui/tuple/tuple-float-index.fixed diff --git a/src/test/ui/tuple-float-index.rs b/src/test/ui/tuple/tuple-float-index.rs similarity index 100% rename from src/test/ui/tuple-float-index.rs rename to src/test/ui/tuple/tuple-float-index.rs diff --git a/src/test/ui/tuple-float-index.stderr b/src/test/ui/tuple/tuple-float-index.stderr similarity index 100% rename from src/test/ui/tuple-float-index.stderr rename to src/test/ui/tuple/tuple-float-index.stderr diff --git a/src/test/compile-fail/tuple-index-not-tuple.rs b/src/test/ui/tuple/tuple-index-not-tuple.rs similarity index 100% rename from src/test/compile-fail/tuple-index-not-tuple.rs rename to src/test/ui/tuple/tuple-index-not-tuple.rs diff --git a/src/test/ui/tuple/tuple-index-not-tuple.stderr b/src/test/ui/tuple/tuple-index-not-tuple.stderr new file mode 100644 index 0000000000000..fa0d0b4172be0 --- /dev/null +++ b/src/test/ui/tuple/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/tuple/tuple-index-out-of-bounds.rs similarity index 100% rename from src/test/compile-fail/tuple-index-out-of-bounds.rs rename to src/test/ui/tuple/tuple-index-out-of-bounds.rs diff --git a/src/test/ui/tuple/tuple-index-out-of-bounds.stderr b/src/test/ui/tuple/tuple-index-out-of-bounds.stderr new file mode 100644 index 0000000000000..068e83ab0918c --- /dev/null +++ b/src/test/ui/tuple/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/ui/tuple-struct-fields/test.rs b/src/test/ui/tuple/tuple-struct-fields/test.rs similarity index 100% rename from src/test/ui/tuple-struct-fields/test.rs rename to src/test/ui/tuple/tuple-struct-fields/test.rs diff --git a/src/test/ui/tuple-struct-fields/test.stderr b/src/test/ui/tuple/tuple-struct-fields/test.stderr similarity index 100% rename from src/test/ui/tuple-struct-fields/test.stderr rename to src/test/ui/tuple/tuple-struct-fields/test.stderr diff --git a/src/test/ui/tuple-struct-fields/test2.rs b/src/test/ui/tuple/tuple-struct-fields/test2.rs similarity index 100% rename from src/test/ui/tuple-struct-fields/test2.rs rename to src/test/ui/tuple/tuple-struct-fields/test2.rs diff --git a/src/test/ui/tuple-struct-fields/test2.stderr b/src/test/ui/tuple/tuple-struct-fields/test2.stderr similarity index 100% rename from src/test/ui/tuple-struct-fields/test2.stderr rename to src/test/ui/tuple/tuple-struct-fields/test2.stderr diff --git a/src/test/ui/tuple-struct-fields/test3.rs b/src/test/ui/tuple/tuple-struct-fields/test3.rs similarity index 100% rename from src/test/ui/tuple-struct-fields/test3.rs rename to src/test/ui/tuple/tuple-struct-fields/test3.rs diff --git a/src/test/ui/tuple-struct-fields/test3.stderr b/src/test/ui/tuple/tuple-struct-fields/test3.stderr similarity index 100% rename from src/test/ui/tuple-struct-fields/test3.stderr rename to src/test/ui/tuple/tuple-struct-fields/test3.stderr diff --git a/src/test/compile-fail/tuple-struct-nonexhaustive.rs b/src/test/ui/tuple/tuple-struct-nonexhaustive.rs similarity index 100% rename from src/test/compile-fail/tuple-struct-nonexhaustive.rs rename to src/test/ui/tuple/tuple-struct-nonexhaustive.rs diff --git a/src/test/ui/tuple/tuple-struct-nonexhaustive.stderr b/src/test/ui/tuple/tuple-struct-nonexhaustive.stderr new file mode 100644 index 0000000000000..ee274bedbb84c --- /dev/null +++ b/src/test/ui/tuple/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/tutorial-suffix-inference-test.rs similarity index 100% rename from src/test/compile-fail/tutorial-suffix-inference-test.rs rename to src/test/ui/tutorial-suffix-inference-test.rs diff --git a/src/test/ui/tutorial-suffix-inference-test.stderr b/src/test/ui/tutorial-suffix-inference-test.stderr new file mode 100644 index 0000000000000..d315f9b87f924 --- /dev/null +++ b/src/test/ui/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/ui/auxiliary/coherence_lib.rs b/src/test/ui/type/auxiliary/crate_a1.rs similarity index 60% rename from src/test/ui/auxiliary/coherence_lib.rs rename to src/test/ui/type/auxiliary/crate_a1.rs index daa123849e4e7..70f7cac94de6c 100644 --- a/src/test/ui/auxiliary/coherence_lib.rs +++ b/src/test/ui/type/auxiliary/crate_a1.rs @@ -1,4 +1,4 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,18 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_type="lib"] +pub struct Foo; -pub trait Remote { - fn foo(&self) { } -} +pub trait Bar{} -pub trait Remote1 { - fn foo(&self, t: T) { } +pub fn bar() -> Box { + unimplemented!() } -pub trait Remote2 { - fn foo(&self, t: T, u: U) { } -} -pub struct Pair(T,U); +pub fn try_foo(x: Foo){} +pub fn try_bar(x: Box){} diff --git a/src/test/compile-fail/auxiliary/crate_a2.rs b/src/test/ui/type/auxiliary/crate_a2.rs similarity index 100% rename from src/test/compile-fail/auxiliary/crate_a2.rs rename to src/test/ui/type/auxiliary/crate_a2.rs diff --git a/src/test/ui/type-alias-bounds.rs b/src/test/ui/type/type-alias-bounds.rs similarity index 100% rename from src/test/ui/type-alias-bounds.rs rename to src/test/ui/type/type-alias-bounds.rs diff --git a/src/test/ui/type-alias-bounds.stderr b/src/test/ui/type/type-alias-bounds.stderr similarity index 100% rename from src/test/ui/type-alias-bounds.stderr rename to src/test/ui/type/type-alias-bounds.stderr diff --git a/src/test/ui/type-annotation-needed.rs b/src/test/ui/type/type-annotation-needed.rs similarity index 100% rename from src/test/ui/type-annotation-needed.rs rename to src/test/ui/type/type-annotation-needed.rs diff --git a/src/test/ui/type-annotation-needed.stderr b/src/test/ui/type/type-annotation-needed.stderr similarity index 100% rename from src/test/ui/type-annotation-needed.stderr rename to src/test/ui/type/type-annotation-needed.stderr diff --git a/src/test/compile-fail/type-arg-out-of-scope.rs b/src/test/ui/type/type-arg-out-of-scope.rs similarity index 100% rename from src/test/compile-fail/type-arg-out-of-scope.rs rename to src/test/ui/type/type-arg-out-of-scope.rs diff --git a/src/test/ui/type/type-arg-out-of-scope.stderr b/src/test/ui/type/type-arg-out-of-scope.stderr new file mode 100644 index 0000000000000..20bf303129f75 --- /dev/null +++ b/src/test/ui/type/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(x: T) { + | - type variable from outer function +LL | fn bar(f: Box T>) { } + | --- ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `bar` + +error[E0401]: can't use type parameters from outer function + --> $DIR/type-arg-out-of-scope.rs:13:31 + | +LL | fn foo(x: T) { + | - type variable from outer function +LL | fn bar(f: Box T>) { } + | --- ^ use of type variable from outer function + | | + | help: try using a local type parameter instead: `bar` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0401`. diff --git a/src/test/ui/type-ascription-instead-of-initializer.rs b/src/test/ui/type/type-ascription-instead-of-initializer.rs similarity index 100% rename from src/test/ui/type-ascription-instead-of-initializer.rs rename to src/test/ui/type/type-ascription-instead-of-initializer.rs diff --git a/src/test/ui/type-ascription-instead-of-initializer.stderr b/src/test/ui/type/type-ascription-instead-of-initializer.stderr similarity index 100% rename from src/test/ui/type-ascription-instead-of-initializer.stderr rename to src/test/ui/type/type-ascription-instead-of-initializer.stderr diff --git a/src/test/ui/type-ascription-instead-of-statement-end.rs b/src/test/ui/type/type-ascription-instead-of-statement-end.rs similarity index 100% rename from src/test/ui/type-ascription-instead-of-statement-end.rs rename to src/test/ui/type/type-ascription-instead-of-statement-end.rs diff --git a/src/test/ui/type-ascription-instead-of-statement-end.stderr b/src/test/ui/type/type-ascription-instead-of-statement-end.stderr similarity index 100% rename from src/test/ui/type-ascription-instead-of-statement-end.stderr rename to src/test/ui/type/type-ascription-instead-of-statement-end.stderr diff --git a/src/test/compile-fail/type-ascription-precedence.rs b/src/test/ui/type/type-ascription-precedence.rs similarity index 100% rename from src/test/compile-fail/type-ascription-precedence.rs rename to src/test/ui/type/type-ascription-precedence.rs diff --git a/src/test/ui/type/type-ascription-precedence.stderr b/src/test/ui/type/type-ascription-precedence.stderr new file mode 100644 index 0000000000000..252b5231220df --- /dev/null +++ b/src/test/ui/type/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` + +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/type/type-ascription-soundness.rs similarity index 100% rename from src/test/compile-fail/type-ascription-soundness.rs rename to src/test/ui/type/type-ascription-soundness.rs diff --git a/src/test/ui/type/type-ascription-soundness.stderr b/src/test/ui/type/type-ascription-soundness.stderr new file mode 100644 index 0000000000000..3dcd6ff49b3ac --- /dev/null +++ b/src/test/ui/type/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/ui/type-ascription-with-fn-call.rs b/src/test/ui/type/type-ascription-with-fn-call.rs similarity index 100% rename from src/test/ui/type-ascription-with-fn-call.rs rename to src/test/ui/type/type-ascription-with-fn-call.rs diff --git a/src/test/ui/type-ascription-with-fn-call.stderr b/src/test/ui/type/type-ascription-with-fn-call.stderr similarity index 100% rename from src/test/ui/type-ascription-with-fn-call.stderr rename to src/test/ui/type/type-ascription-with-fn-call.stderr diff --git a/src/test/ui/type-check-defaults.rs b/src/test/ui/type/type-check-defaults.rs similarity index 100% rename from src/test/ui/type-check-defaults.rs rename to src/test/ui/type/type-check-defaults.rs diff --git a/src/test/ui/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr similarity index 100% rename from src/test/ui/type-check-defaults.stderr rename to src/test/ui/type/type-check-defaults.stderr diff --git a/src/test/ui/type-check/assignment-in-if.rs b/src/test/ui/type/type-check/assignment-in-if.rs similarity index 100% rename from src/test/ui/type-check/assignment-in-if.rs rename to src/test/ui/type/type-check/assignment-in-if.rs diff --git a/src/test/ui/type-check/assignment-in-if.stderr b/src/test/ui/type/type-check/assignment-in-if.stderr similarity index 100% rename from src/test/ui/type-check/assignment-in-if.stderr rename to src/test/ui/type/type-check/assignment-in-if.stderr diff --git a/src/test/ui/type-check/cannot_infer_local_or_array.rs b/src/test/ui/type/type-check/cannot_infer_local_or_array.rs similarity index 100% rename from src/test/ui/type-check/cannot_infer_local_or_array.rs rename to src/test/ui/type/type-check/cannot_infer_local_or_array.rs diff --git a/src/test/ui/type-check/cannot_infer_local_or_array.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_array.stderr similarity index 100% rename from src/test/ui/type-check/cannot_infer_local_or_array.stderr rename to src/test/ui/type/type-check/cannot_infer_local_or_array.stderr diff --git a/src/test/ui/type-check/cannot_infer_local_or_vec.rs b/src/test/ui/type/type-check/cannot_infer_local_or_vec.rs similarity index 100% rename from src/test/ui/type-check/cannot_infer_local_or_vec.rs rename to src/test/ui/type/type-check/cannot_infer_local_or_vec.rs diff --git a/src/test/ui/type-check/cannot_infer_local_or_vec.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr similarity index 100% rename from src/test/ui/type-check/cannot_infer_local_or_vec.stderr rename to src/test/ui/type/type-check/cannot_infer_local_or_vec.stderr diff --git a/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.rs b/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.rs similarity index 100% rename from src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.rs rename to src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.rs diff --git a/src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr b/src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr similarity index 100% rename from src/test/ui/type-check/cannot_infer_local_or_vec_in_tuples.stderr rename to src/test/ui/type/type-check/cannot_infer_local_or_vec_in_tuples.stderr diff --git a/src/test/ui/type-check/issue-22897.rs b/src/test/ui/type/type-check/issue-22897.rs similarity index 100% rename from src/test/ui/type-check/issue-22897.rs rename to src/test/ui/type/type-check/issue-22897.rs diff --git a/src/test/ui/type-check/issue-22897.stderr b/src/test/ui/type/type-check/issue-22897.stderr similarity index 100% rename from src/test/ui/type-check/issue-22897.stderr rename to src/test/ui/type/type-check/issue-22897.stderr diff --git a/src/test/ui/type-check/issue-40294.rs b/src/test/ui/type/type-check/issue-40294.rs similarity index 100% rename from src/test/ui/type-check/issue-40294.rs rename to src/test/ui/type/type-check/issue-40294.rs diff --git a/src/test/ui/type-check/issue-40294.stderr b/src/test/ui/type/type-check/issue-40294.stderr similarity index 100% rename from src/test/ui/type-check/issue-40294.stderr rename to src/test/ui/type/type-check/issue-40294.stderr diff --git a/src/test/ui/type-check/issue-41314.rs b/src/test/ui/type/type-check/issue-41314.rs similarity index 100% rename from src/test/ui/type-check/issue-41314.rs rename to src/test/ui/type/type-check/issue-41314.rs diff --git a/src/test/ui/type-check/issue-41314.stderr b/src/test/ui/type/type-check/issue-41314.stderr similarity index 100% rename from src/test/ui/type-check/issue-41314.stderr rename to src/test/ui/type/type-check/issue-41314.stderr diff --git a/src/test/ui/type-check/missing_trait_impl.rs b/src/test/ui/type/type-check/missing_trait_impl.rs similarity index 100% rename from src/test/ui/type-check/missing_trait_impl.rs rename to src/test/ui/type/type-check/missing_trait_impl.rs diff --git a/src/test/ui/type-check/missing_trait_impl.stderr b/src/test/ui/type/type-check/missing_trait_impl.stderr similarity index 100% rename from src/test/ui/type-check/missing_trait_impl.stderr rename to src/test/ui/type/type-check/missing_trait_impl.stderr diff --git a/src/test/ui/type-check/unknown_type_for_closure.rs b/src/test/ui/type/type-check/unknown_type_for_closure.rs similarity index 100% rename from src/test/ui/type-check/unknown_type_for_closure.rs rename to src/test/ui/type/type-check/unknown_type_for_closure.rs diff --git a/src/test/ui/type-check/unknown_type_for_closure.stderr b/src/test/ui/type/type-check/unknown_type_for_closure.stderr similarity index 100% rename from src/test/ui/type-check/unknown_type_for_closure.stderr rename to src/test/ui/type/type-check/unknown_type_for_closure.stderr diff --git a/src/test/ui/type-dependent-def-issue-49241.rs b/src/test/ui/type/type-dependent-def-issue-49241.rs similarity index 100% rename from src/test/ui/type-dependent-def-issue-49241.rs rename to src/test/ui/type/type-dependent-def-issue-49241.rs diff --git a/src/test/ui/type-dependent-def-issue-49241.stderr b/src/test/ui/type/type-dependent-def-issue-49241.stderr similarity index 100% rename from src/test/ui/type-dependent-def-issue-49241.stderr rename to src/test/ui/type/type-dependent-def-issue-49241.stderr diff --git a/src/test/compile-fail/type-mismatch-multiple.rs b/src/test/ui/type/type-mismatch-multiple.rs similarity index 100% rename from src/test/compile-fail/type-mismatch-multiple.rs rename to src/test/ui/type/type-mismatch-multiple.rs diff --git a/src/test/ui/type/type-mismatch-multiple.stderr b/src/test/ui/type/type-mismatch-multiple.stderr new file mode 100644 index 0000000000000..b9721a5edfa4d --- /dev/null +++ b/src/test/ui/type/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/type/type-mismatch-same-crate-name.rs similarity index 100% rename from src/test/compile-fail/type-mismatch-same-crate-name.rs rename to src/test/ui/type/type-mismatch-same-crate-name.rs diff --git a/src/test/ui/type/type-mismatch-same-crate-name.stderr b/src/test/ui/type/type-mismatch-same-crate-name.stderr new file mode 100644 index 0000000000000..c686092605662 --- /dev/null +++ b/src/test/ui/type/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` +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/ui/type-mismatch.rs b/src/test/ui/type/type-mismatch.rs similarity index 100% rename from src/test/ui/type-mismatch.rs rename to src/test/ui/type/type-mismatch.rs diff --git a/src/test/ui/type-mismatch.stderr b/src/test/ui/type/type-mismatch.stderr similarity index 100% rename from src/test/ui/type-mismatch.stderr rename to src/test/ui/type/type-mismatch.stderr diff --git a/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs b/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.rs similarity index 100% rename from src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs rename to src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.rs diff --git a/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.stderr b/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.stderr new file mode 100644 index 0000000000000..f02bf0533a394 --- /dev/null +++ b/src/test/ui/type/type-parameter-defaults-referencing-Self-ppaux.stderr @@ -0,0 +1,24 @@ +error[E0620]: cast to unsized type: `i32` as `dyn MyAdd` + --> $DIR/type-parameter-defaults-referencing-Self-ppaux.rs:24:13 + | +LL | let y = x as MyAdd; + | ^^^^^^^^^^^^^^^ + | +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; + | ^ + +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; + | ^^^^^^^^^^ 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/type/type-parameter-defaults-referencing-Self.rs similarity index 100% rename from src/test/compile-fail/type-parameter-defaults-referencing-Self.rs rename to src/test/ui/type/type-parameter-defaults-referencing-Self.rs diff --git a/src/test/ui/type/type-parameter-defaults-referencing-Self.stderr b/src/test/ui/type/type-parameter-defaults-referencing-Self.stderr new file mode 100644 index 0000000000000..e163253bdf925 --- /dev/null +++ b/src/test/ui/type/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/type/type-parameter-names.rs similarity index 100% rename from src/test/compile-fail/type-parameter-names.rs rename to src/test/ui/type/type-parameter-names.rs diff --git a/src/test/ui/type/type-parameter-names.stderr b/src/test/ui/type/type-parameter-names.stderr new file mode 100644 index 0000000000000..8e3d39357ed0f --- /dev/null +++ b/src/test/ui/type/type-parameter-names.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/type-parameter-names.rs:15:5 + | +LL | fn foo(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/type/type-params-in-different-spaces-1.rs similarity index 100% rename from src/test/compile-fail/type-params-in-different-spaces-1.rs rename to src/test/ui/type/type-params-in-different-spaces-1.rs diff --git a/src/test/ui/type/type-params-in-different-spaces-1.stderr b/src/test/ui/type/type-params-in-different-spaces-1.stderr new file mode 100644 index 0000000000000..31f332f609596 --- /dev/null +++ b/src/test/ui/type/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/type/type-params-in-different-spaces-2.rs similarity index 100% rename from src/test/compile-fail/type-params-in-different-spaces-2.rs rename to src/test/ui/type/type-params-in-different-spaces-2.rs diff --git a/src/test/ui/type/type-params-in-different-spaces-2.stderr b/src/test/ui/type/type-params-in-different-spaces-2.stderr new file mode 100644 index 0000000000000..af18185dd2446 --- /dev/null +++ b/src/test/ui/type/type-params-in-different-spaces-2.stderr @@ -0,0 +1,29 @@ +error[E0277]: the trait bound `Self: Tr` is not satisfied + --> $DIR/type-params-in-different-spaces-2.rs:20:9 + | +LL | Tr::op(u) //~ ERROR E0277 + | ^^^^^^ the trait `Tr` is not implemented for `Self` + | + = help: consider adding a `where Self: Tr` 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` is not satisfied + --> $DIR/type-params-in-different-spaces-2.rs:26:9 + | +LL | Tr::op(u) //~ ERROR E0277 + | ^^^^^^ the trait `Tr` is not implemented for `Self` + | + = help: consider adding a `where Self: Tr` 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/type/type-params-in-different-spaces-3.rs similarity index 100% rename from src/test/compile-fail/type-params-in-different-spaces-3.rs rename to src/test/ui/type/type-params-in-different-spaces-3.rs diff --git a/src/test/ui/type/type-params-in-different-spaces-3.stderr b/src/test/ui/type/type-params-in-different-spaces-3.stderr new file mode 100644 index 0000000000000..e1b4cbb2ab3f4 --- /dev/null +++ b/src/test/ui/type/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(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/type/type-path-err-node-types.rs similarity index 100% rename from src/test/compile-fail/type-path-err-node-types.rs rename to src/test/ui/type/type-path-err-node-types.rs diff --git a/src/test/ui/type/type-path-err-node-types.stderr b/src/test/ui/type/type-path-err-node-types.stderr new file mode 100644 index 0000000000000..c28b30b5456d0 --- /dev/null +++ b/src/test/ui/type/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::; //~ 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; //~ 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 | >::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::(); //~ 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/ui/type-recursive.rs b/src/test/ui/type/type-recursive.rs similarity index 100% rename from src/test/ui/type-recursive.rs rename to src/test/ui/type/type-recursive.rs diff --git a/src/test/ui/type-recursive.stderr b/src/test/ui/type/type-recursive.stderr similarity index 100% rename from src/test/ui/type-recursive.stderr rename to src/test/ui/type/type-recursive.stderr diff --git a/src/test/compile-fail/type-shadow.rs b/src/test/ui/type/type-shadow.rs similarity index 100% rename from src/test/compile-fail/type-shadow.rs rename to src/test/ui/type/type-shadow.rs diff --git a/src/test/ui/type/type-shadow.stderr b/src/test/ui/type/type-shadow.stderr new file mode 100644 index 0000000000000..29e6e4352e207 --- /dev/null +++ b/src/test/ui/type/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/type_length_limit.rs similarity index 100% rename from src/test/compile-fail/type_length_limit.rs rename to src/test/ui/type_length_limit.rs diff --git a/src/test/ui/type_length_limit.stderr b/src/test/ui/type_length_limit.stderr new file mode 100644 index 0000000000000..910eca075948a --- /dev/null +++ b/src/test/ui/type_length_limit.stderr @@ -0,0 +1,6 @@ +error: reached the type-length limit while instantiating `std::mem::drop:: $DIR/typeck-auto-trait-no-supertraits-2.rs:13:1 + | +LL | auto trait Magic : Sized where Option : 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/typeck/typeck-auto-trait-no-supertraits.rs similarity index 100% rename from src/test/compile-fail/typeck-auto-trait-no-supertraits.rs rename to src/test/ui/typeck/typeck-auto-trait-no-supertraits.rs diff --git a/src/test/ui/typeck/typeck-auto-trait-no-supertraits.stderr b/src/test/ui/typeck/typeck-auto-trait-no-supertraits.stderr new file mode 100644 index 0000000000000..26542286807f9 --- /dev/null +++ b/src/test/ui/typeck/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/ui/typeck-builtin-bound-type-parameters.rs b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs similarity index 100% rename from src/test/ui/typeck-builtin-bound-type-parameters.rs rename to src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs diff --git a/src/test/ui/typeck-builtin-bound-type-parameters.stderr b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr similarity index 100% rename from src/test/ui/typeck-builtin-bound-type-parameters.stderr rename to src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr diff --git a/src/test/compile-fail/typeck-cast-pointer-to-float.rs b/src/test/ui/typeck/typeck-cast-pointer-to-float.rs similarity index 100% rename from src/test/compile-fail/typeck-cast-pointer-to-float.rs rename to src/test/ui/typeck/typeck-cast-pointer-to-float.rs diff --git a/src/test/ui/typeck/typeck-cast-pointer-to-float.stderr b/src/test/ui/typeck/typeck-cast-pointer-to-float.stderr new file mode 100644 index 0000000000000..437675ccb060e --- /dev/null +++ b/src/test/ui/typeck/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/typeck/typeck-default-trait-impl-assoc-type.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-assoc-type.rs rename to src/test/ui/typeck/typeck-default-trait-impl-assoc-type.rs diff --git a/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr b/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr new file mode 100644 index 0000000000000..ad47fcdb042ca --- /dev/null +++ b/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr @@ -0,0 +1,17 @@ +error[E0277]: `::AssocType` cannot be sent between threads safely + --> $DIR/typeck-default-trait-impl-assoc-type.rs:19:5 + | +LL | is_send::(); //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^ `::AssocType` cannot be sent between threads safely + | + = help: the trait `std::marker::Send` is not implemented for `::AssocType` + = help: consider adding a `where ::AssocType: std::marker::Send` bound +note: required by `is_send` + --> $DIR/typeck-default-trait-impl-assoc-type.rs:22:1 + | +LL | fn is_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/typeck/typeck-default-trait-impl-constituent-types-2.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs rename to src/test/ui/typeck/typeck-default-trait-impl-constituent-types-2.rs diff --git a/src/test/ui/typeck/typeck-default-trait-impl-constituent-types-2.stderr b/src/test/ui/typeck/typeck-default-trait-impl-constituent-types-2.stderr new file mode 100644 index 0000000000000..a52628e233cba --- /dev/null +++ b/src/test/ui/typeck/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: + + = 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() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/typeck/typeck-default-trait-impl-constituent-types.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs rename to src/test/ui/typeck/typeck-default-trait-impl-constituent-types.rs diff --git a/src/test/ui/typeck/typeck-default-trait-impl-constituent-types.stderr b/src/test/ui/typeck/typeck-default-trait-impl-constituent-types.stderr new file mode 100644 index 0000000000000..2e382dd05cbc3 --- /dev/null +++ b/src/test/ui/typeck/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::(); + | ^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `MyS2` + | + = help: the following implementations were found: + +note: required by `is_mytrait` + --> $DIR/typeck-default-trait-impl-constituent-types.rs:25:1 + | +LL | fn is_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/typeck/typeck-default-trait-impl-cross-crate-coherence.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-cross-crate-coherence.rs rename to src/test/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.rs diff --git a/src/test/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr b/src/test/ui/typeck/typeck-default-trait-impl-cross-crate-coherence.stderr new file mode 100644 index 0000000000000..6efb7f39f3b2f --- /dev/null +++ b/src/test/ui/typeck/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 { } //~ 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 { } //~ 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/typeck/typeck-default-trait-impl-negation-send.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-negation-send.rs rename to src/test/ui/typeck/typeck-default-trait-impl-negation-send.rs diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr new file mode 100644 index 0000000000000..8dc7df90355f6 --- /dev/null +++ b/src/test/ui/typeck/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` 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() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +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/typeck/typeck-default-trait-impl-negation-sync.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-negation-sync.rs rename to src/test/ui/typeck/typeck-default-trait-impl-negation-sync.rs diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr new file mode 100644 index 0000000000000..b0fe2c599be41 --- /dev/null +++ b/src/test/ui/typeck/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` 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() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::cell::UnsafeCell` cannot be shared between threads safely + --> $DIR/typeck-default-trait-impl-negation-sync.rs:48:5 + | +LL | is_sync::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` cannot be shared between threads safely + | + = help: within `MyTypeWUnsafe`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell` + = 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() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `Managed` cannot be shared between threads safely + --> $DIR/typeck-default-trait-impl-negation-sync.rs:51:5 + | +LL | is_sync::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^ `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() {} + | ^^^^^^^^^^^^^^^^^^^^^ + +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/typeck/typeck-default-trait-impl-negation.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-negation.rs rename to src/test/ui/typeck/typeck-default-trait-impl-negation.rs diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation.stderr new file mode 100644 index 0000000000000..4427955c4b2c8 --- /dev/null +++ b/src/test/ui/typeck/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::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `ThisImplsUnsafeTrait` + | + = help: the following implementations were found: + +note: required by `is_my_trait` + --> $DIR/typeck-default-trait-impl-negation.rs:26:1 + | +LL | fn is_my_trait() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `ThisImplsTrait: MyUnsafeTrait` is not satisfied + --> $DIR/typeck-default-trait-impl-negation.rs:34:5 + | +LL | is_my_unsafe_trait::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MyUnsafeTrait` is not implemented for `ThisImplsTrait` + | + = help: the following implementations were found: + +note: required by `is_my_unsafe_trait` + --> $DIR/typeck-default-trait-impl-negation.rs:27:1 + | +LL | fn is_my_unsafe_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/typeck-default-trait-impl-precedence.rs b/src/test/ui/typeck/typeck-default-trait-impl-precedence.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-precedence.rs rename to src/test/ui/typeck/typeck-default-trait-impl-precedence.rs diff --git a/src/test/ui/typeck/typeck-default-trait-impl-precedence.stderr b/src/test/ui/typeck/typeck-default-trait-impl-precedence.stderr new file mode 100644 index 0000000000000..0ab5eaaa34f78 --- /dev/null +++ b/src/test/ui/typeck/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() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/typeck/typeck-default-trait-impl-send-param.rs similarity index 100% rename from src/test/compile-fail/typeck-default-trait-impl-send-param.rs rename to src/test/ui/typeck/typeck-default-trait-impl-send-param.rs diff --git a/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr b/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr new file mode 100644 index 0000000000000..82f31176f3e50 --- /dev/null +++ b/src/test/ui/typeck/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::() //~ 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() { + | ^^^^^^^^^^^^^^^^^^^^ + +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/typeck/typeck-negative-impls-builtin.rs similarity index 100% rename from src/test/compile-fail/typeck-negative-impls-builtin.rs rename to src/test/ui/typeck/typeck-negative-impls-builtin.rs diff --git a/src/test/ui/typeck/typeck-negative-impls-builtin.stderr b/src/test/ui/typeck/typeck-negative-impls-builtin.stderr new file mode 100644 index 0000000000000..6ae323aedfeb2 --- /dev/null +++ b/src/test/ui/typeck/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/typeck/typeck-unsafe-always-share.rs similarity index 100% rename from src/test/compile-fail/typeck-unsafe-always-share.rs rename to src/test/ui/typeck/typeck-unsafe-always-share.rs diff --git a/src/test/ui/typeck/typeck-unsafe-always-share.stderr b/src/test/ui/typeck/typeck-unsafe-always-share.stderr new file mode 100644 index 0000000000000..57c4bdf0ad2dc --- /dev/null +++ b/src/test/ui/typeck/typeck-unsafe-always-share.stderr @@ -0,0 +1,56 @@ +error[E0277]: `std::cell::UnsafeCell>` cannot be shared between threads safely + --> $DIR/typeck-unsafe-always-share.rs:29:5 + | +LL | test(us); + | ^^^^ `std::cell::UnsafeCell>` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell>` +note: required by `test` + --> $DIR/typeck-unsafe-always-share.rs:25:1 + | +LL | fn test(s: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::cell::UnsafeCell` cannot be shared between threads safely + --> $DIR/typeck-unsafe-always-share.rs:33:5 + | +LL | test(uns); + | ^^^^ `std::cell::UnsafeCell` cannot be shared between threads safely + | + = help: the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell` +note: required by `test` + --> $DIR/typeck-unsafe-always-share.rs:25:1 + | +LL | fn test(s: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^ + +error[E0277]: `std::cell::UnsafeCell` cannot be shared between threads safely + --> $DIR/typeck-unsafe-always-share.rs:37:5 + | +LL | test(ms); + | ^^^^ `std::cell::UnsafeCell` cannot be shared between threads safely + | + = help: within `MySync`, the trait `std::marker::Sync` is not implemented for `std::cell::UnsafeCell` + = note: required because it appears within the type `MySync` +note: required by `test` + --> $DIR/typeck-unsafe-always-share.rs:25:1 + | +LL | fn test(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(s: T) {} + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/typeck_type_placeholder_item.rs b/src/test/ui/typeck/typeck_type_placeholder_item.rs similarity index 100% rename from src/test/ui/typeck_type_placeholder_item.rs rename to src/test/ui/typeck/typeck_type_placeholder_item.rs diff --git a/src/test/ui/typeck_type_placeholder_item.stderr b/src/test/ui/typeck/typeck_type_placeholder_item.stderr similarity index 100% rename from src/test/ui/typeck_type_placeholder_item.stderr rename to src/test/ui/typeck/typeck_type_placeholder_item.stderr diff --git a/src/test/ui/typeck_type_placeholder_lifetime_1.rs b/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.rs similarity index 100% rename from src/test/ui/typeck_type_placeholder_lifetime_1.rs rename to src/test/ui/typeck/typeck_type_placeholder_lifetime_1.rs diff --git a/src/test/ui/typeck_type_placeholder_lifetime_1.stderr b/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr similarity index 100% rename from src/test/ui/typeck_type_placeholder_lifetime_1.stderr rename to src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr diff --git a/src/test/ui/typeck_type_placeholder_lifetime_2.rs b/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.rs similarity index 100% rename from src/test/ui/typeck_type_placeholder_lifetime_2.rs rename to src/test/ui/typeck/typeck_type_placeholder_lifetime_2.rs diff --git a/src/test/ui/typeck_type_placeholder_lifetime_2.stderr b/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr similarity index 100% rename from src/test/ui/typeck_type_placeholder_lifetime_2.stderr rename to src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr diff --git a/src/test/compile-fail/typeck_type_placeholder_mismatch.rs b/src/test/ui/typeck/typeck_type_placeholder_mismatch.rs similarity index 100% rename from src/test/compile-fail/typeck_type_placeholder_mismatch.rs rename to src/test/ui/typeck/typeck_type_placeholder_mismatch.rs diff --git a/src/test/ui/typeck/typeck_type_placeholder_mismatch.stderr b/src/test/ui/typeck/typeck_type_placeholder_mismatch.stderr new file mode 100644 index 0000000000000..6a7623538194c --- /dev/null +++ b/src/test/ui/typeck/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::(PhantomData); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar` + | + = note: expected type `Foo<_>` + found type `Bar` + +error[E0308]: mismatched types + --> $DIR/typeck_type_placeholder_mismatch.rs:32:21 + | +LL | let x: Foo<_> = Bar::(PhantomData); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found struct `Bar` + | + = note: expected type `Foo<_>` + found type `Bar` + +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/ufcs/ufcs-explicit-self-bad.rs similarity index 100% rename from src/test/compile-fail/ufcs-explicit-self-bad.rs rename to src/test/ui/ufcs/ufcs-explicit-self-bad.rs diff --git a/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr b/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr new file mode 100644 index 0000000000000..fce74605cad38 --- /dev/null +++ b/src/test/ui/ufcs/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` + +error[E0307]: invalid `self` type: Bar + --> $DIR/ufcs-explicit-self-bad.rs:29:18 + | +LL | fn foo(self: Bar, x: isize) -> isize { + | ^^^^^^^^^^ + | + = note: type must be `Bar` or a type that dereferences to it + = help: consider changing to `self`, `&self`, `&mut self`, or `self: Box` + +error[E0307]: invalid `self` type: &Bar + --> $DIR/ufcs-explicit-self-bad.rs:33:18 + | +LL | fn bar(self: &Bar, x: isize) -> isize { + | ^^^^^^^^^^^ + | + = note: type must be `Bar` or a type that dereferences to it + = help: consider changing to `self`, `&self`, `&mut self`, or `self: Box` + +error[E0308]: mismatched method receiver + --> $DIR/ufcs-explicit-self-bad.rs:47:21 + | +LL | fn dummy2(self: &Bar) {} //~ ERROR mismatched method receiver + | ^^^^^^^ lifetime mismatch + | + = note: expected type `&'a Bar` + found type `&Bar` +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) {} //~ 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 { + | ^^ + +error[E0308]: mismatched method receiver + --> $DIR/ufcs-explicit-self-bad.rs:47:21 + | +LL | fn dummy2(self: &Bar) {} //~ ERROR mismatched method receiver + | ^^^^^^^ lifetime mismatch + | + = note: expected type `&'a Bar` + found type `&Bar` +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 { + | ^^ +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) {} //~ ERROR mismatched method receiver + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0308]: mismatched method receiver + --> $DIR/ufcs-explicit-self-bad.rs:49:21 + | +LL | fn dummy3(self: &&Bar) {} + | ^^^^^^^^ lifetime mismatch + | + = note: expected type `&'a Bar` + found type `&Bar` +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +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 { + | ^^ + +error[E0308]: mismatched method receiver + --> $DIR/ufcs-explicit-self-bad.rs:49:21 + | +LL | fn dummy3(self: &&Bar) {} + | ^^^^^^^^ lifetime mismatch + | + = note: expected type `&'a Bar` + found type `&Bar` +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 { + | ^^ +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) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/ufcs/ufcs-partially-resolved.rs similarity index 100% rename from src/test/compile-fail/ufcs-partially-resolved.rs rename to src/test/ui/ufcs/ufcs-partially-resolved.rs diff --git a/src/test/ui/ufcs/ufcs-partially-resolved.stderr b/src/test/ui/ufcs/ufcs-partially-resolved.stderr new file mode 100644 index 0000000000000..5de8fb158b770 --- /dev/null +++ b/src/test/ui/ufcs/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 _: ::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 | ::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 _: ::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 _: ::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 _: ::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 | ::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 | ::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 | ::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 _: ::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 | ::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 _: ::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 _: ::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 _: ::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 | ::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 | ::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 | ::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 _: ::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 | ::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 _: ::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 _: ::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 _: ::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 | ::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 | ::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 | ::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 _: ::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 | ::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 _: ::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 | ::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 _: ::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 _: ::Y::NN; //~ ERROR ambiguous associated type + | ^^^^^^^^^^^^^^^^^ ambiguous associated type + | + = note: specify the type using the syntax `<::Y as Trait>::NN` + +error[E0599]: no associated item named `NN` found for type `::Y` in the current scope + --> $DIR/ufcs-partially-resolved.rs:48:5 + | +LL | ::Y::NN; //~ ERROR no associated item named `NN` found for type `::Y` + | ^^^^^^^^^^^^^^^^^ associated item not found in `::Y` + +error[E0599]: no associated item named `N` found for type `::X` in the current scope + --> $DIR/ufcs-partially-resolved.rs:65:5 + | +LL | ::X::N; //~ ERROR no associated item named `N` found for type `::X` + | ^^^^^^^^^^^^^^^^ associated item not found in `::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/ufcs/ufcs-qpath-missing-params.rs similarity index 100% rename from src/test/compile-fail/ufcs-qpath-missing-params.rs rename to src/test/ui/ufcs/ufcs-qpath-missing-params.rs diff --git a/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr b/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr new file mode 100644 index 0000000000000..6c752dba6b449 --- /dev/null +++ b/src/test/ui/ufcs/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 | ::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/ufcs/ufcs-qpath-self-mismatch.rs similarity index 100% rename from src/test/compile-fail/ufcs-qpath-self-mismatch.rs rename to src/test/ui/ufcs/ufcs-qpath-self-mismatch.rs diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr new file mode 100644 index 0000000000000..f4222631872cd --- /dev/null +++ b/src/test/ui/ufcs/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 | >::add(1, 2); + | ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32` + | + = help: the trait `std::ops::Add` is not implemented for `i32` + +error[E0308]: mismatched types + --> $DIR/ufcs-qpath-self-mismatch.rs:16:28 + | +LL | >::add(1u32, 2); + | ^^^^ expected i32, found u32 + +error[E0308]: mismatched types + --> $DIR/ufcs-qpath-self-mismatch.rs:18:31 + | +LL | >::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/unboxed-closures/unboxed-closure-feature-gate.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-feature-gate.rs rename to src/test/ui/unboxed-closures/unboxed-closure-feature-gate.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-feature-gate.stderr b/src/test/ui/unboxed-closures/unboxed-closure-feature-gate.stderr new file mode 100644 index 0000000000000..aea57d9cb4ee7 --- /dev/null +++ b/src/test/ui/unboxed-closures/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; + | ^^^^^^^^^^ + | + = 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/unboxed-closures/unboxed-closure-illegal-move.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closure-illegal-move.nll.stderr new file mode 100644 index 0000000000000..e74c66c27b136 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closure-illegal-move.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-illegal-move.rs rename to src/test/ui/unboxed-closures/unboxed-closure-illegal-move.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-illegal-move.stderr b/src/test/ui/unboxed-closures/unboxed-closure-illegal-move.stderr new file mode 100644 index 0000000000000..7ff4c1c03ba0b --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closure-immutable-capture.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closure-immutable-capture.nll.stderr new file mode 100644 index 0000000000000..084d7ff3bcd61 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closure-immutable-capture.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-immutable-capture.rs rename to src/test/ui/unboxed-closures/unboxed-closure-immutable-capture.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-immutable-capture.stderr b/src/test/ui/unboxed-closures/unboxed-closure-immutable-capture.stderr new file mode 100644 index 0000000000000..02fbb5f17eeed --- /dev/null +++ b/src/test/ui/unboxed-closures/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/ui/unboxed-closure-no-cyclic-sig.rs b/src/test/ui/unboxed-closures/unboxed-closure-no-cyclic-sig.rs similarity index 100% rename from src/test/ui/unboxed-closure-no-cyclic-sig.rs rename to src/test/ui/unboxed-closures/unboxed-closure-no-cyclic-sig.rs diff --git a/src/test/ui/unboxed-closure-no-cyclic-sig.stderr b/src/test/ui/unboxed-closures/unboxed-closure-no-cyclic-sig.stderr similarity index 100% rename from src/test/ui/unboxed-closure-no-cyclic-sig.stderr rename to src/test/ui/unboxed-closures/unboxed-closure-no-cyclic-sig.stderr diff --git a/src/test/compile-fail/unboxed-closure-region.rs b/src/test/ui/unboxed-closures/unboxed-closure-region.rs similarity index 96% rename from src/test/compile-fail/unboxed-closure-region.rs rename to src/test/ui/unboxed-closures/unboxed-closure-region.rs index 1c86dda3378a9..cc635296210a0 100644 --- a/src/test/compile-fail/unboxed-closure-region.rs +++ b/src/test/ui/unboxed-closures/unboxed-closure-region.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that an unboxed closure that captures a free variable by // reference cannot escape the region of that variable. fn main() { diff --git a/src/test/ui/unboxed-closures/unboxed-closure-region.stderr b/src/test/ui/unboxed-closures/unboxed-closure-region.stderr new file mode 100644 index 0000000000000..a838c3608b9a9 --- /dev/null +++ b/src/test/ui/unboxed-closures/unboxed-closure-region.stderr @@ -0,0 +1,15 @@ +error[E0597]: `x` does not live long enough + --> $DIR/unboxed-closure-region.rs:18: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/unboxed-closures/unboxed-closure-sugar-default.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-default.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-default.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr new file mode 100644 index 0000000000000..fccf295b72c61 --- /dev/null +++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr @@ -0,0 +1,15 @@ +error[E0277]: the trait bound `dyn Foo<(isize,), isize, Output=()>: Eq>` is not satisfied + --> $DIR/unboxed-closure-sugar-default.rs:31:5 + | +LL | eq::< Foo<(isize,),isize,Output=()>, Foo(isize) >(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq>` is not implemented for `dyn Foo<(isize,), isize, Output=()>` + | +note: required by `eq` + --> $DIR/unboxed-closure-sugar-default.rs:24:1 + | +LL | fn eq() where A : Eq { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/unboxed-closures/unboxed-closure-sugar-equiv.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-equiv.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr new file mode 100644 index 0000000000000..7d687a55df95d --- /dev/null +++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `dyn Foo<(char,), Output=()>: Eq>` is not satisfied + --> $DIR/unboxed-closure-sugar-equiv.rs:53:5 + | +LL | / eq::< Foo<(),Output=()>, +LL | | Foo(char) >(); + | |___________________________________________________________________^ the trait `Eq>` is not implemented for `dyn Foo<(char,), Output=()>` + | +note: required by `eq` + --> $DIR/unboxed-closure-sugar-equiv.rs:26:1 + | +LL | fn eq>() { } + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/unboxed-closures/unboxed-closure-sugar-lifetime-elision.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-lifetime-elision.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-lifetime-elision.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-lifetime-elision.stderr new file mode 100644 index 0000000000000..fa74e6e660745 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-not-used-on-fn.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr new file mode 100644 index 0000000000000..bda88f4e4d7fb --- /dev/null +++ b/src/test/ui/unboxed-closures/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(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/unboxed-closures/unboxed-closure-sugar-region.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-region.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-region.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr new file mode 100644 index 0000000000000..663034ba143b7 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closure-sugar-used-on-struct-1.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-used-on-struct-1.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-1.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-1.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-1.stderr new file mode 100644 index 0000000000000..1ca99680b5390 --- /dev/null +++ b/src/test/ui/unboxed-closures/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 = 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/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-used-on-struct-3.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct-3.stderr new file mode 100644 index 0000000000000..d6c08a7056551 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closure-sugar-used-on-struct.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-used-on-struct.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-used-on-struct.stderr new file mode 100644 index 0000000000000..954ec4d63a60b --- /dev/null +++ b/src/test/ui/unboxed-closures/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) { + | ^^ 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) { + | ^^^^^ 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/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-1.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-1.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-1.stderr new file mode 100644 index 0000000000000..e7476f0fa6d48 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters-3.stderr new file mode 100644 index 0000000000000..feac4274357b5 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.rs similarity index 100% rename from src/test/compile-fail/unboxed-closure-sugar-wrong-number-number-type-parameters.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr new file mode 100644 index 0000000000000..457bea046c762 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/ui/unboxed-closure-sugar-wrong-trait.rs b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.rs similarity index 100% rename from src/test/ui/unboxed-closure-sugar-wrong-trait.rs rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.rs diff --git a/src/test/ui/unboxed-closure-sugar-wrong-trait.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr similarity index 100% rename from src/test/ui/unboxed-closure-sugar-wrong-trait.stderr rename to src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr diff --git a/src/test/compile-fail/unboxed-closures-borrow-conflict.rs b/src/test/ui/unboxed-closures/unboxed-closures-borrow-conflict.rs similarity index 96% rename from src/test/compile-fail/unboxed-closures-borrow-conflict.rs rename to src/test/ui/unboxed-closures/unboxed-closures-borrow-conflict.rs index ad7e6784a0a41..734f89e5e0b8b 100644 --- a/src/test/compile-fail/unboxed-closures-borrow-conflict.rs +++ b/src/test/ui/unboxed-closures/unboxed-closures-borrow-conflict.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that an unboxed closure that mutates a free variable will // cause borrow conflicts. diff --git a/src/test/ui/unboxed-closures/unboxed-closures-borrow-conflict.stderr b/src/test/ui/unboxed-closures/unboxed-closures-borrow-conflict.stderr new file mode 100644 index 0000000000000..9bdd1022fd179 --- /dev/null +++ b/src/test/ui/unboxed-closures/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:19: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/unboxed-closures/unboxed-closures-failed-recursive-fn-1.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.nll.stderr new file mode 100644 index 0000000000000..8cda1e60ba988 --- /dev/null +++ b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.nll.stderr @@ -0,0 +1,62 @@ +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 + | + = note: borrowed value must be valid for the static lifetime... + +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 + | + = note: borrowed value must be valid for the static lifetime... + +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/unboxed-closures/unboxed-closures-failed-recursive-fn-1.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-failed-recursive-fn-1.rs rename to src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.stderr b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-1.stderr new file mode 100644 index 0000000000000..8390e9f0f956c --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-failed-recursive-fn-2.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-failed-recursive-fn-2.rs rename to src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr b/src/test/ui/unboxed-closures/unboxed-closures-failed-recursive-fn-2.stderr new file mode 100644 index 0000000000000..fd6858cf7bfe3 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-fnmut-as-fn.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-fnmut-as-fn.rs rename to src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr new file mode 100644 index 0000000000000..95aa3f15b7648 --- /dev/null +++ b/src/test/ui/unboxed-closures/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_itisize>(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/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.nll.stderr new file mode 100644 index 0000000000000..a113c1ae27fb4 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-infer-argument-types-two-region-pointers.rs rename to src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-argument-types-two-region-pointers.stderr new file mode 100644 index 0000000000000..7e59347155b47 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures-infer-fn-once-move-from-projection.rs b/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.rs similarity index 100% rename from src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.rs rename to src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.rs diff --git a/src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr similarity index 100% rename from src/test/ui/unboxed-closures-infer-fn-once-move-from-projection.stderr rename to src/test/ui/unboxed-closures/unboxed-closures-infer-fn-once-move-from-projection.stderr diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.nll.stderr new file mode 100644 index 0000000000000..718c3a19938c4 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs rename to src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr new file mode 100644 index 0000000000000..bb2ffcd21b096 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-fnmut-missing-mut.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-missing-mut.nll.stderr new file mode 100644 index 0000000000000..c57f97652b342 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-fnmut-missing-mut.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-infer-fnmut-missing-mut.rs rename to src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-missing-mut.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-missing-mut.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-missing-mut.stderr new file mode 100644 index 0000000000000..22e11b6977c03 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.nll.stderr new file mode 100644 index 0000000000000..a26dc08e54a34 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-infer-fnmut-move-missing-mut.rs rename to src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnmut-move-missing-mut.stderr new file mode 100644 index 0000000000000..f9fd6c21b706c --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.nll.stderr new file mode 100644 index 0000000000000..f4756696b6b06 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-infer-fnonce-call-twice.rs rename to src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-call-twice.stderr new file mode 100644 index 0000000000000..c713b3dd8febc --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-fnonce-move-call-twice.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-move-call-twice.nll.stderr new file mode 100644 index 0000000000000..95ed673627877 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-infer-fnonce-move-call-twice.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-infer-fnonce-move-call-twice.rs rename to src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-move-call-twice.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-move-call-twice.stderr b/src/test/ui/unboxed-closures/unboxed-closures-infer-fnonce-move-call-twice.stderr new file mode 100644 index 0000000000000..a9006318cd8b2 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-mutate-upvar.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-mutate-upvar.nll.stderr new file mode 100644 index 0000000000000..f765f207303d2 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-mutate-upvar.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-mutate-upvar.rs rename to src/test/ui/unboxed-closures/unboxed-closures-mutate-upvar.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-mutate-upvar.stderr b/src/test/ui/unboxed-closures/unboxed-closures-mutate-upvar.stderr new file mode 100644 index 0000000000000..1164a864b6b46 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.nll.stderr new file mode 100644 index 0000000000000..be18e7cee9110 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.stderr b/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.ast.stderr new file mode 100644 index 0000000000000..756bf06440c32 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr b/src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.mir.stderr new file mode 100644 index 0000000000000..be18e7cee9110 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-mutated-upvar-from-fn-closure.rs rename to src/test/ui/unboxed-closures/unboxed-closures-mutated-upvar-from-fn-closure.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-recursive-fn-using-fn-mut.nll.stderr b/src/test/ui/unboxed-closures/unboxed-closures-recursive-fn-using-fn-mut.nll.stderr new file mode 100644 index 0000000000000..e2747e1bb62c4 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-recursive-fn-using-fn-mut.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-recursive-fn-using-fn-mut.rs rename to src/test/ui/unboxed-closures/unboxed-closures-recursive-fn-using-fn-mut.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-recursive-fn-using-fn-mut.stderr b/src/test/ui/unboxed-closures/unboxed-closures-recursive-fn-using-fn-mut.stderr new file mode 100644 index 0000000000000..eec48dd78b01c --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-static-call-wrong-trait.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-static-call-wrong-trait.rs rename to src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr b/src/test/ui/unboxed-closures/unboxed-closures-static-call-wrong-trait.stderr new file mode 100644 index 0000000000000..53386f0e68ef5 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-type-mismatch.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-type-mismatch.rs rename to src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr b/src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr new file mode 100644 index 0000000000000..7e11130573b17 --- /dev/null +++ b/src/test/ui/unboxed-closures/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/unboxed-closures/unboxed-closures-unsafe-extern-fn.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-unsafe-extern-fn.rs rename to src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr new file mode 100644 index 0000000000000..16b2b11ad7b42 --- /dev/null +++ b/src/test/ui/unboxed-closures/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_itisize>(_: &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_mutisize>(_: &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_onceisize>(_: 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/unboxed-closures/unboxed-closures-wrong-abi.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-wrong-abi.rs rename to src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr new file mode 100644 index 0000000000000..6e5e1b928a2c0 --- /dev/null +++ b/src/test/ui/unboxed-closures/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_itisize>(_: &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_mutisize>(_: &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_onceisize>(_: 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/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.rs similarity index 100% rename from src/test/compile-fail/unboxed-closures-wrong-arg-type-extern-fn.rs rename to src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.rs diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr new file mode 100644 index 0000000000000..5c2e73f57160d --- /dev/null +++ b/src/test/ui/unboxed-closures/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_itisize>(_: &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_mutisize>(_: &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_onceisize>(_: 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/underscore-lifetime/underscore-lifetime-binders.rs similarity index 100% rename from src/test/compile-fail/underscore-lifetime-binders.rs rename to src/test/ui/underscore-lifetime/underscore-lifetime-binders.rs diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-binders.stderr new file mode 100644 index 0000000000000..4917c2795e39d --- /dev/null +++ b/src/test/ui/underscore-lifetime/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 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 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/underscore-lifetime/underscore-lifetime-elison-mismatch.nll.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.nll.stderr new file mode 100644 index 0000000000000..eef04cbf35177 --- /dev/null +++ b/src/test/ui/underscore-lifetime/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/underscore-lifetime/underscore-lifetime-elison-mismatch.rs similarity index 100% rename from src/test/compile-fail/underscore-lifetime-elison-mismatch.rs rename to src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.rs diff --git a/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr b/src/test/ui/underscore-lifetime/underscore-lifetime-elison-mismatch.stderr new file mode 100644 index 0000000000000..0847ea362c9e4 --- /dev/null +++ b/src/test/ui/underscore-lifetime/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/uninhabited/uninhabited-enum-cast.rs similarity index 100% rename from src/test/compile-fail/uninhabited-enum-cast.rs rename to src/test/ui/uninhabited/uninhabited-enum-cast.rs diff --git a/src/test/ui/uninhabited/uninhabited-enum-cast.stderr b/src/test/ui/uninhabited/uninhabited-enum-cast.stderr new file mode 100644 index 0000000000000..058f8fba77cc3 --- /dev/null +++ b/src/test/ui/uninhabited/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/uninhabited/uninhabited-irrefutable.rs similarity index 100% rename from src/test/compile-fail/uninhabited-irrefutable.rs rename to src/test/ui/uninhabited/uninhabited-irrefutable.rs diff --git a/src/test/ui/uninhabited/uninhabited-irrefutable.stderr b/src/test/ui/uninhabited/uninhabited-irrefutable.stderr new file mode 100644 index 0000000000000..e14ca6262228e --- /dev/null +++ b/src/test/ui/uninhabited/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/uninhabited/uninhabited-matches-feature-gated.rs similarity index 100% rename from src/test/compile-fail/uninhabited-matches-feature-gated.rs rename to src/test/ui/uninhabited/uninhabited-matches-feature-gated.rs diff --git a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr new file mode 100644 index 0000000000000..d86ebda027efb --- /dev/null +++ b/src/test/ui/uninhabited/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/uninhabited/uninhabited-patterns.rs similarity index 100% rename from src/test/compile-fail/uninhabited-patterns.rs rename to src/test/ui/uninhabited/uninhabited-patterns.rs diff --git a/src/test/ui/uninhabited/uninhabited-patterns.stderr b/src/test/ui/uninhabited/uninhabited-patterns.stderr new file mode 100644 index 0000000000000..f11ff7c13b5e9 --- /dev/null +++ b/src/test/ui/uninhabited/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/union-ub-fat-ptr.rs similarity index 91% rename from src/test/compile-fail/union-ub-fat-ptr.rs rename to src/test/ui/union-ub-fat-ptr.rs index 935e69d2e2230..cfce92ece7a92 100644 --- a/src/test/compile-fail/union-ub-fat-ptr.rs +++ b/src/test/ui/union-ub-fat-ptr.rs @@ -8,6 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// normalize-stderr-test "alignment \d+" -> "alignment N" +// normalize-stderr-test "offset \d+" -> "offset N" +// normalize-stderr-test "allocation \d+" -> "allocation N" +// normalize-stderr-test "size \d+" -> "size N" + #[repr(C)] #[derive(Copy, Clone)] struct SliceRepr { diff --git a/src/test/ui/union-ub-fat-ptr.stderr b/src/test/ui/union-ub-fat-ptr.stderr new file mode 100644 index 0000000000000..f0298d9013c93 --- /dev/null +++ b/src/test/ui/union-ub-fat-ptr.stderr @@ -0,0 +1,43 @@ +error[E0080]: this constant likely exhibits undefined behavior + --> $DIR/union-ub-fat-ptr.rs:72: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:80: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:84:1 + | +LL | const D: &Trait = unsafe { DynTransmute { repr: DynRepr { ptr: &92, vtable: &3 } }.rust}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tried to access memory with alignment N, but alignment N 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:87:1 + | +LL | const E: &Trait = unsafe { DynTransmute { repr2: DynRepr2 { ptr: &92, vtable: &3 } }.rust}; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ memory access at offset N, outside bounds of allocation N which has size N + | + = 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:90: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/union/union-borrow-move-parent-sibling.nll.stderr b/src/test/ui/union/union-borrow-move-parent-sibling.nll.stderr new file mode 100644 index 0000000000000..1ca2a56e757fb --- /dev/null +++ b/src/test/ui/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/union/union-borrow-move-parent-sibling.rs similarity index 100% rename from src/test/compile-fail/union/union-borrow-move-parent-sibling.rs rename to src/test/ui/union/union-borrow-move-parent-sibling.rs diff --git a/src/test/ui/union/union-borrow-move-parent-sibling.stderr b/src/test/ui/union/union-borrow-move-parent-sibling.stderr new file mode 100644 index 0000000000000..d855435416e5d --- /dev/null +++ b/src/test/ui/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/union/union-const-pat.rs similarity index 100% rename from src/test/compile-fail/union/union-const-pat.rs rename to src/test/ui/union/union-const-pat.rs diff --git a/src/test/ui/union/union-const-pat.stderr b/src/test/ui/union/union-const-pat.stderr new file mode 100644 index 0000000000000..2d9c9a5e52049 --- /dev/null +++ b/src/test/ui/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/union/union-copy.rs similarity index 100% rename from src/test/compile-fail/union/union-copy.rs rename to src/test/ui/union/union-copy.rs diff --git a/src/test/ui/union/union-copy.stderr b/src/test/ui/union/union-copy.stderr new file mode 100644 index 0000000000000..05da9e90af76b --- /dev/null +++ b/src/test/ui/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/union/union-derive-clone.rs similarity index 100% rename from src/test/compile-fail/union/union-derive-clone.rs rename to src/test/ui/union/union-derive-clone.rs diff --git a/src/test/ui/union/union-derive-clone.stderr b/src/test/ui/union/union-derive-clone.stderr new file mode 100644 index 0000000000000..e9a92b4452afb --- /dev/null +++ b/src/test/ui/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` in the current scope + --> $DIR/union-derive-clone.rs:40:15 + | +LL | union U4 { + | ----------- method `clone` not found for this +... +LL | let w = u.clone(); //~ ERROR no method named `clone` found for type `U4` + | ^^^^^ + | + = note: the method `clone` exists but the following trait bounds were not satisfied: + `U4 : 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/union/union-derive.rs similarity index 100% rename from src/test/compile-fail/union/union-derive.rs rename to src/test/ui/union/union-derive.rs diff --git a/src/test/ui/union/union-derive.stderr b/src/test/ui/union/union-derive.stderr new file mode 100644 index 0000000000000..e8e11e832d901 --- /dev/null +++ b/src/test/ui/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/union/union-empty.rs similarity index 100% rename from src/test/compile-fail/union/union-empty.rs rename to src/test/ui/union/union-empty.rs diff --git a/src/test/ui/union/union-empty.stderr b/src/test/ui/union/union-empty.stderr new file mode 100644 index 0000000000000..5abe45814acce --- /dev/null +++ b/src/test/ui/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/union/union-generic.rs similarity index 100% rename from src/test/compile-fail/union/union-generic.rs rename to src/test/ui/union/union-generic.rs diff --git a/src/test/ui/union/union-generic.stderr b/src/test/ui/union/union-generic.stderr new file mode 100644 index 0000000000000..dbfffa005fb80 --- /dev/null +++ b/src/test/ui/union/union-generic.stderr @@ -0,0 +1,27 @@ +error[E0277]: the trait bound `std::rc::Rc: 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` + | +note: required by `U` + --> $DIR/union-generic.rs:13:1 + | +LL | union U { + | ^^^^^^^^^^^^^^^^ + +error[E0277]: the trait bound `std::rc::Rc: std::marker::Copy` is not satisfied + --> $DIR/union-generic.rs:20:13 + | +LL | let u = U::> { a: Default::default() }; + | ^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::rc::Rc` + | +note: required by `U` + --> $DIR/union-generic.rs:13:1 + | +LL | union U { + | ^^^^^^^^^^^^^^^^ + +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/union/union-lint-dead-code.rs similarity index 100% rename from src/test/compile-fail/union/union-lint-dead-code.rs rename to src/test/ui/union/union-lint-dead-code.rs diff --git a/src/test/ui/union/union-lint-dead-code.stderr b/src/test/ui/union/union-lint-dead-code.stderr new file mode 100644 index 0000000000000..2cd3aab8c29cb --- /dev/null +++ b/src/test/ui/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/union/union-nonrepresentable.rs similarity index 100% rename from src/test/compile-fail/union/union-nonrepresentable.rs rename to src/test/ui/union/union-nonrepresentable.rs diff --git a/src/test/ui/union/union-nonrepresentable.stderr b/src/test/ui/union/union-nonrepresentable.stderr new file mode 100644 index 0000000000000..17d78ea4c2b04 --- /dev/null +++ b/src/test/ui/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/union/union-repr-c.rs similarity index 100% rename from src/test/compile-fail/union/union-repr-c.rs rename to src/test/ui/union/union-repr-c.rs diff --git a/src/test/ui/union/union-repr-c.stderr b/src/test/ui/union/union-repr-c.stderr new file mode 100644 index 0000000000000..ddf500491927d --- /dev/null +++ b/src/test/ui/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/union/union-unsafe.rs similarity index 100% rename from src/test/compile-fail/union/union-unsafe.rs rename to src/test/ui/union/union-unsafe.rs diff --git a/src/test/ui/union/union-unsafe.stderr b/src/test/ui/union/union-unsafe.stderr new file mode 100644 index 0000000000000..a0b3d98f7a003 --- /dev/null +++ b/src/test/ui/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/union/union-unsized.rs similarity index 100% rename from src/test/compile-fail/union/union-unsized.rs rename to src/test/ui/union/union-unsized.rs diff --git a/src/test/ui/union/union-unsized.stderr b/src/test/ui/union/union-unsized.stderr new file mode 100644 index 0000000000000..e2da60358817a --- /dev/null +++ b/src/test/ui/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 + = 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 + = 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/union/union-with-drop-fields-lint.rs similarity index 100% rename from src/test/compile-fail/union/union-with-drop-fields-lint.rs rename to src/test/ui/union/union-with-drop-fields-lint.rs diff --git a/src/test/ui/union/union-with-drop-fields-lint.stderr b/src/test/ui/union/union-with-drop-fields-lint.stderr new file mode 100644 index 0000000000000..2d3d539cda575 --- /dev/null +++ b/src/test/ui/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/unique-object-noncopyable.rs similarity index 100% rename from src/test/compile-fail/unique-object-noncopyable.rs rename to src/test/ui/unique-object-noncopyable.rs diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr new file mode 100644 index 0000000000000..777b9f19badb5 --- /dev/null +++ b/src/test/ui/unique-object-noncopyable.stderr @@ -0,0 +1,15 @@ +error[E0599]: no method named `clone` found for type `std::boxed::Box` 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 : 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/unique-pinned-nocopy.rs similarity index 100% rename from src/test/compile-fail/unique-pinned-nocopy.rs rename to src/test/ui/unique-pinned-nocopy.rs diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr new file mode 100644 index 0000000000000..ddc676601fa2e --- /dev/null +++ b/src/test/ui/unique-pinned-nocopy.stderr @@ -0,0 +1,15 @@ +error[E0599]: no method named `clone` found for type `std::boxed::Box` 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 : 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/unknown-lint-tool-name.rs similarity index 100% rename from src/test/compile-fail/unknown-lint-tool-name.rs rename to src/test/ui/unknown-lint-tool-name.rs diff --git a/src/test/ui/unknown-lint-tool-name.stderr b/src/test/ui/unknown-lint-tool-name.stderr new file mode 100644 index 0000000000000..29c3a642d875b --- /dev/null +++ b/src/test/ui/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/unknown-tool-name.rs similarity index 100% rename from src/test/compile-fail/unknown-tool-name.rs rename to src/test/ui/unknown-tool-name.rs diff --git a/src/test/ui/unknown-tool-name.stderr b/src/test/ui/unknown-tool-name.stderr new file mode 100644 index 0000000000000..151f957ac568a --- /dev/null +++ b/src/test/ui/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/unop-move-semantics.nll.stderr b/src/test/ui/unop-move-semantics.nll.stderr new file mode 100644 index 0000000000000..111940aab2c32 --- /dev/null +++ b/src/test/ui/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/unop-move-semantics.rs similarity index 100% rename from src/test/compile-fail/unop-move-semantics.rs rename to src/test/ui/unop-move-semantics.rs diff --git a/src/test/ui/unop-move-semantics.stderr b/src/test/ui/unop-move-semantics.stderr new file mode 100644 index 0000000000000..42d17e54aa230 --- /dev/null +++ b/src/test/ui/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/unop-neg-bool.rs similarity index 100% rename from src/test/compile-fail/unop-neg-bool.rs rename to src/test/ui/unop-neg-bool.rs diff --git a/src/test/ui/unop-neg-bool.stderr b/src/test/ui/unop-neg-bool.stderr new file mode 100644 index 0000000000000..8ffb71ec4ce52 --- /dev/null +++ b/src/test/ui/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/auxiliary/unreachable_variant.rs b/src/test/ui/unreachable/auxiliary/unreachable_variant.rs similarity index 100% rename from src/test/compile-fail/auxiliary/unreachable_variant.rs rename to src/test/ui/unreachable/auxiliary/unreachable_variant.rs diff --git a/src/test/compile-fail/unreachable-arm.rs b/src/test/ui/unreachable/unreachable-arm.rs similarity index 100% rename from src/test/compile-fail/unreachable-arm.rs rename to src/test/ui/unreachable/unreachable-arm.rs diff --git a/src/test/ui/unreachable/unreachable-arm.stderr b/src/test/ui/unreachable/unreachable-arm.stderr new file mode 100644 index 0000000000000..6bd3f281ea996 --- /dev/null +++ b/src/test/ui/unreachable/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/unreachable/unreachable-code.rs similarity index 100% rename from src/test/compile-fail/unreachable-code.rs rename to src/test/ui/unreachable/unreachable-code.rs diff --git a/src/test/ui/unreachable/unreachable-code.stderr b/src/test/ui/unreachable/unreachable-code.stderr new file mode 100644 index 0000000000000..0c5d94c6502ff --- /dev/null +++ b/src/test/ui/unreachable/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/unreachable/unreachable-in-call.rs similarity index 100% rename from src/test/compile-fail/unreachable-in-call.rs rename to src/test/ui/unreachable/unreachable-in-call.rs diff --git a/src/test/ui/unreachable/unreachable-in-call.stderr b/src/test/ui/unreachable/unreachable-in-call.stderr new file mode 100644 index 0000000000000..215829af44338 --- /dev/null +++ b/src/test/ui/unreachable/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/unreachable/unreachable-loop-patterns.rs similarity index 100% rename from src/test/compile-fail/unreachable-loop-patterns.rs rename to src/test/ui/unreachable/unreachable-loop-patterns.rs diff --git a/src/test/ui/unreachable/unreachable-loop-patterns.stderr b/src/test/ui/unreachable/unreachable-loop-patterns.stderr new file mode 100644 index 0000000000000..724a92b094790 --- /dev/null +++ b/src/test/ui/unreachable/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/unreachable/unreachable-try-pattern.rs similarity index 100% rename from src/test/compile-fail/unreachable-try-pattern.rs rename to src/test/ui/unreachable/unreachable-try-pattern.rs diff --git a/src/test/ui/unreachable/unreachable-try-pattern.stderr b/src/test/ui/unreachable/unreachable-try-pattern.stderr new file mode 100644 index 0000000000000..a8a0ed3d03b84 --- /dev/null +++ b/src/test/ui/unreachable/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/unreachable/unreachable-variant.rs similarity index 100% rename from src/test/compile-fail/unreachable-variant.rs rename to src/test/ui/unreachable/unreachable-variant.rs diff --git a/src/test/ui/unreachable/unreachable-variant.stderr b/src/test/ui/unreachable/unreachable-variant.stderr new file mode 100644 index 0000000000000..fff77586549d3 --- /dev/null +++ b/src/test/ui/unreachable/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/unresolved/unresolved-extern-mod-suggestion.rs similarity index 100% rename from src/test/compile-fail/unresolved-extern-mod-suggestion.rs rename to src/test/ui/unresolved/unresolved-extern-mod-suggestion.rs diff --git a/src/test/ui/unresolved/unresolved-extern-mod-suggestion.stderr b/src/test/ui/unresolved/unresolved-extern-mod-suggestion.stderr new file mode 100644 index 0000000000000..4e3ea573d2795 --- /dev/null +++ b/src/test/ui/unresolved/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/unresolved/unresolved-import-recovery.rs similarity index 100% rename from src/test/compile-fail/unresolved-import-recovery.rs rename to src/test/ui/unresolved/unresolved-import-recovery.rs diff --git a/src/test/ui/unresolved/unresolved-import-recovery.stderr b/src/test/ui/unresolved/unresolved-import-recovery.stderr new file mode 100644 index 0000000000000..d4304195eb12c --- /dev/null +++ b/src/test/ui/unresolved/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/unresolved/unresolved-import.rs similarity index 100% rename from src/test/compile-fail/unresolved-import.rs rename to src/test/ui/unresolved/unresolved-import.rs diff --git a/src/test/ui/unresolved/unresolved-import.stderr b/src/test/ui/unresolved/unresolved-import.stderr new file mode 100644 index 0000000000000..1e663cde48a65 --- /dev/null +++ b/src/test/ui/unresolved/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/unsafe/unsafe-around-compiler-generated-unsafe.rs similarity index 100% rename from src/test/compile-fail/unsafe-around-compiler-generated-unsafe.rs rename to src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs diff --git a/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.stderr b/src/test/ui/unsafe/unsafe-around-compiler-generated-unsafe.stderr new file mode 100644 index 0000000000000..849630ac34e95 --- /dev/null +++ b/src/test/ui/unsafe/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/ui/unsafe-block-without-braces.rs b/src/test/ui/unsafe/unsafe-block-without-braces.rs similarity index 100% rename from src/test/ui/unsafe-block-without-braces.rs rename to src/test/ui/unsafe/unsafe-block-without-braces.rs diff --git a/src/test/ui/unsafe-block-without-braces.stderr b/src/test/ui/unsafe/unsafe-block-without-braces.stderr similarity index 100% rename from src/test/ui/unsafe-block-without-braces.stderr rename to src/test/ui/unsafe/unsafe-block-without-braces.stderr diff --git a/src/test/ui/unsafe-const-fn.rs b/src/test/ui/unsafe/unsafe-const-fn.rs similarity index 100% rename from src/test/ui/unsafe-const-fn.rs rename to src/test/ui/unsafe/unsafe-const-fn.rs diff --git a/src/test/ui/unsafe-const-fn.stderr b/src/test/ui/unsafe/unsafe-const-fn.stderr similarity index 100% rename from src/test/ui/unsafe-const-fn.stderr rename to src/test/ui/unsafe/unsafe-const-fn.stderr diff --git a/src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs b/src/test/ui/unsafe/unsafe-fn-assign-deref-ptr.rs similarity index 100% rename from src/test/compile-fail/unsafe-fn-assign-deref-ptr.rs rename to src/test/ui/unsafe/unsafe-fn-assign-deref-ptr.rs diff --git a/src/test/ui/unsafe/unsafe-fn-assign-deref-ptr.stderr b/src/test/ui/unsafe/unsafe-fn-assign-deref-ptr.stderr new file mode 100644 index 0000000000000..e98600a8f2f97 --- /dev/null +++ b/src/test/ui/unsafe/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/unsafe/unsafe-fn-autoderef.rs similarity index 100% rename from src/test/compile-fail/unsafe-fn-autoderef.rs rename to src/test/ui/unsafe/unsafe-fn-autoderef.rs diff --git a/src/test/ui/unsafe/unsafe-fn-autoderef.stderr b/src/test/ui/unsafe/unsafe-fn-autoderef.stderr new file mode 100644 index 0000000000000..13fcbb347c94b --- /dev/null +++ b/src/test/ui/unsafe/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/unsafe/unsafe-fn-called-from-safe.rs similarity index 100% rename from src/test/compile-fail/unsafe-fn-called-from-safe.rs rename to src/test/ui/unsafe/unsafe-fn-called-from-safe.rs diff --git a/src/test/ui/unsafe/unsafe-fn-called-from-safe.stderr b/src/test/ui/unsafe/unsafe-fn-called-from-safe.stderr new file mode 100644 index 0000000000000..a781347040e83 --- /dev/null +++ b/src/test/ui/unsafe/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/unsafe/unsafe-fn-deref-ptr.rs similarity index 100% rename from src/test/compile-fail/unsafe-fn-deref-ptr.rs rename to src/test/ui/unsafe/unsafe-fn-deref-ptr.rs diff --git a/src/test/ui/unsafe/unsafe-fn-deref-ptr.stderr b/src/test/ui/unsafe/unsafe-fn-deref-ptr.stderr new file mode 100644 index 0000000000000..885f6e446fe70 --- /dev/null +++ b/src/test/ui/unsafe/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/unsafe/unsafe-fn-used-as-value.rs similarity index 100% rename from src/test/compile-fail/unsafe-fn-used-as-value.rs rename to src/test/ui/unsafe/unsafe-fn-used-as-value.rs diff --git a/src/test/ui/unsafe/unsafe-fn-used-as-value.stderr b/src/test/ui/unsafe/unsafe-fn-used-as-value.stderr new file mode 100644 index 0000000000000..7f8af300be572 --- /dev/null +++ b/src/test/ui/unsafe/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/unsafe/unsafe-move-val-init.rs similarity index 100% rename from src/test/compile-fail/unsafe-move-val-init.rs rename to src/test/ui/unsafe/unsafe-move-val-init.rs diff --git a/src/test/ui/unsafe/unsafe-move-val-init.stderr b/src/test/ui/unsafe/unsafe-move-val-init.stderr new file mode 100644 index 0000000000000..be92623b5d018 --- /dev/null +++ b/src/test/ui/unsafe/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/unsafe/unsafe-subtyping.rs similarity index 100% rename from src/test/compile-fail/unsafe-subtyping.rs rename to src/test/ui/unsafe/unsafe-subtyping.rs diff --git a/src/test/ui/unsafe/unsafe-subtyping.stderr b/src/test/ui/unsafe/unsafe-subtyping.stderr new file mode 100644 index 0000000000000..645f2a7939e6f --- /dev/null +++ b/src/test/ui/unsafe/unsafe-subtyping.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/unsafe-subtyping.rs:14:5 + | +LL | fn foo(x: Option) -> Option { + | ---------------------- expected `std::option::Option` because of return type +LL | x //~ ERROR mismatched types + | ^ expected unsafe fn, found normal fn + | + = note: expected type `std::option::Option` + 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/unsafe-trait-impl.rs b/src/test/ui/unsafe/unsafe-trait-impl.rs similarity index 100% rename from src/test/compile-fail/unsafe-trait-impl.rs rename to src/test/ui/unsafe/unsafe-trait-impl.rs diff --git a/src/test/ui/unsafe/unsafe-trait-impl.stderr b/src/test/ui/unsafe/unsafe-trait-impl.stderr new file mode 100644 index 0000000000000..ae47d6c1627f3 --- /dev/null +++ b/src/test/ui/unsafe/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/unsized/unsized-bare-typaram.rs similarity index 100% rename from src/test/compile-fail/unsized-bare-typaram.rs rename to src/test/ui/unsized/unsized-bare-typaram.rs diff --git a/src/test/ui/unsized/unsized-bare-typaram.stderr b/src/test/ui/unsized/unsized-bare-typaram.stderr new file mode 100644 index 0000000000000..314e47baaad8b --- /dev/null +++ b/src/test/ui/unsized/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() { bar::() } + | ^^^^^^^^ 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 + = help: consider adding a `where T: std::marker::Sized` bound +note: required by `bar` + --> $DIR/unsized-bare-typaram.rs:11:1 + | +LL | fn bar() { } + | ^^^^^^^^^^^^^^^^^^ + +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/unsized/unsized-enum.rs similarity index 100% rename from src/test/compile-fail/unsized-enum.rs rename to src/test/ui/unsized/unsized-enum.rs diff --git a/src/test/ui/unsized/unsized-enum.stderr b/src/test/ui/unsized/unsized-enum.stderr new file mode 100644 index 0000000000000..f518859c37cb1 --- /dev/null +++ b/src/test/ui/unsized/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() { not_sized::>() } + | ^^^^^^ 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 + = help: consider adding a `where T: std::marker::Sized` bound +note: required by `Foo` + --> $DIR/unsized-enum.rs:15:1 + | +LL | enum Foo { FooSome(U), FooNone } + | ^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/unsized-enum2.rs b/src/test/ui/unsized/unsized-enum2.rs similarity index 100% rename from src/test/ui/unsized-enum2.rs rename to src/test/ui/unsized/unsized-enum2.rs diff --git a/src/test/ui/unsized-enum2.stderr b/src/test/ui/unsized/unsized-enum2.stderr similarity index 100% rename from src/test/ui/unsized-enum2.stderr rename to src/test/ui/unsized/unsized-enum2.stderr diff --git a/src/test/compile-fail/unsized-inherent-impl-self-type.rs b/src/test/ui/unsized/unsized-inherent-impl-self-type.rs similarity index 100% rename from src/test/compile-fail/unsized-inherent-impl-self-type.rs rename to src/test/ui/unsized/unsized-inherent-impl-self-type.rs diff --git a/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr b/src/test/ui/unsized/unsized-inherent-impl-self-type.stderr new file mode 100644 index 0000000000000..8b6d9c610d171 --- /dev/null +++ b/src/test/ui/unsized/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 S5 { + | ^^^^^ 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 + = 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); + | ^^^^^^^^^^^^^^^^ + +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/unsized/unsized-struct.rs similarity index 100% rename from src/test/compile-fail/unsized-struct.rs rename to src/test/ui/unsized/unsized-struct.rs diff --git a/src/test/ui/unsized/unsized-struct.stderr b/src/test/ui/unsized/unsized-struct.stderr new file mode 100644 index 0000000000000..0e2d000d5f058 --- /dev/null +++ b/src/test/ui/unsized/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() { not_sized::>() } + | ^^^^^^ 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 + = help: consider adding a `where T: std::marker::Sized` bound +note: required by `Foo` + --> $DIR/unsized-struct.rs:15:1 + | +LL | struct Foo { 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() { is_sized::>() } + | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: within `Bar`, the trait `std::marker::Sized` is not implemented for `T` + = note: to learn more, visit + = help: consider adding a `where T: std::marker::Sized` bound + = note: required because it appears within the type `Bar` +note: required by `is_sized` + --> $DIR/unsized-struct.rs:12:1 + | +LL | fn is_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/unsized/unsized-trait-impl-self-type.rs similarity index 100% rename from src/test/compile-fail/unsized-trait-impl-self-type.rs rename to src/test/ui/unsized/unsized-trait-impl-self-type.rs diff --git a/src/test/ui/unsized/unsized-trait-impl-self-type.stderr b/src/test/ui/unsized/unsized-trait-impl-self-type.stderr new file mode 100644 index 0000000000000..b51787ef10502 --- /dev/null +++ b/src/test/ui/unsized/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 T3 for S5 { + | ^^^^^ 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 + = 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); + | ^^^^^^^^^^^^^^^^ + +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/unsized/unsized-trait-impl-trait-arg.rs similarity index 100% rename from src/test/compile-fail/unsized-trait-impl-trait-arg.rs rename to src/test/ui/unsized/unsized-trait-impl-trait-arg.rs diff --git a/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr b/src/test/ui/unsized/unsized-trait-impl-trait-arg.stderr new file mode 100644 index 0000000000000..187fac9626d31 --- /dev/null +++ b/src/test/ui/unsized/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 T2 for S4 { + | ^^^^^ 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 + = 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/unsized3.rs similarity index 100% rename from src/test/compile-fail/unsized3.rs rename to src/test/ui/unsized3.rs diff --git a/src/test/ui/unsized3.stderr b/src/test/ui/unsized3.stderr new file mode 100644 index 0000000000000..1d7b146b13159 --- /dev/null +++ b/src/test/ui/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); + | ^^^^^^^ 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 + = help: consider adding a `where X: std::marker::Sized` bound +note: required by `f2` + --> $DIR/unsized3.rs:20:1 + | +LL | fn f2(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); + | ^^^^^^^ 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 + = help: consider adding a `where X: std::marker::Sized` bound +note: required by `f4` + --> $DIR/unsized3.rs:31:1 + | +LL | fn f4(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`, the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit + = help: consider adding a `where X: std::marker::Sized` bound + = note: required because it appears within the type `S` +note: required by `f5` + --> $DIR/unsized3.rs:34:1 + | +LL | fn f5(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`, the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit + = help: consider adding a `where X: std::marker::Sized` bound + = note: required because it appears within the type `S` + = 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)`, the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit + = help: consider adding a `where X: std::marker::Sized` bound + = note: required because it appears within the type `S` + = note: required because it appears within the type `({integer}, S)` + = 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)`, the trait `std::marker::Sized` is not implemented for `X` + = note: to learn more, visit + = help: consider adding a `where X: std::marker::Sized` bound + = note: required because it appears within the type `S` + = note: required because it appears within the type `({integer}, S)` +note: required by `f5` + --> $DIR/unsized3.rs:34:1 + | +LL | fn f5(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/unsized5.rs similarity index 100% rename from src/test/compile-fail/unsized5.rs rename to src/test/ui/unsized5.rs diff --git a/src/test/ui/unsized5.stderr b/src/test/ui/unsized5.stderr new file mode 100644 index 0000000000000..73553f8498124 --- /dev/null +++ b/src/test/ui/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 + = 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 + = 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 + = 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 + = 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 + = 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 + = 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/unsized6.rs similarity index 100% rename from src/test/compile-fail/unsized6.rs rename to src/test/ui/unsized6.rs diff --git a/src/test/ui/unsized6.stderr b/src/test/ui/unsized6.stderr new file mode 100644 index 0000000000000..5dc12a344ad3f --- /dev/null +++ b/src/test/ui/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 + = 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 + = 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 + = 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 + = 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 + = 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 + = 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 + = 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 + = 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 + = 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 + = 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 + = 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: 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 + = 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: 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 + = 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/unsized7.rs similarity index 100% rename from src/test/compile-fail/unsized7.rs rename to src/test/ui/unsized7.rs diff --git a/src/test/ui/unsized7.stderr b/src/test/ui/unsized7.stderr new file mode 100644 index 0000000000000..67217659fbc2f --- /dev/null +++ b/src/test/ui/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 T1 for S3 { + | ^^^^^ 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 + = 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/unspecified-self-in-trait-ref.rs similarity index 100% rename from src/test/compile-fail/unspecified-self-in-trait-ref.rs rename to src/test/ui/unspecified-self-in-trait-ref.rs diff --git a/src/test/ui/unspecified-self-in-trait-ref.stderr b/src/test/ui/unspecified-self-in-trait-ref.stderr new file mode 100644 index 0000000000000..c036540068b0b --- /dev/null +++ b/src/test/ui/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` in the current scope + --> $DIR/unspecified-self-in-trait-ref.rs:26:13 + | +LL | let d = Bar::::lol(); + | ^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `dyn Bar` + +error[E0393]: the type parameter `A` must be explicitly specified + --> $DIR/unspecified-self-in-trait-ref.rs:28:13 + | +LL | let e = Bar::::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/unsupported-cast.rs similarity index 100% rename from src/test/compile-fail/unsupported-cast.rs rename to src/test/ui/unsupported-cast.rs diff --git a/src/test/ui/unsupported-cast.stderr b/src/test/ui/unsupported-cast.stderr new file mode 100644 index 0000000000000..4babc01ad7f74 --- /dev/null +++ b/src/test/ui/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/unused/unused-attr.rs similarity index 100% rename from src/test/compile-fail/unused-attr.rs rename to src/test/ui/unused/unused-attr.rs diff --git a/src/test/ui/unused/unused-attr.stderr b/src/test/ui/unused/unused-attr.stderr new file mode 100644 index 0000000000000..7265dd3c63f9e --- /dev/null +++ b/src/test/ui/unused/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/unused/unused-macro-rules.rs similarity index 100% rename from src/test/compile-fail/unused-macro-rules.rs rename to src/test/ui/unused/unused-macro-rules.rs diff --git a/src/test/ui/unused/unused-macro-rules.stderr b/src/test/ui/unused/unused-macro-rules.stderr new file mode 100644 index 0000000000000..8ced41022f829 --- /dev/null +++ b/src/test/ui/unused/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/unused/unused-macro-with-bad-frag-spec.rs similarity index 100% rename from src/test/compile-fail/unused-macro-with-bad-frag-spec.rs rename to src/test/ui/unused/unused-macro-with-bad-frag-spec.rs diff --git a/src/test/ui/unused/unused-macro-with-bad-frag-spec.stderr b/src/test/ui/unused/unused-macro-with-bad-frag-spec.stderr new file mode 100644 index 0000000000000..8843587890549 --- /dev/null +++ b/src/test/ui/unused/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/unused/unused-macro-with-follow-violation.rs similarity index 100% rename from src/test/compile-fail/unused-macro-with-follow-violation.rs rename to src/test/ui/unused/unused-macro-with-follow-violation.rs diff --git a/src/test/ui/unused/unused-macro-with-follow-violation.stderr b/src/test/ui/unused/unused-macro-with-follow-violation.stderr new file mode 100644 index 0000000000000..8efb191c7c645 --- /dev/null +++ b/src/test/ui/unused/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/unused/unused-macro.rs similarity index 100% rename from src/test/compile-fail/unused-macro.rs rename to src/test/ui/unused/unused-macro.rs diff --git a/src/test/ui/unused/unused-macro.stderr b/src/test/ui/unused/unused-macro.stderr new file mode 100644 index 0000000000000..3e1c1164d5b26 --- /dev/null +++ b/src/test/ui/unused/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/unused/unused-mut-warning-captured-var.rs similarity index 100% rename from src/test/compile-fail/unused-mut-warning-captured-var.rs rename to src/test/ui/unused/unused-mut-warning-captured-var.rs diff --git a/src/test/ui/unused/unused-mut-warning-captured-var.stderr b/src/test/ui/unused/unused-mut-warning-captured-var.stderr new file mode 100644 index 0000000000000..ae976d85bde35 --- /dev/null +++ b/src/test/ui/unused/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/unused/unused-result.rs similarity index 100% rename from src/test/compile-fail/unused-result.rs rename to src/test/ui/unused/unused-result.rs diff --git a/src/test/ui/unused/unused-result.stderr b/src/test/ui/unused/unused-result.stderr new file mode 100644 index 0000000000000..e6ca7b8fab8fd --- /dev/null +++ b/src/test/ui/unused/unused-result.stderr @@ -0,0 +1,48 @@ +error: unused `MustUse` which must be used + --> $DIR/unused-result.rs:31:5 + | +LL | foo::(); //~ 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::(); //~ ERROR: unused `MustUseMsg` which must be used + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: some message + +error: unused result + --> $DIR/unused-result.rs:44:5 + | +LL | foo::(); //~ 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::(); //~ ERROR: unused `MustUse` which must be used + | ^^^^^^^^^^^^^^^^^ + +error: unused `MustUseMsg` which must be used + --> $DIR/unused-result.rs:46:5 + | +LL | foo::(); //~ ERROR: unused `MustUseMsg` which must be used + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: some message + +error: aborting due to 5 previous errors + diff --git a/src/test/compile-fail/auxiliary/use_from_trait_xc.rs b/src/test/ui/use/auxiliary/use_from_trait_xc.rs similarity index 100% rename from src/test/compile-fail/auxiliary/use_from_trait_xc.rs rename to src/test/ui/use/auxiliary/use_from_trait_xc.rs diff --git a/src/test/ui/use/use-after-move-based-on-type.nll.stderr b/src/test/ui/use/use-after-move-based-on-type.nll.stderr new file mode 100644 index 0000000000000..a18c25cbb55d8 --- /dev/null +++ b/src/test/ui/use/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/use/use-after-move-based-on-type.rs similarity index 100% rename from src/test/compile-fail/use-after-move-based-on-type.rs rename to src/test/ui/use/use-after-move-based-on-type.rs diff --git a/src/test/ui/use/use-after-move-based-on-type.stderr b/src/test/ui/use/use-after-move-based-on-type.stderr new file mode 100644 index 0000000000000..510cc708bed85 --- /dev/null +++ b/src/test/ui/use/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/use/use-after-move-implicity-coerced-object.nll.stderr b/src/test/ui/use/use-after-move-implicity-coerced-object.nll.stderr new file mode 100644 index 0000000000000..23753506368f0 --- /dev/null +++ b/src/test/ui/use/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`, 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/use/use-after-move-implicity-coerced-object.rs similarity index 100% rename from src/test/compile-fail/use-after-move-implicity-coerced-object.rs rename to src/test/ui/use/use-after-move-implicity-coerced-object.rs diff --git a/src/test/ui/use/use-after-move-implicity-coerced-object.stderr b/src/test/ui/use/use-after-move-implicity-coerced-object.stderr new file mode 100644 index 0000000000000..ab7494702d73c --- /dev/null +++ b/src/test/ui/use/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`, 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/use/use-after-move-self-based-on-type.rs similarity index 100% rename from src/test/compile-fail/use-after-move-self-based-on-type.rs rename to src/test/ui/use/use-after-move-self-based-on-type.rs diff --git a/src/test/ui/use/use-after-move-self-based-on-type.stderr b/src/test/ui/use/use-after-move-self-based-on-type.stderr new file mode 100644 index 0000000000000..60cd142799ebc --- /dev/null +++ b/src/test/ui/use/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/use/use-after-move-self.nll.stderr b/src/test/ui/use/use-after-move-self.nll.stderr new file mode 100644 index 0000000000000..3b19e96d12cce --- /dev/null +++ b/src/test/ui/use/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/use/use-after-move-self.rs similarity index 100% rename from src/test/compile-fail/use-after-move-self.rs rename to src/test/ui/use/use-after-move-self.rs diff --git a/src/test/ui/use/use-after-move-self.stderr b/src/test/ui/use/use-after-move-self.stderr new file mode 100644 index 0000000000000..7273602aadc4b --- /dev/null +++ b/src/test/ui/use/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/use/use-from-trait-xc.rs similarity index 100% rename from src/test/compile-fail/use-from-trait-xc.rs rename to src/test/ui/use/use-from-trait-xc.rs diff --git a/src/test/ui/use/use-from-trait-xc.stderr b/src/test/ui/use/use-from-trait-xc.stderr new file mode 100644 index 0000000000000..130aca8162a43 --- /dev/null +++ b/src/test/ui/use/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/use/use-from-trait.rs similarity index 100% rename from src/test/compile-fail/use-from-trait.rs rename to src/test/ui/use/use-from-trait.rs diff --git a/src/test/ui/use/use-from-trait.stderr b/src/test/ui/use/use-from-trait.stderr new file mode 100644 index 0000000000000..b43a32988cafd --- /dev/null +++ b/src/test/ui/use/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/use/use-keyword.rs similarity index 100% rename from src/test/compile-fail/use-keyword.rs rename to src/test/ui/use/use-keyword.rs diff --git a/src/test/ui/use/use-keyword.stderr b/src/test/ui/use/use-keyword.stderr new file mode 100644 index 0000000000000..11893bce5c41f --- /dev/null +++ b/src/test/ui/use/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/use/use-meta-mismatch.rs similarity index 100% rename from src/test/compile-fail/use-meta-mismatch.rs rename to src/test/ui/use/use-meta-mismatch.rs diff --git a/src/test/ui/use/use-meta-mismatch.stderr b/src/test/ui/use/use-meta-mismatch.stderr new file mode 100644 index 0000000000000..063de29510ed6 --- /dev/null +++ b/src/test/ui/use/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/ui/use-mod.rs b/src/test/ui/use/use-mod.rs similarity index 100% rename from src/test/ui/use-mod.rs rename to src/test/ui/use/use-mod.rs diff --git a/src/test/ui/use-mod.stderr b/src/test/ui/use/use-mod.stderr similarity index 100% rename from src/test/ui/use-mod.stderr rename to src/test/ui/use/use-mod.stderr diff --git a/src/test/compile-fail/use-mod-2.rs b/src/test/ui/use/use-mod/use-mod-2.rs similarity index 100% rename from src/test/compile-fail/use-mod-2.rs rename to src/test/ui/use/use-mod/use-mod-2.rs diff --git a/src/test/ui/use/use-mod/use-mod-2.stderr b/src/test/ui/use/use-mod/use-mod-2.stderr new file mode 100644 index 0000000000000..f343dc2b31d42 --- /dev/null +++ b/src/test/ui/use/use-mod/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/use/use-mod/use-mod-3.rs similarity index 100% rename from src/test/compile-fail/use-mod-3.rs rename to src/test/ui/use/use-mod/use-mod-3.rs diff --git a/src/test/ui/use/use-mod/use-mod-3.stderr b/src/test/ui/use/use-mod/use-mod-3.stderr new file mode 100644 index 0000000000000..619239846419a --- /dev/null +++ b/src/test/ui/use/use-mod/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/use/use-mod/use-mod-4.rs similarity index 100% rename from src/test/compile-fail/use-mod-4.rs rename to src/test/ui/use/use-mod/use-mod-4.rs diff --git a/src/test/ui/use/use-mod/use-mod-4.stderr b/src/test/ui/use/use-mod/use-mod-4.stderr new file mode 100644 index 0000000000000..9a6d608faacca --- /dev/null +++ b/src/test/ui/use/use-mod/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/ui/use-nested-groups-error.rs b/src/test/ui/use/use-nested-groups-error.rs similarity index 100% rename from src/test/ui/use-nested-groups-error.rs rename to src/test/ui/use/use-nested-groups-error.rs diff --git a/src/test/ui/use-nested-groups-error.stderr b/src/test/ui/use/use-nested-groups-error.stderr similarity index 100% rename from src/test/ui/use-nested-groups-error.stderr rename to src/test/ui/use/use-nested-groups-error.stderr diff --git a/src/test/ui/use-nested-groups-unused-imports.rs b/src/test/ui/use/use-nested-groups-unused-imports.rs similarity index 100% rename from src/test/ui/use-nested-groups-unused-imports.rs rename to src/test/ui/use/use-nested-groups-unused-imports.rs diff --git a/src/test/ui/use-nested-groups-unused-imports.stderr b/src/test/ui/use/use-nested-groups-unused-imports.stderr similarity index 100% rename from src/test/ui/use-nested-groups-unused-imports.stderr rename to src/test/ui/use/use-nested-groups-unused-imports.stderr diff --git a/src/test/compile-fail/use-paths-as-items.rs b/src/test/ui/use/use-paths-as-items.rs similarity index 100% rename from src/test/compile-fail/use-paths-as-items.rs rename to src/test/ui/use/use-paths-as-items.rs diff --git a/src/test/ui/use/use-paths-as-items.stderr b/src/test/ui/use/use-paths-as-items.stderr new file mode 100644 index 0000000000000..200cefc23aff0 --- /dev/null +++ b/src/test/ui/use/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/use/use-self-type.rs similarity index 100% rename from src/test/compile-fail/use-self-type.rs rename to src/test/ui/use/use-self-type.rs diff --git a/src/test/ui/use/use-self-type.stderr b/src/test/ui/use/use-self-type.stderr new file mode 100644 index 0000000000000..5a1e5ea259552 --- /dev/null +++ b/src/test/ui/use/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 `Self` + --> $DIR/use-self-type.rs:16:13 + | +LL | use Self::f; //~ ERROR unresolved import + | ^^^^ Use of undeclared type or module `Self` + +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/use/use-super-global-path.rs similarity index 100% rename from src/test/compile-fail/use-super-global-path.rs rename to src/test/ui/use/use-super-global-path.rs diff --git a/src/test/ui/use/use-super-global-path.stderr b/src/test/ui/use/use-super-global-path.stderr new file mode 100644 index 0000000000000..4730653dbf906 --- /dev/null +++ b/src/test/ui/use/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/used.rs similarity index 100% rename from src/test/compile-fail/used.rs rename to src/test/ui/used.rs diff --git a/src/test/ui/used.stderr b/src/test/ui/used.stderr new file mode 100644 index 0000000000000..b8d0f42c3a3d3 --- /dev/null +++ b/src/test/ui/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/useless-pub.rs similarity index 100% rename from src/test/compile-fail/useless-pub.rs rename to src/test/ui/useless-pub.rs diff --git a/src/test/ui/useless-pub.stderr b/src/test/ui/useless-pub.stderr new file mode 100644 index 0000000000000..7e36bf2667ecd --- /dev/null +++ b/src/test/ui/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/useless_comment.rs similarity index 100% rename from src/test/compile-fail/useless_comment.rs rename to src/test/ui/useless_comment.rs diff --git a/src/test/ui/useless_comment.stderr b/src/test/ui/useless_comment.stderr new file mode 100644 index 0000000000000..78c6787c88e62 --- /dev/null +++ b/src/test/ui/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/user-defined-macro-rules.rs similarity index 100% rename from src/test/compile-fail/user-defined-macro-rules.rs rename to src/test/ui/user-defined-macro-rules.rs diff --git a/src/test/ui/user-defined-macro-rules.stderr b/src/test/ui/user-defined-macro-rules.stderr new file mode 100644 index 0000000000000..3359aa4bcd720 --- /dev/null +++ b/src/test/ui/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/utf8_idents.rs similarity index 100% rename from src/test/compile-fail/utf8_idents.rs rename to src/test/ui/utf8_idents.rs diff --git a/src/test/ui/utf8_idents.stderr b/src/test/ui/utf8_idents.stderr new file mode 100644 index 0000000000000..42ee13e05117b --- /dev/null +++ b/src/test/ui/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/variadic/variadic-ffi-2.rs similarity index 100% rename from src/test/compile-fail/variadic-ffi-2.rs rename to src/test/ui/variadic/variadic-ffi-2.rs diff --git a/src/test/ui/variadic/variadic-ffi-2.stderr b/src/test/ui/variadic/variadic-ffi-2.stderr new file mode 100644 index 0000000000000..9af7b5bf753dd --- /dev/null +++ b/src/test/ui/variadic/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/ui/variadic-ffi-3.rs b/src/test/ui/variadic/variadic-ffi-3.rs similarity index 100% rename from src/test/ui/variadic-ffi-3.rs rename to src/test/ui/variadic/variadic-ffi-3.rs diff --git a/src/test/ui/variadic-ffi-3.stderr b/src/test/ui/variadic/variadic-ffi-3.stderr similarity index 100% rename from src/test/ui/variadic-ffi-3.stderr rename to src/test/ui/variadic/variadic-ffi-3.stderr diff --git a/src/test/compile-fail/variadic-ffi.rs b/src/test/ui/variadic/variadic-ffi.rs similarity index 100% rename from src/test/compile-fail/variadic-ffi.rs rename to src/test/ui/variadic/variadic-ffi.rs diff --git a/src/test/ui/variadic/variadic-ffi.stderr b/src/test/ui/variadic/variadic-ffi.stderr new file mode 100644 index 0000000000000..0d0462b709d08 --- /dev/null +++ b/src/test/ui/variadic/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/variance/variance-associated-types.rs similarity index 100% rename from src/test/compile-fail/variance-associated-types.rs rename to src/test/ui/variance/variance-associated-types.rs diff --git a/src/test/ui/variance/variance-associated-types.stderr b/src/test/ui/variance/variance-associated-types.stderr new file mode 100644 index 0000000000000..03ea1e625f8ca --- /dev/null +++ b/src/test/ui/variance/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: >::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/variance/variance-btree-invariant-types.nll.stderr b/src/test/ui/variance/variance-btree-invariant-types.nll.stderr new file mode 100644 index 0000000000000..33230c26b8b0c --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-btree-invariant-types.rs similarity index 100% rename from src/test/compile-fail/variance-btree-invariant-types.rs rename to src/test/ui/variance/variance-btree-invariant-types.rs diff --git a/src/test/ui/variance/variance-btree-invariant-types.stderr b/src/test/ui/variance/variance-btree-invariant-types.stderr new file mode 100644 index 0000000000000..96f76fa5c2d0f --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-cell-is-invariant.rs similarity index 96% rename from src/test/compile-fail/variance-cell-is-invariant.rs rename to src/test/ui/variance/variance-cell-is-invariant.rs index 1ddbcf4ab84c7..39d87a563e516 100644 --- a/src/test/compile-fail/variance-cell-is-invariant.rs +++ b/src/test/ui/variance/variance-cell-is-invariant.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + // Test that Cell is considered invariant with respect to its // type. diff --git a/src/test/ui/variance/variance-cell-is-invariant.stderr b/src/test/ui/variance/variance-cell-is-invariant.stderr new file mode 100644 index 0000000000000..8fb5d9bf38b3c --- /dev/null +++ b/src/test/ui/variance/variance-cell-is-invariant.stderr @@ -0,0 +1,15 @@ +error[E0623]: lifetime mismatch + --> $DIR/variance-cell-is-invariant.rs:26: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/variance/variance-contravariant-arg-object.nll.stderr b/src/test/ui/variance/variance-contravariant-arg-object.nll.stderr new file mode 100644 index 0000000000000..67d43dd507005 --- /dev/null +++ b/src/test/ui/variance/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>) + | ---- ---- 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>) + | ---- ---- 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/variance/variance-contravariant-arg-object.rs similarity index 100% rename from src/test/compile-fail/variance-contravariant-arg-object.rs rename to src/test/ui/variance/variance-contravariant-arg-object.rs diff --git a/src/test/ui/variance/variance-contravariant-arg-object.stderr b/src/test/ui/variance/variance-contravariant-arg-object.stderr new file mode 100644 index 0000000000000..aeed03733f38a --- /dev/null +++ b/src/test/ui/variance/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>) + | ^^^^ +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>) + | ^^^^ + +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>) + | ^^^^ +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>) + | ^^^^ + +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/variance/variance-contravariant-arg-trait-match.rs similarity index 97% rename from src/test/compile-fail/variance-contravariant-arg-trait-match.rs rename to src/test/ui/variance/variance-contravariant-arg-trait-match.rs index 9b6e3c9de3bbd..96791304d93d3 100644 --- a/src/test/compile-fail/variance-contravariant-arg-trait-match.rs +++ b/src/test/ui/variance/variance-contravariant-arg-trait-match.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![allow(dead_code)] // Test that even when `T` is only used in contravariant position, it diff --git a/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr b/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr new file mode 100644 index 0000000000000..282220d1037f5 --- /dev/null +++ b/src/test/ui/variance/variance-contravariant-arg-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-contravariant-arg-trait-match.rs:25:5 + | +LL | impls_get::() //~ 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 22:21... + --> $DIR/variance-contravariant-arg-trait-match.rs:22: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 22:27 + --> $DIR/variance-contravariant-arg-trait-match.rs:22:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-contravariant-arg-trait-match.rs:33:5 + | +LL | impls_get::() //~ 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 28:21... + --> $DIR/variance-contravariant-arg-trait-match.rs:28: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 28:27 + --> $DIR/variance-contravariant-arg-trait-match.rs:28: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/variance/variance-contravariant-self-trait-match.rs similarity index 97% rename from src/test/compile-fail/variance-contravariant-self-trait-match.rs rename to src/test/ui/variance/variance-contravariant-self-trait-match.rs index 6d9d1e61fed61..c04ba8862c317 100644 --- a/src/test/compile-fail/variance-contravariant-self-trait-match.rs +++ b/src/test/ui/variance/variance-contravariant-self-trait-match.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![allow(dead_code)] // Test that even when `Self` is only used in contravariant position, it diff --git a/src/test/ui/variance/variance-contravariant-self-trait-match.stderr b/src/test/ui/variance/variance-contravariant-self-trait-match.stderr new file mode 100644 index 0000000000000..9e60a70bc16b2 --- /dev/null +++ b/src/test/ui/variance/variance-contravariant-self-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-contravariant-self-trait-match.rs:25: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 22:21... + --> $DIR/variance-contravariant-self-trait-match.rs:22: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 22:27 + --> $DIR/variance-contravariant-self-trait-match.rs:22:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-contravariant-self-trait-match.rs:34: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 28:21... + --> $DIR/variance-contravariant-self-trait-match.rs:28: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 28:27 + --> $DIR/variance-contravariant-self-trait-match.rs:28: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/variance/variance-covariant-arg-object.nll.stderr b/src/test/ui/variance/variance-covariant-arg-object.nll.stderr new file mode 100644 index 0000000000000..55413e57a9493 --- /dev/null +++ b/src/test/ui/variance/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>) + | ---- ---- 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>) + | ---- ---- 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/variance/variance-covariant-arg-object.rs similarity index 100% rename from src/test/compile-fail/variance-covariant-arg-object.rs rename to src/test/ui/variance/variance-covariant-arg-object.rs diff --git a/src/test/ui/variance/variance-covariant-arg-object.stderr b/src/test/ui/variance/variance-covariant-arg-object.stderr new file mode 100644 index 0000000000000..074ef6584190a --- /dev/null +++ b/src/test/ui/variance/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>) + | ^^^^ +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>) + | ^^^^ + +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>) + | ^^^^ +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>) + | ^^^^ + +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/variance/variance-covariant-arg-trait-match.rs similarity index 97% rename from src/test/compile-fail/variance-covariant-arg-trait-match.rs rename to src/test/ui/variance/variance-covariant-arg-trait-match.rs index c42a845b3b504..fbda62f34fa16 100644 --- a/src/test/compile-fail/variance-covariant-arg-trait-match.rs +++ b/src/test/ui/variance/variance-covariant-arg-trait-match.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![allow(dead_code)] // Test that even when `T` is only used in covariant position, it diff --git a/src/test/ui/variance/variance-covariant-arg-trait-match.stderr b/src/test/ui/variance/variance-covariant-arg-trait-match.stderr new file mode 100644 index 0000000000000..648acc2119f1b --- /dev/null +++ b/src/test/ui/variance/variance-covariant-arg-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-covariant-arg-trait-match.rs:26:5 + | +LL | impls_get::() //~ 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 22:21... + --> $DIR/variance-covariant-arg-trait-match.rs:22: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 22:27 + --> $DIR/variance-covariant-arg-trait-match.rs:22:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-covariant-arg-trait-match.rs:32:5 + | +LL | impls_get::() //~ 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 29:21... + --> $DIR/variance-covariant-arg-trait-match.rs:29: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 29:27 + --> $DIR/variance-covariant-arg-trait-match.rs:29: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/variance/variance-covariant-self-trait-match.rs similarity index 97% rename from src/test/compile-fail/variance-covariant-self-trait-match.rs rename to src/test/ui/variance/variance-covariant-self-trait-match.rs index 25148dfc0208a..3e0c1da3bca7c 100644 --- a/src/test/compile-fail/variance-covariant-self-trait-match.rs +++ b/src/test/ui/variance/variance-covariant-self-trait-match.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![allow(dead_code)] // Test that even when `Self` is only used in covariant position, it diff --git a/src/test/ui/variance/variance-covariant-self-trait-match.stderr b/src/test/ui/variance/variance-covariant-self-trait-match.stderr new file mode 100644 index 0000000000000..cb8fe0b7890e4 --- /dev/null +++ b/src/test/ui/variance/variance-covariant-self-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-covariant-self-trait-match.rs:26: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 22:21... + --> $DIR/variance-covariant-self-trait-match.rs:22: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 22:27 + --> $DIR/variance-covariant-self-trait-match.rs:22:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-covariant-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 29:21... + --> $DIR/variance-covariant-self-trait-match.rs:29: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 29:27 + --> $DIR/variance-covariant-self-trait-match.rs:29: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/variance/variance-invariant-arg-object.nll.stderr b/src/test/ui/variance/variance-invariant-arg-object.nll.stderr new file mode 100644 index 0000000000000..f90975192460b --- /dev/null +++ b/src/test/ui/variance/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>) + | ---- ---- 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>) + | ---- ---- 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/variance/variance-invariant-arg-object.rs similarity index 100% rename from src/test/compile-fail/variance-invariant-arg-object.rs rename to src/test/ui/variance/variance-invariant-arg-object.rs diff --git a/src/test/ui/variance/variance-invariant-arg-object.stderr b/src/test/ui/variance/variance-invariant-arg-object.stderr new file mode 100644 index 0000000000000..3283ae67e5143 --- /dev/null +++ b/src/test/ui/variance/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>) + | ^^^^ +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>) + | ^^^^ + +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>) + | ^^^^ +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>) + | ^^^^ + +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/variance/variance-invariant-arg-trait-match.rs similarity index 96% rename from src/test/compile-fail/variance-invariant-arg-trait-match.rs rename to src/test/ui/variance/variance-invariant-arg-trait-match.rs index 45fed0b083dc1..771fcdeb62f6d 100644 --- a/src/test/compile-fail/variance-invariant-arg-trait-match.rs +++ b/src/test/ui/variance/variance-invariant-arg-trait-match.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![allow(dead_code)] trait Get { diff --git a/src/test/ui/variance/variance-invariant-arg-trait-match.stderr b/src/test/ui/variance/variance-invariant-arg-trait-match.stderr new file mode 100644 index 0000000000000..3f63549506962 --- /dev/null +++ b/src/test/ui/variance/variance-invariant-arg-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-invariant-arg-trait-match.rs:22:5 + | +LL | impls_get::() //~ 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 19:21... + --> $DIR/variance-invariant-arg-trait-match.rs:19: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 19:27 + --> $DIR/variance-invariant-arg-trait-match.rs:19:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-invariant-arg-trait-match.rs:28:5 + | +LL | impls_get::() //~ 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 25:21... + --> $DIR/variance-invariant-arg-trait-match.rs:25: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 25:27 + --> $DIR/variance-invariant-arg-trait-match.rs:25: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/variance/variance-invariant-self-trait-match.rs similarity index 96% rename from src/test/compile-fail/variance-invariant-self-trait-match.rs rename to src/test/ui/variance/variance-invariant-self-trait-match.rs index fe61dee23bc2a..57abf6f897931 100644 --- a/src/test/compile-fail/variance-invariant-self-trait-match.rs +++ b/src/test/ui/variance/variance-invariant-self-trait-match.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-compare-mode-nll + #![allow(dead_code)] trait Get { diff --git a/src/test/ui/variance/variance-invariant-self-trait-match.stderr b/src/test/ui/variance/variance-invariant-self-trait-match.stderr new file mode 100644 index 0000000000000..1b864abc4f02f --- /dev/null +++ b/src/test/ui/variance/variance-invariant-self-trait-match.stderr @@ -0,0 +1,41 @@ +error[E0308]: mismatched types + --> $DIR/variance-invariant-self-trait-match.rs:22: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 19:21... + --> $DIR/variance-invariant-self-trait-match.rs:19: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 19:27 + --> $DIR/variance-invariant-self-trait-match.rs:19:27 + | +LL | fn get_min_from_max<'min, 'max, G>() + | ^^^^ + +error[E0308]: mismatched types + --> $DIR/variance-invariant-self-trait-match.rs:28: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 25:21... + --> $DIR/variance-invariant-self-trait-match.rs:25: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 25:27 + --> $DIR/variance-invariant-self-trait-match.rs:25: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/variance/variance-issue-20533.nll.stderr b/src/test/ui/variance/variance-issue-20533.nll.stderr new file mode 100644 index 0000000000000..f9e2ae89a9daf --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-issue-20533.rs similarity index 100% rename from src/test/compile-fail/variance-issue-20533.rs rename to src/test/ui/variance/variance-issue-20533.rs diff --git a/src/test/ui/variance/variance-issue-20533.stderr b/src/test/ui/variance/variance-issue-20533.stderr new file mode 100644 index 0000000000000..680dea2447f74 --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-object-types.rs similarity index 100% rename from src/test/compile-fail/variance-object-types.rs rename to src/test/ui/variance/variance-object-types.rs diff --git a/src/test/ui/variance/variance-object-types.stderr b/src/test/ui/variance/variance-object-types.stderr new file mode 100644 index 0000000000000..9a1c9965de3cf --- /dev/null +++ b/src/test/ui/variance/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 &'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/variance/variance-regions-direct.rs similarity index 100% rename from src/test/compile-fail/variance-regions-direct.rs rename to src/test/ui/variance/variance-regions-direct.rs diff --git a/src/test/ui/variance/variance-regions-direct.stderr b/src/test/ui/variance/variance-regions-direct.stderr new file mode 100644 index 0000000000000..81cb929c63b02 --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-regions-indirect.rs similarity index 100% rename from src/test/compile-fail/variance-regions-indirect.rs rename to src/test/ui/variance/variance-regions-indirect.rs diff --git a/src/test/ui/variance/variance-regions-indirect.stderr b/src/test/ui/variance/variance-regions-indirect.stderr new file mode 100644 index 0000000000000..edf39537ff6e0 --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-regions-unused-direct.rs similarity index 100% rename from src/test/compile-fail/variance-regions-unused-direct.rs rename to src/test/ui/variance/variance-regions-unused-direct.rs diff --git a/src/test/ui/variance/variance-regions-unused-direct.stderr b/src/test/ui/variance/variance-regions-unused-direct.stderr new file mode 100644 index 0000000000000..e3d02c649dc7f --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-regions-unused-indirect.rs similarity index 100% rename from src/test/compile-fail/variance-regions-unused-indirect.rs rename to src/test/ui/variance/variance-regions-unused-indirect.rs diff --git a/src/test/ui/variance/variance-regions-unused-indirect.stderr b/src/test/ui/variance/variance-regions-unused-indirect.stderr new file mode 100644 index 0000000000000..f3eee86d5ab8d --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-trait-bounds.rs similarity index 100% rename from src/test/compile-fail/variance-trait-bounds.rs rename to src/test/ui/variance/variance-trait-bounds.rs diff --git a/src/test/ui/variance/variance-trait-bounds.stderr b/src/test/ui/variance/variance-trait-bounds.stderr new file mode 100644 index 0000000000000..1c82ed772e23b --- /dev/null +++ b/src/test/ui/variance/variance-trait-bounds.stderr @@ -0,0 +1,35 @@ +error[E0208]: [+, +] + --> $DIR/variance-trait-bounds.rs:26:1 + | +LL | / struct TestStruct> { //~ ERROR [+, +] +LL | | t: T, u: U +LL | | } + | |_^ + +error[E0208]: [*, +] + --> $DIR/variance-trait-bounds.rs:31:1 + | +LL | / enum TestEnum> { //~ ERROR [*, +] +LL | | Foo(T) +LL | | } + | |_^ + +error[E0208]: [*, +] + --> $DIR/variance-trait-bounds.rs:36:1 + | +LL | / struct TestContraStruct> { //~ ERROR [*, +] +LL | | t: T +LL | | } + | |_^ + +error[E0208]: [*, +] + --> $DIR/variance-trait-bounds.rs:41:1 + | +LL | / struct TestBox+Setter> { //~ 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/variance/variance-trait-matching.nll.stderr b/src/test/ui/variance/variance-trait-matching.nll.stderr new file mode 100644 index 0000000000000..baf75b73463a5 --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-trait-matching.rs similarity index 100% rename from src/test/compile-fail/variance-trait-matching.rs rename to src/test/ui/variance/variance-trait-matching.rs diff --git a/src/test/ui/variance/variance-trait-matching.stderr b/src/test/ui/variance/variance-trait-matching.stderr new file mode 100644 index 0000000000000..645d0ffd3118b --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-trait-object-bound.rs similarity index 100% rename from src/test/compile-fail/variance-trait-object-bound.rs rename to src/test/ui/variance/variance-trait-object-bound.rs diff --git a/src/test/ui/variance/variance-trait-object-bound.stderr b/src/test/ui/variance/variance-trait-object-bound.stderr new file mode 100644 index 0000000000000..b44fa940ed3e6 --- /dev/null +++ b/src/test/ui/variance/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>, +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/variance/variance-types-bounds.rs similarity index 100% rename from src/test/compile-fail/variance-types-bounds.rs rename to src/test/ui/variance/variance-types-bounds.rs diff --git a/src/test/ui/variance/variance-types-bounds.stderr b/src/test/ui/variance/variance-types-bounds.stderr new file mode 100644 index 0000000000000..e4b0887912b0f --- /dev/null +++ b/src/test/ui/variance/variance-types-bounds.stderr @@ -0,0 +1,47 @@ +error[E0208]: [+, +] + --> $DIR/variance-types-bounds.rs:17:1 + | +LL | / struct TestImm { //~ ERROR [+, +] +LL | | x: A, +LL | | y: B, +LL | | } + | |_^ + +error[E0208]: [+, o] + --> $DIR/variance-types-bounds.rs:23:1 + | +LL | / struct TestMut { //~ ERROR [+, o] +LL | | x: A, +LL | | y: &'static mut B, +LL | | } + | |_^ + +error[E0208]: [+, o] + --> $DIR/variance-types-bounds.rs:29:1 + | +LL | / struct TestIndirect { //~ ERROR [+, o] +LL | | m: TestMut +LL | | } + | |_^ + +error[E0208]: [o, o] + --> $DIR/variance-types-bounds.rs:34:1 + | +LL | / struct TestIndirect2 { //~ ERROR [o, o] +LL | | n: TestMut, +LL | | m: TestMut +LL | | } + | |_^ + +error[E0208]: [o, o] + --> $DIR/variance-types-bounds.rs:48:1 + | +LL | / struct TestObject { //~ ERROR [o, o] +LL | | n: Box+Send>, +LL | | m: Box+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/variance/variance-types.rs similarity index 100% rename from src/test/compile-fail/variance-types.rs rename to src/test/ui/variance/variance-types.rs diff --git a/src/test/ui/variance/variance-types.stderr b/src/test/ui/variance/variance-types.stderr new file mode 100644 index 0000000000000..59975fa7a7ed4 --- /dev/null +++ b/src/test/ui/variance/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 { //~ ERROR [o] +LL | | t: Cell +LL | | } + | |_^ + +error[E0208]: [o] + --> $DIR/variance-types.rs:30:1 + | +LL | / struct InvariantIndirect { //~ ERROR [o] +LL | | t: InvariantCell +LL | | } + | |_^ + +error[E0208]: [+] + --> $DIR/variance-types.rs:35:1 + | +LL | / struct Covariant { //~ ERROR [+] +LL | | t: A, u: fn() -> A +LL | | } + | |_^ + +error[E0208]: [-] + --> $DIR/variance-types.rs:40:1 + | +LL | / struct Contravariant { //~ ERROR [-] +LL | | t: fn(A) +LL | | } + | |_^ + +error[E0208]: [+, -, o] + --> $DIR/variance-types.rs:45:1 + | +LL | / enum Enum { //~ ERROR [+, -, o] +LL | | Foo(Covariant), +LL | | Bar(Contravariant), +LL | | Zed(Covariant,Contravariant) +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/variance/variance-unused-region-param.rs similarity index 100% rename from src/test/compile-fail/variance-unused-region-param.rs rename to src/test/ui/variance/variance-unused-region-param.rs diff --git a/src/test/ui/variance/variance-unused-region-param.stderr b/src/test/ui/variance/variance-unused-region-param.stderr new file mode 100644 index 0000000000000..354fcf373a6c2 --- /dev/null +++ b/src/test/ui/variance/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/variance-unused-type-param.rs b/src/test/ui/variance/variance-unused-type-param.rs similarity index 100% rename from src/test/ui/variance-unused-type-param.rs rename to src/test/ui/variance/variance-unused-type-param.rs diff --git a/src/test/ui/variance-unused-type-param.stderr b/src/test/ui/variance/variance-unused-type-param.stderr similarity index 100% rename from src/test/ui/variance-unused-type-param.stderr rename to src/test/ui/variance/variance-unused-type-param.stderr diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-contravariant-struct-1.nll.stderr new file mode 100644 index 0000000000000..5189945982d9f --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-use-contravariant-struct-1.rs similarity index 100% rename from src/test/compile-fail/variance-use-contravariant-struct-1.rs rename to src/test/ui/variance/variance-use-contravariant-struct-1.rs diff --git a/src/test/ui/variance/variance-use-contravariant-struct-1.stderr b/src/test/ui/variance/variance-use-contravariant-struct-1.stderr new file mode 100644 index 0000000000000..48e0d380c66d7 --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-use-contravariant-struct-2.rs similarity index 100% rename from src/test/compile-fail/variance-use-contravariant-struct-2.rs rename to src/test/ui/variance/variance-use-contravariant-struct-2.rs diff --git a/src/test/ui/variance/variance-use-contravariant-struct-2.stderr b/src/test/ui/variance/variance-use-contravariant-struct-2.stderr new file mode 100644 index 0000000000000..e3663eb03450d --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-use-covariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-covariant-struct-1.nll.stderr new file mode 100644 index 0000000000000..8c47513a58706 --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-use-covariant-struct-1.rs similarity index 100% rename from src/test/compile-fail/variance-use-covariant-struct-1.rs rename to src/test/ui/variance/variance-use-covariant-struct-1.rs diff --git a/src/test/ui/variance/variance-use-covariant-struct-1.stderr b/src/test/ui/variance/variance-use-covariant-struct-1.stderr new file mode 100644 index 0000000000000..947abe24b5569 --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-use-covariant-struct-2.rs similarity index 100% rename from src/test/compile-fail/variance-use-covariant-struct-2.rs rename to src/test/ui/variance/variance-use-covariant-struct-2.rs diff --git a/src/test/ui/variance/variance-use-covariant-struct-2.stderr b/src/test/ui/variance/variance-use-covariant-struct-2.stderr new file mode 100644 index 0000000000000..9c3a1cf1cc2c2 --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-use-invariant-struct-1.nll.stderr b/src/test/ui/variance/variance-use-invariant-struct-1.nll.stderr new file mode 100644 index 0000000000000..6553efdbd62cf --- /dev/null +++ b/src/test/ui/variance/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/variance/variance-use-invariant-struct-1.rs similarity index 100% rename from src/test/compile-fail/variance-use-invariant-struct-1.rs rename to src/test/ui/variance/variance-use-invariant-struct-1.rs diff --git a/src/test/ui/variance/variance-use-invariant-struct-1.stderr b/src/test/ui/variance/variance-use-invariant-struct-1.stderr new file mode 100644 index 0000000000000..30da7e38c57ba --- /dev/null +++ b/src/test/ui/variance/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/auxiliary/variant-namespacing.rs b/src/test/ui/variants/auxiliary/variant-namespacing.rs similarity index 100% rename from src/test/compile-fail/auxiliary/variant-namespacing.rs rename to src/test/ui/variants/auxiliary/variant-namespacing.rs diff --git a/src/test/compile-fail/variant-namespacing.rs b/src/test/ui/variants/variant-namespacing.rs similarity index 100% rename from src/test/compile-fail/variant-namespacing.rs rename to src/test/ui/variants/variant-namespacing.rs diff --git a/src/test/ui/variants/variant-namespacing.stderr b/src/test/ui/variants/variant-namespacing.stderr new file mode 100644 index 0000000000000..322ea617f3439 --- /dev/null +++ b/src/test/ui/variants/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/variants/variant-size-differences.rs similarity index 100% rename from src/test/compile-fail/variant-size-differences.rs rename to src/test/ui/variants/variant-size-differences.rs diff --git a/src/test/ui/variants/variant-size-differences.stderr b/src/test/ui/variants/variant-size-differences.stderr new file mode 100644 index 0000000000000..a41a5c17ea3ed --- /dev/null +++ b/src/test/ui/variants/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/variants/variant-used-as-type.rs similarity index 100% rename from src/test/compile-fail/variant-used-as-type.rs rename to src/test/ui/variants/variant-used-as-type.rs diff --git a/src/test/ui/variants/variant-used-as-type.stderr b/src/test/ui/variants/variant-used-as-type.stderr new file mode 100644 index 0000000000000..972fe8a8a616b --- /dev/null +++ b/src/test/ui/variants/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/vec/vec-macro-with-comma-only.rs similarity index 100% rename from src/test/compile-fail/vec-macro-with-comma-only.rs rename to src/test/ui/vec/vec-macro-with-comma-only.rs diff --git a/src/test/ui/vec/vec-macro-with-comma-only.stderr b/src/test/ui/vec/vec-macro-with-comma-only.stderr new file mode 100644 index 0000000000000..f5341ccc31286 --- /dev/null +++ b/src/test/ui/vec/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/vec/vec-mut-iter-borrow.nll.stderr b/src/test/ui/vec/vec-mut-iter-borrow.nll.stderr new file mode 100644 index 0000000000000..fd7843f39bc1e --- /dev/null +++ b/src/test/ui/vec/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/vec/vec-mut-iter-borrow.rs similarity index 100% rename from src/test/compile-fail/vec-mut-iter-borrow.rs rename to src/test/ui/vec/vec-mut-iter-borrow.rs diff --git a/src/test/ui/vec/vec-mut-iter-borrow.stderr b/src/test/ui/vec/vec-mut-iter-borrow.stderr new file mode 100644 index 0000000000000..18fdf2c686705 --- /dev/null +++ b/src/test/ui/vec/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/vec/vec-res-add.rs similarity index 100% rename from src/test/compile-fail/vec-res-add.rs rename to src/test/ui/vec/vec-res-add.rs diff --git a/src/test/ui/vec/vec-res-add.stderr b/src/test/ui/vec/vec-res-add.stderr new file mode 100644 index 0000000000000..62d3f046c967e --- /dev/null +++ b/src/test/ui/vec/vec-res-add.stderr @@ -0,0 +1,11 @@ +error[E0369]: binary operation `+` cannot be applied to type `std::vec::Vec` + --> $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` + +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/vector-cast-weirdness.rs similarity index 100% rename from src/test/compile-fail/vector-cast-weirdness.rs rename to src/test/ui/vector-cast-weirdness.rs diff --git a/src/test/ui/vector-cast-weirdness.stderr b/src/test/ui/vector-cast-weirdness.stderr new file mode 100644 index 0000000000000..a096fee16b9ce --- /dev/null +++ b/src/test/ui/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/vtable-res-trait-param.rs similarity index 100% rename from src/test/compile-fail/vtable-res-trait-param.rs rename to src/test/ui/vtable-res-trait-param.rs diff --git a/src/test/ui/vtable-res-trait-param.stderr b/src/test/ui/vtable-res-trait-param.stderr new file mode 100644 index 0000000000000..0d0e820262318 --- /dev/null +++ b/src/test/ui/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/walk-struct-literal-with.nll.stderr b/src/test/ui/walk-struct-literal-with.nll.stderr new file mode 100644 index 0000000000000..668473882ab6e --- /dev/null +++ b/src/test/ui/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/walk-struct-literal-with.rs similarity index 100% rename from src/test/compile-fail/walk-struct-literal-with.rs rename to src/test/ui/walk-struct-literal-with.rs diff --git a/src/test/ui/walk-struct-literal-with.stderr b/src/test/ui/walk-struct-literal-with.stderr new file mode 100644 index 0000000000000..751e41f5ce9c9 --- /dev/null +++ b/src/test/ui/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/warn-path-statement.rs similarity index 100% rename from src/test/compile-fail/warn-path-statement.rs rename to src/test/ui/warn-path-statement.rs diff --git a/src/test/ui/warn-path-statement.stderr b/src/test/ui/warn-path-statement.stderr new file mode 100644 index 0000000000000..44b194bc62d99 --- /dev/null +++ b/src/test/ui/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/wf-array-elem-sized.rs b/src/test/ui/wf/wf-array-elem-sized.rs similarity index 100% rename from src/test/compile-fail/wf-array-elem-sized.rs rename to src/test/ui/wf/wf-array-elem-sized.rs diff --git a/src/test/ui/wf/wf-array-elem-sized.stderr b/src/test/ui/wf/wf-array-elem-sized.stderr new file mode 100644 index 0000000000000..362b286142469 --- /dev/null +++ b/src/test/ui/wf/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 + = 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/wf/wf-const-type.rs similarity index 100% rename from src/test/compile-fail/wf-const-type.rs rename to src/test/ui/wf/wf-const-type.rs diff --git a/src/test/ui/wf/wf-const-type.stderr b/src/test/ui/wf/wf-const-type.stderr new file mode 100644 index 0000000000000..1c07824ef77a2 --- /dev/null +++ b/src/test/ui/wf/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> = 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` +note: required by `IsCopy` + --> $DIR/wf-const-type.rs:17:1 + | +LL | struct IsCopy { 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/wf/wf-enum-bound.rs similarity index 100% rename from src/test/compile-fail/wf-enum-bound.rs rename to src/test/ui/wf/wf-enum-bound.rs diff --git a/src/test/ui/wf/wf-enum-bound.stderr b/src/test/ui/wf/wf-enum-bound.stderr new file mode 100644 index 0000000000000..3313eb2050878 --- /dev/null +++ b/src/test/ui/wf/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 //~ ERROR E0277 +LL | | where T: ExtraCopy +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 { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-enum-fields-struct-variant.rs similarity index 100% rename from src/test/compile-fail/wf-enum-fields-struct-variant.rs rename to src/test/ui/wf/wf-enum-fields-struct-variant.rs diff --git a/src/test/ui/wf/wf-enum-fields-struct-variant.stderr b/src/test/ui/wf/wf-enum-fields-struct-variant.stderr new file mode 100644 index 0000000000000..86a605f073c1f --- /dev/null +++ b/src/test/ui/wf/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 //~ 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 { + | ^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-enum-fields.rs similarity index 100% rename from src/test/compile-fail/wf-enum-fields.rs rename to src/test/ui/wf/wf-enum-fields.rs diff --git a/src/test/ui/wf/wf-enum-fields.stderr b/src/test/ui/wf/wf-enum-fields.stderr new file mode 100644 index 0000000000000..5aa263f389a79 --- /dev/null +++ b/src/test/ui/wf/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) //~ 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 { + | ^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-fn-where-clause.rs similarity index 100% rename from src/test/compile-fail/wf-fn-where-clause.rs rename to src/test/ui/wf/wf-fn-where-clause.rs diff --git a/src/test/ui/wf/wf-fn-where-clause.stderr b/src/test/ui/wf/wf-fn-where-clause.stderr new file mode 100644 index 0000000000000..5f0f982577ee5 --- /dev/null +++ b/src/test/ui/wf/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() where T: ExtraCopy //~ 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 { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-impl-associated-type-region.rs similarity index 100% rename from src/test/compile-fail/wf-impl-associated-type-region.rs rename to src/test/ui/wf/wf-impl-associated-type-region.rs diff --git a/src/test/ui/wf/wf-impl-associated-type-region.stderr b/src/test/ui/wf/wf-impl-associated-type-region.stderr new file mode 100644 index 0000000000000..f238b3c0d135d --- /dev/null +++ b/src/test/ui/wf/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/wf/wf-impl-associated-type-trait.rs similarity index 100% rename from src/test/compile-fail/wf-impl-associated-type-trait.rs rename to src/test/ui/wf/wf-impl-associated-type-trait.rs diff --git a/src/test/ui/wf/wf-impl-associated-type-trait.stderr b/src/test/ui/wf/wf-impl-associated-type-trait.stderr new file mode 100644 index 0000000000000..595c5b4d8fd73 --- /dev/null +++ b/src/test/ui/wf/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; + | ^^^^^^^^^^^^^^^^^^^^ 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-in-fn-arg.rs similarity index 100% rename from src/test/compile-fail/wf-in-fn-arg.rs rename to src/test/ui/wf/wf-in-fn-arg.rs diff --git a/src/test/ui/wf/wf-in-fn-arg.stderr b/src/test/ui/wf/wf-in-fn-arg.stderr new file mode 100644 index 0000000000000..f82bc1674dfb2 --- /dev/null +++ b/src/test/ui/wf/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(_: &MustBeCopy) //~ 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-in-fn-ret.rs similarity index 100% rename from src/test/compile-fail/wf-in-fn-ret.rs rename to src/test/ui/wf/wf-in-fn-ret.rs diff --git a/src/test/ui/wf/wf-in-fn-ret.stderr b/src/test/ui/wf/wf-in-fn-ret.stderr new file mode 100644 index 0000000000000..357199c4e31ef --- /dev/null +++ b/src/test/ui/wf/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() -> MustBeCopy //~ 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-in-fn-type-arg.rs similarity index 100% rename from src/test/compile-fail/wf-in-fn-type-arg.rs rename to src/test/ui/wf/wf-in-fn-type-arg.rs diff --git a/src/test/ui/wf/wf-in-fn-type-arg.stderr b/src/test/ui/wf/wf-in-fn-type-arg.stderr new file mode 100644 index 0000000000000..7e3d22b262c4b --- /dev/null +++ b/src/test/ui/wf/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) //~ 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-in-fn-type-ret.rs similarity index 100% rename from src/test/compile-fail/wf-in-fn-type-ret.rs rename to src/test/ui/wf/wf-in-fn-type-ret.rs diff --git a/src/test/ui/wf/wf-in-fn-type-ret.stderr b/src/test/ui/wf/wf-in-fn-type-ret.stderr new file mode 100644 index 0000000000000..5d592532d2830 --- /dev/null +++ b/src/test/ui/wf/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 //~ 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-in-fn-type-static.rs similarity index 100% rename from src/test/compile-fail/wf-in-fn-type-static.rs rename to src/test/ui/wf/wf-in-fn-type-static.rs diff --git a/src/test/ui/wf/wf-in-fn-type-static.stderr b/src/test/ui/wf/wf-in-fn-type-static.stderr new file mode 100644 index 0000000000000..0013331f0100b --- /dev/null +++ b/src/test/ui/wf/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 { + | - 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 { + | - 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/wf/wf-in-fn-where-clause.rs similarity index 100% rename from src/test/compile-fail/wf-in-fn-where-clause.rs rename to src/test/ui/wf/wf-in-fn-where-clause.rs diff --git a/src/test/ui/wf/wf-in-fn-where-clause.stderr b/src/test/ui/wf/wf-in-fn-where-clause.stderr new file mode 100644 index 0000000000000..76693eace2f84 --- /dev/null +++ b/src/test/ui/wf/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() //~ ERROR E0277 +LL | | where T: MustBeCopy +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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-in-obj-type-static.rs similarity index 100% rename from src/test/compile-fail/wf-in-obj-type-static.rs rename to src/test/ui/wf/wf-in-obj-type-static.rs diff --git a/src/test/ui/wf/wf-in-obj-type-static.stderr b/src/test/ui/wf/wf-in-obj-type-static.stderr new file mode 100644 index 0000000000000..5cbb4be7e92d6 --- /dev/null +++ b/src/test/ui/wf/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 { + | - 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/wf/wf-in-obj-type-trait.rs similarity index 100% rename from src/test/compile-fail/wf-in-obj-type-trait.rs rename to src/test/ui/wf/wf-in-obj-type-trait.rs diff --git a/src/test/ui/wf/wf-in-obj-type-trait.stderr b/src/test/ui/wf/wf-in-obj-type-trait.stderr new file mode 100644 index 0000000000000..93af991cc93e0 --- /dev/null +++ b/src/test/ui/wf/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> //~ 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 { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-inherent-impl-method-where-clause.rs similarity index 100% rename from src/test/compile-fail/wf-inherent-impl-method-where-clause.rs rename to src/test/ui/wf/wf-inherent-impl-method-where-clause.rs diff --git a/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr b/src/test/ui/wf/wf-inherent-impl-method-where-clause.stderr new file mode 100644 index 0000000000000..25ec4195ab191 --- /dev/null +++ b/src/test/ui/wf/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 //~ 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 { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-inherent-impl-where-clause.rs similarity index 100% rename from src/test/compile-fail/wf-inherent-impl-where-clause.rs rename to src/test/ui/wf/wf-inherent-impl-where-clause.rs diff --git a/src/test/ui/wf/wf-inherent-impl-where-clause.stderr b/src/test/ui/wf/wf-inherent-impl-where-clause.stderr new file mode 100644 index 0000000000000..3c5c557db429e --- /dev/null +++ b/src/test/ui/wf/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 Foo where T: ExtraCopy //~ 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 { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/src/test/ui/wf/wf-misc-methods-issue-28609.nll.stderr b/src/test/ui/wf/wf-misc-methods-issue-28609.nll.stderr new file mode 100644 index 0000000000000..48a68bf5749f9 --- /dev/null +++ b/src/test/ui/wf/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/wf/wf-misc-methods-issue-28609.rs similarity index 100% rename from src/test/compile-fail/wf-misc-methods-issue-28609.rs rename to src/test/ui/wf/wf-misc-methods-issue-28609.rs diff --git a/src/test/ui/wf/wf-misc-methods-issue-28609.stderr b/src/test/ui/wf/wf-misc-methods-issue-28609.stderr new file mode 100644 index 0000000000000..352697e6f9490 --- /dev/null +++ b/src/test/ui/wf/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/wf/wf-object-safe.rs similarity index 100% rename from src/test/compile-fail/wf-object-safe.rs rename to src/test/ui/wf/wf-object-safe.rs diff --git a/src/test/ui/wf/wf-object-safe.stderr b/src/test/ui/wf/wf-object-safe.stderr new file mode 100644 index 0000000000000..3d42c52136bae --- /dev/null +++ b/src/test/ui/wf/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/wf/wf-outlives-ty-in-fn-or-trait.rs similarity index 100% rename from src/test/compile-fail/wf-outlives-ty-in-fn-or-trait.rs rename to src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.rs diff --git a/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr b/src/test/ui/wf/wf-outlives-ty-in-fn-or-trait.stderr new file mode 100644 index 0000000000000..9a8c63126f28e --- /dev/null +++ b/src/test/ui/wf/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, + | ^^^^^^^^^^^^^^^ + | +note: ...so that the reference type `&'a (dyn Trait + 'a)` does not outlive the data it points at + --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:26:5 + | +LL | f: &'a Trait, + | ^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/wf/wf-static-method.nll.stderr b/src/test/ui/wf/wf-static-method.nll.stderr new file mode 100644 index 0000000000000..77896ff2ece74 --- /dev/null +++ b/src/test/ui/wf/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 | ::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/wf/wf-static-method.rs similarity index 100% rename from src/test/compile-fail/wf-static-method.rs rename to src/test/ui/wf/wf-static-method.rs diff --git a/src/test/ui/wf/wf-static-method.stderr b/src/test/ui/wf/wf-static-method.stderr new file mode 100644 index 0000000000000..0de2d8e6ca056 --- /dev/null +++ b/src/test/ui/wf/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 | ::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 | ::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 | ::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/wf/wf-static-type.rs similarity index 100% rename from src/test/compile-fail/wf-static-type.rs rename to src/test/ui/wf/wf-static-type.rs diff --git a/src/test/ui/wf/wf-static-type.stderr b/src/test/ui/wf/wf-static-type.stderr new file mode 100644 index 0000000000000..f76444cfe1fef --- /dev/null +++ b/src/test/ui/wf/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> = 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` +note: required by `IsCopy` + --> $DIR/wf-static-type.rs:17:1 + | +LL | struct IsCopy { 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/wf/wf-struct-bound.rs similarity index 100% rename from src/test/compile-fail/wf-struct-bound.rs rename to src/test/ui/wf/wf-struct-bound.rs diff --git a/src/test/ui/wf/wf-struct-bound.stderr b/src/test/ui/wf/wf-struct-bound.stderr new file mode 100644 index 0000000000000..397d8609ceb05 --- /dev/null +++ b/src/test/ui/wf/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 //~ ERROR E0277 +LL | | where T: ExtraCopy +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 { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-struct-field.rs similarity index 100% rename from src/test/compile-fail/wf-struct-field.rs rename to src/test/ui/wf/wf-struct-field.rs diff --git a/src/test/ui/wf/wf-struct-field.stderr b/src/test/ui/wf/wf-struct-field.stderr new file mode 100644 index 0000000000000..48a03c71d7dbb --- /dev/null +++ b/src/test/ui/wf/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 //~ 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 { + | ^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-trait-associated-type-bound.rs similarity index 100% rename from src/test/compile-fail/wf-trait-associated-type-bound.rs rename to src/test/ui/wf/wf-trait-associated-type-bound.rs diff --git a/src/test/ui/wf/wf-trait-associated-type-bound.stderr b/src/test/ui/wf/wf-trait-associated-type-bound.stderr new file mode 100644 index 0000000000000..f09ba381db14a --- /dev/null +++ b/src/test/ui/wf/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 { //~ ERROR E0277 +LL | | type Type1: ExtraCopy; +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 { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-trait-associated-type-region.rs similarity index 100% rename from src/test/compile-fail/wf-trait-associated-type-region.rs rename to src/test/ui/wf/wf-trait-associated-type-region.rs diff --git a/src/test/ui/wf/wf-trait-associated-type-region.stderr b/src/test/ui/wf/wf-trait-associated-type-region.stderr new file mode 100644 index 0000000000000..26d56f7e9645b --- /dev/null +++ b/src/test/ui/wf/wf-trait-associated-type-region.stderr @@ -0,0 +1,16 @@ +error[E0309]: the associated type `>::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 `>::Type1: 'a`... +note: ...so that the reference type `&'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/wf/wf-trait-associated-type-trait.rs similarity index 100% rename from src/test/compile-fail/wf-trait-associated-type-trait.rs rename to src/test/ui/wf/wf-trait-associated-type-trait.rs diff --git a/src/test/ui/wf/wf-trait-associated-type-trait.stderr b/src/test/ui/wf/wf-trait-associated-type-trait.stderr new file mode 100644 index 0000000000000..6bfca64c4439f --- /dev/null +++ b/src/test/ui/wf/wf-trait-associated-type-trait.stderr @@ -0,0 +1,16 @@ +error[E0277]: the trait bound `::Type1: std::marker::Copy` is not satisfied + --> $DIR/wf-trait-associated-type-trait.rs:21:5 + | +LL | type Type2 = IsCopy; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `::Type1` + | + = help: consider adding a `where ::Type1: std::marker::Copy` bound +note: required by `IsCopy` + --> $DIR/wf-trait-associated-type-trait.rs:17:1 + | +LL | struct IsCopy { 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/wf/wf-trait-bound.rs similarity index 100% rename from src/test/compile-fail/wf-trait-bound.rs rename to src/test/ui/wf/wf-trait-bound.rs diff --git a/src/test/ui/wf/wf-trait-bound.stderr b/src/test/ui/wf/wf-trait-bound.stderr new file mode 100644 index 0000000000000..4c21959d9f70c --- /dev/null +++ b/src/test/ui/wf/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 //~ ERROR E0277 +LL | | where T: ExtraCopy +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 { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-trait-default-fn-arg.rs similarity index 100% rename from src/test/compile-fail/wf-trait-default-fn-arg.rs rename to src/test/ui/wf/wf-trait-default-fn-arg.rs diff --git a/src/test/ui/wf/wf-trait-default-fn-arg.stderr b/src/test/ui/wf/wf-trait-default-fn-arg.stderr new file mode 100644 index 0000000000000..5754fd77b724a --- /dev/null +++ b/src/test/ui/wf/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) { +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 { value: Box } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-trait-default-fn-ret.rs similarity index 100% rename from src/test/compile-fail/wf-trait-default-fn-ret.rs rename to src/test/ui/wf/wf-trait-default-fn-ret.rs diff --git a/src/test/ui/wf/wf-trait-default-fn-ret.stderr b/src/test/ui/wf/wf-trait-default-fn-ret.stderr new file mode 100644 index 0000000000000..28d690b1b057b --- /dev/null +++ b/src/test/ui/wf/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 { +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 { value: Box } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-trait-default-fn-where-clause.rs similarity index 100% rename from src/test/compile-fail/wf-trait-default-fn-where-clause.rs rename to src/test/ui/wf/wf-trait-default-fn-where-clause.rs diff --git a/src/test/ui/wf/wf-trait-default-fn-where-clause.stderr b/src/test/ui/wf/wf-trait-default-fn-where-clause.stderr new file mode 100644 index 0000000000000..c135f199a2662 --- /dev/null +++ b/src/test/ui/wf/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(&self) where A: Bar { +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 { } + | ^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-trait-fn-arg.rs similarity index 100% rename from src/test/compile-fail/wf-trait-fn-arg.rs rename to src/test/ui/wf/wf-trait-fn-arg.rs diff --git a/src/test/ui/wf/wf-trait-fn-arg.stderr b/src/test/ui/wf/wf-trait-fn-arg.stderr new file mode 100644 index 0000000000000..6d624fc62ffd3 --- /dev/null +++ b/src/test/ui/wf/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); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 { value: Box } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-trait-fn-ret.rs similarity index 100% rename from src/test/compile-fail/wf-trait-fn-ret.rs rename to src/test/ui/wf/wf-trait-fn-ret.rs diff --git a/src/test/ui/wf/wf-trait-fn-ret.stderr b/src/test/ui/wf/wf-trait-fn-ret.stderr new file mode 100644 index 0000000000000..dca26a6307941 --- /dev/null +++ b/src/test/ui/wf/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; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 { value: Box } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-trait-fn-where-clause.rs similarity index 100% rename from src/test/compile-fail/wf-trait-fn-where-clause.rs rename to src/test/ui/wf/wf-trait-fn-where-clause.rs diff --git a/src/test/ui/wf/wf-trait-fn-where-clause.stderr b/src/test/ui/wf/wf-trait-fn-where-clause.stderr new file mode 100644 index 0000000000000..887f60935b076 --- /dev/null +++ b/src/test/ui/wf/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: 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 { value: Box } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/wf/wf-trait-superbound.rs similarity index 100% rename from src/test/compile-fail/wf-trait-superbound.rs rename to src/test/ui/wf/wf-trait-superbound.rs diff --git a/src/test/ui/wf/wf-trait-superbound.stderr b/src/test/ui/wf/wf-trait-superbound.stderr new file mode 100644 index 0000000000000..ac58dc7496eea --- /dev/null +++ b/src/test/ui/wf/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: ExtraCopy { //~ 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 { } + | ^^^^^^^^^^^^^^^^^^^^^^^ + +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/where-clauses/where-clause-constraints-are-local-for-inherent-impl.rs similarity index 100% rename from src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs rename to src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.rs diff --git a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr new file mode 100644 index 0000000000000..0d6906a85d5cc --- /dev/null +++ b/src/test/ui/where-clauses/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(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/where-clauses/where-clause-constraints-are-local-for-trait-impl.rs similarity index 100% rename from src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs rename to src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.rs diff --git a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr new file mode 100644 index 0000000000000..976cca7b895b1 --- /dev/null +++ b/src/test/ui/where-clauses/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(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/where-clauses/where-clause-method-substituion.rs similarity index 100% rename from src/test/compile-fail/where-clause-method-substituion.rs rename to src/test/ui/where-clauses/where-clause-method-substituion.rs diff --git a/src/test/ui/where-clauses/where-clause-method-substituion.stderr b/src/test/ui/where-clauses/where-clause-method-substituion.stderr new file mode 100644 index 0000000000000..5cd4c395869dc --- /dev/null +++ b/src/test/ui/where-clauses/where-clause-method-substituion.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `X: Foo` is not satisfied + --> $DIR/where-clause-method-substituion.rs:30:7 + | +LL | 1.method::(); + | ^^^^^^ the trait `Foo` 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/where-clauses/where-clauses-method-unsatisfied.rs similarity index 100% rename from src/test/compile-fail/where-clauses-method-unsatisfied.rs rename to src/test/ui/where-clauses/where-clauses-method-unsatisfied.rs diff --git a/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr b/src/test/ui/where-clauses/where-clauses-method-unsatisfied.stderr new file mode 100644 index 0000000000000..eeb0b51b80a87 --- /dev/null +++ b/src/test/ui/where-clauses/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/where-clauses/where-clauses-unsatisfied.rs similarity index 100% rename from src/test/compile-fail/where-clauses-unsatisfied.rs rename to src/test/ui/where-clauses/where-clauses-unsatisfied.rs diff --git a/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr b/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr new file mode 100644 index 0000000000000..dd042599382a8 --- /dev/null +++ b/src/test/ui/where-clauses/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(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/where-clauses/where-equality-constraints.rs similarity index 100% rename from src/test/compile-fail/where-equality-constraints.rs rename to src/test/ui/where-clauses/where-equality-constraints.rs diff --git a/src/test/ui/where-clauses/where-equality-constraints.stderr b/src/test/ui/where-clauses/where-equality-constraints.stderr new file mode 100644 index 0000000000000..f2bcfacc45268 --- /dev/null +++ b/src/test/ui/where-clauses/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/where-clauses/where-for-self-2.rs similarity index 100% rename from src/test/compile-fail/where-for-self-2.rs rename to src/test/ui/where-clauses/where-for-self-2.rs diff --git a/src/test/ui/where-clauses/where-for-self-2.stderr b/src/test/ui/where-clauses/where-for-self-2.stderr new file mode 100644 index 0000000000000..d234c71821512 --- /dev/null +++ b/src/test/ui/where-clauses/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(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/where-clauses/where-for-self.rs similarity index 100% rename from src/test/compile-fail/where-for-self.rs rename to src/test/ui/where-clauses/where-for-self.rs diff --git a/src/test/ui/where-clauses/where-for-self.stderr b/src/test/ui/where-clauses/where-for-self.stderr new file mode 100644 index 0000000000000..89c0bd023c30c --- /dev/null +++ b/src/test/ui/where-clauses/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/where-clauses/where-lifetime-resolution.rs similarity index 100% rename from src/test/compile-fail/where-lifetime-resolution.rs rename to src/test/ui/where-clauses/where-lifetime-resolution.rs diff --git a/src/test/ui/where-clauses/where-lifetime-resolution.stderr b/src/test/ui/where-clauses/where-lifetime-resolution.stderr new file mode 100644 index 0000000000000..a6fc1b2596274 --- /dev/null +++ b/src/test/ui/where-clauses/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/while-let.rs similarity index 100% rename from src/test/compile-fail/while-let.rs rename to src/test/ui/while-let.rs diff --git a/src/test/ui/while-let.stderr b/src/test/ui/while-let.stderr new file mode 100644 index 0000000000000..de4d8be212e43 --- /dev/null +++ b/src/test/ui/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/while-type-error.rs similarity index 100% rename from src/test/compile-fail/while-type-error.rs rename to src/test/ui/while-type-error.rs diff --git a/src/test/ui/while-type-error.stderr b/src/test/ui/while-type-error.stderr new file mode 100644 index 0000000000000..cfc3f3e257e3b --- /dev/null +++ b/src/test/ui/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/windows-subsystem-invalid.rs similarity index 100% rename from src/test/compile-fail/windows-subsystem-invalid.rs rename to src/test/ui/windows-subsystem-invalid.rs diff --git a/src/test/ui/windows-subsystem-invalid.stderr b/src/test/ui/windows-subsystem-invalid.stderr new file mode 100644 index 0000000000000..0cb843cf0f14e --- /dev/null +++ b/src/test/ui/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/write-to-static-mut-in-static.rs similarity index 100% rename from src/test/compile-fail/write-to-static-mut-in-static.rs rename to src/test/ui/write-to-static-mut-in-static.rs diff --git a/src/test/ui/write-to-static-mut-in-static.stderr b/src/test/ui/write-to-static-mut-in-static.stderr new file mode 100644 index 0000000000000..f07d240746fdf --- /dev/null +++ b/src/test/ui/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/writing-to-immutable-vec.nll.stderr b/src/test/ui/writing-to-immutable-vec.nll.stderr new file mode 100644 index 0000000000000..96899276b97a5 --- /dev/null +++ b/src/test/ui/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 = 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/writing-to-immutable-vec.rs similarity index 100% rename from src/test/compile-fail/writing-to-immutable-vec.rs rename to src/test/ui/writing-to-immutable-vec.rs diff --git a/src/test/ui/writing-to-immutable-vec.stderr b/src/test/ui/writing-to-immutable-vec.stderr new file mode 100644 index 0000000000000..07e1779713909 --- /dev/null +++ b/src/test/ui/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 = 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/wrong-mul-method-signature.rs similarity index 100% rename from src/test/compile-fail/wrong-mul-method-signature.rs rename to src/test/ui/wrong-mul-method-signature.rs diff --git a/src/test/ui/wrong-mul-method-signature.stderr b/src/test/ui/wrong-mul-method-signature.stderr new file mode 100644 index 0000000000000..7c4d22c7cca05 --- /dev/null +++ b/src/test/ui/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/wrong-ret-type.rs similarity index 100% rename from src/test/compile-fail/wrong-ret-type.rs rename to src/test/ui/wrong-ret-type.rs diff --git a/src/test/ui/wrong-ret-type.stderr b/src/test/ui/wrong-ret-type.stderr new file mode 100644 index 0000000000000..4ff6f7076038f --- /dev/null +++ b/src/test/ui/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/xc-private-method.rs similarity index 100% rename from src/test/compile-fail/xc-private-method.rs rename to src/test/ui/xc-private-method.rs diff --git a/src/test/ui/xc-private-method.stderr b/src/test/ui/xc-private-method.stderr new file mode 100644 index 0000000000000..35078e73d4670 --- /dev/null +++ b/src/test/ui/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/xc-private-method2.rs similarity index 100% rename from src/test/compile-fail/xc-private-method2.rs rename to src/test/ui/xc-private-method2.rs diff --git a/src/test/ui/xc-private-method2.stderr b/src/test/ui/xc-private-method2.stderr new file mode 100644 index 0000000000000..d671aa35817fa --- /dev/null +++ b/src/test/ui/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/ui/xcrate/auxiliary/static_priv_by_default.rs b/src/test/ui/xcrate/auxiliary/static_priv_by_default.rs new file mode 100644 index 0000000000000..73597e51f0802 --- /dev/null +++ b/src/test/ui/xcrate/auxiliary/static_priv_by_default.rs @@ -0,0 +1,61 @@ +// Copyright 2013 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![crate_type = "lib"] + +static private: isize = 0; +pub static public: isize = 0; + +pub struct A(()); + +impl A { + fn foo() {} +} + +mod foo { + pub static a: isize = 0; + pub fn b() {} + pub struct c; + pub enum d {} + pub type e = isize; + + pub struct A(()); + + impl A { + fn foo() {} + } + + // these are public so the parent can re-export them. + pub static reexported_a: isize = 0; + pub fn reexported_b() {} + pub struct reexported_c; + pub enum reexported_d {} + pub type reexported_e = isize; +} + +pub mod bar { + pub use foo::reexported_a as e; + pub use foo::reexported_b as f; + pub use foo::reexported_c as g; + pub use foo::reexported_d as h; + pub use foo::reexported_e as i; +} + +pub static a: isize = 0; +pub fn b() {} +pub struct c; +pub enum d {} +pub type e = isize; + +static j: isize = 0; +fn k() {} +struct l; +enum m {} +type n = isize; diff --git a/src/test/compile-fail/auxiliary/xcrate_unit_struct.rs b/src/test/ui/xcrate/auxiliary/xcrate_unit_struct.rs similarity index 100% rename from src/test/compile-fail/auxiliary/xcrate_unit_struct.rs rename to src/test/ui/xcrate/auxiliary/xcrate_unit_struct.rs diff --git a/src/test/compile-fail/xcrate-private-by-default.rs b/src/test/ui/xcrate/xcrate-private-by-default.rs similarity index 100% rename from src/test/compile-fail/xcrate-private-by-default.rs rename to src/test/ui/xcrate/xcrate-private-by-default.rs diff --git a/src/test/ui/xcrate/xcrate-private-by-default.stderr b/src/test/ui/xcrate/xcrate-private-by-default.stderr new file mode 100644 index 0000000000000..c4560b9ca7752 --- /dev/null +++ b/src/test/ui/xcrate/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::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: type alias `n` is private + --> $DIR/xcrate-private-by-default.rs:41:11 + | +LL | foo::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^ + +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::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0603]: module `foo` is private + --> $DIR/xcrate-private-by-default.rs:53:11 + | +LL | foo::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +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/xcrate/xcrate-unit-struct.rs similarity index 100% rename from src/test/compile-fail/xcrate-unit-struct.rs rename to src/test/ui/xcrate/xcrate-unit-struct.rs diff --git a/src/test/ui/xcrate/xcrate-unit-struct.stderr b/src/test/ui/xcrate/xcrate-unit-struct.stderr new file mode 100644 index 0000000000000..9ee4cb3ba177f --- /dev/null +++ b/src/test/ui/xcrate/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`. diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 951a72fec6891..6679ec79c1dd6 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -96,7 +96,7 @@ impl fmt::Display for Mode { } } -#[derive(Clone, PartialEq)] +#[derive(Clone, Debug, PartialEq)] pub enum CompareMode { Nll, Polonius, diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index c8f3956415d53..4b246ab674522 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1126,6 +1126,7 @@ impl<'test> TestCx<'test> { } fn check_error_patterns(&self, output_to_check: &str, proc_res: &ProcRes) { + debug!("check_error_patterns"); if self.props.error_patterns.is_empty() { if self.props.compile_pass { return; @@ -1136,26 +1137,21 @@ impl<'test> TestCx<'test> { )); } } - let mut next_err_idx = 0; - let mut next_err_pat = self.props.error_patterns[next_err_idx].trim(); - let mut done = false; - for line in output_to_check.lines() { - if line.contains(next_err_pat) { - debug!("found error pattern {}", next_err_pat); - next_err_idx += 1; - if next_err_idx == self.props.error_patterns.len() { - debug!("found all error patterns"); - done = true; - break; - } - next_err_pat = self.props.error_patterns[next_err_idx].trim(); + + let mut missing_patterns: Vec = Vec::new(); + + for pattern in &self.props.error_patterns { + if output_to_check.contains(pattern.trim()) { + debug!("found error pattern {}", pattern); + } else { + missing_patterns.push(pattern.to_string()); } } - if done { + + if missing_patterns.is_empty() { return; } - let missing_patterns = &self.props.error_patterns[next_err_idx..]; if missing_patterns.len() == 1 { self.fatal_proc_rec( &format!("error pattern '{}' not found!", missing_patterns[0]), @@ -1163,7 +1159,7 @@ impl<'test> TestCx<'test> { ); } else { for pattern in missing_patterns { - self.error(&format!("error pattern '{}' not found!", *pattern)); + self.error(&format!("error pattern '{}' not found!", pattern)); } self.fatal_proc_rec("multiple error patterns not found", proc_res); } @@ -1186,6 +1182,8 @@ impl<'test> TestCx<'test> { } fn check_expected_errors(&self, expected_errors: Vec, proc_res: &ProcRes) { + debug!("check_expected_errors: expected_errors={:?} proc_res.status={:?}", + expected_errors, proc_res.status); if proc_res.status.success() && expected_errors .iter() @@ -2668,12 +2666,17 @@ impl<'test> TestCx<'test> { self.fatal_proc_rec("test run failed!", &proc_res); } } + + debug!("run_ui_test: explicit={:?} config.compare_mode={:?} expected_errors={:?} \ + proc_res.status={:?} props.error_patterns={:?}", + explicit, self.config.compare_mode, expected_errors, proc_res.status, + self.props.error_patterns); if !explicit && self.config.compare_mode.is_none() { - if !expected_errors.is_empty() || !proc_res.status.success() { - // "// error-pattern" comments - self.check_expected_errors(expected_errors, &proc_res); - } else if !self.props.error_patterns.is_empty() || !proc_res.status.success() { + if !expected_errors.is_empty() && !proc_res.status.success() { // "//~ERROR comments" + self.check_expected_errors(expected_errors, &proc_res); + } else if !self.props.error_patterns.is_empty() && !proc_res.status.success() { + // "// error-pattern" comments self.check_error_patterns(&proc_res.stderr, &proc_res); } } @@ -2915,6 +2918,20 @@ impl<'test> TestCx<'test> { }; normalized = normalized.replace(&src_dir_str, "$SRC_DIR"); + // Paths into the build directory + let test_build_dir = &self.config.build_base; + let parent_build_dir = test_build_dir.parent().unwrap().parent().unwrap().parent().unwrap(); + + // eg. /home/user/rust/build/x86_64-unknown-linux-gnu/test/ui + normalized = normalized.replace(test_build_dir.to_str().unwrap(), "$TEST_BUILD_DIR"); + // eg. /home/user/rust/build + normalized = normalized.replace(&parent_build_dir.to_str().unwrap(), "$BUILD_DIR"); + + // Paths into lib directory. + let mut lib_dir = parent_build_dir.parent().unwrap().to_path_buf(); + lib_dir.push("lib"); + normalized = normalized.replace(&lib_dir.to_str().unwrap(), "$LIB_DIR"); + if json { // escaped newlines in json strings should be readable // in the stderr files. There's no point int being correct, diff --git a/src/tools/tidy/src/lib.rs b/src/tools/tidy/src/lib.rs index bb041b39785ec..85254c6abb599 100644 --- a/src/tools/tidy/src/lib.rs +++ b/src/tools/tidy/src/lib.rs @@ -89,16 +89,18 @@ fn walk_many(paths: &[&Path], skip: &mut dyn FnMut(&Path) -> bool, f: &mut dyn F } fn walk(path: &Path, skip: &mut dyn FnMut(&Path) -> bool, f: &mut dyn FnMut(&Path)) { - for entry in t!(fs::read_dir(path), path) { - let entry = t!(entry); - let kind = t!(entry.file_type()); - let path = entry.path(); - if kind.is_dir() { - if !skip(&path) { - walk(&path, skip, f); + if let Ok(dir) = fs::read_dir(path) { + for entry in dir { + let entry = t!(entry); + let kind = t!(entry.file_type()); + let path = entry.path(); + if kind.is_dir() { + if !skip(&path) { + walk(&path, skip, f); + } + } else { + f(&path); } - } else { - f(&path); } } }