From 7ca2eb9c6f67e694cfc7d762f722c3a510fe59b0 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Sat, 20 Dec 2025 23:37:09 +0900 Subject: [PATCH 1/2] moved test --- .../issue-50581.rs => array-slice-vec/array-break-length-2.rs} | 0 .../array-break-length-2.stderr} | 0 .../issue-36400.rs => borrowck/borrow-immutable-deref-box.rs} | 0 .../borrow-immutable-deref-box.stderr} | 0 .../issue-18423.rs => box/box-lifetime-argument-not-allowed.rs} | 0 .../box-lifetime-argument-not-allowed.stderr} | 0 .../cast-rfc0401.rs => cast/cast-rfc0401-fail.rs} | 0 .../cast-rfc0401.stderr => cast/cast-rfc0401-fail.stderr} | 0 tests/ui/{issues/issue-22289.rs => cast/cast-to-dyn-any.rs} | 0 .../ui/{issues/issue-22289.stderr => cast/cast-to-dyn-any.stderr} | 0 .../closure-array-break-length-2.rs} | 0 .../closure-array-break-length-2.stderr} | 0 .../closure-move-use-after-move-diagnostic.rs} | 0 .../closure-move-use-after-move-diagnostic.stderr} | 0 .../{issues/issue-38458.rs => consts/const-return-outside-fn.rs} | 0 .../issue-38458.stderr => consts/const-return-outside-fn.stderr} | 0 .../ui/{issues/issue-28568.rs => drop/drop-conflicting-impls.rs} | 0 .../issue-28568.stderr => drop/drop-conflicting-impls.stderr} | 0 .../issue-23217.rs => enum/enum-discriminant-missing-variant.rs} | 0 .../enum-discriminant-missing-variant.stderr} | 0 .../{issues/issue-21554.rs => mismatched_types/cast-rfc0401-2.rs} | 0 .../issue-21554.stderr => mismatched_types/cast-rfc0401-2.stderr} | 0 .../issue-47184.rs => nll/borrowck-annotate-static-lifetime.rs} | 0 .../borrowck-annotate-static-lifetime.stderr} | 0 tests/ui/{issues/issue-46983.rs => nll/nll-anon-to-static.rs} | 0 .../{issues/issue-46983.stderr => nll/nll-anon-to-static.stderr} | 0 .../issue-45965.rs => parser/missing-operator-after-float.rs} | 0 .../missing-operator-after-float.stderr} | 0 .../{issues/issue-44078.rs => parser/unbalanced-doublequote-2.rs} | 0 .../issue-44078.stderr => parser/unbalanced-doublequote-2.stderr} | 0 .../issue-23173.rs => resolve/missing-associated-items.rs} | 0 .../missing-associated-items.stderr} | 0 tests/ui/{issues/issue-50582.rs => typeck/for-in-const-eval.rs} | 0 .../issue-50582.stderr => typeck/for-in-const-eval.stderr} | 0 34 files changed, 0 insertions(+), 0 deletions(-) rename tests/ui/{issues/issue-50581.rs => array-slice-vec/array-break-length-2.rs} (100%) rename tests/ui/{issues/issue-50581.stderr => array-slice-vec/array-break-length-2.stderr} (100%) rename tests/ui/{issues/issue-36400.rs => borrowck/borrow-immutable-deref-box.rs} (100%) rename tests/ui/{issues/issue-36400.stderr => borrowck/borrow-immutable-deref-box.stderr} (100%) rename tests/ui/{issues/issue-18423.rs => box/box-lifetime-argument-not-allowed.rs} (100%) rename tests/ui/{issues/issue-18423.stderr => box/box-lifetime-argument-not-allowed.stderr} (100%) rename tests/ui/{mismatched_types/cast-rfc0401.rs => cast/cast-rfc0401-fail.rs} (100%) rename tests/ui/{mismatched_types/cast-rfc0401.stderr => cast/cast-rfc0401-fail.stderr} (100%) rename tests/ui/{issues/issue-22289.rs => cast/cast-to-dyn-any.rs} (100%) rename tests/ui/{issues/issue-22289.stderr => cast/cast-to-dyn-any.stderr} (100%) rename tests/ui/{array-slice-vec/array-break-length.rs => closures/closure-array-break-length-2.rs} (100%) rename tests/ui/{array-slice-vec/array-break-length.stderr => closures/closure-array-break-length-2.stderr} (100%) rename tests/ui/{issues/issue-24357.rs => closures/closure-move-use-after-move-diagnostic.rs} (100%) rename tests/ui/{issues/issue-24357.stderr => closures/closure-move-use-after-move-diagnostic.stderr} (100%) rename tests/ui/{issues/issue-38458.rs => consts/const-return-outside-fn.rs} (100%) rename tests/ui/{issues/issue-38458.stderr => consts/const-return-outside-fn.stderr} (100%) rename tests/ui/{issues/issue-28568.rs => drop/drop-conflicting-impls.rs} (100%) rename tests/ui/{issues/issue-28568.stderr => drop/drop-conflicting-impls.stderr} (100%) rename tests/ui/{issues/issue-23217.rs => enum/enum-discriminant-missing-variant.rs} (100%) rename tests/ui/{issues/issue-23217.stderr => enum/enum-discriminant-missing-variant.stderr} (100%) rename tests/ui/{issues/issue-21554.rs => mismatched_types/cast-rfc0401-2.rs} (100%) rename tests/ui/{issues/issue-21554.stderr => mismatched_types/cast-rfc0401-2.stderr} (100%) rename tests/ui/{issues/issue-47184.rs => nll/borrowck-annotate-static-lifetime.rs} (100%) rename tests/ui/{issues/issue-47184.stderr => nll/borrowck-annotate-static-lifetime.stderr} (100%) rename tests/ui/{issues/issue-46983.rs => nll/nll-anon-to-static.rs} (100%) rename tests/ui/{issues/issue-46983.stderr => nll/nll-anon-to-static.stderr} (100%) rename tests/ui/{issues/issue-45965.rs => parser/missing-operator-after-float.rs} (100%) rename tests/ui/{issues/issue-45965.stderr => parser/missing-operator-after-float.stderr} (100%) rename tests/ui/{issues/issue-44078.rs => parser/unbalanced-doublequote-2.rs} (100%) rename tests/ui/{issues/issue-44078.stderr => parser/unbalanced-doublequote-2.stderr} (100%) rename tests/ui/{issues/issue-23173.rs => resolve/missing-associated-items.rs} (100%) rename tests/ui/{issues/issue-23173.stderr => resolve/missing-associated-items.stderr} (100%) rename tests/ui/{issues/issue-50582.rs => typeck/for-in-const-eval.rs} (100%) rename tests/ui/{issues/issue-50582.stderr => typeck/for-in-const-eval.stderr} (100%) diff --git a/tests/ui/issues/issue-50581.rs b/tests/ui/array-slice-vec/array-break-length-2.rs similarity index 100% rename from tests/ui/issues/issue-50581.rs rename to tests/ui/array-slice-vec/array-break-length-2.rs diff --git a/tests/ui/issues/issue-50581.stderr b/tests/ui/array-slice-vec/array-break-length-2.stderr similarity index 100% rename from tests/ui/issues/issue-50581.stderr rename to tests/ui/array-slice-vec/array-break-length-2.stderr diff --git a/tests/ui/issues/issue-36400.rs b/tests/ui/borrowck/borrow-immutable-deref-box.rs similarity index 100% rename from tests/ui/issues/issue-36400.rs rename to tests/ui/borrowck/borrow-immutable-deref-box.rs diff --git a/tests/ui/issues/issue-36400.stderr b/tests/ui/borrowck/borrow-immutable-deref-box.stderr similarity index 100% rename from tests/ui/issues/issue-36400.stderr rename to tests/ui/borrowck/borrow-immutable-deref-box.stderr diff --git a/tests/ui/issues/issue-18423.rs b/tests/ui/box/box-lifetime-argument-not-allowed.rs similarity index 100% rename from tests/ui/issues/issue-18423.rs rename to tests/ui/box/box-lifetime-argument-not-allowed.rs diff --git a/tests/ui/issues/issue-18423.stderr b/tests/ui/box/box-lifetime-argument-not-allowed.stderr similarity index 100% rename from tests/ui/issues/issue-18423.stderr rename to tests/ui/box/box-lifetime-argument-not-allowed.stderr diff --git a/tests/ui/mismatched_types/cast-rfc0401.rs b/tests/ui/cast/cast-rfc0401-fail.rs similarity index 100% rename from tests/ui/mismatched_types/cast-rfc0401.rs rename to tests/ui/cast/cast-rfc0401-fail.rs diff --git a/tests/ui/mismatched_types/cast-rfc0401.stderr b/tests/ui/cast/cast-rfc0401-fail.stderr similarity index 100% rename from tests/ui/mismatched_types/cast-rfc0401.stderr rename to tests/ui/cast/cast-rfc0401-fail.stderr diff --git a/tests/ui/issues/issue-22289.rs b/tests/ui/cast/cast-to-dyn-any.rs similarity index 100% rename from tests/ui/issues/issue-22289.rs rename to tests/ui/cast/cast-to-dyn-any.rs diff --git a/tests/ui/issues/issue-22289.stderr b/tests/ui/cast/cast-to-dyn-any.stderr similarity index 100% rename from tests/ui/issues/issue-22289.stderr rename to tests/ui/cast/cast-to-dyn-any.stderr diff --git a/tests/ui/array-slice-vec/array-break-length.rs b/tests/ui/closures/closure-array-break-length-2.rs similarity index 100% rename from tests/ui/array-slice-vec/array-break-length.rs rename to tests/ui/closures/closure-array-break-length-2.rs diff --git a/tests/ui/array-slice-vec/array-break-length.stderr b/tests/ui/closures/closure-array-break-length-2.stderr similarity index 100% rename from tests/ui/array-slice-vec/array-break-length.stderr rename to tests/ui/closures/closure-array-break-length-2.stderr diff --git a/tests/ui/issues/issue-24357.rs b/tests/ui/closures/closure-move-use-after-move-diagnostic.rs similarity index 100% rename from tests/ui/issues/issue-24357.rs rename to tests/ui/closures/closure-move-use-after-move-diagnostic.rs diff --git a/tests/ui/issues/issue-24357.stderr b/tests/ui/closures/closure-move-use-after-move-diagnostic.stderr similarity index 100% rename from tests/ui/issues/issue-24357.stderr rename to tests/ui/closures/closure-move-use-after-move-diagnostic.stderr diff --git a/tests/ui/issues/issue-38458.rs b/tests/ui/consts/const-return-outside-fn.rs similarity index 100% rename from tests/ui/issues/issue-38458.rs rename to tests/ui/consts/const-return-outside-fn.rs diff --git a/tests/ui/issues/issue-38458.stderr b/tests/ui/consts/const-return-outside-fn.stderr similarity index 100% rename from tests/ui/issues/issue-38458.stderr rename to tests/ui/consts/const-return-outside-fn.stderr diff --git a/tests/ui/issues/issue-28568.rs b/tests/ui/drop/drop-conflicting-impls.rs similarity index 100% rename from tests/ui/issues/issue-28568.rs rename to tests/ui/drop/drop-conflicting-impls.rs diff --git a/tests/ui/issues/issue-28568.stderr b/tests/ui/drop/drop-conflicting-impls.stderr similarity index 100% rename from tests/ui/issues/issue-28568.stderr rename to tests/ui/drop/drop-conflicting-impls.stderr diff --git a/tests/ui/issues/issue-23217.rs b/tests/ui/enum/enum-discriminant-missing-variant.rs similarity index 100% rename from tests/ui/issues/issue-23217.rs rename to tests/ui/enum/enum-discriminant-missing-variant.rs diff --git a/tests/ui/issues/issue-23217.stderr b/tests/ui/enum/enum-discriminant-missing-variant.stderr similarity index 100% rename from tests/ui/issues/issue-23217.stderr rename to tests/ui/enum/enum-discriminant-missing-variant.stderr diff --git a/tests/ui/issues/issue-21554.rs b/tests/ui/mismatched_types/cast-rfc0401-2.rs similarity index 100% rename from tests/ui/issues/issue-21554.rs rename to tests/ui/mismatched_types/cast-rfc0401-2.rs diff --git a/tests/ui/issues/issue-21554.stderr b/tests/ui/mismatched_types/cast-rfc0401-2.stderr similarity index 100% rename from tests/ui/issues/issue-21554.stderr rename to tests/ui/mismatched_types/cast-rfc0401-2.stderr diff --git a/tests/ui/issues/issue-47184.rs b/tests/ui/nll/borrowck-annotate-static-lifetime.rs similarity index 100% rename from tests/ui/issues/issue-47184.rs rename to tests/ui/nll/borrowck-annotate-static-lifetime.rs diff --git a/tests/ui/issues/issue-47184.stderr b/tests/ui/nll/borrowck-annotate-static-lifetime.stderr similarity index 100% rename from tests/ui/issues/issue-47184.stderr rename to tests/ui/nll/borrowck-annotate-static-lifetime.stderr diff --git a/tests/ui/issues/issue-46983.rs b/tests/ui/nll/nll-anon-to-static.rs similarity index 100% rename from tests/ui/issues/issue-46983.rs rename to tests/ui/nll/nll-anon-to-static.rs diff --git a/tests/ui/issues/issue-46983.stderr b/tests/ui/nll/nll-anon-to-static.stderr similarity index 100% rename from tests/ui/issues/issue-46983.stderr rename to tests/ui/nll/nll-anon-to-static.stderr diff --git a/tests/ui/issues/issue-45965.rs b/tests/ui/parser/missing-operator-after-float.rs similarity index 100% rename from tests/ui/issues/issue-45965.rs rename to tests/ui/parser/missing-operator-after-float.rs diff --git a/tests/ui/issues/issue-45965.stderr b/tests/ui/parser/missing-operator-after-float.stderr similarity index 100% rename from tests/ui/issues/issue-45965.stderr rename to tests/ui/parser/missing-operator-after-float.stderr diff --git a/tests/ui/issues/issue-44078.rs b/tests/ui/parser/unbalanced-doublequote-2.rs similarity index 100% rename from tests/ui/issues/issue-44078.rs rename to tests/ui/parser/unbalanced-doublequote-2.rs diff --git a/tests/ui/issues/issue-44078.stderr b/tests/ui/parser/unbalanced-doublequote-2.stderr similarity index 100% rename from tests/ui/issues/issue-44078.stderr rename to tests/ui/parser/unbalanced-doublequote-2.stderr diff --git a/tests/ui/issues/issue-23173.rs b/tests/ui/resolve/missing-associated-items.rs similarity index 100% rename from tests/ui/issues/issue-23173.rs rename to tests/ui/resolve/missing-associated-items.rs diff --git a/tests/ui/issues/issue-23173.stderr b/tests/ui/resolve/missing-associated-items.stderr similarity index 100% rename from tests/ui/issues/issue-23173.stderr rename to tests/ui/resolve/missing-associated-items.stderr diff --git a/tests/ui/issues/issue-50582.rs b/tests/ui/typeck/for-in-const-eval.rs similarity index 100% rename from tests/ui/issues/issue-50582.rs rename to tests/ui/typeck/for-in-const-eval.rs diff --git a/tests/ui/issues/issue-50582.stderr b/tests/ui/typeck/for-in-const-eval.stderr similarity index 100% rename from tests/ui/issues/issue-50582.stderr rename to tests/ui/typeck/for-in-const-eval.stderr From 4578082361406cdf6836301c127534f1a2317135 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Sun, 21 Dec 2025 09:13:49 +0900 Subject: [PATCH 2/2] Cleaned up some tests add comment to closure-move-use-after-move-diagnostic.rs add comment to missing-operator-after-float.rs add comment to closure-array-break-length.rs add comment to box-lifetime-argument-not-allowed.rs add comment to const-return-outside-fn.rs add comment to drop-conflicting-impls.rs add comment to unbalanced-doublequote-2.rs add comment to borrow-immutable-deref-box.rs add comment to for-in-const-eval.rs add comment to borrowck-annotated-static-lifetime.rs cleaned up cast-rfc0401.rs add comment to nll-anon-to-static.rs add comment to cast-to-dyn-any.rs add comment to missing-associated-items.rs add comment to enum-discriminant-missing-variant.rs --- .../array-slice-vec/array-break-length-2.rs | 3 - .../array-break-length-2.stderr | 9 --- .../ui/borrowck/borrow-immutable-deref-box.rs | 1 + .../borrow-immutable-deref-box.stderr | 2 +- .../box/box-lifetime-argument-not-allowed.rs | 7 +- .../box-lifetime-argument-not-allowed.stderr | 4 +- tests/ui/cast/cast-rfc0401-2.rs | 8 -- tests/ui/cast/cast-rfc0401-2.stderr | 15 ---- tests/ui/cast/cast-rfc0401-fail.rs | 29 ++++--- tests/ui/cast/cast-rfc0401-fail.stderr | 76 ++++++++++--------- tests/ui/cast/cast-to-dyn-any.rs | 1 + tests/ui/cast/cast-to-dyn-any.stderr | 2 +- .../closures/closure-array-break-length-2.rs | 9 --- .../closure-array-break-length-2.stderr | 15 ---- .../ui/closures/closure-array-break-length.rs | 11 +++ .../closure-array-break-length.stderr | 26 ++++++- .../closure-move-use-after-move-diagnostic.rs | 21 ++--- ...sure-move-use-after-move-diagnostic.stderr | 25 +++--- tests/ui/consts/const-return-outside-fn.rs | 1 + .../ui/consts/const-return-outside-fn.stderr | 2 +- tests/ui/drop/drop-conflicting-impls.rs | 7 +- tests/ui/drop/drop-conflicting-impls.stderr | 2 +- .../enum/enum-discriminant-missing-variant.rs | 1 + .../enum-discriminant-missing-variant.stderr | 2 +- tests/ui/mismatched_types/cast-rfc0401-2.rs | 6 -- .../ui/mismatched_types/cast-rfc0401-2.stderr | 9 --- .../nll/borrowck-annotate-static-lifetime.rs | 1 + .../borrowck-annotate-static-lifetime.stderr | 2 +- tests/ui/nll/nll-anon-to-static.rs | 1 + tests/ui/nll/nll-anon-to-static.stderr | 2 +- .../ui/parser/missing-operator-after-float.rs | 1 + .../missing-operator-after-float.stderr | 2 +- tests/ui/parser/unbalanced-doublequote-2.rs | 1 + .../ui/parser/unbalanced-doublequote-2.stderr | 2 +- tests/ui/resolve/missing-associated-items.rs | 12 ++- .../resolve/missing-associated-items.stderr | 10 +-- tests/ui/typeck/for-in-const-eval.rs | 1 + tests/ui/typeck/for-in-const-eval.stderr | 2 +- 38 files changed, 160 insertions(+), 171 deletions(-) delete mode 100644 tests/ui/array-slice-vec/array-break-length-2.rs delete mode 100644 tests/ui/array-slice-vec/array-break-length-2.stderr delete mode 100644 tests/ui/cast/cast-rfc0401-2.rs delete mode 100644 tests/ui/cast/cast-rfc0401-2.stderr delete mode 100644 tests/ui/closures/closure-array-break-length-2.rs delete mode 100644 tests/ui/closures/closure-array-break-length-2.stderr delete mode 100644 tests/ui/mismatched_types/cast-rfc0401-2.rs delete mode 100644 tests/ui/mismatched_types/cast-rfc0401-2.stderr diff --git a/tests/ui/array-slice-vec/array-break-length-2.rs b/tests/ui/array-slice-vec/array-break-length-2.rs deleted file mode 100644 index 12bb9930eca40..0000000000000 --- a/tests/ui/array-slice-vec/array-break-length-2.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - |_: [u8; break]| (); //~ ERROR [E0268] -} diff --git a/tests/ui/array-slice-vec/array-break-length-2.stderr b/tests/ui/array-slice-vec/array-break-length-2.stderr deleted file mode 100644 index bac1ade3b0c8f..0000000000000 --- a/tests/ui/array-slice-vec/array-break-length-2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0268]: `break` outside of a loop or labeled block - --> $DIR/issue-50581.rs:2:14 - | -LL | |_: [u8; break]| (); - | ^^^^^ cannot `break` outside of a loop or labeled block - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0268`. diff --git a/tests/ui/borrowck/borrow-immutable-deref-box.rs b/tests/ui/borrowck/borrow-immutable-deref-box.rs index a405f9b113525..6d4932b5b4b5d 100644 --- a/tests/ui/borrowck/borrow-immutable-deref-box.rs +++ b/tests/ui/borrowck/borrow-immutable-deref-box.rs @@ -1,3 +1,4 @@ +//! regression test for issue fn f(x: &mut u32) {} fn main() { diff --git a/tests/ui/borrowck/borrow-immutable-deref-box.stderr b/tests/ui/borrowck/borrow-immutable-deref-box.stderr index 522fb36e14343..6456dc8a0e5a6 100644 --- a/tests/ui/borrowck/borrow-immutable-deref-box.stderr +++ b/tests/ui/borrowck/borrow-immutable-deref-box.stderr @@ -1,5 +1,5 @@ error[E0596]: cannot borrow `*x` as mutable, as `x` is not declared as mutable - --> $DIR/issue-36400.rs:5:7 + --> $DIR/borrow-immutable-deref-box.rs:6:7 | LL | f(&mut *x); | ^^^^^^^ cannot borrow as mutable diff --git a/tests/ui/box/box-lifetime-argument-not-allowed.rs b/tests/ui/box/box-lifetime-argument-not-allowed.rs index 675fd041154be..647fe0917d0a3 100644 --- a/tests/ui/box/box-lifetime-argument-not-allowed.rs +++ b/tests/ui/box/box-lifetime-argument-not-allowed.rs @@ -1,8 +1,9 @@ -// Test that `Box` cannot be used with a lifetime argument. +//! Test that `Box` cannot be used with a lifetime argument. +//! regression test for issue struct Foo<'a> { - x: Box<'a, isize> + x: Box<'a, isize>, //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument was supplied } -fn main() { } +fn main() {} diff --git a/tests/ui/box/box-lifetime-argument-not-allowed.stderr b/tests/ui/box/box-lifetime-argument-not-allowed.stderr index b5f19b5c9b23c..a597a03023af3 100644 --- a/tests/ui/box/box-lifetime-argument-not-allowed.stderr +++ b/tests/ui/box/box-lifetime-argument-not-allowed.stderr @@ -1,7 +1,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied - --> $DIR/issue-18423.rs:4:8 + --> $DIR/box-lifetime-argument-not-allowed.rs:5:8 | -LL | x: Box<'a, isize> +LL | x: Box<'a, isize>, | ^^^ -- help: remove the lifetime argument | | | expected 0 lifetime arguments diff --git a/tests/ui/cast/cast-rfc0401-2.rs b/tests/ui/cast/cast-rfc0401-2.rs deleted file mode 100644 index 70604a587ea1f..0000000000000 --- a/tests/ui/cast/cast-rfc0401-2.rs +++ /dev/null @@ -1,8 +0,0 @@ -// RFC 401 test extracted into distinct file. This is because some the -// change to suppress "derived" errors wound up suppressing this error -// message, since the fallback for `3` doesn't occur. - -fn main() { - let _ = 3 as bool; - //~^ ERROR cannot cast `i32` as `bool` -} diff --git a/tests/ui/cast/cast-rfc0401-2.stderr b/tests/ui/cast/cast-rfc0401-2.stderr deleted file mode 100644 index f2956cdfa3356..0000000000000 --- a/tests/ui/cast/cast-rfc0401-2.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0054]: cannot cast `i32` as `bool` - --> $DIR/cast-rfc0401-2.rs:6:13 - | -LL | let _ = 3 as bool; - | ^^^^^^^^^ - | -help: compare with zero instead - | -LL - let _ = 3 as bool; -LL + let _ = 3 != 0; - | - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0054`. diff --git a/tests/ui/cast/cast-rfc0401-fail.rs b/tests/ui/cast/cast-rfc0401-fail.rs index b2ff5b4a0c063..fb04e3f5f9a0b 100644 --- a/tests/ui/cast/cast-rfc0401-fail.rs +++ b/tests/ui/cast/cast-rfc0401-fail.rs @@ -1,29 +1,33 @@ -fn illegal_cast(u: *const U) -> *const V -{ +fn illegal_cast(u: *const U) -> *const V { u as *const V //~ ERROR is invalid } -fn illegal_cast_2(u: *const U) -> *const str -{ +fn illegal_cast_2(u: *const U) -> *const str { u as *const str //~ ERROR is invalid } -trait Foo { fn foo(&self) {} } +trait Foo { + fn foo(&self) {} +} impl Foo for T {} -trait Bar { fn foo(&self) {} } +trait Bar { + fn foo(&self) {} +} impl Bar for T {} enum E { - A, B + A, + B, } -fn main() -{ +struct Inches(i32); + +fn main() { let f: f32 = 1.2; let v = core::ptr::null::(); - let fat_v : *const [u8] = unsafe { &*core::ptr::null::<[u8; 1]>()}; - let fat_sv : *const [i8] = unsafe { &*core::ptr::null::<[i8; 1]>()}; + let fat_v: *const [u8] = unsafe { &*core::ptr::null::<[u8; 1]>() }; + let fat_sv: *const [i8] = unsafe { &*core::ptr::null::<[i8; 1]>() }; let foo: &dyn Foo = &f; let _ = v as &u8; //~ ERROR non-primitive cast @@ -39,6 +43,7 @@ fn main() let _ = 3_i32 as bool; //~ ERROR cannot cast let _ = E::A as bool; //~ ERROR cannot cast let _ = 0x61u32 as char; //~ ERROR can be cast as + let _ = Inches as f32; //~ ERROR is invalid let _ = false as f32; //~ ERROR is invalid let _ = E::A as f32; //~ ERROR is invalid @@ -58,7 +63,7 @@ fn main() let _ = &f as *const f64; //~ ERROR is invalid let _ = fat_sv as usize; //~ ERROR is invalid - let a : *const str = "hello"; + let a: *const str = "hello"; let _ = a as *const dyn Foo; //~ ERROR the size for values of type // check no error cascade diff --git a/tests/ui/cast/cast-rfc0401-fail.stderr b/tests/ui/cast/cast-rfc0401-fail.stderr index a188b7791fdc8..c41e6e3612dd3 100644 --- a/tests/ui/cast/cast-rfc0401-fail.stderr +++ b/tests/ui/cast/cast-rfc0401-fail.stderr @@ -1,5 +1,5 @@ error[E0606]: casting `*const U` as `*const V` is invalid - --> $DIR/cast-rfc0401.rs:3:5 + --> $DIR/cast-rfc0401-fail.rs:2:5 | LL | u as *const V | ^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | u as *const V = note: the pointers may have different metadata error[E0606]: casting `*const U` as `*const str` is invalid - --> $DIR/cast-rfc0401.rs:8:5 + --> $DIR/cast-rfc0401-fail.rs:6:5 | LL | u as *const str | ^^^^^^^^^^^^^^^ @@ -15,13 +15,13 @@ LL | u as *const str = note: the pointers may have different metadata error[E0609]: no field `f` on type `fn() {main}` - --> $DIR/cast-rfc0401.rs:65:18 + --> $DIR/cast-rfc0401-fail.rs:70:18 | LL | let _ = main.f as *const u32; | ^ unknown field error[E0605]: non-primitive cast: `*const u8` as `&u8` - --> $DIR/cast-rfc0401.rs:29:13 + --> $DIR/cast-rfc0401-fail.rs:33:13 | LL | let _ = v as &u8; | ^^^^^^^^ invalid cast @@ -33,43 +33,43 @@ LL + let _ = &*v; | error[E0605]: non-primitive cast: `*const u8` as `E` - --> $DIR/cast-rfc0401.rs:30:13 + --> $DIR/cast-rfc0401-fail.rs:34:13 | LL | let _ = v as E; | ^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object error[E0605]: non-primitive cast: `*const u8` as `fn()` - --> $DIR/cast-rfc0401.rs:31:13 + --> $DIR/cast-rfc0401-fail.rs:35:13 | LL | let _ = v as fn(); | ^^^^^^^^^ invalid cast error[E0605]: non-primitive cast: `*const u8` as `(u32,)` - --> $DIR/cast-rfc0401.rs:32:13 + --> $DIR/cast-rfc0401-fail.rs:36:13 | LL | let _ = v as (u32,); | ^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object error[E0605]: non-primitive cast: `Option<&*const u8>` as `*const u8` - --> $DIR/cast-rfc0401.rs:33:13 + --> $DIR/cast-rfc0401-fail.rs:37:13 | LL | let _ = Some(&v) as *const u8; | ^^^^^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object error[E0606]: casting `*const u8` as `f32` is invalid - --> $DIR/cast-rfc0401.rs:35:13 + --> $DIR/cast-rfc0401-fail.rs:39:13 | LL | let _ = v as f32; | ^^^^^^^^ error[E0606]: casting `fn() {main}` as `f64` is invalid - --> $DIR/cast-rfc0401.rs:36:13 + --> $DIR/cast-rfc0401-fail.rs:40:13 | LL | let _ = main as f64; | ^^^^^^^^^^^ error[E0606]: casting `&*const u8` as `usize` is invalid - --> $DIR/cast-rfc0401.rs:37:13 + --> $DIR/cast-rfc0401-fail.rs:41:13 | LL | let _ = &v as usize; | ^^^^^^^^^^^ @@ -77,13 +77,13 @@ LL | let _ = &v as usize; = help: cast through a raw pointer first error[E0606]: casting `f32` as `*const u8` is invalid - --> $DIR/cast-rfc0401.rs:38:13 + --> $DIR/cast-rfc0401-fail.rs:42:13 | LL | let _ = f as *const u8; | ^^^^^^^^^^^^^^ error[E0054]: cannot cast `i32` as `bool` - --> $DIR/cast-rfc0401.rs:39:13 + --> $DIR/cast-rfc0401-fail.rs:43:13 | LL | let _ = 3_i32 as bool; | ^^^^^^^^^^^^^ @@ -95,13 +95,13 @@ LL + let _ = 3_i32 != 0; | error[E0054]: cannot cast `E` as `bool` - --> $DIR/cast-rfc0401.rs:40:13 + --> $DIR/cast-rfc0401-fail.rs:44:13 | LL | let _ = E::A as bool; | ^^^^^^^^^^^^ unsupported cast error[E0604]: only `u8` can be cast as `char`, not `u32` - --> $DIR/cast-rfc0401.rs:41:13 + --> $DIR/cast-rfc0401-fail.rs:45:13 | LL | let _ = 0x61u32 as char; | ^^^^^^^^^^^^^^^ invalid cast @@ -112,8 +112,14 @@ LL - let _ = 0x61u32 as char; LL + let _ = char::from_u32(0x61u32); | +error[E0606]: casting `fn(i32) -> Inches {Inches}` as `f32` is invalid + --> $DIR/cast-rfc0401-fail.rs:46:13 + | +LL | let _ = Inches as f32; + | ^^^^^^^^^^^^^ + error[E0606]: casting `bool` as `f32` is invalid - --> $DIR/cast-rfc0401.rs:43:13 + --> $DIR/cast-rfc0401-fail.rs:48:13 | LL | let _ = false as f32; | ^^^^^^^^^^^^ @@ -121,7 +127,7 @@ LL | let _ = false as f32; = help: cast through an integer first error[E0606]: casting `E` as `f32` is invalid - --> $DIR/cast-rfc0401.rs:44:13 + --> $DIR/cast-rfc0401-fail.rs:49:13 | LL | let _ = E::A as f32; | ^^^^^^^^^^^ @@ -129,7 +135,7 @@ LL | let _ = E::A as f32; = help: cast through an integer first error[E0606]: casting `char` as `f32` is invalid - --> $DIR/cast-rfc0401.rs:45:13 + --> $DIR/cast-rfc0401-fail.rs:50:13 | LL | let _ = 'a' as f32; | ^^^^^^^^^^ @@ -137,25 +143,25 @@ LL | let _ = 'a' as f32; = help: cast through an integer first error[E0606]: casting `bool` as `*const u8` is invalid - --> $DIR/cast-rfc0401.rs:47:13 + --> $DIR/cast-rfc0401-fail.rs:52:13 | LL | let _ = false as *const u8; | ^^^^^^^^^^^^^^^^^^ error[E0606]: casting `E` as `*const u8` is invalid - --> $DIR/cast-rfc0401.rs:48:13 + --> $DIR/cast-rfc0401-fail.rs:53:13 | LL | let _ = E::A as *const u8; | ^^^^^^^^^^^^^^^^^ error[E0606]: casting `char` as `*const u8` is invalid - --> $DIR/cast-rfc0401.rs:49:13 + --> $DIR/cast-rfc0401-fail.rs:54:13 | LL | let _ = 'a' as *const u8; | ^^^^^^^^^^^^^^^^ error[E0606]: cannot cast `usize` to a pointer that is wide - --> $DIR/cast-rfc0401.rs:51:24 + --> $DIR/cast-rfc0401-fail.rs:56:24 | LL | let _ = 42usize as *const [u8]; | ------- ^^^^^^^^^^^ creating a `*const [u8]` requires both an address and a length @@ -163,43 +169,43 @@ LL | let _ = 42usize as *const [u8]; | consider casting this expression to `*const ()`, then using `core::ptr::from_raw_parts` error[E0607]: cannot cast thin pointer `*const u8` to wide pointer `*const [u8]` - --> $DIR/cast-rfc0401.rs:52:13 + --> $DIR/cast-rfc0401-fail.rs:57:13 | LL | let _ = v as *const [u8]; | ^^^^^^^^^^^^^^^^ error[E0606]: casting `&dyn Foo` as `*const str` is invalid - --> $DIR/cast-rfc0401.rs:54:13 + --> $DIR/cast-rfc0401-fail.rs:59:13 | LL | let _ = foo as *const str; | ^^^^^^^^^^^^^^^^^ error[E0606]: casting `&dyn Foo` as `*mut str` is invalid - --> $DIR/cast-rfc0401.rs:55:13 + --> $DIR/cast-rfc0401-fail.rs:60:13 | LL | let _ = foo as *mut str; | ^^^^^^^^^^^^^^^ error[E0606]: casting `fn() {main}` as `*mut str` is invalid - --> $DIR/cast-rfc0401.rs:56:13 + --> $DIR/cast-rfc0401-fail.rs:61:13 | LL | let _ = main as *mut str; | ^^^^^^^^^^^^^^^^ error[E0606]: casting `&f32` as `*mut f32` is invalid - --> $DIR/cast-rfc0401.rs:57:13 + --> $DIR/cast-rfc0401-fail.rs:62:13 | LL | let _ = &f as *mut f32; | ^^^^^^^^^^^^^^ error[E0606]: casting `&f32` as `*const f64` is invalid - --> $DIR/cast-rfc0401.rs:58:13 + --> $DIR/cast-rfc0401-fail.rs:63:13 | LL | let _ = &f as *const f64; | ^^^^^^^^^^^^^^^^ error[E0606]: casting `*const [i8]` as `usize` is invalid - --> $DIR/cast-rfc0401.rs:59:13 + --> $DIR/cast-rfc0401-fail.rs:64:13 | LL | let _ = fat_sv as usize; | ^^^^^^^^^^^^^^^ @@ -207,7 +213,7 @@ LL | let _ = fat_sv as usize; = help: cast through a thin pointer first error[E0606]: casting `*const dyn Foo` as `*const [u16]` is invalid - --> $DIR/cast-rfc0401.rs:68:13 + --> $DIR/cast-rfc0401-fail.rs:73:13 | LL | let _ = cf as *const [u16]; | ^^^^^^^^^^^^^^^^^^ @@ -215,7 +221,7 @@ LL | let _ = cf as *const [u16]; = note: the pointers have different metadata error[E0606]: casting `*const dyn Foo` as `*const dyn Bar` is invalid - --> $DIR/cast-rfc0401.rs:69:13 + --> $DIR/cast-rfc0401-fail.rs:74:13 | LL | let _ = cf as *const dyn Bar; | ^^^^^^^^^^^^^^^^^^^^ @@ -223,7 +229,7 @@ LL | let _ = cf as *const dyn Bar; = note: the trait objects may have different vtables error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> $DIR/cast-rfc0401.rs:53:13 + --> $DIR/cast-rfc0401-fail.rs:58:13 | LL | let _ = fat_v as *const dyn Foo; | ^^^^^ doesn't have a size known at compile-time @@ -232,7 +238,7 @@ LL | let _ = fat_v as *const dyn Foo; = note: required for the cast from `*const [u8]` to `*const dyn Foo` error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/cast-rfc0401.rs:62:13 + --> $DIR/cast-rfc0401-fail.rs:67:13 | LL | let _ = a as *const dyn Foo; | ^ doesn't have a size known at compile-time @@ -241,7 +247,7 @@ LL | let _ = a as *const dyn Foo; = note: required for the cast from `*const str` to `*const dyn Foo` error[E0606]: casting `&{float}` as `f32` is invalid - --> $DIR/cast-rfc0401.rs:71:30 + --> $DIR/cast-rfc0401-fail.rs:76:30 | LL | vec![0.0].iter().map(|s| s as f32).collect::>(); | ^^^^^^^^ @@ -251,7 +257,7 @@ help: dereference the expression LL | vec![0.0].iter().map(|s| *s as f32).collect::>(); | + -error: aborting due to 34 previous errors +error: aborting due to 35 previous errors Some errors have detailed explanations: E0054, E0277, E0604, E0605, E0606, E0607, E0609. For more information about an error, try `rustc --explain E0054`. diff --git a/tests/ui/cast/cast-to-dyn-any.rs b/tests/ui/cast/cast-to-dyn-any.rs index e1b3dfe5b61bd..3180c530209e8 100644 --- a/tests/ui/cast/cast-to-dyn-any.rs +++ b/tests/ui/cast/cast-to-dyn-any.rs @@ -1,3 +1,4 @@ +//! regression test for issue fn main() { 0 as &dyn std::any::Any; //~ ERROR non-primitive cast } diff --git a/tests/ui/cast/cast-to-dyn-any.stderr b/tests/ui/cast/cast-to-dyn-any.stderr index 560fbc73bbdc8..6ee1098fcf406 100644 --- a/tests/ui/cast/cast-to-dyn-any.stderr +++ b/tests/ui/cast/cast-to-dyn-any.stderr @@ -1,5 +1,5 @@ error[E0605]: non-primitive cast: `i32` as `&(dyn Any + 'static)` - --> $DIR/issue-22289.rs:2:5 + --> $DIR/cast-to-dyn-any.rs:3:5 | LL | 0 as &dyn std::any::Any; | ^^^^^^^^^^^^^^^^^^^^^^^ invalid cast diff --git a/tests/ui/closures/closure-array-break-length-2.rs b/tests/ui/closures/closure-array-break-length-2.rs deleted file mode 100644 index 60589f7c264a6..0000000000000 --- a/tests/ui/closures/closure-array-break-length-2.rs +++ /dev/null @@ -1,9 +0,0 @@ -fn main() { - loop { - |_: [_; break]| {} //~ ERROR: `break` outside of a loop - } - - loop { - |_: [_; continue]| {} //~ ERROR: `continue` outside of a loop - } -} diff --git a/tests/ui/closures/closure-array-break-length-2.stderr b/tests/ui/closures/closure-array-break-length-2.stderr deleted file mode 100644 index 2df7b6d7f63c6..0000000000000 --- a/tests/ui/closures/closure-array-break-length-2.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0268]: `break` outside of a loop or labeled block - --> $DIR/array-break-length.rs:3:17 - | -LL | |_: [_; break]| {} - | ^^^^^ cannot `break` outside of a loop or labeled block - -error[E0268]: `continue` outside of a loop - --> $DIR/array-break-length.rs:7:17 - | -LL | |_: [_; continue]| {} - | ^^^^^^^^ cannot `continue` outside of a loop - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0268`. diff --git a/tests/ui/closures/closure-array-break-length.rs b/tests/ui/closures/closure-array-break-length.rs index fda590fda022c..c90ae6585dcab 100644 --- a/tests/ui/closures/closure-array-break-length.rs +++ b/tests/ui/closures/closure-array-break-length.rs @@ -1,7 +1,18 @@ +//! regression test for issue fn main() { |_: [_; continue]| {}; //~ ERROR: `continue` outside of a loop + |_: [_; break]| (); //~ ERROR: `break` outside of a loop or labeled block + while |_: [_; continue]| {} {} //~ ERROR: `continue` outside of a loop while |_: [_; break]| {} {} //~ ERROR: `break` outside of a loop + + loop { + |_: [_; break]| {} //~ ERROR: `break` outside of a loop + } + + loop { + |_: [_; continue]| {} //~ ERROR: `continue` outside of a loop + } } diff --git a/tests/ui/closures/closure-array-break-length.stderr b/tests/ui/closures/closure-array-break-length.stderr index 7e0b0027a6f09..3256c50bb9066 100644 --- a/tests/ui/closures/closure-array-break-length.stderr +++ b/tests/ui/closures/closure-array-break-length.stderr @@ -1,21 +1,39 @@ error[E0268]: `continue` outside of a loop - --> $DIR/closure-array-break-length.rs:2:13 + --> $DIR/closure-array-break-length.rs:3:13 | LL | |_: [_; continue]| {}; | ^^^^^^^^ cannot `continue` outside of a loop +error[E0268]: `break` outside of a loop or labeled block + --> $DIR/closure-array-break-length.rs:5:13 + | +LL | |_: [_; break]| (); + | ^^^^^ cannot `break` outside of a loop or labeled block + error[E0268]: `continue` outside of a loop - --> $DIR/closure-array-break-length.rs:4:19 + --> $DIR/closure-array-break-length.rs:7:19 | LL | while |_: [_; continue]| {} {} | ^^^^^^^^ cannot `continue` outside of a loop error[E0268]: `break` outside of a loop or labeled block - --> $DIR/closure-array-break-length.rs:6:19 + --> $DIR/closure-array-break-length.rs:9:19 | LL | while |_: [_; break]| {} {} | ^^^^^ cannot `break` outside of a loop or labeled block -error: aborting due to 3 previous errors +error[E0268]: `break` outside of a loop or labeled block + --> $DIR/closure-array-break-length.rs:12:17 + | +LL | |_: [_; break]| {} + | ^^^^^ cannot `break` outside of a loop or labeled block + +error[E0268]: `continue` outside of a loop + --> $DIR/closure-array-break-length.rs:16:17 + | +LL | |_: [_; continue]| {} + | ^^^^^^^^ cannot `continue` outside of a loop + +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0268`. diff --git a/tests/ui/closures/closure-move-use-after-move-diagnostic.rs b/tests/ui/closures/closure-move-use-after-move-diagnostic.rs index 63c061594d87e..3326af7486c5e 100644 --- a/tests/ui/closures/closure-move-use-after-move-diagnostic.rs +++ b/tests/ui/closures/closure-move-use-after-move-diagnostic.rs @@ -1,13 +1,16 @@ +//! regression test for struct NoCopy; //~ NOTE if `NoCopy` implemented `Clone`, you could clone the value //~^ NOTE consider implementing `Clone` for this type fn main() { - let x = NoCopy; - //~^ NOTE move occurs because `x` has type `NoCopy` - let f = move || { let y = x; }; - //~^ NOTE value moved into closure here - //~| NOTE variable moved due to use in closure - //~| NOTE you could clone this value - let z = x; - //~^ ERROR use of moved value: `x` - //~| NOTE value used here after move + let x = NoCopy; + //~^ NOTE move occurs because `x` has type `NoCopy` + let f = move || { + //~^ NOTE value moved into closure here + let y = x; + //~^ NOTE variable moved due to use in closure + //~| NOTE you could clone this value + }; + let z = x; + //~^ ERROR use of moved value: `x` + //~| NOTE value used here after move } diff --git a/tests/ui/closures/closure-move-use-after-move-diagnostic.stderr b/tests/ui/closures/closure-move-use-after-move-diagnostic.stderr index 2d85077fe4c21..94f80da1b10a4 100644 --- a/tests/ui/closures/closure-move-use-after-move-diagnostic.stderr +++ b/tests/ui/closures/closure-move-use-after-move-diagnostic.stderr @@ -1,25 +1,26 @@ error[E0382]: use of moved value: `x` - --> $DIR/issue-24357.rs:10:12 + --> $DIR/closure-move-use-after-move-diagnostic.rs:13:13 | -LL | let x = NoCopy; - | - move occurs because `x` has type `NoCopy`, which does not implement the `Copy` trait +LL | let x = NoCopy; + | - move occurs because `x` has type `NoCopy`, which does not implement the `Copy` trait LL | -LL | let f = move || { let y = x; }; - | ------- - variable moved due to use in closure - | | - | value moved into closure here +LL | let f = move || { + | ------- value moved into closure here +LL | +LL | let y = x; + | - variable moved due to use in closure ... -LL | let z = x; - | ^ value used here after move +LL | let z = x; + | ^ value used here after move | note: if `NoCopy` implemented `Clone`, you could clone the value - --> $DIR/issue-24357.rs:1:1 + --> $DIR/closure-move-use-after-move-diagnostic.rs:2:1 | LL | struct NoCopy; | ^^^^^^^^^^^^^ consider implementing `Clone` for this type ... -LL | let f = move || { let y = x; }; - | - you could clone this value +LL | let y = x; + | - you could clone this value error: aborting due to 1 previous error diff --git a/tests/ui/consts/const-return-outside-fn.rs b/tests/ui/consts/const-return-outside-fn.rs index 665a8fdf8e26e..c2ee8642bf4b1 100644 --- a/tests/ui/consts/const-return-outside-fn.rs +++ b/tests/ui/consts/const-return-outside-fn.rs @@ -1,3 +1,4 @@ +//! regression test for issue const x: () = { return; //~ ERROR return statement outside of function body }; diff --git a/tests/ui/consts/const-return-outside-fn.stderr b/tests/ui/consts/const-return-outside-fn.stderr index fbf88d5033973..131d577a2547e 100644 --- a/tests/ui/consts/const-return-outside-fn.stderr +++ b/tests/ui/consts/const-return-outside-fn.stderr @@ -1,5 +1,5 @@ error[E0572]: return statement outside of function body - --> $DIR/issue-38458.rs:2:5 + --> $DIR/const-return-outside-fn.rs:3:5 | LL | return; | ^^^^^^ diff --git a/tests/ui/drop/drop-conflicting-impls.rs b/tests/ui/drop/drop-conflicting-impls.rs index ce511158f0051..fba3462a24b2f 100644 --- a/tests/ui/drop/drop-conflicting-impls.rs +++ b/tests/ui/drop/drop-conflicting-impls.rs @@ -1,12 +1,13 @@ +//! regression test for issue struct MyStruct; impl Drop for MyStruct { - fn drop(&mut self) { } + fn drop(&mut self) {} } impl Drop for MyStruct { -//~^ ERROR conflicting implementations of trait - fn drop(&mut self) { } + //~^ ERROR conflicting implementations of trait + fn drop(&mut self) {} } fn main() {} diff --git a/tests/ui/drop/drop-conflicting-impls.stderr b/tests/ui/drop/drop-conflicting-impls.stderr index c8db0403e59a2..ee310f498d373 100644 --- a/tests/ui/drop/drop-conflicting-impls.stderr +++ b/tests/ui/drop/drop-conflicting-impls.stderr @@ -1,5 +1,5 @@ error[E0119]: conflicting implementations of trait `Drop` for type `MyStruct` - --> $DIR/issue-28568.rs:7:1 + --> $DIR/drop-conflicting-impls.rs:8:1 | LL | impl Drop for MyStruct { | ---------------------- first implementation here diff --git a/tests/ui/enum/enum-discriminant-missing-variant.rs b/tests/ui/enum/enum-discriminant-missing-variant.rs index 09f9ebccf2505..1bdbfb1fbcd42 100644 --- a/tests/ui/enum/enum-discriminant-missing-variant.rs +++ b/tests/ui/enum/enum-discriminant-missing-variant.rs @@ -1,3 +1,4 @@ +//! regression test for issue pub enum SomeEnum { B = SomeEnum::A, //~ ERROR no variant or associated item named `A` found } diff --git a/tests/ui/enum/enum-discriminant-missing-variant.stderr b/tests/ui/enum/enum-discriminant-missing-variant.stderr index 830d260f99d7d..ef98a93e86f66 100644 --- a/tests/ui/enum/enum-discriminant-missing-variant.stderr +++ b/tests/ui/enum/enum-discriminant-missing-variant.stderr @@ -1,5 +1,5 @@ error[E0599]: no variant or associated item named `A` found for enum `SomeEnum` in the current scope - --> $DIR/issue-23217.rs:2:19 + --> $DIR/enum-discriminant-missing-variant.rs:3:19 | LL | pub enum SomeEnum { | ----------------- variant or associated item `A` not found for this enum diff --git a/tests/ui/mismatched_types/cast-rfc0401-2.rs b/tests/ui/mismatched_types/cast-rfc0401-2.rs deleted file mode 100644 index c176b1247cea9..0000000000000 --- a/tests/ui/mismatched_types/cast-rfc0401-2.rs +++ /dev/null @@ -1,6 +0,0 @@ -struct Inches(i32); - -fn main() { - Inches as f32; - //~^ ERROR casting -} diff --git a/tests/ui/mismatched_types/cast-rfc0401-2.stderr b/tests/ui/mismatched_types/cast-rfc0401-2.stderr deleted file mode 100644 index b1b59af6ec2b2..0000000000000 --- a/tests/ui/mismatched_types/cast-rfc0401-2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0606]: casting `fn(i32) -> Inches {Inches}` as `f32` is invalid - --> $DIR/issue-21554.rs:4:5 - | -LL | Inches as f32; - | ^^^^^^^^^^^^^ - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0606`. diff --git a/tests/ui/nll/borrowck-annotate-static-lifetime.rs b/tests/ui/nll/borrowck-annotate-static-lifetime.rs index 2f78ce0002ba3..9d849db9b4f39 100644 --- a/tests/ui/nll/borrowck-annotate-static-lifetime.rs +++ b/tests/ui/nll/borrowck-annotate-static-lifetime.rs @@ -1,3 +1,4 @@ +//! regression test for issue fn main() { let _vec: Vec<&'static String> = vec![&String::new()]; //~^ ERROR temporary value dropped while borrowed [E0716] diff --git a/tests/ui/nll/borrowck-annotate-static-lifetime.stderr b/tests/ui/nll/borrowck-annotate-static-lifetime.stderr index d25c6eda9c349..9cb9007d91314 100644 --- a/tests/ui/nll/borrowck-annotate-static-lifetime.stderr +++ b/tests/ui/nll/borrowck-annotate-static-lifetime.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/issue-47184.rs:2:44 + --> $DIR/borrowck-annotate-static-lifetime.rs:3:44 | LL | let _vec: Vec<&'static String> = vec![&String::new()]; | -------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement diff --git a/tests/ui/nll/nll-anon-to-static.rs b/tests/ui/nll/nll-anon-to-static.rs index 4bd49a8796b34..3dc79950056cf 100644 --- a/tests/ui/nll/nll-anon-to-static.rs +++ b/tests/ui/nll/nll-anon-to-static.rs @@ -1,3 +1,4 @@ +//! regression test for issue fn foo(x: &u32) -> &'static u32 { &*x //~^ ERROR lifetime may not live long enough diff --git a/tests/ui/nll/nll-anon-to-static.stderr b/tests/ui/nll/nll-anon-to-static.stderr index f47df306ab845..e431dfd992e15 100644 --- a/tests/ui/nll/nll-anon-to-static.stderr +++ b/tests/ui/nll/nll-anon-to-static.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-46983.rs:2:5 + --> $DIR/nll-anon-to-static.rs:3:5 | LL | fn foo(x: &u32) -> &'static u32 { | - let's call the lifetime of this reference `'1` diff --git a/tests/ui/parser/missing-operator-after-float.rs b/tests/ui/parser/missing-operator-after-float.rs index 15649f777e090..8868689ff81f3 100644 --- a/tests/ui/parser/missing-operator-after-float.rs +++ b/tests/ui/parser/missing-operator-after-float.rs @@ -1,3 +1,4 @@ +//! regression test for issue fn main() { let a = |r: f64| if r != 0.0(r != 0.0) { 1.0 } else { 0.0 }; //~^ ERROR expected function, found `{float}` diff --git a/tests/ui/parser/missing-operator-after-float.stderr b/tests/ui/parser/missing-operator-after-float.stderr index 95a39b1d1980e..08878cf098a7c 100644 --- a/tests/ui/parser/missing-operator-after-float.stderr +++ b/tests/ui/parser/missing-operator-after-float.stderr @@ -1,5 +1,5 @@ error[E0618]: expected function, found `{float}` - --> $DIR/issue-45965.rs:2:30 + --> $DIR/missing-operator-after-float.rs:3:30 | LL | let a = |r: f64| if r != 0.0(r != 0.0) { 1.0 } else { 0.0 }; | ^^^---------- diff --git a/tests/ui/parser/unbalanced-doublequote-2.rs b/tests/ui/parser/unbalanced-doublequote-2.rs index b8c0e285ffcab..1906f96f6c9b9 100644 --- a/tests/ui/parser/unbalanced-doublequote-2.rs +++ b/tests/ui/parser/unbalanced-doublequote-2.rs @@ -1,3 +1,4 @@ +//! regression test for issue fn main() { "😊""; //~ ERROR unterminated double quote } diff --git a/tests/ui/parser/unbalanced-doublequote-2.stderr b/tests/ui/parser/unbalanced-doublequote-2.stderr index 3e12de34e11ee..3a6efaf7d4ec4 100644 --- a/tests/ui/parser/unbalanced-doublequote-2.stderr +++ b/tests/ui/parser/unbalanced-doublequote-2.stderr @@ -1,5 +1,5 @@ error[E0765]: unterminated double quote string - --> $DIR/issue-44078.rs:2:8 + --> $DIR/unbalanced-doublequote-2.rs:3:8 | LL | "😊""; | _________^ diff --git a/tests/ui/resolve/missing-associated-items.rs b/tests/ui/resolve/missing-associated-items.rs index 92f4c546440ab..72d6cbb3f1497 100644 --- a/tests/ui/resolve/missing-associated-items.rs +++ b/tests/ui/resolve/missing-associated-items.rs @@ -1,9 +1,17 @@ -enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ } +//! regression test for issue +enum Token { + LeftParen, + RightParen, + Plus, + Minus, /* etc */ +} struct Struct { a: usize, } -fn use_token(token: &Token) { unimplemented!() } +fn use_token(token: &Token) { + unimplemented!() +} fn main() { use_token(&Token::Homura); //~ ERROR no variant or associated item named `Homura` diff --git a/tests/ui/resolve/missing-associated-items.stderr b/tests/ui/resolve/missing-associated-items.stderr index d07d1a7caaf24..d27a3a644aee5 100644 --- a/tests/ui/resolve/missing-associated-items.stderr +++ b/tests/ui/resolve/missing-associated-items.stderr @@ -1,14 +1,14 @@ error[E0599]: no variant or associated item named `Homura` found for enum `Token` in the current scope - --> $DIR/issue-23173.rs:9:23 + --> $DIR/missing-associated-items.rs:17:23 | -LL | enum Token { LeftParen, RightParen, Plus, Minus, /* etc */ } +LL | enum Token { | ---------- variant or associated item `Homura` not found for this enum ... LL | use_token(&Token::Homura); | ^^^^^^ variant or associated item not found in `Token` error[E0599]: no function or associated item named `method` found for struct `Struct` in the current scope - --> $DIR/issue-23173.rs:10:13 + --> $DIR/missing-associated-items.rs:18:13 | LL | struct Struct { | ------------- function or associated item `method` not found for this struct @@ -17,7 +17,7 @@ LL | Struct::method(); | ^^^^^^ function or associated item not found in `Struct` error[E0599]: no function or associated item named `method` found for struct `Struct` in the current scope - --> $DIR/issue-23173.rs:11:13 + --> $DIR/missing-associated-items.rs:19:13 | LL | struct Struct { | ------------- function or associated item `method` not found for this struct @@ -26,7 +26,7 @@ LL | Struct::method; | ^^^^^^ function or associated item not found in `Struct` error[E0599]: no associated item named `Assoc` found for struct `Struct` in the current scope - --> $DIR/issue-23173.rs:12:13 + --> $DIR/missing-associated-items.rs:20:13 | LL | struct Struct { | ------------- associated item `Assoc` not found for this struct diff --git a/tests/ui/typeck/for-in-const-eval.rs b/tests/ui/typeck/for-in-const-eval.rs index 1358e0bde4c82..f187a9ef30771 100644 --- a/tests/ui/typeck/for-in-const-eval.rs +++ b/tests/ui/typeck/for-in-const-eval.rs @@ -1,3 +1,4 @@ +//! regression test for issue fn main() { Vec::<[(); 1 + for x in 0..1 {}]>::new(); //~^ ERROR cannot add diff --git a/tests/ui/typeck/for-in-const-eval.stderr b/tests/ui/typeck/for-in-const-eval.stderr index 168f5894fb030..e7a2558495813 100644 --- a/tests/ui/typeck/for-in-const-eval.stderr +++ b/tests/ui/typeck/for-in-const-eval.stderr @@ -1,5 +1,5 @@ error[E0277]: cannot add `()` to `{integer}` - --> $DIR/issue-50582.rs:2:18 + --> $DIR/for-in-const-eval.rs:3:18 | LL | Vec::<[(); 1 + for x in 0..1 {}]>::new(); | ^ no implementation for `{integer} + ()`