about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMarkus Reiter <me@reitermark.us>2024-04-21 18:41:45 +0200
committerMarkus Reiter <me@reitermark.us>2024-04-22 18:48:47 +0200
commit33e68aadc975c60bf975789f70156e67082e8910 (patch)
tree4e510b113ef352e4dc0c984944dcedd3b52e10e3 /tests
parentf22a0c2d9f9cd83dfe84b65e9fa1b3fa8303c7b5 (diff)
downloadrust-33e68aadc975c60bf975789f70156e67082e8910.tar.gz
rust-33e68aadc975c60bf975789f70156e67082e8910.zip
Stabilize generic `NonZero`.
Diffstat (limited to 'tests')
-rw-r--r--tests/codegen/array-equality.rs1
-rw-r--r--tests/codegen/enum/enum-debug-niche-2.rs2
-rw-r--r--tests/codegen/function-arguments.rs1
-rw-r--r--tests/codegen/intrinsics/transmute-niched.rs1
-rw-r--r--tests/codegen/issues/issue-119422.rs1
-rw-r--r--tests/codegen/loads.rs1
-rw-r--r--tests/codegen/option-as-slice.rs1
-rw-r--r--tests/codegen/option-niche-eq.rs1
-rw-r--r--tests/codegen/slice-ref-equality.rs1
-rw-r--r--tests/codegen/transmute-optimized.rs1
-rw-r--r--tests/debuginfo/msvc-pretty-enums.rs1
-rw-r--r--tests/debuginfo/numeric-types.rs1
-rw-r--r--tests/mir-opt/instsimplify/combine_transmutes.rs1
-rw-r--r--tests/ui/abi/compatibility.rs1
-rw-r--r--tests/ui/consts/const-eval/raw-bytes.rs2
-rw-r--r--tests/ui/consts/const-eval/ub-nonnull.rs2
-rw-r--r--tests/ui/consts/const-eval/valid-const.rs1
-rw-r--r--tests/ui/consts/tuple-struct-constructors.rs1
-rw-r--r--tests/ui/intrinsics/panic-uninitialized-zeroed.rs1
-rw-r--r--tests/ui/issues/issue-64593.rs1
-rw-r--r--tests/ui/layout/unsafe-cell-hides-niche.rs1
-rw-r--r--tests/ui/layout/zero-sized-array-enum-niche.rs1
-rw-r--r--tests/ui/layout/zero-sized-array-enum-niche.stderr8
-rw-r--r--tests/ui/lint/clashing-extern-fn.rs1
-rw-r--r--tests/ui/lint/clashing-extern-fn.stderr38
-rw-r--r--tests/ui/lint/invalid_value.rs2
-rw-r--r--tests/ui/lint/lint-ctypes-enum.rs1
-rw-r--r--tests/ui/lint/lint-ctypes-enum.stderr22
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs1
-rw-r--r--tests/ui/print_type_sizes/niche-filling.rs1
-rw-r--r--tests/ui/structs-enums/enum-null-pointer-opt.rs1
-rw-r--r--tests/ui/structs-enums/enum-null-pointer-opt.stderr2
-rw-r--r--tests/ui/structs-enums/type-sizes.rs1
-rw-r--r--tests/ui/suggestions/core-std-import-order-issue-83564.rs1
-rw-r--r--tests/ui/suggestions/core-std-import-order-issue-83564.stderr2
-rw-r--r--tests/ui/traits/next-solver/specialization-transmute.rs1
-rw-r--r--tests/ui/traits/next-solver/specialization-transmute.stderr12
37 files changed, 46 insertions, 73 deletions
diff --git a/tests/codegen/array-equality.rs b/tests/codegen/array-equality.rs
index 5b85da1d4a0..bc5425c7a4f 100644
--- a/tests/codegen/array-equality.rs
+++ b/tests/codegen/array-equality.rs
@@ -1,7 +1,6 @@
 //@ compile-flags: -O -Z merge-functions=disabled
 //@ only-x86_64
 #![crate_type = "lib"]
-#![feature(generic_nonzero)]
 
 // CHECK-LABEL: @array_eq_value
 #[no_mangle]
diff --git a/tests/codegen/enum/enum-debug-niche-2.rs b/tests/codegen/enum/enum-debug-niche-2.rs
index 25871885e7e..58f43fe3ec6 100644
--- a/tests/codegen/enum/enum-debug-niche-2.rs
+++ b/tests/codegen/enum/enum-debug-niche-2.rs
@@ -7,7 +7,7 @@
 // CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_variant_part,{{.*}}size: 32,{{.*}}
 // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i128 4294967295{{[,)].*}}
 // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i128 0{{[,)].*}}
