diff options
Diffstat (limited to 'tests')
468 files changed, 1375 insertions, 5245 deletions
diff --git a/tests/codegen-units/item-collection/generic-drop-glue.rs b/tests/codegen-units/item-collection/generic-drop-glue.rs index 6df4ff7e58b..ca477d06610 100644 --- a/tests/codegen-units/item-collection/generic-drop-glue.rs +++ b/tests/codegen-units/item-collection/generic-drop-glue.rs @@ -34,9 +34,9 @@ enum EnumNoDrop<T1, T2> { } -struct NonGenericNoDrop(#[allow(unused_tuple_struct_fields)] i32); +struct NonGenericNoDrop(#[allow(dead_code)] i32); -struct NonGenericWithDrop(#[allow(unused_tuple_struct_fields)] i32); +struct NonGenericWithDrop(#[allow(dead_code)] i32); //~ MONO_ITEM fn std::ptr::drop_in_place::<NonGenericWithDrop> - shim(Some(NonGenericWithDrop)) @@ generic_drop_glue-cgu.0[Internal] impl Drop for NonGenericWithDrop { diff --git a/tests/codegen-units/item-collection/transitive-drop-glue.rs b/tests/codegen-units/item-collection/transitive-drop-glue.rs index e286c800b7c..5f20637b40f 100644 --- a/tests/codegen-units/item-collection/transitive-drop-glue.rs +++ b/tests/codegen-units/item-collection/transitive-drop-glue.rs @@ -6,9 +6,9 @@ #![feature(start)] //~ MONO_ITEM fn std::ptr::drop_in_place::<Root> - shim(Some(Root)) @@ transitive_drop_glue-cgu.0[Internal] -struct Root(#[allow(unused_tuple_struct_fields)] Intermediate); +struct Root(#[allow(dead_code)] Intermediate); //~ MONO_ITEM fn std::ptr::drop_in_place::<Intermediate> - shim(Some(Intermediate)) @@ transitive_drop_glue-cgu.0[Internal] -struct Intermediate(#[allow(unused_tuple_struct_fields)] Leaf); +struct Intermediate(#[allow(dead_code)] Leaf); //~ MONO_ITEM fn std::ptr::drop_in_place::<Leaf> - shim(Some(Leaf)) @@ transitive_drop_glue-cgu.0[Internal] struct Leaf; @@ -17,9 +17,9 @@ impl Drop for Leaf { fn drop(&mut self) {} } -struct RootGen<T>(#[allow(unused_tuple_struct_fields)] IntermediateGen<T>); -struct IntermediateGen<T>(#[allow(unused_tuple_struct_fields)] LeafGen<T>); -struct LeafGen<T>(#[allow(unused_tuple_struct_fields)] T); +struct RootGen<T>(#[allow(dead_code)] IntermediateGen<T>); +struct IntermediateGen<T>(#[allow(dead_code)] LeafGen<T>); +struct LeafGen<T>(#[allow(dead_code)] T); impl<T> Drop for LeafGen<T> { fn drop(&mut self) {} diff --git a/tests/codegen-units/item-collection/unsizing.rs b/tests/codegen-units/item-collection/unsizing.rs index 111a7231209..34f52ce4e61 100644 --- a/tests/codegen-units/item-collection/unsizing.rs +++ b/tests/codegen-units/item-collection/unsizing.rs @@ -40,7 +40,7 @@ impl Trait for u32 { } #[derive(Clone, Copy)] -struct Wrapper<T: ?Sized>(#[allow(unused_tuple_struct_fields)] *const T); +struct Wrapper<T: ?Sized>(#[allow(dead_code)] *const T); impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Wrapper<U>> for Wrapper<T> {} diff --git a/tests/run-make-fulldeps/hotplug_codegen_backend/Makefile b/tests/run-make-fulldeps/hotplug_codegen_backend/Makefile index 6752091e699..3a5a66b6755 100644 --- a/tests/run-make-fulldeps/hotplug_codegen_backend/Makefile +++ b/tests/run-make-fulldeps/hotplug_codegen_backend/Makefile @@ -7,7 +7,6 @@ include ../../run-make/tools.mk # -Zbinary-dep-depinfo is used. all: - /bin/echo || exit 0 # This test requires /bin/echo to exist $(RUSTC) the_backend.rs --crate-name the_backend --crate-type dylib \ -o $(TMPDIR)/the_backend.dylib diff --git a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs index 28926243390..2323cf46d6f 100644 --- a/tests/ui/allocator/no_std-alloc-error-handler-custom.rs +++ b/tests/ui/allocator/no_std-alloc-error-handler-custom.rs @@ -74,7 +74,7 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! { extern "C" fn rust_eh_personality() {} #[derive(Default, Debug)] -struct Page(#[allow(unused_tuple_struct_fields)] [[u64; 32]; 16]); +struct Page(#[allow(dead_code)] [[u64; 32]; 16]); #[no_mangle] fn main(_argc: i32, _argv: *const *const u8) -> isize { diff --git a/tests/ui/allocator/no_std-alloc-error-handler-default.rs b/tests/ui/allocator/no_std-alloc-error-handler-default.rs index 56409e71339..488434a9a72 100644 --- a/tests/ui/allocator/no_std-alloc-error-handler-default.rs +++ b/tests/ui/allocator/no_std-alloc-error-handler-default.rs @@ -61,7 +61,7 @@ fn panic(panic_info: &core::panic::PanicInfo) -> ! { extern "C" fn rust_eh_personality() {} #[derive(Default, Debug)] -struct Page(#[allow(unused_tuple_struct_fields)] [[u64; 32]; 16]); +struct Page(#[allow(dead_code)] [[u64; 32]; 16]); #[no_mangle] fn main(_argc: i32, _argv: *const *const u8) -> isize { diff --git a/tests/ui/array-slice-vec/show-boxed-slice.rs b/tests/ui/array-slice-vec/show-boxed-slice.rs index c10f779b1f6..3ae3686e423 100644 --- a/tests/ui/array-slice-vec/show-boxed-slice.rs +++ b/tests/ui/array-slice-vec/show-boxed-slice.rs @@ -1,7 +1,7 @@ // run-pass #[derive(Debug)] -struct Foo(#[allow(unused_tuple_struct_fields)] Box<[u8]>); +struct Foo(#[allow(dead_code)] Box<[u8]>); pub fn main() { println!("{:?}", Foo(Box::new([0, 1, 2]))); diff --git a/tests/ui/asm/aarch64/const.rs b/tests/ui/asm/aarch64/const.rs index de299bfdbdf..0b02c99abf6 100644 --- a/tests/ui/asm/aarch64/const.rs +++ b/tests/ui/asm/aarch64/const.rs @@ -1,8 +1,6 @@ // only-aarch64 // run-pass // needs-asm-support -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![feature(asm_const)] diff --git a/tests/ui/asm/bad-arch.rs b/tests/ui/asm/bad-arch.rs index 93309899bf3..3eeb76f3d00 100644 --- a/tests/ui/asm/bad-arch.rs +++ b/tests/ui/asm/bad-arch.rs @@ -1,7 +1,5 @@ // compile-flags: --target sparc-unknown-linux-gnu // needs-llvm-components: sparc -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![feature(no_core, lang_items, rustc_attrs)] #![no_core] diff --git a/tests/ui/asm/bad-arch.mirunsafeck.stderr b/tests/ui/asm/bad-arch.stderr index d7af296152f..23aad9908ef 100644 --- a/tests/ui/asm/bad-arch.mirunsafeck.stderr +++ b/tests/ui/asm/bad-arch.stderr @@ -1,11 +1,11 @@ error[E0472]: inline assembly is unsupported on this target - --> $DIR/bad-arch.rs:22:9 + --> $DIR/bad-arch.rs:20:9 | LL | asm!(""); | ^^^^^^^^ error[E0472]: inline assembly is unsupported on this target - --> $DIR/bad-arch.rs:27:1 + --> $DIR/bad-arch.rs:25:1 | LL | global_asm!(""); | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/asm/bad-arch.thirunsafeck.stderr b/tests/ui/asm/bad-arch.thirunsafeck.stderr deleted file mode 100644 index d7af296152f..00000000000 --- a/tests/ui/asm/bad-arch.thirunsafeck.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error[E0472]: inline assembly is unsupported on this target - --> $DIR/bad-arch.rs:22:9 - | -LL | asm!(""); - | ^^^^^^^^ - -error[E0472]: inline assembly is unsupported on this target - --> $DIR/bad-arch.rs:27:1 - | -LL | global_asm!(""); - | ^^^^^^^^^^^^^^^ - | - = note: this error originates in the macro `global_asm` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0472`. diff --git a/tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr b/tests/ui/asm/bad-template.aarch64.stderr index b16f9a06c2a..4ffcd2303b7 100644 --- a/tests/ui/asm/bad-template.aarch64_mirunsafeck.stderr +++ b/tests/ui/asm/bad-template.aarch64.stderr @@ -1,5 +1,5 @@ error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:31:15 + --> $DIR/bad-template.rs:27:15 | LL | asm!("{}"); | ^^ from here @@ -7,7 +7,7 @@ LL | asm!("{}"); = note: no arguments were given error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:33:15 + --> $DIR/bad-template.rs:29:15 | LL | asm!("{1}", in(reg) foo); | ^^^ from here @@ -15,7 +15,7 @@ LL | asm!("{1}", in(reg) foo); = note: there is 1 argument error: argument never used - --> $DIR/bad-template.rs:33:21 + --> $DIR/bad-template.rs:29:21 | LL | asm!("{1}", in(reg) foo); | ^^^^^^^^^^^ argument never used @@ -23,13 +23,13 @@ LL | asm!("{1}", in(reg) foo); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"` error: there is no argument named `a` - --> $DIR/bad-template.rs:36:16 + --> $DIR/bad-template.rs:32:16 | LL | asm!("{a}"); | ^ error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:38:15 + --> $DIR/bad-template.rs:34:15 | LL | asm!("{}", a = in(reg) foo); | ^^ --------------- named argument @@ -38,13 +38,13 @@ LL | asm!("{}", a = in(reg) foo); | = note: no positional arguments were given note: named arguments cannot be referenced by position - --> $DIR/bad-template.rs:38:20 + --> $DIR/bad-template.rs:34:20 | LL | asm!("{}", a = in(reg) foo); | ^^^^^^^^^^^^^^^ error: named argument never used - --> $DIR/bad-template.rs:38:20 + --> $DIR/bad-template.rs:34:20 | LL | asm!("{}", a = in(reg) foo); | ^^^^^^^^^^^^^^^ named argument never used @@ -52,7 +52,7 @@ LL | asm!("{}", a = in(reg) foo); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:41:15 + --> $DIR/bad-template.rs:37:15 | LL | asm!("{1}", a = in(reg) foo); | ^^^ from here @@ -60,7 +60,7 @@ LL | asm!("{1}", a = in(reg) foo); = note: no positional arguments were given error: named argument never used - --> $DIR/bad-template.rs:41:21 + --> $DIR/bad-template.rs:37:21 | LL | asm!("{1}", a = in(reg) foo); | ^^^^^^^^^^^^^^^ named argument never used @@ -68,7 +68,7 @@ LL | asm!("{1}", a = in(reg) foo); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:48:15 + --> $DIR/bad-template.rs:44:15 | LL | asm!("{}", in("x0") foo); | ^^ ------------ explicit register argument @@ -77,24 +77,24 @@ LL | asm!("{}", in("x0") foo); | = note: no positional arguments were given note: explicit register arguments cannot be used in the asm template - --> $DIR/bad-template.rs:48:20 + --> $DIR/bad-template.rs:44:20 | LL | asm!("{}", in("x0") foo); | ^^^^^^^^^^^^ help: use the register name directly in the assembly code - --> $DIR/bad-template.rs:48:20 + --> $DIR/bad-template.rs:44:20 | LL | asm!("{}", in("x0") foo); | ^^^^^^^^^^^^ error: asm template modifier must be a single character - --> $DIR/bad-template.rs:50:17 + --> $DIR/bad-template.rs:46:17 | LL | asm!("{:foo}", in(reg) foo); | ^^^ error: multiple unused asm arguments - --> $DIR/bad-template.rs:53:18 + --> $DIR/bad-template.rs:49:18 | LL | asm!("", in(reg) 0, in(reg) 1); | ^^^^^^^^^ ^^^^^^^^^ argument never used @@ -104,7 +104,7 @@ LL | asm!("", in(reg) 0, in(reg) 1); = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"` error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:59:14 + --> $DIR/bad-template.rs:55:14 | LL | global_asm!("{}"); | ^^ from here @@ -112,7 +112,7 @@ LL | global_asm!("{}"); = note: no arguments were given error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:61:14 + --> $DIR/bad-template.rs:57:14 | LL | global_asm!("{1}", const FOO); | ^^^ from here @@ -120,7 +120,7 @@ LL | global_asm!("{1}", const FOO); = note: there is 1 argument error: argument never used - --> $DIR/bad-template.rs:61:20 + --> $DIR/bad-template.rs:57:20 | LL | global_asm!("{1}", const FOO); | ^^^^^^^^^ argument never used @@ -128,13 +128,13 @@ LL | global_asm!("{1}", const FOO); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"` error: there is no argument named `a` - --> $DIR/bad-template.rs:64:15 + --> $DIR/bad-template.rs:60:15 | LL | global_asm!("{a}"); | ^ error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:66:14 + --> $DIR/bad-template.rs:62:14 | LL | global_asm!("{}", a = const FOO); | ^^ ------------- named argument @@ -143,13 +143,13 @@ LL | global_asm!("{}", a = const FOO); | = note: no positional arguments were given note: named arguments cannot be referenced by position - --> $DIR/bad-template.rs:66:19 + --> $DIR/bad-template.rs:62:19 | LL | global_asm!("{}", a = const FOO); | ^^^^^^^^^^^^^ error: named argument never used - --> $DIR/bad-template.rs:66:19 + --> $DIR/bad-template.rs:62:19 | LL | global_asm!("{}", a = const FOO); | ^^^^^^^^^^^^^ named argument never used @@ -157,7 +157,7 @@ LL | global_asm!("{}", a = const FOO); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:69:14 + --> $DIR/bad-template.rs:65:14 | LL | global_asm!("{1}", a = const FOO); | ^^^ from here @@ -165,7 +165,7 @@ LL | global_asm!("{1}", a = const FOO); = note: no positional arguments were given error: named argument never used - --> $DIR/bad-template.rs:69:20 + --> $DIR/bad-template.rs:65:20 | LL | global_asm!("{1}", a = const FOO); | ^^^^^^^^^^^^^ named argument never used @@ -173,13 +173,13 @@ LL | global_asm!("{1}", a = const FOO); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` error: asm template modifier must be a single character - --> $DIR/bad-template.rs:72:16 + --> $DIR/bad-template.rs:68:16 | LL | global_asm!("{:foo}", const FOO); | ^^^ error: multiple unused asm arguments - --> $DIR/bad-template.rs:74:17 + --> $DIR/bad-template.rs:70:17 | LL | global_asm!("", const FOO, const FOO); | ^^^^^^^^^ ^^^^^^^^^ argument never used @@ -189,7 +189,7 @@ LL | global_asm!("", const FOO, const FOO); = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"` warning: formatting may not be suitable for sub-register argument - --> $DIR/bad-template.rs:50:15 + --> $DIR/bad-template.rs:46:15 | LL | asm!("{:foo}", in(reg) foo); | ^^^^^^ --- for this argument diff --git a/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr b/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr deleted file mode 100644 index b16f9a06c2a..00000000000 --- a/tests/ui/asm/bad-template.aarch64_thirunsafeck.stderr +++ /dev/null @@ -1,202 +0,0 @@ -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:31:15 - | -LL | asm!("{}"); - | ^^ from here - | - = note: no arguments were given - -error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:33:15 - | -LL | asm!("{1}", in(reg) foo); - | ^^^ from here - | - = note: there is 1 argument - -error: argument never used - --> $DIR/bad-template.rs:33:21 - | -LL | asm!("{1}", in(reg) foo); - | ^^^^^^^^^^^ argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"` - -error: there is no argument named `a` - --> $DIR/bad-template.rs:36:16 - | -LL | asm!("{a}"); - | ^ - -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:38:15 - | -LL | asm!("{}", a = in(reg) foo); - | ^^ --------------- named argument - | | - | from here - | - = note: no positional arguments were given -note: named arguments cannot be referenced by position - --> $DIR/bad-template.rs:38:20 - | -LL | asm!("{}", a = in(reg) foo); - | ^^^^^^^^^^^^^^^ - -error: named argument never used - --> $DIR/bad-template.rs:38:20 - | -LL | asm!("{}", a = in(reg) foo); - | ^^^^^^^^^^^^^^^ named argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` - -error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:41:15 - | -LL | asm!("{1}", a = in(reg) foo); - | ^^^ from here - | - = note: no positional arguments were given - -error: named argument never used - --> $DIR/bad-template.rs:41:21 - | -LL | asm!("{1}", a = in(reg) foo); - | ^^^^^^^^^^^^^^^ named argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` - -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:48:15 - | -LL | asm!("{}", in("x0") foo); - | ^^ ------------ explicit register argument - | | - | from here - | - = note: no positional arguments were given -note: explicit register arguments cannot be used in the asm template - --> $DIR/bad-template.rs:48:20 - | -LL | asm!("{}", in("x0") foo); - | ^^^^^^^^^^^^ -help: use the register name directly in the assembly code - --> $DIR/bad-template.rs:48:20 - | -LL | asm!("{}", in("x0") foo); - | ^^^^^^^^^^^^ - -error: asm template modifier must be a single character - --> $DIR/bad-template.rs:50:17 - | -LL | asm!("{:foo}", in(reg) foo); - | ^^^ - -error: multiple unused asm arguments - --> $DIR/bad-template.rs:53:18 - | -LL | asm!("", in(reg) 0, in(reg) 1); - | ^^^^^^^^^ ^^^^^^^^^ argument never used - | | - | argument never used - | - = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"` - -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:59:14 - | -LL | global_asm!("{}"); - | ^^ from here - | - = note: no arguments were given - -error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:61:14 - | -LL | global_asm!("{1}", const FOO); - | ^^^ from here - | - = note: there is 1 argument - -error: argument never used - --> $DIR/bad-template.rs:61:20 - | -LL | global_asm!("{1}", const FOO); - | ^^^^^^^^^ argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"` - -error: there is no argument named `a` - --> $DIR/bad-template.rs:64:15 - | -LL | global_asm!("{a}"); - | ^ - -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:66:14 - | -LL | global_asm!("{}", a = const FOO); - | ^^ ------------- named argument - | | - | from here - | - = note: no positional arguments were given -note: named arguments cannot be referenced by position - --> $DIR/bad-template.rs:66:19 - | -LL | global_asm!("{}", a = const FOO); - | ^^^^^^^^^^^^^ - -error: named argument never used - --> $DIR/bad-template.rs:66:19 - | -LL | global_asm!("{}", a = const FOO); - | ^^^^^^^^^^^^^ named argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` - -error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:69:14 - | -LL | global_asm!("{1}", a = const FOO); - | ^^^ from here - | - = note: no positional arguments were given - -error: named argument never used - --> $DIR/bad-template.rs:69:20 - | -LL | global_asm!("{1}", a = const FOO); - | ^^^^^^^^^^^^^ named argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` - -error: asm template modifier must be a single character - --> $DIR/bad-template.rs:72:16 - | -LL | global_asm!("{:foo}", const FOO); - | ^^^ - -error: multiple unused asm arguments - --> $DIR/bad-template.rs:74:17 - | -LL | global_asm!("", const FOO, const FOO); - | ^^^^^^^^^ ^^^^^^^^^ argument never used - | | - | argument never used - | - = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"` - -warning: formatting may not be suitable for sub-register argument - --> $DIR/bad-template.rs:50:15 - | -LL | asm!("{:foo}", in(reg) foo); - | ^^^^^^ --- for this argument - | - = help: use `{0:w}` to have the register formatted as `w0` - = help: or use `{0:x}` to keep the default formatting of `x0` - = note: `#[warn(asm_sub_register)]` on by default - -error: aborting due to 21 previous errors; 1 warning emitted - diff --git a/tests/ui/asm/bad-template.rs b/tests/ui/asm/bad-template.rs index 55637174792..a6a233a36ec 100644 --- a/tests/ui/asm/bad-template.rs +++ b/tests/ui/asm/bad-template.rs @@ -1,14 +1,10 @@ -// revisions: x86_64_mirunsafeck aarch64_mirunsafeck x86_64_thirunsafeck aarch64_thirunsafeck +// revisions: x86_64 aarch64 -// [x86_64_thirunsafeck] compile-flags: -Z thir-unsafeck --target x86_64-unknown-linux-gnu -// [aarch64_thirunsafeck] compile-flags: -Z thir-unsafeck --target aarch64-unknown-linux-gnu -// [x86_64_mirunsafeck] compile-flags: --target x86_64-unknown-linux-gnu -// [aarch64_mirunsafeck] compile-flags: --target aarch64-unknown-linux-gnu +// [x86_64] compile-flags: --target x86_64-unknown-linux-gnu +// [aarch64] compile-flags: --target aarch64-unknown-linux-gnu -// [x86_64_thirunsafeck] needs-llvm-components: x86 -// [x86_64_mirunsafeck] needs-llvm-components: x86 -// [aarch64_thirunsafeck] needs-llvm-components: aarch64 -// [aarch64_mirunsafeck] needs-llvm-components: aarch64 +// [x86_64] needs-llvm-components: x86 +// [aarch64] needs-llvm-components: aarch64 #![feature(no_core, lang_items, rustc_attrs, asm_const)] #![no_core] @@ -41,12 +37,12 @@ fn main() { asm!("{1}", a = in(reg) foo); //~^ ERROR invalid reference to argument at index 1 //~^^ ERROR named argument never used - #[cfg(any(x86_64_thirunsafeck, x86_64_mirunsafeck))] + #[cfg(any(x86_64))] asm!("{}", in("eax") foo); - //[x86_64_thirunsafeck,x86_64_mirunsafeck]~^ ERROR invalid reference to argument at index 0 - #[cfg(any(aarch64_thirunsafeck, aarch64_mirunsafeck))] + //[x86_64]~^ ERROR invalid reference to argument at index 0 + #[cfg(any(aarch64))] asm!("{}", in("x0") foo); - //[aarch64_thirunsafeck,aarch64_mirunsafeck]~^ ERROR invalid reference to argument at index 0 + //[aarch64]~^ ERROR invalid reference to argument at index 0 asm!("{:foo}", in(reg) foo); //~^ ERROR asm template modifier must be a single character //~| WARN formatting may not be suitable for sub-register argument [asm_sub_register] diff --git a/tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr b/tests/ui/asm/bad-template.x86_64.stderr index 41ac37c33c2..52a7789b98c 100644 --- a/tests/ui/asm/bad-template.x86_64_mirunsafeck.stderr +++ b/tests/ui/asm/bad-template.x86_64.stderr @@ -1,5 +1,5 @@ error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:31:15 + --> $DIR/bad-template.rs:27:15 | LL | asm!("{}"); | ^^ from here @@ -7,7 +7,7 @@ LL | asm!("{}"); = note: no arguments were given error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:33:15 + --> $DIR/bad-template.rs:29:15 | LL | asm!("{1}", in(reg) foo); | ^^^ from here @@ -15,7 +15,7 @@ LL | asm!("{1}", in(reg) foo); = note: there is 1 argument error: argument never used - --> $DIR/bad-template.rs:33:21 + --> $DIR/bad-template.rs:29:21 | LL | asm!("{1}", in(reg) foo); | ^^^^^^^^^^^ argument never used @@ -23,13 +23,13 @@ LL | asm!("{1}", in(reg) foo); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"` error: there is no argument named `a` - --> $DIR/bad-template.rs:36:16 + --> $DIR/bad-template.rs:32:16 | LL | asm!("{a}"); | ^ error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:38:15 + --> $DIR/bad-template.rs:34:15 | LL | asm!("{}", a = in(reg) foo); | ^^ --------------- named argument @@ -38,13 +38,13 @@ LL | asm!("{}", a = in(reg) foo); | = note: no positional arguments were given note: named arguments cannot be referenced by position - --> $DIR/bad-template.rs:38:20 + --> $DIR/bad-template.rs:34:20 | LL | asm!("{}", a = in(reg) foo); | ^^^^^^^^^^^^^^^ error: named argument never used - --> $DIR/bad-template.rs:38:20 + --> $DIR/bad-template.rs:34:20 | LL | asm!("{}", a = in(reg) foo); | ^^^^^^^^^^^^^^^ named argument never used @@ -52,7 +52,7 @@ LL | asm!("{}", a = in(reg) foo); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:41:15 + --> $DIR/bad-template.rs:37:15 | LL | asm!("{1}", a = in(reg) foo); | ^^^ from here @@ -60,7 +60,7 @@ LL | asm!("{1}", a = in(reg) foo); = note: no positional arguments were given error: named argument never used - --> $DIR/bad-template.rs:41:21 + --> $DIR/bad-template.rs:37:21 | LL | asm!("{1}", a = in(reg) foo); | ^^^^^^^^^^^^^^^ named argument never used @@ -68,7 +68,7 @@ LL | asm!("{1}", a = in(reg) foo); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:45:15 + --> $DIR/bad-template.rs:41:15 | LL | asm!("{}", in("eax") foo); | ^^ ------------- explicit register argument @@ -77,24 +77,24 @@ LL | asm!("{}", in("eax") foo); | = note: no positional arguments were given note: explicit register arguments cannot be used in the asm template - --> $DIR/bad-template.rs:45:20 + --> $DIR/bad-template.rs:41:20 | LL | asm!("{}", in("eax") foo); | ^^^^^^^^^^^^^ help: use the register name directly in the assembly code - --> $DIR/bad-template.rs:45:20 + --> $DIR/bad-template.rs:41:20 | LL | asm!("{}", in("eax") foo); | ^^^^^^^^^^^^^ error: asm template modifier must be a single character - --> $DIR/bad-template.rs:50:17 + --> $DIR/bad-template.rs:46:17 | LL | asm!("{:foo}", in(reg) foo); | ^^^ error: multiple unused asm arguments - --> $DIR/bad-template.rs:53:18 + --> $DIR/bad-template.rs:49:18 | LL | asm!("", in(reg) 0, in(reg) 1); | ^^^^^^^^^ ^^^^^^^^^ argument never used @@ -104,7 +104,7 @@ LL | asm!("", in(reg) 0, in(reg) 1); = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"` error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:59:14 + --> $DIR/bad-template.rs:55:14 | LL | global_asm!("{}"); | ^^ from here @@ -112,7 +112,7 @@ LL | global_asm!("{}"); = note: no arguments were given error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:61:14 + --> $DIR/bad-template.rs:57:14 | LL | global_asm!("{1}", const FOO); | ^^^ from here @@ -120,7 +120,7 @@ LL | global_asm!("{1}", const FOO); = note: there is 1 argument error: argument never used - --> $DIR/bad-template.rs:61:20 + --> $DIR/bad-template.rs:57:20 | LL | global_asm!("{1}", const FOO); | ^^^^^^^^^ argument never used @@ -128,13 +128,13 @@ LL | global_asm!("{1}", const FOO); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"` error: there is no argument named `a` - --> $DIR/bad-template.rs:64:15 + --> $DIR/bad-template.rs:60:15 | LL | global_asm!("{a}"); | ^ error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:66:14 + --> $DIR/bad-template.rs:62:14 | LL | global_asm!("{}", a = const FOO); | ^^ ------------- named argument @@ -143,13 +143,13 @@ LL | global_asm!("{}", a = const FOO); | = note: no positional arguments were given note: named arguments cannot be referenced by position - --> $DIR/bad-template.rs:66:19 + --> $DIR/bad-template.rs:62:19 | LL | global_asm!("{}", a = const FOO); | ^^^^^^^^^^^^^ error: named argument never used - --> $DIR/bad-template.rs:66:19 + --> $DIR/bad-template.rs:62:19 | LL | global_asm!("{}", a = const FOO); | ^^^^^^^^^^^^^ named argument never used @@ -157,7 +157,7 @@ LL | global_asm!("{}", a = const FOO); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:69:14 + --> $DIR/bad-template.rs:65:14 | LL | global_asm!("{1}", a = const FOO); | ^^^ from here @@ -165,7 +165,7 @@ LL | global_asm!("{1}", a = const FOO); = note: no positional arguments were given error: named argument never used - --> $DIR/bad-template.rs:69:20 + --> $DIR/bad-template.rs:65:20 | LL | global_asm!("{1}", a = const FOO); | ^^^^^^^^^^^^^ named argument never used @@ -173,13 +173,13 @@ LL | global_asm!("{1}", a = const FOO); = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` error: asm template modifier must be a single character - --> $DIR/bad-template.rs:72:16 + --> $DIR/bad-template.rs:68:16 | LL | global_asm!("{:foo}", const FOO); | ^^^ error: multiple unused asm arguments - --> $DIR/bad-template.rs:74:17 + --> $DIR/bad-template.rs:70:17 | LL | global_asm!("", const FOO, const FOO); | ^^^^^^^^^ ^^^^^^^^^ argument never used @@ -189,7 +189,7 @@ LL | global_asm!("", const FOO, const FOO); = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"` warning: formatting may not be suitable for sub-register argument - --> $DIR/bad-template.rs:50:15 + --> $DIR/bad-template.rs:46:15 | LL | asm!("{:foo}", in(reg) foo); | ^^^^^^ --- for this argument diff --git a/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr b/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr deleted file mode 100644 index 41ac37c33c2..00000000000 --- a/tests/ui/asm/bad-template.x86_64_thirunsafeck.stderr +++ /dev/null @@ -1,202 +0,0 @@ -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:31:15 - | -LL | asm!("{}"); - | ^^ from here - | - = note: no arguments were given - -error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:33:15 - | -LL | asm!("{1}", in(reg) foo); - | ^^^ from here - | - = note: there is 1 argument - -error: argument never used - --> $DIR/bad-template.rs:33:21 - | -LL | asm!("{1}", in(reg) foo); - | ^^^^^^^^^^^ argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"` - -error: there is no argument named `a` - --> $DIR/bad-template.rs:36:16 - | -LL | asm!("{a}"); - | ^ - -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:38:15 - | -LL | asm!("{}", a = in(reg) foo); - | ^^ --------------- named argument - | | - | from here - | - = note: no positional arguments were given -note: named arguments cannot be referenced by position - --> $DIR/bad-template.rs:38:20 - | -LL | asm!("{}", a = in(reg) foo); - | ^^^^^^^^^^^^^^^ - -error: named argument never used - --> $DIR/bad-template.rs:38:20 - | -LL | asm!("{}", a = in(reg) foo); - | ^^^^^^^^^^^^^^^ named argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` - -error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:41:15 - | -LL | asm!("{1}", a = in(reg) foo); - | ^^^ from here - | - = note: no positional arguments were given - -error: named argument never used - --> $DIR/bad-template.rs:41:21 - | -LL | asm!("{1}", a = in(reg) foo); - | ^^^^^^^^^^^^^^^ named argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` - -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:45:15 - | -LL | asm!("{}", in("eax") foo); - | ^^ ------------- explicit register argument - | | - | from here - | - = note: no positional arguments were given -note: explicit register arguments cannot be used in the asm template - --> $DIR/bad-template.rs:45:20 - | -LL | asm!("{}", in("eax") foo); - | ^^^^^^^^^^^^^ -help: use the register name directly in the assembly code - --> $DIR/bad-template.rs:45:20 - | -LL | asm!("{}", in("eax") foo); - | ^^^^^^^^^^^^^ - -error: asm template modifier must be a single character - --> $DIR/bad-template.rs:50:17 - | -LL | asm!("{:foo}", in(reg) foo); - | ^^^ - -error: multiple unused asm arguments - --> $DIR/bad-template.rs:53:18 - | -LL | asm!("", in(reg) 0, in(reg) 1); - | ^^^^^^^^^ ^^^^^^^^^ argument never used - | | - | argument never used - | - = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"` - -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:59:14 - | -LL | global_asm!("{}"); - | ^^ from here - | - = note: no arguments were given - -error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:61:14 - | -LL | global_asm!("{1}", const FOO); - | ^^^ from here - | - = note: there is 1 argument - -error: argument never used - --> $DIR/bad-template.rs:61:20 - | -LL | global_asm!("{1}", const FOO); - | ^^^^^^^^^ argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {0} */"` - -error: there is no argument named `a` - --> $DIR/bad-template.rs:64:15 - | -LL | global_asm!("{a}"); - | ^ - -error: invalid reference to argument at index 0 - --> $DIR/bad-template.rs:66:14 - | -LL | global_asm!("{}", a = const FOO); - | ^^ ------------- named argument - | | - | from here - | - = note: no positional arguments were given -note: named arguments cannot be referenced by position - --> $DIR/bad-template.rs:66:19 - | -LL | global_asm!("{}", a = const FOO); - | ^^^^^^^^^^^^^ - -error: named argument never used - --> $DIR/bad-template.rs:66:19 - | -LL | global_asm!("{}", a = const FOO); - | ^^^^^^^^^^^^^ named argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` - -error: invalid reference to argument at index 1 - --> $DIR/bad-template.rs:69:14 - | -LL | global_asm!("{1}", a = const FOO); - | ^^^ from here - | - = note: no positional arguments were given - -error: named argument never used - --> $DIR/bad-template.rs:69:20 - | -LL | global_asm!("{1}", a = const FOO); - | ^^^^^^^^^^^^^ named argument never used - | - = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {a} */"` - -error: asm template modifier must be a single character - --> $DIR/bad-template.rs:72:16 - | -LL | global_asm!("{:foo}", const FOO); - | ^^^ - -error: multiple unused asm arguments - --> $DIR/bad-template.rs:74:17 - | -LL | global_asm!("", const FOO, const FOO); - | ^^^^^^^^^ ^^^^^^^^^ argument never used - | | - | argument never used - | - = help: if these arguments are intentionally unused, consider using them in an asm comment: `"/* {0} {1} */"` - -warning: formatting may not be suitable for sub-register argument - --> $DIR/bad-template.rs:50:15 - | -LL | asm!("{:foo}", in(reg) foo); - | ^^^^^^ --- for this argument - | - = help: use `{0:e}` to have the register formatted as `eax` - = help: or use `{0:r}` to keep the default formatting of `rax` - = note: `#[warn(asm_sub_register)]` on by default - -error: aborting due to 21 previous errors; 1 warning emitted - diff --git a/tests/ui/asm/x86_64/const.rs b/tests/ui/asm/x86_64/const.rs index d523ae021a5..f9a2ab6269f 100644 --- a/tests/ui/asm/x86_64/const.rs +++ b/tests/ui/asm/x86_64/const.rs @@ -1,8 +1,6 @@ // only-x86_64 // run-pass // needs-asm-support -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![feature(asm_const)] diff --git a/tests/ui/associated-consts/associated-const-type-parameters.rs b/tests/ui/associated-consts/associated-const-type-parameters.rs index e7ead1045e6..b62d47458be 100644 --- a/tests/ui/associated-consts/associated-const-type-parameters.rs +++ b/tests/ui/associated-consts/associated-const-type-parameters.rs @@ -17,7 +17,7 @@ impl Foo for Def { const X: i32 = 97; } -struct Proxy<T>(#[allow(unused_tuple_struct_fields)] T); +struct Proxy<T>(#[allow(dead_code)] T); impl<T: Foo> Foo for Proxy<T> { const X: i32 = T::X; diff --git a/tests/ui/associated-types/associated-types-method.rs b/tests/ui/associated-types/associated-types-method.rs index 45df3ac20c2..6a6456cbbec 100644 --- a/tests/ui/associated-types/associated-types-method.rs +++ b/tests/ui/associated-types/associated-types-method.rs @@ -5,7 +5,7 @@ trait Device { type Resources; } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Foo<D, R>(D, R); trait Tr { diff --git a/tests/ui/associated-types/associated-types-no-suitable-supertrait.stderr b/tests/ui/associated-types/associated-types-no-suitable-supertrait.stderr index 9ebc45387e8..5443699eb01 100644 --- a/tests/ui/associated-types/associated-types-no-suitable-supertrait.stderr +++ b/tests/ui/associated-types/associated-types-no-suitable-supertrait.stderr @@ -1,4 +1,16 @@ error[E0277]: the trait bound `(T, U): Get` is not satisfied + --> $DIR/associated-types-no-suitable-supertrait.rs:22:5 + | +LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)` + | +help: this trait has no implementations, consider adding one + --> $DIR/associated-types-no-suitable-supertrait.rs:12:1 + | +LL | trait Get { + | ^^^^^^^^^ + +error[E0277]: the trait bound `(T, U): Get` is not satisfied --> $DIR/associated-types-no-suitable-supertrait.rs:22:40 | LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {} @@ -21,18 +33,6 @@ help: consider further restricting `Self` LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {} | +++++++++++++++ -error[E0277]: the trait bound `(T, U): Get` is not satisfied - --> $DIR/associated-types-no-suitable-supertrait.rs:22:5 - | -LL | fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)` - | -help: this trait has no implementations, consider adding one - --> $DIR/associated-types-no-suitable-supertrait.rs:12:1 - | -LL | trait Get { - | ^^^^^^^^^ - error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/associated-types/associated-types-struct-field-numbered.rs b/tests/ui/associated-types/associated-types-struct-field-numbered.rs index 8612911d8f8..b71b71b25f5 100644 --- a/tests/ui/associated-types/associated-types-struct-field-numbered.rs +++ b/tests/ui/associated-types/associated-types-struct-field-numbered.rs @@ -9,7 +9,7 @@ pub trait UnifyKey { fn dummy(&self) { } } -pub struct Node<K:UnifyKey>(#[allow(unused_tuple_struct_fields)] K, K::Value); +pub struct Node<K:UnifyKey>(#[allow(dead_code)] K, K::Value); fn foo<K : UnifyKey<Value=Option<V>>,V : Clone>(node: &Node<K>) -> Option<V> { node.1.clone() diff --git a/tests/ui/associated-types/defaults-cyclic-fail-1.rs b/tests/ui/associated-types/defaults-cyclic-fail-1.rs index 61ef013236e..1ec5faca7c5 100644 --- a/tests/ui/associated-types/defaults-cyclic-fail-1.rs +++ b/tests/ui/associated-types/defaults-cyclic-fail-1.rs @@ -24,13 +24,13 @@ impl Tr for u32 { // ...but not in an impl that redefines one of the types. impl Tr for bool { type A = Box<Self::B>; - //~^ ERROR overflow evaluating the requirement `<bool as Tr>::B == _` + //~^ ERROR overflow evaluating the requirement `<bool as Tr>::A == _` } // (the error is shown twice for some reason) impl Tr for usize { type B = &'static Self::A; - //~^ ERROR overflow evaluating the requirement `<usize as Tr>::A == _` + //~^ ERROR overflow evaluating the requirement `<usize as Tr>::B == _` } fn main() { diff --git a/tests/ui/associated-types/defaults-cyclic-fail-1.stderr b/tests/ui/associated-types/defaults-cyclic-fail-1.stderr index 008eddcb29d..876fdaec296 100644 --- a/tests/ui/associated-types/defaults-cyclic-fail-1.stderr +++ b/tests/ui/associated-types/defaults-cyclic-fail-1.stderr @@ -1,10 +1,10 @@ -error[E0275]: overflow evaluating the requirement `<bool as Tr>::B == _` +error[E0275]: overflow evaluating the requirement `<bool as Tr>::A == _` --> $DIR/defaults-cyclic-fail-1.rs:26:14 | LL | type A = Box<Self::B>; | ^^^^^^^^^^^^ -error[E0275]: overflow evaluating the requirement `<usize as Tr>::A == _` +error[E0275]: overflow evaluating the requirement `<usize as Tr>::B == _` --> $DIR/defaults-cyclic-fail-1.rs:32:14 | LL | type B = &'static Self::A; diff --git a/tests/ui/associated-types/defaults-cyclic-fail-2.rs b/tests/ui/associated-types/defaults-cyclic-fail-2.rs index e91c9f2d29a..bec1bde71a1 100644 --- a/tests/ui/associated-types/defaults-cyclic-fail-2.rs +++ b/tests/ui/associated-types/defaults-cyclic-fail-2.rs @@ -25,13 +25,13 @@ impl Tr for u32 { impl Tr for bool { type A = Box<Self::B>; - //~^ ERROR overflow evaluating the requirement `<bool as Tr>::B == _` + //~^ ERROR overflow evaluating the requirement `<bool as Tr>::A == _` } // (the error is shown twice for some reason) impl Tr for usize { type B = &'static Self::A; - //~^ ERROR overflow evaluating the requirement `<usize as Tr>::A == _` + //~^ ERROR overflow evaluating the requirement `<usize as Tr>::B == _` } fn main() { diff --git a/tests/ui/associated-types/defaults-cyclic-fail-2.stderr b/tests/ui/associated-types/defaults-cyclic-fail-2.stderr index d0fbab07715..ec0c9973c0a 100644 --- a/tests/ui/associated-types/defaults-cyclic-fail-2.stderr +++ b/tests/ui/associated-types/defaults-cyclic-fail-2.stderr @@ -1,10 +1,10 @@ -error[E0275]: overflow evaluating the requirement `<bool as Tr>::B == _` +error[E0275]: overflow evaluating the requirement `<bool as Tr>::A == _` --> $DIR/defaults-cyclic-fail-2.rs:27:14 | LL | type A = Box<Self::B>; | ^^^^^^^^^^^^ -error[E0275]: overflow evaluating the requirement `<usize as Tr>::A == _` +error[E0275]: overflow evaluating the requirement `<usize as Tr>::B == _` --> $DIR/defaults-cyclic-fail-2.rs:33:14 | LL | type B = &'static Self::A; diff --git a/tests/ui/associated-types/issue-25700-1.rs b/tests/ui/associated-types/issue-25700-1.rs index 5e71a52ba4e..79652dc882b 100644 --- a/tests/ui/associated-types/issue-25700-1.rs +++ b/tests/ui/associated-types/issue-25700-1.rs @@ -1,5 +1,5 @@ // run-pass -struct S<T: 'static>(#[allow(unused_tuple_struct_fields)] Option<&'static T>); +struct S<T: 'static>(#[allow(dead_code)] Option<&'static T>); trait Tr { type Out; } impl<T> Tr for T { type Out = T; } diff --git a/tests/ui/associated-types/issue-25700-2.rs b/tests/ui/associated-types/issue-25700-2.rs index 89b1db496f9..f745da4a5cb 100644 --- a/tests/ui/associated-types/issue-25700-2.rs +++ b/tests/ui/associated-types/issue-25700-2.rs @@ -3,9 +3,9 @@ pub trait Parser { type Input; } -pub struct Iter<P: Parser>(#[allow(unused_tuple_struct_fields)] P, P::Input); +pub struct Iter<P: Parser>(#[allow(dead_code)] P, P::Input); -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] pub struct Map<P, F>(P, F); impl<P, F> Parser for Map<P, F> where F: FnMut(P) { type Input = u8; diff --git a/tests/ui/associated-types/issue-25700.rs b/tests/ui/associated-types/issue-25700.rs index e5b9a97523d..a377e37349d 100644 --- a/tests/ui/associated-types/issue-25700.rs +++ b/tests/ui/associated-types/issue-25700.rs @@ -1,4 +1,4 @@ -struct S<T: 'static>(#[allow(unused_tuple_struct_fields)] Option<&'static T>); +struct S<T: 'static>(#[allow(dead_code)] Option<&'static T>); trait Tr { type Out; } impl<T> Tr for T { type Out = T; } diff --git a/tests/ui/async-await/async-await.rs b/tests/ui/async-await/async-await.rs index 9cabf16f8bb..63941a79139 100644 --- a/tests/ui/async-await/async-await.rs +++ b/tests/ui/async-await/async-await.rs @@ -1,8 +1,7 @@ // run-pass -// revisions: default nomiropt thirunsafeck +// revisions: default nomiropt //[nomiropt]compile-flags: -Z mir-opt-level=0 -//[thirunsafeck]compile-flags: -Zthir-unsafeck #![allow(unused)] diff --git a/tests/ui/async-await/async-fn-size-moved-locals.rs b/tests/ui/async-await/async-fn-size-moved-locals.rs index 79b7239f359..fb64bb6db63 100644 --- a/tests/ui/async-await/async-fn-size-moved-locals.rs +++ b/tests/ui/async-await/async-fn-size-moved-locals.rs @@ -17,7 +17,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; const BIG_FUT_SIZE: usize = 1024; -struct BigFut(#[allow(unused_tuple_struct_fields)] [u8; BIG_FUT_SIZE]); +struct BigFut(#[allow(dead_code)] [u8; BIG_FUT_SIZE]); impl BigFut { fn new() -> Self { diff --git a/tests/ui/async-await/async-fn-size-uninit-locals.rs b/tests/ui/async-await/async-fn-size-uninit-locals.rs index 54617269354..fee3e27cfb8 100644 --- a/tests/ui/async-await/async-fn-size-uninit-locals.rs +++ b/tests/ui/async-await/async-fn-size-uninit-locals.rs @@ -17,7 +17,7 @@ use std::pin::Pin; use std::task::{Context, Poll}; const BIG_FUT_SIZE: usize = 1024; -struct Big(#[allow(unused_tuple_struct_fields)] [u8; BIG_FUT_SIZE]); +struct Big(#[allow(dead_code)] [u8; BIG_FUT_SIZE]); impl Big { fn new() -> Self { diff --git a/tests/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr b/tests/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr deleted file mode 100644 index f9e5bf675cb..00000000000 --- a/tests/ui/async-await/async-unsafe-fn-call-in-safe.mir.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/async-unsafe-fn-call-in-safe.rs:14:5 - | -LL | S::f(); - | ^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/async-unsafe-fn-call-in-safe.rs:17:5 - | -LL | f(); - | ^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/async-unsafe-fn-call-in-safe.rs:23:5 - | -LL | S::f(); - | ^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/async-unsafe-fn-call-in-safe.rs:26:5 - | -LL | f(); - | ^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/async-await/async-unsafe-fn-call-in-safe.rs b/tests/ui/async-await/async-unsafe-fn-call-in-safe.rs index 14cc0dc614f..7695853000d 100644 --- a/tests/ui/async-await/async-unsafe-fn-call-in-safe.rs +++ b/tests/ui/async-await/async-unsafe-fn-call-in-safe.rs @@ -1,6 +1,4 @@ // edition:2018 -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck struct S; @@ -12,18 +10,14 @@ async unsafe fn f() {} async fn g() { S::f(); - //[mir]~^ ERROR call to unsafe function is unsafe - //[thir]~^^ ERROR call to unsafe function `S::f` is unsafe + //~^ ERROR call to unsafe function `S::f` is unsafe f(); - //[mir]~^ ERROR call to unsafe function is unsafe - //[thir]~^^ ERROR call to unsafe function `f` is unsafe + //~^ ERROR call to unsafe function `f` is unsafe } fn main() { S::f(); - //[mir]~^ ERROR call to unsafe function is unsafe - //[thir]~^^ ERROR call to unsafe function `S::f` is unsafe + //~^ ERROR call to unsafe function `S::f` is unsafe f(); - //[mir]~^ ERROR call to unsafe function is unsafe - //[thir]~^^ ERROR call to unsafe function `f` is unsafe + //~^ ERROR call to unsafe function `f` is unsafe } diff --git a/tests/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr b/tests/ui/async-await/async-unsafe-fn-call-in-safe.stderr index ba3303fe793..b25794c0892 100644 --- a/tests/ui/async-await/async-unsafe-fn-call-in-safe.thir.stderr +++ b/tests/ui/async-await/async-unsafe-fn-call-in-safe.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `S::f` is unsafe and requires unsafe function or block - --> $DIR/async-unsafe-fn-call-in-safe.rs:14:5 + --> $DIR/async-unsafe-fn-call-in-safe.rs:12:5 | LL | S::f(); | ^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | S::f(); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block - --> $DIR/async-unsafe-fn-call-in-safe.rs:17:5 + --> $DIR/async-unsafe-fn-call-in-safe.rs:14:5 | LL | f(); | ^^^ call to unsafe function @@ -15,7 +15,7 @@ LL | f(); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `S::f` is unsafe and requires unsafe function or block - --> $DIR/async-unsafe-fn-call-in-safe.rs:23:5 + --> $DIR/async-unsafe-fn-call-in-safe.rs:19:5 | LL | S::f(); | ^^^^^^ call to unsafe function @@ -23,7 +23,7 @@ LL | S::f(); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block - --> $DIR/async-unsafe-fn-call-in-safe.rs:26:5 + --> $DIR/async-unsafe-fn-call-in-safe.rs:21:5 | LL | f(); | ^^^ call to unsafe function diff --git a/tests/ui/async-await/issue-66312.stderr b/tests/ui/async-await/issue-66312.stderr index dad5807cb50..2875af8a97e 100644 --- a/tests/ui/async-await/issue-66312.stderr +++ b/tests/ui/async-await/issue-66312.stderr @@ -1,3 +1,9 @@ +error[E0308]: mismatched types + --> $DIR/issue-66312.rs:9:8 + | +LL | if x.is_some() { + | ^^^^^^^^^^^ expected `bool`, found `()` + error[E0307]: invalid `self` parameter type: T --> $DIR/issue-66312.rs:4:22 | @@ -7,12 +13,6 @@ LL | fn is_some(self: T); = note: type of `self` must be `Self` or a type that dereferences to it = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`) -error[E0308]: mismatched types - --> $DIR/issue-66312.rs:9:8 - | -LL | if x.is_some() { - | ^^^^^^^^^^^ expected `bool`, found `()` - error: aborting due to 2 previous errors Some errors have detailed explanations: E0307, E0308. diff --git a/tests/ui/auto-traits/auto-traits.rs b/tests/ui/auto-traits/auto-traits.rs index 7b52d9c176e..6d8e1a52ec1 100644 --- a/tests/ui/auto-traits/auto-traits.rs +++ b/tests/ui/auto-traits/auto-traits.rs @@ -9,7 +9,7 @@ unsafe auto trait AutoUnsafe {} impl !Auto for bool {} impl !AutoUnsafe for bool {} -struct AutoBool(#[allow(unused_tuple_struct_fields)] bool); +struct AutoBool(#[allow(dead_code)] bool); impl Auto for AutoBool {} unsafe impl AutoUnsafe for AutoBool {} diff --git a/tests/ui/bench/issue-32062.rs b/tests/ui/bench/issue-32062.rs index 7eb52196e16..99b8b7c6012 100644 --- a/tests/ui/bench/issue-32062.rs +++ b/tests/ui/bench/issue-32062.rs @@ -15,7 +15,7 @@ trait Parser { } } -struct Token<T>(#[allow(unused_tuple_struct_fields)] T::Item) where T: Iterator; +struct Token<T>(#[allow(dead_code)] T::Item) where T: Iterator; impl<T> Parser for Token<T> where T: Iterator { type Input = T; @@ -25,7 +25,7 @@ impl<T> Parser for Token<T> where T: Iterator { } } -struct Chain<L, R>(#[allow(unused_tuple_struct_fields)] L, #[allow(unused_tuple_struct_fields)] R); +struct Chain<L, R>(#[allow(dead_code)] L, #[allow(dead_code)] R); impl<L, R> Parser for Chain<L, R> where L: Parser, R: Parser<Input = L::Input> { type Input = L::Input; diff --git a/tests/ui/binding/issue-53114-safety-checks.stderr b/tests/ui/binding/issue-53114-safety-checks.stderr index 349c4639a9e..b7d805d9171 100644 --- a/tests/ui/binding/issue-53114-safety-checks.stderr +++ b/tests/ui/binding/issue-53114-safety-checks.stderr @@ -1,63 +1,3 @@ -error[E0793]: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:23:13 - | -LL | let _ = &p.b; - | ^^^^ - | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses - = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - -error[E0793]: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:28:17 - | -LL | let (_,) = (&p.b,); - | ^^^^ - | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses - = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - -error[E0793]: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:37:16 - | -LL | let _: _ = &p.b; - | ^^^^ - | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses - = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - -error[E0793]: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:42:20 - | -LL | let (_,): _ = (&p.b,); - | ^^^^ - | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses - = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - -error[E0793]: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:51:11 - | -LL | match &p.b { _ => { } } - | ^^^^ - | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses - = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - -error[E0793]: reference to packed field is unaligned - --> $DIR/issue-53114-safety-checks.rs:56:12 - | -LL | match (&p.b,) { (_,) => { } } - | ^^^^ - | - = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses - = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) - error[E0133]: access to union field is unsafe and requires unsafe function or block --> $DIR/issue-53114-safety-checks.rs:24:13 | @@ -67,10 +7,10 @@ LL | let _ = u1.a; = 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/issue-53114-safety-checks.rs:25:13 + --> $DIR/issue-53114-safety-checks.rs:25:14 | LL | let _ = &u2.a; - | ^^^^^ access to union field + | ^^^^ access to union field | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior @@ -83,13 +23,33 @@ LL | let (_,) = (u1.a,); = 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/issue-53114-safety-checks.rs:30:17 + --> $DIR/issue-53114-safety-checks.rs:30:18 | LL | let (_,) = (&u2.a,); - | ^^^^^ access to union field + | ^^^^ access to union field | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-53114-safety-checks.rs:23:13 + | +LL | let _ = &p.b; + | ^^^^ + | + = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses + = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) + +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-53114-safety-checks.rs:28:17 + | +LL | let (_,) = (&p.b,); + | ^^^^ + | + = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses + = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) + error[E0133]: access to union field is unsafe and requires unsafe function or block --> $DIR/issue-53114-safety-checks.rs:38:16 | @@ -99,10 +59,10 @@ LL | let _: _ = u1.a; = 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/issue-53114-safety-checks.rs:39:16 + --> $DIR/issue-53114-safety-checks.rs:39:17 | LL | let _: _ = &u2.a; - | ^^^^^ access to union field + | ^^^^ access to union field | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior @@ -115,13 +75,33 @@ LL | let (_,): _ = (u1.a,); = 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/issue-53114-safety-checks.rs:44:20 + --> $DIR/issue-53114-safety-checks.rs:44:21 | LL | let (_,): _ = (&u2.a,); - | ^^^^^ access to union field + | ^^^^ access to union field | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-53114-safety-checks.rs:37:16 + | +LL | let _: _ = &p.b; + | ^^^^ + | + = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses + = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) + +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-53114-safety-checks.rs:42:20 + | +LL | let (_,): _ = (&p.b,); + | ^^^^ + | + = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses + = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) + error[E0133]: access to union field is unsafe and requires unsafe function or block --> $DIR/issue-53114-safety-checks.rs:52:11 | @@ -131,10 +111,10 @@ LL | match u1.a { _ => { } } = 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/issue-53114-safety-checks.rs:53:11 + --> $DIR/issue-53114-safety-checks.rs:53:12 | LL | match &u2.a { _ => { } } - | ^^^^^ access to union field + | ^^^^ access to union field | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior @@ -147,13 +127,33 @@ LL | match (u1.a,) { (_,) => { } } = 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/issue-53114-safety-checks.rs:58:12 + --> $DIR/issue-53114-safety-checks.rs:58:13 | LL | match (&u2.a,) { (_,) => { } } - | ^^^^^ access to union field + | ^^^^ access to union field | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-53114-safety-checks.rs:51:11 + | +LL | match &p.b { _ => { } } + | ^^^^ + | + = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses + = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) + +error[E0793]: reference to packed field is unaligned + --> $DIR/issue-53114-safety-checks.rs:56:12 + | +LL | match (&p.b,) { (_,) => { } } + | ^^^^ + | + = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses + = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) + error: aborting due to 18 previous errors Some errors have detailed explanations: E0133, E0793. diff --git a/tests/ui/binding/match-tag.rs b/tests/ui/binding/match-tag.rs index 407716aa28a..6914a1c6b6d 100644 --- a/tests/ui/binding/match-tag.rs +++ b/tests/ui/binding/match-tag.rs @@ -3,7 +3,7 @@ #![allow(non_camel_case_types)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum color { rgb(isize, isize, isize), rgba(isize, isize, isize, isize), diff --git a/tests/ui/binding/or-pattern.rs b/tests/ui/binding/or-pattern.rs index 47623a3d722..07559e414dc 100644 --- a/tests/ui/binding/or-pattern.rs +++ b/tests/ui/binding/or-pattern.rs @@ -1,7 +1,7 @@ // run-pass #![allow(non_camel_case_types)] -enum blah { a(isize, isize, #[allow(unused_tuple_struct_fields)] usize), b(isize, isize), c, } +enum blah { a(isize, isize, #[allow(dead_code)] usize), b(isize, isize), c, } fn or_alt(q: blah) -> isize { match q { blah::a(x, y, _) | blah::b(x, y) => { return x + y; } blah::c => { return 0; } } diff --git a/tests/ui/binding/simple-generic-match.rs b/tests/ui/binding/simple-generic-match.rs index 2cf050d011d..acac32b8231 100644 --- a/tests/ui/binding/simple-generic-match.rs +++ b/tests/ui/binding/simple-generic-match.rs @@ -3,6 +3,6 @@ // pretty-expanded FIXME #23616 -enum clam<T> { a(#[allow(unused_tuple_struct_fields)] T), } +enum clam<T> { a(#[allow(dead_code)] T), } pub fn main() { let c = clam::a(2); match c { clam::a::<isize>(_) => { } } } diff --git a/tests/ui/builtin-superkinds/builtin-superkinds-in-metadata2.rs b/tests/ui/builtin-superkinds/builtin-superkinds-in-metadata2.rs index cdde48871ea..2edc52c6f55 100644 --- a/tests/ui/builtin-superkinds/builtin-superkinds-in-metadata2.rs +++ b/tests/ui/builtin-superkinds/builtin-superkinds-in-metadata2.rs @@ -12,7 +12,7 @@ use trait_superkinds_in_metadata::RequiresCopy; use std::marker; #[derive(Copy, Clone)] -struct X<T>(#[allow(unused_tuple_struct_fields)] T); +struct X<T>(#[allow(dead_code)] T); impl<T:Sync> RequiresShare for X<T> { } diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed index b74b5e94e2b..e8ca5ccdc54 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.fixed @@ -51,10 +51,10 @@ fn test_sync_trait() { } /* Test Clone Trait Migration */ -struct S(Foo); +struct S(#[allow(dead_code)] Foo); struct T(i32); -struct U(S, T); +struct U(#[allow(dead_code)] S, T); impl Clone for U { fn clone(&self) -> Self { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs index e4965e33cc1..fb464b7f1e1 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/auto_traits.rs @@ -51,10 +51,10 @@ fn test_sync_trait() { } /* Test Clone Trait Migration */ -struct S(Foo); +struct S(#[allow(dead_code)] Foo); struct T(i32); -struct U(S, T); +struct U(#[allow(dead_code)] S, T); impl Clone for U { fn clone(&self) -> Self { diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed index bde8c749731..7c4e5c0f9a5 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.fixed @@ -18,10 +18,10 @@ impl Foo { } } -struct S(#[allow(unused_tuple_struct_fields)] Foo); +struct S(#[allow(dead_code)] Foo); #[derive(Clone)] -struct T(#[allow(unused_tuple_struct_fields)] i32); +struct T(#[allow(dead_code)] i32); struct U(S, T); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs index 584c52ea134..f979db11b7e 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/multi_diagnostics.rs @@ -18,10 +18,10 @@ impl Foo { } } -struct S(#[allow(unused_tuple_struct_fields)] Foo); +struct S(#[allow(dead_code)] Foo); #[derive(Clone)] -struct T(#[allow(unused_tuple_struct_fields)] i32); +struct T(#[allow(dead_code)] i32); struct U(S, T); diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed index e99dbb5ab3a..672aa4be686 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.fixed @@ -13,7 +13,7 @@ impl Drop for Foo { } #[derive(Debug)] -struct ConstainsDropField(Foo, #[allow(unused_tuple_struct_fields)] Foo); +struct ConstainsDropField(Foo, #[allow(dead_code)] Foo); // `t` needs Drop because one of its elements needs drop, // therefore precise capture might affect drop ordering diff --git a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs index 62a984c9eeb..9c751064688 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/significant_drop.rs @@ -13,7 +13,7 @@ impl Drop for Foo { } #[derive(Debug)] -struct ConstainsDropField(Foo, #[allow(unused_tuple_struct_fields)] Foo); +struct ConstainsDropField(Foo, #[allow(dead_code)] Foo); // `t` needs Drop because one of its elements needs drop, // therefore precise capture might affect drop ordering diff --git a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.rs b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.rs index bdb3eb23c38..76a0f291410 100644 --- a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.rs +++ b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - // Ensure we get unsafe function after coercion unsafe fn add(a: i32, b: i32) -> i32 { a + b diff --git a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.mir.stderr b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.stderr index 2f9c7973b5a..190b4792ebc 100644 --- a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.mir.stderr +++ b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:15:23 + --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:12:23 | LL | let result: i32 = foo(5, 5); | ^^^^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | let result: i32 = foo(5, 5); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:24:23 + --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:21:23 | LL | let result: i32 = foo(5, 5); | ^^^^^^^^^ call to unsafe function diff --git a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.thir.stderr b/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.thir.stderr deleted file mode 100644 index 2f9c7973b5a..00000000000 --- a/tests/ui/closures/closure_no_cap_coerce_many_unsafe_0.thir.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:15:23 - | -LL | let result: i32 = foo(5, 5); - | ^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/closure_no_cap_coerce_many_unsafe_0.rs:24:23 - | -LL | let result: i32 = foo(5, 5); - | ^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr deleted file mode 100644 index 57922770310..00000000000 --- a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:5:31 - | -LL | let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.rs b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.rs index 57358fbdd84..36777693fab 100644 --- a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.rs +++ b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - fn main() { let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); }; //~^ ERROR E0133 diff --git a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr index fb237231d65..f5cb3e2b5f8 100644 --- a/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.thir.stderr +++ b/tests/ui/closures/coerce-unsafe-closure-to-unsafe-fn-ptr.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `Pin::<P>::new_unchecked` is unsafe and requires unsafe function or block - --> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:5:31 + --> $DIR/coerce-unsafe-closure-to-unsafe-fn-ptr.rs:2:31 | LL | let _: unsafe fn() = || { ::std::pin::Pin::new_unchecked(&0_u8); }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/closures/thir-unsafeck-issue-85871.rs b/tests/ui/closures/thir-unsafeck-issue-85871.rs index aea539b74df..a4a487c4dc2 100644 --- a/tests/ui/closures/thir-unsafeck-issue-85871.rs +++ b/tests/ui/closures/thir-unsafeck-issue-85871.rs @@ -1,6 +1,5 @@ // Tests that no ICE occurs when a closure appears inside a node // that does not have a body when compiling with -// compile-flags: -Zthir-unsafeck=yes // check-pass #![allow(dead_code)] diff --git a/tests/ui/codegen/issue-16602-3.rs b/tests/ui/codegen/issue-16602-3.rs index ca1ab3cc7fe..2307cfb81c7 100644 --- a/tests/ui/codegen/issue-16602-3.rs +++ b/tests/ui/codegen/issue-16602-3.rs @@ -2,7 +2,7 @@ #![allow(unused_variables)] #![allow(unused_assignments)] #[derive(Debug)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum Foo { Bar(u32, u32), Baz(&'static u32, &'static u32) diff --git a/tests/ui/coercion/issue-14589.rs b/tests/ui/coercion/issue-14589.rs index d35ee5c731e..f92385f8d72 100644 --- a/tests/ui/coercion/issue-14589.rs +++ b/tests/ui/coercion/issue-14589.rs @@ -20,5 +20,5 @@ impl<T> Test<T> { } trait Foo { fn dummy(&self) { }} -struct Output(#[allow(unused_tuple_struct_fields)] isize); +struct Output(#[allow(dead_code)] isize); impl Foo for Output {} diff --git a/tests/ui/command/command-pre-exec.rs b/tests/ui/command/command-pre-exec.rs index d366c5ffbfd..e8a909eecc1 100644 --- a/tests/ui/command/command-pre-exec.rs +++ b/tests/ui/command/command-pre-exec.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck #![allow(stable_features)] // ignore-windows - this is a unix-specific test diff --git a/tests/ui/const-generics/const-argument-cross-crate.rs b/tests/ui/const-generics/const-argument-cross-crate.rs index 5693409e992..ff9cebdf7ec 100644 --- a/tests/ui/const-generics/const-argument-cross-crate.rs +++ b/tests/ui/const-generics/const-argument-cross-crate.rs @@ -4,7 +4,7 @@ extern crate const_generic_lib; -struct Container(#[allow(unused_tuple_struct_fields)] const_generic_lib::Alias); +struct Container(#[allow(dead_code)] const_generic_lib::Alias); fn main() { let res = const_generic_lib::function(const_generic_lib::Struct([14u8, 1u8, 2u8])); diff --git a/tests/ui/const-generics/generic_const_exprs/associated-consts.rs b/tests/ui/const-generics/generic_const_exprs/associated-consts.rs index b839008d424..3bc72fe7faa 100644 --- a/tests/ui/const-generics/generic_const_exprs/associated-consts.rs +++ b/tests/ui/const-generics/generic_const_exprs/associated-consts.rs @@ -16,7 +16,7 @@ impl BlockCipher for BarCipher { const BLOCK_SIZE: usize = 32; } -pub struct Block<C>(#[allow(unused_tuple_struct_fields)] C); +pub struct Block<C>(#[allow(dead_code)] C); pub fn test<C: BlockCipher, const M: usize>() where diff --git a/tests/ui/const-generics/inhabited-assoc-ty-ice-1.rs b/tests/ui/const-generics/inhabited-assoc-ty-ice-1.rs index b385406b020..b4f44dac62d 100644 --- a/tests/ui/const-generics/inhabited-assoc-ty-ice-1.rs +++ b/tests/ui/const-generics/inhabited-assoc-ty-ice-1.rs @@ -9,7 +9,7 @@ trait Foo { const ASSOC: usize = 1; } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Iced<T: Foo>(T, [(); T::ASSOC]) where [(); T::ASSOC]: ; diff --git a/tests/ui/const-generics/inhabited-assoc-ty-ice-2.rs b/tests/ui/const-generics/inhabited-assoc-ty-ice-2.rs index 216d29c7cd4..d6d0a80ab11 100644 --- a/tests/ui/const-generics/inhabited-assoc-ty-ice-2.rs +++ b/tests/ui/const-generics/inhabited-assoc-ty-ice-2.rs @@ -9,7 +9,7 @@ trait Foo { const ASSOC: usize = 1; } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Iced<T: Foo>(T, [(); T::ASSOC]) where [(); T::ASSOC]: ; diff --git a/tests/ui/const-generics/issues/issue-83765.rs b/tests/ui/const-generics/issues/issue-83765.rs index 71c164ab0a5..0959f771c22 100644 --- a/tests/ui/const-generics/issues/issue-83765.rs +++ b/tests/ui/const-generics/issues/issue-83765.rs @@ -4,6 +4,7 @@ trait TensorDimension { const DIM: usize; //~^ ERROR cycle detected when resolving instance + //~| ERROR cycle detected when resolving instance // FIXME Given the current state of the compiler its expected that we cycle here, // but the cycle is still wrong. const ISSCALAR: bool = Self::DIM == 0; @@ -79,6 +80,7 @@ impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> TensorSi for BMap<'a, R, T, F, DIM> { fn size(&self) -> [usize; DIM] { + //~^ ERROR: method not compatible with trait self.reference.size() } } @@ -88,6 +90,7 @@ impl<'a, R, T: Broadcastable, F: Fn(T::Element) -> R, const DIM: usize> Broadcas { type Element = R; fn bget(&self, index: [usize; DIM]) -> Option<Self::Element> { + //~^ ERROR: method not compatible with trait self.reference.bget(index).map(&self.closure) } } diff --git a/tests/ui/const-generics/issues/issue-83765.stderr b/tests/ui/const-generics/issues/issue-83765.stderr index d9956875cf8..c3292314f23 100644 --- a/tests/ui/const-generics/issues/issue-83765.stderr +++ b/tests/ui/const-generics/issues/issue-83765.stderr @@ -17,6 +17,44 @@ LL | trait TensorDimension { | ^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error: aborting due to 1 previous error +error[E0391]: cycle detected when resolving instance `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>::DIM` + --> $DIR/issue-83765.rs:5:5 + | +LL | const DIM: usize; + | ^^^^^^^^^^^^^^^^ + | +note: ...which requires computing candidate for `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>`... + --> $DIR/issue-83765.rs:4:1 + | +LL | trait TensorDimension { + | ^^^^^^^^^^^^^^^^^^^^^ + = note: ...which again requires resolving instance `<LazyUpdim<'_, T, <T as TensorDimension>::DIM, DIM> as TensorDimension>::DIM`, completing the cycle +note: cycle used when checking that `<impl at $DIR/issue-83765.rs:56:1: 56:97>` is well-formed + --> $DIR/issue-83765.rs:56:1 + | +LL | impl<'a, T: Broadcastable, const DIM: usize> Broadcastable for LazyUpdim<'a, T, { T::DIM }, DIM> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information + +error[E0308]: method not compatible with trait + --> $DIR/issue-83765.rs:82:5 + | +LL | fn size(&self) -> [usize; DIM] { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM` + | + = note: expected constant `Self::DIM` + found constant `DIM` + +error[E0308]: method not compatible with trait + --> $DIR/issue-83765.rs:92:5 + | +LL | fn bget(&self, index: [usize; DIM]) -> Option<Self::Element> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Self::DIM`, found `DIM` + | + = note: expected constant `Self::DIM` + found constant `DIM` + +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0391`. +Some errors have detailed explanations: E0308, E0391. +For more information about an error, try `rustc --explain E0308`. diff --git a/tests/ui/consts/assoc-const.rs b/tests/ui/consts/assoc-const.rs index f542f2dcb52..021bcb40102 100644 --- a/tests/ui/consts/assoc-const.rs +++ b/tests/ui/consts/assoc-const.rs @@ -6,7 +6,7 @@ trait Nat { } struct Zero; -struct Succ<N>(#[allow(unused_tuple_struct_fields)] N); +struct Succ<N>(#[allow(dead_code)] N); impl Nat for Zero { const VALUE: usize = 0; diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs b/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs index 6c4f0a5accf..95fb9ef4260 100644 --- a/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs +++ b/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.rs @@ -1,15 +1,12 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #![feature(const_extern_fn)] -const unsafe extern "C" fn foo() -> usize { 5 } +const unsafe extern "C" fn foo() -> usize { + 5 +} fn main() { let a: [u8; foo()]; - //[mir]~^ call to unsafe function is unsafe and requires unsafe function or block - //[thir]~^^ call to unsafe function `foo` is unsafe and requires unsafe function or block + //~^ call to unsafe function `foo` is unsafe and requires unsafe function or block foo(); - //[mir]~^ ERROR call to unsafe function is unsafe and requires unsafe function or block - //[thir]~^^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block + //~^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block } diff --git a/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.stderr b/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.stderr new file mode 100644 index 00000000000..6f59b2f2055 --- /dev/null +++ b/tests/ui/consts/const-extern-fn/const-extern-fn-requires-unsafe.stderr @@ -0,0 +1,19 @@ +error[E0133]: call to unsafe function `foo` is unsafe and requires unsafe function or block + --> $DIR/const-extern-fn-requires-unsafe.rs:10:5 + | +LL | foo(); + | ^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error[E0133]: call to unsafe function `foo` is unsafe and requires unsafe function or block + --> $DIR/const-extern-fn-requires-unsafe.rs:8:17 + | +LL | let a: [u8; foo()]; + | ^^^^^ call to unsafe function + | + = note: consult the function's documentation for information on how to avoid undefined behavior + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/consts/const-needs_drop.rs b/tests/ui/consts/const-needs_drop.rs index 11ee7084ce8..bf622e38939 100644 --- a/tests/ui/consts/const-needs_drop.rs +++ b/tests/ui/consts/const-needs_drop.rs @@ -2,10 +2,10 @@ use std::mem; -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Trivial(u8, f32); -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct NonTrivial(u8, String); const CONST_U8: bool = mem::needs_drop::<u8>(); diff --git a/tests/ui/consts/const-size_of_val-align_of_val.rs b/tests/ui/consts/const-size_of_val-align_of_val.rs index e8323e4ae60..cd678176761 100644 --- a/tests/ui/consts/const-size_of_val-align_of_val.rs +++ b/tests/ui/consts/const-size_of_val-align_of_val.rs @@ -5,7 +5,7 @@ use std::{mem, ptr}; -struct Foo(#[allow(unused_tuple_struct_fields)] u32); +struct Foo(#[allow(dead_code)] u32); #[derive(Clone, Copy)] struct Bar { diff --git a/tests/ui/consts/const-unsized.stderr b/tests/ui/consts/const-unsized.stderr index 674f0cb99e7..f70c9b2e077 100644 --- a/tests/ui/consts/const-unsized.stderr +++ b/tests/ui/consts/const-unsized.stderr @@ -6,39 +6,23 @@ LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync)); | = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/const-unsized.rs:7:18 - | -LL | const CONST_FOO: str = *"foo"; - | ^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `str` - error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time - --> $DIR/const-unsized.rs:11:18 + --> $DIR/const-unsized.rs:3:35 | -LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); - | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time +LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync)); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` + = note: constant expressions must have a statically known size error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/const-unsized.rs:15:20 + --> $DIR/const-unsized.rs:7:18 | -LL | static STATIC_BAR: str = *"bar"; - | ^^^ doesn't have a size known at compile-time +LL | const CONST_FOO: str = *"foo"; + | ^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `str` -error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time - --> $DIR/const-unsized.rs:3:35 - | -LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` - = note: constant expressions must have a statically known size - error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/const-unsized.rs:7:24 | @@ -49,6 +33,14 @@ LL | const CONST_FOO: str = *"foo"; = note: constant expressions must have a statically known size error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time + --> $DIR/const-unsized.rs:11:18 + | +LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); + | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` + +error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time --> $DIR/const-unsized.rs:11:37 | LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); @@ -58,6 +50,14 @@ LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); = note: constant expressions must have a statically known size error[E0277]: the size for values of type `str` cannot be known at compilation time + --> $DIR/const-unsized.rs:15:20 + | +LL | static STATIC_BAR: str = *"bar"; + | ^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `str` + +error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/const-unsized.rs:15:26 | LL | static STATIC_BAR: str = *"bar"; diff --git a/tests/ui/consts/const_in_pattern/null-raw-ptr-issue-119270.rs b/tests/ui/consts/const_in_pattern/null-raw-ptr-issue-119270.rs index 03e91f2b3b1..436a2d0de74 100644 --- a/tests/ui/consts/const_in_pattern/null-raw-ptr-issue-119270.rs +++ b/tests/ui/consts/const_in_pattern/null-raw-ptr-issue-119270.rs @@ -1,7 +1,7 @@ // run-pass // Eventually this will be rejected (when the future-compat lints are turned into hard errors), and // then this test can be removed. But meanwhile we should ensure that this works and does not ICE. -struct NoDerive(i32); +struct NoDerive(#[allow(dead_code)] i32); #[derive(PartialEq)] struct WrapEmbedded(*const NoDerive); diff --git a/tests/ui/consts/const_in_pattern/warn_corner_cases.rs b/tests/ui/consts/const_in_pattern/warn_corner_cases.rs index 15cf3c84d85..d23d85335f8 100644 --- a/tests/ui/consts/const_in_pattern/warn_corner_cases.rs +++ b/tests/ui/consts/const_in_pattern/warn_corner_cases.rs @@ -15,7 +15,7 @@ #![warn(indirect_structural_match)] #[derive(Copy, Clone, Debug)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] u32); +struct NoDerive(#[allow(dead_code)] u32); // This impl makes `NoDerive` irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/consts/issue-16538.mir.stderr b/tests/ui/consts/issue-16538.mir.stderr deleted file mode 100644 index e320df4b7ad..00000000000 --- a/tests/ui/consts/issue-16538.mir.stderr +++ /dev/null @@ -1,29 +0,0 @@ -error[E0015]: cannot call non-const fn `Y::foo` in statics - --> $DIR/issue-16538.rs:14:23 - | -LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: calls in statics are limited to constant functions, tuple structs and tuple variants - = note: consider wrapping this expression in `Lazy::new(|| ...)` from the `once_cell` crate: https://crates.io/crates/once_cell - -error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/issue-16538.rs:14:30 - | -LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); - | ^^^^ use of extern static - | - = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior - -error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-16538.rs:14:21 - | -LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 3 previous errors - -Some errors have detailed explanations: E0015, E0133. -For more information about an error, try `rustc --explain E0015`. diff --git a/tests/ui/consts/issue-16538.rs b/tests/ui/consts/issue-16538.rs index 270fa301414..31f334fb405 100644 --- a/tests/ui/consts/issue-16538.rs +++ b/tests/ui/consts/issue-16538.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - mod Y { pub type X = usize; extern "C" { diff --git a/tests/ui/consts/issue-16538.thir.stderr b/tests/ui/consts/issue-16538.stderr index 4a862869274..834ffa8d3a0 100644 --- a/tests/ui/consts/issue-16538.thir.stderr +++ b/tests/ui/consts/issue-16538.stderr @@ -1,5 +1,5 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-16538.rs:14:22 + --> $DIR/issue-16538.rs:11:22 | LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer @@ -7,7 +7,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); = 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[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/issue-16538.rs:14:30 + --> $DIR/issue-16538.rs:11:30 | LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); | ^^^^ use of extern static @@ -15,7 +15,7 @@ LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior error[E0015]: cannot call non-const fn `Y::foo` in statics - --> $DIR/issue-16538.rs:14:23 + --> $DIR/issue-16538.rs:11:23 | LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/issue-39974.stderr b/tests/ui/consts/issue-39974.stderr index 4bde599039e..114c4cfeaf7 100644 --- a/tests/ui/consts/issue-39974.stderr +++ b/tests/ui/consts/issue-39974.stderr @@ -1,10 +1,4 @@ error[E0308]: mismatched types - --> $DIR/issue-39974.rs:5:19 - | -LL | f: [[f64; 2]; LENGTH], - | ^^^^^^ expected `usize`, found `f64` - -error[E0308]: mismatched types --> $DIR/issue-39974.rs:1:21 | LL | const LENGTH: f64 = 2; @@ -13,6 +7,12 @@ LL | const LENGTH: f64 = 2; | expected `f64`, found integer | help: use a float literal: `2.0` +error[E0308]: mismatched types + --> $DIR/issue-39974.rs:5:19 + | +LL | f: [[f64; 2]; LENGTH], + | ^^^^^^ expected `usize`, found `f64` + error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/consts/issue-70773-mir-typeck-lt-norm.rs b/tests/ui/consts/issue-70773-mir-typeck-lt-norm.rs index dd56faa3185..f82ec005a01 100644 --- a/tests/ui/consts/issue-70773-mir-typeck-lt-norm.rs +++ b/tests/ui/consts/issue-70773-mir-typeck-lt-norm.rs @@ -1,7 +1,7 @@ // run-pass const HASH_LEN: usize = 20; -struct Hash(#[allow(unused_tuple_struct_fields)] [u8; HASH_LEN]); +struct Hash(#[allow(dead_code)] [u8; HASH_LEN]); fn init_hash(_: &mut [u8; HASH_LEN]) {} fn foo<'a>() -> &'a () { diff --git a/tests/ui/consts/promoted_const_call4.rs b/tests/ui/consts/promoted_const_call4.rs index 82a17b7bf86..bb97957179f 100644 --- a/tests/ui/consts/promoted_const_call4.rs +++ b/tests/ui/consts/promoted_const_call4.rs @@ -4,7 +4,7 @@ use std::sync::atomic::*; static FLAG: AtomicBool = AtomicBool::new(false); -struct NoisyDrop(&'static str); +struct NoisyDrop(#[allow(dead_code)] &'static str); impl Drop for NoisyDrop { fn drop(&mut self) { FLAG.store(true, Ordering::SeqCst); diff --git a/tests/ui/consts/rvalue-static-promotion.rs b/tests/ui/consts/rvalue-static-promotion.rs index c48d9eae928..f42e8b70593 100644 --- a/tests/ui/consts/rvalue-static-promotion.rs +++ b/tests/ui/consts/rvalue-static-promotion.rs @@ -4,7 +4,7 @@ use std::cell::Cell; const NONE_CELL_STRING: Option<Cell<String>> = None; -struct Foo<T>(#[allow(unused_tuple_struct_fields)] T); +struct Foo<T>(#[allow(dead_code)] T); impl<T> Foo<T> { const FOO: Option<Box<T>> = None; } diff --git a/tests/ui/consts/transmute-const.rs b/tests/ui/consts/transmute-const.rs index c5c3dfc4cc7..65e5700d083 100644 --- a/tests/ui/consts/transmute-const.rs +++ b/tests/ui/consts/transmute-const.rs @@ -3,7 +3,7 @@ use std::mem; #[repr(transparent)] -struct Foo(#[allow(unused_tuple_struct_fields)] u32); +struct Foo(#[allow(dead_code)] u32); const TRANSMUTED_U32: u32 = unsafe { mem::transmute(Foo(3)) }; diff --git a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.mir.stderr b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.mir.stderr deleted file mode 100644 index 11dc57bcf46..00000000000 --- a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-45729-unsafe-in-coroutine.rs:8:9 - | -LL | *(1 as *mut u32) = 42; - | ^^^^^^^^^^^^^^^^^^^^^ 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 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.rs b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.rs index 7961b58597c..dab9c81bc8f 100644 --- a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.rs +++ b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #![feature(coroutines)] fn main() { diff --git a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.thir.stderr b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.stderr index a61689a0df5..19949b42939 100644 --- a/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.thir.stderr +++ b/tests/ui/coroutine/issue-45729-unsafe-in-coroutine.stderr @@ -1,5 +1,5 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-45729-unsafe-in-coroutine.rs:8:9 + --> $DIR/issue-45729-unsafe-in-coroutine.rs:5:9 | LL | *(1 as *mut u32) = 42; | ^^^^^^^^^^^^^^^^ dereference of raw pointer diff --git a/tests/ui/coroutine/size-moved-locals.rs b/tests/ui/coroutine/size-moved-locals.rs index 10f988cc066..fa657e3b275 100644 --- a/tests/ui/coroutine/size-moved-locals.rs +++ b/tests/ui/coroutine/size-moved-locals.rs @@ -18,7 +18,7 @@ use std::ops::Coroutine; const FOO_SIZE: usize = 1024; -struct Foo(#[allow(unused_tuple_struct_fields)] [u8; FOO_SIZE]); +struct Foo(#[allow(dead_code)] [u8; FOO_SIZE]); impl Drop for Foo { fn drop(&mut self) {} diff --git a/tests/ui/coroutine/static-mut-reference-across-yield.rs b/tests/ui/coroutine/static-mut-reference-across-yield.rs index 07f810856a7..0ed849e0e7d 100644 --- a/tests/ui/coroutine/static-mut-reference-across-yield.rs +++ b/tests/ui/coroutine/static-mut-reference-across-yield.rs @@ -1,6 +1,4 @@ // build-pass -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck #![feature(coroutines)] diff --git a/tests/ui/derive-uninhabited-enum-38885.rs b/tests/ui/derive-uninhabited-enum-38885.rs index 0089453ef0f..c11df030025 100644 --- a/tests/ui/derive-uninhabited-enum-38885.rs +++ b/tests/ui/derive-uninhabited-enum-38885.rs @@ -9,7 +9,7 @@ enum Void {} #[derive(Debug)] enum Foo { - Bar(u8), + Bar(#[allow(dead_code)] u8), Void(Void), //~ WARN variant `Void` is never constructed } diff --git a/tests/ui/derive-uninhabited-enum-38885.stderr b/tests/ui/derive-uninhabited-enum-38885.stderr index 3fabf446dc3..bcd8f6b7b53 100644 --- a/tests/ui/derive-uninhabited-enum-38885.stderr +++ b/tests/ui/derive-uninhabited-enum-38885.stderr @@ -3,7 +3,7 @@ warning: variant `Void` is never constructed | LL | enum Foo { | --- variant in this enum -LL | Bar(u8), +LL | Bar(#[allow(dead_code)] u8), LL | Void(Void), | ^^^^ | diff --git a/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs b/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs index 3480ccc1089..331d7298216 100644 --- a/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs +++ b/tests/ui/deriving/deriving-clone-generic-tuple-struct.rs @@ -2,7 +2,7 @@ // pretty-expanded FIXME #23616 #[derive(Clone)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S<T>(T, ()); pub fn main() { diff --git a/tests/ui/deriving/deriving-copyclone.rs b/tests/ui/deriving/deriving-copyclone.rs index f8403b1feac..099feceae81 100644 --- a/tests/ui/deriving/deriving-copyclone.rs +++ b/tests/ui/deriving/deriving-copyclone.rs @@ -23,7 +23,7 @@ impl Clone for Liar { /// This struct is actually Copy... at least, it thinks it is! #[derive(Copy, Clone)] -struct Innocent(#[allow(unused_tuple_struct_fields)] Liar); +struct Innocent(#[allow(dead_code)] Liar); impl Innocent { fn new() -> Self { diff --git a/tests/ui/deriving/issue-58319.rs b/tests/ui/deriving/issue-58319.rs index 8041bd5bb3c..754f5032d16 100644 --- a/tests/ui/deriving/issue-58319.rs +++ b/tests/ui/deriving/issue-58319.rs @@ -3,7 +3,7 @@ fn main() {} #[derive(Clone)] pub struct Little; #[derive(Clone)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] pub struct Big( Little, Little, diff --git a/tests/ui/drop/dropck-eyepatch-reorder.rs b/tests/ui/drop/dropck-eyepatch-reorder.rs index 0d7af3d4f61..4a56c45aa92 100644 --- a/tests/ui/drop/dropck-eyepatch-reorder.rs +++ b/tests/ui/drop/dropck-eyepatch-reorder.rs @@ -12,10 +12,10 @@ trait Foo { fn foo(&self, _: &str); } struct Dt<A: Foo>(&'static str, A); struct Dr<'a, B:'a+Foo>(&'static str, &'a B); -struct Pt<A: Foo, B: Foo>(&'static str, #[allow(unused_tuple_struct_fields)] A, B); -struct Pr<'a, 'b, B:'a+'b+Foo>(&'static str, #[allow(unused_tuple_struct_fields)] &'a B, &'b B); -struct St<A: Foo>(&'static str, #[allow(unused_tuple_struct_fields)] A); -struct Sr<'a, B:'a+Foo>(&'static str, #[allow(unused_tuple_struct_fields)] &'a B); +struct Pt<A: Foo, B: Foo>(&'static str, #[allow(dead_code)] A, B); +struct Pr<'a, 'b, B:'a+'b+Foo>(&'static str, #[allow(dead_code)] &'a B, &'b B); +struct St<A: Foo>(&'static str, #[allow(dead_code)] A); +struct Sr<'a, B:'a+Foo>(&'static str, #[allow(dead_code)] &'a B); impl<A: Foo> Drop for Dt<A> { fn drop(&mut self) { println!("drop {}", self.0); self.1.foo(self.0); } diff --git a/tests/ui/drop/dropck-eyepatch.rs b/tests/ui/drop/dropck-eyepatch.rs index 3c4840d5c7a..ff5a52b906b 100644 --- a/tests/ui/drop/dropck-eyepatch.rs +++ b/tests/ui/drop/dropck-eyepatch.rs @@ -35,10 +35,10 @@ trait Foo { fn foo(&self, _: &str); } struct Dt<A: Foo>(&'static str, A); struct Dr<'a, B:'a+Foo>(&'static str, &'a B); -struct Pt<A,B: Foo>(&'static str, #[allow(unused_tuple_struct_fields)] A, B); -struct Pr<'a, 'b, B:'a+'b+Foo>(&'static str, #[allow(unused_tuple_struct_fields)] &'a B, &'b B); -struct St<A: Foo>(&'static str, #[allow(unused_tuple_struct_fields)] A); -struct Sr<'a, B:'a+Foo>(&'static str, #[allow(unused_tuple_struct_fields)] &'a B); +struct Pt<A,B: Foo>(&'static str, #[allow(dead_code)] A, B); +struct Pr<'a, 'b, B:'a+'b+Foo>(&'static str, #[allow(dead_code)] &'a B, &'b B); +struct St<A: Foo>(&'static str, #[allow(dead_code)] A); +struct Sr<'a, B:'a+Foo>(&'static str, #[allow(dead_code)] &'a B); impl<A: Foo> Drop for Dt<A> { fn drop(&mut self) { println!("drop {}", self.0); self.1.foo(self.0); } diff --git a/tests/ui/drop/dynamic-drop.rs b/tests/ui/drop/dynamic-drop.rs index d35913ed641..4745cceb516 100644 --- a/tests/ui/drop/dynamic-drop.rs +++ b/tests/ui/drop/dynamic-drop.rs @@ -103,7 +103,7 @@ fn dynamic_drop(a: &Allocator, c: bool) { }; } -struct TwoPtrs<'a>(Ptr<'a>, #[allow(unused_tuple_struct_fields)] Ptr<'a>); +struct TwoPtrs<'a>(Ptr<'a>, #[allow(dead_code)] Ptr<'a>); fn struct_dynamic_drop(a: &Allocator, c0: bool, c1: bool, c: bool) { for i in 0..2 { let x; diff --git a/tests/ui/dropck/issue-24805-dropck-itemless.rs b/tests/ui/dropck/issue-24805-dropck-itemless.rs index 45761b61c3e..4d71389351b 100644 --- a/tests/ui/dropck/issue-24805-dropck-itemless.rs +++ b/tests/ui/dropck/issue-24805-dropck-itemless.rs @@ -19,7 +19,7 @@ impl<'a, T> UserDefined for &'a T { } // ``` macro_rules! impl_drop { ($Bound:ident, $Id:ident) => { - struct $Id<T: $Bound>(#[allow(unused_tuple_struct_fields)] T); + struct $Id<T: $Bound>(#[allow(dead_code)] T); unsafe impl <#[may_dangle] T: $Bound> Drop for $Id<T> { fn drop(&mut self) { } } diff --git a/tests/ui/dropck/issue-28498-ugeh-with-passed-to-fn.rs b/tests/ui/dropck/issue-28498-ugeh-with-passed-to-fn.rs index 04d0d32033a..d2b620f6940 100644 --- a/tests/ui/dropck/issue-28498-ugeh-with-passed-to-fn.rs +++ b/tests/ui/dropck/issue-28498-ugeh-with-passed-to-fn.rs @@ -21,7 +21,7 @@ impl Drop for ScribbleOnDrop { } } -struct Foo<T>(u32, T, #[allow(unused_tuple_struct_fields)] Box<for <'r> fn(&'r T) -> String>); +struct Foo<T>(u32, T, #[allow(dead_code)] Box<for <'r> fn(&'r T) -> String>); unsafe impl<#[may_dangle] T> Drop for Foo<T> { fn drop(&mut self) { diff --git a/tests/ui/dyn-star/drop.rs b/tests/ui/dyn-star/drop.rs index 1478498c0a9..1acfe2f2d1c 100644 --- a/tests/ui/dyn-star/drop.rs +++ b/tests/ui/dyn-star/drop.rs @@ -6,7 +6,7 @@ use std::fmt::Debug; #[derive(Debug)] -struct Foo(usize); +struct Foo(#[allow(dead_code)] usize); impl Drop for Foo { fn drop(&mut self) { diff --git a/tests/ui/enum-discriminant/discriminant_value-wrapper.rs b/tests/ui/enum-discriminant/discriminant_value-wrapper.rs index 8e162d5c455..1f6bb0cdc3a 100644 --- a/tests/ui/enum-discriminant/discriminant_value-wrapper.rs +++ b/tests/ui/enum-discriminant/discriminant_value-wrapper.rs @@ -4,7 +4,7 @@ use std::mem; -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum ADT { First(u32, u32), Second(u64) diff --git a/tests/ui/enum-discriminant/discriminant_value.rs b/tests/ui/enum-discriminant/discriminant_value.rs index f3dfac298ad..2864cd40da0 100644 --- a/tests/ui/enum-discriminant/discriminant_value.rs +++ b/tests/ui/enum-discriminant/discriminant_value.rs @@ -27,14 +27,14 @@ enum CLike3 { D } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum ADT { First(u32, u32), Second(u64) } enum NullablePointer { - Something(#[allow(unused_tuple_struct_fields)] &'static u32), + Something(#[allow(dead_code)] &'static u32), Nothing } diff --git a/tests/ui/error-codes/E0133.mir.stderr b/tests/ui/error-codes/E0133.mir.stderr deleted file mode 100644 index f8703ef0633..00000000000 --- a/tests/ui/error-codes/E0133.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/E0133.rs:7:5 - | -LL | f(); - | ^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/error-codes/E0133.rs b/tests/ui/error-codes/E0133.rs index dee1475ba21..52494ce6078 100644 --- a/tests/ui/error-codes/E0133.rs +++ b/tests/ui/error-codes/E0133.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - unsafe fn f() { return; } fn main() { diff --git a/tests/ui/error-codes/E0133.thir.stderr b/tests/ui/error-codes/E0133.stderr index fd4d42bcb8b..5e3e49fb644 100644 --- a/tests/ui/error-codes/E0133.thir.stderr +++ b/tests/ui/error-codes/E0133.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block - --> $DIR/E0133.rs:7:5 + --> $DIR/E0133.rs:4:5 | LL | f(); | ^^^ call to unsafe function diff --git a/tests/ui/extern/issue-28324.mir.stderr b/tests/ui/extern/issue-28324.mir.stderr deleted file mode 100644 index 9376ac35e21..00000000000 --- a/tests/ui/extern/issue-28324.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/issue-28324.rs:8:24 - | -LL | pub static BAZ: u32 = *&error_message_count; - | ^^^^^^^^^^^^^^^^^^^^ use of extern static - | - = 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 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/extern/issue-28324.rs b/tests/ui/extern/issue-28324.rs index fbe83e325ed..f74726e8166 100644 --- a/tests/ui/extern/issue-28324.rs +++ b/tests/ui/extern/issue-28324.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - extern "C" { static error_message_count: u32; } diff --git a/tests/ui/extern/issue-28324.thir.stderr b/tests/ui/extern/issue-28324.stderr index 8857f379ad1..94ff2131993 100644 --- a/tests/ui/extern/issue-28324.thir.stderr +++ b/tests/ui/extern/issue-28324.stderr @@ -1,5 +1,5 @@ error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/issue-28324.rs:8:25 + --> $DIR/issue-28324.rs:5:25 | LL | pub static BAZ: u32 = *&error_message_count; | ^^^^^^^^^^^^^^^^^^^ use of extern static diff --git a/tests/ui/generic-associated-types/issue-84931.stderr b/tests/ui/generic-associated-types/issue-84931.stderr index 04e14b9c746..71d112277a3 100644 --- a/tests/ui/generic-associated-types/issue-84931.stderr +++ b/tests/ui/generic-associated-types/issue-84931.stderr @@ -1,16 +1,3 @@ -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/issue-84931.rs:14:21 - | -LL | type Item<'a> = &'a mut T; - | -- ^^^^^^^^^ ...so that the reference type `&'a mut T` does not outlive the data it points at - | | - | the parameter type `T` must be valid for the lifetime `'a` as defined here... - | -help: consider adding an explicit lifetime bound - | -LL | type Item<'a> = &'a mut T where T: 'a; - | +++++++++++ - error[E0477]: the type `StreamingSliceIter<'b, T>` does not fulfill the required lifetime --> $DIR/issue-84931.rs:14:21 | @@ -30,6 +17,19 @@ help: copy the `where` clause predicates from the trait LL | type Item<'a> = &'a mut T where Self: 'a; | ++++++++++++++ +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/issue-84931.rs:14:21 + | +LL | type Item<'a> = &'a mut T; + | -- ^^^^^^^^^ ...so that the reference type `&'a mut T` does not outlive the data it points at + | | + | the parameter type `T` must be valid for the lifetime `'a` as defined here... + | +help: consider adding an explicit lifetime bound + | +LL | type Item<'a> = &'a mut T where T: 'a; + | +++++++++++ + error: aborting due to 2 previous errors Some errors have detailed explanations: E0309, E0477. diff --git a/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.stderr b/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.stderr index f73ed5956da..8d21b9172c8 100644 --- a/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.stderr +++ b/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.stderr @@ -12,6 +12,26 @@ LL | #![warn(unused_lifetimes)] | ^^^^^^^^^^^^^^^^ error[E0478]: lifetime bound not satisfied + --> $DIR/unsatisfied-item-lifetime-bound.rs:9:18 + | +LL | type Y<'a: 'static>; + | ------------------- definition of `Y` from trait +... +LL | type Y<'a> = &'a (); + | ^^^^^^ + | +note: lifetime parameter instantiated with the lifetime `'a` as defined here + --> $DIR/unsatisfied-item-lifetime-bound.rs:9:12 + | +LL | type Y<'a> = &'a (); + | ^^ + = note: but lifetime parameter must outlive the static lifetime +help: copy the `where` clause predicates from the trait + | +LL | type Y<'a> = &'a () where 'a: 'static; + | +++++++++++++++++ + +error[E0478]: lifetime bound not satisfied --> $DIR/unsatisfied-item-lifetime-bound.rs:14:8 | LL | f: <T as X>::Y<'a>, @@ -50,26 +70,6 @@ LL | struct D<'a> { | ^^ = note: but lifetime parameter must outlive the static lifetime -error[E0478]: lifetime bound not satisfied - --> $DIR/unsatisfied-item-lifetime-bound.rs:9:18 - | -LL | type Y<'a: 'static>; - | ------------------- definition of `Y` from trait -... -LL | type Y<'a> = &'a (); - | ^^^^^^ - | -note: lifetime parameter instantiated with the lifetime `'a` as defined here - --> $DIR/unsatisfied-item-lifetime-bound.rs:9:12 - | -LL | type Y<'a> = &'a (); - | ^^ - = note: but lifetime parameter must outlive the static lifetime -help: copy the `where` clause predicates from the trait - | -LL | type Y<'a> = &'a () where 'a: 'static; - | +++++++++++++++++ - error: aborting due to 4 previous errors; 1 warning emitted For more information about this error, try `rustc --explain E0478`. diff --git a/tests/ui/generics/generic-default-type-params-cross-crate.rs b/tests/ui/generics/generic-default-type-params-cross-crate.rs index 834b15be1c5..f798901132b 100644 --- a/tests/ui/generics/generic-default-type-params-cross-crate.rs +++ b/tests/ui/generics/generic-default-type-params-cross-crate.rs @@ -5,7 +5,7 @@ extern crate default_type_params_xc; -struct Vec<T, A = default_type_params_xc::Heap>(#[allow(unused_tuple_struct_fields)] Option<(T,A)>); +struct Vec<T, A = default_type_params_xc::Heap>(#[allow(dead_code)] Option<(T,A)>); struct Foo; diff --git a/tests/ui/generics/generic-ivec-leak.rs b/tests/ui/generics/generic-ivec-leak.rs index 9610bdcb338..7a1d10a646d 100644 --- a/tests/ui/generics/generic-ivec-leak.rs +++ b/tests/ui/generics/generic-ivec-leak.rs @@ -1,5 +1,5 @@ // run-pass #![allow(non_camel_case_types)] -enum wrapper<T> { wrapped(#[allow(unused_tuple_struct_fields)] T), } +enum wrapper<T> { wrapped(#[allow(dead_code)] T), } pub fn main() { let _w = wrapper::wrapped(vec![1, 2, 3, 4, 5]); } diff --git a/tests/ui/generics/generic-newtype-struct.rs b/tests/ui/generics/generic-newtype-struct.rs index aa879f01a58..92523b76f98 100644 --- a/tests/ui/generics/generic-newtype-struct.rs +++ b/tests/ui/generics/generic-newtype-struct.rs @@ -1,7 +1,7 @@ // run-pass // pretty-expanded FIXME #23616 -struct S<T>(#[allow(unused_tuple_struct_fields)] T); +struct S<T>(#[allow(dead_code)] T); pub fn main() { let _s = S(2); diff --git a/tests/ui/generics/generic-no-mangle.fixed b/tests/ui/generics/generic-no-mangle.fixed index 501acb6e163..aa6d6310f5f 100644 --- a/tests/ui/generics/generic-no-mangle.fixed +++ b/tests/ui/generics/generic-no-mangle.fixed @@ -76,7 +76,7 @@ impl<T> Trait2<T> for Foo { fn qux<'a>(x: &'a i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled } -pub struct Bar<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct Bar<T>(#[allow(dead_code)] T); impl<T> Bar<T> { @@ -111,7 +111,7 @@ impl<T> Trait3 for Bar<T> { fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled } -pub struct Baz<'a>(#[allow(unused_tuple_struct_fields)] &'a i32); +pub struct Baz<'a>(#[allow(dead_code)] &'a i32); impl<'a> Baz<'a> { #[no_mangle] diff --git a/tests/ui/generics/generic-no-mangle.rs b/tests/ui/generics/generic-no-mangle.rs index 74e407078e8..8a59ca75aaf 100644 --- a/tests/ui/generics/generic-no-mangle.rs +++ b/tests/ui/generics/generic-no-mangle.rs @@ -76,7 +76,7 @@ impl<T> Trait2<T> for Foo { fn qux<'a>(x: &'a i32) -> &i32 { x } //~ ERROR functions generic over types or consts must be mangled } -pub struct Bar<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct Bar<T>(#[allow(dead_code)] T); impl<T> Bar<T> { #[no_mangle] @@ -111,7 +111,7 @@ impl<T> Trait3 for Bar<T> { fn baz<U>() {} //~ ERROR functions generic over types or consts must be mangled } -pub struct Baz<'a>(#[allow(unused_tuple_struct_fields)] &'a i32); +pub struct Baz<'a>(#[allow(dead_code)] &'a i32); impl<'a> Baz<'a> { #[no_mangle] diff --git a/tests/ui/generics/generic-recursive-tag.rs b/tests/ui/generics/generic-recursive-tag.rs index b344da1c7dd..5490822975a 100644 --- a/tests/ui/generics/generic-recursive-tag.rs +++ b/tests/ui/generics/generic-recursive-tag.rs @@ -1,7 +1,7 @@ // run-pass #![allow(non_camel_case_types)] -enum list<T> { #[allow(unused_tuple_struct_fields)] cons(Box<T>, Box<list<T>>), nil, } +enum list<T> { #[allow(dead_code)] cons(Box<T>, Box<list<T>>), nil, } pub fn main() { let _a: list<isize> = diff --git a/tests/ui/generics/generic-tag-corruption.rs b/tests/ui/generics/generic-tag-corruption.rs index 35de3c1f712..ae20a94d9fd 100644 --- a/tests/ui/generics/generic-tag-corruption.rs +++ b/tests/ui/generics/generic-tag-corruption.rs @@ -5,6 +5,6 @@ // This used to cause memory corruption in stage 0. // pretty-expanded FIXME #23616 -enum thing<K> { some(#[allow(unused_tuple_struct_fields)] K), } +enum thing<K> { some(#[allow(dead_code)] K), } pub fn main() { let _x = thing::some("hi".to_string()); } diff --git a/tests/ui/generics/generic-tag-local.rs b/tests/ui/generics/generic-tag-local.rs index c5772e84193..121ec74f8b7 100644 --- a/tests/ui/generics/generic-tag-local.rs +++ b/tests/ui/generics/generic-tag-local.rs @@ -3,6 +3,6 @@ // pretty-expanded FIXME #23616 -enum clam<T> { a(#[allow(unused_tuple_struct_fields)] T), } +enum clam<T> { a(#[allow(dead_code)] T), } pub fn main() { let _c = clam::a(3); } diff --git a/tests/ui/generics/generic-tag.rs b/tests/ui/generics/generic-tag.rs index 31fc2178d6d..9e844c72552 100644 --- a/tests/ui/generics/generic-tag.rs +++ b/tests/ui/generics/generic-tag.rs @@ -6,7 +6,7 @@ #![allow(unused_variables)] -enum option<T> { some(#[allow(unused_tuple_struct_fields)] Box<T>), none, } +enum option<T> { some(#[allow(dead_code)] Box<T>), none, } pub fn main() { let mut a: option<isize> = option::some::<isize>(Box::new(10)); diff --git a/tests/ui/impl-trait/bounds_regression.rs b/tests/ui/impl-trait/bounds_regression.rs index f32d83c0c40..89b0e3c55f9 100644 --- a/tests/ui/impl-trait/bounds_regression.rs +++ b/tests/ui/impl-trait/bounds_regression.rs @@ -15,7 +15,7 @@ pub fn future_from_coroutine< GenFuture(x) } -struct GenFuture<T: FakeCoroutine<Yield = ()>>(#[allow(unused_tuple_struct_fields)] T); +struct GenFuture<T: FakeCoroutine<Yield = ()>>(#[allow(dead_code)] T); impl<T: FakeCoroutine<Yield = ()>> FakeFuture for GenFuture<T> { type Output = T::Return; diff --git a/tests/ui/impl-trait/issues/issue-78722-2.stderr b/tests/ui/impl-trait/issues/issue-78722-2.stderr index 8817eb7d243..69c734530f2 100644 --- a/tests/ui/impl-trait/issues/issue-78722-2.stderr +++ b/tests/ui/impl-trait/issues/issue-78722-2.stderr @@ -1,12 +1,3 @@ -error[E0658]: `async` blocks are not allowed in constants - --> $DIR/issue-78722-2.rs:15:20 - | -LL | let f: F = async { 1 }; - | ^^^^^^^^^^^ - | - = note: see issue #85368 <https://github.com/rust-lang/rust/issues/85368> for more information - = help: add `#![feature(const_async_blocks)]` to the crate attributes to enable - error[E0271]: expected `{async block@$DIR/issue-78722-2.rs:13:13: 13:21}` to be a future that resolves to `u8`, but it resolves to `()` --> $DIR/issue-78722-2.rs:11:30 | @@ -26,6 +17,15 @@ note: this item must mention the opaque type in its signature in order to be abl LL | let f: F = async { 1 }; | ^^^^^^^^^^^ +error[E0658]: `async` blocks are not allowed in constants + --> $DIR/issue-78722-2.rs:15:20 + | +LL | let f: F = async { 1 }; + | ^^^^^^^^^^^ + | + = note: see issue #85368 <https://github.com/rust-lang/rust/issues/85368> for more information + = help: add `#![feature(const_async_blocks)]` to the crate attributes to enable + error: aborting due to 3 previous errors Some errors have detailed explanations: E0271, E0658. diff --git a/tests/ui/impl-trait/issues/issue-86800.rs b/tests/ui/impl-trait/issues/issue-86800.rs index df70b324c5e..297b012d90a 100644 --- a/tests/ui/impl-trait/issues/issue-86800.rs +++ b/tests/ui/impl-trait/issues/issue-86800.rs @@ -1,8 +1,8 @@ #![feature(type_alias_impl_trait)] // edition:2021 -// compile-flags:-Z treat-err-as-bug=1 -// error-pattern: aborting due to `-Z treat-err-as-bug=1` +// compile-flags:-Z treat-err-as-bug=2 +// error-pattern: due to `-Z treat-err-as-bug=2 // failure-status:101 // normalize-stderr-test ".*note: .*\n\n" -> "" // normalize-stderr-test "thread 'rustc' panicked.*:\n.*\n" -> "" diff --git a/tests/ui/impl-trait/issues/issue-86800.stderr b/tests/ui/impl-trait/issues/issue-86800.stderr index 8228f8ace9d..07ba8eb021b 100644 --- a/tests/ui/impl-trait/issues/issue-86800.stderr +++ b/tests/ui/impl-trait/issues/issue-86800.stderr @@ -4,9 +4,18 @@ error: unconstrained opaque type LL | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | +error[E0792]: expected generic lifetime parameter, found `'_` + --> $DIR/issue-86800.rs:39:5 + | +LL | type TransactionFuture<'__, O> = impl '__ + Future<Output = TransactionResult<O>>; + | --- this generic parameter must be used with a generic lifetime parameter +... +LL | f + | ^ + error: the compiler unexpectedly panicked. this is a bug. query stack during panic: -#0 [type_of_opaque] computing type of opaque `TransactionFuture::{opaque#0}` -#1 [type_of] computing type of `TransactionFuture::{opaque#0}` +#0 [mir_borrowck] borrow-checking `execute_transaction_fut` +#1 [type_of_opaque] computing type of opaque `execute_transaction_fut::{opaque#0}` end of query stack diff --git a/tests/ui/inference/issue-36053.rs b/tests/ui/inference/issue-36053.rs index 5c6d0780416..8eee1c33b0e 100644 --- a/tests/ui/inference/issue-36053.rs +++ b/tests/ui/inference/issue-36053.rs @@ -7,7 +7,7 @@ use std::iter::FusedIterator; -struct Thing<'a>(#[allow(unused_tuple_struct_fields)] &'a str); +struct Thing<'a>(#[allow(dead_code)] &'a str); impl<'a> Iterator for Thing<'a> { type Item = &'a str; fn next(&mut self) -> Option<&'a str> { diff --git a/tests/ui/inline-const/expr-unsafe-err.mir.stderr b/tests/ui/inline-const/expr-unsafe-err.mir.stderr deleted file mode 100644 index ebd18f89d9c..00000000000 --- a/tests/ui/inline-const/expr-unsafe-err.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/expr-unsafe-err.rs:8:9 - | -LL | require_unsafe(); - | ^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/inline-const/expr-unsafe-err.rs b/tests/ui/inline-const/expr-unsafe-err.rs index adf05d352ea..a05a2945168 100644 --- a/tests/ui/inline-const/expr-unsafe-err.rs +++ b/tests/ui/inline-const/expr-unsafe-err.rs @@ -1,7 +1,7 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck #![feature(inline_const)] -const unsafe fn require_unsafe() -> usize { 1 } +const unsafe fn require_unsafe() -> usize { + 1 +} fn main() { const { diff --git a/tests/ui/inline-const/expr-unsafe-err.thir.stderr b/tests/ui/inline-const/expr-unsafe-err.stderr index 45f850d1f99..45f850d1f99 100644 --- a/tests/ui/inline-const/expr-unsafe-err.thir.stderr +++ b/tests/ui/inline-const/expr-unsafe-err.stderr diff --git a/tests/ui/inline-const/expr-unsafe.rs b/tests/ui/inline-const/expr-unsafe.rs index d71efd33db1..2370c58a712 100644 --- a/tests/ui/inline-const/expr-unsafe.rs +++ b/tests/ui/inline-const/expr-unsafe.rs @@ -1,6 +1,5 @@ // check-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck + #![warn(unused_unsafe)] #![feature(inline_const)] const unsafe fn require_unsafe() -> usize { 1 } diff --git a/tests/ui/inline-const/expr-unsafe.mir.stderr b/tests/ui/inline-const/expr-unsafe.stderr index 1ab6e42fba0..47334aaab83 100644 --- a/tests/ui/inline-const/expr-unsafe.mir.stderr +++ b/tests/ui/inline-const/expr-unsafe.stderr @@ -1,11 +1,11 @@ warning: unnecessary `unsafe` block - --> $DIR/expr-unsafe.rs:12:13 + --> $DIR/expr-unsafe.rs:11:13 | LL | unsafe {} | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/expr-unsafe.rs:4:9 + --> $DIR/expr-unsafe.rs:3:9 | LL | #![warn(unused_unsafe)] | ^^^^^^^^^^^^^ diff --git a/tests/ui/inline-const/expr-unsafe.thir.stderr b/tests/ui/inline-const/expr-unsafe.thir.stderr deleted file mode 100644 index 1ab6e42fba0..00000000000 --- a/tests/ui/inline-const/expr-unsafe.thir.stderr +++ /dev/null @@ -1,14 +0,0 @@ -warning: unnecessary `unsafe` block - --> $DIR/expr-unsafe.rs:12:13 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/expr-unsafe.rs:4:9 - | -LL | #![warn(unused_unsafe)] - | ^^^^^^^^^^^^^ - -warning: 1 warning emitted - diff --git a/tests/ui/inline-const/pat-unsafe-err.rs b/tests/ui/inline-const/pat-unsafe-err.rs index 6df281c6d94..0db18dd3260 100644 --- a/tests/ui/inline-const/pat-unsafe-err.rs +++ b/tests/ui/inline-const/pat-unsafe-err.rs @@ -1,6 +1,4 @@ -// revisions: mir thir -// [mir]ignore-test This is currently broken -// [thir]compile-flags: -Z thir-unsafeck +// ignore-test This is currently broken #![allow(incomplete_features)] #![feature(inline_const_pat)] diff --git a/tests/ui/inline-const/pat-unsafe-err.thir.stderr b/tests/ui/inline-const/pat-unsafe-err.thir.stderr deleted file mode 100644 index 48a2cb4c704..00000000000 --- a/tests/ui/inline-const/pat-unsafe-err.thir.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0133]: call to unsafe function `require_unsafe` is unsafe and requires unsafe function or block - --> $DIR/pat-unsafe-err.rs:15:13 - | -LL | require_unsafe(); - | ^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function `require_unsafe` is unsafe and requires unsafe function or block - --> $DIR/pat-unsafe-err.rs:22:13 - | -LL | require_unsafe() - | ^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/inline-const/pat-unsafe.rs b/tests/ui/inline-const/pat-unsafe.rs index 36f8632af67..cfef9ad6a56 100644 --- a/tests/ui/inline-const/pat-unsafe.rs +++ b/tests/ui/inline-const/pat-unsafe.rs @@ -1,7 +1,5 @@ // check-pass -// revisions: mir thir -// [mir]ignore-test This is currently broken -// [thir]compile-flags: -Z thir-unsafeck +// ignore-test This is currently broken #![allow(incomplete_features)] #![warn(unused_unsafe)] diff --git a/tests/ui/inline-const/pat-unsafe.thir.stderr b/tests/ui/inline-const/pat-unsafe.thir.stderr deleted file mode 100644 index 0318b3ff2cc..00000000000 --- a/tests/ui/inline-const/pat-unsafe.thir.stderr +++ /dev/null @@ -1,20 +0,0 @@ -warning: unnecessary `unsafe` block - --> $DIR/pat-unsafe.rs:19:17 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/pat-unsafe.rs:7:9 - | -LL | #![warn(unused_unsafe)] - | ^^^^^^^^^^^^^ - -warning: unnecessary `unsafe` block - --> $DIR/pat-unsafe.rs:26:17 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - -warning: 2 warnings emitted - diff --git a/tests/ui/intrinsics/issue-28575.rs b/tests/ui/intrinsics/issue-28575.rs index 410f664f89d..141136d25b2 100644 --- a/tests/ui/intrinsics/issue-28575.rs +++ b/tests/ui/intrinsics/issue-28575.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #![feature(intrinsics)] extern "C" { diff --git a/tests/ui/intrinsics/issue-28575.mir.stderr b/tests/ui/intrinsics/issue-28575.stderr index 4b29b4c1b6a..8a7816f231f 100644 --- a/tests/ui/intrinsics/issue-28575.mir.stderr +++ b/tests/ui/intrinsics/issue-28575.stderr @@ -1,5 +1,5 @@ error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/issue-28575.rs:11:5 + --> $DIR/issue-28575.rs:8:5 | LL | FOO() | ^^^ use of extern static diff --git a/tests/ui/intrinsics/issue-28575.thir.stderr b/tests/ui/intrinsics/issue-28575.thir.stderr deleted file mode 100644 index 4b29b4c1b6a..00000000000 --- a/tests/ui/intrinsics/issue-28575.thir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/issue-28575.rs:11:5 - | -LL | FOO() - | ^^^ use of extern static - | - = 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 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/intrinsics/unchecked_math_unsafe.mir.stderr b/tests/ui/intrinsics/unchecked_math_unsafe.mir.stderr deleted file mode 100644 index 26b2f9f2713..00000000000 --- a/tests/ui/intrinsics/unchecked_math_unsafe.mir.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/unchecked_math_unsafe.rs:8:15 - | -LL | let add = std::intrinsics::unchecked_add(x, y); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/unchecked_math_unsafe.rs:9:15 - | -LL | let sub = std::intrinsics::unchecked_sub(x, y); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/unchecked_math_unsafe.rs:10:15 - | -LL | let mul = std::intrinsics::unchecked_mul(x, y); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/intrinsics/unchecked_math_unsafe.rs b/tests/ui/intrinsics/unchecked_math_unsafe.rs index 98d3a11ad02..a034b45f530 100644 --- a/tests/ui/intrinsics/unchecked_math_unsafe.rs +++ b/tests/ui/intrinsics/unchecked_math_unsafe.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #![feature(core_intrinsics)] fn main() { diff --git a/tests/ui/intrinsics/unchecked_math_unsafe.thir.stderr b/tests/ui/intrinsics/unchecked_math_unsafe.stderr index 5c3728ccdf8..31da1a86ca1 100644 --- a/tests/ui/intrinsics/unchecked_math_unsafe.thir.stderr +++ b/tests/ui/intrinsics/unchecked_math_unsafe.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `unchecked_add` is unsafe and requires unsafe function or block - --> $DIR/unchecked_math_unsafe.rs:8:15 + --> $DIR/unchecked_math_unsafe.rs:5:15 | LL | let add = std::intrinsics::unchecked_add(x, y); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | let add = std::intrinsics::unchecked_add(x, y); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `unchecked_sub` is unsafe and requires unsafe function or block - --> $DIR/unchecked_math_unsafe.rs:9:15 + --> $DIR/unchecked_math_unsafe.rs:6:15 | LL | let sub = std::intrinsics::unchecked_sub(x, y); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function @@ -15,7 +15,7 @@ LL | let sub = std::intrinsics::unchecked_sub(x, y); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `unchecked_mul` is unsafe and requires unsafe function or block - --> $DIR/unchecked_math_unsafe.rs:10:15 + --> $DIR/unchecked_math_unsafe.rs:7:15 | LL | let mul = std::intrinsics::unchecked_mul(x, y); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/issues/issue-11740.rs b/tests/ui/issues/issue-11740.rs index fa80f509b32..c3badfd9b49 100644 --- a/tests/ui/issues/issue-11740.rs +++ b/tests/ui/issues/issue-11740.rs @@ -1,6 +1,4 @@ // check-pass -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck struct Attr { name: String, diff --git a/tests/ui/issues/issue-13027.rs b/tests/ui/issues/issue-13027.rs index 64bf2a11d0e..ac0d1f11bd7 100644 --- a/tests/ui/issues/issue-13027.rs +++ b/tests/ui/issues/issue-13027.rs @@ -164,7 +164,7 @@ fn range_shadow_multi_pats() { fn misc() { enum Foo { - Bar(#[allow(unused_tuple_struct_fields)] usize, bool) + Bar(#[allow(dead_code)] usize, bool) } // This test basically mimics how trace_macros! macro is implemented, // which is a rare combination of vector patterns, multiple wild-card diff --git a/tests/ui/issues/issue-14382.rs b/tests/ui/issues/issue-14382.rs index dca24d0be8a..b5c2362f05c 100644 --- a/tests/ui/issues/issue-14382.rs +++ b/tests/ui/issues/issue-14382.rs @@ -1,6 +1,6 @@ // run-pass #[derive(Debug)] -struct Matrix4<S>(#[allow(unused_tuple_struct_fields)] S); +struct Matrix4<S>(#[allow(dead_code)] S); trait POrd<S> {} fn translate<S: POrd<S>>(s: S) -> Matrix4<S> { Matrix4(s) } diff --git a/tests/ui/issues/issue-15858.rs b/tests/ui/issues/issue-15858.rs index 8d65afc4883..77941c07671 100644 --- a/tests/ui/issues/issue-15858.rs +++ b/tests/ui/issues/issue-15858.rs @@ -12,7 +12,7 @@ impl Bar for BarImpl { } -struct Foo<B: Bar>(#[allow(unused_tuple_struct_fields)] B); +struct Foo<B: Bar>(#[allow(dead_code)] B); impl<B: Bar> Drop for Foo<B> { fn drop(&mut self) { diff --git a/tests/ui/issues/issue-17905.rs b/tests/ui/issues/issue-17905.rs index dae9648b917..83cea8b4395 100644 --- a/tests/ui/issues/issue-17905.rs +++ b/tests/ui/issues/issue-17905.rs @@ -1,7 +1,7 @@ // run-pass #[derive(Debug)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Pair<T, V> (T, V); impl Pair< diff --git a/tests/ui/issues/issue-23122-2.stderr b/tests/ui/issues/issue-23122-2.stderr index b8aa587a739..10463ab2c33 100644 --- a/tests/ui/issues/issue-23122-2.stderr +++ b/tests/ui/issues/issue-23122-2.stderr @@ -5,7 +5,7 @@ LL | type Next = <GetNext<T::Next> as Next>::Next; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_23122_2`) -note: required for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>` to implement `Next` +note: required for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>` to implement `Next` --> $DIR/issue-23122-2.rs:10:15 | LL | impl<T: Next> Next for GetNext<T> { diff --git a/tests/ui/issues/issue-23491.rs b/tests/ui/issues/issue-23491.rs index e5f9dd3efbd..efd83112353 100644 --- a/tests/ui/issues/issue-23491.rs +++ b/tests/ui/issues/issue-23491.rs @@ -1,7 +1,7 @@ // run-pass #![allow(unused_variables)] -struct Node<T: ?Sized>(#[allow(unused_tuple_struct_fields)] T); +struct Node<T: ?Sized>(#[allow(dead_code)] T); fn main() { let x: Box<Node<[isize]>> = Box::new(Node([])); diff --git a/tests/ui/issues/issue-24308.rs b/tests/ui/issues/issue-24308.rs index 4a582c68efc..40950938fc7 100644 --- a/tests/ui/issues/issue-24308.rs +++ b/tests/ui/issues/issue-24308.rs @@ -4,7 +4,7 @@ pub trait Foo { fn method2(); } -struct Slice<'a, T: 'a>(#[allow(unused_tuple_struct_fields)] &'a [T]); +struct Slice<'a, T: 'a>(#[allow(dead_code)] &'a [T]); impl<'a, T: 'a> Foo for Slice<'a, T> { fn method2() { diff --git a/tests/ui/issues/issue-25089.rs b/tests/ui/issues/issue-25089.rs index c988f8f55fa..c7063b24608 100644 --- a/tests/ui/issues/issue-25089.rs +++ b/tests/ui/issues/issue-25089.rs @@ -4,7 +4,7 @@ use std::thread; -struct Foo(#[allow(unused_tuple_struct_fields)] i32); +struct Foo(#[allow(dead_code)] i32); impl Drop for Foo { fn drop(&mut self) { diff --git a/tests/ui/issues/issue-25679.rs b/tests/ui/issues/issue-25679.rs index b548da98888..8415eba887b 100644 --- a/tests/ui/issues/issue-25679.rs +++ b/tests/ui/issues/issue-25679.rs @@ -2,7 +2,7 @@ trait Device { type Resources; } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Foo<D, R>(D, R); impl<D: Device> Foo<D, D::Resources> { diff --git a/tests/ui/issues/issue-26127.rs b/tests/ui/issues/issue-26127.rs index f3f9c1d9ae8..b76f1ba51a4 100644 --- a/tests/ui/issues/issue-26127.rs +++ b/tests/ui/issues/issue-26127.rs @@ -1,7 +1,7 @@ // run-pass trait Tr { type T; } impl Tr for u8 { type T=(); } -struct S<I: Tr>(#[allow(unused_tuple_struct_fields)] I::T); +struct S<I: Tr>(#[allow(dead_code)] I::T); fn foo<I: Tr>(i: I::T) { S::<I>(i); diff --git a/tests/ui/issues/issue-26641.rs b/tests/ui/issues/issue-26641.rs index e08edd0b5cb..3256b71660f 100644 --- a/tests/ui/issues/issue-26641.rs +++ b/tests/ui/issues/issue-26641.rs @@ -1,5 +1,5 @@ // run-pass -struct Parser<'a>(#[allow(unused_tuple_struct_fields)] Box<dyn FnMut(Parser) + 'a>); +struct Parser<'a>(#[allow(dead_code)] Box<dyn FnMut(Parser) + 'a>); fn main() { let _x = Parser(Box::new(|_|{})); diff --git a/tests/ui/issues/issue-26709.rs b/tests/ui/issues/issue-26709.rs index 1bd2651dd6c..8a8186de5cc 100644 --- a/tests/ui/issues/issue-26709.rs +++ b/tests/ui/issues/issue-26709.rs @@ -1,5 +1,5 @@ // run-pass -struct Wrapper<'a, T: ?Sized>(&'a mut i32, #[allow(unused_tuple_struct_fields)] T); +struct Wrapper<'a, T: ?Sized>(&'a mut i32, #[allow(dead_code)] T); impl<'a, T: ?Sized> Drop for Wrapper<'a, T> { fn drop(&mut self) { diff --git a/tests/ui/issues/issue-27240.rs b/tests/ui/issues/issue-27240.rs index eaf254f3361..b518e58d194 100644 --- a/tests/ui/issues/issue-27240.rs +++ b/tests/ui/issues/issue-27240.rs @@ -2,12 +2,12 @@ #![allow(unused_assignments)] #![allow(unused_variables)] use std::fmt; -struct NoisyDrop<T: fmt::Debug>(#[allow(unused_tuple_struct_fields)] T); +struct NoisyDrop<T: fmt::Debug>(#[allow(dead_code)] T); impl<T: fmt::Debug> Drop for NoisyDrop<T> { fn drop(&mut self) {} } -struct Bar<T: fmt::Debug>(#[allow(unused_tuple_struct_fields)] [*const NoisyDrop<T>; 2]); +struct Bar<T: fmt::Debug>(#[allow(dead_code)] [*const NoisyDrop<T>; 2]); fn fine() { let (u,b); @@ -15,7 +15,7 @@ fn fine() { b = Bar([&NoisyDrop(&u), &NoisyDrop(&u)]); } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct Bar2<T: fmt::Debug>(*const NoisyDrop<T>, *const NoisyDrop<T>); fn lolwut() { diff --git a/tests/ui/issues/issue-28498-must-work-ex1.rs b/tests/ui/issues/issue-28498-must-work-ex1.rs index ab6d190e0a1..37234699893 100644 --- a/tests/ui/issues/issue-28498-must-work-ex1.rs +++ b/tests/ui/issues/issue-28498-must-work-ex1.rs @@ -6,7 +6,7 @@ use std::cell::Cell; -struct Concrete<'a>(#[allow(unused_tuple_struct_fields)] u32, Cell<Option<&'a Concrete<'a>>>); +struct Concrete<'a>(#[allow(dead_code)] u32, Cell<Option<&'a Concrete<'a>>>); fn main() { let mut data = Vec::new(); diff --git a/tests/ui/issues/issue-28498-must-work-ex2.rs b/tests/ui/issues/issue-28498-must-work-ex2.rs index 378d736ee3d..ab0b7196082 100644 --- a/tests/ui/issues/issue-28498-must-work-ex2.rs +++ b/tests/ui/issues/issue-28498-must-work-ex2.rs @@ -6,7 +6,7 @@ use std::cell::Cell; -struct Concrete<'a>(#[allow(unused_tuple_struct_fields)] u32, Cell<Option<&'a Concrete<'a>>>); +struct Concrete<'a>(#[allow(dead_code)] u32, Cell<Option<&'a Concrete<'a>>>); struct Foo<T> { data: Vec<T> } diff --git a/tests/ui/issues/issue-28498-ugeh-ex1.rs b/tests/ui/issues/issue-28498-ugeh-ex1.rs index 24bf706cef9..ce49cf1ff99 100644 --- a/tests/ui/issues/issue-28498-ugeh-ex1.rs +++ b/tests/ui/issues/issue-28498-ugeh-ex1.rs @@ -8,7 +8,7 @@ #![feature(dropck_eyepatch)] use std::cell::Cell; -struct Concrete<'a>(#[allow(unused_tuple_struct_fields)] u32, Cell<Option<&'a Concrete<'a>>>); +struct Concrete<'a>(#[allow(dead_code)] u32, Cell<Option<&'a Concrete<'a>>>); struct Foo<T> { data: Vec<T> } diff --git a/tests/ui/issues/issue-28776.mir.stderr b/tests/ui/issues/issue-28776.mir.stderr deleted file mode 100644 index e7b7ba08268..00000000000 --- a/tests/ui/issues/issue-28776.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/issue-28776.rs:7:5 - | -LL | (&ptr::write)(1 as *mut _, 42); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/issues/issue-28776.rs b/tests/ui/issues/issue-28776.rs index 19df3c4a425..e564ebcd110 100644 --- a/tests/ui/issues/issue-28776.rs +++ b/tests/ui/issues/issue-28776.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - use std::ptr; fn main() { diff --git a/tests/ui/issues/issue-28776.thir.stderr b/tests/ui/issues/issue-28776.stderr index 63172b85424..3db94ee1810 100644 --- a/tests/ui/issues/issue-28776.thir.stderr +++ b/tests/ui/issues/issue-28776.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `std::ptr::write` is unsafe and requires unsafe function or block - --> $DIR/issue-28776.rs:7:5 + --> $DIR/issue-28776.rs:4:5 | LL | (&ptr::write)(1 as *mut _, 42); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/issues/issue-31267-additional.rs b/tests/ui/issues/issue-31267-additional.rs index 7f0cbd658f1..c6e93533e7c 100644 --- a/tests/ui/issues/issue-31267-additional.rs +++ b/tests/ui/issues/issue-31267-additional.rs @@ -6,7 +6,7 @@ struct Bar; const BAZ: Bar = Bar; #[derive(Debug)] -struct Foo(#[allow(unused_tuple_struct_fields)] [Bar; 1]); +struct Foo(#[allow(dead_code)] [Bar; 1]); struct Biz; diff --git a/tests/ui/issues/issue-31299.rs b/tests/ui/issues/issue-31299.rs index 78c3252d32e..e3c422cb97c 100644 --- a/tests/ui/issues/issue-31299.rs +++ b/tests/ui/issues/issue-31299.rs @@ -25,9 +25,9 @@ impl<T> Front for Vec<T> { type Back = Vec<T>; } -struct PtrBack<T: Front>(#[allow(unused_tuple_struct_fields)] Vec<T::Back>); +struct PtrBack<T: Front>(#[allow(dead_code)] Vec<T::Back>); -struct M(#[allow(unused_tuple_struct_fields)] PtrBack<Vec<M>>); +struct M(#[allow(dead_code)] PtrBack<Vec<M>>); #[allow(unused_must_use)] fn main() { diff --git a/tests/ui/issues/issue-34571.rs b/tests/ui/issues/issue-34571.rs index 5498091da58..c392f59d8da 100644 --- a/tests/ui/issues/issue-34571.rs +++ b/tests/ui/issues/issue-34571.rs @@ -1,7 +1,7 @@ // run-pass #[repr(u8)] enum Foo { - Foo(#[allow(unused_tuple_struct_fields)] u8), + Foo(#[allow(dead_code)] u8), } fn main() { diff --git a/tests/ui/issues/issue-36278-prefix-nesting.rs b/tests/ui/issues/issue-36278-prefix-nesting.rs index a809f7f1329..5f476932018 100644 --- a/tests/ui/issues/issue-36278-prefix-nesting.rs +++ b/tests/ui/issues/issue-36278-prefix-nesting.rs @@ -5,7 +5,7 @@ use std::mem; const SZ: usize = 100; -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct P<T: ?Sized>([u8; SZ], T); type Ack<T> = P<P<T>>; diff --git a/tests/ui/issues/issue-39367.rs b/tests/ui/issues/issue-39367.rs index e7beb8a0392..039b47ae780 100644 --- a/tests/ui/issues/issue-39367.rs +++ b/tests/ui/issues/issue-39367.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck use std::ops::Deref; diff --git a/tests/ui/issues/issue-4252.rs b/tests/ui/issues/issue-4252.rs index 0d47a7f0c16..9b82121baa2 100644 --- a/tests/ui/issues/issue-4252.rs +++ b/tests/ui/issues/issue-4252.rs @@ -7,7 +7,7 @@ trait X { } #[derive(Debug)] -struct Y(#[allow(unused_tuple_struct_fields)] isize); +struct Y(#[allow(dead_code)] isize); #[derive(Debug)] struct Z<T: X+std::fmt::Debug> { diff --git a/tests/ui/issues/issue-46069.rs b/tests/ui/issues/issue-46069.rs index c418128c186..f80ea932001 100644 --- a/tests/ui/issues/issue-46069.rs +++ b/tests/ui/issues/issue-46069.rs @@ -2,7 +2,7 @@ use std::iter::{Fuse, Cloned}; use std::slice::Iter; -struct Foo<'a, T: 'a>(#[allow(unused_tuple_struct_fields)] &'a T); +struct Foo<'a, T: 'a>(#[allow(dead_code)] &'a T); impl<'a, T: 'a> Copy for Foo<'a, T> {} impl<'a, T: 'a> Clone for Foo<'a, T> { fn clone(&self) -> Self { *self } diff --git a/tests/ui/issues/issue-48131.mir.stderr b/tests/ui/issues/issue-48131.mir.stderr deleted file mode 100644 index 6817e8830c5..00000000000 --- a/tests/ui/issues/issue-48131.mir.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: unnecessary `unsafe` block - --> $DIR/issue-48131.rs:12:9 - | -LL | unsafe { /* unnecessary */ } - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/issue-48131.rs:6:9 - | -LL | #![deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/issue-48131.rs:23:13 - | -LL | unsafe { /* unnecessary */ } - | ^^^^^^ unnecessary `unsafe` block - -error: aborting due to 2 previous errors - diff --git a/tests/ui/issues/issue-48131.rs b/tests/ui/issues/issue-48131.rs index df98547084d..85664e62ead 100644 --- a/tests/ui/issues/issue-48131.rs +++ b/tests/ui/issues/issue-48131.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - // This note is annotated because the purpose of the test // is to ensure that certain other notes are not generated. #![deny(unused_unsafe)] //~ NOTE diff --git a/tests/ui/issues/issue-48131.thir.stderr b/tests/ui/issues/issue-48131.stderr index 6817e8830c5..5acc4f16e9f 100644 --- a/tests/ui/issues/issue-48131.thir.stderr +++ b/tests/ui/issues/issue-48131.stderr @@ -1,17 +1,17 @@ error: unnecessary `unsafe` block - --> $DIR/issue-48131.rs:12:9 + --> $DIR/issue-48131.rs:9:9 | LL | unsafe { /* unnecessary */ } | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/issue-48131.rs:6:9 + --> $DIR/issue-48131.rs:3:9 | LL | #![deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/issue-48131.rs:23:13 + --> $DIR/issue-48131.rs:20:13 | LL | unsafe { /* unnecessary */ } | ^^^^^^ unnecessary `unsafe` block diff --git a/tests/ui/issues/issue-5315.rs b/tests/ui/issues/issue-5315.rs index 0c121a5eee6..81d075a98a9 100644 --- a/tests/ui/issues/issue-5315.rs +++ b/tests/ui/issues/issue-5315.rs @@ -1,7 +1,7 @@ // run-pass // pretty-expanded FIXME #23616 -struct A(#[allow(unused_tuple_struct_fields)] bool); +struct A(#[allow(dead_code)] bool); pub fn main() { let f = A; diff --git a/tests/ui/issues/issue-5844.mir.stderr b/tests/ui/issues/issue-5844.mir.stderr deleted file mode 100644 index 4434f5a0ff2..00000000000 --- a/tests/ui/issues/issue-5844.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/issue-5844.rs:8:5 - | -LL | issue_5844_aux::rand(); - | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/issues/issue-5844.rs b/tests/ui/issues/issue-5844.rs index 4f90a9c6645..0db1ccf76d9 100644 --- a/tests/ui/issues/issue-5844.rs +++ b/tests/ui/issues/issue-5844.rs @@ -1,9 +1,7 @@ //aux-build:issue-5844-aux.rs -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck extern crate issue_5844_aux; -fn main () { +fn main() { issue_5844_aux::rand(); //~ ERROR: requires unsafe } diff --git a/tests/ui/issues/issue-5844.thir.stderr b/tests/ui/issues/issue-5844.stderr index 6074f7d0ed4..bae917fa72c 100644 --- a/tests/ui/issues/issue-5844.thir.stderr +++ b/tests/ui/issues/issue-5844.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `rand` is unsafe and requires unsafe function or block - --> $DIR/issue-5844.rs:8:5 + --> $DIR/issue-5844.rs:6:5 | LL | issue_5844_aux::rand(); | ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/issues/issue-61894.rs b/tests/ui/issues/issue-61894.rs index 776fdbb7466..fe934bdeb60 100644 --- a/tests/ui/issues/issue-61894.rs +++ b/tests/ui/issues/issue-61894.rs @@ -4,7 +4,7 @@ use std::any::type_name; -struct Bar<M>(#[allow(unused_tuple_struct_fields)] M); +struct Bar<M>(#[allow(dead_code)] M); impl<M> Bar<M> { fn foo(&self) -> &'static str { diff --git a/tests/ui/issues/issue-7911.rs b/tests/ui/issues/issue-7911.rs index f64887136ca..d4db3b0776b 100644 --- a/tests/ui/issues/issue-7911.rs +++ b/tests/ui/issues/issue-7911.rs @@ -6,7 +6,7 @@ trait FooBar { fn dummy(&self) { } } -struct Bar(#[allow(unused_tuple_struct_fields)] i32); +struct Bar(#[allow(dead_code)] i32); struct Foo { bar: Bar } impl FooBar for Bar {} diff --git a/tests/ui/issues/issue-99838.rs b/tests/ui/issues/issue-99838.rs index 2e81d5e8221..3bddca43daa 100644 --- a/tests/ui/issues/issue-99838.rs +++ b/tests/ui/issues/issue-99838.rs @@ -2,7 +2,7 @@ use std::hint; -struct U16(u16); +struct U16(#[allow(dead_code)] u16); impl Drop for U16 { fn drop(&mut self) { @@ -23,7 +23,7 @@ struct Wrapper { } #[repr(packed)] -struct Misalign(u8, Wrapper); +struct Misalign(#[allow(dead_code)] u8, Wrapper); fn main() { let m = Misalign( diff --git a/tests/ui/layout/issue-84108.stderr b/tests/ui/layout/issue-84108.stderr index 3a02e73f96b..d6d75851034 100644 --- a/tests/ui/layout/issue-84108.stderr +++ b/tests/ui/layout/issue-84108.stderr @@ -29,15 +29,6 @@ LL | const BAR: (&Path, [u8], usize) = ("hello", [], 42); = help: the trait `Sized` is not implemented for `[u8]` = note: only the last element of a tuple may have a dynamically sized type -error[E0277]: the size for values of type `[u8]` cannot be known at compilation time - --> $DIR/issue-84108.rs:14:13 - | -LL | static BAZ: ([u8], usize) = ([], 0); - | ^^^^^^^^^^^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `[u8]` - = note: only the last element of a tuple may have a dynamically sized type - error[E0308]: mismatched types --> $DIR/issue-84108.rs:9:45 | @@ -47,6 +38,15 @@ LL | const BAR: (&Path, [u8], usize) = ("hello", [], 42); = note: expected slice `[u8]` found array `[_; 0]` +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time + --> $DIR/issue-84108.rs:14:13 + | +LL | static BAZ: ([u8], usize) = ([], 0); + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + = help: the trait `Sized` is not implemented for `[u8]` + = note: only the last element of a tuple may have a dynamically sized type + error[E0308]: mismatched types --> $DIR/issue-84108.rs:14:30 | diff --git a/tests/ui/layout/unsafe-cell-hides-niche.rs b/tests/ui/layout/unsafe-cell-hides-niche.rs index 68bcc3c1aff..8d6cea10933 100644 --- a/tests/ui/layout/unsafe-cell-hides-niche.rs +++ b/tests/ui/layout/unsafe-cell-hides-niche.rs @@ -14,10 +14,10 @@ use std::mem::size_of; use std::num::NonZeroU32 as N32; use std::sync::{Mutex, RwLock}; -struct Wrapper<T>(#[allow(unused_tuple_struct_fields)] T); +struct Wrapper<T>(#[allow(dead_code)] T); #[repr(transparent)] -struct Transparent<T>(#[allow(unused_tuple_struct_fields)] T); +struct Transparent<T>(#[allow(dead_code)] T); struct NoNiche<T>(UnsafeCell<T>); diff --git a/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs b/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs index b0b6b318d8f..782c38200a0 100644 --- a/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs +++ b/tests/ui/lifetimes/issue-76168-hr-outlives-3.rs @@ -6,10 +6,9 @@ use std::future::Future; async fn wrapper<F>(f: F) //~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` //~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` -//~| ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` where - F:, - for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, +F:, +for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, { //~^ ERROR: expected a `FnOnce(&'a mut i32)` closure, found `i32` let mut i = 41; diff --git a/tests/ui/lifetimes/issue-76168-hr-outlives-3.stderr b/tests/ui/lifetimes/issue-76168-hr-outlives-3.stderr index 5b77051dc88..89ebdb57f3c 100644 --- a/tests/ui/lifetimes/issue-76168-hr-outlives-3.stderr +++ b/tests/ui/lifetimes/issue-76168-hr-outlives-3.stderr @@ -4,11 +4,10 @@ error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` LL | / async fn wrapper<F>(f: F) LL | | LL | | -LL | | LL | | where -LL | | F:, -LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, - | |______________________________________________________________________________^ expected an `FnOnce(&'a mut i32)` closure, found `i32` +LL | | F:, +LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, + | |__________________________________________________________________________^ expected an `FnOnce(&'a mut i32)` closure, found `i32` | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` @@ -21,7 +20,7 @@ LL | async fn wrapper<F>(f: F) = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` - --> $DIR/issue-76168-hr-outlives-3.rs:13:1 + --> $DIR/issue-76168-hr-outlives-3.rs:12:1 | LL | / { LL | | @@ -32,20 +31,6 @@ LL | | } | = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` -error[E0277]: expected a `FnOnce(&'a mut i32)` closure, found `i32` - --> $DIR/issue-76168-hr-outlives-3.rs:6:1 - | -LL | / async fn wrapper<F>(f: F) -LL | | -LL | | -LL | | -LL | | where -LL | | F:, -LL | | for<'a> <i32 as FnOnce<(&'a mut i32,)>>::Output: Future<Output = ()> + 'a, - | |______________________________________________________________________________^ expected an `FnOnce(&'a mut i32)` closure, found `i32` - | - = help: the trait `for<'a> FnOnce<(&'a mut i32,)>` is not implemented for `i32` - -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/lint/dead-code/lint-dead-code-1.rs b/tests/ui/lint/dead-code/lint-dead-code-1.rs index 8f5a4c41ef2..ddcafedf7bc 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-1.rs +++ b/tests/ui/lint/dead-code/lint-dead-code-1.rs @@ -37,7 +37,7 @@ struct UsedStruct1 { #[allow(dead_code)] x: isize } -struct UsedStruct2(isize); +struct UsedStruct2(#[allow(dead_code)] isize); struct UsedStruct3; pub struct UsedStruct4; // this struct is never used directly, but its method is, so we don't want diff --git a/tests/ui/lint/dead-code/lint-dead-code-5.rs b/tests/ui/lint/dead-code/lint-dead-code-5.rs index ed90fb46429..76067d114a1 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-5.rs +++ b/tests/ui/lint/dead-code/lint-dead-code-5.rs @@ -2,12 +2,12 @@ #![deny(dead_code)] enum Enum1 { - Variant1(isize), + Variant1(#[allow(dead_code)] isize), Variant2 //~ ERROR: variant `Variant2` is never constructed } enum Enum2 { - Variant3(bool), + Variant3(#[allow(dead_code)] bool), #[allow(dead_code)] Variant4(isize), Variant5 { _x: isize }, //~ ERROR: variants `Variant5` and `Variant6` are never constructed @@ -15,7 +15,7 @@ enum Enum2 { _Variant7, Variant8 { _field: bool }, Variant9, - Variant10(usize) + Variant10(#[allow(dead_code)] usize) } impl Enum2 { diff --git a/tests/ui/lint/dead-code/lint-dead-code-5.stderr b/tests/ui/lint/dead-code/lint-dead-code-5.stderr index eaf43e45361..a583f234a3d 100644 --- a/tests/ui/lint/dead-code/lint-dead-code-5.stderr +++ b/tests/ui/lint/dead-code/lint-dead-code-5.stderr @@ -3,7 +3,7 @@ error: variant `Variant2` is never constructed | LL | enum Enum1 { | ----- variant in this enum -LL | Variant1(isize), +LL | Variant1(#[allow(dead_code)] isize), LL | Variant2 | ^^^^^^^^ | diff --git a/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.rs b/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.rs index a478153b3f4..942c5516500 100644 --- a/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.rs +++ b/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.rs @@ -17,7 +17,7 @@ struct Bar { // Issue 119267: this should not ICE. #[derive(Debug)] -struct Foo(usize, #[allow(unused)] usize); +struct Foo(usize, #[allow(unused)] usize); //~ WARN field `0` is never read fn main() { Bar { diff --git a/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.stderr b/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.stderr index 0e5c78a7167..06f9b229c18 100644 --- a/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.stderr +++ b/tests/ui/lint/dead-code/multiple-dead-codes-in-the-same-struct.stderr @@ -51,5 +51,19 @@ note: the lint level is defined here LL | #[forbid(dead_code)] | ^^^^^^^^^ -error: aborting due to 2 previous errors; 1 warning emitted +warning: field `0` is never read + --> $DIR/multiple-dead-codes-in-the-same-struct.rs:20:12 + | +LL | struct Foo(usize, #[allow(unused)] usize); + | --- ^^^^^ + | | + | field in this struct + | + = note: `Foo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis +help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field + | +LL | struct Foo((), #[allow(unused)] usize); + | ~~ + +error: aborting due to 2 previous errors; 2 warnings emitted diff --git a/tests/ui/lint/dead-code/tuple-struct-field.rs b/tests/ui/lint/dead-code/tuple-struct-field.rs index 14fb30be949..d13fe029289 100644 --- a/tests/ui/lint/dead-code/tuple-struct-field.rs +++ b/tests/ui/lint/dead-code/tuple-struct-field.rs @@ -1,4 +1,4 @@ -#![deny(unused_tuple_struct_fields)] +#![deny(dead_code)] //~^ NOTE: the lint level is defined here use std::marker::PhantomData; diff --git a/tests/ui/lint/dead-code/tuple-struct-field.stderr b/tests/ui/lint/dead-code/tuple-struct-field.stderr index b8ad5cbe4e9..0154d5489f9 100644 --- a/tests/ui/lint/dead-code/tuple-struct-field.stderr +++ b/tests/ui/lint/dead-code/tuple-struct-field.stderr @@ -9,8 +9,8 @@ LL | struct SingleUnused(i32, [u8; LEN], String); note: the lint level is defined here --> $DIR/tuple-struct-field.rs:1:9 | -LL | #![deny(unused_tuple_struct_fields)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![deny(dead_code)] + | ^^^^^^^^^ help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field | LL | struct SingleUnused(i32, (), String); diff --git a/tests/ui/lint/dead-code/with-impl.rs b/tests/ui/lint/dead-code/with-impl.rs index 812fcdd09b6..147ec7b9e2e 100644 --- a/tests/ui/lint/dead-code/with-impl.rs +++ b/tests/ui/lint/dead-code/with-impl.rs @@ -2,7 +2,7 @@ #![deny(dead_code)] -pub struct GenericFoo<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct GenericFoo<T>(#[allow(dead_code)] T); type Foo = GenericFoo<u32>; diff --git a/tests/ui/lint/unused/issue-104397.rs b/tests/ui/lint/unused/issue-104397.rs index 94e15cd96bc..c17e532c17f 100644 --- a/tests/ui/lint/unused/issue-104397.rs +++ b/tests/ui/lint/unused/issue-104397.rs @@ -3,7 +3,7 @@ #![warn(unused)] #![deny(warnings)] -struct Inv<'a>(&'a mut &'a ()); +struct Inv<'a>(#[allow(dead_code)] &'a mut &'a ()); trait Trait {} impl Trait for for<'a> fn(Inv<'a>) {} diff --git a/tests/ui/lint/unused/issue-105061-should-lint.rs b/tests/ui/lint/unused/issue-105061-should-lint.rs index 7e4e0947349..433c2882089 100644 --- a/tests/ui/lint/unused/issue-105061-should-lint.rs +++ b/tests/ui/lint/unused/issue-105061-should-lint.rs @@ -1,7 +1,7 @@ #![warn(unused)] #![deny(warnings)] -struct Inv<'a>(&'a mut &'a ()); +struct Inv<'a>(#[allow(dead_code)] &'a mut &'a ()); trait Trait<'a> {} impl<'b> Trait<'b> for for<'a> fn(Inv<'a>) {} diff --git a/tests/ui/lint/unused/issue-105061.rs b/tests/ui/lint/unused/issue-105061.rs index 92d636d0ac6..6043daf209d 100644 --- a/tests/ui/lint/unused/issue-105061.rs +++ b/tests/ui/lint/unused/issue-105061.rs @@ -1,7 +1,7 @@ #![warn(unused)] #![deny(warnings)] -struct Inv<'a>(&'a mut &'a ()); +struct Inv<'a>(#[allow(dead_code)] &'a mut &'a ()); trait Trait {} impl Trait for (for<'a> fn(Inv<'a>),) {} diff --git a/tests/ui/list.rs b/tests/ui/list.rs index ffe9f93860a..e44c94b3219 100644 --- a/tests/ui/list.rs +++ b/tests/ui/list.rs @@ -3,7 +3,7 @@ #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 -enum list { #[allow(unused_tuple_struct_fields)] cons(isize, Box<list>), nil, } +enum list { #[allow(dead_code)] cons(isize, Box<list>), nil, } pub fn main() { list::cons(10, Box::new(list::cons(11, Box::new(list::cons(12, Box::new(list::nil)))))); diff --git a/tests/ui/lto/lto-still-runs-thread-dtors.rs b/tests/ui/lto/lto-still-runs-thread-dtors.rs index 1c7368b36e1..635ad783b31 100644 --- a/tests/ui/lto/lto-still-runs-thread-dtors.rs +++ b/tests/ui/lto/lto-still-runs-thread-dtors.rs @@ -2,8 +2,6 @@ // compile-flags: -C lto // no-prefer-dynamic // ignore-emscripten no threads support -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck use std::thread; diff --git a/tests/ui/macros/html-literals.rs b/tests/ui/macros/html-literals.rs index 26f00fed9c4..e5ff425041a 100644 --- a/tests/ui/macros/html-literals.rs +++ b/tests/ui/macros/html-literals.rs @@ -88,7 +88,7 @@ pub fn main() { ); } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum HTMLFragment { tag(String, Vec<HTMLFragment> ), text(String), diff --git a/tests/ui/macros/macro-tt-followed-by-seq.rs b/tests/ui/macros/macro-tt-followed-by-seq.rs index 080dbcfdd41..67238df8524 100644 --- a/tests/ui/macros/macro-tt-followed-by-seq.rs +++ b/tests/ui/macros/macro-tt-followed-by-seq.rs @@ -5,7 +5,7 @@ use self::Join::*; #[derive(Debug)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] enum Join<A,B> { Keep(A,B), Skip(A,B), diff --git a/tests/ui/methods/method-argument-inference-associated-type.rs b/tests/ui/methods/method-argument-inference-associated-type.rs index a3c31fab1c2..852747d06b5 100644 --- a/tests/ui/methods/method-argument-inference-associated-type.rs +++ b/tests/ui/methods/method-argument-inference-associated-type.rs @@ -7,7 +7,7 @@ pub trait Service { fn call(&self, _req: Self::Request); } -pub struct S<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct S<T>(#[allow(dead_code)] T); impl Service for ClientMap { type Request = S<Box<dyn Fn(i32)>>; diff --git a/tests/ui/methods/method-probe-no-guessing-dyn-trait.rs b/tests/ui/methods/method-probe-no-guessing-dyn-trait.rs index ec41b711709..787191a26fb 100644 --- a/tests/ui/methods/method-probe-no-guessing-dyn-trait.rs +++ b/tests/ui/methods/method-probe-no-guessing-dyn-trait.rs @@ -15,7 +15,7 @@ trait MyTrait1 { impl MyTrait1 for Foo<u32> {} -struct Foo<T>(#[allow(unused_tuple_struct_fields)] T); +struct Foo<T>(#[allow(dead_code)] T); impl Deref for Foo<()> { type Target = dyn MyTrait1 + 'static; @@ -33,7 +33,7 @@ trait MyTrait2 { } impl MyTrait2 for u32 {} -struct Bar<T>(#[allow(unused_tuple_struct_fields)] T, u32); +struct Bar<T>(#[allow(dead_code)] T, u32); impl Deref for Bar<u8> { type Target = dyn MyTrait2 + 'static; fn deref(&self) -> &(dyn MyTrait2 + 'static) { diff --git a/tests/ui/mir/mir_codegen_switch.rs b/tests/ui/mir/mir_codegen_switch.rs index 9c93499d948..afdcd36f4bc 100644 --- a/tests/ui/mir/mir_codegen_switch.rs +++ b/tests/ui/mir/mir_codegen_switch.rs @@ -1,7 +1,7 @@ // run-pass enum Abc { - A(#[allow(unused_tuple_struct_fields)] u8), - B(#[allow(unused_tuple_struct_fields)] i8), + A(#[allow(dead_code)] u8), + B(#[allow(dead_code)] i8), C, D, } diff --git a/tests/ui/mir/mir_fat_ptr.rs b/tests/ui/mir/mir_fat_ptr.rs index 7c3e07c9e34..0c07fba6e94 100644 --- a/tests/ui/mir/mir_fat_ptr.rs +++ b/tests/ui/mir/mir_fat_ptr.rs @@ -1,7 +1,7 @@ // run-pass // test that ordinary fat pointer operations work. -struct Wrapper<T: ?Sized>(#[allow(unused_tuple_struct_fields)] u32, T); +struct Wrapper<T: ?Sized>(#[allow(dead_code)] u32, T); struct FatPtrContainer<'a> { ptr: &'a [u8] diff --git a/tests/ui/mir/mir_raw_fat_ptr.rs b/tests/ui/mir/mir_raw_fat_ptr.rs index f4a9afd2308..8e5a2043dc6 100644 --- a/tests/ui/mir/mir_raw_fat_ptr.rs +++ b/tests/ui/mir/mir_raw_fat_ptr.rs @@ -105,7 +105,7 @@ impl<T> Foo for T { } } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S<T:?Sized>(u32, T); fn main_ref() { diff --git a/tests/ui/mir/mir_refs_correct.rs b/tests/ui/mir/mir_refs_correct.rs index 6cd9526b749..c5b57f52743 100644 --- a/tests/ui/mir/mir_refs_correct.rs +++ b/tests/ui/mir/mir_refs_correct.rs @@ -3,7 +3,7 @@ extern crate mir_external_refs as ext; -struct S(#[allow(unused_tuple_struct_fields)] u8); +struct S(#[allow(dead_code)] u8); #[derive(Debug, PartialEq, Eq)] struct Unit; @@ -46,7 +46,7 @@ impl<I, O> T<I, O> for O {} impl X for S {} enum E { - U(#[allow(unused_tuple_struct_fields)] u8) + U(#[allow(dead_code)] u8) } #[derive(PartialEq, Debug, Eq)] diff --git a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed index 63b65ab20fe..b8eeb3d5cae 100644 --- a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed +++ b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.fixed @@ -4,7 +4,7 @@ macro_rules! my_wrapper { ($expr:expr) => { MyWrapper($expr) } } -pub struct MyWrapper(u32); +pub struct MyWrapper(#[allow(dead_code)] u32); fn main() { let value = MyWrapper(123); diff --git a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.rs b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.rs index 2ab4e3955f3..54a13c67350 100644 --- a/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.rs +++ b/tests/ui/mismatched_types/suggest-removing-tuple-struct-field.rs @@ -4,7 +4,7 @@ macro_rules! my_wrapper { ($expr:expr) => { MyWrapper($expr) } } -pub struct MyWrapper(u32); +pub struct MyWrapper(#[allow(dead_code)] u32); fn main() { let value = MyWrapper(123); diff --git a/tests/ui/nullable-pointer-iotareduction.rs b/tests/ui/nullable-pointer-iotareduction.rs index d345fec8118..3f3a962664e 100644 --- a/tests/ui/nullable-pointer-iotareduction.rs +++ b/tests/ui/nullable-pointer-iotareduction.rs @@ -8,7 +8,7 @@ // trying to get assert failure messages that at least identify which case // failed. -enum E<T> { Thing(isize, T), #[allow(unused_tuple_struct_fields)] Nothing((), ((), ()), [i8; 0]) } +enum E<T> { Thing(isize, T), #[allow(dead_code)] Nothing((), ((), ()), [i8; 0]) } impl<T> E<T> { fn is_none(&self) -> bool { match *self { diff --git a/tests/ui/optimization-fuel-0.rs b/tests/ui/optimization-fuel-0.rs index 2643dbea1c4..77c727ad0f7 100644 --- a/tests/ui/optimization-fuel-0.rs +++ b/tests/ui/optimization-fuel-0.rs @@ -6,9 +6,9 @@ use std::mem::size_of; // compile-flags: -Z fuel=foo=0 -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S1(u8, u16, u8); -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S2(u8, u16, u8); fn main() { diff --git a/tests/ui/optimization-fuel-1.rs b/tests/ui/optimization-fuel-1.rs index d5e2255d9f0..8b3d139201e 100644 --- a/tests/ui/optimization-fuel-1.rs +++ b/tests/ui/optimization-fuel-1.rs @@ -6,9 +6,9 @@ use std::mem::size_of; // compile-flags: -Z fuel=foo=1 -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S1(u8, u16, u8); -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S2(u8, u16, u8); fn main() { diff --git a/tests/ui/packed/issue-118537-field-offset-ice.rs b/tests/ui/packed/issue-118537-field-offset-ice.rs index 657aec64003..679d9d754e3 100644 --- a/tests/ui/packed/issue-118537-field-offset-ice.rs +++ b/tests/ui/packed/issue-118537-field-offset-ice.rs @@ -3,7 +3,7 @@ use std::mem; #[repr(packed(4))] -struct Slice([u32]); +struct Slice(#[allow(dead_code)] [u32]); #[repr(packed(2), C)] struct PackedSized { diff --git a/tests/ui/packed/packed-struct-drop-aligned.rs b/tests/ui/packed/packed-struct-drop-aligned.rs index 4fec72763a4..6c2907c86e9 100644 --- a/tests/ui/packed/packed-struct-drop-aligned.rs +++ b/tests/ui/packed/packed-struct-drop-aligned.rs @@ -24,7 +24,7 @@ impl<'a> Drop for Aligned<'a> { } #[repr(transparent)] -struct NotCopy(#[allow(unused_tuple_struct_fields)] u8); +struct NotCopy(#[allow(dead_code)] u8); #[repr(packed)] struct Packed<'a>(NotCopy, Aligned<'a>); diff --git a/tests/ui/packed/packed-struct-optimized-enum.rs b/tests/ui/packed/packed-struct-optimized-enum.rs index 5e1a1f518c5..c3540f7619b 100644 --- a/tests/ui/packed/packed-struct-optimized-enum.rs +++ b/tests/ui/packed/packed-struct-optimized-enum.rs @@ -1,6 +1,6 @@ // run-pass #[repr(packed)] -struct Packed<T: Copy>(#[allow(unused_tuple_struct_fields)] T); +struct Packed<T: Copy>(#[allow(dead_code)] T); impl<T: Copy> Copy for Packed<T> {} impl<T: Copy> Clone for Packed<T> { diff --git a/tests/ui/packed/packed-tuple-struct-layout.rs b/tests/ui/packed/packed-tuple-struct-layout.rs index 931be5b9414..879553142da 100644 --- a/tests/ui/packed/packed-tuple-struct-layout.rs +++ b/tests/ui/packed/packed-tuple-struct-layout.rs @@ -2,11 +2,11 @@ use std::mem; #[repr(packed)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S4(u8,[u8; 3]); #[repr(packed)] -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S5(u8,u32); pub fn main() { diff --git a/tests/ui/parser/issues/issue-70388-without-witness.fixed b/tests/ui/parser/issues/issue-70388-without-witness.fixed index 8d981405ea1..58721495dcd 100644 --- a/tests/ui/parser/issues/issue-70388-without-witness.fixed +++ b/tests/ui/parser/issues/issue-70388-without-witness.fixed @@ -1,7 +1,7 @@ // run-rustfix // This is for checking if we can apply suggestions as-is. -pub struct Foo(#[allow(unused_tuple_struct_fields)] i32); +pub struct Foo(#[allow(dead_code)] i32); fn main() { let Foo(..) = Foo(0); //~ ERROR unexpected `...` diff --git a/tests/ui/parser/issues/issue-70388-without-witness.rs b/tests/ui/parser/issues/issue-70388-without-witness.rs index bf36073083a..2e679db5464 100644 --- a/tests/ui/parser/issues/issue-70388-without-witness.rs +++ b/tests/ui/parser/issues/issue-70388-without-witness.rs @@ -1,7 +1,7 @@ // run-rustfix // This is for checking if we can apply suggestions as-is. -pub struct Foo(#[allow(unused_tuple_struct_fields)] i32); +pub struct Foo(#[allow(dead_code)] i32); fn main() { let Foo(...) = Foo(0); //~ ERROR unexpected `...` diff --git a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed index 227c40e97c0..a09ff3e5417 100644 --- a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed +++ b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.fixed @@ -1,7 +1,7 @@ // Regression test for issues #100790 and #106439. // run-rustfix -pub struct Example(usize) +pub struct Example(#[allow(dead_code)] usize) where (): Sized; //~^^^ ERROR where clauses are not allowed before tuple struct bodies diff --git a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs index 3699e6fe572..e86f2a8acb8 100644 --- a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs +++ b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.rs @@ -4,7 +4,7 @@ pub struct Example where (): Sized, -(usize); +(#[allow(dead_code)] usize); //~^^^ ERROR where clauses are not allowed before tuple struct bodies struct _Demo diff --git a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr index 18aa5fadb6b..ddbf237e866 100644 --- a/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr +++ b/tests/ui/parser/recover/recover-where-clause-before-tuple-struct-body-0.stderr @@ -6,12 +6,12 @@ LL | pub struct Example LL | / where LL | | (): Sized, | |______________^ unexpected where clause -LL | (usize); - | ------- the struct body +LL | (#[allow(dead_code)] usize); + | --------------------------- the struct body | help: move the body before the where clause | -LL ~ pub struct Example(usize) +LL ~ pub struct Example(#[allow(dead_code)] usize) LL | where LL ~ (): Sized; | diff --git a/tests/ui/pattern/non-structural-match-types.mir.stderr b/tests/ui/pattern/non-structural-match-types.mir.stderr deleted file mode 100644 index 7a9e5b7e02e..00000000000 --- a/tests/ui/pattern/non-structural-match-types.mir.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: `{closure@$DIR/non-structural-match-types.rs:12:17: 12:19}` cannot be used in patterns - --> $DIR/non-structural-match-types.rs:12:9 - | -LL | const { || {} } => {} - | ^^^^^^^^^^^^^^^ - -error: `{async block@$DIR/non-structural-match-types.rs:15:17: 15:25}` cannot be used in patterns - --> $DIR/non-structural-match-types.rs:15:9 - | -LL | const { async {} } => {} - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/tests/ui/pattern/non-structural-match-types.rs b/tests/ui/pattern/non-structural-match-types.rs index fb7779fa808..b4f19bb8294 100644 --- a/tests/ui/pattern/non-structural-match-types.rs +++ b/tests/ui/pattern/non-structural-match-types.rs @@ -1,6 +1,4 @@ // edition:2021 -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck #![allow(incomplete_features)] #![allow(unreachable_code)] diff --git a/tests/ui/pattern/non-structural-match-types.stderr b/tests/ui/pattern/non-structural-match-types.stderr new file mode 100644 index 00000000000..4a6990da56f --- /dev/null +++ b/tests/ui/pattern/non-structural-match-types.stderr @@ -0,0 +1,14 @@ +error: `{closure@$DIR/non-structural-match-types.rs:10:17: 10:19}` cannot be used in patterns + --> $DIR/non-structural-match-types.rs:10:9 + | +LL | const { || {} } => {} + | ^^^^^^^^^^^^^^^ + +error: `{async block@$DIR/non-structural-match-types.rs:13:17: 13:25}` cannot be used in patterns + --> $DIR/non-structural-match-types.rs:13:9 + | +LL | const { async {} } => {} + | ^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/pattern/non-structural-match-types.thir.stderr b/tests/ui/pattern/non-structural-match-types.thir.stderr deleted file mode 100644 index 7a9e5b7e02e..00000000000 --- a/tests/ui/pattern/non-structural-match-types.thir.stderr +++ /dev/null @@ -1,14 +0,0 @@ -error: `{closure@$DIR/non-structural-match-types.rs:12:17: 12:19}` cannot be used in patterns - --> $DIR/non-structural-match-types.rs:12:9 - | -LL | const { || {} } => {} - | ^^^^^^^^^^^^^^^ - -error: `{async block@$DIR/non-structural-match-types.rs:15:17: 15:25}` cannot be used in patterns - --> $DIR/non-structural-match-types.rs:15:9 - | -LL | const { async {} } => {} - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/tests/ui/pattern/usefulness/issue-57472.rs b/tests/ui/pattern/usefulness/issue-57472.rs index 1131006374c..17c252de2be 100644 --- a/tests/ui/pattern/usefulness/issue-57472.rs +++ b/tests/ui/pattern/usefulness/issue-57472.rs @@ -1,4 +1,4 @@ -#![crate_type="lib"] +#![crate_type = "lib"] #![deny(unreachable_patterns)] mod test_struct { @@ -26,10 +26,12 @@ mod test_union { } pub fn test(punned: Punned) { - match punned { - Punned { foo: [_] } => println!("foo"), - Punned { bar: [_] } => println!("bar"), - //~^ ERROR unreachable pattern [unreachable_patterns] + unsafe { + match punned { + Punned { foo: [_] } => println!("foo"), + Punned { bar: [_] } => println!("bar"), + //~^ ERROR unreachable pattern [unreachable_patterns] + } } } } diff --git a/tests/ui/pattern/usefulness/issue-57472.stderr b/tests/ui/pattern/usefulness/issue-57472.stderr index 26efdf6dbaf..c814eaec0d1 100644 --- a/tests/ui/pattern/usefulness/issue-57472.stderr +++ b/tests/ui/pattern/usefulness/issue-57472.stderr @@ -11,10 +11,10 @@ LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/issue-57472.rs:31:13 + --> $DIR/issue-57472.rs:32:17 | -LL | Punned { bar: [_] } => println!("bar"), - | ^^^^^^^^^^^^^^^^^^^ +LL | Punned { bar: [_] } => println!("bar"), + | ^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors diff --git a/tests/ui/process/no-stdio.rs b/tests/ui/process/no-stdio.rs index 24985386a97..68e6fa838b4 100644 --- a/tests/ui/process/no-stdio.rs +++ b/tests/ui/process/no-stdio.rs @@ -2,8 +2,6 @@ // ignore-android // ignore-emscripten no processes // ignore-sgx no processes -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck #![feature(rustc_private)] diff --git a/tests/ui/pub/pub-ident-struct-4.fixed b/tests/ui/pub/pub-ident-struct-4.fixed index b49fa678e1b..71c6f0a6994 100644 --- a/tests/ui/pub/pub-ident-struct-4.fixed +++ b/tests/ui/pub/pub-ident-struct-4.fixed @@ -1,6 +1,6 @@ // run-rustfix -pub struct T(String); +pub struct T(#[allow(dead_code)] String); //~^ ERROR missing `struct` for struct definition fn main() {} diff --git a/tests/ui/pub/pub-ident-struct-4.rs b/tests/ui/pub/pub-ident-struct-4.rs index 20bc94b0acb..971f39a8ce1 100644 --- a/tests/ui/pub/pub-ident-struct-4.rs +++ b/tests/ui/pub/pub-ident-struct-4.rs @@ -1,6 +1,6 @@ // run-rustfix -pub T(String); +pub T(#[allow(dead_code)] String); //~^ ERROR missing `struct` for struct definition fn main() {} diff --git a/tests/ui/pub/pub-ident-struct-4.stderr b/tests/ui/pub/pub-ident-struct-4.stderr index 470874e0637..5fbb02c8673 100644 --- a/tests/ui/pub/pub-ident-struct-4.stderr +++ b/tests/ui/pub/pub-ident-struct-4.stderr @@ -1,12 +1,12 @@ error: missing `struct` for struct definition --> $DIR/pub-ident-struct-4.rs:3:4 | -LL | pub T(String); +LL | pub T(#[allow(dead_code)] String); | ^ | help: add `struct` here to parse `T` as a public struct | -LL | pub struct T(String); +LL | pub struct T(#[allow(dead_code)] String); | ++++++ error: aborting due to 1 previous error diff --git a/tests/ui/range_inclusive.rs b/tests/ui/range_inclusive.rs index c9107d24ed0..2425113b904 100644 --- a/tests/ui/range_inclusive.rs +++ b/tests/ui/range_inclusive.rs @@ -11,7 +11,7 @@ fn foo() -> isize { 42 } pub fn return_range_to() -> RangeToInclusive<i32> { return ..=1; } #[derive(Debug)] -struct P(#[allow(unused_tuple_struct_fields)] u8); +struct P(#[allow(dead_code)] u8); pub fn main() { let mut count = 0; diff --git a/tests/ui/recursion_limit/issue-40003.rs b/tests/ui/recursion_limit/issue-40003.rs index 5e61361f987..01a2aaffb9e 100644 --- a/tests/ui/recursion_limit/issue-40003.rs +++ b/tests/ui/recursion_limit/issue-40003.rs @@ -153,7 +153,7 @@ mod stream { } enum Slot<T> { - Next(#[allow(unused_tuple_struct_fields)] usize), + Next(#[allow(dead_code)] usize), _Data { _a: T }, } diff --git a/tests/ui/repr/align-with-extern-c-fn.rs b/tests/ui/repr/align-with-extern-c-fn.rs index 9e490e27ad1..659ef88fce6 100644 --- a/tests/ui/repr/align-with-extern-c-fn.rs +++ b/tests/ui/repr/align-with-extern-c-fn.rs @@ -8,7 +8,7 @@ #![feature(repr_align)] #[repr(align(16))] -pub struct A(#[allow(unused_tuple_struct_fields)] i64); +pub struct A(#[allow(dead_code)] i64); #[allow(improper_ctypes_definitions)] pub extern "C" fn foo(x: A) {} diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs index 1914e155493..c95777b0ef1 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs @@ -5,7 +5,7 @@ #![warn(pointer_structural_match)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive // (which doesn't matter here because `<*const T>::eq` won't recur on `T`). diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs index e713b003b00..3f663fd09f8 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs @@ -5,7 +5,7 @@ #![warn(pointer_structural_match)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive // (which doesn't matter here because `<*const T>::eq` won't recur on `T`). diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs index 04da14c5419..56b7988e0e4 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs @@ -5,7 +5,7 @@ #![warn(pointer_structural_match)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive // (which doesn't matter here because `<*const T>::eq` won't recur on `T`). diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs index 8313c25e753..3ebe3225437 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs @@ -5,7 +5,7 @@ #![warn(pointer_structural_match)] -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive // (which doesn't matter here because `<*const T>::eq` won't recur on `T`). diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs index 7623839fdd1..bb5e243d934 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs @@ -5,7 +5,7 @@ // // See discussion on rust-lang/rust#62307 and rust-lang/rust#62339 -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs index 894739ff705..e3abb47cf73 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs @@ -7,7 +7,7 @@ #![warn(indirect_structural_match)] // run-pass -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs index 1699dae4624..2d3788eea8a 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs @@ -7,7 +7,7 @@ #![warn(indirect_structural_match)] // run-pass -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs index 2672bdd9e56..65df7788d90 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs @@ -7,7 +7,7 @@ #![warn(indirect_structural_match)] // run-pass -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs index 3489995ae71..88260fd1081 100644 --- a/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs +++ b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs @@ -7,7 +7,7 @@ #![warn(indirect_structural_match)] // run-pass -struct NoDerive(#[allow(unused_tuple_struct_fields)] i32); +struct NoDerive(#[allow(dead_code)] i32); // This impl makes NoDerive irreflexive. impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } } diff --git a/tests/ui/rfcs/rfc-2151-raw-identifiers/attr.rs b/tests/ui/rfcs/rfc-2151-raw-identifiers/attr.rs index d359067f627..0deb8c7f119 100644 --- a/tests/ui/rfcs/rfc-2151-raw-identifiers/attr.rs +++ b/tests/ui/rfcs/rfc-2151-raw-identifiers/attr.rs @@ -7,7 +7,7 @@ struct Test { } #[r#derive(r#Debug)] -struct Test2(#[allow(unused_tuple_struct_fields)] u32); +struct Test2(#[allow(dead_code)] u32); pub fn main() { assert_eq!(mem::size_of::<Test>(), 9); diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/check-pass.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/check-pass.rs index e0842bfa4cd..58a2c271ecf 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/check-pass.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/check-pass.rs @@ -8,8 +8,6 @@ // check-pass // only-x86_64 -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck #![feature(target_feature_11)] diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs index a59d7c2d784..fefe100ba0e 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/closures-inherit-target_feature.rs @@ -1,18 +1,16 @@ // Tests #73631: closures inherit `#[target_feature]` annotations // check-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck // only-x86_64 #![feature(target_feature_11)] -#[target_feature(enable="avx")] +#[target_feature(enable = "avx")] fn also_use_avx() { println!("Hello from AVX") } -#[target_feature(enable="avx")] +#[target_feature(enable = "avx")] fn use_avx() -> Box<dyn Fn()> { Box::new(|| also_use_avx()) } diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs index c95d4a08e48..3ecea5c5313 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.rs @@ -1,5 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck // only-x86_64 #![feature(target_feature_11)] diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr new file mode 100644 index 00000000000..cc941be5479 --- /dev/null +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.stderr @@ -0,0 +1,23 @@ +error[E0308]: mismatched types + --> $DIR/fn-ptr.rs:9:21 + | +LL | #[target_feature(enable = "sse2")] + | ---------------------------------- `#[target_feature]` added here +... +LL | let foo: fn() = foo; + | ---- ^^^ cannot coerce functions with `#[target_feature]` to safe function pointers + | | + | expected due to this + | + = note: expected fn pointer `fn()` + found fn item `fn() {foo}` + = note: fn items are distinct from fn pointers + = note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers +help: consider casting to a fn pointer + | +LL | let foo: fn() = foo as fn(); + | ~~~~~~~~~~~ + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108655-inline-always-closure.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108655-inline-always-closure.rs index bc886400099..115f00b3f4e 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108655-inline-always-closure.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/issue-108655-inline-always-closure.rs @@ -1,8 +1,6 @@ // Tests #108655: closures in `#[target_feature]` functions can still be marked #[inline(always)] // check-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck // only-x86_64 #![feature(target_feature_11)] diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs index f17dab269bc..788c79adc1f 100644 --- a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.rs @@ -1,5 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck // only-x86_64 #![feature(target_feature_11)] @@ -11,7 +9,6 @@ const fn sse2() {} #[target_feature(enable = "fxsr")] const fn sse2_and_fxsr() {} - #[target_feature(enable = "avx")] #[target_feature(enable = "bmi2")] fn avx_bmi2() {} @@ -26,62 +23,50 @@ impl Quux { fn foo() { sse2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe Quux.avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe } #[target_feature(enable = "sse2")] fn bar() { avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe Quux.avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe } #[target_feature(enable = "avx")] fn baz() { sse2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `avx_bmi2` with `#[target_feature]` is unsafe Quux.avx_bmi2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe } #[target_feature(enable = "avx")] #[target_feature(enable = "bmi2")] fn qux() { sse2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe } const _: () = sse2(); -//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe -//[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe +//~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe const _: () = sse2_and_fxsr(); -//[mir]~^ ERROR call to function with `#[target_feature]` is unsafe -//[thir]~^^ ERROR call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe +//~^ ERROR call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe #[deny(unsafe_op_in_unsafe_fn)] #[target_feature(enable = "avx")] #[target_feature(enable = "bmi2")] unsafe fn needs_unsafe_block() { sse2(); - //[mir]~^ ERROR call to function with `#[target_feature]` is unsafe - //[thir]~^^ ERROR call to function `sse2` with `#[target_feature]` is unsafe + //~^ ERROR call to function `sse2` with `#[target_feature]` is unsafe } fn main() {} diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr new file mode 100644 index 00000000000..e17859eb40f --- /dev/null +++ b/tests/ui/rfcs/rfc-2396-target_feature-11/safe-calls.stderr @@ -0,0 +1,115 @@ +error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:25:5 + | +LL | sse2(); + | ^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target feature: sse2 + = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` + +error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:27:5 + | +LL | avx_bmi2(); + | ^^^^^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2 + +error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:29:5 + | +LL | Quux.avx_bmi2(); + | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2 + +error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:35:5 + | +LL | avx_bmi2(); + | ^^^^^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2 + +error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:37:5 + | +LL | Quux.avx_bmi2(); + | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target features: avx and bmi2 + +error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:43:5 + | +LL | sse2(); + | ^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target feature: sse2 + = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` + +error[E0133]: call to function `avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:45:5 + | +LL | avx_bmi2(); + | ^^^^^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target feature: bmi2 + +error[E0133]: call to function `Quux::avx_bmi2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:47:5 + | +LL | Quux.avx_bmi2(); + | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target feature: bmi2 + +error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:54:5 + | +LL | sse2(); + | ^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target feature: sse2 + = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` + +error[E0133]: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:58:15 + | +LL | const _: () = sse2(); + | ^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target feature: sse2 + = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` + +error[E0133]: call to function `sse2_and_fxsr` with `#[target_feature]` is unsafe and requires unsafe function or block + --> $DIR/safe-calls.rs:61:15 + | +LL | const _: () = sse2_and_fxsr(); + | ^^^^^^^^^^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target features: sse2 and fxsr + = note: the fxsr and sse2 target features being enabled in the build configuration does not remove the requirement to list them in `#[target_feature]` + +error: call to function `sse2` with `#[target_feature]` is unsafe and requires unsafe block (error E0133) + --> $DIR/safe-calls.rs:68:5 + | +LL | sse2(); + | ^^^^^^ call to function with `#[target_feature]` + | + = help: in order for the call to be safe, the context requires the following additional target feature: sse2 + = note: the sse2 target feature being enabled in the build configuration does not remove the requirement to list it in `#[target_feature]` +note: an unsafe function restricts its caller, but its body is safe by default + --> $DIR/safe-calls.rs:67:1 + | +LL | unsafe fn needs_unsafe_block() { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: the lint level is defined here + --> $DIR/safe-calls.rs:64:8 + | +LL | #[deny(unsafe_op_in_unsafe_fn)] + | ^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 12 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs index 4836d2b02ce..75797b1cbfe 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs @@ -100,7 +100,7 @@ implements_const_drop! { } fn main() { - struct HasDropGlue(#[allow(unused_tuple_struct_fields)] Box<u8>); + struct HasDropGlue(#[allow(dead_code)] Box<u8>); struct HasDropImpl; impl Drop for HasDropImpl { fn drop(&mut self) { diff --git a/tests/ui/runtime/running-with-no-runtime.rs b/tests/ui/runtime/running-with-no-runtime.rs index c575a6bec8e..c321e86dc18 100644 --- a/tests/ui/runtime/running-with-no-runtime.rs +++ b/tests/ui/runtime/running-with-no-runtime.rs @@ -1,8 +1,6 @@ // run-pass // ignore-emscripten spawning processes is not supported // ignore-sgx no processes -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck #![feature(start)] diff --git a/tests/ui/simd/intrinsic/generic-comparison-pass.rs b/tests/ui/simd/intrinsic/generic-comparison-pass.rs index da5c42a1a98..103132c18ae 100644 --- a/tests/ui/simd/intrinsic/generic-comparison-pass.rs +++ b/tests/ui/simd/intrinsic/generic-comparison-pass.rs @@ -1,7 +1,5 @@ // run-pass // ignore-emscripten FIXME(#45351) hits an LLVM assert -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck #![feature(repr_simd, platform_intrinsics, concat_idents)] #![allow(non_camel_case_types)] diff --git a/tests/ui/span/lint-unused-unsafe.rs b/tests/ui/span/lint-unused-unsafe.rs index ca615f64f22..94bdd114007 100644 --- a/tests/ui/span/lint-unused-unsafe.rs +++ b/tests/ui/span/lint-unused-unsafe.rs @@ -3,9 +3,6 @@ // edition:2018 -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck - #![allow(dead_code)] #![deny(unused_unsafe)] diff --git a/tests/ui/span/lint-unused-unsafe.mir.stderr b/tests/ui/span/lint-unused-unsafe.stderr index 9e8d3359242..d8bd7cc7475 100644 --- a/tests/ui/span/lint-unused-unsafe.mir.stderr +++ b/tests/ui/span/lint-unused-unsafe.stderr @@ -1,77 +1,77 @@ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:22:13 + --> $DIR/lint-unused-unsafe.rs:19:13 | LL | fn bad1() { unsafe {} } | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:10:9 + --> $DIR/lint-unused-unsafe.rs:7:9 | LL | #![deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:23:13 + --> $DIR/lint-unused-unsafe.rs:20:13 | LL | fn bad2() { unsafe { bad1() } } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:24:20 + --> $DIR/lint-unused-unsafe.rs:21:20 | LL | unsafe fn bad3() { unsafe {} } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:25:13 + --> $DIR/lint-unused-unsafe.rs:22:13 | LL | fn bad4() { unsafe { callback(||{}) } } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:28:5 + --> $DIR/lint-unused-unsafe.rs:25:5 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:35:5 + --> $DIR/lint-unused-unsafe.rs:32:5 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:70:9 + --> $DIR/lint-unused-unsafe.rs:67:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:79:9 + --> $DIR/lint-unused-unsafe.rs:76:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:80:13 + --> $DIR/lint-unused-unsafe.rs:77:13 | LL | unsafe {} | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:81:13 + --> $DIR/lint-unused-unsafe.rs:78:13 | LL | unsafe {} | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:86:9 + --> $DIR/lint-unused-unsafe.rs:83:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:96:13 + --> $DIR/lint-unused-unsafe.rs:93:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -80,7 +80,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:97:13 + --> $DIR/lint-unused-unsafe.rs:94:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -89,7 +89,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:98:13 + --> $DIR/lint-unused-unsafe.rs:95:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -98,7 +98,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:108:17 + --> $DIR/lint-unused-unsafe.rs:105:17 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -107,13 +107,13 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:106:20 + --> $DIR/lint-unused-unsafe.rs:103:20 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:109:17 + --> $DIR/lint-unused-unsafe.rs:106:17 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -122,7 +122,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:110:17 + --> $DIR/lint-unused-unsafe.rs:107:17 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -131,37 +131,37 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:120:9 + --> $DIR/lint-unused-unsafe.rs:117:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:130:9 + --> $DIR/lint-unused-unsafe.rs:127:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:131:13 + --> $DIR/lint-unused-unsafe.rs:128:13 | LL | unsafe {} | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:132:13 + --> $DIR/lint-unused-unsafe.rs:129:13 | LL | unsafe {} | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:138:9 + --> $DIR/lint-unused-unsafe.rs:135:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:149:13 + --> $DIR/lint-unused-unsafe.rs:146:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -170,7 +170,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:150:13 + --> $DIR/lint-unused-unsafe.rs:147:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -179,7 +179,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:151:13 + --> $DIR/lint-unused-unsafe.rs:148:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -188,7 +188,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:162:17 + --> $DIR/lint-unused-unsafe.rs:159:17 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -197,13 +197,13 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:160:20 + --> $DIR/lint-unused-unsafe.rs:157:20 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:163:17 + --> $DIR/lint-unused-unsafe.rs:160:17 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -212,7 +212,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:164:17 + --> $DIR/lint-unused-unsafe.rs:161:17 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -221,37 +221,37 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:174:9 + --> $DIR/lint-unused-unsafe.rs:171:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:184:9 + --> $DIR/lint-unused-unsafe.rs:181:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:185:13 + --> $DIR/lint-unused-unsafe.rs:182:13 | LL | unsafe {} | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:186:13 + --> $DIR/lint-unused-unsafe.rs:183:13 | LL | unsafe {} | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:192:9 + --> $DIR/lint-unused-unsafe.rs:189:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:203:13 + --> $DIR/lint-unused-unsafe.rs:200:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -260,7 +260,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:204:13 + --> $DIR/lint-unused-unsafe.rs:201:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -269,7 +269,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:205:13 + --> $DIR/lint-unused-unsafe.rs:202:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -278,7 +278,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:216:17 + --> $DIR/lint-unused-unsafe.rs:213:17 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -287,13 +287,13 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:214:20 + --> $DIR/lint-unused-unsafe.rs:211:20 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:217:17 + --> $DIR/lint-unused-unsafe.rs:214:17 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -302,7 +302,7 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:218:17 + --> $DIR/lint-unused-unsafe.rs:215:17 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -311,13 +311,13 @@ LL | unsafe { unsf() } | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:238:9 + --> $DIR/lint-unused-unsafe.rs:235:9 | LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:251:13 + --> $DIR/lint-unused-unsafe.rs:248:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -325,7 +325,7 @@ LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:264:13 + --> $DIR/lint-unused-unsafe.rs:261:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -333,37 +333,37 @@ LL | unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:282:20 + --> $DIR/lint-unused-unsafe.rs:279:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:291:20 + --> $DIR/lint-unused-unsafe.rs:288:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:292:24 + --> $DIR/lint-unused-unsafe.rs:289:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:293:24 + --> $DIR/lint-unused-unsafe.rs:290:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:298:20 + --> $DIR/lint-unused-unsafe.rs:295:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:308:24 + --> $DIR/lint-unused-unsafe.rs:305:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -372,7 +372,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:309:24 + --> $DIR/lint-unused-unsafe.rs:306:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -381,7 +381,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:310:24 + --> $DIR/lint-unused-unsafe.rs:307:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -390,7 +390,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:320:28 + --> $DIR/lint-unused-unsafe.rs:317:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -399,13 +399,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:318:20 + --> $DIR/lint-unused-unsafe.rs:315:20 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:321:28 + --> $DIR/lint-unused-unsafe.rs:318:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -414,7 +414,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:322:28 + --> $DIR/lint-unused-unsafe.rs:319:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -423,37 +423,37 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:332:20 + --> $DIR/lint-unused-unsafe.rs:329:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:342:20 + --> $DIR/lint-unused-unsafe.rs:339:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:343:24 + --> $DIR/lint-unused-unsafe.rs:340:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:344:24 + --> $DIR/lint-unused-unsafe.rs:341:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:350:20 + --> $DIR/lint-unused-unsafe.rs:347:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:361:24 + --> $DIR/lint-unused-unsafe.rs:358:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -462,7 +462,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:362:24 + --> $DIR/lint-unused-unsafe.rs:359:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -471,7 +471,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:363:24 + --> $DIR/lint-unused-unsafe.rs:360:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -480,7 +480,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:374:28 + --> $DIR/lint-unused-unsafe.rs:371:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -489,13 +489,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:372:20 + --> $DIR/lint-unused-unsafe.rs:369:20 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:375:28 + --> $DIR/lint-unused-unsafe.rs:372:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -504,7 +504,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:376:28 + --> $DIR/lint-unused-unsafe.rs:373:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -513,37 +513,37 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:386:20 + --> $DIR/lint-unused-unsafe.rs:383:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:396:20 + --> $DIR/lint-unused-unsafe.rs:393:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:397:24 + --> $DIR/lint-unused-unsafe.rs:394:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:398:24 + --> $DIR/lint-unused-unsafe.rs:395:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:404:20 + --> $DIR/lint-unused-unsafe.rs:401:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:415:24 + --> $DIR/lint-unused-unsafe.rs:412:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -552,7 +552,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:416:24 + --> $DIR/lint-unused-unsafe.rs:413:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -561,7 +561,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:417:24 + --> $DIR/lint-unused-unsafe.rs:414:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -570,7 +570,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:428:28 + --> $DIR/lint-unused-unsafe.rs:425:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -579,13 +579,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:426:20 + --> $DIR/lint-unused-unsafe.rs:423:20 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:429:28 + --> $DIR/lint-unused-unsafe.rs:426:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -594,7 +594,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:430:28 + --> $DIR/lint-unused-unsafe.rs:427:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -603,13 +603,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:450:20 + --> $DIR/lint-unused-unsafe.rs:447:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:463:24 + --> $DIR/lint-unused-unsafe.rs:460:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -617,7 +617,7 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:476:24 + --> $DIR/lint-unused-unsafe.rs:473:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -625,37 +625,37 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:495:20 + --> $DIR/lint-unused-unsafe.rs:492:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:504:20 + --> $DIR/lint-unused-unsafe.rs:501:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:505:24 + --> $DIR/lint-unused-unsafe.rs:502:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:506:24 + --> $DIR/lint-unused-unsafe.rs:503:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:511:20 + --> $DIR/lint-unused-unsafe.rs:508:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:521:24 + --> $DIR/lint-unused-unsafe.rs:518:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -664,7 +664,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:522:24 + --> $DIR/lint-unused-unsafe.rs:519:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -673,7 +673,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:523:24 + --> $DIR/lint-unused-unsafe.rs:520:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -682,7 +682,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:533:28 + --> $DIR/lint-unused-unsafe.rs:530:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -691,13 +691,13 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:531:20 + --> $DIR/lint-unused-unsafe.rs:528:20 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:534:28 + --> $DIR/lint-unused-unsafe.rs:531:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -706,7 +706,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:535:28 + --> $DIR/lint-unused-unsafe.rs:532:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -715,37 +715,37 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:545:20 + --> $DIR/lint-unused-unsafe.rs:542:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:555:20 + --> $DIR/lint-unused-unsafe.rs:552:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:556:24 + --> $DIR/lint-unused-unsafe.rs:553:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:557:24 + --> $DIR/lint-unused-unsafe.rs:554:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:563:20 + --> $DIR/lint-unused-unsafe.rs:560:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:574:24 + --> $DIR/lint-unused-unsafe.rs:571:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -754,7 +754,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:575:24 + --> $DIR/lint-unused-unsafe.rs:572:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -763,7 +763,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:576:24 + --> $DIR/lint-unused-unsafe.rs:573:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -772,7 +772,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:587:28 + --> $DIR/lint-unused-unsafe.rs:584:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -781,13 +781,13 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:585:20 + --> $DIR/lint-unused-unsafe.rs:582:20 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:588:28 + --> $DIR/lint-unused-unsafe.rs:585:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -796,7 +796,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:589:28 + --> $DIR/lint-unused-unsafe.rs:586:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -805,37 +805,37 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:599:20 + --> $DIR/lint-unused-unsafe.rs:596:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:609:20 + --> $DIR/lint-unused-unsafe.rs:606:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:610:24 + --> $DIR/lint-unused-unsafe.rs:607:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:611:24 + --> $DIR/lint-unused-unsafe.rs:608:24 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:617:20 + --> $DIR/lint-unused-unsafe.rs:614:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:628:24 + --> $DIR/lint-unused-unsafe.rs:625:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -844,7 +844,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:629:24 + --> $DIR/lint-unused-unsafe.rs:626:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -853,7 +853,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:630:24 + --> $DIR/lint-unused-unsafe.rs:627:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -862,7 +862,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:641:28 + --> $DIR/lint-unused-unsafe.rs:638:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -871,13 +871,13 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:639:20 + --> $DIR/lint-unused-unsafe.rs:636:20 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:642:28 + --> $DIR/lint-unused-unsafe.rs:639:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -886,7 +886,7 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:643:28 + --> $DIR/lint-unused-unsafe.rs:640:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -895,13 +895,13 @@ LL | let _ = || unsafe { let _ = || unsf(); }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:663:20 + --> $DIR/lint-unused-unsafe.rs:660:20 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:676:24 + --> $DIR/lint-unused-unsafe.rs:673:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -909,7 +909,7 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:689:24 + --> $DIR/lint-unused-unsafe.rs:686:24 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -917,37 +917,37 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:707:24 + --> $DIR/lint-unused-unsafe.rs:704:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:717:24 + --> $DIR/lint-unused-unsafe.rs:714:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:718:28 + --> $DIR/lint-unused-unsafe.rs:715:28 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:719:28 + --> $DIR/lint-unused-unsafe.rs:716:28 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:725:24 + --> $DIR/lint-unused-unsafe.rs:722:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:736:28 + --> $DIR/lint-unused-unsafe.rs:733:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -956,7 +956,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:737:28 + --> $DIR/lint-unused-unsafe.rs:734:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -965,7 +965,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:738:28 + --> $DIR/lint-unused-unsafe.rs:735:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -974,7 +974,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:749:32 + --> $DIR/lint-unused-unsafe.rs:746:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -983,13 +983,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:747:24 + --> $DIR/lint-unused-unsafe.rs:744:24 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:750:32 + --> $DIR/lint-unused-unsafe.rs:747:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -998,7 +998,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:751:32 + --> $DIR/lint-unused-unsafe.rs:748:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1007,37 +1007,37 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:761:24 + --> $DIR/lint-unused-unsafe.rs:758:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:771:24 + --> $DIR/lint-unused-unsafe.rs:768:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:772:28 + --> $DIR/lint-unused-unsafe.rs:769:28 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:773:28 + --> $DIR/lint-unused-unsafe.rs:770:28 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:779:24 + --> $DIR/lint-unused-unsafe.rs:776:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:790:28 + --> $DIR/lint-unused-unsafe.rs:787:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1046,7 +1046,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:791:28 + --> $DIR/lint-unused-unsafe.rs:788:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1055,7 +1055,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:792:28 + --> $DIR/lint-unused-unsafe.rs:789:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1064,7 +1064,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:803:32 + --> $DIR/lint-unused-unsafe.rs:800:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1073,13 +1073,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:801:24 + --> $DIR/lint-unused-unsafe.rs:798:24 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:804:32 + --> $DIR/lint-unused-unsafe.rs:801:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1088,7 +1088,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:805:32 + --> $DIR/lint-unused-unsafe.rs:802:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1097,13 +1097,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:825:24 + --> $DIR/lint-unused-unsafe.rs:822:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:838:28 + --> $DIR/lint-unused-unsafe.rs:835:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1111,7 +1111,7 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:851:28 + --> $DIR/lint-unused-unsafe.rs:848:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1119,37 +1119,37 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:865:24 + --> $DIR/lint-unused-unsafe.rs:862:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:875:24 + --> $DIR/lint-unused-unsafe.rs:872:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:876:28 + --> $DIR/lint-unused-unsafe.rs:873:28 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:877:28 + --> $DIR/lint-unused-unsafe.rs:874:28 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:883:24 + --> $DIR/lint-unused-unsafe.rs:880:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:894:28 + --> $DIR/lint-unused-unsafe.rs:891:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1158,7 +1158,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:895:28 + --> $DIR/lint-unused-unsafe.rs:892:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1167,7 +1167,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:896:28 + --> $DIR/lint-unused-unsafe.rs:893:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1176,7 +1176,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:907:32 + --> $DIR/lint-unused-unsafe.rs:904:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1185,13 +1185,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:905:24 + --> $DIR/lint-unused-unsafe.rs:902:24 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:908:32 + --> $DIR/lint-unused-unsafe.rs:905:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1200,7 +1200,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:909:32 + --> $DIR/lint-unused-unsafe.rs:906:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1209,37 +1209,37 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:919:24 + --> $DIR/lint-unused-unsafe.rs:916:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:929:24 + --> $DIR/lint-unused-unsafe.rs:926:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:930:28 + --> $DIR/lint-unused-unsafe.rs:927:28 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:931:28 + --> $DIR/lint-unused-unsafe.rs:928:28 | LL | let _ = || unsafe {}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:937:24 + --> $DIR/lint-unused-unsafe.rs:934:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:948:28 + --> $DIR/lint-unused-unsafe.rs:945:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1248,7 +1248,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:949:28 + --> $DIR/lint-unused-unsafe.rs:946:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1257,7 +1257,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:950:28 + --> $DIR/lint-unused-unsafe.rs:947:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1266,7 +1266,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:961:32 + --> $DIR/lint-unused-unsafe.rs:958:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1275,13 +1275,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:959:24 + --> $DIR/lint-unused-unsafe.rs:956:24 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:962:32 + --> $DIR/lint-unused-unsafe.rs:959:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1290,7 +1290,7 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:963:32 + --> $DIR/lint-unused-unsafe.rs:960:32 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1299,13 +1299,13 @@ LL | let _ = || unsafe { unsf() }; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:983:24 + --> $DIR/lint-unused-unsafe.rs:980:24 | LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:996:28 + --> $DIR/lint-unused-unsafe.rs:993:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1313,7 +1313,7 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1009:28 + --> $DIR/lint-unused-unsafe.rs:1006:28 | LL | let _ = || unsafe { | ------ because it's nested under this `unsafe` block @@ -1321,13 +1321,13 @@ LL | let _ = || unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1055:29 + --> $DIR/lint-unused-unsafe.rs:1052:29 | LL | let _ = async { unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1062:33 + --> $DIR/lint-unused-unsafe.rs:1059:33 | LL | let _ = async { unsafe { | ------ because it's nested under this `unsafe` block @@ -1336,7 +1336,7 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1063:33 + --> $DIR/lint-unused-unsafe.rs:1060:33 | LL | let _ = async { unsafe { | ------ because it's nested under this `unsafe` block @@ -1345,7 +1345,7 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1064:33 + --> $DIR/lint-unused-unsafe.rs:1061:33 | LL | let _ = async { unsafe { | ------ because it's nested under this `unsafe` block @@ -1354,13 +1354,13 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1069:29 + --> $DIR/lint-unused-unsafe.rs:1066:29 | LL | let _ = async { unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1076:33 + --> $DIR/lint-unused-unsafe.rs:1073:33 | LL | let _ = async { unsafe { | ------ because it's nested under this `unsafe` block @@ -1369,7 +1369,7 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1077:33 + --> $DIR/lint-unused-unsafe.rs:1074:33 | LL | let _ = async { unsafe { | ------ because it's nested under this `unsafe` block @@ -1378,7 +1378,7 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1078:33 + --> $DIR/lint-unused-unsafe.rs:1075:33 | LL | let _ = async { unsafe { | ------ because it's nested under this `unsafe` block @@ -1387,13 +1387,13 @@ LL | let _ = async { unsafe { let _ = async { unsf() }; }}; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1088:22 + --> $DIR/lint-unused-unsafe.rs:1085:22 | LL | let _x: [(); unsafe { 0 }] = []; | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1092:22 + --> $DIR/lint-unused-unsafe.rs:1089:22 | LL | let _x: [(); unsafe { unsafe { size() } }] = []; | ^^^^^^ unnecessary `unsafe` block diff --git a/tests/ui/span/lint-unused-unsafe.thir.stderr b/tests/ui/span/lint-unused-unsafe.thir.stderr deleted file mode 100644 index 9e8d3359242..00000000000 --- a/tests/ui/span/lint-unused-unsafe.thir.stderr +++ /dev/null @@ -1,1402 +0,0 @@ -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:22:13 - | -LL | fn bad1() { unsafe {} } - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:10:9 - | -LL | #![deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:23:13 - | -LL | fn bad2() { unsafe { bad1() } } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:24:20 - | -LL | unsafe fn bad3() { unsafe {} } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:25:13 - | -LL | fn bad4() { unsafe { callback(||{}) } } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:28:5 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:35:5 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:70:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:79:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:80:13 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:81:13 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:86:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:96:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:97:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:98:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:108:17 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:106:20 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:109:17 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:110:17 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:120:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:130:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:131:13 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:132:13 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:138:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:149:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:150:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:151:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:162:17 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:160:20 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:163:17 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:164:17 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:174:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:184:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:185:13 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:186:13 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:192:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:203:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:204:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:205:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:216:17 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:214:20 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:217:17 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:218:17 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | unsafe { unsf() } - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:238:9 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:251:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:264:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:282:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:291:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:292:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:293:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:298:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:308:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:309:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:310:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:320:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:318:20 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:321:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:322:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:332:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:342:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:343:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:344:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:350:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:361:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:362:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:363:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:374:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:372:20 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:375:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:376:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:386:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:396:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:397:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:398:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:404:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:415:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:416:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:417:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:428:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:426:20 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:429:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:430:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:450:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:463:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:476:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:495:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:504:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:505:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:506:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:511:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:521:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsf(); -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:522:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:523:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:533:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:531:20 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:534:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:535:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:545:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:555:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:556:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:557:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:563:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:574:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsf(); -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:575:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:576:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:587:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:585:20 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:588:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:589:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:599:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:609:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:610:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:611:24 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:617:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:628:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsf(); -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:629:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:630:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:641:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:639:20 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:642:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:643:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { let _ = || unsf(); }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:663:20 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:676:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:689:24 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:707:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:717:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:718:28 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:719:28 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:725:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:736:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:737:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:738:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:749:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:747:24 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:750:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:751:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:761:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:771:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:772:28 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:773:28 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:779:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:790:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:791:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:792:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:803:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:801:24 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:804:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:805:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:825:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:838:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:851:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:865:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:875:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:876:28 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:877:28 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:883:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:894:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:895:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:896:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:907:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:905:24 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:908:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:909:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:919:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:929:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:930:28 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:931:28 - | -LL | let _ = || unsafe {}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:937:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:948:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | unsf(); -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:949:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:950:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:961:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/lint-unused-unsafe.rs:959:24 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:962:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:963:32 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = || unsafe { unsf() }; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:983:24 - | -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:996:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1009:28 - | -LL | let _ = || unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = || unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1055:29 - | -LL | let _ = async { unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1062:33 - | -LL | let _ = async { unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = async { unsf() }; -LL | let _ = async { unsafe { let _ = async { unsf() }; }}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1063:33 - | -LL | let _ = async { unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = async { unsafe { let _ = async { unsf() }; }}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1064:33 - | -LL | let _ = async { unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = async { unsafe { let _ = async { unsf() }; }}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1069:29 - | -LL | let _ = async { unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1076:33 - | -LL | let _ = async { unsafe { - | ------ because it's nested under this `unsafe` block -LL | let _ = async { unsf() }; -LL | let _ = async { unsafe { let _ = async { unsf() }; }}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1077:33 - | -LL | let _ = async { unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = async { unsafe { let _ = async { unsf() }; }}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1078:33 - | -LL | let _ = async { unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | let _ = async { unsafe { let _ = async { unsf() }; }}; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1088:22 - | -LL | let _x: [(); unsafe { 0 }] = []; - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/lint-unused-unsafe.rs:1092:22 - | -LL | let _x: [(); unsafe { unsafe { size() } }] = []; - | ^^^^^^ unnecessary `unsafe` block - -error: aborting due to 174 previous errors - diff --git a/tests/ui/specialization/min_specialization/issue-79224.stderr b/tests/ui/specialization/min_specialization/issue-79224.stderr index 7541579498e..37ced4cf267 100644 --- a/tests/ui/specialization/min_specialization/issue-79224.stderr +++ b/tests/ui/specialization/min_specialization/issue-79224.stderr @@ -11,10 +11,10 @@ LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> { | +++++++++++++++++++ error[E0277]: the trait bound `B: Clone` is not satisfied - --> $DIR/issue-79224.rs:20:13 + --> $DIR/issue-79224.rs:20:5 | LL | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - | ^^^^ the trait `Clone` is not implemented for `B` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `B` | = note: required for `B` to implement `ToOwned` help: consider further restricting this bound @@ -23,10 +23,10 @@ LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> { | +++++++++++++++++++ error[E0277]: the trait bound `B: Clone` is not satisfied - --> $DIR/issue-79224.rs:20:5 + --> $DIR/issue-79224.rs:20:13 | LL | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `B` + | ^^^^ the trait `Clone` is not implemented for `B` | = note: required for `B` to implement `ToOwned` help: consider further restricting this bound diff --git a/tests/ui/specialization/specialization-cross-crate.rs b/tests/ui/specialization/specialization-cross-crate.rs index d9381d66152..4b2ac07378d 100644 --- a/tests/ui/specialization/specialization-cross-crate.rs +++ b/tests/ui/specialization/specialization-cross-crate.rs @@ -14,7 +14,7 @@ struct NotClone; struct MarkedAndClone; impl MyMarker for MarkedAndClone {} -struct MyType<T>(#[allow(unused_tuple_struct_fields)] T); +struct MyType<T>(#[allow(dead_code)] T); impl<T> Foo for MyType<T> { default fn foo(&self) -> &'static str { "generic MyType" diff --git a/tests/ui/specialization/specialization-translate-projections-with-lifetimes.rs b/tests/ui/specialization/specialization-translate-projections-with-lifetimes.rs index 904aeaa088b..f06afc8ba41 100644 --- a/tests/ui/specialization/specialization-translate-projections-with-lifetimes.rs +++ b/tests/ui/specialization/specialization-translate-projections-with-lifetimes.rs @@ -14,7 +14,7 @@ impl<'a> WithAssoc for &'a () { type Item = &'a u32; } -struct Cloned<I>(#[allow(unused_tuple_struct_fields)] I); +struct Cloned<I>(#[allow(dead_code)] I); impl<'a, I, T: 'a> Iterator for Cloned<I> where I: WithAssoc<Item=&'a T>, T: Clone diff --git a/tests/ui/static/safe-extern-statics-mut.mir.stderr b/tests/ui/static/safe-extern-statics-mut.mir.stderr deleted file mode 100644 index cec5f9d9c9f..00000000000 --- a/tests/ui/static/safe-extern-statics-mut.mir.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics-mut.rs:13:13 - | -LL | let b = B; - | ^ 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:14:14 - | -LL | let rb = &B; - | ^^ 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:15:14 - | -LL | let xb = XB; - | ^^ 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:16:15 - | -LL | let xrb = &XB; - | ^^^ 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/tests/ui/static/safe-extern-statics-mut.rs b/tests/ui/static/safe-extern-statics-mut.rs index 389a4589a71..324fa443aa5 100644 --- a/tests/ui/static/safe-extern-statics-mut.rs +++ b/tests/ui/static/safe-extern-statics-mut.rs @@ -1,6 +1,4 @@ // aux-build:extern-statics.rs -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck extern crate extern_statics; use extern_statics::*; diff --git a/tests/ui/static/safe-extern-statics-mut.thir.stderr b/tests/ui/static/safe-extern-statics-mut.stderr index 8e6d2805a0b..e390625f20a 100644 --- a/tests/ui/static/safe-extern-statics-mut.thir.stderr +++ b/tests/ui/static/safe-extern-statics-mut.stderr @@ -1,5 +1,5 @@ error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics-mut.rs:13:13 + --> $DIR/safe-extern-statics-mut.rs:11:13 | LL | let b = B; | ^ use of mutable static @@ -7,7 +7,7 @@ LL | let b = B; = 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:14:15 + --> $DIR/safe-extern-statics-mut.rs:12:15 | LL | let rb = &B; | ^ use of mutable static @@ -15,7 +15,7 @@ LL | let rb = &B; = 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:15:14 + --> $DIR/safe-extern-statics-mut.rs:13:14 | LL | let xb = XB; | ^^ use of mutable static @@ -23,7 +23,7 @@ LL | let xb = XB; = 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:16:16 + --> $DIR/safe-extern-statics-mut.rs:14:16 | LL | let xrb = &XB; | ^^ use of mutable static diff --git a/tests/ui/static/safe-extern-statics.mir.stderr b/tests/ui/static/safe-extern-statics.mir.stderr deleted file mode 100644 index 102abd0816f..00000000000 --- a/tests/ui/static/safe-extern-statics.mir.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics.rs:13:13 - | -LL | let a = A; - | ^ use of extern static - | - = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior - -error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics.rs:14:14 - | -LL | let ra = &A; - | ^^ use of extern static - | - = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior - -error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics.rs:15:14 - | -LL | let xa = XA; - | ^^ use of extern static - | - = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior - -error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics.rs:16:15 - | -LL | let xra = &XA; - | ^^^ use of extern static - | - = 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 - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/static/safe-extern-statics.rs b/tests/ui/static/safe-extern-statics.rs index 0aa90c442ea..6fa4c4aaca5 100644 --- a/tests/ui/static/safe-extern-statics.rs +++ b/tests/ui/static/safe-extern-statics.rs @@ -1,6 +1,4 @@ // aux-build:extern-statics.rs -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck extern crate extern_statics; use extern_statics::*; diff --git a/tests/ui/static/safe-extern-statics.thir.stderr b/tests/ui/static/safe-extern-statics.stderr index 7fd2182c4c6..6be6c074c26 100644 --- a/tests/ui/static/safe-extern-statics.thir.stderr +++ b/tests/ui/static/safe-extern-statics.stderr @@ -1,5 +1,5 @@ error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics.rs:13:13 + --> $DIR/safe-extern-statics.rs:11:13 | LL | let a = A; | ^ use of extern static @@ -7,7 +7,7 @@ LL | let a = A; = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics.rs:14:15 + --> $DIR/safe-extern-statics.rs:12:15 | LL | let ra = &A; | ^ use of extern static @@ -15,7 +15,7 @@ LL | let ra = &A; = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics.rs:15:14 + --> $DIR/safe-extern-statics.rs:13:14 | LL | let xa = XA; | ^^ use of extern static @@ -23,7 +23,7 @@ LL | let xa = XA; = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/safe-extern-statics.rs:16:16 + --> $DIR/safe-extern-statics.rs:14:16 | LL | let xra = &XA; | ^^ use of extern static diff --git a/tests/ui/static/static-mut-foreign-requires-unsafe.mir.stderr b/tests/ui/static/static-mut-foreign-requires-unsafe.mir.stderr deleted file mode 100644 index a4659bc8712..00000000000 --- a/tests/ui/static/static-mut-foreign-requires-unsafe.mir.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/static-mut-foreign-requires-unsafe.rs:9:5 - | -LL | a += 3; - | ^^^^^^ 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:10:5 - | -LL | a = 4; - | ^^^^^ 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:11:14 - | -LL | let _b = a; - | ^ 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/tests/ui/static/static-mut-foreign-requires-unsafe.rs b/tests/ui/static/static-mut-foreign-requires-unsafe.rs index 4f96acb3375..90aa2537a82 100644 --- a/tests/ui/static/static-mut-foreign-requires-unsafe.rs +++ b/tests/ui/static/static-mut-foreign-requires-unsafe.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - extern "C" { static mut a: i32; } diff --git a/tests/ui/static/static-mut-foreign-requires-unsafe.thir.stderr b/tests/ui/static/static-mut-foreign-requires-unsafe.stderr index 2c62d4d8f3b..022f7e9fb16 100644 --- a/tests/ui/static/static-mut-foreign-requires-unsafe.thir.stderr +++ b/tests/ui/static/static-mut-foreign-requires-unsafe.stderr @@ -1,5 +1,5 @@ error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/static-mut-foreign-requires-unsafe.rs:9:5 + --> $DIR/static-mut-foreign-requires-unsafe.rs:6:5 | LL | a += 3; | ^ use of mutable static @@ -7,7 +7,7 @@ LL | a += 3; = 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:10:5 + --> $DIR/static-mut-foreign-requires-unsafe.rs:7:5 | LL | a = 4; | ^ use of mutable static @@ -15,7 +15,7 @@ LL | a = 4; = 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:11:14 + --> $DIR/static-mut-foreign-requires-unsafe.rs:8:14 | LL | let _b = a; | ^ use of mutable static diff --git a/tests/ui/static/static-mut-requires-unsafe.mir.stderr b/tests/ui/static/static-mut-requires-unsafe.mir.stderr deleted file mode 100644 index 0d4ce056fc2..00000000000 --- a/tests/ui/static/static-mut-requires-unsafe.mir.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/static-mut-requires-unsafe.rs:7:5 - | -LL | a += 3; - | ^^^^^^ 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:8:5 - | -LL | a = 4; - | ^^^^^ 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:9:14 - | -LL | let _b = a; - | ^ 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/tests/ui/static/static-mut-requires-unsafe.rs b/tests/ui/static/static-mut-requires-unsafe.rs index ea3ba095007..413b97e431d 100644 --- a/tests/ui/static/static-mut-requires-unsafe.rs +++ b/tests/ui/static/static-mut-requires-unsafe.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - static mut a: isize = 3; fn main() { diff --git a/tests/ui/static/static-mut-requires-unsafe.thir.stderr b/tests/ui/static/static-mut-requires-unsafe.stderr index 1a1cf14271a..30be0220cf6 100644 --- a/tests/ui/static/static-mut-requires-unsafe.thir.stderr +++ b/tests/ui/static/static-mut-requires-unsafe.stderr @@ -1,5 +1,5 @@ error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/static-mut-requires-unsafe.rs:7:5 + --> $DIR/static-mut-requires-unsafe.rs:4:5 | LL | a += 3; | ^ use of mutable static @@ -7,7 +7,7 @@ LL | a += 3; = 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:8:5 + --> $DIR/static-mut-requires-unsafe.rs:5:5 | LL | a = 4; | ^ use of mutable static @@ -15,7 +15,7 @@ LL | a = 4; = 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:9:14 + --> $DIR/static-mut-requires-unsafe.rs:6:14 | LL | let _b = a; | ^ use of mutable static diff --git a/tests/ui/statics/issue-14227.rs b/tests/ui/statics/issue-14227.rs index 5f866ec9061..a1fde14600a 100644 --- a/tests/ui/statics/issue-14227.rs +++ b/tests/ui/statics/issue-14227.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - extern "C" { pub static symbol: u32; } diff --git a/tests/ui/statics/issue-14227.mir.stderr b/tests/ui/statics/issue-14227.stderr index ab50b97d63f..085d6df9c41 100644 --- a/tests/ui/statics/issue-14227.mir.stderr +++ b/tests/ui/statics/issue-14227.stderr @@ -1,5 +1,5 @@ error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/issue-14227.rs:7:21 + --> $DIR/issue-14227.rs:4:21 | LL | static CRASH: u32 = symbol; | ^^^^^^ use of extern static diff --git a/tests/ui/statics/issue-14227.thir.stderr b/tests/ui/statics/issue-14227.thir.stderr deleted file mode 100644 index ab50b97d63f..00000000000 --- a/tests/ui/statics/issue-14227.thir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: use of extern static is unsafe and requires unsafe function or block - --> $DIR/issue-14227.rs:7:21 - | -LL | static CRASH: u32 = symbol; - | ^^^^^^ use of extern static - | - = 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 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/stdlib-unit-tests/raw-fat-ptr.rs b/tests/ui/stdlib-unit-tests/raw-fat-ptr.rs index 6b0b09c9894..0f535523dcc 100644 --- a/tests/ui/stdlib-unit-tests/raw-fat-ptr.rs +++ b/tests/ui/stdlib-unit-tests/raw-fat-ptr.rs @@ -39,7 +39,7 @@ impl<T> Foo for T { } } -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] struct S<T:?Sized>(u32, T); fn main() { diff --git a/tests/ui/struct-ctor-mangling.rs b/tests/ui/struct-ctor-mangling.rs index ba6abbf03a5..159e21d2863 100644 --- a/tests/ui/struct-ctor-mangling.rs +++ b/tests/ui/struct-ctor-mangling.rs @@ -4,7 +4,7 @@ fn size_of_val<T>(_: &T) -> usize { std::mem::size_of::<T>() } -struct Foo(#[allow(unused_tuple_struct_fields)] i64); +struct Foo(#[allow(dead_code)] i64); // Test that the (symbol) mangling of `Foo` (the `struct` type) and that of // `typeof Foo` (the function type of the `struct` constructor) don't collide. diff --git a/tests/ui/structs-enums/enum-null-pointer-opt.rs b/tests/ui/structs-enums/enum-null-pointer-opt.rs index 85fa1eac2e2..356f8a6dd36 100644 --- a/tests/ui/structs-enums/enum-null-pointer-opt.rs +++ b/tests/ui/structs-enums/enum-null-pointer-opt.rs @@ -10,8 +10,8 @@ use std::sync::Arc; trait Trait { fn dummy(&self) { } } trait Mirror { type Image; } impl<T> Mirror for T { type Image = T; } -struct ParamTypeStruct<T>(#[allow(unused_tuple_struct_fields)] T); -struct AssocTypeStruct<T>(#[allow(unused_tuple_struct_fields)] <T as Mirror>::Image); +struct ParamTypeStruct<T>(#[allow(dead_code)] T); +struct AssocTypeStruct<T>(#[allow(dead_code)] <T as Mirror>::Image); #[repr(transparent)] union MaybeUninitUnion<T: Copy> { _value: T, @@ -46,7 +46,7 @@ fn main() { struct Foo { _a: Box<isize> } - struct Bar(#[allow(unused_tuple_struct_fields)] Box<isize>); + struct Bar(#[allow(dead_code)] Box<isize>); // Should apply through structs assert_eq!(size_of::<Foo>(), size_of::<Option<Foo>>()); diff --git a/tests/ui/structs-enums/enum-nullable-simplifycfg-misopt.rs b/tests/ui/structs-enums/enum-nullable-simplifycfg-misopt.rs index a05cf8b93d5..4bd7ee45dfe 100644 --- a/tests/ui/structs-enums/enum-nullable-simplifycfg-misopt.rs +++ b/tests/ui/structs-enums/enum-nullable-simplifycfg-misopt.rs @@ -6,7 +6,7 @@ * represented with nullable pointers could be misoptimized in some cases. */ -enum List<X> { Nil, Cons(X, #[allow(unused_tuple_struct_fields)] Box<List<X>>) } +enum List<X> { Nil, Cons(X, #[allow(dead_code)] Box<List<X>>) } pub fn main() { match List::Cons(10, Box::new(List::Nil)) { List::Cons(10, _) => {} diff --git a/tests/ui/structs-enums/resource-in-struct.rs b/tests/ui/structs-enums/resource-in-struct.rs index 9613ca62a49..267ad6b4a86 100644 --- a/tests/ui/structs-enums/resource-in-struct.rs +++ b/tests/ui/structs-enums/resource-in-struct.rs @@ -25,7 +25,7 @@ fn close_res(i: closable) -> close_res { } } -enum option<T> { none, some(#[allow(unused_tuple_struct_fields)] T), } +enum option<T> { none, some(#[allow(dead_code)] T), } fn sink(_res: option<close_res>) { } diff --git a/tests/ui/structs-enums/tuple-struct-construct.rs b/tests/ui/structs-enums/tuple-struct-construct.rs index fbf97e6b225..dc7cbaffddb 100644 --- a/tests/ui/structs-enums/tuple-struct-construct.rs +++ b/tests/ui/structs-enums/tuple-struct-construct.rs @@ -1,5 +1,5 @@ // run-pass -#[allow(unused_tuple_struct_fields)] +#[allow(dead_code)] #[derive(Debug)] struct Foo(isize, isize); diff --git a/tests/ui/structs-enums/uninstantiable-struct.rs b/tests/ui/structs-enums/uninstantiable-struct.rs index b24effe5a9c..15f2fc424bb 100644 --- a/tests/ui/structs-enums/uninstantiable-struct.rs +++ b/tests/ui/structs-enums/uninstantiable-struct.rs @@ -1,4 +1,4 @@ // run-pass -pub struct Z(#[allow(unused_tuple_struct_fields)] &'static Z); +pub struct Z(#[allow(dead_code)] &'static Z); pub fn main() {} diff --git a/tests/ui/suggestions/lifetimes/type-param-bound-scope.fixed b/tests/ui/suggestions/lifetimes/type-param-bound-scope.fixed index 470cc67b973..3257ea04c69 100644 --- a/tests/ui/suggestions/lifetimes/type-param-bound-scope.fixed +++ b/tests/ui/suggestions/lifetimes/type-param-bound-scope.fixed @@ -2,7 +2,7 @@ // trait, impl or associated fn. // run-rustfix -struct Inv<'a>(Option<*mut &'a u8>); +struct Inv<'a>(#[allow(dead_code)] Option<*mut &'a u8>); fn check_bound<'a, A: 'a>(_: A, _: Inv<'a>) {} diff --git a/tests/ui/suggestions/lifetimes/type-param-bound-scope.rs b/tests/ui/suggestions/lifetimes/type-param-bound-scope.rs index 874788e13ef..fcc13aad996 100644 --- a/tests/ui/suggestions/lifetimes/type-param-bound-scope.rs +++ b/tests/ui/suggestions/lifetimes/type-param-bound-scope.rs @@ -2,7 +2,7 @@ // trait, impl or associated fn. // run-rustfix -struct Inv<'a>(Option<*mut &'a u8>); +struct Inv<'a>(#[allow(dead_code)] Option<*mut &'a u8>); fn check_bound<'a, A: 'a>(_: A, _: Inv<'a>) {} diff --git a/tests/ui/thread-local/thread-local-static.rs b/tests/ui/thread-local/thread-local-static.rs index afaffbb7e9b..e6cd4839dda 100644 --- a/tests/ui/thread-local/thread-local-static.rs +++ b/tests/ui/thread-local/thread-local-static.rs @@ -1,6 +1,4 @@ // edition:2018 -// revisions: mir thir -//thir: -Zthir-unsafeck #![feature(thread_local)] #![feature(const_swap)] diff --git a/tests/ui/thread-local/thread-local-static.mir.stderr b/tests/ui/thread-local/thread-local-static.stderr index 607d7ee902c..c1777dd60db 100644 --- a/tests/ui/thread-local/thread-local-static.mir.stderr +++ b/tests/ui/thread-local/thread-local-static.stderr @@ -1,5 +1,13 @@ +error[E0133]: use of mutable static is unsafe and requires unsafe function or block + --> $DIR/thread-local-static.rs:10:28 + | +LL | std::mem::swap(x, &mut STATIC_VAR_2) + | ^^^^^^^^^^^^ use of mutable static + | + = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior + error[E0658]: mutable references are not allowed in constant functions - --> $DIR/thread-local-static.rs:10:12 + --> $DIR/thread-local-static.rs:8:12 | LL | const fn g(x: &mut [u32; 8]) { | ^ @@ -8,13 +16,13 @@ LL | const fn g(x: &mut [u32; 8]) { = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-static.rs:12:28 + --> $DIR/thread-local-static.rs:10:28 | LL | std::mem::swap(x, &mut STATIC_VAR_2) | ^^^^^^^^^^^^ error[E0013]: constant functions cannot refer to statics - --> $DIR/thread-local-static.rs:12:28 + --> $DIR/thread-local-static.rs:10:28 | LL | std::mem::swap(x, &mut STATIC_VAR_2) | ^^^^^^^^^^^^ @@ -22,7 +30,7 @@ LL | std::mem::swap(x, &mut STATIC_VAR_2) = help: consider extracting the value of the `static` to a `const`, and referring to that error[E0658]: mutable references are not allowed in constant functions - --> $DIR/thread-local-static.rs:12:23 + --> $DIR/thread-local-static.rs:10:23 | LL | std::mem::swap(x, &mut STATIC_VAR_2) | ^^^^^^^^^^^^^^^^^ @@ -30,14 +38,6 @@ LL | std::mem::swap(x, &mut STATIC_VAR_2) = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/thread-local-static.rs:12:23 - | -LL | std::mem::swap(x, &mut STATIC_VAR_2) - | ^^^^^^^^^^^^^^^^^ 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 5 previous errors Some errors have detailed explanations: E0013, E0133, E0625, E0658. diff --git a/tests/ui/thread-local/thread-local-static.thir.stderr b/tests/ui/thread-local/thread-local-static.thir.stderr deleted file mode 100644 index 607d7ee902c..00000000000 --- a/tests/ui/thread-local/thread-local-static.thir.stderr +++ /dev/null @@ -1,44 +0,0 @@ -error[E0658]: mutable references are not allowed in constant functions - --> $DIR/thread-local-static.rs:10:12 - | -LL | const fn g(x: &mut [u32; 8]) { - | ^ - | - = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error[E0625]: thread-local statics cannot be accessed at compile-time - --> $DIR/thread-local-static.rs:12:28 - | -LL | std::mem::swap(x, &mut STATIC_VAR_2) - | ^^^^^^^^^^^^ - -error[E0013]: constant functions cannot refer to statics - --> $DIR/thread-local-static.rs:12:28 - | -LL | std::mem::swap(x, &mut STATIC_VAR_2) - | ^^^^^^^^^^^^ - | - = help: consider extracting the value of the `static` to a `const`, and referring to that - -error[E0658]: mutable references are not allowed in constant functions - --> $DIR/thread-local-static.rs:12:23 - | -LL | std::mem::swap(x, &mut STATIC_VAR_2) - | ^^^^^^^^^^^^^^^^^ - | - = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/thread-local-static.rs:12:23 - | -LL | std::mem::swap(x, &mut STATIC_VAR_2) - | ^^^^^^^^^^^^^^^^^ 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 5 previous errors - -Some errors have detailed explanations: E0013, E0133, E0625, E0658. -For more information about an error, try `rustc --explain E0013`. diff --git a/tests/ui/threads-sendsync/issue-43733.mir.stderr b/tests/ui/threads-sendsync/issue-43733.mir.stderr deleted file mode 100644 index ff83e16add9..00000000000 --- a/tests/ui/threads-sendsync/issue-43733.mir.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/issue-43733.rs:19:5 - | -LL | __KEY.get(Default::default) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/issue-43733.rs:24:42 - | -LL | static FOO: std::thread::LocalKey<Foo> = std::thread::LocalKey::new(__getit); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/threads-sendsync/issue-43733.rs b/tests/ui/threads-sendsync/issue-43733.rs index cac745f1e12..671b45e777f 100644 --- a/tests/ui/threads-sendsync/issue-43733.rs +++ b/tests/ui/threads-sendsync/issue-43733.rs @@ -1,6 +1,4 @@ // ignore-wasm32 -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck #![feature(thread_local)] #![feature(cfg_target_thread_local, thread_local_internals)] @@ -17,13 +15,11 @@ static __KEY: std::thread::local_impl::Key<Foo> = std::thread::local_impl::Key:: fn __getit(_: Option<&mut Option<RefCell<String>>>) -> std::option::Option<&'static Foo> { __KEY.get(Default::default) - //[mir]~^ ERROR call to unsafe function is unsafe - //[thir]~^^ ERROR call to unsafe function `Key::<T>::get` + //~^ ERROR call to unsafe function `Key::<T>::get` is unsafe } static FOO: std::thread::LocalKey<Foo> = std::thread::LocalKey::new(__getit); -//[mir]~^ ERROR call to unsafe function is unsafe -//[thir]~^^ ERROR call to unsafe function `LocalKey::<T>::new` +//~^ ERROR call to unsafe function `LocalKey::<T>::new` is unsafe fn main() { FOO.with(|foo| println!("{}", foo.borrow())); diff --git a/tests/ui/threads-sendsync/issue-43733.thir.stderr b/tests/ui/threads-sendsync/issue-43733.stderr index 94ec724044c..9b13646a228 100644 --- a/tests/ui/threads-sendsync/issue-43733.thir.stderr +++ b/tests/ui/threads-sendsync/issue-43733.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `Key::<T>::get` is unsafe and requires unsafe function or block - --> $DIR/issue-43733.rs:19:5 + --> $DIR/issue-43733.rs:17:5 | LL | __KEY.get(Default::default) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function @@ -7,7 +7,7 @@ LL | __KEY.get(Default::default) = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `LocalKey::<T>::new` is unsafe and requires unsafe function or block - --> $DIR/issue-43733.rs:24:42 + --> $DIR/issue-43733.rs:21:42 | LL | static FOO: std::thread::LocalKey<Foo> = std::thread::LocalKey::new(__getit); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/trailing-comma.rs b/tests/ui/trailing-comma.rs index 90adba99e54..31091398508 100644 --- a/tests/ui/trailing-comma.rs +++ b/tests/ui/trailing-comma.rs @@ -3,7 +3,7 @@ fn f<T,>(_: T,) {} -struct Foo<T,>(#[allow(unused_tuple_struct_fields)] T); +struct Foo<T,>(#[allow(dead_code)] T); struct Bar; @@ -14,7 +14,7 @@ impl Bar { } enum Baz { - Qux(#[allow(unused_tuple_struct_fields)] isize,), + Qux(#[allow(dead_code)] isize,), } #[allow(unused,)] diff --git a/tests/ui/traits/augmented-assignments-trait.rs b/tests/ui/traits/augmented-assignments-trait.rs index 747a5393f12..75168c4f1e5 100644 --- a/tests/ui/traits/augmented-assignments-trait.rs +++ b/tests/ui/traits/augmented-assignments-trait.rs @@ -1,7 +1,7 @@ // run-pass use std::ops::AddAssign; -struct Int(#[allow(unused_tuple_struct_fields)] i32); +struct Int(#[allow(dead_code)] i32); impl AddAssign for Int { fn add_assign(&mut self, _: Int) { diff --git a/tests/ui/traits/cycle-cache-err-60010.rs b/tests/ui/traits/cycle-cache-err-60010.rs index 94e718317e7..94875a5a25a 100644 --- a/tests/ui/traits/cycle-cache-err-60010.rs +++ b/tests/ui/traits/cycle-cache-err-60010.rs @@ -29,9 +29,8 @@ struct SalsaStorage { } impl Database for RootDatabase { - // This would also be an error if we didn't abort compilation on the error - // above. type Storage = SalsaStorage; + //~^ ERROR overflow } impl HasQueryGroup for RootDatabase {} impl<DB> Query<DB> for ParseQuery diff --git a/tests/ui/traits/cycle-cache-err-60010.stderr b/tests/ui/traits/cycle-cache-err-60010.stderr index 4f9615104cb..4f5e3181832 100644 --- a/tests/ui/traits/cycle-cache-err-60010.stderr +++ b/tests/ui/traits/cycle-cache-err-60010.stderr @@ -21,7 +21,7 @@ note: required because it appears within the type `RootDatabase` LL | struct RootDatabase { | ^^^^^^^^^^^^ note: required for `RootDatabase` to implement `SourceDatabase` - --> $DIR/cycle-cache-err-60010.rs:44:9 + --> $DIR/cycle-cache-err-60010.rs:43:9 | LL | impl<T> SourceDatabase for T | ^^^^^^^^^^^^^^ ^ @@ -29,7 +29,7 @@ LL | where LL | T: RefUnwindSafe, | ------------- unsatisfied trait bound introduced here note: required for `ParseQuery` to implement `Query<RootDatabase>` - --> $DIR/cycle-cache-err-60010.rs:37:10 + --> $DIR/cycle-cache-err-60010.rs:36:10 | LL | impl<DB> Query<DB> for ParseQuery | ^^^^^^^^^ ^^^^^^^^^^ @@ -37,6 +37,59 @@ LL | where LL | DB: SourceDatabase, | -------------- unsatisfied trait bound introduced here -error: aborting due to 1 previous error +error[E0275]: overflow evaluating the requirement `SalsaStorage: RefUnwindSafe` + --> $DIR/cycle-cache-err-60010.rs:32:20 + | +LL | type Storage = SalsaStorage; + | ^^^^^^^^^^^^ + | +note: required because it appears within the type `PhantomData<SalsaStorage>` + --> $SRC_DIR/core/src/marker.rs:LL:COL +note: required because it appears within the type `Unique<SalsaStorage>` + --> $SRC_DIR/core/src/ptr/unique.rs:LL:COL +note: required because it appears within the type `Box<SalsaStorage>` + --> $SRC_DIR/alloc/src/boxed.rs:LL:COL +note: required because it appears within the type `Runtime<RootDatabase>` + --> $DIR/cycle-cache-err-60010.rs:23:8 + | +LL | struct Runtime<DB: Database> { + | ^^^^^^^ +note: required because it appears within the type `RootDatabase` + --> $DIR/cycle-cache-err-60010.rs:20:8 + | +LL | struct RootDatabase { + | ^^^^^^^^^^^^ +note: required for `RootDatabase` to implement `SourceDatabase` + --> $DIR/cycle-cache-err-60010.rs:43:9 + | +LL | impl<T> SourceDatabase for T + | ^^^^^^^^^^^^^^ ^ +LL | where +LL | T: RefUnwindSafe, + | ------------- unsatisfied trait bound introduced here +note: required for `ParseQuery` to implement `Query<RootDatabase>` + --> $DIR/cycle-cache-err-60010.rs:36:10 + | +LL | impl<DB> Query<DB> for ParseQuery + | ^^^^^^^^^ ^^^^^^^^^^ +LL | where +LL | DB: SourceDatabase, + | -------------- unsatisfied trait bound introduced here +note: required because it appears within the type `SalsaStorage` + --> $DIR/cycle-cache-err-60010.rs:26:8 + | +LL | struct SalsaStorage { + | ^^^^^^^^^^^^ +note: required by a bound in `Database::Storage` + --> $DIR/cycle-cache-err-60010.rs:7:5 + | +LL | type Storage; + | ^^^^^^^^^^^^^ required by this bound in `Database::Storage` +help: consider relaxing the implicit `Sized` restriction + | +LL | type Storage: ?Sized; + | ++++++++ + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/traits/negative-impls/negated-auto-traits-rpass.rs b/tests/ui/traits/negative-impls/negated-auto-traits-rpass.rs index 0bc611c26ca..05345d3432b 100644 --- a/tests/ui/traits/negative-impls/negated-auto-traits-rpass.rs +++ b/tests/ui/traits/negative-impls/negated-auto-traits-rpass.rs @@ -5,7 +5,7 @@ pub struct WaitToken; impl !Send for WaitToken {} -pub struct Test<T>(#[allow(unused_tuple_struct_fields)] T); +pub struct Test<T>(#[allow(dead_code)] T); unsafe impl<T: 'static> Send for Test<T> {} pub fn spawn<F>(_: F) -> () where F: FnOnce(), F: Send + 'static {} diff --git a/tests/ui/traits/next-solver/specialization-transmute.rs b/tests/ui/traits/next-solver/specialization-transmute.rs index 58b62f52dfd..ff25656a7ff 100644 --- a/tests/ui/traits/next-solver/specialization-transmute.rs +++ b/tests/ui/traits/next-solver/specialization-transmute.rs @@ -4,15 +4,15 @@ //~^ WARN the feature `specialization` is incomplete trait Default { - type Id; + type Id; - fn intu(&self) -> &Self::Id; + fn intu(&self) -> &Self::Id; } impl<T> Default for T { default type Id = T; //~ ERROR type annotations needed // This will be fixed by #111994 - fn intu(&self) -> &Self::Id { //~ ERROR type annotations needed + fn intu(&self) -> &Self::Id { self } } diff --git a/tests/ui/traits/next-solver/specialization-transmute.stderr b/tests/ui/traits/next-solver/specialization-transmute.stderr index eaf32a475ac..a5459165587 100644 --- a/tests/ui/traits/next-solver/specialization-transmute.stderr +++ b/tests/ui/traits/next-solver/specialization-transmute.stderr @@ -8,19 +8,12 @@ LL | #![feature(specialization)] = help: consider using `min_specialization` instead, which is more stable and complete = note: `#[warn(incomplete_features)]` on by default -error[E0284]: type annotations needed: cannot satisfy `<T as Default>::Id normalizes-to _` - --> $DIR/specialization-transmute.rs:15:23 - | -LL | fn intu(&self) -> &Self::Id { - | ^^^^^^^^^ cannot satisfy `<T as Default>::Id normalizes-to _` - error[E0282]: type annotations needed --> $DIR/specialization-transmute.rs:13:23 | LL | default type Id = T; | ^ cannot infer type for associated type `<T as Default>::Id` -error: aborting due to 2 previous errors; 1 warning emitted +error: aborting due to 1 previous error; 1 warning emitted -Some errors have detailed explanations: E0282, E0284. -For more information about an error, try `rustc --explain E0282`. +For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/traits/object/exclusion.rs b/tests/ui/traits/object/exclusion.rs index 766dceeaffe..3abd3bbfccf 100644 --- a/tests/ui/traits/object/exclusion.rs +++ b/tests/ui/traits/object/exclusion.rs @@ -8,7 +8,7 @@ trait Future: 'static { } } -struct Map<A>(#[allow(unused_tuple_struct_fields)] A); +struct Map<A>(#[allow(dead_code)] A); impl<A: Future> Future for Map<A> {} pub struct Promise; diff --git a/tests/ui/traits/object/generics.rs b/tests/ui/traits/object/generics.rs index 5a4a6aecc6b..e2e70d43ab8 100644 --- a/tests/ui/traits/object/generics.rs +++ b/tests/ui/traits/object/generics.rs @@ -25,7 +25,7 @@ impl<A1, A2, A3> Impl<A1, A2, A3> { // test for #8601 -enum Type<T> { Constant(#[allow(unused_tuple_struct_fields)] T) } +enum Type<T> { Constant(#[allow(dead_code)] T) } trait Trait<K,V> { fn method(&self, _: Type<(K,V)>) -> isize; diff --git a/tests/ui/traits/pointee-deduction.rs b/tests/ui/traits/pointee-deduction.rs index c333b0129c8..82e3aa1ae89 100644 --- a/tests/ui/traits/pointee-deduction.rs +++ b/tests/ui/traits/pointee-deduction.rs @@ -13,8 +13,8 @@ impl Foo for () { type Bar = (); } -struct Wrapper1<T: Foo>(#[allow(unused_tuple_struct_fields)] <T as Foo>::Bar); -struct Wrapper2<T: Foo>(#[allow(unused_tuple_struct_fields)] <Wrapper1<T> as Pointee>::Metadata); +struct Wrapper1<T: Foo>(#[allow(dead_code)] <T as Foo>::Bar); +struct Wrapper2<T: Foo>(#[allow(dead_code)] <Wrapper1<T> as Pointee>::Metadata); fn main() { let _: Wrapper2<()> = Wrapper2(()); diff --git a/tests/ui/traits/principal-less-objects.rs b/tests/ui/traits/principal-less-objects.rs index 62bad0d7d77..5fe01efa4f8 100644 --- a/tests/ui/traits/principal-less-objects.rs +++ b/tests/ui/traits/principal-less-objects.rs @@ -7,7 +7,7 @@ use std::mem; // Array is to make sure the size is not exactly pointer-size, so // we can be sure we are measuring the right size in the // `size_of_val` test. -struct SetOnDrop<'a>(&'a AtomicUsize, #[allow(unused_tuple_struct_fields)] [u8; 64]); +struct SetOnDrop<'a>(&'a AtomicUsize, #[allow(dead_code)] [u8; 64]); impl<'a> Drop for SetOnDrop<'a> { fn drop(&mut self) { self.0.store(self.0.load(Ordering::Relaxed) + 1, Ordering::Relaxed); diff --git a/tests/ui/traits/safety-fn-body.mir.stderr b/tests/ui/traits/safety-fn-body.mir.stderr deleted file mode 100644 index 9a04f3e7d62..00000000000 --- a/tests/ui/traits/safety-fn-body.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/safety-fn-body.rs:14:9 - | -LL | *self += 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 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/traits/safety-fn-body.rs b/tests/ui/traits/safety-fn-body.rs index 2cc4fe1b344..df527747305 100644 --- a/tests/ui/traits/safety-fn-body.rs +++ b/tests/ui/traits/safety-fn-body.rs @@ -1,9 +1,6 @@ // Check that an unsafe impl does not imply that unsafe actions are // legal in the methods. -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - unsafe trait UnsafeTrait : Sized { fn foo(self) { } } diff --git a/tests/ui/traits/safety-fn-body.thir.stderr b/tests/ui/traits/safety-fn-body.stderr index 5d4626c161e..7a8e6c81a22 100644 --- a/tests/ui/traits/safety-fn-body.thir.stderr +++ b/tests/ui/traits/safety-fn-body.stderr @@ -1,5 +1,5 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/safety-fn-body.rs:14:9 + --> $DIR/safety-fn-body.rs:11:9 | LL | *self += 1; | ^^^^^ dereference of raw pointer diff --git a/tests/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs b/tests/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs index 0aa644db052..d869794ec0a 100644 --- a/tests/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs +++ b/tests/ui/type-alias-enum-variants/enum-variant-generic-args-pass.rs @@ -9,7 +9,7 @@ #![allow(irrefutable_let_patterns)] -enum Enum<T> { TSVariant(#[allow(unused_tuple_struct_fields)] T), SVariant { _v: T }, UVariant } +enum Enum<T> { TSVariant(#[allow(dead_code)] T), SVariant { _v: T }, UVariant } type Alias<T> = Enum<T>; type AliasFixed = Enum<()>; diff --git a/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr b/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr index 404e376e364..94113b336c3 100644 --- a/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr +++ b/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr @@ -44,11 +44,6 @@ note: ...which requires preparing `Alpha::V3::{constant#0}` for borrow checking. | LL | V3 = Self::V1 {} as u8 + 2, | ^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires unsafety-checking `Alpha::V3::{constant#0}`... - --> $DIR/self-in-enum-definition.rs:5:10 - | -LL | V3 = Self::V1 {} as u8 + 2, - | ^^^^^^^^^^^^^^^^^^^^^ note: ...which requires building MIR for `Alpha::V3::{constant#0}`... --> $DIR/self-in-enum-definition.rs:5:10 | diff --git a/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr b/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr index 88529b370f1..be9b07823ae 100644 --- a/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr +++ b/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr @@ -1,8 +1,13 @@ error[E0277]: the trait bound `T: Trait` is not satisfied - --> $DIR/generic_underconstrained.rs:9:31 + --> $DIR/generic_underconstrained.rs:9:51 | -LL | fn underconstrain<T>(_: T) -> Underconstrained<T> { - | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` +LL | fn underconstrain<T>(_: T) -> Underconstrained<T> { + | ___________________________________________________^ +LL | | +LL | | +LL | | unimplemented!() +LL | | } + | |_^ the trait `Trait` is not implemented for `T` | note: required by a bound on the type alias `Underconstrained` --> $DIR/generic_underconstrained.rs:6:26 @@ -15,15 +20,10 @@ LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> { | +++++++ error[E0277]: the trait bound `T: Trait` is not satisfied - --> $DIR/generic_underconstrained.rs:9:51 + --> $DIR/generic_underconstrained.rs:9:31 | -LL | fn underconstrain<T>(_: T) -> Underconstrained<T> { - | ___________________________________________________^ -LL | | -LL | | -LL | | unimplemented!() -LL | | } - | |_^ the trait `Trait` is not implemented for `T` +LL | fn underconstrain<T>(_: T) -> Underconstrained<T> { + | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T` | note: required by a bound on the type alias `Underconstrained` --> $DIR/generic_underconstrained.rs:6:26 diff --git a/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr b/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr index b3b9cbca968..15d96191ba9 100644 --- a/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr +++ b/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr @@ -1,8 +1,13 @@ error[E0277]: `U` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:8:33 + --> $DIR/generic_underconstrained2.rs:8:53 | -LL | fn underconstrained<U>(_: U) -> Underconstrained<U> { - | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` +LL | fn underconstrained<U>(_: U) -> Underconstrained<U> { + | _____________________________________________________^ +LL | | +LL | | +LL | | 5u32 +LL | | } + | |_^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` | note: required by a bound on the type alias `Underconstrained` --> $DIR/generic_underconstrained2.rs:5:26 @@ -15,10 +20,15 @@ LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> { | +++++++++++++++++ error[E0277]: `V` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:17:43 + --> $DIR/generic_underconstrained2.rs:17:64 | -LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> { - | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug` +LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> { + | ________________________________________________________________^ +LL | | +LL | | +LL | | 5u32 +LL | | } + | |_^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug` | note: required by a bound on the type alias `Underconstrained2` --> $DIR/generic_underconstrained2.rs:14:27 @@ -31,15 +41,10 @@ LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained | +++++++++++++++++ error[E0277]: `U` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:8:53 + --> $DIR/generic_underconstrained2.rs:8:33 | -LL | fn underconstrained<U>(_: U) -> Underconstrained<U> { - | _____________________________________________________^ -LL | | -LL | | -LL | | 5u32 -LL | | } - | |_^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` +LL | fn underconstrained<U>(_: U) -> Underconstrained<U> { + | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug` | note: required by a bound on the type alias `Underconstrained` --> $DIR/generic_underconstrained2.rs:5:26 @@ -52,15 +57,10 @@ LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> { | +++++++++++++++++ error[E0277]: `V` doesn't implement `Debug` - --> $DIR/generic_underconstrained2.rs:17:64 + --> $DIR/generic_underconstrained2.rs:17:43 | -LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> { - | ________________________________________________________________^ -LL | | -LL | | -LL | | 5u32 -LL | | } - | |_^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug` +LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> { + | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug` | note: required by a bound on the type alias `Underconstrained2` --> $DIR/generic_underconstrained2.rs:14:27 diff --git a/tests/ui/type-alias-impl-trait/issue-53092-2.stderr b/tests/ui/type-alias-impl-trait/issue-53092-2.stderr index e4054e14abe..e805a71ea6f 100644 --- a/tests/ui/type-alias-impl-trait/issue-53092-2.stderr +++ b/tests/ui/type-alias-impl-trait/issue-53092-2.stderr @@ -17,17 +17,11 @@ LL | const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) }; = note: ...which requires computing layout of `Bug<u8, ()>`... = note: ...which requires normalizing `Bug<u8, ()>`... = note: ...which again requires computing type of `Bug::{opaque#0}`, completing the cycle -note: cycle used when checking item types in top-level module - --> $DIR/issue-53092-2.rs:1:1 - | -LL | / #![feature(type_alias_impl_trait)] -LL | | #![allow(dead_code)] -LL | | -LL | | type Bug<T, U> = impl Fn(T) -> U + Copy; -... | -LL | | CONST_BUG(0); -LL | | } - | |_^ +note: cycle used when checking that `Bug::{opaque#0}` is well-formed + --> $DIR/issue-53092-2.rs:4:18 + | +LL | type Bug<T, U> = impl Fn(T) -> U + Copy; + | ^^^^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information error[E0277]: the trait bound `U: From<T>` is not satisfied diff --git a/tests/ui/typeck/issue-2063.rs b/tests/ui/typeck/issue-2063.rs index f08f9d4cfe4..b00bbc082af 100644 --- a/tests/ui/typeck/issue-2063.rs +++ b/tests/ui/typeck/issue-2063.rs @@ -3,7 +3,7 @@ // cause compiler to loop. Note that no instances // of such a type could ever be constructed. -struct T(#[allow(unused_tuple_struct_fields)] Box<T>); +struct T(#[allow(dead_code)] Box<T>); trait ToStr2 { fn my_to_string(&self) -> String; diff --git a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr index 4c2cb0eb753..b0e71507a2e 100644 --- a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr +++ b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr @@ -1,3 +1,20 @@ +error[E0053]: method `dummy2` has an incompatible type for trait + --> $DIR/ufcs-explicit-self-bad.rs:37:21 + | +LL | fn dummy2(self: &Bar<T>) {} + | ------^^^^^^^ + | | | + | | expected `&'a Bar<T>`, found `Bar<T>` + | help: change the self-receiver type to match the trait: `&self` + | +note: type in trait + --> $DIR/ufcs-explicit-self-bad.rs:31:15 + | +LL | fn dummy2(&self); + | ^^^^^ + = note: expected signature `fn(&&'a Bar<_>)` + found signature `fn(&Bar<_>)` + error[E0307]: invalid `self` parameter type: isize --> $DIR/ufcs-explicit-self-bad.rs:8:18 | @@ -101,23 +118,6 @@ note: ...does not necessarily outlive the anonymous lifetime defined here LL | fn dummy3(self: &&Bar<T>) {} | ^^^^^^^ -error[E0053]: method `dummy2` has an incompatible type for trait - --> $DIR/ufcs-explicit-self-bad.rs:37:21 - | -LL | fn dummy2(self: &Bar<T>) {} - | ------^^^^^^^ - | | | - | | expected `&'a Bar<T>`, found `Bar<T>` - | help: change the self-receiver type to match the trait: `&self` - | -note: type in trait - --> $DIR/ufcs-explicit-self-bad.rs:31:15 - | -LL | fn dummy2(&self); - | ^^^^^ - = note: expected signature `fn(&&'a Bar<_>)` - found signature `fn(&Bar<_>)` - error: aborting due to 8 previous errors Some errors have detailed explanations: E0053, E0307, E0308. diff --git a/tests/ui/unboxed-closures/type-id-higher-rank.rs b/tests/ui/unboxed-closures/type-id-higher-rank.rs index 1f8aec205fb..a9db71a0399 100644 --- a/tests/ui/unboxed-closures/type-id-higher-rank.rs +++ b/tests/ui/unboxed-closures/type-id-higher-rank.rs @@ -4,7 +4,7 @@ use std::any::{Any, TypeId}; -struct Struct<'a>(#[allow(unused_tuple_struct_fields)] &'a ()); +struct Struct<'a>(#[allow(dead_code)] &'a ()); trait Trait<'a> {} fn main() { diff --git a/tests/ui/union/union-align.rs b/tests/ui/union/union-align.rs index 6a44f27dbb2..67ab10fef4b 100644 --- a/tests/ui/union/union-align.rs +++ b/tests/ui/union/union-align.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(dead_code)] diff --git a/tests/ui/union/union-backcomp.rs b/tests/ui/union/union-backcomp.rs index b19eab9f52b..21b9fc50e1d 100644 --- a/tests/ui/union/union-backcomp.rs +++ b/tests/ui/union/union-backcomp.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(path_statements)] #![allow(dead_code)] diff --git a/tests/ui/union/union-basic.rs b/tests/ui/union/union-basic.rs index dcc552ac75c..1009def7d52 100644 --- a/tests/ui/union/union-basic.rs +++ b/tests/ui/union/union-basic.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(unused_imports)] diff --git a/tests/ui/union/union-borrow-move-parent-sibling.rs b/tests/ui/union/union-borrow-move-parent-sibling.rs index 83781c5e550..5b0b44232e4 100644 --- a/tests/ui/union/union-borrow-move-parent-sibling.rs +++ b/tests/ui/union/union-borrow-move-parent-sibling.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![allow(unused)] use std::ops::{Deref, DerefMut}; diff --git a/tests/ui/union/union-borrow-move-parent-sibling.mirunsafeck.stderr b/tests/ui/union/union-borrow-move-parent-sibling.stderr index 7f931b49a58..c9a440a66cc 100644 --- a/tests/ui/union/union-borrow-move-parent-sibling.mirunsafeck.stderr +++ b/tests/ui/union/union-borrow-move-parent-sibling.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x`) - --> $DIR/union-borrow-move-parent-sibling.rs:56:13 + --> $DIR/union-borrow-move-parent-sibling.rs:53:13 | LL | let a = &mut (*u.x).0; | --- mutable borrow occurs here (via `u.x`) @@ -11,7 +11,7 @@ LL | use_borrow(a); = note: `u.y` is a field of the union `U`, so it overlaps the field `u.x` error[E0507]: cannot move out of dereference of `ManuallyDrop<((MockVec<u8>, MockVec<u8>), MockVec<u8>)>` - --> $DIR/union-borrow-move-parent-sibling.rs:62:13 + --> $DIR/union-borrow-move-parent-sibling.rs:59:13 | LL | let a = u.x.0; | ^^^^^ move occurs because value has type `(MockVec<u8>, MockVec<u8>)`, which does not implement the `Copy` trait @@ -22,7 +22,7 @@ LL | let a = &u.x.0; | + error[E0382]: use of moved value: `u` - --> $DIR/union-borrow-move-parent-sibling.rs:64:13 + --> $DIR/union-borrow-move-parent-sibling.rs:61:13 | LL | let u = U { x: ManuallyDrop::new(((MockVec::new(), MockVec::new()), MockVec::new())) }; | - move occurs because `u` has type `U`, which does not implement the `Copy` trait @@ -33,7 +33,7 @@ LL | let b = u.y; | ^^^ value used here after move error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x`) - --> $DIR/union-borrow-move-parent-sibling.rs:70:13 + --> $DIR/union-borrow-move-parent-sibling.rs:67:13 | LL | let a = &mut ((*u.x).0).0; | --- mutable borrow occurs here (via `u.x`) @@ -45,7 +45,7 @@ LL | use_borrow(a); = note: `u.y` is a field of the union `U`, so it overlaps the field `u.x` error[E0507]: cannot move out of dereference of `ManuallyDrop<((MockVec<u8>, MockVec<u8>), MockVec<u8>)>` - --> $DIR/union-borrow-move-parent-sibling.rs:76:13 + --> $DIR/union-borrow-move-parent-sibling.rs:73:13 | LL | let a = (u.x.0).0; | ^^^^^^^^^ move occurs because value has type `MockVec<u8>`, which does not implement the `Copy` trait @@ -56,7 +56,7 @@ LL | let a = &(u.x.0).0; | + error[E0382]: use of moved value: `u` - --> $DIR/union-borrow-move-parent-sibling.rs:78:13 + --> $DIR/union-borrow-move-parent-sibling.rs:75:13 | LL | let u = U { x: ManuallyDrop::new(((MockVec::new(), MockVec::new()), MockVec::new())) }; | - move occurs because `u` has type `U`, which does not implement the `Copy` trait @@ -67,7 +67,7 @@ LL | let b = u.y; | ^^^ value used here after move error[E0502]: cannot borrow `u` (via `u.x`) as immutable because it is also borrowed as mutable (via `u.y`) - --> $DIR/union-borrow-move-parent-sibling.rs:84:13 + --> $DIR/union-borrow-move-parent-sibling.rs:81:13 | LL | let a = &mut *u.y; | --- mutable borrow occurs here (via `u.y`) diff --git a/tests/ui/union/union-borrow-move-parent-sibling.thirunsafeck.stderr b/tests/ui/union/union-borrow-move-parent-sibling.thirunsafeck.stderr deleted file mode 100644 index 7f931b49a58..00000000000 --- a/tests/ui/union/union-borrow-move-parent-sibling.thirunsafeck.stderr +++ /dev/null @@ -1,84 +0,0 @@ -error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x`) - --> $DIR/union-borrow-move-parent-sibling.rs:56:13 - | -LL | let a = &mut (*u.x).0; - | --- mutable borrow occurs here (via `u.x`) -LL | let b = &u.y; - | ^^^^ immutable borrow of `u.y` -- which overlaps with `u.x` -- occurs here -LL | use_borrow(a); - | - mutable borrow later used here - | - = note: `u.y` is a field of the union `U`, so it overlaps the field `u.x` - -error[E0507]: cannot move out of dereference of `ManuallyDrop<((MockVec<u8>, MockVec<u8>), MockVec<u8>)>` - --> $DIR/union-borrow-move-parent-sibling.rs:62:13 - | -LL | let a = u.x.0; - | ^^^^^ move occurs because value has type `(MockVec<u8>, MockVec<u8>)`, which does not implement the `Copy` trait - | -help: consider borrowing here - | -LL | let a = &u.x.0; - | + - -error[E0382]: use of moved value: `u` - --> $DIR/union-borrow-move-parent-sibling.rs:64:13 - | -LL | let u = U { x: ManuallyDrop::new(((MockVec::new(), MockVec::new()), MockVec::new())) }; - | - move occurs because `u` has type `U`, which does not implement the `Copy` trait -LL | let a = u.x.0; -LL | let a = u.x; - | --- value moved here -LL | let b = u.y; - | ^^^ value used here after move - -error[E0502]: cannot borrow `u` (via `u.y`) as immutable because it is also borrowed as mutable (via `u.x`) - --> $DIR/union-borrow-move-parent-sibling.rs:70:13 - | -LL | let a = &mut ((*u.x).0).0; - | --- mutable borrow occurs here (via `u.x`) -LL | let b = &u.y; - | ^^^^ immutable borrow of `u.y` -- which overlaps with `u.x` -- occurs here -LL | use_borrow(a); - | - mutable borrow later used here - | - = note: `u.y` is a field of the union `U`, so it overlaps the field `u.x` - -error[E0507]: cannot move out of dereference of `ManuallyDrop<((MockVec<u8>, MockVec<u8>), MockVec<u8>)>` - --> $DIR/union-borrow-move-parent-sibling.rs:76:13 - | -LL | let a = (u.x.0).0; - | ^^^^^^^^^ move occurs because value has type `MockVec<u8>`, which does not implement the `Copy` trait - | -help: consider borrowing here - | -LL | let a = &(u.x.0).0; - | + - -error[E0382]: use of moved value: `u` - --> $DIR/union-borrow-move-parent-sibling.rs:78:13 - | -LL | let u = U { x: ManuallyDrop::new(((MockVec::new(), MockVec::new()), MockVec::new())) }; - | - move occurs because `u` has type `U`, which does not implement the `Copy` trait -LL | let a = (u.x.0).0; -LL | let a = u.x; - | --- value moved here -LL | let b = u.y; - | ^^^ value used here after move - -error[E0502]: cannot borrow `u` (via `u.x`) as immutable because it is also borrowed as mutable (via `u.y`) - --> $DIR/union-borrow-move-parent-sibling.rs:84:13 - | -LL | let a = &mut *u.y; - | --- mutable borrow occurs here (via `u.y`) -LL | let b = &u.x; - | ^^^^ immutable borrow of `u.x` -- which overlaps with `u.y` -- occurs here -LL | use_borrow(a); - | - mutable borrow later used here - | - = note: `u.x` is a field of the union `U`, so it overlaps the field `u.y` - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0382, E0502, E0507. -For more information about an error, try `rustc --explain E0382`. diff --git a/tests/ui/union/union-const-codegen.rs b/tests/ui/union/union-const-codegen.rs index 32a546cf35f..d5b30559595 100644 --- a/tests/ui/union/union-const-codegen.rs +++ b/tests/ui/union/union-const-codegen.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck union U { a: u64, diff --git a/tests/ui/union/union-const-eval-field.rs b/tests/ui/union/union-const-eval-field.rs index ca48785cd9f..15a20899a78 100644 --- a/tests/ui/union/union-const-eval-field.rs +++ b/tests/ui/union/union-const-eval-field.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck type Field1 = (i32, u32); type Field2 = f32; diff --git a/tests/ui/union/union-const-eval.rs b/tests/ui/union/union-const-eval.rs index 32ee4a739ea..70a97795b75 100644 --- a/tests/ui/union/union-const-eval.rs +++ b/tests/ui/union/union-const-eval.rs @@ -1,6 +1,4 @@ // check-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck union U { a: usize, diff --git a/tests/ui/union/union-deref.rs b/tests/ui/union/union-deref.rs index 5aa28d93f96..02f9bf2c413 100644 --- a/tests/ui/union/union-deref.rs +++ b/tests/ui/union/union-deref.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - //! Test the part of RFC 2514 that is about not applying `DerefMut` coercions //! of union fields. diff --git a/tests/ui/union/union-deref.mirunsafeck.stderr b/tests/ui/union/union-deref.stderr index be5e60ab88a..38fce568ae7 100644 --- a/tests/ui/union/union-deref.mirunsafeck.stderr +++ b/tests/ui/union/union-deref.stderr @@ -1,5 +1,5 @@ error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:16:14 + --> $DIR/union-deref.rs:13:14 | LL | unsafe { u.f.0 = Vec::new() }; | ^^^ @@ -8,7 +8,7 @@ LL | unsafe { u.f.0 = Vec::new() }; = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:18:19 + --> $DIR/union-deref.rs:15:19 | LL | unsafe { &mut u.f.0 }; | ^^^ @@ -17,7 +17,7 @@ LL | unsafe { &mut u.f.0 }; = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:20:14 + --> $DIR/union-deref.rs:17:14 | LL | unsafe { u.f.0.push(0) }; | ^^^ @@ -26,7 +26,7 @@ LL | unsafe { u.f.0.push(0) }; = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:24:14 + --> $DIR/union-deref.rs:21:14 | LL | unsafe { u.f.0.0 = Vec::new() }; | ^^^^^ @@ -35,7 +35,7 @@ LL | unsafe { u.f.0.0 = Vec::new() }; = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:26:19 + --> $DIR/union-deref.rs:23:19 | LL | unsafe { &mut u.f.0.0 }; | ^^^^^ @@ -44,7 +44,7 @@ LL | unsafe { &mut u.f.0.0 }; = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:28:14 + --> $DIR/union-deref.rs:25:14 | LL | unsafe { u.f.0.0.push(0) }; | ^^^^^ diff --git a/tests/ui/union/union-deref.thirunsafeck.stderr b/tests/ui/union/union-deref.thirunsafeck.stderr deleted file mode 100644 index be5e60ab88a..00000000000 --- a/tests/ui/union/union-deref.thirunsafeck.stderr +++ /dev/null @@ -1,56 +0,0 @@ -error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:16:14 - | -LL | unsafe { u.f.0 = Vec::new() }; - | ^^^ - | - = help: writing to this reference calls the destructor for the old value - = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor - -error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:18:19 - | -LL | unsafe { &mut u.f.0 }; - | ^^^ - | - = help: writing to this reference calls the destructor for the old value - = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor - -error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:20:14 - | -LL | unsafe { u.f.0.push(0) }; - | ^^^ - | - = help: writing to this reference calls the destructor for the old value - = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor - -error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:24:14 - | -LL | unsafe { u.f.0.0 = Vec::new() }; - | ^^^^^ - | - = help: writing to this reference calls the destructor for the old value - = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor - -error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:26:19 - | -LL | unsafe { &mut u.f.0.0 }; - | ^^^^^ - | - = help: writing to this reference calls the destructor for the old value - = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor - -error: not automatically applying `DerefMut` on `ManuallyDrop` union field - --> $DIR/union-deref.rs:28:14 - | -LL | unsafe { u.f.0.0.push(0) }; - | ^^^^^ - | - = help: writing to this reference calls the destructor for the old value - = help: add an explicit `*` if that is desired, or call `ptr::write` to not run the destructor - -error: aborting due to 6 previous errors - diff --git a/tests/ui/union/union-derive-clone.rs b/tests/ui/union/union-derive-clone.rs index 7aa62146e54..7ab19edb471 100644 --- a/tests/ui/union/union-derive-clone.rs +++ b/tests/ui/union/union-derive-clone.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - use std::mem::ManuallyDrop; #[derive(Clone)] //~ ERROR the trait bound `U1: Copy` is not satisfied diff --git a/tests/ui/union/union-derive-clone.mirunsafeck.stderr b/tests/ui/union/union-derive-clone.stderr index 4d23d230fa3..39f1e32e6eb 100644 --- a/tests/ui/union/union-derive-clone.mirunsafeck.stderr +++ b/tests/ui/union/union-derive-clone.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `U1: Copy` is not satisfied - --> $DIR/union-derive-clone.rs:6:10 + --> $DIR/union-derive-clone.rs:3:10 | LL | #[derive(Clone)] | ^^^^^ the trait `Copy` is not implemented for `U1` @@ -14,7 +14,7 @@ LL | union U1 { | error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied - --> $DIR/union-derive-clone.rs:38:15 + --> $DIR/union-derive-clone.rs:35:15 | LL | union U5<T> { | ----------- @@ -29,7 +29,7 @@ LL | let w = u.clone(); | ^^^^^ method cannot be called on `U5<CloneNoCopy>` due to unsatisfied trait bounds | note: trait bound `CloneNoCopy: Copy` was not satisfied - --> $DIR/union-derive-clone.rs:28:10 + --> $DIR/union-derive-clone.rs:25:10 | LL | #[derive(Clone, Copy)] | ^^^^^ unsatisfied trait bound introduced in this `derive` macro diff --git a/tests/ui/union/union-derive-clone.thirunsafeck.stderr b/tests/ui/union/union-derive-clone.thirunsafeck.stderr deleted file mode 100644 index 4d23d230fa3..00000000000 --- a/tests/ui/union/union-derive-clone.thirunsafeck.stderr +++ /dev/null @@ -1,45 +0,0 @@ -error[E0277]: the trait bound `U1: Copy` is not satisfied - --> $DIR/union-derive-clone.rs:6:10 - | -LL | #[derive(Clone)] - | ^^^^^ the trait `Copy` is not implemented for `U1` - | -note: required by a bound in `AssertParamIsCopy` - --> $SRC_DIR/core/src/clone.rs:LL:COL - = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) -help: consider annotating `U1` with `#[derive(Copy)]` - | -LL + #[derive(Copy)] -LL | union U1 { - | - -error[E0599]: the method `clone` exists for union `U5<CloneNoCopy>`, but its trait bounds were not satisfied - --> $DIR/union-derive-clone.rs:38:15 - | -LL | union U5<T> { - | ----------- - | | - | method `clone` not found for this union - | doesn't satisfy `U5<CloneNoCopy>: Clone` -... -LL | struct CloneNoCopy; - | ------------------ doesn't satisfy `CloneNoCopy: Copy` -... -LL | let w = u.clone(); - | ^^^^^ method cannot be called on `U5<CloneNoCopy>` due to unsatisfied trait bounds - | -note: trait bound `CloneNoCopy: Copy` was not satisfied - --> $DIR/union-derive-clone.rs:28:10 - | -LL | #[derive(Clone, Copy)] - | ^^^^^ unsatisfied trait bound introduced in this `derive` macro -help: consider annotating `CloneNoCopy` with `#[derive(Clone, Copy)]` - | -LL + #[derive(Clone, Copy)] -LL | struct CloneNoCopy; - | - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0277, E0599. -For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/union/union-derive-eq.rs b/tests/ui/union/union-derive-eq.rs index b7e7f343f8a..e689f8c27d7 100644 --- a/tests/ui/union/union-derive-eq.rs +++ b/tests/ui/union/union-derive-eq.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #[derive(Eq)] // OK union U1 { a: u8, diff --git a/tests/ui/union/union-derive-eq.mirunsafeck.stderr b/tests/ui/union/union-derive-eq.stderr index 86e7c955d2e..b068edd6d69 100644 --- a/tests/ui/union/union-derive-eq.mirunsafeck.stderr +++ b/tests/ui/union/union-derive-eq.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `PartialEqNotEq: Eq` is not satisfied - --> $DIR/union-derive-eq.rs:16:5 + --> $DIR/union-derive-eq.rs:13:5 | LL | #[derive(Eq)] | -- in this derive macro expansion diff --git a/tests/ui/union/union-derive-eq.thirunsafeck.stderr b/tests/ui/union/union-derive-eq.thirunsafeck.stderr deleted file mode 100644 index 86e7c955d2e..00000000000 --- a/tests/ui/union/union-derive-eq.thirunsafeck.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0277]: the trait bound `PartialEqNotEq: Eq` is not satisfied - --> $DIR/union-derive-eq.rs:16:5 - | -LL | #[derive(Eq)] - | -- in this derive macro expansion -LL | union U2 { -LL | a: PartialEqNotEq, - | ^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `PartialEqNotEq` - | -note: required by a bound in `AssertParamIsEq` - --> $SRC_DIR/core/src/cmp.rs:LL:COL - = note: this error originates in the derive macro `Eq` (in Nightly builds, run with -Z macro-backtrace for more info) -help: consider annotating `PartialEqNotEq` with `#[derive(Eq)]` - | -LL + #[derive(Eq)] -LL | struct PartialEqNotEq; - | - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/union/union-derive-rpass.rs b/tests/ui/union/union-derive-rpass.rs index 8276bc635fc..826b9e5a7c6 100644 --- a/tests/ui/union/union-derive-rpass.rs +++ b/tests/ui/union/union-derive-rpass.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(dead_code)] #![allow(unused_variables)] diff --git a/tests/ui/union/union-drop.rs b/tests/ui/union/union-drop.rs index c3d7d41ca35..41c1e9243f7 100644 --- a/tests/ui/union/union-drop.rs +++ b/tests/ui/union/union-drop.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(dead_code)] #![allow(unused_variables)] diff --git a/tests/ui/union/union-fields-1.mirunsafeck.stderr b/tests/ui/union/union-fields-1.mirunsafeck.stderr deleted file mode 100644 index 0c9981c69fc..00000000000 --- a/tests/ui/union/union-fields-1.mirunsafeck.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error: field `c` is never read - --> $DIR/union-fields-1.rs:9:5 - | -LL | union U1 { - | -- field in this union -... -LL | c: u8, - | ^ - | -note: the lint level is defined here - --> $DIR/union-fields-1.rs:4:9 - | -LL | #![deny(dead_code)] - | ^^^^^^^^^ - -error: field `a` is never read - --> $DIR/union-fields-1.rs:12:5 - | -LL | union U2 { - | -- field in this union -LL | a: u8, - | ^ - -error: field `a` is never read - --> $DIR/union-fields-1.rs:16:20 - | -LL | union NoDropLike { a: u8 } - | ---------- ^ - | | - | field in this union - -error: field `c` is never read - --> $DIR/union-fields-1.rs:21:5 - | -LL | union U { - | - field in this union -... -LL | c: u8, - | ^ - -error: aborting due to 4 previous errors - diff --git a/tests/ui/union/union-fields-1.rs b/tests/ui/union/union-fields-1.rs index cf2ef4c03d6..8ab34b55da2 100644 --- a/tests/ui/union/union-fields-1.rs +++ b/tests/ui/union/union-fields-1.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![deny(dead_code)] union U1 { diff --git a/tests/ui/union/union-fields-1.thirunsafeck.stderr b/tests/ui/union/union-fields-1.stderr index 0c9981c69fc..bba8aae6024 100644 --- a/tests/ui/union/union-fields-1.thirunsafeck.stderr +++ b/tests/ui/union/union-fields-1.stderr @@ -1,5 +1,5 @@ error: field `c` is never read - --> $DIR/union-fields-1.rs:9:5 + --> $DIR/union-fields-1.rs:6:5 | LL | union U1 { | -- field in this union @@ -8,13 +8,13 @@ LL | c: u8, | ^ | note: the lint level is defined here - --> $DIR/union-fields-1.rs:4:9 + --> $DIR/union-fields-1.rs:1:9 | LL | #![deny(dead_code)] | ^^^^^^^^^ error: field `a` is never read - --> $DIR/union-fields-1.rs:12:5 + --> $DIR/union-fields-1.rs:9:5 | LL | union U2 { | -- field in this union @@ -22,7 +22,7 @@ LL | a: u8, | ^ error: field `a` is never read - --> $DIR/union-fields-1.rs:16:20 + --> $DIR/union-fields-1.rs:13:20 | LL | union NoDropLike { a: u8 } | ---------- ^ @@ -30,7 +30,7 @@ LL | union NoDropLike { a: u8 } | field in this union error: field `c` is never read - --> $DIR/union-fields-1.rs:21:5 + --> $DIR/union-fields-1.rs:18:5 | LL | union U { | - field in this union diff --git a/tests/ui/union/union-fields-2.rs b/tests/ui/union/union-fields-2.rs index e738b184703..71b204fcdc5 100644 --- a/tests/ui/union/union-fields-2.rs +++ b/tests/ui/union/union-fields-2.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - union U { a: u8, b: u16, diff --git a/tests/ui/union/union-fields-2.mirunsafeck.stderr b/tests/ui/union/union-fields-2.stderr index 1157f0c2ae7..142186885ca 100644 --- a/tests/ui/union/union-fields-2.mirunsafeck.stderr +++ b/tests/ui/union/union-fields-2.stderr @@ -1,17 +1,17 @@ error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:10:13 + --> $DIR/union-fields-2.rs:7:13 | LL | let u = U {}; | ^ error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:12:13 + --> $DIR/union-fields-2.rs:9:13 | LL | let u = U { a: 0, b: 1 }; | ^ error[E0560]: union `U` has no field named `c` - --> $DIR/union-fields-2.rs:13:29 + --> $DIR/union-fields-2.rs:10:29 | LL | let u = U { a: 0, b: 1, c: 2 }; | ^ `U` does not have this field @@ -19,61 +19,61 @@ LL | let u = U { a: 0, b: 1, c: 2 }; = note: all struct fields are already assigned error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:13:13 + --> $DIR/union-fields-2.rs:10:13 | LL | let u = U { a: 0, b: 1, c: 2 }; | ^ error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:15:13 + --> $DIR/union-fields-2.rs:12:13 | LL | let u = U { ..u }; | ^ error[E0436]: functional record update syntax requires a struct - --> $DIR/union-fields-2.rs:15:19 + --> $DIR/union-fields-2.rs:12:19 | LL | let u = U { ..u }; | ^ error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:18:9 + --> $DIR/union-fields-2.rs:15:9 | LL | let U {} = u; | ^^^^ error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:20:9 + --> $DIR/union-fields-2.rs:17:9 | LL | let U { a, b } = u; | ^^^^^^^^^^ error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:21:9 + --> $DIR/union-fields-2.rs:18:9 | LL | let U { a, b, c } = u; | ^^^^^^^^^^^^^ error[E0026]: union `U` does not have a field named `c` - --> $DIR/union-fields-2.rs:21:19 + --> $DIR/union-fields-2.rs:18:19 | LL | let U { a, b, c } = u; | ^ union `U` does not have this field error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:23:9 + --> $DIR/union-fields-2.rs:20:9 | LL | let U { .. } = u; | ^^^^^^^^ error: `..` cannot be used in union patterns - --> $DIR/union-fields-2.rs:23:9 + --> $DIR/union-fields-2.rs:20:9 | LL | let U { .. } = u; | ^^^^^^^^ error: `..` cannot be used in union patterns - --> $DIR/union-fields-2.rs:25:9 + --> $DIR/union-fields-2.rs:22:9 | LL | let U { a, .. } = u; | ^^^^^^^^^^^ diff --git a/tests/ui/union/union-fields-2.thirunsafeck.stderr b/tests/ui/union/union-fields-2.thirunsafeck.stderr deleted file mode 100644 index 1157f0c2ae7..00000000000 --- a/tests/ui/union/union-fields-2.thirunsafeck.stderr +++ /dev/null @@ -1,84 +0,0 @@ -error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:10:13 - | -LL | let u = U {}; - | ^ - -error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:12:13 - | -LL | let u = U { a: 0, b: 1 }; - | ^ - -error[E0560]: union `U` has no field named `c` - --> $DIR/union-fields-2.rs:13:29 - | -LL | let u = U { a: 0, b: 1, c: 2 }; - | ^ `U` does not have this field - | - = note: all struct fields are already assigned - -error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:13:13 - | -LL | let u = U { a: 0, b: 1, c: 2 }; - | ^ - -error[E0784]: union expressions should have exactly one field - --> $DIR/union-fields-2.rs:15:13 - | -LL | let u = U { ..u }; - | ^ - -error[E0436]: functional record update syntax requires a struct - --> $DIR/union-fields-2.rs:15:19 - | -LL | let u = U { ..u }; - | ^ - -error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:18:9 - | -LL | let U {} = u; - | ^^^^ - -error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:20:9 - | -LL | let U { a, b } = u; - | ^^^^^^^^^^ - -error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:21:9 - | -LL | let U { a, b, c } = u; - | ^^^^^^^^^^^^^ - -error[E0026]: union `U` does not have a field named `c` - --> $DIR/union-fields-2.rs:21:19 - | -LL | let U { a, b, c } = u; - | ^ union `U` does not have this field - -error: union patterns should have exactly one field - --> $DIR/union-fields-2.rs:23:9 - | -LL | let U { .. } = u; - | ^^^^^^^^ - -error: `..` cannot be used in union patterns - --> $DIR/union-fields-2.rs:23:9 - | -LL | let U { .. } = u; - | ^^^^^^^^ - -error: `..` cannot be used in union patterns - --> $DIR/union-fields-2.rs:25:9 - | -LL | let U { a, .. } = u; - | ^^^^^^^^^^^ - -error: aborting due to 13 previous errors - -Some errors have detailed explanations: E0026, E0436, E0560, E0784. -For more information about an error, try `rustc --explain E0026`. diff --git a/tests/ui/union/union-generic-rpass.rs b/tests/ui/union/union-generic-rpass.rs index 25f1f5050f9..69837f31cab 100644 --- a/tests/ui/union/union-generic-rpass.rs +++ b/tests/ui/union/union-generic-rpass.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![allow(dead_code)] use std::mem::ManuallyDrop; diff --git a/tests/ui/union/union-generic.rs b/tests/ui/union/union-generic.rs index 3d68ecb87d8..ff877892579 100644 --- a/tests/ui/union/union-generic.rs +++ b/tests/ui/union/union-generic.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - use std::rc::Rc; union U<T: Copy> { diff --git a/tests/ui/union/union-generic.mirunsafeck.stderr b/tests/ui/union/union-generic.stderr index 037022a91fc..b9d4aee787e 100644 --- a/tests/ui/union/union-generic.mirunsafeck.stderr +++ b/tests/ui/union/union-generic.stderr @@ -1,23 +1,23 @@ error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied - --> $DIR/union-generic.rs:11:13 + --> $DIR/union-generic.rs:8:13 | LL | let u = U { a: Rc::new(0u32) }; | ^ the trait `Copy` is not implemented for `Rc<u32>` | note: required by a bound in `U` - --> $DIR/union-generic.rs:6:12 + --> $DIR/union-generic.rs:3:12 | LL | union U<T: Copy> { | ^^^^ required by this bound in `U` error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied - --> $DIR/union-generic.rs:13:17 + --> $DIR/union-generic.rs:10:17 | LL | let u = U::<Rc<u32>> { a: Default::default() }; | ^^^^^^^ the trait `Copy` is not implemented for `Rc<u32>` | note: required by a bound in `U` - --> $DIR/union-generic.rs:6:12 + --> $DIR/union-generic.rs:3:12 | LL | union U<T: Copy> { | ^^^^ required by this bound in `U` diff --git a/tests/ui/union/union-generic.thirunsafeck.stderr b/tests/ui/union/union-generic.thirunsafeck.stderr deleted file mode 100644 index 037022a91fc..00000000000 --- a/tests/ui/union/union-generic.thirunsafeck.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied - --> $DIR/union-generic.rs:11:13 - | -LL | let u = U { a: Rc::new(0u32) }; - | ^ the trait `Copy` is not implemented for `Rc<u32>` - | -note: required by a bound in `U` - --> $DIR/union-generic.rs:6:12 - | -LL | union U<T: Copy> { - | ^^^^ required by this bound in `U` - -error[E0277]: the trait bound `Rc<u32>: Copy` is not satisfied - --> $DIR/union-generic.rs:13:17 - | -LL | let u = U::<Rc<u32>> { a: Default::default() }; - | ^^^^^^^ the trait `Copy` is not implemented for `Rc<u32>` - | -note: required by a bound in `U` - --> $DIR/union-generic.rs:6:12 - | -LL | union U<T: Copy> { - | ^^^^ required by this bound in `U` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/union/union-inherent-method.rs b/tests/ui/union/union-inherent-method.rs index b0fd22da73a..2e75cce7b10 100644 --- a/tests/ui/union/union-inherent-method.rs +++ b/tests/ui/union/union-inherent-method.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck union U { a: u8, diff --git a/tests/ui/union/union-lint-dead-code.rs b/tests/ui/union/union-lint-dead-code.rs index 65aaf0a1d35..cb2cdd4dba0 100644 --- a/tests/ui/union/union-lint-dead-code.rs +++ b/tests/ui/union/union-lint-dead-code.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![deny(dead_code)] union Foo { diff --git a/tests/ui/union/union-lint-dead-code.mirunsafeck.stderr b/tests/ui/union/union-lint-dead-code.stderr index 8a3677d525d..691a5e19ae6 100644 --- a/tests/ui/union/union-lint-dead-code.mirunsafeck.stderr +++ b/tests/ui/union/union-lint-dead-code.stderr @@ -1,5 +1,5 @@ error: field `b` is never read - --> $DIR/union-lint-dead-code.rs:8:5 + --> $DIR/union-lint-dead-code.rs:5:5 | LL | union Foo { | --- field in this union @@ -8,7 +8,7 @@ LL | b: bool, | ^ | note: the lint level is defined here - --> $DIR/union-lint-dead-code.rs:4:9 + --> $DIR/union-lint-dead-code.rs:1:9 | LL | #![deny(dead_code)] | ^^^^^^^^^ diff --git a/tests/ui/union/union-lint-dead-code.thirunsafeck.stderr b/tests/ui/union/union-lint-dead-code.thirunsafeck.stderr deleted file mode 100644 index 8a3677d525d..00000000000 --- a/tests/ui/union/union-lint-dead-code.thirunsafeck.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: field `b` is never read - --> $DIR/union-lint-dead-code.rs:8:5 - | -LL | union Foo { - | --- field in this union -LL | x: usize, -LL | b: bool, - | ^ - | -note: the lint level is defined here - --> $DIR/union-lint-dead-code.rs:4:9 - | -LL | #![deny(dead_code)] - | ^^^^^^^^^ - -error: aborting due to 1 previous error - diff --git a/tests/ui/union/union-macro.rs b/tests/ui/union/union-macro.rs index 7fd9d8221c6..5ca013a44cd 100644 --- a/tests/ui/union/union-macro.rs +++ b/tests/ui/union/union-macro.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(unused_variables)] diff --git a/tests/ui/union/union-manuallydrop-rpass.rs b/tests/ui/union/union-manuallydrop-rpass.rs index 826bdf07cef..ba99e7441e6 100644 --- a/tests/ui/union/union-manuallydrop-rpass.rs +++ b/tests/ui/union/union-manuallydrop-rpass.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![allow(dead_code)] use std::mem::needs_drop; @@ -28,9 +25,9 @@ union UnionOk3<T: Copy> { value: T, } -trait Foo { } +trait Foo {} -trait ImpliesCopy : Copy { } +trait ImpliesCopy: Copy {} #[allow(dead_code)] union UnionOk4<T: ImpliesCopy> { diff --git a/tests/ui/union/union-move.rs b/tests/ui/union/union-move.rs index b8b1ac8046a..76220a7d40a 100644 --- a/tests/ui/union/union-move.rs +++ b/tests/ui/union/union-move.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - //! Test the behavior of moving out of non-`Copy` union fields. //! Avoid types that `Drop`, we want to focus on moving. diff --git a/tests/ui/union/union-move.mirunsafeck.stderr b/tests/ui/union/union-move.stderr index 6381ae874ba..47fb801a50e 100644 --- a/tests/ui/union/union-move.mirunsafeck.stderr +++ b/tests/ui/union/union-move.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `x` - --> $DIR/union-move.rs:29:18 + --> $DIR/union-move.rs:26:18 | LL | fn test1(x: U1) { | - move occurs because `x` has type `U1`, which does not implement the `Copy` trait @@ -10,7 +10,7 @@ LL | move_out(x.f2_nocopy); | ^^^^^^^^^^^ value used here after move | note: consider changing this parameter type in function `move_out` to borrow instead if owning the value isn't necessary - --> $DIR/union-move.rs:10:19 + --> $DIR/union-move.rs:7:19 | LL | fn move_out<T>(x: T) {} | -------- ^ this parameter takes ownership of the value @@ -18,7 +18,7 @@ LL | fn move_out<T>(x: T) {} | in this function error[E0382]: use of moved value: `x` - --> $DIR/union-move.rs:45:18 + --> $DIR/union-move.rs:42:18 | LL | fn test3(x: U1) { | - move occurs because `x` has type `U1`, which does not implement the `Copy` trait @@ -29,7 +29,7 @@ LL | move_out(x.f3_copy); | ^^^^^^^^^ value used here after move | note: consider changing this parameter type in function `move_out` to borrow instead if owning the value isn't necessary - --> $DIR/union-move.rs:10:19 + --> $DIR/union-move.rs:7:19 | LL | fn move_out<T>(x: T) {} | -------- ^ this parameter takes ownership of the value @@ -37,7 +37,7 @@ LL | fn move_out<T>(x: T) {} | in this function error[E0509]: cannot move out of type `U2`, which implements the `Drop` trait - --> $DIR/union-move.rs:52:18 + --> $DIR/union-move.rs:49:18 | LL | move_out(x.f1_nocopy); | ^^^^^^^^^^^ diff --git a/tests/ui/union/union-move.thirunsafeck.stderr b/tests/ui/union/union-move.thirunsafeck.stderr deleted file mode 100644 index 6381ae874ba..00000000000 --- a/tests/ui/union/union-move.thirunsafeck.stderr +++ /dev/null @@ -1,51 +0,0 @@ -error[E0382]: use of moved value: `x` - --> $DIR/union-move.rs:29:18 - | -LL | fn test1(x: U1) { - | - move occurs because `x` has type `U1`, which does not implement the `Copy` trait -... -LL | move_out(x.f1_nocopy); - | ----------- value moved here -LL | move_out(x.f2_nocopy); - | ^^^^^^^^^^^ value used here after move - | -note: consider changing this parameter type in function `move_out` to borrow instead if owning the value isn't necessary - --> $DIR/union-move.rs:10:19 - | -LL | fn move_out<T>(x: T) {} - | -------- ^ this parameter takes ownership of the value - | | - | in this function - -error[E0382]: use of moved value: `x` - --> $DIR/union-move.rs:45:18 - | -LL | fn test3(x: U1) { - | - move occurs because `x` has type `U1`, which does not implement the `Copy` trait -... -LL | move_out(x.f2_nocopy); - | ----------- value moved here -LL | move_out(x.f3_copy); - | ^^^^^^^^^ value used here after move - | -note: consider changing this parameter type in function `move_out` to borrow instead if owning the value isn't necessary - --> $DIR/union-move.rs:10:19 - | -LL | fn move_out<T>(x: T) {} - | -------- ^ this parameter takes ownership of the value - | | - | in this function - -error[E0509]: cannot move out of type `U2`, which implements the `Drop` trait - --> $DIR/union-move.rs:52:18 - | -LL | move_out(x.f1_nocopy); - | ^^^^^^^^^^^ - | | - | cannot move out of here - | move occurs because `x.f1_nocopy` has type `ManuallyDrop<RefCell<i32>>`, which does not implement the `Copy` trait - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0382, E0509. -For more information about an error, try `rustc --explain E0382`. diff --git a/tests/ui/union/union-nodrop.rs b/tests/ui/union/union-nodrop.rs index 6e6b105a73e..7ce17a7c825 100644 --- a/tests/ui/union/union-nodrop.rs +++ b/tests/ui/union/union-nodrop.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(dead_code)] @@ -19,10 +17,14 @@ static X: () = (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1; const Y: () = (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1; -const fn _f() { (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1 } +const fn _f() { + (NoDrop { inner: ManuallyDrop::new(NeedDrop) }, ()).1 +} // A union that scrubs the drop glue from its inner type -union NoDrop<T> { inner: ManuallyDrop<T> } +union NoDrop<T> { + inner: ManuallyDrop<T>, +} // Copy currently can't be implemented on drop-containing unions, // this may change later @@ -35,7 +37,7 @@ union NoDrop<T> { inner: ManuallyDrop<T> } // // We should be able to implement Copy for things using NoDrop // #[derive(Copy, Clone)] struct Foo { - x: NoDrop<Box<u8>> + x: NoDrop<Box<u8>>, } struct Baz { @@ -43,7 +45,9 @@ struct Baz { y: Box<u8>, } -union ActuallyDrop<T> { inner: ManuallyDrop<T> } +union ActuallyDrop<T> { + inner: ManuallyDrop<T>, +} impl<T> Drop for ActuallyDrop<T> { fn drop(&mut self) {} diff --git a/tests/ui/union/union-nonzero.rs b/tests/ui/union/union-nonzero.rs index 3f4f7ea1c10..e7ab4ebe323 100644 --- a/tests/ui/union/union-nonzero.rs +++ b/tests/ui/union/union-nonzero.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(dead_code)] diff --git a/tests/ui/union/union-overwrite.rs b/tests/ui/union/union-overwrite.rs index 0eea14d9de0..399ed9ae458 100644 --- a/tests/ui/union/union-overwrite.rs +++ b/tests/ui/union/union-overwrite.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #[repr(C)] #[derive(Copy, Clone)] diff --git a/tests/ui/union/union-packed.rs b/tests/ui/union/union-packed.rs index 9c6398bf5aa..538c337a773 100644 --- a/tests/ui/union/union-packed.rs +++ b/tests/ui/union/union-packed.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(dead_code)] #![allow(non_snake_case)] diff --git a/tests/ui/union/union-pat-refutability.rs b/tests/ui/union/union-pat-refutability.rs index d628a200a07..17ac6c6dfa9 100644 --- a/tests/ui/union/union-pat-refutability.rs +++ b/tests/ui/union/union-pat-refutability.rs @@ -1,12 +1,13 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(dead_code)] #![allow(illegal_floating_point_literal_pattern)] #[repr(u32)] -enum Tag { I, F } +enum Tag { + I, + F, +} #[repr(C)] union U { diff --git a/tests/ui/union/union-suggest-field.rs b/tests/ui/union/union-suggest-field.rs index 601a22a0600..71b93e873c2 100644 --- a/tests/ui/union/union-suggest-field.rs +++ b/tests/ui/union/union-suggest-field.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - union U { principal: u8, } diff --git a/tests/ui/union/union-suggest-field.mirunsafeck.stderr b/tests/ui/union/union-suggest-field.stderr index efe4987bd02..5c428cf6c89 100644 --- a/tests/ui/union/union-suggest-field.mirunsafeck.stderr +++ b/tests/ui/union/union-suggest-field.stderr @@ -1,5 +1,5 @@ error[E0560]: union `U` has no field named `principle` - --> $DIR/union-suggest-field.rs:13:17 + --> $DIR/union-suggest-field.rs:10:17 | LL | let u = U { principle: 0 }; | ^^^^^^^^^ unknown field @@ -10,7 +10,7 @@ LL | let u = U { principal: 0 }; | ~~~~~~~~~ error[E0609]: no field `principial` on type `U` - --> $DIR/union-suggest-field.rs:17:15 + --> $DIR/union-suggest-field.rs:14:15 | LL | let w = u.principial; | ^^^^^^^^^^ unknown field @@ -21,7 +21,7 @@ LL | let w = u.principal; | ~~~~~~~~~ error[E0615]: attempted to take value of method `calculate` on type `U` - --> $DIR/union-suggest-field.rs:21:15 + --> $DIR/union-suggest-field.rs:18:15 | LL | let y = u.calculate; | ^^^^^^^^^ method, not a field diff --git a/tests/ui/union/union-suggest-field.thirunsafeck.stderr b/tests/ui/union/union-suggest-field.thirunsafeck.stderr deleted file mode 100644 index efe4987bd02..00000000000 --- a/tests/ui/union/union-suggest-field.thirunsafeck.stderr +++ /dev/null @@ -1,37 +0,0 @@ -error[E0560]: union `U` has no field named `principle` - --> $DIR/union-suggest-field.rs:13:17 - | -LL | let u = U { principle: 0 }; - | ^^^^^^^^^ unknown field - | -help: a field with a similar name exists - | -LL | let u = U { principal: 0 }; - | ~~~~~~~~~ - -error[E0609]: no field `principial` on type `U` - --> $DIR/union-suggest-field.rs:17:15 - | -LL | let w = u.principial; - | ^^^^^^^^^^ unknown field - | -help: a field with a similar name exists - | -LL | let w = u.principal; - | ~~~~~~~~~ - -error[E0615]: attempted to take value of method `calculate` on type `U` - --> $DIR/union-suggest-field.rs:21:15 - | -LL | let y = u.calculate; - | ^^^^^^^^^ method, not a field - | -help: use parentheses to call the method - | -LL | let y = u.calculate(); - | ++ - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0560, E0609, E0615. -For more information about an error, try `rustc --explain E0560`. diff --git a/tests/ui/union/union-trait-impl.rs b/tests/ui/union/union-trait-impl.rs index 6134e91f31e..8a7ac817240 100644 --- a/tests/ui/union/union-trait-impl.rs +++ b/tests/ui/union/union-trait-impl.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck use std::fmt; diff --git a/tests/ui/union/union-transmute.rs b/tests/ui/union/union-transmute.rs index 1a3b32d55f3..be8062f6276 100644 --- a/tests/ui/union/union-transmute.rs +++ b/tests/ui/union/union-transmute.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck union U { a: (u8, u8), diff --git a/tests/ui/union/union-unsafe.mir.stderr b/tests/ui/union/union-unsafe.mir.stderr deleted file mode 100644 index 15f059ffa48..00000000000 --- a/tests/ui/union/union-unsafe.mir.stderr +++ /dev/null @@ -1,83 +0,0 @@ -error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:34:5 - | -LL | *(u.p) = 13; - | ^^^^^^^^^^^ 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:47:6 - | -LL | *u3.a = T::default(); - | ^^^^ 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:53:6 - | -LL | *u3.a = T::default(); - | ^^^^ 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:61:13 - | -LL | let a = u1.a; - | ^^^^ 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:64:14 - | -LL | let U1 { a } = u1; - | ^ 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:65:12 - | -LL | if let U1 { a: 12 } = u1 {} - | ^^^^^^^^^^^^ 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:66:12 - | -LL | if let Some(U1 { a: 13 }) = Some(u1) {} - | ^^^^^^^^^^^^^^^^^^ 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:71:6 - | -LL | *u2.a = String::from("new"); - | ^^^^ 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:75:6 - | -LL | *u3.a = 1; - | ^^^^ 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:79:6 - | -LL | *u3.a = String::from("new"); - | ^^^^ access to union field - | - = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior - -error: aborting due to 10 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/union/union-unsafe.rs b/tests/ui/union/union-unsafe.rs index d1465486f77..bd3946686be 100644 --- a/tests/ui/union/union-unsafe.rs +++ b/tests/ui/union/union-unsafe.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - use std::cell::RefCell; use std::mem::ManuallyDrop; @@ -35,7 +32,6 @@ fn deref_union_field(mut u: URef) { } fn assign_noncopy_union_field(mut u: URefCell) { - // FIXME(thir-unsafeck) u.a = (ManuallyDrop::new(RefCell::new(0)), 1); // OK (assignment does not drop) u.a.0 = ManuallyDrop::new(RefCell::new(0)); // OK (assignment does not drop) u.a.1 = 1; // OK diff --git a/tests/ui/union/union-unsafe.thir.stderr b/tests/ui/union/union-unsafe.stderr index 9ce835497c5..82b3f897167 100644 --- a/tests/ui/union/union-unsafe.thir.stderr +++ b/tests/ui/union/union-unsafe.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-unsafe.rs:34:6 + --> $DIR/union-unsafe.rs:31:6 | LL | *(u.p) = 13; | ^^^^^ access to union field @@ -7,7 +7,7 @@ LL | *(u.p) = 13; = 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:47:6 + --> $DIR/union-unsafe.rs:43:6 | LL | *u3.a = T::default(); | ^^^^ access to union field @@ -15,7 +15,7 @@ LL | *u3.a = T::default(); = 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:53:6 + --> $DIR/union-unsafe.rs:49:6 | LL | *u3.a = T::default(); | ^^^^ access to union field @@ -23,7 +23,7 @@ LL | *u3.a = T::default(); = 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:61:13 + --> $DIR/union-unsafe.rs:57:13 | LL | let a = u1.a; | ^^^^ access to union field @@ -31,7 +31,7 @@ LL | let a = u1.a; = 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:64:14 + --> $DIR/union-unsafe.rs:60:14 | LL | let U1 { a } = u1; | ^ access to union field @@ -39,7 +39,7 @@ LL | let U1 { a } = u1; = 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:65:20 + --> $DIR/union-unsafe.rs:61:20 | LL | if let U1 { a: 12 } = u1 {} | ^^ access to union field @@ -47,7 +47,7 @@ LL | if let U1 { a: 12 } = u1 {} = 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:66:25 + --> $DIR/union-unsafe.rs:62:25 | LL | if let Some(U1 { a: 13 }) = Some(u1) {} | ^^ access to union field @@ -55,7 +55,7 @@ LL | if let Some(U1 { a: 13 }) = Some(u1) {} = 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:71:6 + --> $DIR/union-unsafe.rs:67:6 | LL | *u2.a = String::from("new"); | ^^^^ access to union field @@ -63,7 +63,7 @@ LL | *u2.a = String::from("new"); = 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:75:6 + --> $DIR/union-unsafe.rs:71:6 | LL | *u3.a = 1; | ^^^^ access to union field @@ -71,7 +71,7 @@ LL | *u3.a = 1; = 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:79:6 + --> $DIR/union-unsafe.rs:75:6 | LL | *u3.a = String::from("new"); | ^^^^ access to union field diff --git a/tests/ui/union/union-unsized.rs b/tests/ui/union/union-unsized.rs index b95b2e414f3..5dd32192ab9 100644 --- a/tests/ui/union/union-unsized.rs +++ b/tests/ui/union/union-unsized.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - union U { a: str, //~^ ERROR the size for values of type diff --git a/tests/ui/union/union-unsized.mirunsafeck.stderr b/tests/ui/union/union-unsized.stderr index f8da20413b2..851ad8939d4 100644 --- a/tests/ui/union/union-unsized.mirunsafeck.stderr +++ b/tests/ui/union/union-unsized.stderr @@ -1,5 +1,5 @@ error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/union-unsized.rs:5:8 + --> $DIR/union-unsized.rs:2:8 | LL | a: str, | ^^^ doesn't have a size known at compile-time @@ -16,8 +16,20 @@ help: the `Box` type always has a statically known size and allocates its conten LL | a: Box<str>, | ++++ + +error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union + --> $DIR/union-unsized.rs:2:5 + | +LL | a: str, + | ^^^^^^ + | + = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` +help: wrap the field type in `ManuallyDrop<...>` + | +LL | a: std::mem::ManuallyDrop<str>, + | +++++++++++++++++++++++ + + error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/union-unsized.rs:14:8 + --> $DIR/union-unsized.rs:11:8 | LL | b: str, | ^^^ doesn't have a size known at compile-time @@ -35,19 +47,7 @@ LL | b: Box<str>, | ++++ + error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-unsized.rs:5:5 - | -LL | a: str, - | ^^^^^^ - | - = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` -help: wrap the field type in `ManuallyDrop<...>` - | -LL | a: std::mem::ManuallyDrop<str>, - | +++++++++++++++++++++++ + - -error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-unsized.rs:14:5 + --> $DIR/union-unsized.rs:11:5 | LL | b: str, | ^^^^^^ diff --git a/tests/ui/union/union-unsized.thirunsafeck.stderr b/tests/ui/union/union-unsized.thirunsafeck.stderr deleted file mode 100644 index f8da20413b2..00000000000 --- a/tests/ui/union/union-unsized.thirunsafeck.stderr +++ /dev/null @@ -1,64 +0,0 @@ -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/union-unsized.rs:5:8 - | -LL | a: str, - | ^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `str` - = note: no field of a union may have a dynamically sized type - = help: change the field's type to have a statically known size -help: borrowed types always have a statically known size - | -LL | a: &str, - | + -help: the `Box` type always has a statically known size and allocates its contents in the heap - | -LL | a: Box<str>, - | ++++ + - -error[E0277]: the size for values of type `str` cannot be known at compilation time - --> $DIR/union-unsized.rs:14:8 - | -LL | b: str, - | ^^^ doesn't have a size known at compile-time - | - = help: the trait `Sized` is not implemented for `str` - = note: no field of a union may have a dynamically sized type - = help: change the field's type to have a statically known size -help: borrowed types always have a statically known size - | -LL | b: &str, - | + -help: the `Box` type always has a statically known size and allocates its contents in the heap - | -LL | b: Box<str>, - | ++++ + - -error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-unsized.rs:5:5 - | -LL | a: str, - | ^^^^^^ - | - = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` -help: wrap the field type in `ManuallyDrop<...>` - | -LL | a: std::mem::ManuallyDrop<str>, - | +++++++++++++++++++++++ + - -error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-unsized.rs:14:5 - | -LL | b: str, - | ^^^^^^ - | - = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` -help: wrap the field type in `ManuallyDrop<...>` - | -LL | b: std::mem::ManuallyDrop<str>, - | +++++++++++++++++++++++ + - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0277, E0740. -For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/union/union-with-drop-fields.rs b/tests/ui/union/union-with-drop-fields.rs index 9720830fb1f..ae147e9bd2b 100644 --- a/tests/ui/union/union-with-drop-fields.rs +++ b/tests/ui/union/union-with-drop-fields.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![allow(dead_code)] union U { diff --git a/tests/ui/union/union-with-drop-fields.mirunsafeck.stderr b/tests/ui/union/union-with-drop-fields.stderr index 9861a21cb3d..6328be56540 100644 --- a/tests/ui/union/union-with-drop-fields.mirunsafeck.stderr +++ b/tests/ui/union/union-with-drop-fields.stderr @@ -1,5 +1,5 @@ error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-with-drop-fields.rs:11:5 + --> $DIR/union-with-drop-fields.rs:8:5 | LL | a: String, | ^^^^^^^^^ @@ -11,7 +11,7 @@ LL | a: std::mem::ManuallyDrop<String>, | +++++++++++++++++++++++ + error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-with-drop-fields.rs:19:5 + --> $DIR/union-with-drop-fields.rs:16:5 | LL | a: S, | ^^^^ @@ -23,7 +23,7 @@ LL | a: std::mem::ManuallyDrop<S>, | +++++++++++++++++++++++ + error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-with-drop-fields.rs:24:5 + --> $DIR/union-with-drop-fields.rs:21:5 | LL | a: T, | ^^^^ diff --git a/tests/ui/union/union-with-drop-fields.thirunsafeck.stderr b/tests/ui/union/union-with-drop-fields.thirunsafeck.stderr deleted file mode 100644 index 9861a21cb3d..00000000000 --- a/tests/ui/union/union-with-drop-fields.thirunsafeck.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-with-drop-fields.rs:11:5 - | -LL | a: String, - | ^^^^^^^^^ - | - = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` -help: wrap the field type in `ManuallyDrop<...>` - | -LL | a: std::mem::ManuallyDrop<String>, - | +++++++++++++++++++++++ + - -error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-with-drop-fields.rs:19:5 - | -LL | a: S, - | ^^^^ - | - = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` -help: wrap the field type in `ManuallyDrop<...>` - | -LL | a: std::mem::ManuallyDrop<S>, - | +++++++++++++++++++++++ + - -error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union - --> $DIR/union-with-drop-fields.rs:24:5 - | -LL | a: T, - | ^^^^ - | - = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>` -help: wrap the field type in `ManuallyDrop<...>` - | -LL | a: std::mem::ManuallyDrop<T>, - | +++++++++++++++++++++++ + - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0740`. diff --git a/tests/ui/unsafe/access_union_field.rs b/tests/ui/unsafe/access_union_field.rs index 5c4e695df58..4183119725e 100644 --- a/tests/ui/unsafe/access_union_field.rs +++ b/tests/ui/unsafe/access_union_field.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #![allow(unused_variables)] union Foo { diff --git a/tests/ui/unsafe/access_union_field.mir.stderr b/tests/ui/unsafe/access_union_field.stderr index 98bc4077793..4c46bb44a1d 100644 --- a/tests/ui/unsafe/access_union_field.mir.stderr +++ b/tests/ui/unsafe/access_union_field.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/access_union_field.rs:13:13 + --> $DIR/access_union_field.rs:10:13 | LL | let a = foo.bar; | ^^^^^^^ access to union field @@ -7,7 +7,7 @@ LL | let a = foo.bar; = 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/access_union_field.rs:14:13 + --> $DIR/access_union_field.rs:11:13 | LL | let b = foo.baz; | ^^^^^^^ access to union field diff --git a/tests/ui/unsafe/access_union_field.thir.stderr b/tests/ui/unsafe/access_union_field.thir.stderr deleted file mode 100644 index 98bc4077793..00000000000 --- a/tests/ui/unsafe/access_union_field.thir.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/access_union_field.rs:13:13 - | -LL | let a = foo.bar; - | ^^^^^^^ 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/access_union_field.rs:14:13 - | -LL | let b = foo.baz; - | ^^^^^^^ access to union field - | - = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/const_pat_in_layout_restricted.rs b/tests/ui/unsafe/const_pat_in_layout_restricted.rs new file mode 100644 index 00000000000..5bc7a7113e4 --- /dev/null +++ b/tests/ui/unsafe/const_pat_in_layout_restricted.rs @@ -0,0 +1,24 @@ +// Check that ref mut patterns within a const pattern don't get considered +// unsafe because they're within a pattern for a layout constrained stuct. +// check-pass + +#![allow(incomplete_features)] +#![feature(rustc_attrs)] +#![feature(inline_const_pat)] + +#[rustc_layout_scalar_valid_range_start(3)] +struct Gt2(i32); + +fn main() { + match unsafe { Gt2(5) } { + Gt2( + const { + || match () { + ref mut y => (), + }; + 4 + }, + ) => (), + _ => (), + } +} diff --git a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.mir.stderr b/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.mir.stderr deleted file mode 100644 index ea53bf59d31..00000000000 --- a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.mir.stderr +++ /dev/null @@ -1,16 +0,0 @@ -warning: call to unsafe function is unsafe and requires unsafe block (error E0133) - --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:13:5 - | -LL | unsf(); - | ^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior -note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:12:1 - | -LL | unsafe fn foo() { - | ^^^^^^^^^^^^^^^ - = note: `#[warn(unsafe_op_in_unsafe_fn)]` on by default - -warning: 1 warning emitted - diff --git a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.rs b/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.rs index 1b429955cb0..f84f12c8301 100644 --- a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.rs +++ b/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.rs @@ -1,9 +1,6 @@ // edition: 2024 // compile-flags: -Zunstable-options // check-pass -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck - #![crate_type = "lib"] #![deny(unused_unsafe)] @@ -11,8 +8,7 @@ unsafe fn unsf() {} unsafe fn foo() { unsf(); - //[mir]~^ WARN call to unsafe function is unsafe and requires unsafe block - //[thir]~^^ WARN call to unsafe function `unsf` is unsafe and requires unsafe block + //~^ WARN call to unsafe function `unsf` is unsafe and requires unsafe block // no unused_unsafe unsafe { diff --git a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.thir.stderr b/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.stderr index d63843ed2b3..1187c2d80f3 100644 --- a/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.thir.stderr +++ b/tests/ui/unsafe/edition-2024-unsafe_op_in_unsafe_fn.stderr @@ -1,12 +1,12 @@ warning: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133) - --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:13:5 + --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:10:5 | LL | unsf(); | ^^^^^^ call to unsafe function | = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:12:1 + --> $DIR/edition-2024-unsafe_op_in_unsafe_fn.rs:9:1 | LL | unsafe fn foo() { | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/unsafe/foreign-unsafe-fn-called.mir.stderr b/tests/ui/unsafe/foreign-unsafe-fn-called.mir.stderr deleted file mode 100644 index 5157dbb514b..00000000000 --- a/tests/ui/unsafe/foreign-unsafe-fn-called.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/foreign-unsafe-fn-called.rs:11: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 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/foreign-unsafe-fn-called.rs b/tests/ui/unsafe/foreign-unsafe-fn-called.rs index 67302ea1bcd..b5065beb5fc 100644 --- a/tests/ui/unsafe/foreign-unsafe-fn-called.rs +++ b/tests/ui/unsafe/foreign-unsafe-fn-called.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - mod test { extern "C" { pub fn free(); @@ -9,6 +6,5 @@ mod test { fn main() { test::free(); - //[mir]~^ ERROR call to unsafe function is unsafe - //[thir]~^^ ERROR call to unsafe function `test::free` is unsafe + //~^ ERROR call to unsafe function `test::free` is unsafe } diff --git a/tests/ui/unsafe/foreign-unsafe-fn-called.thir.stderr b/tests/ui/unsafe/foreign-unsafe-fn-called.stderr index 8c221314cd7..cf2d4c493a1 100644 --- a/tests/ui/unsafe/foreign-unsafe-fn-called.thir.stderr +++ b/tests/ui/unsafe/foreign-unsafe-fn-called.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `test::free` is unsafe and requires unsafe function or block - --> $DIR/foreign-unsafe-fn-called.rs:11:5 + --> $DIR/foreign-unsafe-fn-called.rs:8:5 | LL | test::free(); | ^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/unsafe/inline_asm.mir.stderr b/tests/ui/unsafe/inline_asm.mir.stderr deleted file mode 100644 index e38a9388a78..00000000000 --- a/tests/ui/unsafe/inline_asm.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: use of inline assembly is unsafe and requires unsafe function or block - --> $DIR/inline_asm.rs:8:5 - | -LL | asm!("nop"); - | ^^^^^^^^^^^ use of inline assembly - | - = note: inline assembly is entirely unchecked and can cause undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/inline_asm.rs b/tests/ui/unsafe/inline_asm.rs index 12c7efe4f50..df45b8640c1 100644 --- a/tests/ui/unsafe/inline_asm.rs +++ b/tests/ui/unsafe/inline_asm.rs @@ -1,5 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck // needs-asm-support use std::arch::asm; diff --git a/tests/ui/unsafe/inline_asm.thir.stderr b/tests/ui/unsafe/inline_asm.stderr index e38a9388a78..1e829152a72 100644 --- a/tests/ui/unsafe/inline_asm.thir.stderr +++ b/tests/ui/unsafe/inline_asm.stderr @@ -1,5 +1,5 @@ error[E0133]: use of inline assembly is unsafe and requires unsafe function or block - --> $DIR/inline_asm.rs:8:5 + --> $DIR/inline_asm.rs:6:5 | LL | asm!("nop"); | ^^^^^^^^^^^ use of inline assembly diff --git a/tests/ui/unsafe/issue-3080.mir.stderr b/tests/ui/unsafe/issue-3080.mir.stderr deleted file mode 100644 index a1ad98d205e..00000000000 --- a/tests/ui/unsafe/issue-3080.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/issue-3080.rs:10:5 - | -LL | X(()).with(); - | ^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/issue-3080.rs b/tests/ui/unsafe/issue-3080.rs index 2b5269dda8f..883f3bfd24e 100644 --- a/tests/ui/unsafe/issue-3080.rs +++ b/tests/ui/unsafe/issue-3080.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - struct X(()); impl X { pub unsafe fn with(&self) { } diff --git a/tests/ui/unsafe/issue-3080.thir.stderr b/tests/ui/unsafe/issue-3080.stderr index 1018218b1b0..913a601049e 100644 --- a/tests/ui/unsafe/issue-3080.thir.stderr +++ b/tests/ui/unsafe/issue-3080.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `X::with` is unsafe and requires unsafe function or block - --> $DIR/issue-3080.rs:10:5 + --> $DIR/issue-3080.rs:7:5 | LL | X(()).with(); | ^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/unsafe/issue-45087-unreachable-unsafe.mir.stderr b/tests/ui/unsafe/issue-45087-unreachable-unsafe.mir.stderr deleted file mode 100644 index e7960960774..00000000000 --- a/tests/ui/unsafe/issue-45087-unreachable-unsafe.mir.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-45087-unreachable-unsafe.rs:7:5 - | -LL | *(1 as *mut u32) = 42; - | ^^^^^^^^^^^^^^^^^^^^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-45087-unreachable-unsafe.rs:17:5 - | -LL | *a = 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-45087-unreachable-unsafe.rs:29:5 - | -LL | *b = 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 3 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/issue-45087-unreachable-unsafe.rs b/tests/ui/unsafe/issue-45087-unreachable-unsafe.rs index 3e3da667c0b..7c4bde185fb 100644 --- a/tests/ui/unsafe/issue-45087-unreachable-unsafe.rs +++ b/tests/ui/unsafe/issue-45087-unreachable-unsafe.rs @@ -1,6 +1,4 @@ // Verify that unreachable code undergoes unsafety checks. -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck fn main() { return; diff --git a/tests/ui/unsafe/issue-45087-unreachable-unsafe.thir.stderr b/tests/ui/unsafe/issue-45087-unreachable-unsafe.stderr index e81adad4507..d6cc5fd2e08 100644 --- a/tests/ui/unsafe/issue-45087-unreachable-unsafe.thir.stderr +++ b/tests/ui/unsafe/issue-45087-unreachable-unsafe.stderr @@ -1,5 +1,5 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-45087-unreachable-unsafe.rs:7:5 + --> $DIR/issue-45087-unreachable-unsafe.rs:5:5 | LL | *(1 as *mut u32) = 42; | ^^^^^^^^^^^^^^^^ dereference of raw pointer @@ -7,7 +7,7 @@ LL | *(1 as *mut u32) = 42; = 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-45087-unreachable-unsafe.rs:17:5 + --> $DIR/issue-45087-unreachable-unsafe.rs:15:5 | LL | *a = 1; | ^^ dereference of raw pointer @@ -15,7 +15,7 @@ LL | *a = 1; = 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-45087-unreachable-unsafe.rs:29:5 + --> $DIR/issue-45087-unreachable-unsafe.rs:27:5 | LL | *b = 1; | ^^ dereference of raw pointer diff --git a/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.mir.stderr b/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.mir.stderr deleted file mode 100644 index 9e9cbcf33ae..00000000000 --- a/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.mir.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error: unnecessary `unsafe` block - --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:10:13 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -LL | let f = |v: &mut Vec<_>| { -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:4:8 - | -LL | #[deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:12:38 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | |w: &mut Vec<u32>| { unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:16:34 - | -LL | unsafe { - | ------ because it's nested under this `unsafe` block -... -LL | |x: &mut Vec<u32>| { unsafe { - | ^^^^^^ unnecessary `unsafe` block - -error: aborting due to 3 previous errors - diff --git a/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.rs b/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.rs index ac1cfd62a05..de275ff701a 100644 --- a/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.rs +++ b/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck - #[deny(unused_unsafe)] fn main() { let mut v = Vec::<i32>::with_capacity(24); diff --git a/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.thir.stderr b/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.stderr index 2267da31512..b23c002dc65 100644 --- a/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.thir.stderr +++ b/tests/ui/unsafe/issue-45107-unnecessary-unsafe-in-closure.stderr @@ -1,5 +1,5 @@ error: unnecessary `unsafe` block - --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:10:13 + --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:7:13 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -8,13 +8,13 @@ LL | unsafe { | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:4:8 + --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:1:8 | LL | #[deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:12:38 + --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:9:38 | LL | unsafe { | ------ because it's nested under this `unsafe` block @@ -23,7 +23,7 @@ LL | |w: &mut Vec<u32>| { unsafe { | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:16:34 + --> $DIR/issue-45107-unnecessary-unsafe-in-closure.rs:13:34 | LL | unsafe { | ------ because it's nested under this `unsafe` block diff --git a/tests/ui/unsafe/issue-47412.rs b/tests/ui/unsafe/issue-47412.rs index df6d6e4222e..2d1ea72280b 100644 --- a/tests/ui/unsafe/issue-47412.rs +++ b/tests/ui/unsafe/issue-47412.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #[derive(Copy, Clone)] enum Void {} diff --git a/tests/ui/unsafe/issue-47412.mir.stderr b/tests/ui/unsafe/issue-47412.stderr index 305f482e8c2..aebcbf07463 100644 --- a/tests/ui/unsafe/issue-47412.mir.stderr +++ b/tests/ui/unsafe/issue-47412.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/issue-47412.rs:14:11 + --> $DIR/issue-47412.rs:11:11 | LL | match u.void {} | ^^^^^^ access to union field @@ -7,7 +7,7 @@ LL | match u.void {} = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-47412.rs:20:11 + --> $DIR/issue-47412.rs:17:11 | LL | match *ptr {} | ^^^^ dereference of raw pointer diff --git a/tests/ui/unsafe/issue-47412.thir.stderr b/tests/ui/unsafe/issue-47412.thir.stderr deleted file mode 100644 index 305f482e8c2..00000000000 --- a/tests/ui/unsafe/issue-47412.thir.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/issue-47412.rs:14:11 - | -LL | match u.void {} - | ^^^^^^ access to union field - | - = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior - -error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/issue-47412.rs:20:11 - | -LL | match *ptr {} - | ^^^^ 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 2 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/issue-85435-unsafe-op-in-let-under-unsafe-under-closure.rs b/tests/ui/unsafe/issue-85435-unsafe-op-in-let-under-unsafe-under-closure.rs index 72f7b674777..b0d738855d7 100644 --- a/tests/ui/unsafe/issue-85435-unsafe-op-in-let-under-unsafe-under-closure.rs +++ b/tests/ui/unsafe/issue-85435-unsafe-op-in-let-under-unsafe-under-closure.rs @@ -1,6 +1,4 @@ // check-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck // This is issue #85435. But the real story is reflected in issue #85561, where // a bug in the implementation of feature(capture_disjoint_fields) () was diff --git a/tests/ui/unsafe/issue-87414-query-cycle.rs b/tests/ui/unsafe/issue-87414-query-cycle.rs index 99e40ba4b4c..a004d739422 100644 --- a/tests/ui/unsafe/issue-87414-query-cycle.rs +++ b/tests/ui/unsafe/issue-87414-query-cycle.rs @@ -1,7 +1,6 @@ // Regression test for #87414. // check-pass -// compile-flags: -Zthir-unsafeck fn bad<T>() -> Box<dyn Iterator<Item = [(); { |x: u32| { x }; 4 }]>> { todo!() } diff --git a/tests/ui/unsafe/ranged_ints.rs b/tests/ui/unsafe/ranged_ints.rs index 05efe87ba6e..0fa2da917e9 100644 --- a/tests/ui/unsafe/ranged_ints.rs +++ b/tests/ui/unsafe/ranged_ints.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] #[rustc_layout_scalar_valid_range_start(1)] diff --git a/tests/ui/unsafe/ranged_ints.mir.stderr b/tests/ui/unsafe/ranged_ints.stderr index ef00edae05d..b6875e15815 100644 --- a/tests/ui/unsafe/ranged_ints.mir.stderr +++ b/tests/ui/unsafe/ranged_ints.stderr @@ -1,5 +1,5 @@ error[E0133]: initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe function or block - --> $DIR/ranged_ints.rs:10:14 + --> $DIR/ranged_ints.rs:7:14 | LL | let _x = NonZero(0); | ^^^^^^^^^^ initializing type with `rustc_layout_scalar_valid_range` attr diff --git a/tests/ui/unsafe/ranged_ints.thir.stderr b/tests/ui/unsafe/ranged_ints.thir.stderr deleted file mode 100644 index ef00edae05d..00000000000 --- a/tests/ui/unsafe/ranged_ints.thir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe function or block - --> $DIR/ranged_ints.rs:10:14 - | -LL | let _x = NonZero(0); - | ^^^^^^^^^^ initializing type with `rustc_layout_scalar_valid_range` attr - | - = note: initializing a layout restricted type's field with a value outside the valid range is undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/ranged_ints2.rs b/tests/ui/unsafe/ranged_ints2.rs index ad9d598aba2..a3d9f54efe2 100644 --- a/tests/ui/unsafe/ranged_ints2.rs +++ b/tests/ui/unsafe/ranged_ints2.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] #[rustc_layout_scalar_valid_range_start(1)] diff --git a/tests/ui/unsafe/ranged_ints2.mirunsafeck.stderr b/tests/ui/unsafe/ranged_ints2.stderr index dc6bd72f56c..1885e77af7e 100644 --- a/tests/ui/unsafe/ranged_ints2.mirunsafeck.stderr +++ b/tests/ui/unsafe/ranged_ints2.stderr @@ -1,5 +1,5 @@ error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints2.rs:11:13 + --> $DIR/ranged_ints2.rs:8:13 | LL | let y = &mut x.0; | ^^^^^^^^ mutation of layout constrained field @@ -7,7 +7,7 @@ LL | let y = &mut x.0; = note: mutating layout constrained fields cannot statically be checked for valid values error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints2.rs:12:25 + --> $DIR/ranged_ints2.rs:9:25 | LL | if let Some(NonZero(ref mut y)) = Some(x) {} | ^^^^^^^^^ mutation of layout constrained field diff --git a/tests/ui/unsafe/ranged_ints2.thirunsafeck.stderr b/tests/ui/unsafe/ranged_ints2.thirunsafeck.stderr deleted file mode 100644 index dc6bd72f56c..00000000000 --- a/tests/ui/unsafe/ranged_ints2.thirunsafeck.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints2.rs:11:13 - | -LL | let y = &mut x.0; - | ^^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints2.rs:12:25 - | -LL | if let Some(NonZero(ref mut y)) = Some(x) {} - | ^^^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/ranged_ints2_const.rs b/tests/ui/unsafe/ranged_ints2_const.rs index 56f5407bb6e..b7178c2b52b 100644 --- a/tests/ui/unsafe/ranged_ints2_const.rs +++ b/tests/ui/unsafe/ranged_ints2_const.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] #[rustc_layout_scalar_valid_range_start(1)] diff --git a/tests/ui/unsafe/ranged_ints2_const.mirunsafeck.stderr b/tests/ui/unsafe/ranged_ints2_const.stderr index c16550a5800..f267dc6e23e 100644 --- a/tests/ui/unsafe/ranged_ints2_const.mirunsafeck.stderr +++ b/tests/ui/unsafe/ranged_ints2_const.stderr @@ -1,5 +1,13 @@ +error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block + --> $DIR/ranged_ints2_const.rs:11:13 + | +LL | let y = &mut x.0; + | ^^^^^^^^ mutation of layout constrained field + | + = note: mutating layout constrained fields cannot statically be checked for valid values + error[E0658]: mutable references are not allowed in constant functions - --> $DIR/ranged_ints2_const.rs:14:13 + --> $DIR/ranged_ints2_const.rs:11:13 | LL | let y = &mut x.0; | ^^^^^^^^ @@ -8,7 +16,7 @@ LL | let y = &mut x.0; = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0658]: mutable references are not allowed in constant functions - --> $DIR/ranged_ints2_const.rs:21:22 + --> $DIR/ranged_ints2_const.rs:18:22 | LL | let y = unsafe { &mut x.0 }; | ^^^^^^^^ @@ -17,7 +25,7 @@ LL | let y = unsafe { &mut x.0 }; = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable error[E0658]: mutable references are not allowed in constant functions - --> $DIR/ranged_ints2_const.rs:27:22 + --> $DIR/ranged_ints2_const.rs:24:22 | LL | unsafe { let y = &mut x.0; } | ^^^^^^^^ @@ -25,14 +33,6 @@ LL | unsafe { let y = &mut x.0; } = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints2_const.rs:14:13 - | -LL | let y = &mut x.0; - | ^^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - error: aborting due to 4 previous errors Some errors have detailed explanations: E0133, E0658. diff --git a/tests/ui/unsafe/ranged_ints2_const.thirunsafeck.stderr b/tests/ui/unsafe/ranged_ints2_const.thirunsafeck.stderr deleted file mode 100644 index b3f139f7213..00000000000 --- a/tests/ui/unsafe/ranged_ints2_const.thirunsafeck.stderr +++ /dev/null @@ -1,39 +0,0 @@ -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints2_const.rs:14:13 - | -LL | let y = &mut x.0; - | ^^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error[E0658]: mutable references are not allowed in constant functions - --> $DIR/ranged_ints2_const.rs:14:13 - | -LL | let y = &mut x.0; - | ^^^^^^^^ - | - = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error[E0658]: mutable references are not allowed in constant functions - --> $DIR/ranged_ints2_const.rs:21:22 - | -LL | let y = unsafe { &mut x.0 }; - | ^^^^^^^^ - | - = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error[E0658]: mutable references are not allowed in constant functions - --> $DIR/ranged_ints2_const.rs:27:22 - | -LL | unsafe { let y = &mut x.0; } - | ^^^^^^^^ - | - = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information - = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0133, E0658. -For more information about an error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/ranged_ints3.rs b/tests/ui/unsafe/ranged_ints3.rs index 76d4bfe9530..47d67fac678 100644 --- a/tests/ui/unsafe/ranged_ints3.rs +++ b/tests/ui/unsafe/ranged_ints3.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] use std::cell::Cell; diff --git a/tests/ui/unsafe/ranged_ints3.mirunsafeck.stderr b/tests/ui/unsafe/ranged_ints3.stderr index 72bce5de0ae..8dcb99fc16d 100644 --- a/tests/ui/unsafe/ranged_ints3.mirunsafeck.stderr +++ b/tests/ui/unsafe/ranged_ints3.stderr @@ -1,5 +1,5 @@ error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block - --> $DIR/ranged_ints3.rs:13:13 + --> $DIR/ranged_ints3.rs:10:13 | LL | let y = &x.0; | ^^^^ borrow of layout constrained field with interior mutability diff --git a/tests/ui/unsafe/ranged_ints3.thirunsafeck.stderr b/tests/ui/unsafe/ranged_ints3.thirunsafeck.stderr deleted file mode 100644 index 72bce5de0ae..00000000000 --- a/tests/ui/unsafe/ranged_ints3.thirunsafeck.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block - --> $DIR/ranged_ints3.rs:13:13 - | -LL | let y = &x.0; - | ^^^^ borrow of layout constrained field with interior mutability - | - = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/ranged_ints3_const.rs b/tests/ui/unsafe/ranged_ints3_const.rs index 637198d3604..c069ae7da02 100644 --- a/tests/ui/unsafe/ranged_ints3_const.rs +++ b/tests/ui/unsafe/ranged_ints3_const.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] use std::cell::Cell; diff --git a/tests/ui/unsafe/ranged_ints3_const.mirunsafeck.stderr b/tests/ui/unsafe/ranged_ints3_const.stderr index 62df9333069..75b36cdf94b 100644 --- a/tests/ui/unsafe/ranged_ints3_const.mirunsafeck.stderr +++ b/tests/ui/unsafe/ranged_ints3_const.stderr @@ -1,5 +1,13 @@ +error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block + --> $DIR/ranged_ints3_const.rs:12:13 + | +LL | let y = &x.0; + | ^^^^ borrow of layout constrained field with interior mutability + | + = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values + error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability - --> $DIR/ranged_ints3_const.rs:15:13 + --> $DIR/ranged_ints3_const.rs:12:13 | LL | let y = &x.0; | ^^^^ @@ -8,7 +16,7 @@ LL | let y = &x.0; = help: add `#![feature(const_refs_to_cell)]` to the crate attributes to enable error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability - --> $DIR/ranged_ints3_const.rs:22:22 + --> $DIR/ranged_ints3_const.rs:19:22 | LL | let y = unsafe { &x.0 }; | ^^^^ @@ -16,14 +24,6 @@ LL | let y = unsafe { &x.0 }; = note: see issue #80384 <https://github.com/rust-lang/rust/issues/80384> for more information = help: add `#![feature(const_refs_to_cell)]` to the crate attributes to enable -error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block - --> $DIR/ranged_ints3_const.rs:15:13 - | -LL | let y = &x.0; - | ^^^^ borrow of layout constrained field with interior mutability - | - = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values - error: aborting due to 3 previous errors Some errors have detailed explanations: E0133, E0658. diff --git a/tests/ui/unsafe/ranged_ints3_const.thirunsafeck.stderr b/tests/ui/unsafe/ranged_ints3_const.thirunsafeck.stderr deleted file mode 100644 index 5dbc563aad2..00000000000 --- a/tests/ui/unsafe/ranged_ints3_const.thirunsafeck.stderr +++ /dev/null @@ -1,30 +0,0 @@ -error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block - --> $DIR/ranged_ints3_const.rs:15:13 - | -LL | let y = &x.0; - | ^^^^ borrow of layout constrained field with interior mutability - | - = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values - -error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability - --> $DIR/ranged_ints3_const.rs:15:13 - | -LL | let y = &x.0; - | ^^^^ - | - = note: see issue #80384 <https://github.com/rust-lang/rust/issues/80384> for more information - = help: add `#![feature(const_refs_to_cell)]` to the crate attributes to enable - -error[E0658]: cannot borrow here, since the borrowed element may contain interior mutability - --> $DIR/ranged_ints3_const.rs:22:22 - | -LL | let y = unsafe { &x.0 }; - | ^^^^ - | - = note: see issue #80384 <https://github.com/rust-lang/rust/issues/80384> for more information - = help: add `#![feature(const_refs_to_cell)]` to the crate attributes to enable - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0133, E0658. -For more information about an error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/ranged_ints3_match.rs b/tests/ui/unsafe/ranged_ints3_match.rs index d9fcf0bd665..de6be506d56 100644 --- a/tests/ui/unsafe/ranged_ints3_match.rs +++ b/tests/ui/unsafe/ranged_ints3_match.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] use std::cell::Cell; diff --git a/tests/ui/unsafe/ranged_ints3_match.mirunsafeck.stderr b/tests/ui/unsafe/ranged_ints3_match.stderr index 27c06640928..1bdc29d077c 100644 --- a/tests/ui/unsafe/ranged_ints3_match.mirunsafeck.stderr +++ b/tests/ui/unsafe/ranged_ints3_match.stderr @@ -1,5 +1,5 @@ error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block - --> $DIR/ranged_ints3_match.rs:14:17 + --> $DIR/ranged_ints3_match.rs:11:17 | LL | NonZero(ref x) => { x } | ^^^^^ borrow of layout constrained field with interior mutability @@ -7,7 +7,7 @@ LL | NonZero(ref x) => { x } = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints3_match.rs:20:23 + --> $DIR/ranged_ints3_match.rs:17:23 | LL | match y { NonZero(ref mut y) => { y } }; | ^^^^^^^^^ mutation of layout constrained field diff --git a/tests/ui/unsafe/ranged_ints3_match.thirunsafeck.stderr b/tests/ui/unsafe/ranged_ints3_match.thirunsafeck.stderr deleted file mode 100644 index 27c06640928..00000000000 --- a/tests/ui/unsafe/ranged_ints3_match.thirunsafeck.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0133]: borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block - --> $DIR/ranged_ints3_match.rs:14:17 - | -LL | NonZero(ref x) => { x } - | ^^^^^ borrow of layout constrained field with interior mutability - | - = note: references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values - -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints3_match.rs:20:23 - | -LL | match y { NonZero(ref mut y) => { y } }; - | ^^^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/ranged_ints4.mirunsafeck.stderr b/tests/ui/unsafe/ranged_ints4.mirunsafeck.stderr deleted file mode 100644 index 4f2f1e42e76..00000000000 --- a/tests/ui/unsafe/ranged_ints4.mirunsafeck.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints4.rs:11:5 - | -LL | x.0 = 0; - | ^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/ranged_ints4.rs b/tests/ui/unsafe/ranged_ints4.rs index fe80af454cb..d8632c48434 100644 --- a/tests/ui/unsafe/ranged_ints4.rs +++ b/tests/ui/unsafe/ranged_ints4.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] #[rustc_layout_scalar_valid_range_start(1)] diff --git a/tests/ui/unsafe/ranged_ints4.thirunsafeck.stderr b/tests/ui/unsafe/ranged_ints4.stderr index 4f2f1e42e76..4a703696b88 100644 --- a/tests/ui/unsafe/ranged_ints4.thirunsafeck.stderr +++ b/tests/ui/unsafe/ranged_ints4.stderr @@ -1,5 +1,5 @@ error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints4.rs:11:5 + --> $DIR/ranged_ints4.rs:8:5 | LL | x.0 = 0; | ^^^^^^^ mutation of layout constrained field diff --git a/tests/ui/unsafe/ranged_ints4_const.rs b/tests/ui/unsafe/ranged_ints4_const.rs index a43c8be71c4..f09168c3d3f 100644 --- a/tests/ui/unsafe/ranged_ints4_const.rs +++ b/tests/ui/unsafe/ranged_ints4_const.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] #[rustc_layout_scalar_valid_range_start(1)] diff --git a/tests/ui/unsafe/ranged_ints4_const.mirunsafeck.stderr b/tests/ui/unsafe/ranged_ints4_const.stderr index a2a3ae668a2..604ec1167e4 100644 --- a/tests/ui/unsafe/ranged_ints4_const.mirunsafeck.stderr +++ b/tests/ui/unsafe/ranged_ints4_const.stderr @@ -1,5 +1,5 @@ error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints4_const.rs:13:5 + --> $DIR/ranged_ints4_const.rs:10:5 | LL | x.0 = 0; | ^^^^^^^ mutation of layout constrained field diff --git a/tests/ui/unsafe/ranged_ints4_const.thirunsafeck.stderr b/tests/ui/unsafe/ranged_ints4_const.thirunsafeck.stderr deleted file mode 100644 index a2a3ae668a2..00000000000 --- a/tests/ui/unsafe/ranged_ints4_const.thirunsafeck.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/ranged_ints4_const.rs:13:5 - | -LL | x.0 = 0; - | ^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/ranged_ints_const.rs b/tests/ui/unsafe/ranged_ints_const.rs index 472b0968150..8477772867e 100644 --- a/tests/ui/unsafe/ranged_ints_const.rs +++ b/tests/ui/unsafe/ranged_ints_const.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] #[rustc_layout_scalar_valid_range_start(1)] diff --git a/tests/ui/unsafe/ranged_ints_const.mir.stderr b/tests/ui/unsafe/ranged_ints_const.stderr index 563b9be2672..2b8be290d3a 100644 --- a/tests/ui/unsafe/ranged_ints_const.mir.stderr +++ b/tests/ui/unsafe/ranged_ints_const.stderr @@ -1,5 +1,5 @@ error[E0133]: initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe function or block - --> $DIR/ranged_ints_const.rs:11:34 + --> $DIR/ranged_ints_const.rs:8:34 | LL | const fn foo() -> NonZero<u32> { NonZero(0) } | ^^^^^^^^^^ initializing type with `rustc_layout_scalar_valid_range` attr diff --git a/tests/ui/unsafe/ranged_ints_const.thir.stderr b/tests/ui/unsafe/ranged_ints_const.thir.stderr deleted file mode 100644 index 563b9be2672..00000000000 --- a/tests/ui/unsafe/ranged_ints_const.thir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe function or block - --> $DIR/ranged_ints_const.rs:11:34 - | -LL | const fn foo() -> NonZero<u32> { NonZero(0) } - | ^^^^^^^^^^ initializing type with `rustc_layout_scalar_valid_range` attr - | - = note: initializing a layout restricted type's field with a value outside the valid range is undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/ranged_ints_macro.rs b/tests/ui/unsafe/ranged_ints_macro.rs index 8293d029951..0acc3e0f6b1 100644 --- a/tests/ui/unsafe/ranged_ints_macro.rs +++ b/tests/ui/unsafe/ranged_ints_macro.rs @@ -1,6 +1,4 @@ // build-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck #![feature(rustc_attrs)] diff --git a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr b/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr deleted file mode 100644 index 0c0826c1cfb..00000000000 --- a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.mir.stderr +++ /dev/null @@ -1,112 +0,0 @@ -error: call to unsafe function is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:12:5 - | -LL | unsf(); - | ^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior -note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:11:1 - | -LL | unsafe fn deny_level() { - | ^^^^^^^^^^^^^^^^^^^^^^ -note: the lint level is defined here - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:4:9 - | -LL | #![deny(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:15:5 - | -LL | *PTR; - | ^^^^ 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: use of mutable static is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:17:5 - | -LL | VOID = (); - | ^^^^^^^^^ use of mutable static - | - = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior - -error: unnecessary `unsafe` block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:20:5 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:5:9 - | -LL | #![deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: call to unsafe function is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:28:5 - | -LL | unsf(); - | ^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior -note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:27:1 - | -LL | unsafe fn warning_level() { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -note: the lint level is defined here - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:26:8 - | -LL | #[deny(warnings)] - | ^^^^^^^^ - = note: `#[deny(unsafe_op_in_unsafe_fn)]` implied by `#[deny(warnings)]` - -error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:31:5 - | -LL | *PTR; - | ^^^^ 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: use of mutable static is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:33:5 - | -LL | VOID = (); - | ^^^^^^^^^ use of mutable static - | - = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior - -error: unnecessary `unsafe` block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:35:5 - | -LL | unsafe {} - | ^^^^^^ unnecessary `unsafe` block - -error: unnecessary `unsafe` block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:49:5 - | -LL | unsafe { unsafe { unsf() } } - | ^^^^^^ unnecessary `unsafe` block - -error[E0133]: call to unsafe function is unsafe and requires unsafe block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:76:5 - | -LL | unsf(); - | ^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:81:9 - | -LL | unsf(); - | ^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 11 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs b/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs index db1e916a36c..658d14da829 100644 --- a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs +++ b/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck - #![deny(unsafe_op_in_unsafe_fn)] #![deny(unused_unsafe)] @@ -10,8 +7,7 @@ static mut VOID: () = (); unsafe fn deny_level() { unsf(); - //[mir]~^ ERROR call to unsafe function is unsafe and requires unsafe block - //[thir]~^^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe block + //~^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe block *PTR; //~^ ERROR dereference of raw pointer is unsafe and requires unsafe block VOID = (); @@ -26,8 +22,7 @@ unsafe fn deny_level() { #[deny(warnings)] unsafe fn warning_level() { unsf(); - //[mir]~^ ERROR call to unsafe function is unsafe and requires unsafe block - //[thir]~^^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe block + //~^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe block *PTR; //~^ ERROR dereference of raw pointer is unsafe and requires unsafe block VOID = (); @@ -74,12 +69,10 @@ unsafe fn nested_allow_level() { fn main() { unsf(); - //[mir]~^ ERROR call to unsafe function is unsafe and requires unsafe block - //[thir]~^^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe block + //~^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe block #[allow(unsafe_op_in_unsafe_fn)] { unsf(); - //[mir]~^ ERROR call to unsafe function is unsafe and requires unsafe function or block - //[thir]~^^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe function or block + //~^ ERROR call to unsafe function `unsf` is unsafe and requires unsafe function or block } } diff --git a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr b/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.stderr index ad0621a1d04..ea0659b2e10 100644 --- a/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.thir.stderr +++ b/tests/ui/unsafe/rfc-2585-unsafe_op_in_unsafe_fn.stderr @@ -1,23 +1,23 @@ error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:12:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:9:5 | LL | unsf(); | ^^^^^^ call to unsafe function | = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:11:1 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:8:1 | LL | unsafe fn deny_level() { | ^^^^^^^^^^^^^^^^^^^^^^ note: the lint level is defined here - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:4:9 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:1:9 | LL | #![deny(unsafe_op_in_unsafe_fn)] | ^^^^^^^^^^^^^^^^^^^^^^ error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:15:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:11:5 | LL | *PTR; | ^^^^ dereference of raw pointer @@ -25,7 +25,7 @@ LL | *PTR; = 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: use of mutable static is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:17:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:13:5 | LL | VOID = (); | ^^^^ use of mutable static @@ -33,38 +33,38 @@ LL | VOID = (); = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior error: unnecessary `unsafe` block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:20:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:16:5 | LL | unsafe {} | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:5:9 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:2:9 | LL | #![deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:28:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:24:5 | LL | unsf(); | ^^^^^^ call to unsafe function | = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:27:1 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:23:1 | LL | unsafe fn warning_level() { | ^^^^^^^^^^^^^^^^^^^^^^^^^ note: the lint level is defined here - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:26:8 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:22:8 | LL | #[deny(warnings)] | ^^^^^^^^ = note: `#[deny(unsafe_op_in_unsafe_fn)]` implied by `#[deny(warnings)]` error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:31:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:26:5 | LL | *PTR; | ^^^^ dereference of raw pointer @@ -72,7 +72,7 @@ LL | *PTR; = 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: use of mutable static is unsafe and requires unsafe block (error E0133) - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:33:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:28:5 | LL | VOID = (); | ^^^^ use of mutable static @@ -80,19 +80,19 @@ LL | VOID = (); = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior error: unnecessary `unsafe` block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:35:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:30:5 | LL | unsafe {} | ^^^^^^ unnecessary `unsafe` block error: unnecessary `unsafe` block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:49:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:44:5 | LL | unsafe { unsafe { unsf() } } | ^^^^^^ unnecessary `unsafe` block error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:76:5 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:71:5 | LL | unsf(); | ^^^^^^ call to unsafe function @@ -100,7 +100,7 @@ LL | unsf(); = note: consult the function's documentation for information on how to avoid undefined behavior error[E0133]: call to unsafe function `unsf` is unsafe and requires unsafe function or block - --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:81:9 + --> $DIR/rfc-2585-unsafe_op_in_unsafe_fn.rs:75:9 | LL | unsf(); | ^^^^^^ call to unsafe function diff --git a/tests/ui/unsafe/union-assignop.mirunsafeck.stderr b/tests/ui/unsafe/union-assignop.mirunsafeck.stderr deleted file mode 100644 index 0ecd5203dd9..00000000000 --- a/tests/ui/unsafe/union-assignop.mirunsafeck.stderr +++ /dev/null @@ -1,51 +0,0 @@ -error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-assignop.rs:19:5 - | -LL | foo.a += 5; - | ^^^^^^^^^^ 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-assignop.rs:20:6 - | -LL | *foo.b += NonCopy; - | ^^^^^ 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-assignop.rs:21:6 - | -LL | *foo.b = NonCopy; - | ^^^^^ 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-assignop.rs:23:5 - | -LL | foo.a; - | ^^^^^ 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-assignop.rs:25:5 - | -LL | foo.b; - | ^^^^^ 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-assignop.rs:27:13 - | -LL | foo.b = foo.b; - | ^^^^^ access to union field - | - = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior - -error: aborting due to 6 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/union-assignop.rs b/tests/ui/unsafe/union-assignop.rs index 5e667cd10d5..6122aef0565 100644 --- a/tests/ui/unsafe/union-assignop.rs +++ b/tests/ui/unsafe/union-assignop.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - use std::ops::AddAssign; use std::mem::ManuallyDrop; diff --git a/tests/ui/unsafe/union-assignop.thirunsafeck.stderr b/tests/ui/unsafe/union-assignop.stderr index 24b357e762b..6b2ebfb5099 100644 --- a/tests/ui/unsafe/union-assignop.thirunsafeck.stderr +++ b/tests/ui/unsafe/union-assignop.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union-assignop.rs:19:5 + --> $DIR/union-assignop.rs:16:5 | LL | foo.a += 5; | ^^^^^ access to union field @@ -7,7 +7,7 @@ LL | foo.a += 5; = 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-assignop.rs:20:6 + --> $DIR/union-assignop.rs:17:6 | LL | *foo.b += NonCopy; | ^^^^^ access to union field @@ -15,7 +15,7 @@ LL | *foo.b += NonCopy; = 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-assignop.rs:21:6 + --> $DIR/union-assignop.rs:18:6 | LL | *foo.b = NonCopy; | ^^^^^ access to union field @@ -23,7 +23,7 @@ LL | *foo.b = NonCopy; = 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-assignop.rs:23:5 + --> $DIR/union-assignop.rs:20:5 | LL | foo.a; | ^^^^^ access to union field @@ -31,7 +31,7 @@ LL | foo.a; = 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-assignop.rs:25:5 + --> $DIR/union-assignop.rs:22:5 | LL | foo.b; | ^^^^^ access to union field @@ -39,7 +39,7 @@ LL | foo.b; = 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-assignop.rs:27:13 + --> $DIR/union-assignop.rs:24:13 | LL | foo.b = foo.b; | ^^^^^ access to union field diff --git a/tests/ui/unsafe/union-modification.rs b/tests/ui/unsafe/union-modification.rs index 9a53ef90852..fbcb846be9d 100644 --- a/tests/ui/unsafe/union-modification.rs +++ b/tests/ui/unsafe/union-modification.rs @@ -1,7 +1,4 @@ // run-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - union Foo { bar: i8, _blah: isize, diff --git a/tests/ui/unsafe/union.mir.stderr b/tests/ui/unsafe/union.mir.stderr deleted file mode 100644 index 787714cdd2d..00000000000 --- a/tests/ui/unsafe/union.mir.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union.rs:30:20 - | -LL | Foo { bar: _a } => {}, - | ^^ 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.rs:32:11 - | -LL | match foo { - | ^^^ access to union field - | - = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/union.rs b/tests/ui/unsafe/union.rs index 4338d78eabb..ae81708aa19 100644 --- a/tests/ui/unsafe/union.rs +++ b/tests/ui/unsafe/union.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - union Foo { bar: i8, zst: (), @@ -29,20 +26,19 @@ pub fn main() { match foo { Foo { bar: _a } => {}, //~ ERROR access to union field is unsafe } - match foo { //[mir]~ ERROR access to union field is unsafe + match foo { Foo { - pizza: Pizza { //[thir]~ ERROR access to union field is unsafe + pizza: Pizza { //~ ERROR access to union field is unsafe topping: Some(PizzaTopping::Cheese) | Some(PizzaTopping::Pineapple) | None } } => {}, } - // MIR unsafeck incorrectly thinks that no unsafe block is needed to do these match foo { - Foo { zst: () } => {}, //[thir]~ ERROR access to union field is unsafe + Foo { zst: () } => {} //~ ERROR access to union field is unsafe } match foo { - Foo { pizza: Pizza { .. } } => {}, //[thir]~ ERROR access to union field is unsafe + Foo { pizza: Pizza { .. } } => {} //~ ERROR access to union field is unsafe } // binding to wildcard is okay diff --git a/tests/ui/unsafe/union.thir.stderr b/tests/ui/unsafe/union.stderr index e1a1bd634de..1506bdb919b 100644 --- a/tests/ui/unsafe/union.thir.stderr +++ b/tests/ui/unsafe/union.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/union.rs:30:20 + --> $DIR/union.rs:27:20 | LL | Foo { bar: _a } => {}, | ^^ access to union field @@ -7,7 +7,7 @@ LL | Foo { bar: _a } => {}, = 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.rs:34:20 + --> $DIR/union.rs:31:20 | LL | pizza: Pizza { | ____________________^ @@ -18,17 +18,17 @@ LL | | } = 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.rs:42:20 + --> $DIR/union.rs:38:20 | -LL | Foo { zst: () } => {}, +LL | Foo { zst: () } => {} | ^^ 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.rs:45:22 + --> $DIR/union.rs:41:22 | -LL | Foo { pizza: Pizza { .. } } => {}, +LL | Foo { pizza: Pizza { .. } } => {} | ^^^^^^^^^^^^ access to union field | = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior diff --git a/tests/ui/unsafe/union_access_through_block.rs b/tests/ui/unsafe/union_access_through_block.rs index e4c0976b826..8b28c33650e 100644 --- a/tests/ui/unsafe/union_access_through_block.rs +++ b/tests/ui/unsafe/union_access_through_block.rs @@ -1,7 +1,4 @@ // check-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #[derive(Copy, Clone)] pub struct Foo { a: bool } diff --git a/tests/ui/unsafe/union_destructure.mir.stderr b/tests/ui/unsafe/union_destructure.mir.stderr deleted file mode 100644 index 818f5ce03b5..00000000000 --- a/tests/ui/unsafe/union_destructure.mir.stderr +++ /dev/null @@ -1,16 +0,0 @@ -warning: unnecessary `unsafe` block - --> $DIR/union_destructure.rs:35:5 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - | - = note: `#[warn(unused_unsafe)]` on by default - -warning: unnecessary `unsafe` block - --> $DIR/union_destructure.rs:41:5 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -warning: 2 warnings emitted - diff --git a/tests/ui/unsafe/union_destructure.rs b/tests/ui/unsafe/union_destructure.rs index 6c88344b5fd..d0cf8640eaa 100644 --- a/tests/ui/unsafe/union_destructure.rs +++ b/tests/ui/unsafe/union_destructure.rs @@ -1,6 +1,4 @@ // run-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck #[derive(Copy, Clone)] #[allow(dead_code)] @@ -12,7 +10,7 @@ struct Pie { union Foo { #[allow(dead_code)] bar: i8, - baz: Pie + baz: Pie, } fn main() { @@ -32,20 +30,20 @@ fn main() { }; let u = Foo { bar: 9 }; - unsafe { //[mir]~ WARNING unnecessary `unsafe` block + unsafe { match u { - Foo { baz: Pie { .. } } => {}, + Foo { baz: Pie { .. } } => {} }; } let u = Foo { bar: 10 }; - unsafe { //[mir]~ WARNING unnecessary `unsafe` block + unsafe { match u { - Foo { baz: Pie { slices: _, size: _ } } => {}, + Foo { baz: Pie { slices: _, size: _ } } => {} }; } let u = Foo { bar: 11 }; match u { - Foo { baz: _ } => {}, + Foo { baz: _ } => {} }; } diff --git a/tests/ui/unsafe/union_wild_or_wild.rs b/tests/ui/unsafe/union_wild_or_wild.rs index 52a0a7abf27..935de97f255 100644 --- a/tests/ui/unsafe/union_wild_or_wild.rs +++ b/tests/ui/unsafe/union_wild_or_wild.rs @@ -1,7 +1,4 @@ // check-pass -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - union X { a: i8 } fn main() { diff --git a/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.mir.stderr b/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.mir.stderr deleted file mode 100644 index 62199e5a2ec..00000000000 --- a/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.mir.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: unnecessary `unsafe` block - --> $DIR/unsafe-around-compiler-generated-unsafe.rs:9:9 - | -LL | unsafe { async {}.await; } - | ^^^^^^ unnecessary `unsafe` block - | -note: the lint level is defined here - --> $DIR/unsafe-around-compiler-generated-unsafe.rs:5:9 - | -LL | #![deny(unused_unsafe)] - | ^^^^^^^^^^^^^ - -error: unnecessary `unsafe` block - --> $DIR/unsafe-around-compiler-generated-unsafe.rs:13:5 - | -LL | unsafe { println!("foo"); } - | ^^^^^^ unnecessary `unsafe` block - -error: aborting due to 2 previous errors - diff --git a/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs b/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs index c1a32764039..e060c58e408 100644 --- a/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs +++ b/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.rs @@ -1,6 +1,4 @@ // edition:2018 -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck #![deny(unused_unsafe)] diff --git a/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.thir.stderr b/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.stderr index 62199e5a2ec..ffadd90c64b 100644 --- a/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.thir.stderr +++ b/tests/ui/unsafe/unsafe-around-compiler-generated-unsafe.stderr @@ -1,17 +1,17 @@ error: unnecessary `unsafe` block - --> $DIR/unsafe-around-compiler-generated-unsafe.rs:9:9 + --> $DIR/unsafe-around-compiler-generated-unsafe.rs:7:9 | LL | unsafe { async {}.await; } | ^^^^^^ unnecessary `unsafe` block | note: the lint level is defined here - --> $DIR/unsafe-around-compiler-generated-unsafe.rs:5:9 + --> $DIR/unsafe-around-compiler-generated-unsafe.rs:3:9 | LL | #![deny(unused_unsafe)] | ^^^^^^^^^^^^^ error: unnecessary `unsafe` block - --> $DIR/unsafe-around-compiler-generated-unsafe.rs:13:5 + --> $DIR/unsafe-around-compiler-generated-unsafe.rs:11:5 | LL | unsafe { println!("foo"); } | ^^^^^^ unnecessary `unsafe` block diff --git a/tests/ui/unsafe/unsafe-assign.rs b/tests/ui/unsafe/unsafe-assign.rs index 15273165b5e..02ce238854d 100644 --- a/tests/ui/unsafe/unsafe-assign.rs +++ b/tests/ui/unsafe/unsafe-assign.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] #![allow(unused,dead_code)] diff --git a/tests/ui/unsafe/unsafe-assign.mirunsafeck.stderr b/tests/ui/unsafe/unsafe-assign.stderr index f8b55e0668d..1fa5d715c2e 100644 --- a/tests/ui/unsafe/unsafe-assign.mirunsafeck.stderr +++ b/tests/ui/unsafe/unsafe-assign.stderr @@ -1,5 +1,5 @@ error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/unsafe-assign.rs:12:5 + --> $DIR/unsafe-assign.rs:9:5 | LL | foo.0.0 = 0; | ^^^^^^^^^^^ mutation of layout constrained field diff --git a/tests/ui/unsafe/unsafe-assign.thirunsafeck.stderr b/tests/ui/unsafe/unsafe-assign.thirunsafeck.stderr deleted file mode 100644 index f8b55e0668d..00000000000 --- a/tests/ui/unsafe/unsafe-assign.thirunsafeck.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/unsafe-assign.rs:12:5 - | -LL | foo.0.0 = 0; - | ^^^^^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/unsafe-borrow.rs b/tests/ui/unsafe/unsafe-borrow.rs index 8dddc70be45..ab0e59489a9 100644 --- a/tests/ui/unsafe/unsafe-borrow.rs +++ b/tests/ui/unsafe/unsafe-borrow.rs @@ -1,6 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck - #![feature(rustc_attrs)] #![allow(unused,dead_code)] diff --git a/tests/ui/unsafe/unsafe-borrow.mirunsafeck.stderr b/tests/ui/unsafe/unsafe-borrow.stderr index a206722495a..a53b50583ca 100644 --- a/tests/ui/unsafe/unsafe-borrow.mirunsafeck.stderr +++ b/tests/ui/unsafe/unsafe-borrow.stderr @@ -1,5 +1,5 @@ error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/unsafe-borrow.rs:12:13 + --> $DIR/unsafe-borrow.rs:9:13 | LL | let a = &mut foo.0.0; | ^^^^^^^^^^^^ mutation of layout constrained field @@ -7,7 +7,7 @@ LL | let a = &mut foo.0.0; = note: mutating layout constrained fields cannot statically be checked for valid values error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/unsafe-borrow.rs:32:13 + --> $DIR/unsafe-borrow.rs:29:13 | LL | let a = &mut foo.0[2]; | ^^^^^^^^^^^^^ mutation of layout constrained field @@ -15,7 +15,7 @@ LL | let a = &mut foo.0[2]; = note: mutating layout constrained fields cannot statically be checked for valid values error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/unsafe-borrow.rs:51:18 + --> $DIR/unsafe-borrow.rs:48:18 | LL | NonZero((a,)) => *a = 0, | ^ mutation of layout constrained field diff --git a/tests/ui/unsafe/unsafe-borrow.thirunsafeck.stderr b/tests/ui/unsafe/unsafe-borrow.thirunsafeck.stderr deleted file mode 100644 index a206722495a..00000000000 --- a/tests/ui/unsafe/unsafe-borrow.thirunsafeck.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/unsafe-borrow.rs:12:13 - | -LL | let a = &mut foo.0.0; - | ^^^^^^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/unsafe-borrow.rs:32:13 - | -LL | let a = &mut foo.0[2]; - | ^^^^^^^^^^^^^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block - --> $DIR/unsafe-borrow.rs:51:18 - | -LL | NonZero((a,)) => *a = 0, - | ^ mutation of layout constrained field - | - = note: mutating layout constrained fields cannot statically be checked for valid values - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/unsafe-const-fn.mir.stderr b/tests/ui/unsafe/unsafe-const-fn.mir.stderr deleted file mode 100644 index 2450f08664c..00000000000 --- a/tests/ui/unsafe/unsafe-const-fn.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/unsafe-const-fn.rs:10:18 - | -LL | const VAL: u32 = dummy(0xFFFF); - | ^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/unsafe-const-fn.rs b/tests/ui/unsafe/unsafe-const-fn.rs index 65e3acf3063..3b4becf17a7 100644 --- a/tests/ui/unsafe/unsafe-const-fn.rs +++ b/tests/ui/unsafe/unsafe-const-fn.rs @@ -1,8 +1,5 @@ // A quick test of 'unsafe const fn' functionality -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - const unsafe fn dummy(v: u32) -> u32 { !v } diff --git a/tests/ui/unsafe/unsafe-const-fn.thir.stderr b/tests/ui/unsafe/unsafe-const-fn.stderr index 199dca9237e..5a6e6b7ce59 100644 --- a/tests/ui/unsafe/unsafe-const-fn.thir.stderr +++ b/tests/ui/unsafe/unsafe-const-fn.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `dummy` is unsafe and requires unsafe function or block - --> $DIR/unsafe-const-fn.rs:10:18 + --> $DIR/unsafe-const-fn.rs:7:18 | LL | const VAL: u32 = dummy(0xFFFF); | ^^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.mir.stderr b/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.mir.stderr deleted file mode 100644 index da3d5f3bd29..00000000000 --- a/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-assign-deref-ptr.rs:5:5 - | -LL | *p = 0; - | ^^^^^^ 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 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.rs b/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.rs index a94e94375ae..91264e790c8 100644 --- a/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.rs +++ b/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - fn f(p: *mut u8) { *p = 0; //~ ERROR dereference of raw pointer is unsafe return; diff --git a/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.thir.stderr b/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.stderr index aa5644782a4..3a0874f32c0 100644 --- a/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.thir.stderr +++ b/tests/ui/unsafe/unsafe-fn-assign-deref-ptr.stderr @@ -1,5 +1,5 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-assign-deref-ptr.rs:5:5 + --> $DIR/unsafe-fn-assign-deref-ptr.rs:2:5 | LL | *p = 0; | ^^ dereference of raw pointer diff --git a/tests/ui/unsafe/unsafe-fn-called-from-safe.mir.stderr b/tests/ui/unsafe/unsafe-fn-called-from-safe.mir.stderr deleted file mode 100644 index d3347437075..00000000000 --- a/tests/ui/unsafe/unsafe-fn-called-from-safe.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-called-from-safe.rs:7:5 - | -LL | f(); - | ^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/unsafe-fn-called-from-safe.rs b/tests/ui/unsafe/unsafe-fn-called-from-safe.rs index 55072dcc6c3..758b80097f7 100644 --- a/tests/ui/unsafe/unsafe-fn-called-from-safe.rs +++ b/tests/ui/unsafe/unsafe-fn-called-from-safe.rs @@ -1,10 +1,8 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - -unsafe fn f() { return; } +unsafe fn f() { + return; +} fn main() { f(); - //[mir]~^ ERROR call to unsafe function is unsafe - //[thir]~^^ ERROR call to unsafe function `f` is unsafe + //~^ ERROR call to unsafe function `f` is unsafe } diff --git a/tests/ui/unsafe/unsafe-fn-called-from-safe.thir.stderr b/tests/ui/unsafe/unsafe-fn-called-from-safe.stderr index 75431666186..1b1c92f0546 100644 --- a/tests/ui/unsafe/unsafe-fn-called-from-safe.thir.stderr +++ b/tests/ui/unsafe/unsafe-fn-called-from-safe.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-called-from-safe.rs:7:5 + --> $DIR/unsafe-fn-called-from-safe.rs:6:5 | LL | f(); | ^^^ call to unsafe function diff --git a/tests/ui/unsafe/unsafe-fn-deref-ptr.rs b/tests/ui/unsafe/unsafe-fn-deref-ptr.rs index 4b7c6bf6985..a3144824323 100644 --- a/tests/ui/unsafe/unsafe-fn-deref-ptr.rs +++ b/tests/ui/unsafe/unsafe-fn-deref-ptr.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - fn f(p: *const u8) -> u8 { let _ = *p; //~ ERROR dereference of raw pointer is unsafe let _: u8 = *p; //~ ERROR dereference of raw pointer is unsafe diff --git a/tests/ui/unsafe/unsafe-fn-deref-ptr.mir.stderr b/tests/ui/unsafe/unsafe-fn-deref-ptr.stderr index 7f1e7c8902f..2e68963097e 100644 --- a/tests/ui/unsafe/unsafe-fn-deref-ptr.mir.stderr +++ b/tests/ui/unsafe/unsafe-fn-deref-ptr.stderr @@ -1,5 +1,5 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-deref-ptr.rs:5:13 + --> $DIR/unsafe-fn-deref-ptr.rs:2:13 | LL | let _ = *p; | ^^ dereference of raw pointer @@ -7,7 +7,7 @@ LL | let _ = *p; = 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-deref-ptr.rs:6:17 + --> $DIR/unsafe-fn-deref-ptr.rs:3:17 | LL | let _: u8 = *p; | ^^ dereference of raw pointer @@ -15,7 +15,7 @@ LL | let _: u8 = *p; = 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-deref-ptr.rs:7:9 + --> $DIR/unsafe-fn-deref-ptr.rs:4:9 | LL | _ = *p; | ^^ dereference of raw pointer @@ -23,7 +23,7 @@ LL | _ = *p; = 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-deref-ptr.rs:8:12 + --> $DIR/unsafe-fn-deref-ptr.rs:5:12 | LL | return *p; | ^^ dereference of raw pointer diff --git a/tests/ui/unsafe/unsafe-fn-deref-ptr.thir.stderr b/tests/ui/unsafe/unsafe-fn-deref-ptr.thir.stderr deleted file mode 100644 index 7f1e7c8902f..00000000000 --- a/tests/ui/unsafe/unsafe-fn-deref-ptr.thir.stderr +++ /dev/null @@ -1,35 +0,0 @@ -error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-deref-ptr.rs:5:13 - | -LL | let _ = *p; - | ^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-deref-ptr.rs:6:17 - | -LL | let _: u8 = *p; - | ^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-deref-ptr.rs:7:9 - | -LL | _ = *p; - | ^^ 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[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-deref-ptr.rs:8:12 - | -LL | return *p; - | ^^ 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 4 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/unsafe-fn-used-as-value.mir.stderr b/tests/ui/unsafe/unsafe-fn-used-as-value.mir.stderr deleted file mode 100644 index 01e8e49ecfa..00000000000 --- a/tests/ui/unsafe/unsafe-fn-used-as-value.mir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-used-as-value.rs:8:5 - | -LL | x(); - | ^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/unsafe-fn-used-as-value.rs b/tests/ui/unsafe/unsafe-fn-used-as-value.rs index 9517598c7ce..99506ea047c 100644 --- a/tests/ui/unsafe/unsafe-fn-used-as-value.rs +++ b/tests/ui/unsafe/unsafe-fn-used-as-value.rs @@ -1,11 +1,9 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - -unsafe fn f() { return; } +unsafe fn f() { + return; +} fn main() { let x = f; x(); - //[mir]~^ ERROR call to unsafe function is unsafe - //[thir]~^^ ERROR call to unsafe function `f` is unsafe + //~^ ERROR call to unsafe function `f` is unsafe } diff --git a/tests/ui/unsafe/unsafe-fn-used-as-value.thir.stderr b/tests/ui/unsafe/unsafe-fn-used-as-value.stderr index c38da7226f6..0542b87b5e6 100644 --- a/tests/ui/unsafe/unsafe-fn-used-as-value.thir.stderr +++ b/tests/ui/unsafe/unsafe-fn-used-as-value.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function `f` is unsafe and requires unsafe function or block - --> $DIR/unsafe-fn-used-as-value.rs:8:5 + --> $DIR/unsafe-fn-used-as-value.rs:7:5 | LL | x(); | ^^^ call to unsafe function diff --git a/tests/ui/unsafe/unsafe-not-inherited.mirunsafeck.stderr b/tests/ui/unsafe/unsafe-not-inherited.mirunsafeck.stderr deleted file mode 100644 index 5536efbc6f4..00000000000 --- a/tests/ui/unsafe/unsafe-not-inherited.mirunsafeck.stderr +++ /dev/null @@ -1,24 +0,0 @@ -error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/unsafe-not-inherited.rs:8:31 - | -LL | unsafe {static BAR: u64 = FOO;} - | ------ ^^^ use of mutable static - | | - | items do not inherit unsafety from separate enclosing items - | - = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior - -error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/unsafe-not-inherited.rs:20:13 - | -LL | unsafe { - | ------ items do not inherit unsafety from separate enclosing items -... -LL | unsafe_call(); - | ^^^^^^^^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/unsafe-not-inherited.rs b/tests/ui/unsafe/unsafe-not-inherited.rs index f9d9a595714..6d797caa0f9 100644 --- a/tests/ui/unsafe/unsafe-not-inherited.rs +++ b/tests/ui/unsafe/unsafe-not-inherited.rs @@ -1,5 +1,3 @@ -// revisions: mirunsafeck thirunsafeck -// [thirunsafeck]compile-flags: -Z thir-unsafeck #![allow(unused, dead_code)] static mut FOO: u64 = 0; diff --git a/tests/ui/unsafe/unsafe-not-inherited.thirunsafeck.stderr b/tests/ui/unsafe/unsafe-not-inherited.stderr index 88ea2e6d1fe..8b699127312 100644 --- a/tests/ui/unsafe/unsafe-not-inherited.thirunsafeck.stderr +++ b/tests/ui/unsafe/unsafe-not-inherited.stderr @@ -1,5 +1,5 @@ error[E0133]: use of mutable static is unsafe and requires unsafe function or block - --> $DIR/unsafe-not-inherited.rs:8:31 + --> $DIR/unsafe-not-inherited.rs:6:31 | LL | unsafe {static BAR: u64 = FOO;} | ------ ^^^ use of mutable static @@ -9,7 +9,7 @@ LL | unsafe {static BAR: u64 = FOO;} = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior error[E0133]: call to unsafe function `unsafe_call` is unsafe and requires unsafe function or block - --> $DIR/unsafe-not-inherited.rs:20:13 + --> $DIR/unsafe-not-inherited.rs:18:13 | LL | unsafe { | ------ items do not inherit unsafety from separate enclosing items diff --git a/tests/ui/unsafe/unsafe-unstable-const-fn.rs b/tests/ui/unsafe/unsafe-unstable-const-fn.rs index 581b15cdfb0..5398721484a 100644 --- a/tests/ui/unsafe/unsafe-unstable-const-fn.rs +++ b/tests/ui/unsafe/unsafe-unstable-const-fn.rs @@ -1,6 +1,3 @@ -// revisions: mir thir -// [thir]compile-flags: -Z thir-unsafeck - #![stable(feature = "foo", since = "1.33.0")] #![feature(staged_api)] diff --git a/tests/ui/unsafe/unsafe-unstable-const-fn.mir.stderr b/tests/ui/unsafe/unsafe-unstable-const-fn.stderr index 79133ab39a0..22a2dcbf119 100644 --- a/tests/ui/unsafe/unsafe-unstable-const-fn.mir.stderr +++ b/tests/ui/unsafe/unsafe-unstable-const-fn.stderr @@ -1,5 +1,5 @@ error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-unstable-const-fn.rs:10:5 + --> $DIR/unsafe-unstable-const-fn.rs:7:5 | LL | *a == b | ^^ dereference of raw pointer diff --git a/tests/ui/unsafe/unsafe-unstable-const-fn.thir.stderr b/tests/ui/unsafe/unsafe-unstable-const-fn.thir.stderr deleted file mode 100644 index 79133ab39a0..00000000000 --- a/tests/ui/unsafe/unsafe-unstable-const-fn.thir.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block - --> $DIR/unsafe-unstable-const-fn.rs:10:5 - | -LL | *a == b - | ^^ 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 1 previous error - -For more information about this error, try `rustc --explain E0133`. diff --git a/tests/ui/unsafe/wrapping-unsafe-block-sugg.mir.fixed b/tests/ui/unsafe/wrapping-unsafe-block-sugg.fixed index b59029df642..20f4fe847da 100644 --- a/tests/ui/unsafe/wrapping-unsafe-block-sugg.mir.fixed +++ b/tests/ui/unsafe/wrapping-unsafe-block-sugg.fixed @@ -1,7 +1,5 @@ // run-rustfix // aux-build:external_unsafe_macro.rs -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck #![deny(unsafe_op_in_unsafe_fn)] //~ NOTE #![crate_name = "wrapping_unsafe_block_sugg"] @@ -12,13 +10,11 @@ unsafe fn unsf() {} pub unsafe fn foo() { unsafe { //~^ NOTE an unsafe function restricts its caller, but its body is safe by default - unsf(); //[mir]~ ERROR call to unsafe function is unsafe - //[thir]~^ ERROR call to unsafe function `unsf` is unsafe - //~^^ NOTE + unsf(); //~ ERROR call to unsafe function `unsf` is unsafe + //~^ NOTE //~| NOTE - unsf(); //[mir]~ ERROR call to unsafe function is unsafe - //[thir]~^ ERROR call to unsafe function `unsf` is unsafe - //~^^ NOTE + unsf(); //~ ERROR call to unsafe function `unsf` is unsafe + //~^ NOTE //~| NOTE }} @@ -44,12 +40,10 @@ pub unsafe fn baz() -> i32 { unsafe { }} macro_rules! unsafe_macro { () => (unsf()) } -//[mir]~^ ERROR call to unsafe function is unsafe -//[thir]~^^ ERROR call to unsafe function `unsf` is unsafe +//~^ ERROR call to unsafe function `unsf` is unsafe //~| NOTE //~| NOTE -//[mir]~| ERROR call to unsafe function is unsafe -//[thir]~| ERROR call to unsafe function `unsf` is unsafe +//~| ERROR call to unsafe function `unsf` is unsafe //~| NOTE //~| NOTE diff --git a/tests/ui/unsafe/wrapping-unsafe-block-sugg.mir.stderr b/tests/ui/unsafe/wrapping-unsafe-block-sugg.mir.stderr deleted file mode 100644 index 7a1b83c7367..00000000000 --- a/tests/ui/unsafe/wrapping-unsafe-block-sugg.mir.stderr +++ /dev/null @@ -1,99 +0,0 @@ -error: call to unsafe function is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:15:5 - | -LL | unsf(); - | ^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior -note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/wrapping-unsafe-block-sugg.rs:13:1 - | -LL | pub unsafe fn foo() { - | ^^^^^^^^^^^^^^^^^^^ -note: the lint level is defined here - --> $DIR/wrapping-unsafe-block-sugg.rs:6:9 - | -LL | #![deny(unsafe_op_in_unsafe_fn)] - | ^^^^^^^^^^^^^^^^^^^^^^ - -error: call to unsafe function is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:19:5 - | -LL | unsf(); - | ^^^^^^ call to unsafe function - | - = note: consult the function's documentation for information on how to avoid undefined behavior - -error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:27:13 - | -LL | let y = *x; - | ^^ 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 -note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/wrapping-unsafe-block-sugg.rs:25:1 - | -LL | pub unsafe fn bar(x: *const i32) -> i32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:30:9 - | -LL | y + *x - | ^^ 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: use of mutable static is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:38:13 - | -LL | let y = BAZ; - | ^^^ use of mutable static - | - = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior -note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/wrapping-unsafe-block-sugg.rs:36:1 - | -LL | pub unsafe fn baz() -> i32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: use of mutable static is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:41:9 - | -LL | y + BAZ - | ^^^ use of mutable static - | - = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior - -error: call to unsafe function is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:46:36 - | -LL | macro_rules! unsafe_macro { () => (unsf()) } - | ^^^^^^ call to unsafe function -... -LL | unsafe_macro!(); - | --------------- in this macro invocation - | - = note: consult the function's documentation for information on how to avoid undefined behavior -note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/wrapping-unsafe-block-sugg.rs:56:1 - | -LL | pub unsafe fn unsafe_in_macro() { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: call to unsafe function is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:46:36 - | -LL | macro_rules! unsafe_macro { () => (unsf()) } - | ^^^^^^ call to unsafe function -... -LL | unsafe_macro!(); - | --------------- in this macro invocation - | - = note: consult the function's documentation for information on how to avoid undefined behavior - = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 8 previous errors - diff --git a/tests/ui/unsafe/wrapping-unsafe-block-sugg.rs b/tests/ui/unsafe/wrapping-unsafe-block-sugg.rs index 3629b8a1beb..13a446d2d24 100644 --- a/tests/ui/unsafe/wrapping-unsafe-block-sugg.rs +++ b/tests/ui/unsafe/wrapping-unsafe-block-sugg.rs @@ -1,7 +1,5 @@ // run-rustfix // aux-build:external_unsafe_macro.rs -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck #![deny(unsafe_op_in_unsafe_fn)] //~ NOTE #![crate_name = "wrapping_unsafe_block_sugg"] @@ -12,13 +10,11 @@ unsafe fn unsf() {} pub unsafe fn foo() { //~^ NOTE an unsafe function restricts its caller, but its body is safe by default - unsf(); //[mir]~ ERROR call to unsafe function is unsafe - //[thir]~^ ERROR call to unsafe function `unsf` is unsafe - //~^^ NOTE + unsf(); //~ ERROR call to unsafe function `unsf` is unsafe + //~^ NOTE //~| NOTE - unsf(); //[mir]~ ERROR call to unsafe function is unsafe - //[thir]~^ ERROR call to unsafe function `unsf` is unsafe - //~^^ NOTE + unsf(); //~ ERROR call to unsafe function `unsf` is unsafe + //~^ NOTE //~| NOTE } @@ -44,12 +40,10 @@ pub unsafe fn baz() -> i32 { } macro_rules! unsafe_macro { () => (unsf()) } -//[mir]~^ ERROR call to unsafe function is unsafe -//[thir]~^^ ERROR call to unsafe function `unsf` is unsafe +//~^ ERROR call to unsafe function `unsf` is unsafe //~| NOTE //~| NOTE -//[mir]~| ERROR call to unsafe function is unsafe -//[thir]~| ERROR call to unsafe function `unsf` is unsafe +//~| ERROR call to unsafe function `unsf` is unsafe //~| NOTE //~| NOTE diff --git a/tests/ui/unsafe/wrapping-unsafe-block-sugg.thir.stderr b/tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr index b1fb35f85a6..84b58bc0288 100644 --- a/tests/ui/unsafe/wrapping-unsafe-block-sugg.thir.stderr +++ b/tests/ui/unsafe/wrapping-unsafe-block-sugg.stderr @@ -1,23 +1,23 @@ error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:15:5 + --> $DIR/wrapping-unsafe-block-sugg.rs:13:5 | LL | unsf(); | ^^^^^^ call to unsafe function | = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/wrapping-unsafe-block-sugg.rs:13:1 + --> $DIR/wrapping-unsafe-block-sugg.rs:11:1 | LL | pub unsafe fn foo() { | ^^^^^^^^^^^^^^^^^^^ note: the lint level is defined here - --> $DIR/wrapping-unsafe-block-sugg.rs:6:9 + --> $DIR/wrapping-unsafe-block-sugg.rs:4:9 | LL | #![deny(unsafe_op_in_unsafe_fn)] | ^^^^^^^^^^^^^^^^^^^^^^ error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:19:5 + --> $DIR/wrapping-unsafe-block-sugg.rs:16:5 | LL | unsf(); | ^^^^^^ call to unsafe function @@ -25,20 +25,20 @@ LL | unsf(); = note: consult the function's documentation for information on how to avoid undefined behavior error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:27:13 + --> $DIR/wrapping-unsafe-block-sugg.rs:23:13 | LL | let y = *x; | ^^ 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 note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/wrapping-unsafe-block-sugg.rs:25:1 + --> $DIR/wrapping-unsafe-block-sugg.rs:21:1 | LL | pub unsafe fn bar(x: *const i32) -> i32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: dereference of raw pointer is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:30:9 + --> $DIR/wrapping-unsafe-block-sugg.rs:26:9 | LL | y + *x | ^^ dereference of raw pointer @@ -46,20 +46,20 @@ LL | y + *x = 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: use of mutable static is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:38:13 + --> $DIR/wrapping-unsafe-block-sugg.rs:34:13 | LL | let y = BAZ; | ^^^ use of mutable static | = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/wrapping-unsafe-block-sugg.rs:36:1 + --> $DIR/wrapping-unsafe-block-sugg.rs:32:1 | LL | pub unsafe fn baz() -> i32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: use of mutable static is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:41:9 + --> $DIR/wrapping-unsafe-block-sugg.rs:37:9 | LL | y + BAZ | ^^^ use of mutable static @@ -67,7 +67,7 @@ LL | y + BAZ = note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:46:36 + --> $DIR/wrapping-unsafe-block-sugg.rs:42:36 | LL | macro_rules! unsafe_macro { () => (unsf()) } | ^^^^^^ call to unsafe function @@ -77,14 +77,14 @@ LL | unsafe_macro!(); | = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default - --> $DIR/wrapping-unsafe-block-sugg.rs:56:1 + --> $DIR/wrapping-unsafe-block-sugg.rs:50:1 | LL | pub unsafe fn unsafe_in_macro() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: this error originates in the macro `unsafe_macro` (in Nightly builds, run with -Z macro-backtrace for more info) error: call to unsafe function `unsf` is unsafe and requires unsafe block (error E0133) - --> $DIR/wrapping-unsafe-block-sugg.rs:46:36 + --> $DIR/wrapping-unsafe-block-sugg.rs:42:36 | LL | macro_rules! unsafe_macro { () => (unsf()) } | ^^^^^^ call to unsafe function diff --git a/tests/ui/unsafe/wrapping-unsafe-block-sugg.thir.fixed b/tests/ui/unsafe/wrapping-unsafe-block-sugg.thir.fixed deleted file mode 100644 index b59029df642..00000000000 --- a/tests/ui/unsafe/wrapping-unsafe-block-sugg.thir.fixed +++ /dev/null @@ -1,73 +0,0 @@ -// run-rustfix -// aux-build:external_unsafe_macro.rs -// revisions: mir thir -// [thir]compile-flags: -Zthir-unsafeck - -#![deny(unsafe_op_in_unsafe_fn)] //~ NOTE -#![crate_name = "wrapping_unsafe_block_sugg"] - -extern crate external_unsafe_macro; - -unsafe fn unsf() {} - -pub unsafe fn foo() { unsafe { - //~^ NOTE an unsafe function restricts its caller, but its body is safe by default - unsf(); //[mir]~ ERROR call to unsafe function is unsafe - //[thir]~^ ERROR call to unsafe function `unsf` is unsafe - //~^^ NOTE - //~| NOTE - unsf(); //[mir]~ ERROR call to unsafe function is unsafe - //[thir]~^ ERROR call to unsafe function `unsf` is unsafe - //~^^ NOTE - //~| NOTE -}} - -pub unsafe fn bar(x: *const i32) -> i32 { unsafe { - //~^ NOTE an unsafe function restricts its caller, but its body is safe by default - let y = *x; //~ ERROR dereference of raw pointer is unsafe and requires unsafe block - //~^ NOTE - //~| NOTE - y + *x //~ ERROR dereference of raw pointer is unsafe and requires unsafe block - //~^ NOTE - //~| NOTE -}} - -static mut BAZ: i32 = 0; -pub unsafe fn baz() -> i32 { unsafe { - //~^ NOTE an unsafe function restricts its caller, but its body is safe by default - let y = BAZ; //~ ERROR use of mutable static is unsafe and requires unsafe block - //~^ NOTE - //~| NOTE - y + BAZ //~ ERROR use of mutable static is unsafe and requires unsafe block - //~^ NOTE - //~| NOTE -}} - -macro_rules! unsafe_macro { () => (unsf()) } -//[mir]~^ ERROR call to unsafe function is unsafe -//[thir]~^^ ERROR call to unsafe function `unsf` is unsafe -//~| NOTE -//~| NOTE -//[mir]~| ERROR call to unsafe function is unsafe -//[thir]~| ERROR call to unsafe function `unsf` is unsafe -//~| NOTE -//~| NOTE - -pub unsafe fn unsafe_in_macro() { unsafe { - //~^ NOTE an unsafe function restricts its caller, but its body is safe by default - unsafe_macro!(); - //~^ NOTE - //~| NOTE - unsafe_macro!(); - //~^ NOTE - //~| NOTE -}} - -pub unsafe fn unsafe_in_external_macro() { - // FIXME: https://github.com/rust-lang/rust/issues/112504 - // FIXME: ~^ NOTE an unsafe function restricts its caller, but its body is safe by default - external_unsafe_macro::unsafe_macro!(); - external_unsafe_macro::unsafe_macro!(); -} - -fn main() {} diff --git a/tests/ui/unsized-locals/unsized-exprs-rpass.rs b/tests/ui/unsized-locals/unsized-exprs-rpass.rs index 175b02fcb81..83d3680f72f 100644 --- a/tests/ui/unsized-locals/unsized-exprs-rpass.rs +++ b/tests/ui/unsized-locals/unsized-exprs-rpass.rs @@ -2,7 +2,7 @@ #![allow(incomplete_features, unused_braces, unused_parens)] #![feature(unsized_tuple_coercion, unsized_locals, unsized_fn_params)] -struct A<X: ?Sized>(#[allow(unused_tuple_struct_fields)] X); +struct A<X: ?Sized>(#[allow(dead_code)] X); fn udrop<T: ?Sized>(_x: T) {} fn foo() -> Box<[u8]> { diff --git a/tests/ui/unsized/unchanged-param.rs b/tests/ui/unsized/unchanged-param.rs index 6bdc89310eb..8aa2ed15344 100644 --- a/tests/ui/unsized/unchanged-param.rs +++ b/tests/ui/unsized/unchanged-param.rs @@ -1,8 +1,8 @@ // run-pass // Test that we allow unsizing even if there is an unchanged param in the // field getting unsized. -struct A<T, U: ?Sized + 'static>(#[allow(unused_tuple_struct_fields)] T, B<T, U>); -struct B<T, U: ?Sized>(#[allow(unused_tuple_struct_fields)] T, U); +struct A<T, U: ?Sized + 'static>(#[allow(dead_code)] T, B<T, U>); +struct B<T, U: ?Sized>(#[allow(dead_code)] T, U); fn main() { let x: A<[u32; 1], [u32; 1]> = A([0; 1], B([0; 1], [0; 1])); diff --git a/tests/ui/wf/hir-wf-check-erase-regions.stderr b/tests/ui/wf/hir-wf-check-erase-regions.stderr index eb0a8f8f69a..4b696dc1d1d 100644 --- a/tests/ui/wf/hir-wf-check-erase-regions.stderr +++ b/tests/ui/wf/hir-wf-check-erase-regions.stderr @@ -6,15 +6,15 @@ LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; | = help: the trait `Iterator` is not implemented for `&'a T` = help: the trait `Iterator` is implemented for `&mut I` - = note: required for `&'a T` to implement `IntoIterator` -note: required by a bound in `Flatten` - --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL + = note: required for `Flatten<std::slice::Iter<'a, T>>` to implement `Iterator` +note: required by a bound in `std::iter::IntoIterator::IntoIter` + --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL error[E0277]: `&'a T` is not an iterator - --> $DIR/hir-wf-check-erase-regions.rs:11:27 + --> $DIR/hir-wf-check-erase-regions.rs:7:21 | -LL | fn into_iter(self) -> Self::IntoIter { - | ^^^^^^^^^^^^^^ `&'a T` is not an iterator +LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'a T` is not an iterator | = help: the trait `Iterator` is not implemented for `&'a T` = help: the trait `Iterator` is implemented for `&mut I` @@ -23,16 +23,16 @@ note: required by a bound in `Flatten` --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL error[E0277]: `&'a T` is not an iterator - --> $DIR/hir-wf-check-erase-regions.rs:7:21 + --> $DIR/hir-wf-check-erase-regions.rs:11:27 | -LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'a T` is not an iterator +LL | fn into_iter(self) -> Self::IntoIter { + | ^^^^^^^^^^^^^^ `&'a T` is not an iterator | = help: the trait `Iterator` is not implemented for `&'a T` = help: the trait `Iterator` is implemented for `&mut I` - = note: required for `Flatten<std::slice::Iter<'a, T>>` to implement `Iterator` -note: required by a bound in `std::iter::IntoIterator::IntoIter` - --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL + = note: required for `&'a T` to implement `IntoIterator` +note: required by a bound in `Flatten` + --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL error: aborting due to 3 previous errors |
