diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 181783441f3ff..a0b3df717672f 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -424,9 +424,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { ast::TyKind::BareFn(ref bare_fn_ty) => { self.check_extern(bare_fn_ty.ext); } - ast::TyKind::Never => { - gate_feature_post!(&self, never_type, ty.span, "the `!` type is experimental"); - } _ => {} } visit::walk_ty(self, ty) diff --git a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs index 4a8375afac3ce..97a3392d66dc3 100644 --- a/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs +++ b/compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs @@ -1,14 +1,11 @@ -#![feature( - no_core, start, lang_items, box_syntax, never_type, linkage, - extern_types, thread_local -)] +#![feature(no_core, start, lang_items, box_syntax, linkage, extern_types, thread_local)] #![no_core] #![allow(dead_code, non_camel_case_types)] extern crate mini_core; -use mini_core::*; use mini_core::libc::*; +use mini_core::*; unsafe extern "C" fn my_puts(s: *const i8) { puts(s); @@ -74,15 +71,17 @@ enum Ordering { } #[lang = "start"] -fn start( - main: fn() -> T, - argc: isize, - argv: *const *const u8, -) -> isize { +fn start(main: fn() -> T, argc: isize, argv: *const *const u8) -> isize { if argc == 3 { - unsafe { puts(*argv as *const i8); } - unsafe { puts(*((argv as usize + intrinsics::size_of::<*const u8>()) as *const *const i8)); } - unsafe { puts(*((argv as usize + 2 * intrinsics::size_of::<*const u8>()) as *const *const i8)); } + unsafe { + puts(*argv as *const i8); + } + unsafe { + puts(*((argv as usize + intrinsics::size_of::<*const u8>()) as *const *const i8)); + } + unsafe { + puts(*((argv as usize + 2 * intrinsics::size_of::<*const u8>()) as *const *const i8)); + } } main().report(); @@ -95,7 +94,7 @@ static NUM_REF: &'static u8 = unsafe { &NUM }; macro_rules! assert { ($e:expr) => { if !$e { - panic(stringify!(! $e)); + panic(stringify!(!$e)); } }; } @@ -105,7 +104,7 @@ macro_rules! assert_eq { if $l != $r { panic(stringify!($l != $r)); } - } + }; } struct Unique { @@ -133,10 +132,7 @@ fn call_return_u128_pair() { } fn main() { - take_unique(Unique { - pointer: 0 as *const (), - _marker: PhantomData, - }); + take_unique(Unique { pointer: 0 as *const (), _marker: PhantomData }); take_f32(0.1); call_return_u128_pair(); @@ -179,15 +175,15 @@ fn main() { assert_eq!(intrinsics::size_of_val(&0u32) as u8, 4); assert_eq!(intrinsics::min_align_of::() as u8, 2); - assert_eq!(intrinsics::min_align_of_val(&a) as u8, intrinsics::min_align_of::<&str>() as u8); + assert_eq!( + intrinsics::min_align_of_val(&a) as u8, + intrinsics::min_align_of::<&str>() as u8 + ); assert!(!intrinsics::needs_drop::()); assert!(intrinsics::needs_drop::()); - Unique { - pointer: 0 as *const &str, - _marker: PhantomData, - } as Unique; + Unique { pointer: 0 as *const &str, _marker: PhantomData } as Unique; struct MyDst(T); @@ -213,19 +209,17 @@ fn main() { } } - let _ = box NoisyDrop { - text: "Boxed outer got dropped!\0", - inner: NoisyDropInner, - } as Box; + let _ = box NoisyDrop { text: "Boxed outer got dropped!\0", inner: NoisyDropInner } + as Box; const FUNC_REF: Option = Some(main); match FUNC_REF { - Some(_) => {}, + Some(_) => {} None => assert!(false), } match Ordering::Less { - Ordering::Less => {}, + Ordering::Less => {} _ => assert!(false), } @@ -241,19 +235,21 @@ fn main() { #[cfg(not(jit))] { - extern { + extern "C" { #[linkage = "extern_weak"] static ABC: *const u8; } { - extern { + extern "C" { #[linkage = "extern_weak"] static ABC: *const u8; } } - unsafe { assert_eq!(ABC as usize, 0); } + unsafe { + assert_eq!(ABC as usize, 0); + } } &mut (|| Some(0 as *const ())) as &mut dyn FnMut() -> Option<*const ()>; @@ -337,13 +333,10 @@ extern "C" { native: *mut pthread_t, attr: *const pthread_attr_t, f: extern "C" fn(_: *mut c_void) -> *mut c_void, - value: *mut c_void + value: *mut c_void, ) -> c_int; - fn pthread_join( - native: pthread_t, - value: *mut *mut c_void - ) -> c_int; + fn pthread_join(native: pthread_t, value: *mut *mut c_void) -> c_int; } #[thread_local] @@ -352,7 +345,9 @@ static mut TLS: u8 = 42; #[cfg(not(jit))] extern "C" fn mutate_tls(_: *mut c_void) -> *mut c_void { - unsafe { TLS = 0; } + unsafe { + TLS = 0; + } 0 as *mut c_void } @@ -402,44 +397,267 @@ pub enum E1 { pub enum E2 { V1 { f: bool }, - /*_00*/ _01(X), _02(X), _03(X), _04(X), _05(X), _06(X), _07(X), - _08(X), _09(X), _0A(X), _0B(X), _0C(X), _0D(X), _0E(X), _0F(X), - _10(X), _11(X), _12(X), _13(X), _14(X), _15(X), _16(X), _17(X), - _18(X), _19(X), _1A(X), _1B(X), _1C(X), _1D(X), _1E(X), _1F(X), - _20(X), _21(X), _22(X), _23(X), _24(X), _25(X), _26(X), _27(X), - _28(X), _29(X), _2A(X), _2B(X), _2C(X), _2D(X), _2E(X), _2F(X), - _30(X), _31(X), _32(X), _33(X), _34(X), _35(X), _36(X), _37(X), - _38(X), _39(X), _3A(X), _3B(X), _3C(X), _3D(X), _3E(X), _3F(X), - _40(X), _41(X), _42(X), _43(X), _44(X), _45(X), _46(X), _47(X), - _48(X), _49(X), _4A(X), _4B(X), _4C(X), _4D(X), _4E(X), _4F(X), - _50(X), _51(X), _52(X), _53(X), _54(X), _55(X), _56(X), _57(X), - _58(X), _59(X), _5A(X), _5B(X), _5C(X), _5D(X), _5E(X), _5F(X), - _60(X), _61(X), _62(X), _63(X), _64(X), _65(X), _66(X), _67(X), - _68(X), _69(X), _6A(X), _6B(X), _6C(X), _6D(X), _6E(X), _6F(X), - _70(X), _71(X), _72(X), _73(X), _74(X), _75(X), _76(X), _77(X), - _78(X), _79(X), _7A(X), _7B(X), _7C(X), _7D(X), _7E(X), _7F(X), - _80(X), _81(X), _82(X), _83(X), _84(X), _85(X), _86(X), _87(X), - _88(X), _89(X), _8A(X), _8B(X), _8C(X), _8D(X), _8E(X), _8F(X), - _90(X), _91(X), _92(X), _93(X), _94(X), _95(X), _96(X), _97(X), - _98(X), _99(X), _9A(X), _9B(X), _9C(X), _9D(X), _9E(X), _9F(X), - _A0(X), _A1(X), _A2(X), _A3(X), _A4(X), _A5(X), _A6(X), _A7(X), - _A8(X), _A9(X), _AA(X), _AB(X), _AC(X), _AD(X), _AE(X), _AF(X), - _B0(X), _B1(X), _B2(X), _B3(X), _B4(X), _B5(X), _B6(X), _B7(X), - _B8(X), _B9(X), _BA(X), _BB(X), _BC(X), _BD(X), _BE(X), _BF(X), - _C0(X), _C1(X), _C2(X), _C3(X), _C4(X), _C5(X), _C6(X), _C7(X), - _C8(X), _C9(X), _CA(X), _CB(X), _CC(X), _CD(X), _CE(X), _CF(X), - _D0(X), _D1(X), _D2(X), _D3(X), _D4(X), _D5(X), _D6(X), _D7(X), - _D8(X), _D9(X), _DA(X), _DB(X), _DC(X), _DD(X), _DE(X), _DF(X), - _E0(X), _E1(X), _E2(X), _E3(X), _E4(X), _E5(X), _E6(X), _E7(X), - _E8(X), _E9(X), _EA(X), _EB(X), _EC(X), _ED(X), _EE(X), _EF(X), - _F0(X), _F1(X), _F2(X), _F3(X), _F4(X), _F5(X), _F6(X), _F7(X), - _F8(X), _F9(X), _FA(X), _FB(X), _FC(X), _FD(X), _FE(X), _FF(X), + /*_00*/ _01(X), + _02(X), + _03(X), + _04(X), + _05(X), + _06(X), + _07(X), + _08(X), + _09(X), + _0A(X), + _0B(X), + _0C(X), + _0D(X), + _0E(X), + _0F(X), + _10(X), + _11(X), + _12(X), + _13(X), + _14(X), + _15(X), + _16(X), + _17(X), + _18(X), + _19(X), + _1A(X), + _1B(X), + _1C(X), + _1D(X), + _1E(X), + _1F(X), + _20(X), + _21(X), + _22(X), + _23(X), + _24(X), + _25(X), + _26(X), + _27(X), + _28(X), + _29(X), + _2A(X), + _2B(X), + _2C(X), + _2D(X), + _2E(X), + _2F(X), + _30(X), + _31(X), + _32(X), + _33(X), + _34(X), + _35(X), + _36(X), + _37(X), + _38(X), + _39(X), + _3A(X), + _3B(X), + _3C(X), + _3D(X), + _3E(X), + _3F(X), + _40(X), + _41(X), + _42(X), + _43(X), + _44(X), + _45(X), + _46(X), + _47(X), + _48(X), + _49(X), + _4A(X), + _4B(X), + _4C(X), + _4D(X), + _4E(X), + _4F(X), + _50(X), + _51(X), + _52(X), + _53(X), + _54(X), + _55(X), + _56(X), + _57(X), + _58(X), + _59(X), + _5A(X), + _5B(X), + _5C(X), + _5D(X), + _5E(X), + _5F(X), + _60(X), + _61(X), + _62(X), + _63(X), + _64(X), + _65(X), + _66(X), + _67(X), + _68(X), + _69(X), + _6A(X), + _6B(X), + _6C(X), + _6D(X), + _6E(X), + _6F(X), + _70(X), + _71(X), + _72(X), + _73(X), + _74(X), + _75(X), + _76(X), + _77(X), + _78(X), + _79(X), + _7A(X), + _7B(X), + _7C(X), + _7D(X), + _7E(X), + _7F(X), + _80(X), + _81(X), + _82(X), + _83(X), + _84(X), + _85(X), + _86(X), + _87(X), + _88(X), + _89(X), + _8A(X), + _8B(X), + _8C(X), + _8D(X), + _8E(X), + _8F(X), + _90(X), + _91(X), + _92(X), + _93(X), + _94(X), + _95(X), + _96(X), + _97(X), + _98(X), + _99(X), + _9A(X), + _9B(X), + _9C(X), + _9D(X), + _9E(X), + _9F(X), + _A0(X), + _A1(X), + _A2(X), + _A3(X), + _A4(X), + _A5(X), + _A6(X), + _A7(X), + _A8(X), + _A9(X), + _AA(X), + _AB(X), + _AC(X), + _AD(X), + _AE(X), + _AF(X), + _B0(X), + _B1(X), + _B2(X), + _B3(X), + _B4(X), + _B5(X), + _B6(X), + _B7(X), + _B8(X), + _B9(X), + _BA(X), + _BB(X), + _BC(X), + _BD(X), + _BE(X), + _BF(X), + _C0(X), + _C1(X), + _C2(X), + _C3(X), + _C4(X), + _C5(X), + _C6(X), + _C7(X), + _C8(X), + _C9(X), + _CA(X), + _CB(X), + _CC(X), + _CD(X), + _CE(X), + _CF(X), + _D0(X), + _D1(X), + _D2(X), + _D3(X), + _D4(X), + _D5(X), + _D6(X), + _D7(X), + _D8(X), + _D9(X), + _DA(X), + _DB(X), + _DC(X), + _DD(X), + _DE(X), + _DF(X), + _E0(X), + _E1(X), + _E2(X), + _E3(X), + _E4(X), + _E5(X), + _E6(X), + _E7(X), + _E8(X), + _E9(X), + _EA(X), + _EB(X), + _EC(X), + _ED(X), + _EE(X), + _EF(X), + _F0(X), + _F1(X), + _F2(X), + _F3(X), + _F4(X), + _F5(X), + _F6(X), + _F7(X), + _F8(X), + _F9(X), + _FA(X), + _FB(X), + _FC(X), + _FD(X), + _FE(X), + _FF(X), V3, V4, } -fn check_niche_behavior () { +fn check_niche_behavior() { if let E1::V2 { .. } = (E1::V1 { f: true }) { intrinsics::abort(); } diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 4401ec0a04ea5..a9106eeb94eb0 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -273,6 +273,10 @@ declare_features! ( /// Allows patterns with concurrent by-move and by-ref bindings. /// For example, you can write `Foo(a, ref b)` where `a` is by-move and `b` is by-ref. (accepted, move_ref_pattern, "1.48.0", Some(68354), None), + /// Allows the `!` type. Does not imply 'exhaustive_patterns' (below) any more. + (accepted, never_type, "1.49.0", Some(35121), None), + /// Allows diverging expressions to fall back to `!` rather than `()`. + (accepted, never_type_fallback, "1.49.0", Some(65992), None), // ------------------------------------------------------------------------- // feature-group-end: accepted features diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index a035507924794..8fc28f61d956e 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -323,9 +323,6 @@ declare_features! ( /// Allows `X..Y` patterns. (active, exclusive_range_pattern, "1.11.0", Some(37854), None), - /// Allows the `!` type. Does not imply 'exhaustive_patterns' (below) any more. - (active, never_type, "1.13.0", Some(35121), None), - /// Allows exhaustive pattern matching on types that contain uninhabited types. (active, exhaustive_patterns, "1.13.0", Some(51085), None), @@ -510,9 +507,6 @@ declare_features! ( /// Allows `&raw const $place_expr` and `&raw mut $place_expr` expressions. (active, raw_ref_op, "1.41.0", Some(64490), None), - /// Allows diverging expressions to fall back to `!` rather than `()`. - (active, never_type_fallback, "1.41.0", Some(65992), None), - /// Allows using the `#[register_attr]` attribute. (active, register_attr, "1.41.0", Some(66080), None), diff --git a/compiler/rustc_infer/src/lib.rs b/compiler/rustc_infer/src/lib.rs index 3690a88c0d973..d1bdd5dc1a27d 100644 --- a/compiler/rustc_infer/src/lib.rs +++ b/compiler/rustc_infer/src/lib.rs @@ -19,7 +19,7 @@ #![feature(const_fn)] #![feature(const_panic)] #![feature(extend_one)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(or_patterns)] #![feature(in_band_lifetimes)] #![feature(control_flow_enum)] diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs index 24bfdad970a1c..0c6f939ab051f 100644 --- a/compiler/rustc_lint/src/lib.rs +++ b/compiler/rustc_lint/src/lib.rs @@ -32,7 +32,7 @@ #![feature(box_syntax)] #![feature(crate_visibility_modifier)] #![feature(iter_order_by)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(nll)] #![feature(or_patterns)] #![feature(half_open_range_patterns)] diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index 77766be7397c7..fb95ca62ce37d 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -11,7 +11,7 @@ #![feature(min_specialization)] #![feature(stmt_expr_attributes)] #![feature(try_blocks)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![recursion_limit = "256"] extern crate proc_macro; diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index cdc5940d9baed..ddab25bdf13a2 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -34,7 +34,7 @@ #![feature(const_panic)] #![feature(core_intrinsics)] #![feature(discriminant_kind)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(extern_types)] #![feature(nll)] #![feature(once_cell)] diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 36cbd36a7705f..6924fa5760dfa 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -2281,7 +2281,7 @@ impl<'tcx> TyCtxt<'tcx> { #[inline] pub fn mk_diverging_default(self) -> Ty<'tcx> { - if self.features().never_type_fallback { self.types.never } else { self.types.unit } + self.types.never } #[inline] diff --git a/compiler/rustc_mir/src/lib.rs b/compiler/rustc_mir/src/lib.rs index 2ed115b12971c..8cd0463716ae4 100644 --- a/compiler/rustc_mir/src/lib.rs +++ b/compiler/rustc_mir/src/lib.rs @@ -17,7 +17,7 @@ Rust MIR: a lowered representation of Rust. #![feature(decl_macro)] #![feature(exact_size_is_empty)] #![feature(exhaustive_patterns)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(min_specialization)] #![feature(trusted_len)] #![feature(try_blocks)] diff --git a/compiler/rustc_serialize/src/lib.rs b/compiler/rustc_serialize/src/lib.rs index fab29f29e8730..0ac2425844aea 100644 --- a/compiler/rustc_serialize/src/lib.rs +++ b/compiler/rustc_serialize/src/lib.rs @@ -10,7 +10,7 @@ Core encoding and decoding interfaces. test(attr(allow(unused_variables), deny(warnings))) )] #![feature(box_syntax)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(nll)] #![feature(associated_type_bounds)] #![feature(min_const_generics)] diff --git a/compiler/rustc_symbol_mangling/src/lib.rs b/compiler/rustc_symbol_mangling/src/lib.rs index 10245d21b63a5..feddabaf28891 100644 --- a/compiler/rustc_symbol_mangling/src/lib.rs +++ b/compiler/rustc_symbol_mangling/src/lib.rs @@ -88,7 +88,7 @@ //! DefPaths which are much more robust in the face of changes to the code base. #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(nll)] #![feature(or_patterns)] #![feature(in_band_lifetimes)] diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs index fb747dfcbd337..70d33fe82211a 100644 --- a/compiler/rustc_target/src/lib.rs +++ b/compiler/rustc_target/src/lib.rs @@ -12,7 +12,7 @@ #![feature(const_fn)] #![feature(const_panic)] #![feature(nll)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(associated_type_bounds)] #![feature(exhaustive_patterns)] diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index 42509cd897582..b7593c29a5c01 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -16,7 +16,7 @@ #![feature(box_patterns)] #![feature(drain_filter)] #![feature(in_band_lifetimes)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(crate_visibility_modifier)] #![feature(or_patterns)] #![feature(control_flow_enum)] diff --git a/compiler/rustc_typeck/src/check/fallback.rs b/compiler/rustc_typeck/src/check/fallback.rs index 1bb11334a5757..cf04dbca1ab96 100644 --- a/compiler/rustc_typeck/src/check/fallback.rs +++ b/compiler/rustc_typeck/src/check/fallback.rs @@ -72,8 +72,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> { // - Unconstrained floats are replaced with with `f64`. // // - Non-numerics may get replaced with `()` or `!`, depending on - // how they were categorized by `calculate_diverging_fallback` - // (and the setting of `#![feature(never_type_fallback)]`). + // how they were categorized by `calculate_diverging_fallback`. // // Fallback becomes very dubious if we have encountered // type-checking errors. In that case, fallback to Error. diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs index 929c88455f041..896367bb2cad2 100644 --- a/compiler/rustc_typeck/src/lib.rs +++ b/compiler/rustc_typeck/src/lib.rs @@ -65,7 +65,7 @@ This API is completely unstable and subject to change. #![feature(nll)] #![feature(or_patterns)] #![feature(try_blocks)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(slice_partition_dedup)] #![feature(control_flow_enum)] #![recursion_limit = "256"] diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index f21fc8854d05e..76f8512f87bbf 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -109,7 +109,7 @@ #![feature(layout_for_ptr)] #![feature(maybe_uninit_ref)] #![feature(negative_impls)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(nll)] #![feature(nonnull_slice_from_raw_parts)] #![feature(optin_builtin_traits)] diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index a953a3a4182bc..de8bb15495bb7 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -193,7 +193,7 @@ mod impls { bool char } - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "1.49.0")] impl Clone for ! { #[inline] fn clone(&self) -> Self { diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index bbb3a3dea435e..e70d6d814ce5d 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -1189,24 +1189,24 @@ mod impls { ord_impl! { char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "1.49.0")] impl PartialEq for ! { fn eq(&self, _: &!) -> bool { *self } } - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "1.49.0")] impl Eq for ! {} - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "1.49.0")] impl PartialOrd for ! { fn partial_cmp(&self, _: &!) -> Option { *self } } - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "1.49.0")] impl Ord for ! { fn cmp(&self, _: &!) -> Ordering { *self diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index 506d778068682..03db55306453b 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -1991,14 +1991,14 @@ macro_rules! fmt_refs { fmt_refs! { Debug, Display, Octal, Binary, LowerHex, UpperHex, LowerExp, UpperExp } -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "1.49.0")] impl Debug for ! { fn fmt(&self, _: &mut Formatter<'_>) -> Result { *self } } -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "1.49.0")] impl Display for ! { fn fmt(&self, _: &mut Formatter<'_>) -> Result { *self diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index d67f9c15a1916..cfae920e9c793 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -115,7 +115,7 @@ #![feature(link_llvm_intrinsics)] #![feature(llvm_asm)] #![feature(negative_impls)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(nll)] #![feature(exhaustive_patterns)] #![feature(no_core)] diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index cdf742057b7b6..ee46d78e6ad53 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -815,7 +815,7 @@ mod copy_impls { bool char } - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "1.49.0")] impl Copy for ! {} #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index e84014c68a676..c6d4703205e1c 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1018,7 +1018,6 @@ pub const fn discriminant(v: &T) -> Discriminant { /// # Examples /// /// ``` -/// # #![feature(never_type)] /// # #![feature(variant_count)] /// /// use std::mem; diff --git a/library/core/src/num/error.rs b/library/core/src/num/error.rs index 9d8c8c862911c..a42fc6feb16be 100644 --- a/library/core/src/num/error.rs +++ b/library/core/src/num/error.rs @@ -35,7 +35,7 @@ impl From for TryFromIntError { } } -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "1.49.0")] impl From for TryFromIntError { fn from(never: !) -> TryFromIntError { // Match rather than coerce to make sure that code like diff --git a/library/core/src/result.rs b/library/core/src/result.rs index b6d9f13d881e3..f439b7c32ec4b 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -1086,7 +1086,6 @@ impl> Result { /// Basic usage: /// /// ``` - /// # #![feature(never_type)] /// # #![feature(unwrap_infallible)] /// /// fn only_good_news() -> Result { diff --git a/library/core/tests/lib.rs b/library/core/tests/lib.rs index 14ef03fd53eba..a0a1d74eb3f94 100644 --- a/library/core/tests/lib.rs +++ b/library/core/tests/lib.rs @@ -52,7 +52,7 @@ #![feature(const_pin)] #![feature(const_slice_from_raw_parts)] #![feature(const_raw_ptr_deref)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(unwrap_infallible)] #![feature(option_unwrap_none)] #![feature(peekable_next_if)] diff --git a/library/std/src/error.rs b/library/std/src/error.rs index 0044e59d697e3..6e6a1b76fd755 100644 --- a/library/std/src/error.rs +++ b/library/std/src/error.rs @@ -379,7 +379,7 @@ impl<'a> From> for Box { } } -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "1.49.0")] impl Error for ! {} #[unstable( diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index db523f05e01a5..ce6a604c191dc 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -284,7 +284,7 @@ #![feature(min_specialization)] #![feature(needs_panic_runtime)] #![feature(negative_impls)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(nll)] #![feature(nonnull_slice_from_raw_parts)] #![feature(once_cell)] diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index 83a282c8cd6b5..a86058b914069 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -69,7 +69,6 @@ mod prim_bool {} /// write: /// /// ``` -/// #![feature(never_type)] /// # fn foo() -> u32 { /// let x: ! = { /// return 123 @@ -231,7 +230,6 @@ mod prim_bool {} /// for example: /// /// ``` -/// #![feature(never_type)] /// # use std::fmt; /// # trait Debug { /// # fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result; @@ -267,7 +265,7 @@ mod prim_bool {} /// [`Debug`]: fmt::Debug /// [`default()`]: Default::default /// -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "1.49.0")] mod prim_never {} #[doc(primitive = "char")] diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index a88efba77b41c..6e274e1d6e891 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -12,7 +12,7 @@ #![feature(peekable_next_if)] #![feature(test)] #![feature(crate_visibility_modifier)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(once_cell)] #![recursion_limit = "256"] diff --git a/src/test/codegen/enum-debug-niche-2.rs b/src/test/codegen/enum-debug-niche-2.rs index 0f78234d9774d..cd6207ab7eefa 100644 --- a/src/test/codegen/enum-debug-niche-2.rs +++ b/src/test/codegen/enum-debug-niche-2.rs @@ -10,8 +10,6 @@ // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i64 4294967295{{[,)].*}} // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}} -#![feature(never_type)] - #[derive(Copy, Clone)] pub struct Entity { private: std::num::NonZeroU32, diff --git a/src/test/mir-opt/issue-72181-1.rs b/src/test/mir-opt/issue-72181-1.rs index 91e98adbe8049..336a21a3a83e3 100644 --- a/src/test/mir-opt/issue-72181-1.rs +++ b/src/test/mir-opt/issue-72181-1.rs @@ -1,7 +1,6 @@ // compile-flags: -Z mir-opt-level=1 // Regression test for #72181, this ICE requires `-Z mir-opt-level=1` flags. -#![feature(never_type)] #![allow(unused, invalid_value)] enum Void {} @@ -13,9 +12,7 @@ fn f(v: Void) -> ! { // EMIT_MIR issue_72181_1.main.mir_map.0.mir fn main() { - let v: Void = unsafe { - std::mem::transmute::<(), Void>(()) - }; + let v: Void = unsafe { std::mem::transmute::<(), Void>(()) }; f(v); } diff --git a/src/test/mir-opt/remove-never-const.rs b/src/test/mir-opt/remove-never-const.rs index 1673f14b45ce4..fddbbd5965358 100644 --- a/src/test/mir-opt/remove-never-const.rs +++ b/src/test/mir-opt/remove-never-const.rs @@ -6,7 +6,6 @@ // compile-flags: --emit mir,link #![feature(const_panic)] -#![feature(never_type)] #![warn(const_err)] struct PrintName(T); diff --git a/src/test/mir-opt/uninhabited-enum.rs b/src/test/mir-opt/uninhabited-enum.rs index 97c6e8cd53111..b7aa029004b9a 100644 --- a/src/test/mir-opt/uninhabited-enum.rs +++ b/src/test/mir-opt/uninhabited-enum.rs @@ -1,19 +1,17 @@ -#![feature(never_type)] - pub enum Void {} // EMIT_MIR uninhabited_enum.process_never.SimplifyLocals.after.mir #[no_mangle] pub fn process_never(input: *const !) { - let _input = unsafe { &*input }; + let _input = unsafe { &*input }; } // EMIT_MIR uninhabited_enum.process_void.SimplifyLocals.after.mir #[no_mangle] pub fn process_void(input: *const Void) { - let _input = unsafe { &*input }; - // In the future, this should end with `unreachable`, but we currently only do - // unreachability analysis for `!`. + let _input = unsafe { &*input }; + // In the future, this should end with `unreachable`, but we currently only do + // unreachability analysis for `!`. } fn main() {} diff --git a/src/test/ui/borrowck/assign-never-type.rs b/src/test/ui/borrowck/assign-never-type.rs index 4f30ea1467023..3309a72ff1d6f 100644 --- a/src/test/ui/borrowck/assign-never-type.rs +++ b/src/test/ui/borrowck/assign-never-type.rs @@ -2,13 +2,11 @@ // check-pass -#![feature(never_type)] - pub fn main() { loop { match None { None => return, Some(val) => val, }; - }; + } } diff --git a/src/test/ui/break-diverging-value.rs b/src/test/ui/break-diverging-value.rs index d070fddaffc19..ea86971ea813a 100644 --- a/src/test/ui/break-diverging-value.rs +++ b/src/test/ui/break-diverging-value.rs @@ -1,19 +1,29 @@ -#![feature(never_type)] - fn loop_break_return() -> i32 { - let loop_value = loop { break return 0 }; // ok + let loop_value = loop { + break return 0; + }; // ok } fn loop_break_loop() -> i32 { - let loop_value = loop { break loop {} }; // ok + let loop_value = loop { + break loop {}; + }; // ok } -fn loop_break_break() -> i32 { //~ ERROR mismatched types - let loop_value = loop { break break }; +fn loop_break_break() -> i32 { + //~ ERROR mismatched types + let loop_value = loop { + break break; + }; } fn loop_break_return_2() -> i32 { - let loop_value = loop { break { return 0; () } }; // ok + let loop_value = loop { + break { + return 0; + () + }; + }; // ok } enum Void {} @@ -22,8 +32,11 @@ fn get_void() -> Void { panic!() } -fn loop_break_void() -> i32 { //~ ERROR mismatched types - let loop_value = loop { break get_void() }; +fn loop_break_void() -> i32 { + //~ ERROR mismatched types + let loop_value = loop { + break get_void(); + }; } fn get_never() -> ! { @@ -31,7 +44,9 @@ fn get_never() -> ! { } fn loop_break_never() -> i32 { - let loop_value = loop { break get_never() }; // ok + let loop_value = loop { + break get_never(); + }; // ok } fn main() {} diff --git a/src/test/ui/break-while-condition.rs b/src/test/ui/break-while-condition.rs index 6064e6ab00235..06a611d752309 100644 --- a/src/test/ui/break-while-condition.rs +++ b/src/test/ui/break-while-condition.rs @@ -1,28 +1,29 @@ -#![feature(never_type)] - fn main() { // The `if false` expressions are simply to // make sure we don't avoid checking everything // simply because a few expressions are unreachable. if false { - let _: ! = { //~ ERROR mismatched types - 'a: while break 'a {}; + let _: ! = { + //~ ERROR mismatched types + 'a: while break 'a {} }; } if false { let _: ! = { - while false { //~ ERROR mismatched types - break + while false { + //~ ERROR mismatched types + break; } }; } if false { let _: ! = { - while false { //~ ERROR mismatched types - return + while false { + //~ ERROR mismatched types + return; } }; } diff --git a/src/test/ui/coercion/coerce-to-bang-cast.rs b/src/test/ui/coercion/coerce-to-bang-cast.rs index 85598a42eccd9..9ec72c46d88be 100644 --- a/src/test/ui/coercion/coerce-to-bang-cast.rs +++ b/src/test/ui/coercion/coerce-to-bang-cast.rs @@ -1,7 +1,8 @@ -#![feature(never_type)] - fn cast_a() { - let y = {return; 22} as !; + let y = { + return; + 22 + } as !; //~^ ERROR non-primitive cast } @@ -9,4 +10,4 @@ fn cast_b() { let y = 22 as !; //~ ERROR non-primitive cast } -fn main() { } +fn main() {} diff --git a/src/test/ui/coercion/coerce-to-bang.rs b/src/test/ui/coercion/coerce-to-bang.rs index 1e06934d09f9e..d52f79fbb7a98 100644 --- a/src/test/ui/coercion/coerce-to-bang.rs +++ b/src/test/ui/coercion/coerce-to-bang.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - fn foo(x: usize, y: !, z: usize) { } fn call_foo_a() { diff --git a/src/test/ui/const-generics/min_const_generics/complex-types.rs b/src/test/ui/const-generics/min_const_generics/complex-types.rs index 2aaf2c3987558..29f58c29dfb48 100644 --- a/src/test/ui/const-generics/min_const_generics/complex-types.rs +++ b/src/test/ui/const-generics/min_const_generics/complex-types.rs @@ -1,5 +1,4 @@ #![feature(min_const_generics)] -#![feature(never_type)] struct Foo; //~^ ERROR `[u8; 0]` is forbidden @@ -18,11 +17,15 @@ struct Faz; struct Fiz; //~^ ERROR `!` is forbidden -enum Goo { A, B } +enum Goo { + A, + B, +} //~^ ERROR `()` is forbidden -union Boo { a: () } +union Boo { + a: (), +} //~^ ERROR `()` is forbidden - fn main() {} diff --git a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs index 795c5154f8155..d3ade5a08b230 100644 --- a/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs +++ b/src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs @@ -2,14 +2,15 @@ // Regression test for #66975 #![warn(const_err, unconditional_panic)] -#![feature(never_type)] struct PrintName(T); impl PrintName { - const VOID: ! = { let x = 0 * std::mem::size_of::(); [][x] }; + const VOID: ! = { + let x = 0 * std::mem::size_of::(); + [][x] + }; //~^ WARN any use of this value will cause an error - } fn f() { diff --git a/src/test/ui/consts/const-eval/panic-assoc-never-type.rs b/src/test/ui/consts/const-eval/panic-assoc-never-type.rs index 21ee64fa6d937..8c0ac868d4392 100644 --- a/src/test/ui/consts/const-eval/panic-assoc-never-type.rs +++ b/src/test/ui/consts/const-eval/panic-assoc-never-type.rs @@ -3,7 +3,6 @@ // Regression test for #66975 #![warn(const_err)] #![feature(const_panic)] -#![feature(never_type)] struct PrintName; diff --git a/src/test/ui/consts/const-eval/panic-never-type.rs b/src/test/ui/consts/const-eval/panic-never-type.rs index 3b28b2fdd247e..f248a787ededa 100644 --- a/src/test/ui/consts/const-eval/panic-never-type.rs +++ b/src/test/ui/consts/const-eval/panic-never-type.rs @@ -3,7 +3,6 @@ // Regression test for #66975 #![warn(const_err)] #![feature(const_panic)] -#![feature(never_type)] const VOID: ! = panic!(); //~^ WARN any use of this value will cause an error diff --git a/src/test/ui/consts/const-eval/ub-enum.rs b/src/test/ui/consts/const-eval/ub-enum.rs index dc94f2368c9b6..fab021c1c1293 100644 --- a/src/test/ui/consts/const-eval/ub-enum.rs +++ b/src/test/ui/consts/const-eval/ub-enum.rs @@ -1,5 +1,4 @@ // normalize-stderr-64bit "0x0000000000" -> "0x00" -#![feature(never_type)] #![allow(const_err)] // make sure we cannot allow away the errors tested here use std::mem; @@ -53,7 +52,7 @@ union MaybeUninit { uninit: (), init: T, } -const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init }; +const BAD_ENUM2_UNDEF: Enum2 = unsafe { MaybeUninit { uninit: () }.init }; //~^ ERROR is undefined behavior // Pointer value in an enum with a niche that is not just 0. @@ -94,5 +93,4 @@ const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem: const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) }; //~^ ERROR is undefined behavior -fn main() { -} +fn main() {} diff --git a/src/test/ui/consts/const-variant-count.rs b/src/test/ui/consts/const-variant-count.rs index 455419d2c7f1d..f21f6e9c29168 100644 --- a/src/test/ui/consts/const-variant-count.rs +++ b/src/test/ui/consts/const-variant-count.rs @@ -1,7 +1,6 @@ // run-pass #![allow(dead_code)] #![feature(variant_count)] -#![feature(never_type)] use std::mem::variant_count; diff --git a/src/test/ui/empty/empty-never-array.rs b/src/test/ui/empty/empty-never-array.rs index 01b99134a445f..a5024449d91d9 100644 --- a/src/test/ui/empty/empty-never-array.rs +++ b/src/test/ui/empty/empty-never-array.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - enum Helper { T(T, [!; 0]), #[allow(dead_code)] diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs index f0cc9ea70550e..c27089d2a0590 100644 --- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs +++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - fn foo() -> Result { Ok(123) } diff --git a/src/test/ui/feature-gates/feature-gate-never_type.rs b/src/test/ui/feature-gates/feature-gate-never_type.rs deleted file mode 100644 index be8c27dbb1b02..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-never_type.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Test that ! errors when used in illegal positions with feature(never_type) disabled - -trait Foo { - type Wub; -} - -type Ma = (u32, !, i32); //~ ERROR type is experimental -type Meeshka = Vec; //~ ERROR type is experimental -type Mow = &'static fn(!) -> !; //~ ERROR type is experimental -type Skwoz = &'static mut !; //~ ERROR type is experimental - -impl Foo for Meeshka { - type Wub = !; //~ ERROR type is experimental -} - -fn main() { -} diff --git a/src/test/ui/feature-gates/feature-gate-never_type.stderr b/src/test/ui/feature-gates/feature-gate-never_type.stderr deleted file mode 100644 index 0a59cae9c8c46..0000000000000 --- a/src/test/ui/feature-gates/feature-gate-never_type.stderr +++ /dev/null @@ -1,48 +0,0 @@ -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:7:17 - | -LL | type Ma = (u32, !, i32); - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:8:20 - | -LL | type Meeshka = Vec; - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:9:24 - | -LL | type Mow = &'static fn(!) -> !; - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:10:27 - | -LL | type Skwoz = &'static mut !; - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:13:16 - | -LL | type Wub = !; - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/for-loop-while/loop-break-value.rs b/src/test/ui/for-loop-while/loop-break-value.rs index d7209fc4de867..eee214406bf33 100644 --- a/src/test/ui/for-loop-while/loop-break-value.rs +++ b/src/test/ui/for-loop-while/loop-break-value.rs @@ -1,7 +1,6 @@ // run-pass #![allow(unreachable_code)] -#![feature(never_type)] #[allow(unused)] fn never_returns() { @@ -18,7 +17,7 @@ pub fn main() { let _never: ! = loop { break loop { break 'outer panic!(); - } + }; }; } }; @@ -38,29 +37,21 @@ pub fn main() { assert_eq!(coerced, &[17u32]); let trait_unified = loop { - break if true { - break Default::default() - } else { - break [13, 14] - }; + break if true { break Default::default() } else { break [13, 14] }; }; assert_eq!(trait_unified, [0, 0]); let trait_unified_2 = loop { if false { - break [String::from("Hello")] + break [String::from("Hello")]; } else { - break Default::default() + break Default::default(); }; }; assert_eq!(trait_unified_2, [""]); let trait_unified_3 = loop { - break if false { - break [String::from("Hello")] - } else { - ["Yes".into()] - }; + break if false { break [String::from("Hello")] } else { ["Yes".into()] }; }; assert_eq!(trait_unified_3, ["Yes"]); @@ -87,7 +78,7 @@ pub fn main() { Default::default() } else { break; - } + }; }; assert_eq!(regular_break_3, ()); diff --git a/src/test/ui/lint/must_use-unit.rs b/src/test/ui/lint/must_use-unit.rs index 4dd4798abb7ce..8f59bab26d3ef 100644 --- a/src/test/ui/lint/must_use-unit.rs +++ b/src/test/ui/lint/must_use-unit.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![deny(unused_must_use)] #[must_use] diff --git a/src/test/ui/loops/loop-break-value.rs b/src/test/ui/loops/loop-break-value.rs index 6c4160c36aa39..219c7604c8c50 100644 --- a/src/test/ui/loops/loop-break-value.rs +++ b/src/test/ui/loops/loop-break-value.rs @@ -1,7 +1,7 @@ -#![feature(never_type)] - fn main() { - let val: ! = loop { break break; }; + let val: ! = loop { + break break; + }; //~^ ERROR mismatched types loop { @@ -10,7 +10,7 @@ fn main() { } else { break 123; //~ ERROR mismatched types } - }; + } let _: i32 = loop { break "asdf"; //~ ERROR mismatched types @@ -20,10 +20,11 @@ fn main() { loop { break 'outer_loop "nope"; //~ ERROR mismatched types break "ok"; - }; + } }; - 'while_loop: while true { //~ WARN denote infinite loops with + 'while_loop: while true { + //~ WARN denote infinite loops with break; break (); //~ ERROR `break` with value from a `while` loop loop { @@ -31,7 +32,7 @@ fn main() { //~^ ERROR `break` with value from a `while` loop break 456; break 789; - }; + } } while let Some(_) = Some(()) { @@ -49,21 +50,21 @@ fn main() { break 'while_let_loop "nope"; //~^ ERROR `break` with value from a `while` loop break 33; - }; + } } - for _ in &[1,2,3] { + for _ in &[1, 2, 3] { break (); //~ ERROR `break` with value from a `for` loop break [()]; //~^ ERROR `break` with value from a `for` loop } - 'for_loop: for _ in &[1,2,3] { + 'for_loop: for _ in &[1, 2, 3] { loop { break Some(3); break 'for_loop Some(17); //~^ ERROR `break` with value from a `for` loop - }; + } } let _: i32 = 'a: loop { @@ -78,16 +79,16 @@ fn main() { loop { break (break, break); //~ ERROR mismatched types - }; + } loop { break; break 2; //~ ERROR mismatched types - }; + } loop { break 2; break; //~ ERROR mismatched types break 4; - }; + } } diff --git a/src/test/ui/mir/mir_calls_to_shims.rs b/src/test/ui/mir/mir_calls_to_shims.rs index 6f13d5612ce51..189fa87601d18 100644 --- a/src/test/ui/mir/mir_calls_to_shims.rs +++ b/src/test/ui/mir/mir_calls_to_shims.rs @@ -2,15 +2,19 @@ // ignore-wasm32-bare compiled with panic=abort by default #![feature(fn_traits)] -#![feature(never_type)] use std::panic; -fn foo(x: u32, y: u32) -> u32 { x/y } -fn foo_diverges() -> ! { panic!() } +fn foo(x: u32, y: u32) -> u32 { + x / y +} +fn foo_diverges() -> ! { + panic!() +} fn test_fn_ptr(mut t: T) - where T: Fn(u32, u32) -> u32, +where + T: Fn(u32, u32) -> u32, { let as_fn = >::call; assert_eq!(as_fn(&t, (9, 3)), 3); @@ -20,18 +24,20 @@ fn test_fn_ptr(mut t: T) assert_eq!(as_fn_once(t, (24, 3)), 8); } -fn assert_panics(f: F) where F: FnOnce() { +fn assert_panics(f: F) +where + F: FnOnce(), +{ let f = panic::AssertUnwindSafe(f); - let result = panic::catch_unwind(move || { - f.0() - }); + let result = panic::catch_unwind(move || f.0()); if let Ok(..) = result { panic!("diverging function returned"); } } fn test_fn_ptr_panic(mut t: T) - where T: Fn() -> ! +where + T: Fn() -> !, { let as_fn = >::call; assert_panics(|| as_fn(&t, ())); diff --git a/src/test/ui/never_type/adjust_never.rs b/src/test/ui/never_type/adjust_never.rs index 0d7d2c0ed3fa9..e4d15c8a17dfa 100644 --- a/src/test/ui/never_type/adjust_never.rs +++ b/src/test/ui/never_type/adjust_never.rs @@ -2,8 +2,6 @@ // check-pass -#![feature(never_type)] - fn main() { let x: ! = panic!(); let y: u32 = x; diff --git a/src/test/ui/never_type/auto-traits.rs b/src/test/ui/never_type/auto-traits.rs index 84c8db4053e4f..ee801e1c5bf60 100644 --- a/src/test/ui/never_type/auto-traits.rs +++ b/src/test/ui/never_type/auto-traits.rs @@ -2,7 +2,6 @@ #![feature(optin_builtin_traits)] #![feature(negative_impls)] -#![feature(never_type)] fn main() { enum Void {} diff --git a/src/test/ui/never_type/call-fn-never-arg-wrong-type.rs b/src/test/ui/never_type/call-fn-never-arg-wrong-type.rs index d06637e74a2f2..a2b44e91f1141 100644 --- a/src/test/ui/never_type/call-fn-never-arg-wrong-type.rs +++ b/src/test/ui/never_type/call-fn-never-arg-wrong-type.rs @@ -1,7 +1,5 @@ // Test that we can't pass other types for ! -#![feature(never_type)] - fn foo(x: !) -> ! { x } diff --git a/src/test/ui/never_type/call-fn-never-arg.rs b/src/test/ui/never_type/call-fn-never-arg.rs index 9d355817ee80d..55a7b79157a82 100644 --- a/src/test/ui/never_type/call-fn-never-arg.rs +++ b/src/test/ui/never_type/call-fn-never-arg.rs @@ -2,7 +2,6 @@ // check-pass -#![feature(never_type)] #![allow(unreachable_code)] fn foo(x: !) -> ! { diff --git a/src/test/ui/never_type/cast-never.rs b/src/test/ui/never_type/cast-never.rs index 0139ebe4640be..fbba114ab3274 100644 --- a/src/test/ui/never_type/cast-never.rs +++ b/src/test/ui/never_type/cast-never.rs @@ -2,8 +2,6 @@ // check-pass -#![feature(never_type)] - fn main() { let x: ! = panic!(); let y: u32 = x as u32; diff --git a/src/test/ui/never_type/impl-for-never.rs b/src/test/ui/never_type/impl-for-never.rs index 9423f08858b9b..cbfda9a2cc00a 100644 --- a/src/test/ui/never_type/impl-for-never.rs +++ b/src/test/ui/never_type/impl-for-never.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(never_type)] - // Test that we can call static methods on ! both directly and when it appears in a generic trait StringifyType { diff --git a/src/test/ui/never_type/issue-44402.rs b/src/test/ui/never_type/issue-44402.rs index 699e480dfe7e5..f63974b465c5f 100644 --- a/src/test/ui/never_type/issue-44402.rs +++ b/src/test/ui/never_type/issue-44402.rs @@ -1,7 +1,6 @@ // check-pass #![allow(dead_code)] -#![feature(never_type)] #![feature(exhaustive_patterns)] // Regression test for inhabitedness check. The old @@ -14,20 +13,22 @@ struct Foo { } struct Bar { - field1: &'static Foo + field1: &'static Foo, } fn test_a() { let x: Option = None; - match x { None => () } + match x { + None => (), + } } fn test_b() { let x: Option = None; match x { Some(_) => (), - None => () + None => (), } } -fn main() { } +fn main() {} diff --git a/src/test/ui/never_type/never-assign-dead-code.rs b/src/test/ui/never_type/never-assign-dead-code.rs index 7bb7c87097c50..5c1300c715128 100644 --- a/src/test/ui/never_type/never-assign-dead-code.rs +++ b/src/test/ui/never_type/never-assign-dead-code.rs @@ -2,7 +2,6 @@ // check-pass -#![feature(never_type)] #![warn(unused)] fn main() { diff --git a/src/test/ui/never_type/never-assign-wrong-type.rs b/src/test/ui/never_type/never-assign-wrong-type.rs index 67e26f5663f41..9ca1ac7462d4d 100644 --- a/src/test/ui/never_type/never-assign-wrong-type.rs +++ b/src/test/ui/never_type/never-assign-wrong-type.rs @@ -1,6 +1,5 @@ // Test that we can't use another type in place of ! -#![feature(never_type)] #![deny(warnings)] fn main() { diff --git a/src/test/ui/never_type/never-associated-type.rs b/src/test/ui/never_type/never-associated-type.rs index 3bb917c931635..45e54b9bf7c18 100644 --- a/src/test/ui/never_type/never-associated-type.rs +++ b/src/test/ui/never_type/never-associated-type.rs @@ -2,8 +2,6 @@ // check-pass -#![feature(never_type)] - trait Foo { type Wow; diff --git a/src/test/ui/never_type/never-from-impl-is-reserved.rs b/src/test/ui/never_type/never-from-impl-is-reserved.rs index 9d16015bdc129..df74b6a53f888 100644 --- a/src/test/ui/never_type/never-from-impl-is-reserved.rs +++ b/src/test/ui/never_type/never-from-impl-is-reserved.rs @@ -1,7 +1,5 @@ // check that the `for T: From` impl is reserved -#![feature(never_type)] - pub struct MyFoo; pub trait MyTrait {} diff --git a/src/test/ui/never_type/never-result.rs b/src/test/ui/never_type/never-result.rs index 35af37910ef3e..c168a6ff71526 100644 --- a/src/test/ui/never_type/never-result.rs +++ b/src/test/ui/never_type/never-result.rs @@ -5,8 +5,6 @@ // Test that we can extract a ! through pattern matching then use it as several different types. -#![feature(never_type)] - fn main() { let x: Result = Ok(123); match x { @@ -16,6 +14,6 @@ fn main() { let w: i32 = y; let e: String = y; y - }, + } } } diff --git a/src/test/ui/never_type/never-type-arg.rs b/src/test/ui/never_type/never-type-arg.rs index 13cd59e6aa9f1..3cbb114f43b94 100644 --- a/src/test/ui/never_type/never-type-arg.rs +++ b/src/test/ui/never_type/never-type-arg.rs @@ -2,8 +2,6 @@ // check-pass -#![feature(never_type)] - struct Wub; impl PartialEq for Wub { diff --git a/src/test/ui/never_type/never-type-rvalues.rs b/src/test/ui/never_type/never-type-rvalues.rs index 9ccc73dbf92d4..48fb9465138ee 100644 --- a/src/test/ui/never_type/never-type-rvalues.rs +++ b/src/test/ui/never_type/never-type-rvalues.rs @@ -1,6 +1,5 @@ // run-pass -#![feature(never_type)] #![allow(dead_code)] #![allow(path_statements)] #![allow(unreachable_patterns)] @@ -30,9 +29,9 @@ fn never_slice(x: &[!]) { fn never_match(x: Result<(), !>) { match x { - Ok(_) => {}, - Err(_) => {}, + Ok(_) => {} + Err(_) => {} } } -pub fn main() { } +pub fn main() {} diff --git a/src/test/ui/never_type/never-value-fallback-issue-66757.rs b/src/test/ui/never_type/never-value-fallback-issue-66757.rs index f2e9e087307db..36491bf7cb305 100644 --- a/src/test/ui/never_type/never-value-fallback-issue-66757.rs +++ b/src/test/ui/never_type/never-value-fallback-issue-66757.rs @@ -6,8 +6,6 @@ // // run-pass -#![feature(never_type)] - // FIXME(#67225) -- this should be true even without the fallback gate. #![feature(never_type_fallback)] @@ -22,8 +20,8 @@ impl From for E { #[allow(unreachable_code)] #[allow(dead_code)] fn foo(never: !) { - >::from(never); // Ok - >::from(never); // Inference fails here + >::from(never); // Ok + >::from(never); // Inference fails here } -fn main() { } +fn main() {} diff --git a/src/test/ui/never_type/never_transmute_never.rs b/src/test/ui/never_type/never_transmute_never.rs index fce3ced9aac7f..3c850bfdb5755 100644 --- a/src/test/ui/never_type/never_transmute_never.rs +++ b/src/test/ui/never_type/never_transmute_never.rs @@ -1,8 +1,6 @@ // check-pass -#![crate_type="lib"] - -#![feature(never_type)] +#![crate_type = "lib"] #![allow(dead_code)] #![allow(unreachable_code)] #![allow(unused_variables)] @@ -16,8 +14,6 @@ pub fn f(x: !) -> ! { pub fn ub() { // This is completely undefined behaviour, // but we still want to make sure it compiles. - let x: ! = unsafe { - std::mem::transmute::(Foo) - }; + let x: ! = unsafe { std::mem::transmute::(Foo) }; f(x) } diff --git a/src/test/ui/never_type/try_from.rs b/src/test/ui/never_type/try_from.rs index 50451576f9c97..d2aacf4c4be65 100644 --- a/src/test/ui/never_type/try_from.rs +++ b/src/test/ui/never_type/try_from.rs @@ -5,9 +5,7 @@ // This test was added to show the motivation for doing this // over `TryFrom` being blanket impl for all `T: From` -#![feature(never_type)] - -use std::convert::{TryInto, Infallible}; +use std::convert::{Infallible, TryInto}; struct Foo { t: T, diff --git a/src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs b/src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs index 7d1cac8a442f5..a909a784c9e4b 100644 --- a/src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs +++ b/src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs @@ -2,8 +2,6 @@ // undecided. This test file currently checks a conservative choice. #![feature(exhaustive_patterns)] -#![feature(never_type)] - #![allow(dead_code)] #![allow(unreachable_code)] diff --git a/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.rs b/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.rs index c5c3a214f9aff..a17e19e35b7e1 100644 --- a/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.rs +++ b/src/test/ui/pattern/usefulness/match-empty-exhaustive_patterns.rs @@ -1,6 +1,4 @@ // aux-build:empty.rs -#![feature(never_type)] -#![feature(never_type_fallback)] #![feature(exhaustive_patterns)] #![deny(unreachable_patterns)] @@ -9,19 +7,23 @@ extern crate empty; enum EmptyEnum {} struct NonEmptyStruct(bool); //~ `NonEmptyStruct` defined here -union NonEmptyUnion1 { //~ `NonEmptyUnion1` defined here +union NonEmptyUnion1 { + //~ `NonEmptyUnion1` defined here foo: (), } -union NonEmptyUnion2 { //~ `NonEmptyUnion2` defined here +union NonEmptyUnion2 { + //~ `NonEmptyUnion2` defined here foo: (), bar: (), } -enum NonEmptyEnum1 { //~ `NonEmptyEnum1` defined here +enum NonEmptyEnum1 { + //~ `NonEmptyEnum1` defined here Foo(bool), //~^ not covered //~| not covered } -enum NonEmptyEnum2 { //~ `NonEmptyEnum2` defined here +enum NonEmptyEnum2 { + //~ `NonEmptyEnum2` defined here Foo(bool), //~^ not covered //~| not covered @@ -29,8 +31,13 @@ enum NonEmptyEnum2 { //~ `NonEmptyEnum2` defined here //~^ not covered //~| not covered } -enum NonEmptyEnum5 { //~ `NonEmptyEnum5` defined here - V1, V2, V3, V4, V5, +enum NonEmptyEnum5 { + //~ `NonEmptyEnum5` defined here + V1, + V2, + V3, + V4, + V5, } macro_rules! match_empty { @@ -49,30 +56,30 @@ macro_rules! match_false { fn empty_enum(x: EmptyEnum) { match x {} // ok match x { - _ => {}, //~ ERROR unreachable pattern + _ => {} //~ ERROR unreachable pattern } match x { - _ if false => {}, //~ ERROR unreachable pattern + _ if false => {} //~ ERROR unreachable pattern } } fn empty_foreign_enum(x: empty::EmptyForeignEnum) { match x {} // ok match x { - _ => {}, //~ ERROR unreachable pattern + _ => {} //~ ERROR unreachable pattern } match x { - _ if false => {}, //~ ERROR unreachable pattern + _ if false => {} //~ ERROR unreachable pattern } } fn never(x: !) { match x {} // ok match x { - _ => {}, //~ ERROR unreachable pattern + _ => {} //~ ERROR unreachable pattern } match x { - _ if false => {}, //~ ERROR unreachable pattern + _ if false => {} //~ ERROR unreachable pattern } } diff --git a/src/test/ui/pattern/usefulness/match-empty.rs b/src/test/ui/pattern/usefulness/match-empty.rs index 10ea2a10406e3..968ef04bec031 100644 --- a/src/test/ui/pattern/usefulness/match-empty.rs +++ b/src/test/ui/pattern/usefulness/match-empty.rs @@ -1,6 +1,4 @@ // aux-build:empty.rs -#![feature(never_type)] -#![feature(never_type_fallback)] #![deny(unreachable_patterns)] extern crate empty; @@ -8,19 +6,23 @@ extern crate empty; enum EmptyEnum {} struct NonEmptyStruct(bool); //~ `NonEmptyStruct` defined here -union NonEmptyUnion1 { //~ `NonEmptyUnion1` defined here +union NonEmptyUnion1 { + //~ `NonEmptyUnion1` defined here foo: (), } -union NonEmptyUnion2 { //~ `NonEmptyUnion2` defined here +union NonEmptyUnion2 { + //~ `NonEmptyUnion2` defined here foo: (), bar: (), } -enum NonEmptyEnum1 { //~ `NonEmptyEnum1` defined here +enum NonEmptyEnum1 { + //~ `NonEmptyEnum1` defined here Foo(bool), //~^ not covered //~| not covered } -enum NonEmptyEnum2 { //~ `NonEmptyEnum2` defined here +enum NonEmptyEnum2 { + //~ `NonEmptyEnum2` defined here Foo(bool), //~^ not covered //~| not covered @@ -28,8 +30,13 @@ enum NonEmptyEnum2 { //~ `NonEmptyEnum2` defined here //~^ not covered //~| not covered } -enum NonEmptyEnum5 { //~ `NonEmptyEnum5` defined here - V1, V2, V3, V4, V5, +enum NonEmptyEnum5 { + //~ `NonEmptyEnum5` defined here + V1, + V2, + V3, + V4, + V5, } macro_rules! match_empty { @@ -48,30 +55,30 @@ macro_rules! match_false { fn empty_enum(x: EmptyEnum) { match x {} // ok match x { - _ => {}, //~ ERROR unreachable pattern + _ => {} //~ ERROR unreachable pattern } match x { - _ if false => {}, //~ ERROR unreachable pattern + _ if false => {} //~ ERROR unreachable pattern } } fn empty_foreign_enum(x: empty::EmptyForeignEnum) { match x {} // ok match x { - _ => {}, //~ ERROR unreachable pattern + _ => {} //~ ERROR unreachable pattern } match x { - _ if false => {}, //~ ERROR unreachable pattern + _ if false => {} //~ ERROR unreachable pattern } } fn never(x: !) { match x {} // ok match x { - _ => {}, //~ ERROR unreachable pattern + _ => {} //~ ERROR unreachable pattern } match x { - _ if false => {}, //~ ERROR unreachable pattern + _ if false => {} //~ ERROR unreachable pattern } } diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.rs b/src/test/ui/pattern/usefulness/match-privately-empty.rs index 315eb03d16564..520df830f0291 100644 --- a/src/test/ui/pattern/usefulness/match-privately-empty.rs +++ b/src/test/ui/pattern/usefulness/match-privately-empty.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![feature(exhaustive_patterns)] mod private { @@ -11,11 +10,8 @@ mod private { fn main() { match private::DATA { - //~^ ERROR non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered + //~^ ERROR non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered None => {} - Some(private::Private { - misc: false, - .. - }) => {} + Some(private::Private { misc: false, .. }) => {} } } diff --git a/src/test/ui/print_type_sizes/uninhabited.rs b/src/test/ui/print_type_sizes/uninhabited.rs index c234547bd14b1..55c2121247d8b 100644 --- a/src/test/ui/print_type_sizes/uninhabited.rs +++ b/src/test/ui/print_type_sizes/uninhabited.rs @@ -4,7 +4,6 @@ // ^-- needed because `--pass check` does not emit the output needed. // FIXME: consider using an attribute instead of side-effects. -#![feature(never_type)] #![feature(start)] #[start] diff --git a/src/test/ui/reachable/expr_add.rs b/src/test/ui/reachable/expr_add.rs index b45e5daf42c8d..640c2a2cf8fcc 100644 --- a/src/test/ui/reachable/expr_add.rs +++ b/src/test/ui/reachable/expr_add.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unused_variables)] #![deny(unreachable_code)] diff --git a/src/test/ui/reachable/expr_assign.rs b/src/test/ui/reachable/expr_assign.rs index e547f75e2697b..293af24ce9008 100644 --- a/src/test/ui/reachable/expr_assign.rs +++ b/src/test/ui/reachable/expr_assign.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unused_variables)] #![allow(unused_assignments)] #![allow(dead_code)] @@ -23,7 +22,10 @@ fn bar() { fn baz() { let mut i = 0; - *{return; &mut i} = 22; //~ ERROR unreachable + *{ + return; + &mut i + } = 22; //~ ERROR unreachable } -fn main() { } +fn main() {} diff --git a/src/test/ui/reachable/expr_call.rs b/src/test/ui/reachable/expr_call.rs index 1eaa96c3ce773..88c21a9198003 100644 --- a/src/test/ui/reachable/expr_call.rs +++ b/src/test/ui/reachable/expr_call.rs @@ -1,12 +1,11 @@ -#![feature(never_type)] #![allow(unused_variables)] #![allow(unused_assignments)] #![allow(dead_code)] #![deny(unreachable_code)] -fn foo(x: !, y: usize) { } +fn foo(x: !, y: usize) {} -fn bar(x: !) { } +fn bar(x: !) {} fn a() { // the `22` is unreachable: @@ -18,4 +17,4 @@ fn b() { bar(return); //~ ERROR unreachable } -fn main() { } +fn main() {} diff --git a/src/test/ui/reachable/expr_method.rs b/src/test/ui/reachable/expr_method.rs index d917df05b3c3d..07b2042725750 100644 --- a/src/test/ui/reachable/expr_method.rs +++ b/src/test/ui/reachable/expr_method.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unused_variables)] #![allow(unused_assignments)] #![allow(dead_code)] @@ -7,8 +6,8 @@ struct Foo; impl Foo { - fn foo(&self, x: !, y: usize) { } - fn bar(&self, x: !) { } + fn foo(&self, x: !, y: usize) {} + fn bar(&self, x: !) {} } fn a() { @@ -21,4 +20,4 @@ fn b() { Foo.bar(return); //~ ERROR unreachable } -fn main() { } +fn main() {} diff --git a/src/test/ui/reachable/expr_unary.rs b/src/test/ui/reachable/expr_unary.rs index e229d22ebc798..6f221c360cb17 100644 --- a/src/test/ui/reachable/expr_unary.rs +++ b/src/test/ui/reachable/expr_unary.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unused_variables)] #![allow(unused_assignments)] #![allow(dead_code)] diff --git a/src/test/ui/reachable/unwarned-match-on-never.rs b/src/test/ui/reachable/unwarned-match-on-never.rs index 71f8fe3a783e2..2ed51a2a7a6f3 100644 --- a/src/test/ui/reachable/unwarned-match-on-never.rs +++ b/src/test/ui/reachable/unwarned-match-on-never.rs @@ -1,8 +1,6 @@ #![deny(unreachable_code)] #![allow(dead_code)] -#![feature(never_type)] - fn foo(x: !) -> bool { // Explicit matches on the never type are unwarned. match x {} @@ -12,13 +10,14 @@ fn foo(x: !) -> bool { fn bar() { match (return) { - () => () //~ ERROR unreachable arm + () => (), //~ ERROR unreachable arm } } fn main() { return; - match () { //~ ERROR unreachable expression + match () { + //~ ERROR unreachable expression () => (), } } diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs index a2735d4cbfb29..905a59fd3408d 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs @@ -1,9 +1,7 @@ #![crate_type = "rlib"] -#![feature(never_type)] #[non_exhaustive] -pub enum UninhabitedEnum { -} +pub enum UninhabitedEnum {} #[non_exhaustive] pub struct UninhabitedStruct { @@ -14,13 +12,18 @@ pub struct UninhabitedStruct { pub struct UninhabitedTupleStruct(!); pub enum UninhabitedVariants { - #[non_exhaustive] Tuple(!), - #[non_exhaustive] Struct { x: ! } + #[non_exhaustive] + Tuple(!), + #[non_exhaustive] + Struct { x: ! }, } pub enum PartiallyInhabitedVariants { Tuple(u8), - #[non_exhaustive] Struct { x: ! } + #[non_exhaustive] + Struct { + x: !, + }, } pub struct IndirectUninhabitedEnum(UninhabitedEnum); diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs index 80b9dc4c1c338..b5f4357229d3e 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs @@ -1,13 +1,9 @@ // aux-build:uninhabited.rs -#![feature(never_type)] extern crate uninhabited; use uninhabited::{ - UninhabitedEnum, - UninhabitedStruct, - UninhabitedTupleStruct, - UninhabitedVariants, + UninhabitedEnum, UninhabitedStruct, UninhabitedTupleStruct, UninhabitedVariants, }; // This test checks that uninhabited non-exhaustive types cannot coerce to any type, as the never diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs index 6b911dd989cc5..b7591d8a3d059 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs @@ -1,8 +1,5 @@ -#![feature(never_type)] - #[non_exhaustive] -pub enum UninhabitedEnum { -} +pub enum UninhabitedEnum {} #[non_exhaustive] pub struct UninhabitedTupleStruct(!); @@ -13,8 +10,10 @@ pub struct UninhabitedStruct { } pub enum UninhabitedVariants { - #[non_exhaustive] Tuple(!), - #[non_exhaustive] Struct { x: ! } + #[non_exhaustive] + Tuple(!), + #[non_exhaustive] + Struct { x: ! }, } struct A; diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs index 98a7fdbc5049a..c07b09c735dd3 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs @@ -1,12 +1,9 @@ // aux-build:uninhabited.rs -#![feature(never_type)] extern crate uninhabited; use uninhabited::{ - IndirectUninhabitedEnum, - IndirectUninhabitedStruct, - IndirectUninhabitedTupleStruct, + IndirectUninhabitedEnum, IndirectUninhabitedStruct, IndirectUninhabitedTupleStruct, IndirectUninhabitedVariants, }; diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs index 8f090fe886a00..e46ac84e8afb4 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs @@ -1,8 +1,5 @@ -#![feature(never_type)] - #[non_exhaustive] -pub enum UninhabitedEnum { -} +pub enum UninhabitedEnum {} #[non_exhaustive] pub struct UninhabitedStruct { @@ -13,8 +10,10 @@ pub struct UninhabitedStruct { pub struct UninhabitedTupleStruct(!); pub enum UninhabitedVariants { - #[non_exhaustive] Tuple(!), - #[non_exhaustive] Struct { x: ! } + #[non_exhaustive] + Tuple(!), + #[non_exhaustive] + Struct { x: ! }, } pub struct IndirectUninhabitedEnum(UninhabitedEnum); diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs index be86519ecb159..f82b851ceca9d 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs @@ -1,14 +1,11 @@ // aux-build:uninhabited.rs #![deny(unreachable_patterns)] #![feature(exhaustive_patterns)] -#![feature(never_type)] extern crate uninhabited; use uninhabited::{ - IndirectUninhabitedEnum, - IndirectUninhabitedStruct, - IndirectUninhabitedTupleStruct, + IndirectUninhabitedEnum, IndirectUninhabitedStruct, IndirectUninhabitedTupleStruct, IndirectUninhabitedVariants, }; diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs index 60289aa780378..d7b237b672d24 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs @@ -2,11 +2,9 @@ #![deny(unreachable_patterns)] #![feature(exhaustive_patterns)] -#![feature(never_type)] #[non_exhaustive] -pub enum UninhabitedEnum { -} +pub enum UninhabitedEnum {} #[non_exhaustive] pub struct UninhabitedStruct { @@ -17,8 +15,10 @@ pub struct UninhabitedStruct { pub struct UninhabitedTupleStruct(!); pub enum UninhabitedVariants { - #[non_exhaustive] Tuple(!), - #[non_exhaustive] Struct { x: ! } + #[non_exhaustive] + Tuple(!), + #[non_exhaustive] + Struct { x: ! }, } pub struct IndirectUninhabitedEnum(UninhabitedEnum); diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs index 230ac75298e72..2eb063d57545f 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs @@ -1,6 +1,5 @@ // aux-build:uninhabited.rs #![deny(unreachable_patterns)] -#![feature(never_type)] extern crate uninhabited; @@ -11,11 +10,11 @@ use uninhabited::PartiallyInhabitedVariants; pub fn foo(x: PartiallyInhabitedVariants) { match x { - PartiallyInhabitedVariants::Struct { .. } => {}, - PartiallyInhabitedVariants::Struct { .. } => {}, + PartiallyInhabitedVariants::Struct { .. } => {} + PartiallyInhabitedVariants::Struct { .. } => {} //~^ ERROR unreachable pattern - _ => {}, + _ => {} } } -fn main() { } +fn main() {} diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.rs index e54098d4d48b9..fc19a64ff105b 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.rs @@ -1,13 +1,9 @@ // aux-build:uninhabited.rs -#![feature(never_type)] extern crate uninhabited; use uninhabited::{ - UninhabitedEnum, - UninhabitedStruct, - UninhabitedTupleStruct, - UninhabitedVariants, + UninhabitedEnum, UninhabitedStruct, UninhabitedTupleStruct, UninhabitedVariants, }; struct A; diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs index ebbdfba15f3a3..7608f0e3db00c 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs @@ -1,8 +1,5 @@ -#![feature(never_type)] - #[non_exhaustive] -pub enum UninhabitedEnum { -} +pub enum UninhabitedEnum {} #[non_exhaustive] pub struct UninhabitedStruct { @@ -13,8 +10,10 @@ pub struct UninhabitedStruct { pub struct UninhabitedTupleStruct(!); pub enum UninhabitedVariants { - #[non_exhaustive] Tuple(!), - #[non_exhaustive] Struct { x: ! } + #[non_exhaustive] + Tuple(!), + #[non_exhaustive] + Struct { x: ! }, } struct A; diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs index 900dfff652ea6..8265265e292f2 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs @@ -1,15 +1,11 @@ // aux-build:uninhabited.rs #![deny(unreachable_patterns)] #![feature(exhaustive_patterns)] -#![feature(never_type)] extern crate uninhabited; use uninhabited::{ - UninhabitedEnum, - UninhabitedStruct, - UninhabitedTupleStruct, - UninhabitedVariants, + UninhabitedEnum, UninhabitedStruct, UninhabitedTupleStruct, UninhabitedVariants, }; struct A; diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs index de5530485f3e6..884d092f1372e 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs @@ -2,11 +2,9 @@ #![deny(unreachable_patterns)] #![feature(exhaustive_patterns)] -#![feature(never_type)] #[non_exhaustive] -pub enum UninhabitedEnum { -} +pub enum UninhabitedEnum {} #[non_exhaustive] pub struct UninhabitedStruct { @@ -17,8 +15,10 @@ pub struct UninhabitedStruct { pub struct UninhabitedTupleStruct(!); pub enum UninhabitedVariants { - #[non_exhaustive] Tuple(!), - #[non_exhaustive] Struct { x: ! } + #[non_exhaustive] + Tuple(!), + #[non_exhaustive] + Struct { x: ! }, } struct A; diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs index ffc496a975ecf..01e9f86d5564f 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs @@ -1,10 +1,8 @@ #![deny(unreachable_patterns)] #![feature(exhaustive_patterns)] -#![feature(never_type)] #[non_exhaustive] -pub enum UninhabitedEnum { -} +pub enum UninhabitedEnum {} #[non_exhaustive] pub struct UninhabitedTupleStruct(!); @@ -15,13 +13,18 @@ pub struct UninhabitedStruct { } pub enum UninhabitedVariants { - #[non_exhaustive] Tuple(!), - #[non_exhaustive] Struct { x: ! } + #[non_exhaustive] + Tuple(!), + #[non_exhaustive] + Struct { x: ! }, } pub enum PartiallyInhabitedVariants { Tuple(u8), - #[non_exhaustive] Struct { x: ! } + #[non_exhaustive] + Struct { + x: !, + }, } fn uninhabited_enum() -> Option { diff --git a/src/test/ui/statics/uninhabited-static.rs b/src/test/ui/statics/uninhabited-static.rs index cc78f6cfa53f7..8b459f26139db 100644 --- a/src/test/ui/statics/uninhabited-static.rs +++ b/src/test/ui/statics/uninhabited-static.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![deny(uninhabited_static)] enum Void {} diff --git a/src/test/ui/type-sizes.rs b/src/test/ui/type-sizes.rs index 73a11a5e743f6..6eab3b9782ef4 100644 --- a/src/test/ui/type-sizes.rs +++ b/src/test/ui/type-sizes.rs @@ -2,35 +2,62 @@ #![allow(non_camel_case_types)] #![allow(dead_code)] -#![feature(never_type)] use std::mem::size_of; use std::num::NonZeroU8; -struct t {a: u8, b: i8} -struct u {a: u8, b: i8, c: u8} -struct v {a: u8, b: i8, c: v2, d: u32} -struct v2 {u: char, v: u8} -struct w {a: isize, b: ()} -struct x {a: isize, b: (), c: ()} -struct y {x: isize} +struct t { + a: u8, + b: i8, +} +struct u { + a: u8, + b: i8, + c: u8, +} +struct v { + a: u8, + b: i8, + c: v2, + d: u32, +} +struct v2 { + u: char, + v: u8, +} +struct w { + a: isize, + b: (), +} +struct x { + a: isize, + b: (), + c: (), +} +struct y { + x: isize, +} enum e1 { - a(u8, u32), b(u32), c + a(u8, u32), + b(u32), + c, } enum e2 { - a(u32), b + a(u32), + b, } #[repr(C, u8)] enum e3 { - a([u16; 0], u8), b + a([u16; 0], u8), + b, } struct ReorderedStruct { a: u8, b: u16, - c: u8 + c: u8, } enum ReorderedEnum { @@ -43,22 +70,262 @@ enum ReorderedEnum2 { B(u16, u8, u16, u8), // 0x100 niche variants. - _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, _0A, _0B, _0C, _0D, _0E, _0F, - _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _1A, _1B, _1C, _1D, _1E, _1F, - _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _2A, _2B, _2C, _2D, _2E, _2F, - _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _3A, _3B, _3C, _3D, _3E, _3F, - _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _4A, _4B, _4C, _4D, _4E, _4F, - _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _5A, _5B, _5C, _5D, _5E, _5F, - _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _6A, _6B, _6C, _6D, _6E, _6F, - _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _7A, _7B, _7C, _7D, _7E, _7F, - _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _8A, _8B, _8C, _8D, _8E, _8F, - _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _9A, _9B, _9C, _9D, _9E, _9F, - _A0, _A1, _A2, _A3, _A4, _A5, _A6, _A7, _A8, _A9, _AA, _AB, _AC, _AD, _AE, _AF, - _B0, _B1, _B2, _B3, _B4, _B5, _B6, _B7, _B8, _B9, _BA, _BB, _BC, _BD, _BE, _BF, - _C0, _C1, _C2, _C3, _C4, _C5, _C6, _C7, _C8, _C9, _CA, _CB, _CC, _CD, _CE, _CF, - _D0, _D1, _D2, _D3, _D4, _D5, _D6, _D7, _D8, _D9, _DA, _DB, _DC, _DD, _DE, _DF, - _E0, _E1, _E2, _E3, _E4, _E5, _E6, _E7, _E8, _E9, _EA, _EB, _EC, _ED, _EE, _EF, - _F0, _F1, _F2, _F3, _F4, _F5, _F6, _F7, _F8, _F9, _FA, _FB, _FC, _FD, _FE, _FF, + _00, + _01, + _02, + _03, + _04, + _05, + _06, + _07, + _08, + _09, + _0A, + _0B, + _0C, + _0D, + _0E, + _0F, + _10, + _11, + _12, + _13, + _14, + _15, + _16, + _17, + _18, + _19, + _1A, + _1B, + _1C, + _1D, + _1E, + _1F, + _20, + _21, + _22, + _23, + _24, + _25, + _26, + _27, + _28, + _29, + _2A, + _2B, + _2C, + _2D, + _2E, + _2F, + _30, + _31, + _32, + _33, + _34, + _35, + _36, + _37, + _38, + _39, + _3A, + _3B, + _3C, + _3D, + _3E, + _3F, + _40, + _41, + _42, + _43, + _44, + _45, + _46, + _47, + _48, + _49, + _4A, + _4B, + _4C, + _4D, + _4E, + _4F, + _50, + _51, + _52, + _53, + _54, + _55, + _56, + _57, + _58, + _59, + _5A, + _5B, + _5C, + _5D, + _5E, + _5F, + _60, + _61, + _62, + _63, + _64, + _65, + _66, + _67, + _68, + _69, + _6A, + _6B, + _6C, + _6D, + _6E, + _6F, + _70, + _71, + _72, + _73, + _74, + _75, + _76, + _77, + _78, + _79, + _7A, + _7B, + _7C, + _7D, + _7E, + _7F, + _80, + _81, + _82, + _83, + _84, + _85, + _86, + _87, + _88, + _89, + _8A, + _8B, + _8C, + _8D, + _8E, + _8F, + _90, + _91, + _92, + _93, + _94, + _95, + _96, + _97, + _98, + _99, + _9A, + _9B, + _9C, + _9D, + _9E, + _9F, + _A0, + _A1, + _A2, + _A3, + _A4, + _A5, + _A6, + _A7, + _A8, + _A9, + _AA, + _AB, + _AC, + _AD, + _AE, + _AF, + _B0, + _B1, + _B2, + _B3, + _B4, + _B5, + _B6, + _B7, + _B8, + _B9, + _BA, + _BB, + _BC, + _BD, + _BE, + _BF, + _C0, + _C1, + _C2, + _C3, + _C4, + _C5, + _C6, + _C7, + _C8, + _C9, + _CA, + _CB, + _CC, + _CD, + _CE, + _CF, + _D0, + _D1, + _D2, + _D3, + _D4, + _D5, + _D6, + _D7, + _D8, + _D9, + _DA, + _DB, + _DC, + _DD, + _DE, + _DF, + _E0, + _E1, + _E2, + _E3, + _E4, + _E5, + _E6, + _E7, + _E8, + _E9, + _EA, + _EB, + _EC, + _ED, + _EE, + _EF, + _F0, + _F1, + _F2, + _F3, + _F4, + _F5, + _F6, + _F7, + _F8, + _F9, + _FA, + _FB, + _FC, + _FD, + _FE, + _FF, } enum EnumEmpty {} @@ -100,7 +367,7 @@ enum NicheFilledEnumWithAbsentVariant { enum Option2 { Some(A, B), - None + None, } // Two layouts are considered for `CanBeNicheFilledButShouldnt`: @@ -113,11 +380,11 @@ enum Option2 { // allowing types like `Option>` to fit into 8 bytes. pub enum CanBeNicheFilledButShouldnt { A(NonZeroU8, u32), - B + B, } pub enum AlwaysTaggedBecauseItHasNoNiche { A(u8, u32), - B + B, } pub fn main() { @@ -130,8 +397,7 @@ pub fn main() { assert_eq!(size_of::(), 3 as usize); // Alignment causes padding before the char and the u32. - assert_eq!(size_of::(), - 16 as usize); + assert_eq!(size_of::(), 16 as usize); assert_eq!(size_of::(), size_of::()); assert_eq!(size_of::(), size_of::()); assert_eq!(size_of::(), size_of::()); @@ -147,7 +413,6 @@ pub fn main() { assert_eq!(size_of::(), 6); assert_eq!(size_of::(), 8); - assert_eq!(size_of::(), 0); assert_eq!(size_of::(), 0); assert_eq!(size_of::(), 0); @@ -155,8 +420,10 @@ pub fn main() { assert_eq!(size_of::(), 1); assert_eq!(size_of::(), 1); - assert_eq!(size_of::>(), - size_of::>()); + assert_eq!( + size_of::>(), + size_of::>() + ); assert_eq!(size_of::(), size_of::<&'static ()>()); assert_eq!(size_of::>>(), size_of::<(bool, &())>()); diff --git a/src/test/ui/uninhabited/uninhabited-irrefutable.rs b/src/test/ui/uninhabited/uninhabited-irrefutable.rs index 48cd92719b49a..84daa35484f81 100644 --- a/src/test/ui/uninhabited/uninhabited-irrefutable.rs +++ b/src/test/ui/uninhabited/uninhabited-irrefutable.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![feature(exhaustive_patterns)] mod foo { diff --git a/src/test/ui/uninhabited/uninhabited-patterns.rs b/src/test/ui/uninhabited/uninhabited-patterns.rs index 58c726d2185c4..13369ba9517a4 100644 --- a/src/test/ui/uninhabited/uninhabited-patterns.rs +++ b/src/test/ui/uninhabited/uninhabited-patterns.rs @@ -1,8 +1,6 @@ #![feature(box_patterns)] #![feature(box_syntax)] -#![feature(never_type)] #![feature(exhaustive_patterns)] - #![deny(unreachable_patterns)] mod foo { @@ -23,22 +21,22 @@ fn main() { let x: &[!] = &[]; match x { - &[] => (), - &[..] => (), //~ ERROR unreachable pattern + &[] => (), + &[..] => (), //~ ERROR unreachable pattern }; let x: Result, &[Result]> = Err(&[]); match x { - Ok(box _) => (), //~ ERROR unreachable pattern + Ok(box _) => (), //~ ERROR unreachable pattern Err(&[]) => (), - Err(&[..]) => (), //~ ERROR unreachable pattern + Err(&[..]) => (), //~ ERROR unreachable pattern } let x: Result> = Err(Err(123)); match x { Ok(_y) => (), Err(Err(_y)) => (), - Err(Ok(_y)) => (), //~ ERROR unreachable pattern + Err(Ok(_y)) => (), //~ ERROR unreachable pattern } while let Some(_y) = foo() { diff --git a/src/tools/clippy/clippy_lints/src/empty_enum.rs b/src/tools/clippy/clippy_lints/src/empty_enum.rs index a249117d182fa..07df43b76deb6 100644 --- a/src/tools/clippy/clippy_lints/src/empty_enum.rs +++ b/src/tools/clippy/clippy_lints/src/empty_enum.rs @@ -27,8 +27,6 @@ declare_clippy_lint! { /// /// Good: /// ```rust - /// #![feature(never_type)] - /// /// struct Test(!); /// ``` pub EMPTY_ENUM, diff --git a/src/tools/clippy/tests/ui/must_use_candidates.fixed b/src/tools/clippy/tests/ui/must_use_candidates.fixed index 9556f6f82cc63..db4142f19262c 100644 --- a/src/tools/clippy/tests/ui/must_use_candidates.fixed +++ b/src/tools/clippy/tests/ui/must_use_candidates.fixed @@ -1,5 +1,4 @@ // run-rustfix -#![feature(never_type)] #![allow(unused_mut, clippy::redundant_allocation)] #![warn(clippy::must_use_candidate)] use std::rc::Rc; diff --git a/src/tools/clippy/tests/ui/must_use_candidates.rs b/src/tools/clippy/tests/ui/must_use_candidates.rs index 3732422017104..99426384fabee 100644 --- a/src/tools/clippy/tests/ui/must_use_candidates.rs +++ b/src/tools/clippy/tests/ui/must_use_candidates.rs @@ -1,5 +1,4 @@ // run-rustfix -#![feature(never_type)] #![allow(unused_mut, clippy::redundant_allocation)] #![warn(clippy::must_use_candidate)] use std::rc::Rc; diff --git a/src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.rs b/src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.rs index b197c609d7bfc..c00bd437588c4 100644 --- a/src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.rs +++ b/src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.rs @@ -1,5 +1,4 @@ #![warn(clippy::result_map_unit_fn)] -#![feature(never_type)] #![allow(unused)] struct HasResult {