-#![feature(generic_nonzero, never_type)]
+#![feature(never_type)]
 
 #[derive(Copy, Clone)]
 pub struct Entity {
diff --git a/tests/codegen/function-arguments.rs b/tests/codegen/function-arguments.rs
index 468ec0a7753..2b27dab078d 100644
--- a/tests/codegen/function-arguments.rs
+++ b/tests/codegen/function-arguments.rs
@@ -1,7 +1,6 @@
 //@ compile-flags: -O -C no-prepopulate-passes
 #![crate_type = "lib"]
 #![feature(dyn_star)]
-#![feature(generic_nonzero)]
 #![feature(allocator_api)]
 
 use std::mem::MaybeUninit;
diff --git a/tests/codegen/intrinsics/transmute-niched.rs b/tests/codegen/intrinsics/transmute-niched.rs
index b5e0da1b2f5..f5b7bd2efea 100644
--- a/tests/codegen/intrinsics/transmute-niched.rs
+++ b/tests/codegen/intrinsics/transmute-niched.rs
@@ -3,7 +3,6 @@
 //@ [DBG] compile-flags: -C opt-level=0 -C no-prepopulate-passes
 //@ only-64bit (so I don't need to worry about usize)
 #![crate_type = "lib"]
-#![feature(generic_nonzero)]
 
 use std::mem::transmute;
 use std::num::NonZero;
diff --git a/tests/codegen/issues/issue-119422.rs b/tests/codegen/issues/issue-119422.rs
index 19480b4dc9e..aa56bfe79ac 100644
--- a/tests/codegen/issues/issue-119422.rs
+++ b/tests/codegen/issues/issue-119422.rs
@@ -4,7 +4,6 @@
 //@ compile-flags: -O --edition=2021 -Zmerge-functions=disabled
 //@ only-64bit (because the LLVM type of i64 for usize shows up)
 #![crate_type = "lib"]
-#![feature(generic_nonzero)]
 
 use core::ptr::NonNull;
 use core::num::NonZero;
diff --git a/tests/codegen/loads.rs b/tests/codegen/loads.rs
index ba4de77ce6f..e3e2f757770 100644
--- a/tests/codegen/loads.rs
+++ b/tests/codegen/loads.rs
@@ -1,7 +1,6 @@
 //@ compile-flags: -C no-prepopulate-passes -Zmir-opt-level=0 -O
 
 #![crate_type = "lib"]
-#![feature(generic_nonzero)]
 
 use std::mem::MaybeUninit;
 use std::num::NonZero;
diff --git a/tests/codegen/option-as-slice.rs b/tests/codegen/option-as-slice.rs
index c5b1eafaccb..65637a2495d 100644
--- a/tests/codegen/option-as-slice.rs
+++ b/tests/codegen/option-as-slice.rs
@@ -1,7 +1,6 @@
 //@ compile-flags: -O -Z randomize-layout=no
 //@ only-x86_64
 #![crate_type = "lib"]
-#![feature(generic_nonzero)]
 
 extern crate core;
 
diff --git a/tests/codegen/option-niche-eq.rs b/tests/codegen/option-niche-eq.rs
index 8b8044e9b75..7b955332fd3 100644
--- a/tests/codegen/option-niche-eq.rs
+++ b/tests/codegen/option-niche-eq.rs
@@ -1,7 +1,6 @@
 //@ compile-flags: -O -Zmerge-functions=disabled
 //@ min-llvm-version: 18
 #![crate_type = "lib"]
-#![feature(generic_nonzero)]
 
 extern crate core;
 use core::cmp::Ordering;
diff --git a/tests/codegen/slice-ref-equality.rs b/tests/codegen/slice-ref-equality.rs
index 7ab70108fe0..1153d7817b2 100644
--- a/tests/codegen/slice-ref-equality.rs
+++ b/tests/codegen/slice-ref-equality.rs
@@ -1,6 +1,5 @@
 //@ compile-flags: -O -Zmerge-functions=disabled
 #![crate_type = "lib"]
-#![feature(generic_nonzero)]
 
 use std::num::NonZero;
 
diff --git a/tests/codegen/transmute-optimized.rs b/tests/codegen/transmute-optimized.rs
index 1a5f53e625a..8e5bcb2340e 100644
--- a/tests/codegen/transmute-optimized.rs
+++ b/tests/codegen/transmute-optimized.rs
@@ -1,6 +1,5 @@
 //@ compile-flags: -O -Z merge-functions=disabled
 #![crate_type = "lib"]
-#![feature(generic_nonzero)]
 
 // This tests that LLVM can optimize based on the niches in the source or
 // destination types for transmutes.
diff --git a/tests/debuginfo/msvc-pretty-enums.rs b/tests/debuginfo/msvc-pretty-enums.rs
index cfac14a22c4..0293ec0ec39 100644
--- a/tests/debuginfo/msvc-pretty-enums.rs
+++ b/tests/debuginfo/msvc-pretty-enums.rs
@@ -132,7 +132,6 @@
 // cdb-command: dx -r2 arbitrary_discr2,d
 // cdb-check: arbitrary_discr2,d : Def [Type: enum2$<msvc_pretty_enums::ArbitraryDiscr>]
 // cdb-check:     [+0x[...]] __0              : 5678 [Type: unsigned int]
-#![feature(generic_nonzero)]
 #![feature(rustc_attrs)]
 #![feature(repr128)]
 #![feature(arbitrary_enum_discriminant)]
diff --git a/tests/debuginfo/numeric-types.rs b/tests/debuginfo/numeric-types.rs
index 1ff72d34fbd..98bc31e8855 100644
--- a/tests/debuginfo/numeric-types.rs
+++ b/tests/debuginfo/numeric-types.rs
@@ -237,7 +237,6 @@
 
 // lldb-command:v nz_usize
 // lldb-check:[...] 122 { __0 = { 0 = 122 } }
-#![feature(generic_nonzero)]
 
 use std::num::*;
 use std::sync::atomic::*;
diff --git a/tests/mir-opt/instsimplify/combine_transmutes.rs b/tests/mir-opt/instsimplify/combine_transmutes.rs
index a1274dd1b40..0be7466001f 100644
--- a/tests/mir-opt/instsimplify/combine_transmutes.rs
+++ b/tests/mir-opt/instsimplify/combine_transmutes.rs
@@ -3,7 +3,6 @@
 #![crate_type = "lib"]
 #![feature(core_intrinsics)]
 #![feature(custom_mir)]
-#![feature(generic_nonzero)]
 
 use std::intrinsics::mir::*;
 use std::mem::{MaybeUninit, ManuallyDrop, transmute};
diff --git a/tests/ui/abi/compatibility.rs b/tests/ui/abi/compatibility.rs
index 3ee4542810c..373d1cce1d7 100644
--- a/tests/ui/abi/compatibility.rs
+++ b/tests/ui/abi/compatibility.rs
@@ -64,7 +64,6 @@
   [csky] needs-llvm-components: csky
 */
 #![feature(rustc_attrs, unsized_fn_params, transparent_unions)]
-#![cfg_attr(host, feature(generic_nonzero))]
 #![cfg_attr(not(host), feature(no_core, lang_items), no_std, no_core)]
 #![allow(unused, improper_ctypes_definitions, internal_features)]
 
diff --git a/tests/ui/consts/const-eval/raw-bytes.rs b/tests/ui/consts/const-eval/raw-bytes.rs
index e5dfd5ca293..2fbf135c997 100644
--- a/tests/ui/consts/const-eval/raw-bytes.rs
+++ b/tests/ui/consts/const-eval/raw-bytes.rs
@@ -3,7 +3,7 @@
 // ignore-tidy-linelength
 //@ normalize-stderr-test "╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼" -> "╾ALLOC_ID$1╼"
 #![allow(invalid_value)]
-#![feature(generic_nonzero, never_type, rustc_attrs, ptr_metadata, slice_from_ptr_range, const_slice_from_ptr_range)]
+#![feature(never_type, rustc_attrs, ptr_metadata, slice_from_ptr_range, const_slice_from_ptr_range)]
 
 use std::mem;
 use std::alloc::Layout;
diff --git a/tests/ui/consts/const-eval/ub-nonnull.rs b/tests/ui/consts/const-eval/ub-nonnull.rs
index 76bd5248ffd..10d304436f8 100644
--- a/tests/ui/consts/const-eval/ub-nonnull.rs
+++ b/tests/ui/consts/const-eval/ub-nonnull.rs
@@ -2,7 +2,7 @@
 //@ normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr-test "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
 #![allow(invalid_value)] // make sure we cannot allow away the errors tested here
-#![feature(generic_nonzero, rustc_attrs, ptr_metadata)]
+#![feature(rustc_attrs, ptr_metadata)]
 
 use std::mem;
 use std::ptr::NonNull;
diff --git a/tests/ui/consts/const-eval/valid-const.rs b/tests/ui/consts/const-eval/valid-const.rs
index 15d3e883456..777484c6b09 100644
--- a/tests/ui/consts/const-eval/valid-const.rs
+++ b/tests/ui/consts/const-eval/valid-const.rs
@@ -1,7 +1,6 @@
 //@ check-pass
 //
 // Some constants that *are* valid
-#![feature(generic_nonzero)]
 
 use std::mem;
 use std::ptr::NonNull;
diff --git a/tests/ui/consts/tuple-struct-constructors.rs b/tests/ui/consts/tuple-struct-constructors.rs
index d2f25aeec9b..e645b574075 100644
--- a/tests/ui/consts/tuple-struct-constructors.rs
+++ b/tests/ui/consts/tuple-struct-constructors.rs
@@ -1,7 +1,6 @@
 //@ run-pass
 //
 // https://github.com/rust-lang/rust/issues/41898
-#![feature(generic_nonzero)]
 
 use std::num::NonZero;
 
diff --git a/tests/ui/intrinsics/panic-uninitialized-zeroed.rs b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs
index b1ac7528d58..67b9832d601 100644
--- a/tests/ui/intrinsics/panic-uninitialized-zeroed.rs
+++ b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs
@@ -7,7 +7,6 @@
 //
 // This test checks panic emitted from `mem::{uninitialized,zeroed}`.
 #![allow(deprecated, invalid_value)]
-#![feature(generic_nonzero)]
 #![feature(never_type)]
 
 use std::{
diff --git a/tests/ui/issues/issue-64593.rs b/tests/ui/issues/issue-64593.rs
index 091c3a2f316..e28b9577347 100644
--- a/tests/ui/issues/issue-64593.rs
+++ b/tests/ui/issues/issue-64593.rs
@@ -1,6 +1,5 @@
 //@ check-pass
 #![deny(improper_ctypes)]
-#![feature(generic_nonzero)]
 
 pub struct Error(std::num::NonZero<u32>);
 
diff --git a/tests/ui/layout/unsafe-cell-hides-niche.rs b/tests/ui/layout/unsafe-cell-hides-niche.rs
index 568eb819be2..fe51c9925e8 100644
--- a/tests/ui/layout/unsafe-cell-hides-niche.rs
+++ b/tests/ui/layout/unsafe-cell-hides-niche.rs
@@ -6,7 +6,6 @@
 //@ check-pass
 //@ compile-flags: --crate-type=lib
 //@ only-x86
-#![feature(generic_nonzero)]
 #![feature(repr_simd)]
 
 use std::cell::{UnsafeCell, RefCell, Cell};
diff --git a/tests/ui/layout/zero-sized-array-enum-niche.rs b/tests/ui/layout/zero-sized-array-enum-niche.rs
index 058f5923487..0c37c0f010e 100644
--- a/tests/ui/layout/zero-sized-array-enum-niche.rs
+++ b/tests/ui/layout/zero-sized-array-enum-niche.rs
@@ -1,6 +1,5 @@
 //@ normalize-stderr-test "pref: Align\([1-8] bytes\)" -> "pref: $$PREF_ALIGN"
 #![crate_type = "lib"]
-#![feature(generic_nonzero)]
 #![feature(rustc_attrs)]
 
 // Various tests around the behavior of zero-sized arrays and
diff --git a/tests/ui/layout/zero-sized-array-enum-niche.stderr b/tests/ui/layout/zero-sized-array-enum-niche.stderr
index af049125de4..ee34cfdfb0d 100644
--- a/tests/ui/layout/zero-sized-array-enum-niche.stderr
+++ b/tests/ui/layout/zero-sized-array-enum-niche.stderr
@@ -98,7 +98,7 @@ error: layout_of(Result<[u32; 0], bool>) = Layout {
            max_repr_align: None,
            unadjusted_abi_align: Align(4 bytes),
        }
-  --> $DIR/zero-sized-array-enum-niche.rs:14:1
+  --> $DIR/zero-sized-array-enum-niche.rs:13:1
    |
 LL | type AlignedResult = Result<[u32; 0], bool>;
    | ^^^^^^^^^^^^^^^^^^
@@ -227,7 +227,7 @@ error: layout_of(MultipleAlignments) = Layout {
            max_repr_align: None,
            unadjusted_abi_align: Align(4 bytes),
        }
-  --> $DIR/zero-sized-array-enum-niche.rs:22:1
+  --> $DIR/zero-sized-array-enum-niche.rs:21:1
    |
 LL | enum MultipleAlignments {
    | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -332,7 +332,7 @@ error: layout_of(Result<[u32; 0], Packed<NonZero<u16>>>) = Layout {
            max_repr_align: None,
            unadjusted_abi_align: Align(4 bytes),
        }
-  --> $DIR/zero-sized-array-enum-niche.rs:38:1
+  --> $DIR/zero-sized-array-enum-niche.rs:37:1
    |
 LL | type NicheLosesToTagged = Result<[u32; 0], Packed<std::num::NonZero<u16>>>;
    | ^^^^^^^^^^^^^^^^^^^^^^^
@@ -441,7 +441,7 @@ error: layout_of(Result<[u32; 0], Packed<U16IsZero>>) = Layout {
            max_repr_align: None,
            unadjusted_abi_align: Align(4 bytes),
        }
-  --> $DIR/zero-sized-array-enum-niche.rs:45:1
+  --> $DIR/zero-sized-array-enum-niche.rs:44:1
    |
 LL | type NicheWinsOverTagged = Result<[u32; 0], Packed<U16IsZero>>;
    | ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/lint/clashing-extern-fn.rs b/tests/ui/lint/clashing-extern-fn.rs
index cb63af0ea42..728dfabb393 100644
--- a/tests/ui/lint/clashing-extern-fn.rs
+++ b/tests/ui/lint/clashing-extern-fn.rs
@@ -2,7 +2,6 @@
 //@ aux-build:external_extern_fn.rs
 #![crate_type = "lib"]
 #![warn(clashing_extern_declarations)]
-#![feature(generic_nonzero)]
 
 mod redeclared_different_signature {
     mod a {
diff --git a/tests/ui/lint/clashing-extern-fn.stderr b/tests/ui/lint/clashing-extern-fn.stderr
index 86ee789aeb2..43c8cdead9f 100644
--- a/tests/ui/lint/clashing-extern-fn.stderr
+++ b/tests/ui/lint/clashing-extern-fn.stderr
@@ -1,5 +1,5 @@
 warning: `extern` block uses type `Option<TransparentNoNiche>`, which is not FFI-safe
-  --> $DIR/clashing-extern-fn.rs:430:55
+  --> $DIR/clashing-extern-fn.rs:429:55
    |
 LL |             fn hidden_niche_transparent_no_niche() -> Option<TransparentNoNiche>;
    |                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -9,7 +9,7 @@ LL |             fn hidden_niche_transparent_no_niche() -> Option<TransparentNoN
    = note: `#[warn(improper_ctypes)]` on by default
 
 warning: `extern` block uses type `Option<UnsafeCell<NonZero<usize>>>`, which is not FFI-safe
-  --> $DIR/clashing-extern-fn.rs:434:46
+  --> $DIR/clashing-extern-fn.rs:433:46
    |
 LL |             fn hidden_niche_unsafe_cell() -> Option<UnsafeCell<NonZero<usize>>>;
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -18,7 +18,7 @@ LL |             fn hidden_niche_unsafe_cell() -> Option<UnsafeCell<NonZero<usiz
    = note: enum has no representation hint
 
 warning: `clash` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:15:13
+  --> $DIR/clashing-extern-fn.rs:14:13
    |
 LL |             fn clash(x: u8);
    |             --------------- `clash` previously declared here
@@ -35,7 +35,7 @@ LL | #![warn(clashing_extern_declarations)]
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 warning: `extern_link_name` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:53:9
+  --> $DIR/clashing-extern-fn.rs:52:9
    |
 LL |     #[link_name = "extern_link_name"]
    |     --------------------------------- `extern_link_name` previously declared here
@@ -47,7 +47,7 @@ LL |         fn extern_link_name(x: u32);
               found `unsafe extern "C" fn(u32)`
 
 warning: `some_other_extern_link_name` redeclares `some_other_new_name` with a different signature
-  --> $DIR/clashing-extern-fn.rs:56:9
+  --> $DIR/clashing-extern-fn.rs:55:9
    |
 LL |     fn some_other_new_name(x: i16);
    |     ------------------------------ `some_other_new_name` previously declared here
@@ -59,7 +59,7 @@ LL |         #[link_name = "some_other_new_name"]
               found `unsafe extern "C" fn(u32)`
 
 warning: `other_both_names_different` redeclares `link_name_same` with a different signature
-  --> $DIR/clashing-extern-fn.rs:60:9
+  --> $DIR/clashing-extern-fn.rs:59:9
    |
 LL |     #[link_name = "link_name_same"]
    |     ------------------------------- `link_name_same` previously declared here
@@ -71,7 +71,7 @@ LL |         #[link_name = "link_name_same"]
               found `unsafe extern "C" fn(u32)`
 
 warning: `different_mod` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:73:9
+  --> $DIR/clashing-extern-fn.rs:72:9
    |
 LL |         fn different_mod(x: u8);
    |         ----------------------- `different_mod` previously declared here
@@ -83,7 +83,7 @@ LL |         fn different_mod(x: u64);
               found `unsafe extern "C" fn(u64)`
 
 warning: `variadic_decl` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:83:9
+  --> $DIR/clashing-extern-fn.rs:82:9
    |
 LL |     fn variadic_decl(x: u8, ...);
    |     ---------------------------- `variadic_decl` previously declared here
@@ -95,7 +95,7 @@ LL |         fn variadic_decl(x: u8);
               found `unsafe extern "C" fn(u8)`
 
 warning: `weigh_banana` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:143:13
+  --> $DIR/clashing-extern-fn.rs:142:13
    |
 LL |             fn weigh_banana(count: *const Banana) -> u64;
    |             -------------------------------------------- `weigh_banana` previously declared here
@@ -107,7 +107,7 @@ LL |             fn weigh_banana(count: *const Banana) -> u64;
               found `unsafe extern "C" fn(*const three::Banana) -> u64`
 
 warning: `draw_point` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:172:13
+  --> $DIR/clashing-extern-fn.rs:171:13
    |
 LL |             fn draw_point(p: Point);
    |             ----------------------- `draw_point` previously declared here
@@ -119,7 +119,7 @@ LL |             fn draw_point(p: Point);
               found `unsafe extern "C" fn(sameish_members::b::Point)`
 
 warning: `origin` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:198:13
+  --> $DIR/clashing-extern-fn.rs:197:13
    |
 LL |             fn origin() -> Point3;
    |             --------------------- `origin` previously declared here
@@ -131,7 +131,7 @@ LL |             fn origin() -> Point3;
               found `unsafe extern "C" fn() -> same_sized_members_clash::b::Point3`
 
 warning: `transparent_incorrect` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:221:13
+  --> $DIR/clashing-extern-fn.rs:220:13
    |
 LL |             fn transparent_incorrect() -> T;
    |             ------------------------------- `transparent_incorrect` previously declared here
@@ -143,7 +143,7 @@ LL |             fn transparent_incorrect() -> isize;
               found `unsafe extern "C" fn() -> isize`
 
 warning: `missing_return_type` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:260:13
+  --> $DIR/clashing-extern-fn.rs:259:13
    |
 LL |             fn missing_return_type() -> usize;
    |             --------------------------------- `missing_return_type` previously declared here
@@ -155,7 +155,7 @@ LL |             fn missing_return_type();
               found `unsafe extern "C" fn()`
 
 warning: `non_zero_usize` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:278:13
+  --> $DIR/clashing-extern-fn.rs:277:13
    |
 LL |             fn non_zero_usize() -> core::num::NonZero<usize>;
    |             ------------------------------------------------ `non_zero_usize` previously declared here
@@ -167,7 +167,7 @@ LL |             fn non_zero_usize() -> usize;
               found `unsafe extern "C" fn() -> usize`
 
 warning: `non_null_ptr` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:280:13
+  --> $DIR/clashing-extern-fn.rs:279:13
    |
 LL |             fn non_null_ptr() -> core::ptr::NonNull<usize>;
    |             ---------------------------------------------- `non_null_ptr` previously declared here
@@ -179,7 +179,7 @@ LL |             fn non_null_ptr() -> *const usize;
               found `unsafe extern "C" fn() -> *const usize`
 
 warning: `option_non_zero_usize_incorrect` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:374:13
+  --> $DIR/clashing-extern-fn.rs:373:13
    |
 LL |             fn option_non_zero_usize_incorrect() -> usize;
    |             --------------------------------------------- `option_non_zero_usize_incorrect` previously declared here
@@ -191,7 +191,7 @@ LL |             fn option_non_zero_usize_incorrect() -> isize;
               found `unsafe extern "C" fn() -> isize`
 
 warning: `option_non_null_ptr_incorrect` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:376:13
+  --> $DIR/clashing-extern-fn.rs:375:13
    |
 LL |             fn option_non_null_ptr_incorrect() -> *const usize;
    |             -------------------------------------------------- `option_non_null_ptr_incorrect` previously declared here
@@ -203,7 +203,7 @@ LL |             fn option_non_null_ptr_incorrect() -> *const isize;
               found `unsafe extern "C" fn() -> *const isize`
 
 warning: `hidden_niche_transparent_no_niche` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:430:13
+  --> $DIR/clashing-extern-fn.rs:429:13
    |
 LL |             fn hidden_niche_transparent_no_niche() -> usize;
    |             ----------------------------------------------- `hidden_niche_transparent_no_niche` previously declared here
@@ -215,7 +215,7 @@ LL |             fn hidden_niche_transparent_no_niche() -> Option<TransparentNoN
               found `unsafe extern "C" fn() -> Option<TransparentNoNiche>`
 
 warning: `hidden_niche_unsafe_cell` redeclared with a different signature
-  --> $DIR/clashing-extern-fn.rs:434:13
+  --> $DIR/clashing-extern-fn.rs:433:13
    |
 LL |             fn hidden_niche_unsafe_cell() -> usize;
    |             -------------------------------------- `hidden_niche_unsafe_cell` previously declared here
diff --git a/tests/ui/lint/invalid_value.rs b/tests/ui/lint/invalid_value.rs
index 1d2f23aaaf6..29e8e6cfef6 100644
--- a/tests/ui/lint/invalid_value.rs
+++ b/tests/ui/lint/invalid_value.rs
@@ -2,7 +2,7 @@
 // in a lint.
 #![allow(deprecated)]
 #![deny(invalid_value)]
-#![feature(generic_nonzero, never_type, rustc_attrs)]
+#![feature(never_type, rustc_attrs)]
 
 use std::mem::{self, MaybeUninit};
 use std::ptr::NonNull;
diff --git a/tests/ui/lint/lint-ctypes-enum.rs b/tests/ui/lint/lint-ctypes-enum.rs
index 3157b6e240a..c60290f8553 100644
--- a/tests/ui/lint/lint-ctypes-enum.rs
+++ b/tests/ui/lint/lint-ctypes-enum.rs
@@ -1,6 +1,5 @@
 #![allow(dead_code)]
 #![deny(improper_ctypes)]
-#![feature(generic_nonzero)]
 #![feature(ptr_internals)]
 #![feature(transparent_unions)]
 
diff --git a/tests/ui/lint/lint-ctypes-enum.stderr b/tests/ui/lint/lint-ctypes-enum.stderr
index 48be3eb5a56..103fda8d402 100644
--- a/tests/ui/lint/lint-ctypes-enum.stderr
+++ b/tests/ui/lint/lint-ctypes-enum.stderr
@@ -1,5 +1,5 @@
 error: `extern` block uses type `U`, which is not FFI-safe
-  --> $DIR/lint-ctypes-enum.rs:61:13
+  --> $DIR/lint-ctypes-enum.rs:60:13
    |
 LL |    fn uf(x: U);
    |             ^ not FFI-safe
@@ -7,7 +7,7 @@ LL |    fn uf(x: U);
    = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
    = note: enum has no representation hint
 note: the type is defined here
-  --> $DIR/lint-ctypes-enum.rs:10:1
+  --> $DIR/lint-ctypes-enum.rs:9:1
    |
 LL | enum U {
    | ^^^^^^
@@ -18,7 +18,7 @@ LL | #![deny(improper_ctypes)]
    |         ^^^^^^^^^^^^^^^
 
 error: `extern` block uses type `B`, which is not FFI-safe
-  --> $DIR/lint-ctypes-enum.rs:62:13
+  --> $DIR/lint-ctypes-enum.rs:61:13
    |
 LL |    fn bf(x: B);
    |             ^ not FFI-safe
@@ -26,13 +26,13 @@ LL |    fn bf(x: B);
    = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
    = note: enum has no representation hint
 note: the type is defined here
-  --> $DIR/lint-ctypes-enum.rs:13:1
+  --> $DIR/lint-ctypes-enum.rs:12:1
    |
 LL | enum B {
    | ^^^^^^
 
 error: `extern` block uses type `T`, which is not FFI-safe
-  --> $DIR/lint-ctypes-enum.rs:63:13
+  --> $DIR/lint-ctypes-enum.rs:62:13
    |
 LL |    fn tf(x: T);
    |             ^ not FFI-safe
@@ -40,13 +40,13 @@ LL |    fn tf(x: T);
    = help: consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
    = note: enum has no representation hint
 note: the type is defined here
-  --> $DIR/lint-ctypes-enum.rs:17:1
+  --> $DIR/lint-ctypes-enum.rs:16:1
    |
 LL | enum T {
    | ^^^^^^
 
 error: `extern` block uses type `u128`, which is not FFI-safe
-  --> $DIR/lint-ctypes-enum.rs:75:23
+  --> $DIR/lint-ctypes-enum.rs:74:23
    |
 LL |    fn nonzero_u128(x: Option<num::NonZero<u128>>);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -54,7 +54,7 @@ LL |    fn nonzero_u128(x: Option<num::NonZero<u128>>);
    = note: 128-bit integers don't currently have a known stable ABI
 
 error: `extern` block uses type `i128`, which is not FFI-safe
-  --> $DIR/lint-ctypes-enum.rs:82:23
+  --> $DIR/lint-ctypes-enum.rs:81:23
    |
 LL |    fn nonzero_i128(x: Option<num::NonZero<i128>>);
    |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -62,7 +62,7 @@ LL |    fn nonzero_i128(x: Option<num::NonZero<i128>>);
    = note: 128-bit integers don't currently have a known stable ABI
 
 error: `extern` block uses type `Option<TransparentUnion<NonZero<u8>>>`, which is not FFI-safe
-  --> $DIR/lint-ctypes-enum.rs:87:28
+  --> $DIR/lint-ctypes-enum.rs:86:28
    |
 LL |    fn transparent_union(x: Option<TransparentUnion<num::NonZero<u8>>>);
    |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -71,7 +71,7 @@ LL |    fn transparent_union(x: Option<TransparentUnion<num::NonZero<u8>>>);
    = note: enum has no representation hint
 
 error: `extern` block uses type `Option<Rust<NonZero<u8>>>`, which is not FFI-safe
-  --> $DIR/lint-ctypes-enum.rs:89:20
+  --> $DIR/lint-ctypes-enum.rs:88:20
    |
 LL |    fn repr_rust(x: Option<Rust<num::NonZero<u8>>>);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
@@ -80,7 +80,7 @@ LL |    fn repr_rust(x: Option<Rust<num::NonZero<u8>>>);
    = note: enum has no representation hint
 
 error: `extern` block uses type `Result<(), NonZero<i32>>`, which is not FFI-safe
-  --> $DIR/lint-ctypes-enum.rs:90:20
+  --> $DIR/lint-ctypes-enum.rs:89:20
    |
 LL |    fn no_result(x: Result<(), num::NonZero<i32>>);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not FFI-safe
diff --git a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs
index bda5cef979e..8aa0d04e500 100644
--- a/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-neg-nonzero.rs
@@ -3,7 +3,6 @@
 //@ ignore-emscripten no processes
 //@ compile-flags: -C debug-assertions
 #![allow(arithmetic_overflow)]
-#![feature(generic_nonzero)]
 
 use std::num::NonZero;
 
diff --git a/tests/ui/print_type_sizes/niche-filling.rs b/tests/ui/print_type_sizes/niche-filling.rs
index 07da1cff27a..5dda0da8458 100644
--- a/tests/ui/print_type_sizes/niche-filling.rs
+++ b/tests/ui/print_type_sizes/niche-filling.rs
@@ -15,7 +15,6 @@
 //  ^-- needed because `--pass check` does not emit the output needed.
 //      FIXME: consider using an attribute instead of side-effects.
 #![allow(dead_code)]
-#![feature(generic_nonzero)]
 #![feature(rustc_attrs)]
 
 use std::num::NonZero;
diff --git a/tests/ui/structs-enums/enum-null-pointer-opt.rs b/tests/ui/structs-enums/enum-null-pointer-opt.rs
index a8418943ba4..7a9e1b3c1e4 100644
--- a/tests/ui/structs-enums/enum-null-pointer-opt.rs
+++ b/tests/ui/structs-enums/enum-null-pointer-opt.rs
@@ -1,5 +1,4 @@
 //@ run-pass
-#![feature(generic_nonzero)]
 #![feature(transparent_unions)]
 
 use std::mem::size_of;
diff --git a/tests/ui/structs-enums/enum-null-pointer-opt.stderr b/tests/ui/structs-enums/enum-null-pointer-opt.stderr
index fca62bd1c80..64e93ffaffd 100644
--- a/tests/ui/structs-enums/enum-null-pointer-opt.stderr
+++ b/tests/ui/structs-enums/enum-null-pointer-opt.stderr
@@ -1,5 +1,5 @@
 warning: method `dummy` is never used
-  --> $DIR/enum-null-pointer-opt.rs:11:18
+  --> $DIR/enum-null-pointer-opt.rs:10:18
    |
 LL | trait Trait { fn dummy(&self) { } }
    |       -----      ^^^^^
diff --git a/tests/ui/structs-enums/type-sizes.rs b/tests/ui/structs-enums/type-sizes.rs
index 50491d5ef3e..9c933a9ef1c 100644
--- a/tests/ui/structs-enums/type-sizes.rs
+++ b/tests/ui/structs-enums/type-sizes.rs
@@ -2,7 +2,6 @@
 
 #![allow(non_camel_case_types)]
 #![allow(dead_code)]
-#![feature(generic_nonzero)]
 #![feature(never_type)]
 #![feature(pointer_is_aligned_to)]
 #![feature(strict_provenance)]
diff --git a/tests/ui/suggestions/core-std-import-order-issue-83564.rs b/tests/ui/suggestions/core-std-import-order-issue-83564.rs
index 62b9b246cc8..6f2bdd7a38a 100644
--- a/tests/ui/suggestions/core-std-import-order-issue-83564.rs
+++ b/tests/ui/suggestions/core-std-import-order-issue-83564.rs
@@ -2,7 +2,6 @@
 //
 // This is a regression test for #83564.
 // For some reason, Rust 2018 or higher is required to reproduce the bug.
-#![feature(generic_nonzero)]
 
 fn main() {
     //~^ HELP consider importing one of these items
diff --git a/tests/ui/suggestions/core-std-import-order-issue-83564.stderr b/tests/ui/suggestions/core-std-import-order-issue-83564.stderr
index 56e10b9340c..8665cc6d87c 100644
--- a/tests/ui/suggestions/core-std-import-order-issue-83564.stderr
+++ b/tests/ui/suggestions/core-std-import-order-issue-83564.stderr
@@ -1,5 +1,5 @@
 error[E0433]: failed to resolve: use of undeclared type `NonZero`
-  --> $DIR/core-std-import-order-issue-83564.rs:9:14
+  --> $DIR/core-std-import-order-issue-83564.rs:8:14
    |
 LL |     let _x = NonZero::new(5u32).unwrap();
    |              ^^^^^^^ use of undeclared type `NonZero`
diff --git a/tests/ui/traits/next-solver/specialization-transmute.rs b/tests/ui/traits/next-solver/specialization-transmute.rs
index 17c55fb4d49..caa3bfc552e 100644
--- a/tests/ui/traits/next-solver/specialization-transmute.rs
+++ b/tests/ui/traits/next-solver/specialization-transmute.rs
@@ -1,6 +1,5 @@
 //@ compile-flags: -Znext-solver
 //~^ ERROR cannot normalize `<T as Default>::Id: '_`
-#![feature(generic_nonzero)]
 #![feature(specialization)]
 //~^ WARN the feature `specialization` is incomplete
 
diff --git a/tests/ui/traits/next-solver/specialization-transmute.stderr b/tests/ui/traits/next-solver/specialization-transmute.stderr
index 65e33700325..76ae08fdb7a 100644
--- a/tests/ui/traits/next-solver/specialization-transmute.stderr
+++ b/tests/ui/traits/next-solver/specialization-transmute.stderr
@@ -1,5 +1,5 @@
 warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/specialization-transmute.rs:4:12
+  --> $DIR/specialization-transmute.rs:3:12
    |
 LL | #![feature(specialization)]
    |            ^^^^^^^^^^^^^^
@@ -11,31 +11,31 @@ LL | #![feature(specialization)]
 error: cannot normalize `<T as Default>::Id: '_`
 
 error[E0284]: type annotations needed: cannot satisfy `<T as Default>::Id == _`
-  --> $DIR/specialization-transmute.rs:16:23
+  --> $DIR/specialization-transmute.rs:15:23
    |
 LL |     fn intu(&self) -> &Self::Id {
    |                       ^^^^^^^^^ cannot satisfy `<T as Default>::Id == _`
 
 error[E0284]: type annotations needed: cannot satisfy `T <: <T as Default>::Id`
-  --> $DIR/specialization-transmute.rs:18:9
+  --> $DIR/specialization-transmute.rs:17:9
    |
 LL |         self
    |         ^^^^ cannot satisfy `T <: <T as Default>::Id`
 
 error[E0284]: type annotations needed: cannot satisfy `<u8 as Default>::Id == Option<NonZero<u8>>`
-  --> $DIR/specialization-transmute.rs:29:13
+  --> $DIR/specialization-transmute.rs:28:13
    |
 LL |     let s = transmute::<u8, Option<NonZero<u8>>>(0);
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot satisfy `<u8 as Default>::Id == Option<NonZero<u8>>`
    |
 note: required by a bound in `transmute`
-  --> $DIR/specialization-transmute.rs:22:25
+  --> $DIR/specialization-transmute.rs:21:25
    |
 LL | fn transmute<T: Default<Id = U>, U: Copy>(t: T) -> U {
    |                         ^^^^^^ required by this bound in `transmute`
 
 error[E0282]: type annotations needed
-  --> $DIR/specialization-transmute.rs:14:23
+  --> $DIR/specialization-transmute.rs:13:23
    |
 LL |     default type Id = T;
    |                       ^ cannot infer type for associated type `<T as Default>::Id`