From 373b6cb5d856881ff3dd15a863c329923c1e844b Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 15 Aug 2025 02:23:51 +0200 Subject: [PATCH 01/14] stabilize the never type (`!`) --- compiler/rustc_ast_passes/src/feature_gate.rs | 12 ------------ compiler/rustc_feature/src/accepted.rs | 2 ++ compiler/rustc_feature/src/unstable.rs | 2 -- library/core/src/clone.rs | 2 +- library/core/src/cmp.rs | 8 ++++---- library/core/src/error.rs | 2 +- library/core/src/fmt/mod.rs | 4 ++-- library/core/src/marker.rs | 2 +- library/core/src/num/error.rs | 2 +- library/core/src/primitive_docs.rs | 2 +- 10 files changed, 13 insertions(+), 25 deletions(-) diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 5831636a81b2c..d7a63830f103a 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -288,9 +288,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { // Function pointers cannot be `const` self.check_late_bound_lifetime_defs(&fn_ptr_ty.generic_params); } - ast::TyKind::Never => { - gate!(self, never_type, ty.span, "the `!` type is experimental"); - } ast::TyKind::Pat(..) => { gate!(self, pattern_types, ty.span, "pattern types are unstable"); } @@ -318,15 +315,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> { } fn visit_generic_args(&mut self, args: &'a ast::GenericArgs) { - // This check needs to happen here because the never type can be returned from a function, - // but cannot be used in any other context. If this check was in `visit_fn_ret_ty`, it - // include both functions and generics like `impl Fn() -> !`. - if let ast::GenericArgs::Parenthesized(generic_args) = args - && let ast::FnRetTy::Ty(ref ty) = generic_args.output - && matches!(ty.kind, ast::TyKind::Never) - { - gate!(self, never_type, ty.span, "the `!` type is experimental"); - } visit::walk_generic_args(self, args); } diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index 54a935d13c8c1..227db5eb3f387 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -326,6 +326,8 @@ declare_features! ( (accepted, native_link_modifiers_verbatim, "1.67.0", Some(81490)), /// Allows specifying the whole-archive link modifier (accepted, native_link_modifiers_whole_archive, "1.61.0", Some(81490)), + /// Allows the `!` type. + (accepted, never_type, "CURRENT_RUSTC_VERSION", Some(35121)), /// Allows using non lexical lifetimes (RFC 2094). (accepted, nll, "1.63.0", Some(43234)), /// Allows using `#![no_std]`. diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index c175c3adc2f02..94cfa978c6f24 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -622,8 +622,6 @@ declare_features! ( (unstable, negative_impls, "1.44.0", Some(68318)), /// Allows the `!` pattern. (incomplete, never_patterns, "1.76.0", Some(118155)), - /// Allows the `!` type. Does not imply 'exhaustive_patterns' (below) any more. - (unstable, never_type, "1.13.0", Some(35121)), /// Switch `..` syntax to use the new (`Copy + IntoIterator`) range types. (unstable, new_range, "1.86.0", Some(123741)), /// Allows `#![no_core]`. diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index f2fa6fd0ca3e9..a4802ed5129aa 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -631,7 +631,7 @@ mod impls { bool char } - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_clone", issue = "142757")] impl const Clone for ! { #[inline] diff --git a/library/core/src/cmp.rs b/library/core/src/cmp.rs index 2051a806af642..e963c4898ece4 100644 --- a/library/core/src/cmp.rs +++ b/library/core/src/cmp.rs @@ -2078,7 +2078,7 @@ 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 = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] impl const PartialEq for ! { #[inline] @@ -2087,11 +2087,11 @@ mod impls { } } - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] impl const Eq for ! {} - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] impl const PartialOrd for ! { #[inline] @@ -2100,7 +2100,7 @@ mod impls { } } - #[unstable(feature = "never_type", issue = "35121")] + #[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] impl const Ord for ! { #[inline] diff --git a/library/core/src/error.rs b/library/core/src/error.rs index 0f01c09c8d91c..7386c52849eab 100644 --- a/library/core/src/error.rs +++ b/library/core/src/error.rs @@ -268,7 +268,7 @@ mod private { pub struct Internal; } -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] impl Error for ! {} // Copied from `any.rs`. diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index 9e5f693246f33..cfded5faaebda 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -2881,7 +2881,7 @@ 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 = "CURRENT_RUSTC_VERSION")] impl Debug for ! { #[inline] fn fmt(&self, _: &mut Formatter<'_>) -> Result { @@ -2889,7 +2889,7 @@ impl Debug for ! { } } -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] impl Display for ! { #[inline] fn fmt(&self, _: &mut Formatter<'_>) -> Result { diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index f56a4d7308e90..21b448115817f 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -480,7 +480,7 @@ marker_impls! { } -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] impl Copy for ! {} /// Shared references can be copied, but mutable references *cannot*! diff --git a/library/core/src/num/error.rs b/library/core/src/num/error.rs index 8cd065630cd88..71989ace1a746 100644 --- a/library/core/src/num/error.rs +++ b/library/core/src/num/error.rs @@ -36,7 +36,7 @@ impl const From for TryFromIntError { } } -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] impl const From for TryFromIntError { #[inline] diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs index 3a4e1e657a3da..db61aba59277d 100644 --- a/library/core/src/primitive_docs.rs +++ b/library/core/src/primitive_docs.rs @@ -311,7 +311,7 @@ mod prim_bool {} /// [`()`]: prim@unit /// [2024 edition]: /// -#[unstable(feature = "never_type", issue = "35121")] +#[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] mod prim_never {} // Required to make auto trait impls render. From 03df427fe68aec232caa2a9c2037d584482a73e8 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 15 Aug 2025 02:32:46 +0200 Subject: [PATCH 02/14] fixup clippy::empty_enums --- src/tools/clippy/clippy_lints/src/empty_enums.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/tools/clippy/clippy_lints/src/empty_enums.rs b/src/tools/clippy/clippy_lints/src/empty_enums.rs index f96854411fe6f..80e5ca2382d1c 100644 --- a/src/tools/clippy/clippy_lints/src/empty_enums.rs +++ b/src/tools/clippy/clippy_lints/src/empty_enums.rs @@ -9,9 +9,6 @@ declare_clippy_lint! { /// Checks for `enum`s with no variants, which therefore are uninhabited types /// (cannot be instantiated). /// - /// As of this writing, the `never_type` is still a nightly-only experimental API. - /// Therefore, this lint is only triggered if `#![feature(never_type)]` is enabled. - /// /// ### Why is this bad? /// * If you only want a type which can’t be instantiated, you should use [`!`] /// (the primitive type "never"), because [`!`] has more extensive compiler support @@ -36,8 +33,6 @@ declare_clippy_lint! { /// /// Use instead: /// ```no_run - /// #![feature(never_type)] - /// /// /// Use the `!` type directly... /// type CannotExist = !; /// @@ -61,8 +56,6 @@ impl LateLintPass<'_> for EmptyEnums { fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { if let ItemKind::Enum(.., def) = item.kind && def.variants.is_empty() - // Only suggest the `never_type` if the feature is enabled - && cx.tcx.features().never_type() && !span_contains_cfg(cx, item.span) { span_lint_and_help( From f33865c730ec60bb28d88527df07f5afb81280d8 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 15 Aug 2025 02:32:46 +0200 Subject: [PATCH 03/14] remove `#![feature(never_type)]` from the compiler --- compiler/rustc_arena/src/lib.rs | 2 +- compiler/rustc_ast_ir/src/lib.rs | 2 +- compiler/rustc_borrowck/src/lib.rs | 2 +- compiler/rustc_const_eval/src/lib.rs | 2 +- compiler/rustc_data_structures/src/lib.rs | 2 +- compiler/rustc_error_codes/src/error_codes/E0725.md | 5 +++-- compiler/rustc_errors/src/lib.rs | 2 +- compiler/rustc_hir/src/lib.rs | 2 +- compiler/rustc_hir_analysis/src/lib.rs | 2 +- compiler/rustc_hir_typeck/src/lib.rs | 2 +- compiler/rustc_macros/src/lib.rs | 2 +- compiler/rustc_metadata/src/lib.rs | 2 +- compiler/rustc_middle/src/lib.rs | 2 +- compiler/rustc_middle/src/ty/inhabitedness/mod.rs | 4 ++-- compiler/rustc_mir_dataflow/src/lib.rs | 2 +- compiler/rustc_pattern_analysis/src/constructor.rs | 3 +-- compiler/rustc_resolve/src/late.rs | 4 ++-- compiler/rustc_serialize/src/lib.rs | 2 +- compiler/rustc_trait_selection/src/lib.rs | 2 +- compiler/rustc_transmute/src/lib.rs | 2 +- compiler/rustc_ty_utils/src/lib.rs | 2 +- 21 files changed, 25 insertions(+), 25 deletions(-) diff --git a/compiler/rustc_arena/src/lib.rs b/compiler/rustc_arena/src/lib.rs index 24ade7300c33b..d42517711a27b 100644 --- a/compiler/rustc_arena/src/lib.rs +++ b/compiler/rustc_arena/src/lib.rs @@ -10,12 +10,12 @@ // tidy-alphabetical-start #![allow(clippy::mut_from_ref)] // Arena allocators are one place where this pattern is fine. #![allow(internal_features)] +#![cfg_attr(bootstrap, feature(never_type))] #![cfg_attr(test, feature(test))] #![deny(unsafe_op_in_unsafe_fn)] #![doc(test(no_crate_inject, attr(deny(warnings), allow(internal_features))))] #![feature(decl_macro)] #![feature(dropck_eyepatch)] -#![feature(never_type)] #![feature(rustc_attrs)] #![feature(unwrap_infallible)] // tidy-alphabetical-end diff --git a/compiler/rustc_ast_ir/src/lib.rs b/compiler/rustc_ast_ir/src/lib.rs index fb00f5d9b6236..037468bd84d58 100644 --- a/compiler/rustc_ast_ir/src/lib.rs +++ b/compiler/rustc_ast_ir/src/lib.rs @@ -6,8 +6,8 @@ //! `rustc_type_ir` for a single import. // tidy-alphabetical-start +#![cfg_attr(all(feature = "nightly", bootstrap), feature(never_type))] #![cfg_attr(feature = "nightly", allow(internal_features))] -#![cfg_attr(feature = "nightly", feature(never_type))] #![cfg_attr(feature = "nightly", feature(rustc_attrs))] // tidy-alphabetical-end diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index 822fe1e58ebba..49cee80d89eba 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -2,11 +2,11 @@ // tidy-alphabetical-start #![allow(internal_features)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(box_patterns)] #![feature(default_field_values)] #![feature(file_buffered)] #![feature(negative_impls)] -#![feature(never_type)] #![feature(rustc_attrs)] #![feature(stmt_expr_attributes)] #![feature(try_blocks)] diff --git a/compiler/rustc_const_eval/src/lib.rs b/compiler/rustc_const_eval/src/lib.rs index 33da1c5ecf738..cd43aaeef85d3 100644 --- a/compiler/rustc_const_eval/src/lib.rs +++ b/compiler/rustc_const_eval/src/lib.rs @@ -1,8 +1,8 @@ // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(never_type))] #![feature(array_try_map)] #![feature(box_patterns)] #![feature(decl_macro)] -#![feature(never_type)] #![feature(slice_ptr_get)] #![feature(trait_alias)] #![feature(unqualified_local_imports)] diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs index 0cfa8dd90d533..9718476a11ad7 100644 --- a/compiler/rustc_data_structures/src/lib.rs +++ b/compiler/rustc_data_structures/src/lib.rs @@ -10,6 +10,7 @@ #![allow(internal_features)] #![allow(rustc::default_hash_types)] #![allow(rustc::potential_query_instability)] +#![cfg_attr(bootstrap, feature(never_type))] #![cfg_attr(test, feature(test))] #![deny(unsafe_op_in_unsafe_fn)] #![feature(allocator_api)] @@ -24,7 +25,6 @@ #![feature(map_try_insert)] #![feature(min_specialization)] #![feature(negative_impls)] -#![feature(never_type)] #![feature(pattern_type_macro)] #![feature(pattern_types)] #![feature(ptr_alignment_type)] diff --git a/compiler/rustc_error_codes/src/error_codes/E0725.md b/compiler/rustc_error_codes/src/error_codes/E0725.md index 9bd321e5f82d6..20019bf59c36a 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0725.md +++ b/compiler/rustc_error_codes/src/error_codes/E0725.md @@ -4,8 +4,9 @@ command line flags. Erroneous code example: ```ignore (can't specify compiler flags from doctests) -#![feature(never_type)] // error: the feature `never_type` is not in - // the list of allowed features +#![feature(extern_item_impls)] +//~^ error: the feature `extern_item_impls` +// is not in the list of allowed features ``` Delete the offending feature attribute, or add it to the list of allowed diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index f4874652f6ace..68b63501019fd 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -5,11 +5,11 @@ // tidy-alphabetical-start #![allow(internal_features)] #![allow(rustc::direct_use_of_rustc_type_ir)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(associated_type_defaults)] #![feature(default_field_values)] #![feature(macro_metavar_expr_concat)] #![feature(negative_impls)] -#![feature(never_type)] #![feature(rustc_attrs)] // tidy-alphabetical-end diff --git a/compiler/rustc_hir/src/lib.rs b/compiler/rustc_hir/src/lib.rs index c2d9f879cd601..2a7500629243c 100644 --- a/compiler/rustc_hir/src/lib.rs +++ b/compiler/rustc_hir/src/lib.rs @@ -3,13 +3,13 @@ //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/hir.html // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(never_type))] #![feature(associated_type_defaults)] #![feature(closure_track_caller)] #![feature(const_default)] #![feature(const_trait_impl)] #![feature(derive_const)] #![feature(exhaustive_patterns)] -#![feature(never_type)] #![feature(variant_count)] #![recursion_limit = "256"] // tidy-alphabetical-end diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index 0721bfcab519a..393d500a7e095 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -56,10 +56,10 @@ This API is completely unstable and subject to change. */ // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(never_type))] #![feature(default_field_values)] #![feature(gen_blocks)] #![feature(iter_intersperse)] -#![feature(never_type)] #![feature(slice_partition_dedup)] #![feature(try_blocks)] #![feature(unwrap_infallible)] diff --git a/compiler/rustc_hir_typeck/src/lib.rs b/compiler/rustc_hir_typeck/src/lib.rs index 15729bc311e57..d610757c20468 100644 --- a/compiler/rustc_hir_typeck/src/lib.rs +++ b/compiler/rustc_hir_typeck/src/lib.rs @@ -1,8 +1,8 @@ // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(never_type))] #![feature(box_patterns)] #![feature(iter_intersperse)] #![feature(iter_order_by)] -#![feature(never_type)] #![feature(trim_prefix_suffix)] // tidy-alphabetical-end diff --git a/compiler/rustc_macros/src/lib.rs b/compiler/rustc_macros/src/lib.rs index 44969908b3f41..1e259fe1d1e39 100644 --- a/compiler/rustc_macros/src/lib.rs +++ b/compiler/rustc_macros/src/lib.rs @@ -1,6 +1,6 @@ // tidy-alphabetical-start #![allow(rustc::default_hash_types)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(proc_macro_diagnostic)] #![feature(proc_macro_tracked_env)] // tidy-alphabetical-end diff --git a/compiler/rustc_metadata/src/lib.rs b/compiler/rustc_metadata/src/lib.rs index 1dff5740ab3bc..e60473f339870 100644 --- a/compiler/rustc_metadata/src/lib.rs +++ b/compiler/rustc_metadata/src/lib.rs @@ -1,11 +1,11 @@ // tidy-alphabetical-start #![allow(internal_features)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(error_iter)] #![feature(file_buffered)] #![feature(gen_blocks)] #![feature(macro_metavar_expr)] #![feature(min_specialization)] -#![feature(never_type)] #![feature(proc_macro_internals)] #![feature(result_option_map_or_default)] #![feature(strip_circumfix)] diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs index 1d6132ba2a3ea..86ac816a22ac6 100644 --- a/compiler/rustc_middle/src/lib.rs +++ b/compiler/rustc_middle/src/lib.rs @@ -27,6 +27,7 @@ // tidy-alphabetical-start #![allow(internal_features)] #![allow(rustc::direct_use_of_rustc_type_ir)] +#![cfg_attr(bootstrap, feature(never_type))] #![cfg_attr(doc, feature(intra_doc_pointers))] #![feature(allocator_api)] #![feature(associated_type_defaults)] @@ -44,7 +45,6 @@ #![feature(gen_blocks)] #![feature(min_specialization)] #![feature(negative_impls)] -#![feature(never_type)] #![feature(ptr_alignment_type)] #![feature(range_bounds_is_empty)] #![feature(rustc_attrs)] diff --git a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs index 6aff85e77da5a..11ada1af38adf 100644 --- a/compiler/rustc_middle/src/ty/inhabitedness/mod.rs +++ b/compiler/rustc_middle/src/ty/inhabitedness/mod.rs @@ -5,7 +5,7 @@ //! //! # Example //! ```rust -//! #![feature(never_type)] +#![cfg_attr(bootstrap, doc = "#![feature(never_type)]")] //! mod a { //! pub mod b { //! pub struct SecretlyUninhabited { @@ -141,7 +141,7 @@ impl<'tcx> Ty<'tcx> { /// /// # Example /// ``` - /// #![feature(never_type)] + #[cfg_attr(bootstrap, doc = "#![feature(never_type)]")] /// # fn main() {} /// enum Void {} /// mod a { diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs index c5026c1c92aa6..5f7d799def7fc 100644 --- a/compiler/rustc_mir_dataflow/src/lib.rs +++ b/compiler/rustc_mir_dataflow/src/lib.rs @@ -1,9 +1,9 @@ // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(never_type))] #![feature(associated_type_defaults)] #![feature(box_patterns)] #![feature(exact_size_is_empty)] #![feature(file_buffered)] -#![feature(never_type)] #![feature(try_blocks)] // tidy-alphabetical-end diff --git a/compiler/rustc_pattern_analysis/src/constructor.rs b/compiler/rustc_pattern_analysis/src/constructor.rs index 6f07e922ceef4..f453931b77770 100644 --- a/compiler/rustc_pattern_analysis/src/constructor.rs +++ b/compiler/rustc_pattern_analysis/src/constructor.rs @@ -94,7 +94,6 @@ //! constructors of a type. For example, all the following is ok: //! //! ```rust,ignore(example) -//! # #![feature(never_type)] //! # #![feature(exhaustive_patterns)] //! fn foo(x: Option) { //! match x { @@ -114,8 +113,8 @@ //! Moreover, take the following: //! //! ```rust -//! # #![feature(never_type)] //! # #![feature(exhaustive_patterns)] +#![cfg_attr(bootstrap, doc = "#![feature(never_type)]")] //! # let x = None::; //! match x { //! None => {} diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 6eb5fe17bc169..50df88ca08e69 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -3942,8 +3942,8 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { /// A never pattern by definition indicates an unreachable case. For example, matching on /// `Result` could look like: /// ```rust - /// # #![feature(never_type)] /// # #![feature(never_patterns)] + #[cfg_attr(bootstrap, doc = "#![feature(never_type)]")] /// # fn bar(_x: u32) {} /// let foo: Result = Ok(0); /// match foo { @@ -4008,8 +4008,8 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { /// A never pattern by definition indicates an unreachable case. For example, destructuring a /// `Result` could look like: /// ```rust - /// # #![feature(never_type)] /// # #![feature(never_patterns)] + #[cfg_attr(bootstrap, doc = "#![feature(never_type)]")] /// # fn foo() -> Result { Ok(true) } /// let (Ok(x) | Err(&!)) = foo(); /// # let _ = x; diff --git a/compiler/rustc_serialize/src/lib.rs b/compiler/rustc_serialize/src/lib.rs index f4c7e5519536b..57cdb274be6f8 100644 --- a/compiler/rustc_serialize/src/lib.rs +++ b/compiler/rustc_serialize/src/lib.rs @@ -3,10 +3,10 @@ // tidy-alphabetical-start #![allow(internal_features)] #![allow(rustc::internal)] +#![cfg_attr(bootstrap, feature(never_type))] #![doc(test(attr(allow(unused_variables), deny(warnings), allow(internal_features))))] #![feature(core_intrinsics)] #![feature(min_specialization)] -#![feature(never_type)] #![feature(sized_hierarchy)] // tidy-alphabetical-end diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index f0c67e4b4f89c..a23bbe3535424 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -11,13 +11,13 @@ //! This API is completely unstable and subject to change. // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(never_type))] #![feature(associated_type_defaults)] #![feature(box_patterns)] #![feature(default_field_values)] #![feature(hash_set_entry)] #![feature(iter_intersperse)] #![feature(iterator_try_reduce)] -#![feature(never_type)] #![feature(strip_circumfix)] #![feature(try_blocks)] #![feature(unwrap_infallible)] diff --git a/compiler/rustc_transmute/src/lib.rs b/compiler/rustc_transmute/src/lib.rs index 732881f12d2cb..3f4d1967faef6 100644 --- a/compiler/rustc_transmute/src/lib.rs +++ b/compiler/rustc_transmute/src/lib.rs @@ -1,6 +1,6 @@ // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(never_type))] #![cfg_attr(test, feature(test))] -#![feature(never_type)] // tidy-alphabetical-end pub(crate) use rustc_data_structures::fx::{FxIndexMap as Map, FxIndexSet as Set}; diff --git a/compiler/rustc_ty_utils/src/lib.rs b/compiler/rustc_ty_utils/src/lib.rs index 5f42a134ec9af..3d2e7759b3a6a 100644 --- a/compiler/rustc_ty_utils/src/lib.rs +++ b/compiler/rustc_ty_utils/src/lib.rs @@ -5,10 +5,10 @@ //! This API is completely unstable and subject to change. // tidy-alphabetical-start +#![cfg_attr(bootstrap, feature(never_type))] #![feature(associated_type_defaults)] #![feature(box_patterns)] #![feature(iterator_try_collect)] -#![feature(never_type)] // tidy-alphabetical-end use rustc_middle::query::Providers; From 323d35cf271a68ab8efe13062a02e0e13a52a946 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 15 Aug 2025 02:32:46 +0200 Subject: [PATCH 04/14] remove `#![feature(never_type)]` from tests --- tests/codegen-llvm/enum/enum-debug-niche-2.rs | 1 - tests/mir-opt/building/eq_never_type.rs | 1 - tests/mir-opt/gvn_uninhabited.rs | 2 - tests/mir-opt/issue_72181_1.rs | 1 - tests/mir-opt/remove_never_const.rs | 2 - tests/mir-opt/ssa_unreachable_116212.rs | 2 - tests/mir-opt/uninhabited_enum.rs | 1 - tests/mir-opt/uninhabited_not_read.rs | 2 - tests/pretty/never-pattern.pp | 1 - tests/pretty/never-pattern.rs | 1 - .../intra-doc/prim-associated-traits.rs | 1 - tests/rustdoc-js/hof.rs | 2 - tests/rustdoc-js/never-search.rs | 2 - .../rustdoc-json/primitives/primitive_type.rs | 2 - tests/ui/asm/aarch64/type-check-2-2.rs | 2 +- tests/ui/asm/aarch64/type-check-2.rs | 2 +- tests/ui/asm/noreturn.rs | 1 - tests/ui/asm/x86_64/type-check-2.rs | 2 +- tests/ui/asm/x86_64/type-check-5.rs | 2 - tests/ui/binding/empty-types-in-patterns.rs | 10 +- tests/ui/borrowck/assign-never-type.rs | 4 +- tests/ui/borrowck/suggest-assign-rvalue.rs | 1 - .../match/pattern-matching-should-fail.rs | 2 - .../migrations/mir_calls_to_shims.fixed | 1 - .../migrations/mir_calls_to_shims.rs | 1 - .../only-inhabited-variant.rs | 1 - .../coercion/coerce-issue-49593-box-never.rs | 2 - tests/ui/coercion/coerce-to-bang-cast.rs | 2 - .../min_const_generics/complex-types.rs | 2 - tests/ui/consts/assert-type-intrinsics.rs | 1 - .../index-out-of-bounds-never-type.rs | 1 - .../const-eval/panic-assoc-never-type.rs | 1 - .../ui/consts/const-eval/panic-never-type.rs | 1 - tests/ui/consts/const-eval/raw-bytes.rs | 2 +- tests/ui/consts/const-eval/ub-enum.rs | 1 - tests/ui/consts/const-eval/ub-uninhabit.rs | 1 - tests/ui/consts/const-variant-count.rs | 1 - .../consts/extra-const-ub/detect-extra-ub.rs | 1 - .../let-irrefutable-pattern-ice-120337.rs | 1 - tests/ui/consts/validate_never_arrays.rs | 1 - tests/ui/coroutine/issue-93161.rs | 2 - tests/ui/coroutine/uninhabited-field.rs | 1 - .../feature-gate-exhaustive-patterns.rs | 2 - .../feature-gates/feature-gate-never_type.rs | 71 --------- .../feature-gate-never_type.stderr | 103 ------------ .../for-loop-while/break-while-condition.rs | 17 +- tests/ui/for-loop-while/loop-break-value.rs | 21 +-- .../intrinsics/panic-uninitialized-zeroed.rs | 146 +++++++++--------- tests/ui/layout/debug.rs | 2 +- tests/ui/layout/enum-scalar-pair-int-ptr.rs | 1 - tests/ui/layout/enum.rs | 13 +- tests/ui/layout/hexagon-enum.rs | 2 +- tests/ui/layout/struct.rs | 1 - tests/ui/layout/thumb-enum.rs | 2 +- tests/ui/lifetimes/issue-54378.rs | 2 - tests/ui/lint/invalid_value.rs | 2 +- .../unused-language-features.rs | 5 +- tests/ui/lint/unused/must-use-ops.rs | 1 - .../must_use-result-unit-uninhabited.rs | 1 - tests/ui/lint/unused/must_use-unit.rs | 1 - .../loops/loop-break-never-type-mismatch.rs | 2 - tests/ui/loops/loop-break-value.rs | 2 - tests/ui/mir/enum/wrap_break.rs | 1 - tests/ui/mir/mir_calls_to_shims.rs | 1 - tests/ui/never_type/basic/adjust_never.rs | 2 - tests/ui/never_type/basic/auto-traits.rs | 1 - .../basic/call-fn-never-arg-wrong-type.rs | 2 - .../ui/never_type/basic/call-fn-never-arg.rs | 1 - tests/ui/never_type/basic/cast-never.rs | 2 - tests/ui/never_type/basic/impl-for-never.rs | 3 - .../basic/never-assign-wrong-type.rs | 2 - .../never_type/basic/never-associated-type.rs | 2 - tests/ui/never_type/basic/never-result.rs | 1 - tests/ui/never_type/basic/never-type-arg.rs | 2 - .../ui/never_type/basic/never-type-rvalues.rs | 1 - .../never_type/basic/never_transmute_never.rs | 1 - tests/ui/never_type/diverging-place-match.rs | 2 - tests/ui/never_type/empty-never-array.rs | 2 - tests/ui/never_type/exhaustive_patterns.rs | 2 - .../from_infer_breaking_with_unit_fallback.rs | 2 +- .../try-block-never-type-fallback.rs | 1 - .../never_type/never-from-impl-is-reserved.rs | 2 - .../builtin_derives_on_adts_with_never.rs | 1 - tests/ui/never_type/regress/eq-never-types.rs | 2 - .../never-as-spec-default-associated-type.rs | 2 +- .../never_type/regress/never-in-range-pat.rs | 2 - .../regress/span-bug-issue-121445.rs | 2 - .../usefulness/always-inhabited-union-ref.rs | 1 - .../usefulness/empty-match-check-notes.rs | 1 - tests/ui/pattern/usefulness/empty-match.rs | 1 - tests/ui/pattern/usefulness/empty-types.rs | 1 - .../usefulness/explain-unreachable-pats.rs | 1 - tests/ui/pattern/usefulness/impl-trait.rs | 1 - .../usefulness/match-privately-empty.rs | 1 - tests/ui/pattern/usefulness/slice_of_empty.rs | 1 - tests/ui/pattern/usefulness/uninhabited.rs | 1 - tests/ui/print_type_sizes/uninhabited.rs | 2 - .../raw-ref-op/never-place-isnt-diverging.rs | 2 - tests/ui/reachable/expr_add.rs | 1 - tests/ui/reachable/expr_assign.rs | 1 - tests/ui/reachable/expr_call.rs | 1 - tests/ui/reachable/expr_method.rs | 1 - tests/ui/reachable/expr_type.rs | 2 +- tests/ui/reachable/expr_unary.rs | 1 - tests/ui/reachable/guard_read_for_never.rs | 2 +- tests/ui/reachable/nested_type_ascription.rs | 1 - tests/ui/reachable/never-assign-dead-code.rs | 1 - .../ui/reachable/type_ascribe_never_field.rs | 1 - tests/ui/reachable/unreachable-try-pattern.rs | 2 +- tests/ui/reachable/unwarned-match-on-never.rs | 2 - ...ICE-133063-never-arm-no-otherwise-block.rs | 1 - .../ICE-133117-duplicate-never-arm.rs | 1 - .../never-pattern-is-a-read.rs | 3 +- .../uninhabited/auxiliary/uninhabited.rs | 1 - .../uninhabited/coercions.rs | 1 - .../uninhabited/coercions_same_crate.rs | 2 - .../uninhabited/indirect_match.rs | 1 - .../uninhabited/indirect_match_same_crate.rs | 1 - ...indirect_match_with_exhaustive_patterns.rs | 1 - ...tch_with_exhaustive_patterns_same_crate.rs | 1 - .../issue-65157-repeated-match-arm.rs | 1 - .../uninhabited/match.rs | 1 - .../uninhabited/match_same_crate.rs | 1 - .../match_with_exhaustive_patterns.rs | 1 - ...tch_with_exhaustive_patterns_same_crate.rs | 1 - .../uninhabited/patterns_same_crate.rs | 1 - .../illformed-element-type.rs | 1 - tests/ui/self/dispatch_from_dyn_zst.rs | 2 +- .../stability-attribute-trait-impl.rs | 2 +- tests/ui/statics/uninhabited-static.rs | 2 - tests/ui/structs-enums/type-sizes.rs | 1 - tests/ui/symbol-names/types.rs | 1 - tests/ui/traits/const-traits/const-drop.rs | 1 - .../const-traits/reservation-impl-ice.rs | 2 +- .../typeck/resolve-before-checking-never.rs | 2 - .../traits/reservation-impl/non-lattice-ok.rs | 17 +- tests/ui/transmutability/char.rs | 1 - tests/ui/uninhabited/projection.rs | 2 +- .../ui/uninhabited/uninhabited-irrefutable.rs | 1 - tests/ui/uninhabited/uninhabited-patterns.rs | 1 - .../uninhabited/uninhabited-unstable-field.rs | 1 - tests/ui/unpretty/exhaustive.expanded.stdout | 1 - tests/ui/unpretty/exhaustive.rs | 1 - 143 files changed, 130 insertions(+), 467 deletions(-) delete mode 100644 tests/ui/feature-gates/feature-gate-never_type.rs delete mode 100644 tests/ui/feature-gates/feature-gate-never_type.stderr diff --git a/tests/codegen-llvm/enum/enum-debug-niche-2.rs b/tests/codegen-llvm/enum/enum-debug-niche-2.rs index 80a4081f15b10..fd9c18583f375 100644 --- a/tests/codegen-llvm/enum/enum-debug-niche-2.rs +++ b/tests/codegen-llvm/enum/enum-debug-niche-2.rs @@ -7,7 +7,6 @@ // CHECK: {{.*}}DICompositeType{{.*}}tag: DW_TAG_variant_part,{{.*}}size: 32,{{.*}} // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Placeholder",{{.*}}extraData: i32 -1{{[,)].*}} // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i32 0{{[,)].*}} -#![feature(never_type)] #[derive(Copy, Clone)] pub struct Entity { diff --git a/tests/mir-opt/building/eq_never_type.rs b/tests/mir-opt/building/eq_never_type.rs index 762f20ee1e104..b805904b4f379 100644 --- a/tests/mir-opt/building/eq_never_type.rs +++ b/tests/mir-opt/building/eq_never_type.rs @@ -1,6 +1,5 @@ //@ compile-flags: -Zmir-opt-level=0 //@ skip-filecheck -#![feature(never_type)] #![allow(unreachable_code)] // EMIT_MIR eq_never_type._f.built.after.mir diff --git a/tests/mir-opt/gvn_uninhabited.rs b/tests/mir-opt/gvn_uninhabited.rs index 78afc0efef900..106d7862471a5 100644 --- a/tests/mir-opt/gvn_uninhabited.rs +++ b/tests/mir-opt/gvn_uninhabited.rs @@ -3,8 +3,6 @@ // EMIT_MIR_FOR_EACH_PANIC_STRATEGY //@ skip-filecheck -#![feature(never_type)] - #[derive(Copy, Clone)] pub enum E { A(!, u32), diff --git a/tests/mir-opt/issue_72181_1.rs b/tests/mir-opt/issue_72181_1.rs index 1e7c70c449d98..c20ae49c75bb0 100644 --- a/tests/mir-opt/issue_72181_1.rs +++ b/tests/mir-opt/issue_72181_1.rs @@ -2,7 +2,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 {} diff --git a/tests/mir-opt/remove_never_const.rs b/tests/mir-opt/remove_never_const.rs index 9307b8e760508..ad76518ef21bd 100644 --- a/tests/mir-opt/remove_never_const.rs +++ b/tests/mir-opt/remove_never_const.rs @@ -3,8 +3,6 @@ // consts in codegen. We also have tests for this that catches the error, see // tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs. -#![feature(never_type)] - struct PrintName(T); impl PrintName { diff --git a/tests/mir-opt/ssa_unreachable_116212.rs b/tests/mir-opt/ssa_unreachable_116212.rs index f8550556f54d0..14a2195275f7b 100644 --- a/tests/mir-opt/ssa_unreachable_116212.rs +++ b/tests/mir-opt/ssa_unreachable_116212.rs @@ -1,8 +1,6 @@ //@ skip-filecheck // Regression test for issue #116212. -#![feature(never_type)] - use std::mem::MaybeUninit; struct Foo { diff --git a/tests/mir-opt/uninhabited_enum.rs b/tests/mir-opt/uninhabited_enum.rs index 2ef76449e3cc3..4dc05eb8edd99 100644 --- a/tests/mir-opt/uninhabited_enum.rs +++ b/tests/mir-opt/uninhabited_enum.rs @@ -2,7 +2,6 @@ // // check that we mark blocks with `!` locals as unreachable. // (and currently don't do the same for other uninhabited types) -#![feature(never_type)] #[derive(Copy, Clone)] pub enum Void {} diff --git a/tests/mir-opt/uninhabited_not_read.rs b/tests/mir-opt/uninhabited_not_read.rs index c1598d0301f67..526849cfc612e 100644 --- a/tests/mir-opt/uninhabited_not_read.rs +++ b/tests/mir-opt/uninhabited_not_read.rs @@ -5,8 +5,6 @@ // This would introduce a `! -> ()` coercion which would // be UB if we didn't disallow this explicitly. -#![feature(never_type)] - // EMIT_MIR uninhabited_not_read.main.SimplifyLocals-final.after.mir fn main() { // With a type annotation diff --git a/tests/pretty/never-pattern.pp b/tests/pretty/never-pattern.pp index bb95a1ed442a4..133a636ecdc40 100644 --- a/tests/pretty/never-pattern.pp +++ b/tests/pretty/never-pattern.pp @@ -6,7 +6,6 @@ #![allow(incomplete_features)] #![feature(never_patterns)] -#![feature(never_type)] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/never-pattern.rs b/tests/pretty/never-pattern.rs index fe170bafc666a..ea9aaaa10514f 100644 --- a/tests/pretty/never-pattern.rs +++ b/tests/pretty/never-pattern.rs @@ -4,7 +4,6 @@ #![allow(incomplete_features)] #![feature(never_patterns)] -#![feature(never_type)] fn f(x: Result) { _ = match x { diff --git a/tests/rustdoc-html/intra-doc/prim-associated-traits.rs b/tests/rustdoc-html/intra-doc/prim-associated-traits.rs index 41a3931222fc1..12fe8b9d41bfd 100644 --- a/tests/rustdoc-html/intra-doc/prim-associated-traits.rs +++ b/tests/rustdoc-html/intra-doc/prim-associated-traits.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] use std::str::FromStr; //@ has 'prim_associated_traits/struct.Number.html' '//a[@href="{{channel}}/std/primitive.f64.html#method.from_str"]' 'f64::from_str()' diff --git a/tests/rustdoc-js/hof.rs b/tests/rustdoc-js/hof.rs index e4d550250e8ad..375d12e1adf78 100644 --- a/tests/rustdoc-js/hof.rs +++ b/tests/rustdoc-js/hof.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - pub struct First(T); pub struct Second(T); pub struct Third(T); diff --git a/tests/rustdoc-js/never-search.rs b/tests/rustdoc-js/never-search.rs index 800f9ead8b35f..57175bc1a2a6d 100644 --- a/tests/rustdoc-js/never-search.rs +++ b/tests/rustdoc-js/never-search.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - #[allow(nonstandard_style)] pub struct never; diff --git a/tests/rustdoc-json/primitives/primitive_type.rs b/tests/rustdoc-json/primitives/primitive_type.rs index a0d34218b805d..ff9bdc0c173bf 100644 --- a/tests/rustdoc-json/primitives/primitive_type.rs +++ b/tests/rustdoc-json/primitives/primitive_type.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - //@ is "$.index[?(@.name=='PrimNever')].visibility" \"public\" //@ is "$.index[?(@.name=='PrimNever')].inner.type_alias.type.primitive" \"never\" pub type PrimNever = !; diff --git a/tests/ui/asm/aarch64/type-check-2-2.rs b/tests/ui/asm/aarch64/type-check-2-2.rs index 4b8ee1d922986..d729212c4d06a 100644 --- a/tests/ui/asm/aarch64/type-check-2-2.rs +++ b/tests/ui/asm/aarch64/type-check-2-2.rs @@ -1,6 +1,6 @@ //@ only-aarch64 -#![feature(repr_simd, never_type)] +#![feature(repr_simd)] use std::arch::{asm, global_asm}; diff --git a/tests/ui/asm/aarch64/type-check-2.rs b/tests/ui/asm/aarch64/type-check-2.rs index ad223b799b786..0faa6d904a5ce 100644 --- a/tests/ui/asm/aarch64/type-check-2.rs +++ b/tests/ui/asm/aarch64/type-check-2.rs @@ -1,6 +1,6 @@ //@ only-aarch64 -#![feature(repr_simd, never_type)] +#![feature(repr_simd)] use std::arch::{asm, global_asm}; diff --git a/tests/ui/asm/noreturn.rs b/tests/ui/asm/noreturn.rs index 5351d4bc47332..59794275d02bd 100644 --- a/tests/ui/asm/noreturn.rs +++ b/tests/ui/asm/noreturn.rs @@ -2,7 +2,6 @@ //@ check-pass //@ reference: asm.options.supported-options.noreturn -#![feature(never_type)] #![crate_type = "rlib"] use std::arch::asm; diff --git a/tests/ui/asm/x86_64/type-check-2.rs b/tests/ui/asm/x86_64/type-check-2.rs index c63042298da30..ed5ad6fbc4591 100644 --- a/tests/ui/asm/x86_64/type-check-2.rs +++ b/tests/ui/asm/x86_64/type-check-2.rs @@ -1,6 +1,6 @@ //@ only-x86_64 -#![feature(repr_simd, never_type)] +#![feature(repr_simd)] use std::arch::{asm, global_asm}; diff --git a/tests/ui/asm/x86_64/type-check-5.rs b/tests/ui/asm/x86_64/type-check-5.rs index 81e096a72300a..f181fe44a3f12 100644 --- a/tests/ui/asm/x86_64/type-check-5.rs +++ b/tests/ui/asm/x86_64/type-check-5.rs @@ -1,7 +1,5 @@ //@ only-x86_64 -#![feature(never_type)] - use std::arch::asm; fn main() { diff --git a/tests/ui/binding/empty-types-in-patterns.rs b/tests/ui/binding/empty-types-in-patterns.rs index c6765a1cecef5..06cfec20e1553 100644 --- a/tests/ui/binding/empty-types-in-patterns.rs +++ b/tests/ui/binding/empty-types-in-patterns.rs @@ -1,9 +1,7 @@ //@ run-pass //@ edition: 2024 -#![feature(never_type)] #![feature(exhaustive_patterns)] - #![allow(unreachable_patterns)] #![allow(unreachable_code)] #![allow(unused_variables)] @@ -25,13 +23,13 @@ fn foo(z: !) { fn bar(nevers: &[!]) { match nevers { - &[] => (), + &[] => (), }; match nevers { - &[] => (), - &[_] => (), - &[_, _, _, ..] => (), + &[] => (), + &[_] => (), + &[_, _, _, ..] => (), }; } diff --git a/tests/ui/borrowck/assign-never-type.rs b/tests/ui/borrowck/assign-never-type.rs index 17993bfc08f47..ee4ab9b4b8aaf 100644 --- a/tests/ui/borrowck/assign-never-type.rs +++ b/tests/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/tests/ui/borrowck/suggest-assign-rvalue.rs b/tests/ui/borrowck/suggest-assign-rvalue.rs index aaca9d47f0aee..66acbf7235b7f 100644 --- a/tests/ui/borrowck/suggest-assign-rvalue.rs +++ b/tests/ui/borrowck/suggest-assign-rvalue.rs @@ -1,5 +1,4 @@ #![allow(dead_code)] -#![feature(never_type)] #[derive(Debug, Default)] struct Demo {} diff --git a/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs b/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs index 377b1ab10c4b2..592ca5a6a4a8b 100644 --- a/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs +++ b/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.rs @@ -1,7 +1,5 @@ //@ edition:2021 -#![feature(never_type)] - // Should fake read the discriminant and throw an error fn test1() { let x: !; diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed index 6b73969d1e9ce..a27ea41a6bc74 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.fixed @@ -5,7 +5,6 @@ #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here #![feature(fn_traits)] -#![feature(never_type)] use std::panic; diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs index 9fdbf7c20a80e..609727e975c94 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.rs @@ -5,7 +5,6 @@ #![deny(rust_2021_incompatible_closure_captures)] //~^ NOTE: the lint level is defined here #![feature(fn_traits)] -#![feature(never_type)] use std::panic; diff --git a/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.rs b/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.rs index 4638387347269..bea32133653a9 100644 --- a/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.rs +++ b/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.rs @@ -5,7 +5,6 @@ //@ revisions: normal exhaustive_patterns //@ edition:2021 #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))] -#![feature(never_type)] pub fn main() { let mut r = Result::::Err((0, 0)); diff --git a/tests/ui/coercion/coerce-issue-49593-box-never.rs b/tests/ui/coercion/coerce-issue-49593-box-never.rs index 751450a7fb435..6b1ec2a849d6d 100644 --- a/tests/ui/coercion/coerce-issue-49593-box-never.rs +++ b/tests/ui/coercion/coerce-issue-49593-box-never.rs @@ -15,8 +15,6 @@ // //@[e2024] check-pass -#![feature(never_type)] - use std::error::Error; use std::mem; diff --git a/tests/ui/coercion/coerce-to-bang-cast.rs b/tests/ui/coercion/coerce-to-bang-cast.rs index 85598a42eccd9..7fb9235ea3669 100644 --- a/tests/ui/coercion/coerce-to-bang-cast.rs +++ b/tests/ui/coercion/coerce-to-bang-cast.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - fn cast_a() { let y = {return; 22} as !; //~^ ERROR non-primitive cast diff --git a/tests/ui/const-generics/min_const_generics/complex-types.rs b/tests/ui/const-generics/min_const_generics/complex-types.rs index 057bd5af89ef7..f3d103d46ce65 100644 --- a/tests/ui/const-generics/min_const_generics/complex-types.rs +++ b/tests/ui/const-generics/min_const_generics/complex-types.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - struct Foo; //~^ ERROR `[u8; 0]` is forbidden diff --git a/tests/ui/consts/assert-type-intrinsics.rs b/tests/ui/consts/assert-type-intrinsics.rs index 91c8dd00e89f9..3390db9227174 100644 --- a/tests/ui/consts/assert-type-intrinsics.rs +++ b/tests/ui/consts/assert-type-intrinsics.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![feature(core_intrinsics)] use std::intrinsics; diff --git a/tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs b/tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs index dbe507e3cd137..a9f8e3ed826ed 100644 --- a/tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs +++ b/tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs @@ -2,7 +2,6 @@ //@ ignore-parallel-frontend post-monomorphization errors // Regression test for #66975 #![warn(unconditional_panic)] -#![feature(never_type)] struct PrintName(T); diff --git a/tests/ui/consts/const-eval/panic-assoc-never-type.rs b/tests/ui/consts/const-eval/panic-assoc-never-type.rs index a0a5ba36bfe4f..3fe25f582d823 100644 --- a/tests/ui/consts/const-eval/panic-assoc-never-type.rs +++ b/tests/ui/consts/const-eval/panic-assoc-never-type.rs @@ -2,7 +2,6 @@ //@ dont-require-annotations: NOTE // Regression test for #66975 -#![feature(never_type)] struct PrintName; diff --git a/tests/ui/consts/const-eval/panic-never-type.rs b/tests/ui/consts/const-eval/panic-never-type.rs index d9b46e70b357d..1dbaa85377f31 100644 --- a/tests/ui/consts/const-eval/panic-never-type.rs +++ b/tests/ui/consts/const-eval/panic-never-type.rs @@ -1,5 +1,4 @@ // Regression test for #66975 -#![feature(never_type)] const VOID: ! = panic!(); //~^ ERROR explicit panic diff --git a/tests/ui/consts/const-eval/raw-bytes.rs b/tests/ui/consts/const-eval/raw-bytes.rs index d63e1d5b062cf..e2e13d3312b8b 100644 --- a/tests/ui/consts/const-eval/raw-bytes.rs +++ b/tests/ui/consts/const-eval/raw-bytes.rs @@ -5,7 +5,7 @@ //@ dont-require-annotations: NOTE //@ ignore-parallel-frontend different alloc ids #![allow(invalid_value, unnecessary_transmutes)] -#![feature(never_type, rustc_attrs, ptr_metadata, slice_from_ptr_range, const_slice_from_ptr_range)] +#![feature(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-enum.rs b/tests/ui/consts/const-eval/ub-enum.rs index 8feb78e0b11e8..10dd4b94fe0b6 100644 --- a/tests/ui/consts/const-eval/ub-enum.rs +++ b/tests/ui/consts/const-eval/ub-enum.rs @@ -5,7 +5,6 @@ //@ normalize-stderr: "0x[0-9](\.\.|\])" -> "0x%$1" //@ dont-require-annotations: NOTE //@ ignore-parallel-frontend different alloc ids -#![feature(never_type)] #![allow(invalid_value, unnecessary_transmutes)] use std::mem; diff --git a/tests/ui/consts/const-eval/ub-uninhabit.rs b/tests/ui/consts/const-eval/ub-uninhabit.rs index 188ad768a0e98..2b2edf64e7e12 100644 --- a/tests/ui/consts/const-eval/ub-uninhabit.rs +++ b/tests/ui/consts/const-eval/ub-uninhabit.rs @@ -4,7 +4,6 @@ //@ dont-require-annotations: NOTE #![feature(core_intrinsics)] -#![feature(never_type)] use std::{intrinsics, mem}; diff --git a/tests/ui/consts/const-variant-count.rs b/tests/ui/consts/const-variant-count.rs index c554c3b0ff418..8faee50a756ef 100644 --- a/tests/ui/consts/const-variant-count.rs +++ b/tests/ui/consts/const-variant-count.rs @@ -1,7 +1,6 @@ //@ run-pass #![allow(dead_code, enum_intrinsics_non_enums)] #![feature(variant_count)] -#![feature(never_type)] use std::mem::variant_count; diff --git a/tests/ui/consts/extra-const-ub/detect-extra-ub.rs b/tests/ui/consts/extra-const-ub/detect-extra-ub.rs index 60086acc3707e..52bcb07ee298a 100644 --- a/tests/ui/consts/extra-const-ub/detect-extra-ub.rs +++ b/tests/ui/consts/extra-const-ub/detect-extra-ub.rs @@ -1,7 +1,6 @@ //@ revisions: no_flag with_flag //@ [no_flag] check-pass //@ [with_flag] compile-flags: -Zextra-const-ub-checks -#![feature(never_type)] #![allow(unnecessary_transmutes)] use std::mem::transmute; diff --git a/tests/ui/consts/let-irrefutable-pattern-ice-120337.rs b/tests/ui/consts/let-irrefutable-pattern-ice-120337.rs index 24ff0a1f0719c..af4ac479905ab 100644 --- a/tests/ui/consts/let-irrefutable-pattern-ice-120337.rs +++ b/tests/ui/consts/let-irrefutable-pattern-ice-120337.rs @@ -4,7 +4,6 @@ // variant. (N.B. this is UB, but not currently detected by rustc) // //@ check-pass -#![feature(never_type)] #[derive(Copy, Clone)] pub enum E { A(!), } diff --git a/tests/ui/consts/validate_never_arrays.rs b/tests/ui/consts/validate_never_arrays.rs index b0ea064188bcf..c67681b0002c8 100644 --- a/tests/ui/consts/validate_never_arrays.rs +++ b/tests/ui/consts/validate_never_arrays.rs @@ -1,7 +1,6 @@ // Strip out raw byte dumps to make comparison platform-independent: //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)" //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?()?─*╼ )+ *│.*" -> "HEX_DUMP" -#![feature(never_type)] const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; //~ ERROR invalid value const _: &[!; 0] = unsafe { &*(1_usize as *const [!; 0]) }; // ok diff --git a/tests/ui/coroutine/issue-93161.rs b/tests/ui/coroutine/issue-93161.rs index 0c7be8407d0b9..fd76f3fbf4bed 100644 --- a/tests/ui/coroutine/issue-93161.rs +++ b/tests/ui/coroutine/issue-93161.rs @@ -1,8 +1,6 @@ //@ edition:2021 //@ run-pass -#![feature(never_type)] - use std::future::Future; // See if we can run a basic `async fn` diff --git a/tests/ui/coroutine/uninhabited-field.rs b/tests/ui/coroutine/uninhabited-field.rs index 6debd89ef4a9e..a349093570d19 100644 --- a/tests/ui/coroutine/uninhabited-field.rs +++ b/tests/ui/coroutine/uninhabited-field.rs @@ -3,7 +3,6 @@ #![allow(unused)] #![feature(coroutine_trait)] #![feature(coroutines, stmt_expr_attributes)] -#![feature(never_type)] use std::assert_matches; use std::ops::Coroutine; use std::ops::CoroutineState; diff --git a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs index 7989159369275..b5c9a93533e76 100644 --- a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs +++ b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - fn foo() -> Result { Ok(123) } diff --git a/tests/ui/feature-gates/feature-gate-never_type.rs b/tests/ui/feature-gates/feature-gate-never_type.rs deleted file mode 100644 index c678d55acd0ff..0000000000000 --- a/tests/ui/feature-gates/feature-gate-never_type.rs +++ /dev/null @@ -1,71 +0,0 @@ -// Test that ! errors when used in illegal positions with feature(never_type) disabled - -mod ungated { - //! Functions returning `!` directly (as in `-> !`) and function pointers doing the same are - //! allowed with no gates. - - fn panic() -> ! { - panic!(); - } - - fn takes_fn_ptr(x: fn() -> !) -> ! { - x() - } -} - -mod gated { - //! All other mentions of the type are gated. - - 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 - type Meow = fn() -> Result<(), !>; //~ ERROR type is experimental - - impl Foo for Meeshka { - type Wub = !; //~ ERROR type is experimental - } - - fn look_ma_no_feature_gate !>() {} //~ ERROR type is experimental - - fn tadam(f: &dyn Fn() -> !) {} //~ ERROR type is experimental - - fn toudoum() -> impl Fn() -> ! { //~ ERROR type is experimental - || panic!() - } - - fn infallible() -> Result<(), !> { //~ ERROR type is experimental - Ok(()) - } -} - -mod hack { - //! There is a hack which, by exploiting the fact that `fn() -> !` can be named stably and that - //! type system does not interact with stability, allows one to mention the never type while - //! avoiding any and all feature gates. It is generally considered a "hack"/compiler bug, and - //! thus users of this hack resign stability guarantees. However, fixing this is more trouble - //! than good. - - trait F { - type Ret; - } - - impl F for fn() -> T { - type Ret = T; - } - - type Never = ! as F>::Ret; - - fn damn( - never: Never, - _: &dyn Fn() -> Never, - ) -> (impl Fn() -> Never, &'static mut Never, Never, u8) { - (|| never, never, never, never) - } -} - -fn main() {} diff --git a/tests/ui/feature-gates/feature-gate-never_type.stderr b/tests/ui/feature-gates/feature-gate-never_type.stderr deleted file mode 100644 index 475aac433b84d..0000000000000 --- a/tests/ui/feature-gates/feature-gate-never_type.stderr +++ /dev/null @@ -1,103 +0,0 @@ -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:23:21 - | -LL | type Ma = (u32, !, i32); - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:24:24 - | -LL | type Meeshka = Vec; - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:25:28 - | -LL | type Mow = &'static fn(!) -> !; - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:26:31 - | -LL | type Skwoz = &'static mut !; - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:27:36 - | -LL | type Meow = fn() -> Result<(), !>; - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:30:20 - | -LL | type Wub = !; - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:33:47 - | -LL | fn look_ma_no_feature_gate !>() {} - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:35:30 - | -LL | fn tadam(f: &dyn Fn() -> !) {} - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:37:34 - | -LL | fn toudoum() -> impl Fn() -> ! { - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: the `!` type is experimental - --> $DIR/feature-gate-never_type.rs:41:35 - | -LL | fn infallible() -> Result<(), !> { - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 10 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/for-loop-while/break-while-condition.rs b/tests/ui/for-loop-while/break-while-condition.rs index 6064e6ab00235..f61ef6b4898e9 100644 --- a/tests/ui/for-loop-while/break-while-condition.rs +++ b/tests/ui/for-loop-while/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 _: ! = { + 'a: while break 'a {} + //~^ ERROR mismatched types }; } 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/tests/ui/for-loop-while/loop-break-value.rs b/tests/ui/for-loop-while/loop-break-value.rs index f46524b6d2781..53183899fae1d 100644 --- a/tests/ui/for-loop-while/loop-break-value.rs +++ b/tests/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/tests/ui/intrinsics/panic-uninitialized-zeroed.rs b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs index 00fb2b029f9aa..df340f259a5ab 100644 --- a/tests/ui/intrinsics/panic-uninitialized-zeroed.rs +++ b/tests/ui/intrinsics/panic-uninitialized-zeroed.rs @@ -8,13 +8,11 @@ //@ edition:2024 #![allow(deprecated, invalid_value, unreachable_code)] -#![feature(never_type, rustc_private)] +#![feature(rustc_private)] -use std::{ - mem::{self, MaybeUninit, ManuallyDrop}, - ptr::NonNull, - num, -}; +use std::mem::{self, ManuallyDrop, MaybeUninit}; +use std::num; +use std::ptr::NonNull; #[cfg(target_os = "linux")] extern crate libc; @@ -28,7 +26,9 @@ struct Foo { enum Bar {} #[allow(dead_code)] -enum OneVariant { Variant(i32) } +enum OneVariant { + Variant(i32), +} #[allow(dead_code, non_camel_case_types)] enum OneVariant_NonZero { @@ -73,7 +73,7 @@ enum ZeroIsValid { #[track_caller] fn test_panic_msg T) + 'static>(op: F, msg: &str) { - use std::{panic, env, process}; + use std::{env, panic, process}; // The tricky part is that we can't just run `op`, as that would *abort* the process. // So instead, we reinvoke this process with the caller location as argument. @@ -96,7 +96,12 @@ fn test_panic_msg T) + 'static>(op: F, msg: &str) { let res = cmd.output().unwrap(); assert!(!res.status.success(), "test did not fail"); let stderr = String::from_utf8_lossy(&res.stderr); - assert!(stderr.contains(msg), "test did not contain expected output: looking for {:?}, output:\n{}", msg, stderr); + assert!( + stderr.contains(msg), + "test did not contain expected output: looking for {:?}, output:\n{}", + msg, + stderr + ); } } @@ -126,276 +131,267 @@ fn main() { // Uninhabited types test_panic_msg( || mem::uninitialized::(), - "attempted to instantiate uninhabited type `!`" - ); - test_panic_msg( - || mem::zeroed::(), - "attempted to instantiate uninhabited type `!`" + "attempted to instantiate uninhabited type `!`", ); + test_panic_msg(|| mem::zeroed::(), "attempted to instantiate uninhabited type `!`"); test_panic_msg( || MaybeUninit::::uninit().assume_init(), - "attempted to instantiate uninhabited type `!`" + "attempted to instantiate uninhabited type `!`", ); test_panic_msg( || mem::uninitialized::(), - "attempted to instantiate uninhabited type `Foo`" - ); - test_panic_msg( - || mem::zeroed::(), - "attempted to instantiate uninhabited type `Foo`" + "attempted to instantiate uninhabited type `Foo`", ); + test_panic_msg(|| mem::zeroed::(), "attempted to instantiate uninhabited type `Foo`"); test_panic_msg( || MaybeUninit::::uninit().assume_init(), - "attempted to instantiate uninhabited type `Foo`" + "attempted to instantiate uninhabited type `Foo`", ); test_panic_msg( || mem::uninitialized::(), - "attempted to instantiate uninhabited type `Bar`" - ); - test_panic_msg( - || mem::zeroed::(), - "attempted to instantiate uninhabited type `Bar`" + "attempted to instantiate uninhabited type `Bar`", ); + test_panic_msg(|| mem::zeroed::(), "attempted to instantiate uninhabited type `Bar`"); test_panic_msg( || MaybeUninit::::uninit().assume_init(), - "attempted to instantiate uninhabited type `Bar`" + "attempted to instantiate uninhabited type `Bar`", ); test_panic_msg( || mem::uninitialized::<[Foo; 2]>(), - "attempted to instantiate uninhabited type `[Foo; 2]`" + "attempted to instantiate uninhabited type `[Foo; 2]`", ); test_panic_msg( || mem::zeroed::<[Foo; 2]>(), - "attempted to instantiate uninhabited type `[Foo; 2]`" + "attempted to instantiate uninhabited type `[Foo; 2]`", ); test_panic_msg( || MaybeUninit::<[Foo; 2]>::uninit().assume_init(), - "attempted to instantiate uninhabited type `[Foo; 2]`" + "attempted to instantiate uninhabited type `[Foo; 2]`", ); test_panic_msg( || mem::uninitialized::<[Bar; 2]>(), - "attempted to instantiate uninhabited type `[Bar; 2]`" + "attempted to instantiate uninhabited type `[Bar; 2]`", ); test_panic_msg( || mem::zeroed::<[Bar; 2]>(), - "attempted to instantiate uninhabited type `[Bar; 2]`" + "attempted to instantiate uninhabited type `[Bar; 2]`", ); test_panic_msg( || MaybeUninit::<[Bar; 2]>::uninit().assume_init(), - "attempted to instantiate uninhabited type `[Bar; 2]`" + "attempted to instantiate uninhabited type `[Bar; 2]`", ); // Types that don't allow either. test_panic_msg( || mem::zeroed::<&i32>(), - "attempted to zero-initialize type `&i32`, which is invalid" + "attempted to zero-initialize type `&i32`, which is invalid", ); test_panic_msg( || mem::uninitialized::<&i32>(), - "attempted to leave type `&i32` uninitialized, which is invalid" + "attempted to leave type `&i32` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::>(), - "attempted to zero-initialize type `alloc::boxed::Box<[i32; 0]>`, which is invalid" + "attempted to zero-initialize type `alloc::boxed::Box<[i32; 0]>`, which is invalid", ); test_panic_msg( || mem::uninitialized::>(), - "attempted to leave type `alloc::boxed::Box<[i32; 0]>` uninitialized, which is invalid" + "attempted to leave type `alloc::boxed::Box<[i32; 0]>` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::>(), - "attempted to zero-initialize type `alloc::boxed::Box`, which is invalid" + "attempted to zero-initialize type `alloc::boxed::Box`, which is invalid", ); test_panic_msg( || mem::uninitialized::>(), - "attempted to leave type `alloc::boxed::Box` uninitialized, which is invalid" + "attempted to leave type `alloc::boxed::Box` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::<&[i32]>(), - "attempted to zero-initialize type `&[i32]`, which is invalid" + "attempted to zero-initialize type `&[i32]`, which is invalid", ); test_panic_msg( || mem::uninitialized::<&[i32]>(), - "attempted to leave type `&[i32]` uninitialized, which is invalid" + "attempted to leave type `&[i32]` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::<&(u8, [u8])>(), - "attempted to zero-initialize type `&(u8, [u8])`, which is invalid" + "attempted to zero-initialize type `&(u8, [u8])`, which is invalid", ); test_panic_msg( || mem::uninitialized::<&(u8, [u8])>(), - "attempted to leave type `&(u8, [u8])` uninitialized, which is invalid" + "attempted to leave type `&(u8, [u8])` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::<&dyn Send>(), - "attempted to zero-initialize type `&dyn core::marker::Send`, which is invalid" + "attempted to zero-initialize type `&dyn core::marker::Send`, which is invalid", ); test_panic_msg( || mem::uninitialized::<&dyn Send>(), - "attempted to leave type `&dyn core::marker::Send` uninitialized, which is invalid" + "attempted to leave type `&dyn core::marker::Send` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::<*const dyn Send>(), - "attempted to zero-initialize type `*const dyn core::marker::Send`, which is invalid" + "attempted to zero-initialize type `*const dyn core::marker::Send`, which is invalid", ); test_panic_msg( || mem::uninitialized::<*const dyn Send>(), - "attempted to leave type `*const dyn core::marker::Send` uninitialized, which is invalid" + "attempted to leave type `*const dyn core::marker::Send` uninitialized, which is invalid", ); test_panic_msg( || mem::uninitialized::(), "attempted to leave type `NoNullVariant` uninitialized, \ - which is invalid" + which is invalid", ); test_panic_msg( || mem::zeroed::(), "attempted to zero-initialize type `NoNullVariant`, \ - which is invalid" + which is invalid", ); test_panic_msg( || mem::zeroed::(), "attempted to zero-initialize type `OneVariant_Ref`, \ - which is invalid" + which is invalid", ); test_panic_msg( || mem::uninitialized::(), - "attempted to leave type `OneVariant_Ref` uninitialized, which is invalid" + "attempted to leave type `OneVariant_Ref` uninitialized, which is invalid", ); // Types where both are invalid, but we allow uninit since the 0x01-filling is not LLVM UB. test_panic_msg( || mem::zeroed::(), - "attempted to zero-initialize type `fn()`, which is invalid" + "attempted to zero-initialize type `fn()`, which is invalid", ); test_panic_msg_only_if_strict( || mem::uninitialized::(), - "attempted to leave type `fn()` uninitialized, which is invalid" + "attempted to leave type `fn()` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::<&()>(), - "attempted to zero-initialize type `&()`, which is invalid" + "attempted to zero-initialize type `&()`, which is invalid", ); test_panic_msg_only_if_strict( || mem::uninitialized::<&()>(), - "attempted to leave type `&()` uninitialized, which is invalid" + "attempted to leave type `&()` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::<&[u8]>(), - "attempted to zero-initialize type `&[u8]`, which is invalid" + "attempted to zero-initialize type `&[u8]`, which is invalid", ); test_panic_msg_only_if_strict( || mem::uninitialized::<&[u8]>(), - "attempted to leave type `&[u8]` uninitialized, which is invalid" + "attempted to leave type `&[u8]` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::<&str>(), - "attempted to zero-initialize type `&str`, which is invalid" + "attempted to zero-initialize type `&str`, which is invalid", ); test_panic_msg_only_if_strict( || mem::uninitialized::<&str>(), - "attempted to leave type `&str` uninitialized, which is invalid" + "attempted to leave type `&str` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::<(NonNull, u32, u32)>(), "attempted to zero-initialize type `(core::ptr::non_null::NonNull, u32, u32)`, \ - which is invalid" + which is invalid", ); test_panic_msg_only_if_strict( || mem::uninitialized::<(NonNull, u32, u32)>(), - "attempted to leave type `(core::ptr::non_null::NonNull, u32, u32)` uninitialized, which is invalid" + "attempted to leave type `(core::ptr::non_null::NonNull, u32, u32)` uninitialized, which is invalid", ); test_panic_msg( || mem::zeroed::(), "attempted to zero-initialize type `OneVariant_NonZero`, \ - which is invalid" + which is invalid", ); test_panic_msg_only_if_strict( || mem::uninitialized::(), - "attempted to leave type `OneVariant_NonZero` uninitialized, which is invalid" + "attempted to leave type `OneVariant_NonZero` uninitialized, which is invalid", ); // Types where both are invalid but we allow the zeroed form since it is not LLVM UB. test_panic_msg_only_if_strict( || mem::zeroed::(), - "attempted to zero-initialize type `LR_NonZero`, which is invalid" + "attempted to zero-initialize type `LR_NonZero`, which is invalid", ); test_panic_msg( || mem::uninitialized::(), - "attempted to leave type `LR_NonZero` uninitialized, which is invalid" + "attempted to leave type `LR_NonZero` uninitialized, which is invalid", ); test_panic_msg_only_if_strict( || mem::zeroed::>(), "attempted to zero-initialize type `core::mem::manually_drop::ManuallyDrop`, \ - which is invalid" + which is invalid", ); test_panic_msg( || mem::uninitialized::>(), "attempted to leave type `core::mem::manually_drop::ManuallyDrop` uninitialized, \ - which is invalid" + which is invalid", ); // Some strict-only things test_panic_msg_only_if_strict( || mem::uninitialized::(), - "attempted to leave type `i32` uninitialized, which is invalid" + "attempted to leave type `i32` uninitialized, which is invalid", ); test_panic_msg_only_if_strict( || mem::uninitialized::<*const ()>(), - "attempted to leave type `*const ()` uninitialized, which is invalid" + "attempted to leave type `*const ()` uninitialized, which is invalid", ); test_panic_msg_only_if_strict( || mem::uninitialized::<[i32; 1]>(), - "attempted to leave type `[i32; 1]` uninitialized, which is invalid" + "attempted to leave type `[i32; 1]` uninitialized, which is invalid", ); test_panic_msg_only_if_strict( || mem::zeroed::<[NonNull<()>; 1]>(), - "attempted to zero-initialize type `[core::ptr::non_null::NonNull<()>; 1]`, which is invalid" + "attempted to zero-initialize type `[core::ptr::non_null::NonNull<()>; 1]`, which is invalid", ); // Types that can be zero, but not uninit (though some are mitigated). let _val = mem::zeroed::(); test_panic_msg( || mem::uninitialized::(), - "attempted to leave type `LR` uninitialized, which is invalid" + "attempted to leave type `LR` uninitialized, which is invalid", ); let _val = mem::zeroed::>(); test_panic_msg( || mem::uninitialized::>(), - "attempted to leave type `core::mem::manually_drop::ManuallyDrop` uninitialized, which is invalid" + "attempted to leave type `core::mem::manually_drop::ManuallyDrop` uninitialized, which is invalid", ); let _val = mem::zeroed::(); test_panic_msg_only_if_strict( || mem::uninitialized::(), - "attempted to leave type `bool` uninitialized, which is invalid" + "attempted to leave type `bool` uninitialized, which is invalid", ); let _val = mem::zeroed::(); test_panic_msg_only_if_strict( || mem::uninitialized::(), - "attempted to leave type `OneVariant` uninitialized, which is invalid" + "attempted to leave type `OneVariant` uninitialized, which is invalid", ); // Some things that are actually allowed. diff --git a/tests/ui/layout/debug.rs b/tests/ui/layout/debug.rs index 0c3e5bc92d5ba..3abfccb394556 100644 --- a/tests/ui/layout/debug.rs +++ b/tests/ui/layout/debug.rs @@ -1,6 +1,6 @@ //@ normalize-stderr: "pref: Align\([1-8] bytes\)" -> "pref: $$SOME_ALIGN" //@ normalize-stderr: "randomization_seed: \d+" -> "randomization_seed: $$SEED" -#![feature(never_type, rustc_attrs, type_alias_impl_trait, repr_simd)] +#![feature(rustc_attrs, type_alias_impl_trait, repr_simd)] #![crate_type = "lib"] #[rustc_dump_layout(debug)] diff --git a/tests/ui/layout/enum-scalar-pair-int-ptr.rs b/tests/ui/layout/enum-scalar-pair-int-ptr.rs index 184f61fe79653..984f36401bc6f 100644 --- a/tests/ui/layout/enum-scalar-pair-int-ptr.rs +++ b/tests/ui/layout/enum-scalar-pair-int-ptr.rs @@ -5,7 +5,6 @@ //! Enum layout tests related to scalar pairs with an int/ptr common primitive. #![feature(rustc_attrs)] -#![feature(never_type)] #![crate_type = "lib"] #[rustc_dump_layout(backend_repr)] diff --git a/tests/ui/layout/enum.rs b/tests/ui/layout/enum.rs index 84918f64fe7ed..0f6d52ccc73f9 100644 --- a/tests/ui/layout/enum.rs +++ b/tests/ui/layout/enum.rs @@ -2,23 +2,25 @@ //! Various enum layout tests. #![feature(rustc_attrs)] -#![feature(never_type)] #![crate_type = "lib"] #[rustc_dump_layout(align)] -enum UninhabitedVariantAlign { //~ERROR: align: Align(2 bytes) +enum UninhabitedVariantAlign { + //~^ ERROR: align: Align(2 bytes) A([u8; 32]), B([u16; 0], !), // make sure alignment in uninhabited fields is respected } #[rustc_dump_layout(size)] -enum UninhabitedVariantSpace { //~ERROR: size: Size(16 bytes) +enum UninhabitedVariantSpace { + //~^ ERROR: size: Size(16 bytes) A, B([u8; 15], !), // make sure there is space being reserved for this field. } #[rustc_dump_layout(backend_repr)] -enum ScalarPairDifferingSign { //~ERROR: backend_repr: ScalarPair +enum ScalarPairDifferingSign { + //~^ ERROR: backend_repr: ScalarPair A(u8), B(i8), } @@ -28,7 +30,8 @@ enum Never {} // See https://github.com/rust-lang/rust/issues/146984 #[rustc_dump_layout(size)] #[repr(u32)] -enum DefinedLayoutAllUninhabited { //~ERROR: size: Size(4 bytes) +enum DefinedLayoutAllUninhabited { + //~^ ERROR: size: Size(4 bytes) A(Never), B(Never), } diff --git a/tests/ui/layout/hexagon-enum.rs b/tests/ui/layout/hexagon-enum.rs index 76f1bd5022118..dcb43b04f51da 100644 --- a/tests/ui/layout/hexagon-enum.rs +++ b/tests/ui/layout/hexagon-enum.rs @@ -7,7 +7,7 @@ // Verify that the hexagon targets implement the repr(C) for enums correctly. // // See #82100 -#![feature(never_type, rustc_attrs, no_core, lang_items)] +#![feature(rustc_attrs, no_core, lang_items)] #![crate_type = "lib"] #![no_core] diff --git a/tests/ui/layout/struct.rs b/tests/ui/layout/struct.rs index fc218d9fecbd0..e2feb472abbac 100644 --- a/tests/ui/layout/struct.rs +++ b/tests/ui/layout/struct.rs @@ -2,7 +2,6 @@ //! Various struct layout tests. #![feature(rustc_attrs)] -#![feature(never_type)] #![crate_type = "lib"] #[rustc_dump_layout(backend_repr)] diff --git a/tests/ui/layout/thumb-enum.rs b/tests/ui/layout/thumb-enum.rs index 7d6d98b9edd6b..613154ee1c194 100644 --- a/tests/ui/layout/thumb-enum.rs +++ b/tests/ui/layout/thumb-enum.rs @@ -7,7 +7,7 @@ // Verify that thumb targets implement the repr(C) for enums correctly. // // See #87917 -#![feature(never_type, rustc_attrs, no_core, lang_items)] +#![feature(rustc_attrs, no_core, lang_items)] #![crate_type = "lib"] #![no_core] diff --git a/tests/ui/lifetimes/issue-54378.rs b/tests/ui/lifetimes/issue-54378.rs index b835b08d31e9c..35bd7eeb56a9b 100644 --- a/tests/ui/lifetimes/issue-54378.rs +++ b/tests/ui/lifetimes/issue-54378.rs @@ -2,8 +2,6 @@ // Regression test for #54378. -#![feature(never_type)] - use std::marker::PhantomData; pub trait Machine<'a, 'mir, 'tcx>: Sized { diff --git a/tests/ui/lint/invalid_value.rs b/tests/ui/lint/invalid_value.rs index 29e8e6cfef6dd..49a729f55eaf0 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(never_type, rustc_attrs)] +#![feature(rustc_attrs)] use std::mem::{self, MaybeUninit}; use std::ptr::NonNull; diff --git a/tests/ui/lint/unused-features/unused-language-features.rs b/tests/ui/lint/unused-features/unused-language-features.rs index 9334c1df0408a..89fbda6d9e887 100644 --- a/tests/ui/lint/unused-features/unused-language-features.rs +++ b/tests/ui/lint/unused-features/unused-language-features.rs @@ -1,6 +1,5 @@ #![crate_type = "lib"] #![deny(unused_features)] - // Unused language features #![feature(coroutines)] //~^ ERROR feature `coroutines` is declared but not used @@ -16,10 +15,10 @@ //~^ ERROR feature `negative_impls` is declared but not used // Not enabled via cfg_attr, so should not warn even if unused -#![cfg_attr(any(), feature(never_type))] +#![cfg_attr(any(), feature(type_ascription))] macro_rules! use_asm_unwind { () => { unsafe { std::arch::asm!("", options(may_unwind)) }; - } + }; } diff --git a/tests/ui/lint/unused/must-use-ops.rs b/tests/ui/lint/unused/must-use-ops.rs index 5085dbb58c19f..a04ec0fd9a042 100644 --- a/tests/ui/lint/unused/must-use-ops.rs +++ b/tests/ui/lint/unused/must-use-ops.rs @@ -3,7 +3,6 @@ //@ check-pass #![warn(unused_must_use)] -#![feature(never_type)] fn deref_never(x: &!) { // Don't lint for uninhabited types diff --git a/tests/ui/lint/unused/must_use-result-unit-uninhabited.rs b/tests/ui/lint/unused/must_use-result-unit-uninhabited.rs index 8f63e4a7f8323..be31a57140e01 100644 --- a/tests/ui/lint/unused/must_use-result-unit-uninhabited.rs +++ b/tests/ui/lint/unused/must_use-result-unit-uninhabited.rs @@ -2,7 +2,6 @@ //@ aux-crate:dep=must_use_result_unit_uninhabited_extern_crate.rs #![deny(unused_must_use)] -#![feature(never_type)] use core::ops::{ControlFlow, ControlFlow::Continue}; use dep::{MyUninhabited, MyUninhabitedNonexhaustive}; diff --git a/tests/ui/lint/unused/must_use-unit.rs b/tests/ui/lint/unused/must_use-unit.rs index 171ae3257b6c2..4566bbc631daf 100644 --- a/tests/ui/lint/unused/must_use-unit.rs +++ b/tests/ui/lint/unused/must_use-unit.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![deny(unused_must_use)] #[must_use] diff --git a/tests/ui/loops/loop-break-never-type-mismatch.rs b/tests/ui/loops/loop-break-never-type-mismatch.rs index 2be4e4f4ac5ab..d76dbc9f021f7 100644 --- a/tests/ui/loops/loop-break-never-type-mismatch.rs +++ b/tests/ui/loops/loop-break-never-type-mismatch.rs @@ -1,7 +1,5 @@ //! Tests type mismatches with `break` and diverging types in loops -#![feature(never_type)] - fn loop_break_return() -> i32 { let loop_value = loop { break return 0; diff --git a/tests/ui/loops/loop-break-value.rs b/tests/ui/loops/loop-break-value.rs index d509fc1657054..23a326b6b090d 100644 --- a/tests/ui/loops/loop-break-value.rs +++ b/tests/ui/loops/loop-break-value.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - fn main() { let val: ! = loop { break break; }; //~^ ERROR mismatched types diff --git a/tests/ui/mir/enum/wrap_break.rs b/tests/ui/mir/enum/wrap_break.rs index 5c410afa511c7..bd176c0e59797 100644 --- a/tests/ui/mir/enum/wrap_break.rs +++ b/tests/ui/mir/enum/wrap_break.rs @@ -1,7 +1,6 @@ //@ run-crash //@ compile-flags: -C debug-assertions //@ error-pattern: trying to construct an enum from an invalid value 0x0 -#![feature(never_type)] #![allow(invalid_value)] #[allow(dead_code)] diff --git a/tests/ui/mir/mir_calls_to_shims.rs b/tests/ui/mir/mir_calls_to_shims.rs index 9e8dd0c0afbfc..7ba49aa8c50a4 100644 --- a/tests/ui/mir/mir_calls_to_shims.rs +++ b/tests/ui/mir/mir_calls_to_shims.rs @@ -3,7 +3,6 @@ //@ needs-unwind #![feature(fn_traits)] -#![feature(never_type)] use std::panic; diff --git a/tests/ui/never_type/basic/adjust_never.rs b/tests/ui/never_type/basic/adjust_never.rs index aa7ee9ef7ab17..973ed8e859b32 100644 --- a/tests/ui/never_type/basic/adjust_never.rs +++ b/tests/ui/never_type/basic/adjust_never.rs @@ -2,8 +2,6 @@ //@ check-pass -#![feature(never_type)] - fn main() { let x: ! = panic!(); let y: u32 = x; diff --git a/tests/ui/never_type/basic/auto-traits.rs b/tests/ui/never_type/basic/auto-traits.rs index 19554f13b0bac..484829b4a55fd 100644 --- a/tests/ui/never_type/basic/auto-traits.rs +++ b/tests/ui/never_type/basic/auto-traits.rs @@ -1,7 +1,6 @@ //@ check-pass #![feature(auto_traits)] -#![feature(never_type)] fn main() { enum Void {} diff --git a/tests/ui/never_type/basic/call-fn-never-arg-wrong-type.rs b/tests/ui/never_type/basic/call-fn-never-arg-wrong-type.rs index d06637e74a2f2..a2b44e91f1141 100644 --- a/tests/ui/never_type/basic/call-fn-never-arg-wrong-type.rs +++ b/tests/ui/never_type/basic/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/tests/ui/never_type/basic/call-fn-never-arg.rs b/tests/ui/never_type/basic/call-fn-never-arg.rs index 546b37fb52f5f..0f85f1077208f 100644 --- a/tests/ui/never_type/basic/call-fn-never-arg.rs +++ b/tests/ui/never_type/basic/call-fn-never-arg.rs @@ -2,7 +2,6 @@ // //@ check-pass -#![feature(never_type)] #![expect(unreachable_code)] fn foo(x: !) -> ! { diff --git a/tests/ui/never_type/basic/cast-never.rs b/tests/ui/never_type/basic/cast-never.rs index eaca210182873..77667d895e843 100644 --- a/tests/ui/never_type/basic/cast-never.rs +++ b/tests/ui/never_type/basic/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/tests/ui/never_type/basic/impl-for-never.rs b/tests/ui/never_type/basic/impl-for-never.rs index e908d2a62547c..fe10b2943d1b8 100644 --- a/tests/ui/never_type/basic/impl-for-never.rs +++ b/tests/ui/never_type/basic/impl-for-never.rs @@ -3,9 +3,6 @@ //@ run-pass //@ check-run-results -#![feature(never_type)] - - trait StringifyType { fn stringify_type() -> &'static str; } diff --git a/tests/ui/never_type/basic/never-assign-wrong-type.rs b/tests/ui/never_type/basic/never-assign-wrong-type.rs index ccc2f872dab43..799786978b0f0 100644 --- a/tests/ui/never_type/basic/never-assign-wrong-type.rs +++ b/tests/ui/never_type/basic/never-assign-wrong-type.rs @@ -1,7 +1,5 @@ // Test that we can't use another type in place of ! -#![feature(never_type)] - fn main() { let x: ! = "hello"; //~ ERROR mismatched types } diff --git a/tests/ui/never_type/basic/never-associated-type.rs b/tests/ui/never_type/basic/never-associated-type.rs index a62ec7e599107..cca38f5096806 100644 --- a/tests/ui/never_type/basic/never-associated-type.rs +++ b/tests/ui/never_type/basic/never-associated-type.rs @@ -2,8 +2,6 @@ // //@ check-pass -#![feature(never_type)] - trait Foo { type Wow; diff --git a/tests/ui/never_type/basic/never-result.rs b/tests/ui/never_type/basic/never-result.rs index 34b7cd67a55a1..c4901498538eb 100644 --- a/tests/ui/never_type/basic/never-result.rs +++ b/tests/ui/never_type/basic/never-result.rs @@ -3,7 +3,6 @@ // //@ run-pass -#![feature(never_type)] #![expect(unused_variables)] #![expect(unreachable_code)] diff --git a/tests/ui/never_type/basic/never-type-arg.rs b/tests/ui/never_type/basic/never-type-arg.rs index 45ce6836e2a40..1c0f10b3b2bfe 100644 --- a/tests/ui/never_type/basic/never-type-arg.rs +++ b/tests/ui/never_type/basic/never-type-arg.rs @@ -2,8 +2,6 @@ // //@ check-pass -#![feature(never_type)] - struct Wub; impl PartialEq for Wub { diff --git a/tests/ui/never_type/basic/never-type-rvalues.rs b/tests/ui/never_type/basic/never-type-rvalues.rs index 943de2563ef81..7595dc01e9c46 100644 --- a/tests/ui/never_type/basic/never-type-rvalues.rs +++ b/tests/ui/never_type/basic/never-type-rvalues.rs @@ -2,7 +2,6 @@ // //@ run-pass -#![feature(never_type)] #![allow(dead_code)] #![allow(path_statements)] #![allow(unreachable_patterns)] diff --git a/tests/ui/never_type/basic/never_transmute_never.rs b/tests/ui/never_type/basic/never_transmute_never.rs index 6d32a12bc44a3..ad00f322b3cc7 100644 --- a/tests/ui/never_type/basic/never_transmute_never.rs +++ b/tests/ui/never_type/basic/never_transmute_never.rs @@ -1,6 +1,5 @@ //@ check-pass -#![feature(never_type)] #![allow(dead_code)] #![expect(unreachable_code)] #![expect(unused_variables)] diff --git a/tests/ui/never_type/diverging-place-match.rs b/tests/ui/never_type/diverging-place-match.rs index b9bc29a218c4a..e029323bc8db5 100644 --- a/tests/ui/never_type/diverging-place-match.rs +++ b/tests/ui/never_type/diverging-place-match.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - fn not_a_read() -> ! { unsafe { //~^ ERROR mismatched types diff --git a/tests/ui/never_type/empty-never-array.rs b/tests/ui/never_type/empty-never-array.rs index c84d9bd85a3bc..42f5a53fa511c 100644 --- a/tests/ui/never_type/empty-never-array.rs +++ b/tests/ui/never_type/empty-never-array.rs @@ -1,7 +1,5 @@ //@ dont-require-annotations: NOTE -#![feature(never_type)] - enum Helper { T(T, [!; 0]), #[allow(dead_code)] diff --git a/tests/ui/never_type/exhaustive_patterns.rs b/tests/ui/never_type/exhaustive_patterns.rs index 0562575d511e1..f54f98d749cec 100644 --- a/tests/ui/never_type/exhaustive_patterns.rs +++ b/tests/ui/never_type/exhaustive_patterns.rs @@ -3,8 +3,6 @@ // //@ check-fail -#![feature(never_type)] - mod inner { pub struct Wrapper(T); } diff --git a/tests/ui/never_type/fallback_change/from_infer_breaking_with_unit_fallback.rs b/tests/ui/never_type/fallback_change/from_infer_breaking_with_unit_fallback.rs index 970c642514b23..a13e52966973d 100644 --- a/tests/ui/never_type/fallback_change/from_infer_breaking_with_unit_fallback.rs +++ b/tests/ui/never_type/fallback_change/from_infer_breaking_with_unit_fallback.rs @@ -7,7 +7,7 @@ //@ revisions: unit never //@[never] check-pass #![allow(internal_features)] -#![feature(rustc_attrs, never_type)] +#![feature(rustc_attrs)] #![cfg_attr(unit, rustc_never_type_options(fallback = "unit"))] #![cfg_attr(never, rustc_never_type_options(fallback = "never"))] diff --git a/tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs b/tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs index 94107a0ff103c..770fc6f58c722 100644 --- a/tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs +++ b/tests/ui/never_type/fallback_change/try-block-never-type-fallback.rs @@ -9,7 +9,6 @@ // causing a type error (since (): Into does not hold). // In edition 2024, it falls back to !, allowing the code to compile correctly. -#![feature(never_type)] #![feature(try_blocks)] fn bar(_: Result, u32>) { diff --git a/tests/ui/never_type/never-from-impl-is-reserved.rs b/tests/ui/never_type/never-from-impl-is-reserved.rs index c673462f2962a..4bf80fce1ab05 100644 --- a/tests/ui/never_type/never-from-impl-is-reserved.rs +++ b/tests/ui/never_type/never-from-impl-is-reserved.rs @@ -4,8 +4,6 @@ //@ ignore-compare-mode-next-solver (explicit revisions) //@[next] compile-flags: -Znext-solver=coherence -#![feature(never_type)] - pub struct MyFoo; pub trait MyTrait {} diff --git a/tests/ui/never_type/regress/builtin_derives_on_adts_with_never.rs b/tests/ui/never_type/regress/builtin_derives_on_adts_with_never.rs index 2a57c6023adce..27ec28b9ab020 100644 --- a/tests/ui/never_type/regress/builtin_derives_on_adts_with_never.rs +++ b/tests/ui/never_type/regress/builtin_derives_on_adts_with_never.rs @@ -1,7 +1,6 @@ // Regression test for . // //@ check-pass -#![feature(never_type)] #![crate_type = "lib"] #![warn(unreachable_code)] diff --git a/tests/ui/never_type/regress/eq-never-types.rs b/tests/ui/never_type/regress/eq-never-types.rs index c130b9a352142..6d462d918b3bb 100644 --- a/tests/ui/never_type/regress/eq-never-types.rs +++ b/tests/ui/never_type/regress/eq-never-types.rs @@ -3,8 +3,6 @@ //@ edition: 2024 //@ check-pass -#![feature(never_type)] - fn ice(a: !) { a == a; } diff --git a/tests/ui/never_type/regress/never-as-spec-default-associated-type.rs b/tests/ui/never_type/regress/never-as-spec-default-associated-type.rs index c366b6c16b297..9fff364bb62db 100644 --- a/tests/ui/never_type/regress/never-as-spec-default-associated-type.rs +++ b/tests/ui/never_type/regress/never-as-spec-default-associated-type.rs @@ -1,6 +1,6 @@ // Regression test for -#![feature(never_type, specialization)] +#![feature(specialization)] #![allow(incomplete_features)] use std::iter::{self, Empty}; diff --git a/tests/ui/never_type/regress/never-in-range-pat.rs b/tests/ui/never_type/regress/never-in-range-pat.rs index 2e0409bfa6458..9b2847f882d2a 100644 --- a/tests/ui/never_type/regress/never-in-range-pat.rs +++ b/tests/ui/never_type/regress/never-in-range-pat.rs @@ -5,8 +5,6 @@ // This shouldn't be allowed anyways, but we only deny it during MIR // building, so make sure we handle it semi-gracefully during typeck. -#![feature(never_type)] - fn main() { let x: !; match 1 { diff --git a/tests/ui/never_type/regress/span-bug-issue-121445.rs b/tests/ui/never_type/regress/span-bug-issue-121445.rs index 64bf6bd6aa11e..f9f95b6d8e11f 100644 --- a/tests/ui/never_type/regress/span-bug-issue-121445.rs +++ b/tests/ui/never_type/regress/span-bug-issue-121445.rs @@ -1,7 +1,5 @@ // Regression test for -#![feature(never_type)] - fn test2() { let x: !; let c2 = SingleVariant::Points(0) diff --git a/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs b/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs index 335eff425abef..8353ad5c6284e 100644 --- a/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs +++ b/tests/ui/pattern/usefulness/always-inhabited-union-ref.rs @@ -4,7 +4,6 @@ // undecided. This test file currently checks a conservative choice. #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))] -#![feature(never_type)] #![allow(dead_code)] #![allow(unreachable_code)] diff --git a/tests/ui/pattern/usefulness/empty-match-check-notes.rs b/tests/ui/pattern/usefulness/empty-match-check-notes.rs index 48d20fd2d5c1b..fda609229ab0e 100644 --- a/tests/ui/pattern/usefulness/empty-match-check-notes.rs +++ b/tests/ui/pattern/usefulness/empty-match-check-notes.rs @@ -2,7 +2,6 @@ //@ revisions: normal exhaustive_patterns // // This tests a match with no arms on various types, and checks NOTEs. -#![feature(never_type)] #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))] #![deny(unreachable_patterns)] //~^ NOTE the lint level is defined here diff --git a/tests/ui/pattern/usefulness/empty-match.rs b/tests/ui/pattern/usefulness/empty-match.rs index b34427a7c2388..9f9997e7f698e 100644 --- a/tests/ui/pattern/usefulness/empty-match.rs +++ b/tests/ui/pattern/usefulness/empty-match.rs @@ -1,7 +1,6 @@ //@ revisions: normal exhaustive_patterns // // This tests a match with no arms on various types. -#![feature(never_type)] #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))] #![deny(unreachable_patterns)] diff --git a/tests/ui/pattern/usefulness/empty-types.rs b/tests/ui/pattern/usefulness/empty-types.rs index d4fdb7c1dd46a..9cb23a5c1b746 100644 --- a/tests/ui/pattern/usefulness/empty-types.rs +++ b/tests/ui/pattern/usefulness/empty-types.rs @@ -6,7 +6,6 @@ // Most of the subtlety of this file happens in scrutinee places which are not required to hold // valid data, namely dereferences and union field accesses. In these cases, empty arms can // generally not be omitted, except with `exhaustive_patterns` which ignores this.. -#![feature(never_type)] #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))] #![cfg_attr(never_pats, feature(never_patterns))] #![allow(dead_code, unreachable_code)] diff --git a/tests/ui/pattern/usefulness/explain-unreachable-pats.rs b/tests/ui/pattern/usefulness/explain-unreachable-pats.rs index f1af7f294cbd8..502ab7b2a14e7 100644 --- a/tests/ui/pattern/usefulness/explain-unreachable-pats.rs +++ b/tests/ui/pattern/usefulness/explain-unreachable-pats.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![feature(exhaustive_patterns)] #![deny(unreachable_patterns)] //~^ NOTE lint level is defined here diff --git a/tests/ui/pattern/usefulness/impl-trait.rs b/tests/ui/pattern/usefulness/impl-trait.rs index 47cee17b57994..f04633ebef2f6 100644 --- a/tests/ui/pattern/usefulness/impl-trait.rs +++ b/tests/ui/pattern/usefulness/impl-trait.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![feature(type_alias_impl_trait)] #![feature(non_exhaustive_omitted_patterns_lint)] #![feature(exhaustive_patterns)] diff --git a/tests/ui/pattern/usefulness/match-privately-empty.rs b/tests/ui/pattern/usefulness/match-privately-empty.rs index bfea15af18011..1c439e0135c12 100644 --- a/tests/ui/pattern/usefulness/match-privately-empty.rs +++ b/tests/ui/pattern/usefulness/match-privately-empty.rs @@ -1,6 +1,5 @@ //@ revisions: normal exhaustive_patterns #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))] -#![feature(never_type)] mod private { pub struct Private { diff --git a/tests/ui/pattern/usefulness/slice_of_empty.rs b/tests/ui/pattern/usefulness/slice_of_empty.rs index e186ba5134d5f..fba9f1083ba1b 100644 --- a/tests/ui/pattern/usefulness/slice_of_empty.rs +++ b/tests/ui/pattern/usefulness/slice_of_empty.rs @@ -1,6 +1,5 @@ //@ revisions: normal exhaustive_patterns #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))] -#![feature(never_type)] #![deny(unreachable_patterns)] fn main() {} diff --git a/tests/ui/pattern/usefulness/uninhabited.rs b/tests/ui/pattern/usefulness/uninhabited.rs index 2e2c7cae65cbc..c3c350af130d7 100644 --- a/tests/ui/pattern/usefulness/uninhabited.rs +++ b/tests/ui/pattern/usefulness/uninhabited.rs @@ -4,7 +4,6 @@ // // This tests plays with matching and uninhabited types. This also serves as a test for the // `Ty::is_inhabited_from` function. -#![feature(never_type)] #![deny(unreachable_patterns)] macro_rules! assert_empty { diff --git a/tests/ui/print_type_sizes/uninhabited.rs b/tests/ui/print_type_sizes/uninhabited.rs index 7cb3e5b33fa56..b55707d041088 100644 --- a/tests/ui/print_type_sizes/uninhabited.rs +++ b/tests/ui/print_type_sizes/uninhabited.rs @@ -4,8 +4,6 @@ // ^-- needed because `--pass check` does not emit the output needed. // FIXME: consider using an attribute instead of side-effects. -#![feature(never_type)] - pub fn test() { let _x: Option = None; let _y: Result = Ok(42); diff --git a/tests/ui/raw-ref-op/never-place-isnt-diverging.rs b/tests/ui/raw-ref-op/never-place-isnt-diverging.rs index 80d441729f746..8f41363ffc6b0 100644 --- a/tests/ui/raw-ref-op/never-place-isnt-diverging.rs +++ b/tests/ui/raw-ref-op/never-place-isnt-diverging.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - fn make_up_a_value() -> T { unsafe { //~^ ERROR mismatched types diff --git a/tests/ui/reachable/expr_add.rs b/tests/ui/reachable/expr_add.rs index b45e5daf42c8d..640c2a2cf8fcc 100644 --- a/tests/ui/reachable/expr_add.rs +++ b/tests/ui/reachable/expr_add.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unused_variables)] #![deny(unreachable_code)] diff --git a/tests/ui/reachable/expr_assign.rs b/tests/ui/reachable/expr_assign.rs index e547f75e2697b..3914fb32432ef 100644 --- a/tests/ui/reachable/expr_assign.rs +++ b/tests/ui/reachable/expr_assign.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unused_variables)] #![allow(unused_assignments)] #![allow(dead_code)] diff --git a/tests/ui/reachable/expr_call.rs b/tests/ui/reachable/expr_call.rs index 1eaa96c3ce773..ce1a94e3c4a25 100644 --- a/tests/ui/reachable/expr_call.rs +++ b/tests/ui/reachable/expr_call.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unused_variables)] #![allow(unused_assignments)] #![allow(dead_code)] diff --git a/tests/ui/reachable/expr_method.rs b/tests/ui/reachable/expr_method.rs index d917df05b3c3d..e74a7daec8828 100644 --- a/tests/ui/reachable/expr_method.rs +++ b/tests/ui/reachable/expr_method.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unused_variables)] #![allow(unused_assignments)] #![allow(dead_code)] diff --git a/tests/ui/reachable/expr_type.rs b/tests/ui/reachable/expr_type.rs index 1ceb2f8597160..c0a5452f4ad0c 100644 --- a/tests/ui/reachable/expr_type.rs +++ b/tests/ui/reachable/expr_type.rs @@ -2,7 +2,7 @@ #![allow(unused_assignments)] #![allow(dead_code)] #![deny(unreachable_code)] -#![feature(never_type, type_ascription)] +#![feature(type_ascription)] fn a() { // the cast is unreachable: diff --git a/tests/ui/reachable/expr_unary.rs b/tests/ui/reachable/expr_unary.rs index 190c7447dccbe..6b54822a2b0ee 100644 --- a/tests/ui/reachable/expr_unary.rs +++ b/tests/ui/reachable/expr_unary.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unused_variables)] #![allow(unused_assignments)] #![allow(dead_code)] diff --git a/tests/ui/reachable/guard_read_for_never.rs b/tests/ui/reachable/guard_read_for_never.rs index 763dfd354b586..3af5ecd9896d6 100644 --- a/tests/ui/reachable/guard_read_for_never.rs +++ b/tests/ui/reachable/guard_read_for_never.rs @@ -1,7 +1,7 @@ // Regression test for // //@ check-pass -#![feature(guard_patterns, never_type)] +#![feature(guard_patterns)] #![expect(incomplete_features)] #![deny(unreachable_code)] diff --git a/tests/ui/reachable/nested_type_ascription.rs b/tests/ui/reachable/nested_type_ascription.rs index 1712ee00b17c8..5f8fc09db81a2 100644 --- a/tests/ui/reachable/nested_type_ascription.rs +++ b/tests/ui/reachable/nested_type_ascription.rs @@ -5,7 +5,6 @@ // //@ check-pass -#![feature(never_type)] #![feature(type_ascription)] #![deny(unreachable_code)] diff --git a/tests/ui/reachable/never-assign-dead-code.rs b/tests/ui/reachable/never-assign-dead-code.rs index 05e5d5551336b..249f12628408e 100644 --- a/tests/ui/reachable/never-assign-dead-code.rs +++ b/tests/ui/reachable/never-assign-dead-code.rs @@ -2,7 +2,6 @@ // //@ check-pass -#![feature(never_type)] #![expect(dropping_copy_types)] #![warn(unused)] diff --git a/tests/ui/reachable/type_ascribe_never_field.rs b/tests/ui/reachable/type_ascribe_never_field.rs index 2788d30414e69..48f540ca96237 100644 --- a/tests/ui/reachable/type_ascribe_never_field.rs +++ b/tests/ui/reachable/type_ascribe_never_field.rs @@ -5,7 +5,6 @@ // //@ check-pass -#![feature(never_type)] #![feature(type_ascription)] #![deny(unreachable_code)] diff --git a/tests/ui/reachable/unreachable-try-pattern.rs b/tests/ui/reachable/unreachable-try-pattern.rs index 1358722e229ce..5d787fc5966f8 100644 --- a/tests/ui/reachable/unreachable-try-pattern.rs +++ b/tests/ui/reachable/unreachable-try-pattern.rs @@ -1,5 +1,5 @@ //@ check-pass -#![feature(never_type, exhaustive_patterns)] +#![feature(exhaustive_patterns)] #![warn(unreachable_code)] #![warn(unreachable_patterns)] diff --git a/tests/ui/reachable/unwarned-match-on-never.rs b/tests/ui/reachable/unwarned-match-on-never.rs index 71f8fe3a783e2..c38ea6ab9ad01 100644 --- a/tests/ui/reachable/unwarned-match-on-never.rs +++ b/tests/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 {} diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs index 4f52f6ee4bd91..7597ef41b0c84 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![feature(never_patterns)] #![allow(incomplete_features)] diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133117-duplicate-never-arm.rs b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133117-duplicate-never-arm.rs index bca2ab5657021..484583c30b969 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133117-duplicate-never-arm.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133117-duplicate-never-arm.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![feature(never_patterns)] #![allow(incomplete_features)] diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/never-pattern-is-a-read.rs b/tests/ui/rfcs/rfc-0000-never_patterns/never-pattern-is-a-read.rs index 8dff48de60aa5..8d9d91204959d 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/never-pattern-is-a-read.rs +++ b/tests/ui/rfcs/rfc-0000-never_patterns/never-pattern-is-a-read.rs @@ -1,6 +1,5 @@ // Make sure we consider `!` to be a union read. - -#![feature(never_type, never_patterns)] +#![feature(never_patterns)] union U { a: !, diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs index e1799761b6961..9e6f0142bb37c 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs @@ -1,5 +1,4 @@ #![crate_type = "rlib"] -#![feature(never_type)] #[non_exhaustive] pub enum UninhabitedEnum { diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.rs index 4804d34a920ca..857185e8aac3a 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.rs @@ -1,5 +1,4 @@ //@ aux-build:uninhabited.rs -#![feature(never_type)] extern crate uninhabited; diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs index 6b911dd989cc5..c3c0ce650d73e 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - #[non_exhaustive] pub enum UninhabitedEnum { } diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs index c7a7c927c0c23..9d19189b819da 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs @@ -1,5 +1,4 @@ //@ aux-build:uninhabited.rs -#![feature(never_type)] extern crate uninhabited; diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs index d81896eba1956..be4856bf26f49 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs @@ -1,5 +1,4 @@ //@ check-pass -#![feature(never_type)] #[non_exhaustive] pub enum UninhabitedEnum { diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs index dd9a570522a26..0d940bae74dd6 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs @@ -1,6 +1,5 @@ //@ aux-build:uninhabited.rs #![deny(unreachable_patterns)] -#![feature(never_type)] extern crate uninhabited; diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs index 32f5f504136ab..802f994aab9f8 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs @@ -1,7 +1,6 @@ //@ check-pass #![deny(unreachable_patterns)] -#![feature(never_type)] #[non_exhaustive] pub enum UninhabitedEnum { diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs index ca7c528715420..e7bc2525a6830 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs +++ b/tests/ui/rfcs/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; diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.rs index 58d7bbd2c1730..f1caf15a79402 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.rs @@ -1,5 +1,4 @@ //@ aux-build:uninhabited.rs -#![feature(never_type)] extern crate uninhabited; diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs index 04f7fe26b5ae1..b15d09d49cd07 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs @@ -1,5 +1,4 @@ //@ check-pass -#![feature(never_type)] #[non_exhaustive] pub enum UninhabitedEnum { diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs index c214581549cd7..7b19825da1330 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs @@ -1,6 +1,5 @@ //@ aux-build:uninhabited.rs #![deny(unreachable_patterns)] -#![feature(never_type)] extern crate uninhabited; diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs index 9662016221278..5f79abf27eeb9 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs @@ -1,6 +1,5 @@ //@ check-pass #![deny(unreachable_patterns)] -#![feature(never_type)] #[non_exhaustive] pub enum UninhabitedEnum { diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs index 3d89ca15d3778..c12963a6f9c48 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs @@ -1,6 +1,5 @@ #![feature(exhaustive_patterns)] #![deny(unreachable_patterns)] -#![feature(never_type)] #[non_exhaustive] pub enum UninhabitedEnum { diff --git a/tests/ui/scalable-vectors/illformed-element-type.rs b/tests/ui/scalable-vectors/illformed-element-type.rs index 8461b0a067ff8..ce406cb5f725b 100644 --- a/tests/ui/scalable-vectors/illformed-element-type.rs +++ b/tests/ui/scalable-vectors/illformed-element-type.rs @@ -2,7 +2,6 @@ //@ only-aarch64 #![allow(internal_features)] #![feature(extern_types)] -#![feature(never_type)] #![feature(rustc_attrs)] struct Foo; diff --git a/tests/ui/self/dispatch_from_dyn_zst.rs b/tests/ui/self/dispatch_from_dyn_zst.rs index d3c32b57519fb..3d655165be2d6 100644 --- a/tests/ui/self/dispatch_from_dyn_zst.rs +++ b/tests/ui/self/dispatch_from_dyn_zst.rs @@ -1,6 +1,6 @@ //@ run-pass -#![feature(unsize, dispatch_from_dyn, never_type)] +#![feature(unsize, dispatch_from_dyn)] #![allow(dead_code)] diff --git a/tests/ui/stability-attribute/stability-attribute-trait-impl.rs b/tests/ui/stability-attribute/stability-attribute-trait-impl.rs index 880000ee7a434..2ef6ec81a56c5 100644 --- a/tests/ui/stability-attribute/stability-attribute-trait-impl.rs +++ b/tests/ui/stability-attribute/stability-attribute-trait-impl.rs @@ -1,4 +1,4 @@ -#![feature(staged_api, never_type, rust_cold_cc)] +#![feature(staged_api, rust_cold_cc)] //~^ ERROR module has missing stability attribute #[stable(feature = "a", since = "3.3.3")] diff --git a/tests/ui/statics/uninhabited-static.rs b/tests/ui/statics/uninhabited-static.rs index febbca6f0026d..3dc1975f970be 100644 --- a/tests/ui/statics/uninhabited-static.rs +++ b/tests/ui/statics/uninhabited-static.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - enum Void {} extern "C" { static VOID: Void; //~ ERROR static of uninhabited type diff --git a/tests/ui/structs-enums/type-sizes.rs b/tests/ui/structs-enums/type-sizes.rs index a8fadcc1d1ec6..7e4b3c8ad73af 100644 --- a/tests/ui/structs-enums/type-sizes.rs +++ b/tests/ui/structs-enums/type-sizes.rs @@ -3,7 +3,6 @@ #![allow(non_camel_case_types)] #![allow(dead_code)] -#![feature(never_type)] #![feature(pointer_is_aligned_to)] #![feature(rustc_attrs)] diff --git a/tests/ui/symbol-names/types.rs b/tests/ui/symbol-names/types.rs index 9dc7cad33cb0d..f1789cba6abe6 100644 --- a/tests/ui/symbol-names/types.rs +++ b/tests/ui/symbol-names/types.rs @@ -7,7 +7,6 @@ //@ normalize-stderr: "h[[:xdigit:]]{16}" -> "h[HASH]" //@ [v0] normalize-stderr: "\[[[:xdigit:]]{16}\]" -> "[HASH]" -#![feature(never_type)] #![feature(rustc_attrs)] #![feature(f128)] #![feature(f16)] diff --git a/tests/ui/traits/const-traits/const-drop.rs b/tests/ui/traits/const-traits/const-drop.rs index f7c3ec9be331d..e30368d1b2758 100644 --- a/tests/ui/traits/const-traits/const-drop.rs +++ b/tests/ui/traits/const-traits/const-drop.rs @@ -3,7 +3,6 @@ //@ revisions: stock precise #![feature(const_trait_impl, const_destruct)] -#![feature(never_type)] #![cfg_attr(precise, feature(const_precise_live_drops))] use std::marker::Destruct; diff --git a/tests/ui/traits/const-traits/reservation-impl-ice.rs b/tests/ui/traits/const-traits/reservation-impl-ice.rs index 3fbfe8c950daa..c2d9662945a44 100644 --- a/tests/ui/traits/const-traits/reservation-impl-ice.rs +++ b/tests/ui/traits/const-traits/reservation-impl-ice.rs @@ -1,5 +1,5 @@ //@ compile-flags: -Znext-solver -#![feature(const_convert, never_type, const_trait_impl)] +#![feature(const_convert, const_trait_impl)] const fn impls_from>() {} diff --git a/tests/ui/traits/next-solver/typeck/resolve-before-checking-never.rs b/tests/ui/traits/next-solver/typeck/resolve-before-checking-never.rs index 6df1fd5d4ba16..7b1a7372b0b25 100644 --- a/tests/ui/traits/next-solver/typeck/resolve-before-checking-never.rs +++ b/tests/ui/traits/next-solver/typeck/resolve-before-checking-never.rs @@ -1,8 +1,6 @@ //@ check-pass //@ compile-flags: -Znext-solver -#![feature(never_type)] - trait Mirror { type Assoc; } diff --git a/tests/ui/traits/reservation-impl/non-lattice-ok.rs b/tests/ui/traits/reservation-impl/non-lattice-ok.rs index 32d610bf915aa..93dab111891c0 100644 --- a/tests/ui/traits/reservation-impl/non-lattice-ok.rs +++ b/tests/ui/traits/reservation-impl/non-lattice-ok.rs @@ -30,13 +30,12 @@ // // [ii]: https://smallcultfollowing.com/babysteps/blog/2016/09/24/intersection-impls/ - // check that reservation impls can't be used as normal impls in positive reasoning. //@ revisions: old next //@[next] compile-flags: -Znext-solver -#![feature(rustc_attrs, never_type)] +#![feature(rustc_attrs)] trait MyTrait {} @@ -47,19 +46,25 @@ trait MyFrom { } // Given the "normal" impls for From -#[rustc_reservation_impl="this impl is reserved"] +#[rustc_reservation_impl = "this impl is reserved"] impl MyFrom for T { - fn my_from(x: !) -> Self { match x {} } + fn my_from(x: !) -> Self { + match x {} + } } impl MyFrom for T { - fn my_from(x: T) -> Self { x } + fn my_from(x: T) -> Self { + x + } } // ... we *do* want to allow this common pattern, of `From for MySmaht` struct MySmaht(T); impl MyFrom for MySmaht { - fn my_from(x: T) -> Self { MySmaht(x) } + fn my_from(x: T) -> Self { + MySmaht(x) + } } fn main() {} diff --git a/tests/ui/transmutability/char.rs b/tests/ui/transmutability/char.rs index 55a6153732955..ddf6da564ddea 100644 --- a/tests/ui/transmutability/char.rs +++ b/tests/ui/transmutability/char.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![feature(transmutability)] use std::mem::{Assume, TransmuteFrom}; diff --git a/tests/ui/uninhabited/projection.rs b/tests/ui/uninhabited/projection.rs index 395eeb675791e..51475de92c120 100644 --- a/tests/ui/uninhabited/projection.rs +++ b/tests/ui/uninhabited/projection.rs @@ -1,6 +1,6 @@ //@ check-pass -#![feature(never_type, exhaustive_patterns)] +#![feature(exhaustive_patterns)] trait Tag { type TagType; diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.rs b/tests/ui/uninhabited/uninhabited-irrefutable.rs index 9f4731e6e71a2..43616aa8acbc8 100644 --- a/tests/ui/uninhabited/uninhabited-irrefutable.rs +++ b/tests/ui/uninhabited/uninhabited-irrefutable.rs @@ -1,6 +1,5 @@ //@ revisions: normal exhaustive_patterns #![cfg_attr(exhaustive_patterns, feature(exhaustive_patterns))] -#![feature(never_type)] mod foo { pub struct SecretlyEmpty { diff --git a/tests/ui/uninhabited/uninhabited-patterns.rs b/tests/ui/uninhabited/uninhabited-patterns.rs index 1f30af2acc697..0c811c5b7c748 100644 --- a/tests/ui/uninhabited/uninhabited-patterns.rs +++ b/tests/ui/uninhabited/uninhabited-patterns.rs @@ -1,6 +1,5 @@ #![feature(exhaustive_patterns)] #![feature(box_patterns)] -#![feature(never_type)] #![deny(unreachable_patterns)] mod foo { diff --git a/tests/ui/uninhabited/uninhabited-unstable-field.rs b/tests/ui/uninhabited/uninhabited-unstable-field.rs index 321b864aa27de..f59b9c0a98efd 100644 --- a/tests/ui/uninhabited/uninhabited-unstable-field.rs +++ b/tests/ui/uninhabited/uninhabited-unstable-field.rs @@ -4,7 +4,6 @@ //! been reverted, and this file ensures that we don't special-case unstable fields wrt //! inhabitedness anymore. #![feature(exhaustive_patterns)] -#![feature(never_type)] #![feature(my_coro_state)] // Custom feature from `staged-api.rs` #![deny(unreachable_patterns)] diff --git a/tests/ui/unpretty/exhaustive.expanded.stdout b/tests/ui/unpretty/exhaustive.expanded.stdout index f555904e5dd7d..f2488029bffda 100644 --- a/tests/ui/unpretty/exhaustive.expanded.stdout +++ b/tests/ui/unpretty/exhaustive.expanded.stdout @@ -20,7 +20,6 @@ #![feature(gen_blocks)] #![feature(more_qualified_paths)] #![feature(never_patterns)] -#![feature(never_type)] #![feature(pattern_types)] #![feature(pattern_type_macro)] #![feature(prelude_import)] diff --git a/tests/ui/unpretty/exhaustive.rs b/tests/ui/unpretty/exhaustive.rs index 0bbc87845695f..1ab664434e1f6 100644 --- a/tests/ui/unpretty/exhaustive.rs +++ b/tests/ui/unpretty/exhaustive.rs @@ -19,7 +19,6 @@ #![feature(gen_blocks)] #![feature(more_qualified_paths)] #![feature(never_patterns)] -#![feature(never_type)] #![feature(pattern_types)] #![feature(pattern_type_macro)] #![feature(prelude_import)] From 361d28240ddcc8d3325200b6d8b469acd147e085 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 15 Aug 2025 02:32:46 +0200 Subject: [PATCH 05/14] remove `#![feature(never_type)]` from library --- library/alloc/src/lib.rs | 1 - library/alloctests/lib.rs | 1 - library/core/src/lib.rs | 1 - library/core/src/mem/mod.rs | 1 - library/core/src/primitive_docs.rs | 2 -- library/core/src/result.rs | 2 -- library/coretests/tests/lib.rs | 1 - library/std/src/keyword_docs.rs | 1 - library/std/src/lib.rs | 1 - 9 files changed, 11 deletions(-) diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs index d85a63999fe03..8a70dea66f2bb 100644 --- a/library/alloc/src/lib.rs +++ b/library/alloc/src/lib.rs @@ -184,7 +184,6 @@ #![feature(min_specialization)] #![feature(multiple_supertrait_upcastable)] #![feature(negative_impls)] -#![feature(never_type)] #![feature(optimize_attribute)] #![feature(rustc_attrs)] #![feature(slice_internals)] diff --git a/library/alloctests/lib.rs b/library/alloctests/lib.rs index e09d8495fdeac..6778f25de5d21 100644 --- a/library/alloctests/lib.rs +++ b/library/alloctests/lib.rs @@ -57,7 +57,6 @@ #![feature(const_trait_impl)] #![feature(dropck_eyepatch)] #![feature(min_specialization)] -#![feature(never_type)] #![feature(optimize_attribute)] #![feature(prelude_import)] #![feature(rustc_attrs)] diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 2b4ac66212e5b..5750ff89a033f 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -153,7 +153,6 @@ #![feature(multiple_supertrait_upcastable)] #![feature(must_not_suspend)] #![feature(negative_impls)] -#![feature(never_type)] #![feature(no_core)] #![feature(optimize_attribute)] #![feature(pattern_types)] diff --git a/library/core/src/mem/mod.rs b/library/core/src/mem/mod.rs index 2fbb5842ef778..e33cdad3f8a21 100644 --- a/library/core/src/mem/mod.rs +++ b/library/core/src/mem/mod.rs @@ -1342,7 +1342,6 @@ pub const fn discriminant(v: &T) -> Discriminant { /// # Examples /// /// ``` -/// # #![feature(never_type)] /// # #![feature(variant_count)] /// /// use std::mem; diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs index db61aba59277d..46984b8592e4c 100644 --- a/library/core/src/primitive_docs.rs +++ b/library/core/src/primitive_docs.rs @@ -73,7 +73,6 @@ mod prim_bool {} /// write: /// /// ``` -/// #![feature(never_type)] /// # fn foo() -> u32 { /// let x: ! = { /// return 123 @@ -230,7 +229,6 @@ mod prim_bool {} /// for example: /// /// ``` -/// #![feature(never_type)] /// # use std::fmt; /// # trait Debug { /// # fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result; diff --git a/library/core/src/result.rs b/library/core/src/result.rs index 5f438d72ac13c..4ea35279ecc36 100644 --- a/library/core/src/result.rs +++ b/library/core/src/result.rs @@ -1344,7 +1344,6 @@ impl Result { /// # Examples /// /// ``` - /// # #![feature(never_type)] /// # #![feature(unwrap_infallible)] /// /// fn only_good_news() -> Result { @@ -1381,7 +1380,6 @@ impl Result { /// # Examples /// /// ``` - /// # #![feature(never_type)] /// # #![feature(unwrap_infallible)] /// /// fn only_bad_news() -> Result { diff --git a/library/coretests/tests/lib.rs b/library/coretests/tests/lib.rs index c4292c2a421b1..28fcb1275ca4e 100644 --- a/library/coretests/tests/lib.rs +++ b/library/coretests/tests/lib.rs @@ -84,7 +84,6 @@ #![feature(maybe_uninit_fill)] #![feature(maybe_uninit_uninit_array_transpose)] #![feature(min_specialization)] -#![feature(never_type)] #![feature(next_index)] #![feature(non_exhaustive_omitted_patterns_lint)] #![feature(nonzero_from_str_radix)] diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs index 1c8927435c3a1..bfda626fb7544 100644 --- a/library/std/src/keyword_docs.rs +++ b/library/std/src/keyword_docs.rs @@ -2229,7 +2229,6 @@ mod type_keyword {} /// It is also possible to have `unsafe fn` in a regular safe `trait`: /// /// ```rust -/// # #![feature(never_type)] /// #![deny(unsafe_op_in_unsafe_fn)] /// /// trait Indexable { diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 807befec1ad11..81fc72a259e8d 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -294,7 +294,6 @@ #![feature(must_not_suspend)] #![feature(needs_panic_runtime)] #![feature(negative_impls)] -#![feature(never_type)] #![feature(optimize_attribute)] #![feature(prelude_import)] #![feature(rustc_attrs)] From 5b4550fcd49dd8ae7e17876e325ad1efa1f92eaa Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 15 Aug 2025 02:32:46 +0200 Subject: [PATCH 06/14] remove `#![feature(never_type)]` from tools --- src/tools/clippy/clippy_lints/src/lib.rs | 2 +- .../src/zero_repeat_side_effects.rs | 5 +-- src/tools/clippy/tests/ui/double_must_use.rs | 1 - .../clippy/tests/ui/double_must_use.stderr | 12 +++---- src/tools/clippy/tests/ui/empty_enums.rs | 1 - src/tools/clippy/tests/ui/empty_enums.stderr | 2 +- .../ui/empty_enums_without_never_type.rs | 8 ----- .../ui/infallible_destructuring_match.fixed | 2 +- .../ui/infallible_destructuring_match.rs | 2 +- .../clippy/tests/ui/infallible_try_from.rs | 1 - .../tests/ui/infallible_try_from.stderr | 4 +-- .../clippy/tests/ui/must_use_candidates.fixed | 1 - .../clippy/tests/ui/must_use_candidates.rs | 1 - .../tests/ui/must_use_candidates.stderr | 14 ++++---- .../tests/ui/result_map_unit_fn_unfixable.rs | 1 - .../ui/result_map_unit_fn_unfixable.stderr | 12 +++---- .../clippy/tests/ui/uninhabited_references.rs | 1 - .../tests/ui/uninhabited_references.stderr | 8 ++--- .../clippy/tests/ui/unwrap_expect_used.rs | 1 - .../clippy/tests/ui/unwrap_expect_used.stderr | 32 +++++++++---------- ...ro_repeat_side_effects_never_pattern.fixed | 1 - .../zero_repeat_side_effects_never_pattern.rs | 1 - ...o_repeat_side_effects_never_pattern.stderr | 2 +- .../zero_repeat_side_effects_unfixable.stderr | 6 +++- src/tools/miri/src/lib.rs | 2 +- .../dangling_pointer_deref_match_never.rs | 1 - src/tools/miri/tests/fail/erroneous_const.rs | 1 - .../intrinsics/uninit_uninhabited_type.rs | 2 -- .../match/closures/uninhabited-variant1.rs | 1 - .../match/closures/uninhabited-variant2.rs | 1 - .../fail/match/only_inhabited_variant.rs | 1 - .../miri/tests/fail/never_match_never.rs | 1 - src/tools/miri/tests/fail/never_say_never.rs | 1 - .../miri/tests/fail/never_transmute_humans.rs | 2 -- .../miri/tests/fail/never_transmute_void.rs | 1 - .../invalid_enum_op_discr_uninhabited.rs | 1 - .../fail/validity/ref_to_uninhabited1.rs | 1 - .../fail/validity/uninhabited_variant.rs | 1 - src/tools/miri/tests/pass/async-fn.rs | 2 -- src/tools/miri/tests/pass/coroutine.rs | 2 +- .../tests/pass/function_calls/abi_compat.rs | 2 -- .../issue-120337-irrefutable-let-ice.rs | 1 - src/tools/miri/tests/pass/loop-break-value.rs | 1 - .../miri/tests/pass/panic/catch_panic.rs | 1 - .../miri/tests/pass/underscore_pattern.rs | 1 - 45 files changed, 54 insertions(+), 94 deletions(-) delete mode 100644 src/tools/clippy/tests/ui/empty_enums_without_never_type.rs diff --git a/src/tools/clippy/clippy_lints/src/lib.rs b/src/tools/clippy/clippy_lints/src/lib.rs index 72ee5cca03970..c37adbac3c617 100644 --- a/src/tools/clippy/clippy_lints/src/lib.rs +++ b/src/tools/clippy/clippy_lints/src/lib.rs @@ -6,7 +6,7 @@ #![feature(iter_intersperse)] #![feature(iter_partition_in_place)] #![feature(macro_metavar_expr_concat)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(rustc_private)] #![feature(stmt_expr_attributes)] #![feature(unwrap_infallible)] diff --git a/src/tools/clippy/clippy_lints/src/zero_repeat_side_effects.rs b/src/tools/clippy/clippy_lints/src/zero_repeat_side_effects.rs index cb254cc156296..73f749f24d572 100644 --- a/src/tools/clippy/clippy_lints/src/zero_repeat_side_effects.rs +++ b/src/tools/clippy/clippy_lints/src/zero_repeat_side_effects.rs @@ -74,7 +74,6 @@ fn inner_check(cx: &LateContext<'_>, expr: &'_ Expr<'_>, inner_expr: &'_ Expr<'_ // check if expr is a call or has a call inside it if inner_expr.can_have_side_effects() { let parent_hir_node = cx.tcx.parent_hir_node(expr.hir_id); - let inner_expr_ty = cx.typeck_results().expr_ty(inner_expr); let return_type = cx.typeck_results().expr_ty(expr); let inner_expr = snippet(cx, inner_expr.span.source_callsite(), ".."); @@ -119,9 +118,7 @@ fn inner_check(cx: &LateContext<'_>, expr: &'_ Expr<'_>, inner_expr: &'_ Expr<'_ span, "expression with side effects as the initial value in a zero-sized array initializer", |diag| { - if (!inner_expr_ty.is_never() || cx.tcx.features().never_type()) - && return_type.is_suggestable(cx.tcx, true) - { + if return_type.is_suggestable(cx.tcx, true) { diag.span_suggestion_verbose( span, "consider performing the side effect separately", diff --git a/src/tools/clippy/tests/ui/double_must_use.rs b/src/tools/clippy/tests/ui/double_must_use.rs index c8b5828889fc8..93389b3d54a34 100644 --- a/src/tools/clippy/tests/ui/double_must_use.rs +++ b/src/tools/clippy/tests/ui/double_must_use.rs @@ -1,6 +1,5 @@ #![warn(clippy::double_must_use)] #![allow(clippy::result_unit_err)] -#![feature(never_type)] use std::ops::ControlFlow; diff --git a/src/tools/clippy/tests/ui/double_must_use.stderr b/src/tools/clippy/tests/ui/double_must_use.stderr index 50b1640c47f5f..7e923a7dcb08c 100644 --- a/src/tools/clippy/tests/ui/double_must_use.stderr +++ b/src/tools/clippy/tests/ui/double_must_use.stderr @@ -1,5 +1,5 @@ error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` - --> tests/ui/double_must_use.rs:8:1 + --> tests/ui/double_must_use.rs:7:1 | LL | pub fn must_use_result() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | pub fn must_use_result() -> Result<(), ()> { = help: to override `-D warnings` add `#[allow(clippy::double_must_use)]` error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` - --> tests/ui/double_must_use.rs:15:1 + --> tests/ui/double_must_use.rs:14:1 | LL | pub fn must_use_tuple() -> (Result<(), ()>, u8) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -17,7 +17,7 @@ LL | pub fn must_use_tuple() -> (Result<(), ()>, u8) { = help: either add some descriptive message or remove the attribute error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` - --> tests/ui/double_must_use.rs:22:1 + --> tests/ui/double_must_use.rs:21:1 | LL | pub fn must_use_array() -> [Result<(), ()>; 1] { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,7 +25,7 @@ LL | pub fn must_use_array() -> [Result<(), ()>; 1] { = help: either add some descriptive message or remove the attribute error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` - --> tests/ui/double_must_use.rs:40:1 + --> tests/ui/double_must_use.rs:39:1 | LL | async fn async_must_use_result() -> Result<(), ()> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -33,7 +33,7 @@ LL | async fn async_must_use_result() -> Result<(), ()> { = help: either add some descriptive message or remove the attribute error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` - --> tests/ui/double_must_use.rs:55:1 + --> tests/ui/double_must_use.rs:54:1 | LL | pub fn must_use_result_with_uninhabited_2() -> Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -41,7 +41,7 @@ LL | pub fn must_use_result_with_uninhabited_2() -> Result { = help: either add some descriptive message or remove the attribute error: this function has a `#[must_use]` attribute with no message, but returns a type already marked as `#[must_use]` - --> tests/ui/double_must_use.rs:66:1 + --> tests/ui/double_must_use.rs:65:1 | LL | pub fn must_use_controlflow_with_uninhabited_2() -> ControlFlow { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/clippy/tests/ui/empty_enums.rs b/src/tools/clippy/tests/ui/empty_enums.rs index 0deb0f57b0e4a..dc8549f52fdc8 100644 --- a/src/tools/clippy/tests/ui/empty_enums.rs +++ b/src/tools/clippy/tests/ui/empty_enums.rs @@ -1,6 +1,5 @@ #![warn(clippy::empty_enums)] // Enable never type to test empty enum lint -#![feature(never_type)] enum Empty {} //~^ empty_enums diff --git a/src/tools/clippy/tests/ui/empty_enums.stderr b/src/tools/clippy/tests/ui/empty_enums.stderr index 5aa2347b4ae08..231d68a21c258 100644 --- a/src/tools/clippy/tests/ui/empty_enums.stderr +++ b/src/tools/clippy/tests/ui/empty_enums.stderr @@ -1,5 +1,5 @@ error: enum with no variants - --> tests/ui/empty_enums.rs:5:1 + --> tests/ui/empty_enums.rs:4:1 | LL | enum Empty {} | ^^^^^^^^^^^^^ diff --git a/src/tools/clippy/tests/ui/empty_enums_without_never_type.rs b/src/tools/clippy/tests/ui/empty_enums_without_never_type.rs deleted file mode 100644 index 17ccac83ce98e..0000000000000 --- a/src/tools/clippy/tests/ui/empty_enums_without_never_type.rs +++ /dev/null @@ -1,8 +0,0 @@ -//@ check-pass - -#![warn(clippy::empty_enums)] - -// `never_type` is not enabled; this test has no stderr file -enum Empty {} - -fn main() {} diff --git a/src/tools/clippy/tests/ui/infallible_destructuring_match.fixed b/src/tools/clippy/tests/ui/infallible_destructuring_match.fixed index ecf1b14e5b620..57e2efdf79301 100644 --- a/src/tools/clippy/tests/ui/infallible_destructuring_match.fixed +++ b/src/tools/clippy/tests/ui/infallible_destructuring_match.fixed @@ -1,4 +1,4 @@ -#![feature(exhaustive_patterns, never_type)] +#![feature(exhaustive_patterns)] #![allow(dead_code, unreachable_code, unused_variables)] #![allow(clippy::let_and_return, clippy::uninhabited_references)] diff --git a/src/tools/clippy/tests/ui/infallible_destructuring_match.rs b/src/tools/clippy/tests/ui/infallible_destructuring_match.rs index 5db30ebca88fa..fe425abcf1dff 100644 --- a/src/tools/clippy/tests/ui/infallible_destructuring_match.rs +++ b/src/tools/clippy/tests/ui/infallible_destructuring_match.rs @@ -1,4 +1,4 @@ -#![feature(exhaustive_patterns, never_type)] +#![feature(exhaustive_patterns)] #![allow(dead_code, unreachable_code, unused_variables)] #![allow(clippy::let_and_return, clippy::uninhabited_references)] diff --git a/src/tools/clippy/tests/ui/infallible_try_from.rs b/src/tools/clippy/tests/ui/infallible_try_from.rs index 6a1f12f824f55..6545a54980ae9 100644 --- a/src/tools/clippy/tests/ui/infallible_try_from.rs +++ b/src/tools/clippy/tests/ui/infallible_try_from.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![warn(clippy::infallible_try_from)] use std::convert::Infallible; diff --git a/src/tools/clippy/tests/ui/infallible_try_from.stderr b/src/tools/clippy/tests/ui/infallible_try_from.stderr index d1e0d9e7d3bb7..d4774b2430e4a 100644 --- a/src/tools/clippy/tests/ui/infallible_try_from.stderr +++ b/src/tools/clippy/tests/ui/infallible_try_from.stderr @@ -1,5 +1,5 @@ error: infallible TryFrom impl; consider implementing From instead - --> tests/ui/infallible_try_from.rs:8:1 + --> tests/ui/infallible_try_from.rs:7:1 | LL | impl TryFrom for MyStruct { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,7 +11,7 @@ LL | type Error = !; = help: to override `-D warnings` add `#[allow(clippy::infallible_try_from)]` error: infallible TryFrom impl; consider implementing From instead - --> tests/ui/infallible_try_from.rs:16:1 + --> tests/ui/infallible_try_from.rs:15:1 | LL | impl TryFrom for MyStruct { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/clippy/tests/ui/must_use_candidates.fixed b/src/tools/clippy/tests/ui/must_use_candidates.fixed index 17569884658b1..cd78dcdbb9fda 100644 --- a/src/tools/clippy/tests/ui/must_use_candidates.fixed +++ b/src/tools/clippy/tests/ui/must_use_candidates.fixed @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow( unused_mut, clippy::redundant_allocation, diff --git a/src/tools/clippy/tests/ui/must_use_candidates.rs b/src/tools/clippy/tests/ui/must_use_candidates.rs index 8b898533d01b7..5b18a13045326 100644 --- a/src/tools/clippy/tests/ui/must_use_candidates.rs +++ b/src/tools/clippy/tests/ui/must_use_candidates.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow( unused_mut, clippy::redundant_allocation, diff --git a/src/tools/clippy/tests/ui/must_use_candidates.stderr b/src/tools/clippy/tests/ui/must_use_candidates.stderr index 38c7334322503..ddb14b1b87a62 100644 --- a/src/tools/clippy/tests/ui/must_use_candidates.stderr +++ b/src/tools/clippy/tests/ui/must_use_candidates.stderr @@ -1,5 +1,5 @@ error: this function could have a `#[must_use]` attribute - --> tests/ui/must_use_candidates.rs:16:8 + --> tests/ui/must_use_candidates.rs:15:8 | LL | pub fn pure(i: u8) -> u8 { | ^^^^ @@ -13,7 +13,7 @@ LL | pub fn pure(i: u8) -> u8 { | error: this method could have a `#[must_use]` attribute - --> tests/ui/must_use_candidates.rs:22:12 + --> tests/ui/must_use_candidates.rs:21:12 | LL | pub fn inherent_pure(&self) -> u8 { | ^^^^^^^^^^^^^ @@ -25,7 +25,7 @@ LL ~ pub fn inherent_pure(&self) -> u8 { | error: this function could have a `#[must_use]` attribute - --> tests/ui/must_use_candidates.rs:54:8 + --> tests/ui/must_use_candidates.rs:53:8 | LL | pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool { | ^^^^^^^^^^^ @@ -37,7 +37,7 @@ LL | pub fn with_marker(_d: std::marker::PhantomData<&mut u32>) -> bool { | error: this function could have a `#[must_use]` attribute - --> tests/ui/must_use_candidates.rs:67:8 + --> tests/ui/must_use_candidates.rs:66:8 | LL | pub fn rcd(_x: Rc) -> bool { | ^^^ @@ -49,7 +49,7 @@ LL | pub fn rcd(_x: Rc) -> bool { | error: this function could have a `#[must_use]` attribute - --> tests/ui/must_use_candidates.rs:76:8 + --> tests/ui/must_use_candidates.rs:75:8 | LL | pub fn arcd(_x: Arc) -> bool { | ^^^^ @@ -61,7 +61,7 @@ LL | pub fn arcd(_x: Arc) -> bool { | error: this function could have a `#[must_use]` attribute - --> tests/ui/must_use_candidates.rs:108:8 + --> tests/ui/must_use_candidates.rs:107:8 | LL | pub fn result_uninhabited() -> Result { | ^^^^^^^^^^^^^^^^^^ @@ -74,7 +74,7 @@ LL | pub fn result_uninhabited() -> Result { | error: this function could have a `#[must_use]` attribute - --> tests/ui/must_use_candidates.rs:113:8 + --> tests/ui/must_use_candidates.rs:112:8 | LL | pub fn controlflow_uninhabited() -> std::ops::ControlFlow { | ^^^^^^^^^^^^^^^^^^^^^^^ 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 e3f5c7f996dad..eae7c7d660909 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,6 +1,5 @@ //@no-rustfix #![warn(clippy::result_map_unit_fn)] -#![feature(never_type)] #![allow(clippy::unnecessary_map_on_constructor)] struct HasResult { diff --git a/src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.stderr b/src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.stderr index c7bca9e9e02b3..5b808fd383f98 100644 --- a/src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.stderr +++ b/src/tools/clippy/tests/ui/result_map_unit_fn_unfixable.stderr @@ -1,5 +1,5 @@ error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()` - --> tests/ui/result_map_unit_fn_unfixable.rs:24:5 + --> tests/ui/result_map_unit_fn_unfixable.rs:23:5 | LL | x.field.map(|value| { do_nothing(value); do_nothing(value) }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL + if let Ok(value) = x.field { ... } | error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()` - --> tests/ui/result_map_unit_fn_unfixable.rs:29:5 + --> tests/ui/result_map_unit_fn_unfixable.rs:28:5 | LL | x.field.map(|value| if value > 0 { do_nothing(value); do_nothing(value) }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -25,7 +25,7 @@ LL + if let Ok(value) = x.field { ... } | error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()` - --> tests/ui/result_map_unit_fn_unfixable.rs:35:5 + --> tests/ui/result_map_unit_fn_unfixable.rs:34:5 | LL | / x.field.map(|value| { LL | | @@ -47,7 +47,7 @@ LL + if let Ok(value) = x.field { ... } | error: called `map(f)` on a `Result` value where `f` is a closure that returns the unit type `()` - --> tests/ui/result_map_unit_fn_unfixable.rs:41:5 + --> tests/ui/result_map_unit_fn_unfixable.rs:40:5 | LL | x.field.map(|value| { do_nothing(value); do_nothing(value); }); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ LL + if let Ok(value) = x.field { ... } | error: called `map(f)` on a `Result` value where `f` is a function that returns the unit type `()` - --> tests/ui/result_map_unit_fn_unfixable.rs:47:5 + --> tests/ui/result_map_unit_fn_unfixable.rs:46:5 | LL | "12".parse::().map(diverge); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -71,7 +71,7 @@ LL + if let Ok(a) = "12".parse::() { diverge(a) } | error: called `map(f)` on a `Result` value where `f` is a function that returns the unit type `()` - --> tests/ui/result_map_unit_fn_unfixable.rs:55:5 + --> tests/ui/result_map_unit_fn_unfixable.rs:54:5 | LL | y.map(do_nothing); | ^^^^^^^^^^^^^^^^^ diff --git a/src/tools/clippy/tests/ui/uninhabited_references.rs b/src/tools/clippy/tests/ui/uninhabited_references.rs index 9b3616ad51871..f8b8dc558dbdf 100644 --- a/src/tools/clippy/tests/ui/uninhabited_references.rs +++ b/src/tools/clippy/tests/ui/uninhabited_references.rs @@ -1,6 +1,5 @@ #![warn(clippy::uninhabited_references)] #![allow(clippy::missing_transmute_annotations)] -#![feature(never_type)] fn ret_uninh_ref() -> &'static std::convert::Infallible { //~^ uninhabited_references diff --git a/src/tools/clippy/tests/ui/uninhabited_references.stderr b/src/tools/clippy/tests/ui/uninhabited_references.stderr index ac05ab5bb4d40..0d29816fc51d9 100644 --- a/src/tools/clippy/tests/ui/uninhabited_references.stderr +++ b/src/tools/clippy/tests/ui/uninhabited_references.stderr @@ -1,5 +1,5 @@ error: dereferencing a reference to an uninhabited type would be undefined behavior - --> tests/ui/uninhabited_references.rs:5:23 + --> tests/ui/uninhabited_references.rs:4:23 | LL | fn ret_uninh_ref() -> &'static std::convert::Infallible { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -8,7 +8,7 @@ LL | fn ret_uninh_ref() -> &'static std::convert::Infallible { = help: to override `-D warnings` add `#[allow(clippy::uninhabited_references)]` error: dereferencing a reference to an uninhabited type would be undefined behavior - --> tests/ui/uninhabited_references.rs:12:30 + --> tests/ui/uninhabited_references.rs:11:30 | LL | fn $name(x: &$ty) -> &$ty { | ^^^^ @@ -19,7 +19,7 @@ LL | ret_something!(id_never, !); = note: this error originates in the macro `ret_something` (in Nightly builds, run with -Z macro-backtrace for more info) error: dereferencing a reference to an uninhabited type is undefined behavior - --> tests/ui/uninhabited_references.rs:14:14 + --> tests/ui/uninhabited_references.rs:13:14 | LL | &*x | ^^ @@ -30,7 +30,7 @@ LL | ret_something!(id_never, !); = note: this error originates in the macro `ret_something` (in Nightly builds, run with -Z macro-backtrace for more info) error: dereferencing a reference to an uninhabited type is undefined behavior - --> tests/ui/uninhabited_references.rs:25:13 + --> tests/ui/uninhabited_references.rs:24:13 | LL | let _ = *x; | ^^ diff --git a/src/tools/clippy/tests/ui/unwrap_expect_used.rs b/src/tools/clippy/tests/ui/unwrap_expect_used.rs index 207d4dd815be3..3e152a3e52a5c 100644 --- a/src/tools/clippy/tests/ui/unwrap_expect_used.rs +++ b/src/tools/clippy/tests/ui/unwrap_expect_used.rs @@ -1,6 +1,5 @@ #![warn(clippy::unwrap_used, clippy::expect_used)] #![allow(clippy::unnecessary_literal_unwrap)] -#![feature(never_type)] use std::convert::Infallible; diff --git a/src/tools/clippy/tests/ui/unwrap_expect_used.stderr b/src/tools/clippy/tests/ui/unwrap_expect_used.stderr index b9a2844b284c8..6c8c16c2c1967 100644 --- a/src/tools/clippy/tests/ui/unwrap_expect_used.stderr +++ b/src/tools/clippy/tests/ui/unwrap_expect_used.stderr @@ -1,5 +1,5 @@ error: used `unwrap()` on an `Option` value - --> tests/ui/unwrap_expect_used.rs:27:5 + --> tests/ui/unwrap_expect_used.rs:26:5 | LL | Some(3).unwrap(); | ^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | Some(3).unwrap(); = help: to override `-D warnings` add `#[allow(clippy::unwrap_used)]` error: used `expect()` on an `Option` value - --> tests/ui/unwrap_expect_used.rs:30:5 + --> tests/ui/unwrap_expect_used.rs:29:5 | LL | Some(3).expect("Hello world!"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -19,7 +19,7 @@ LL | Some(3).expect("Hello world!"); = help: to override `-D warnings` add `#[allow(clippy::expect_used)]` error: used `unwrap()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:46:5 + --> tests/ui/unwrap_expect_used.rs:45:5 | LL | a.unwrap(); | ^^^^^^^^^^ @@ -27,7 +27,7 @@ LL | a.unwrap(); = note: if this value is an `Err`, it will panic error: used `expect()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:49:5 + --> tests/ui/unwrap_expect_used.rs:48:5 | LL | a.expect("Hello world!"); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -35,7 +35,7 @@ LL | a.expect("Hello world!"); = note: if this value is an `Err`, it will panic error: used `unwrap_err()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:52:5 + --> tests/ui/unwrap_expect_used.rs:51:5 | LL | a.unwrap_err(); | ^^^^^^^^^^^^^^ @@ -43,7 +43,7 @@ LL | a.unwrap_err(); = note: if this value is an `Ok`, it will panic error: used `expect_err()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:55:5 + --> tests/ui/unwrap_expect_used.rs:54:5 | LL | a.expect_err("Hello error!"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -51,7 +51,7 @@ LL | a.expect_err("Hello error!"); = note: if this value is an `Ok`, it will panic error: used `unwrap()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:80:17 + --> tests/ui/unwrap_expect_used.rs:79:17 | LL | let _ = open!(file).unwrap(); | ^^^^^^^^^^^^^^^^^^^^ @@ -59,7 +59,7 @@ LL | let _ = open!(file).unwrap(); = note: if this value is an `Err`, it will panic error: used `expect()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:81:17 + --> tests/ui/unwrap_expect_used.rs:80:17 | LL | let _ = open!(file).expect("can open"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -67,7 +67,7 @@ LL | let _ = open!(file).expect("can open"); = note: if this value is an `Err`, it will panic error: used `unwrap_err()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:82:17 + --> tests/ui/unwrap_expect_used.rs:81:17 | LL | let _ = open!(file).unwrap_err(); | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -75,7 +75,7 @@ LL | let _ = open!(file).unwrap_err(); = note: if this value is an `Ok`, it will panic error: used `expect_err()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:83:17 + --> tests/ui/unwrap_expect_used.rs:82:17 | LL | let _ = open!(file).expect_err("can open"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -83,7 +83,7 @@ LL | let _ = open!(file).expect_err("can open"); = note: if this value is an `Ok`, it will panic error: used `unwrap()` on an `Option` value - --> tests/ui/unwrap_expect_used.rs:89:5 + --> tests/ui/unwrap_expect_used.rs:88:5 | LL | Option::unwrap(opt); | ^^^^^^^^^^^^^^^^^^^ @@ -91,7 +91,7 @@ LL | Option::unwrap(opt); = note: if this value is `None`, it will panic error: used `expect()` on an `Option` value - --> tests/ui/unwrap_expect_used.rs:90:5 + --> tests/ui/unwrap_expect_used.rs:89:5 | LL | Option::expect(opt, "error message"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -99,7 +99,7 @@ LL | Option::expect(opt, "error message"); = note: if this value is `None`, it will panic error: used `unwrap()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:93:5 + --> tests/ui/unwrap_expect_used.rs:92:5 | LL | Result::unwrap(res); | ^^^^^^^^^^^^^^^^^^^ @@ -107,7 +107,7 @@ LL | Result::unwrap(res); = note: if this value is an `Err`, it will panic error: used `expect()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:94:5 + --> tests/ui/unwrap_expect_used.rs:93:5 | LL | Result::expect(res, "error message"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -115,7 +115,7 @@ LL | Result::expect(res, "error message"); = note: if this value is an `Err`, it will panic error: used `unwrap_err()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:95:5 + --> tests/ui/unwrap_expect_used.rs:94:5 | LL | Result::unwrap_err(res); | ^^^^^^^^^^^^^^^^^^^^^^^ @@ -123,7 +123,7 @@ LL | Result::unwrap_err(res); = note: if this value is an `Ok`, it will panic error: used `expect_err()` on a `Result` value - --> tests/ui/unwrap_expect_used.rs:96:5 + --> tests/ui/unwrap_expect_used.rs:95:5 | LL | Result::expect_err(res, "error message"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.fixed b/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.fixed index 3d037516f75c8..e6faf115de545 100644 --- a/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.fixed +++ b/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.fixed @@ -1,6 +1,5 @@ #![warn(clippy::zero_repeat_side_effects)] #![allow(clippy::diverging_sub_expression)] -#![feature(never_type)] fn issue_14998() { // nameable type thanks to `never_type` being enabled, suggest diff --git a/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.rs b/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.rs index 3dc1929bcdc76..2fec6b1d26ab2 100644 --- a/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.rs +++ b/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.rs @@ -1,6 +1,5 @@ #![warn(clippy::zero_repeat_side_effects)] #![allow(clippy::diverging_sub_expression)] -#![feature(never_type)] fn issue_14998() { // nameable type thanks to `never_type` being enabled, suggest diff --git a/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.stderr b/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.stderr index 280955740cc4c..df2c26bda7971 100644 --- a/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.stderr +++ b/src/tools/clippy/tests/ui/zero_repeat_side_effects_never_pattern.stderr @@ -1,5 +1,5 @@ error: expression with side effects as the initial value in a zero-sized array initializer - --> tests/ui/zero_repeat_side_effects_never_pattern.rs:7:5 + --> tests/ui/zero_repeat_side_effects_never_pattern.rs:6:5 | LL | let _data = [panic!(); 0]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/tools/clippy/tests/ui/zero_repeat_side_effects_unfixable.stderr b/src/tools/clippy/tests/ui/zero_repeat_side_effects_unfixable.stderr index 450617f3782c4..1a7c88591783f 100644 --- a/src/tools/clippy/tests/ui/zero_repeat_side_effects_unfixable.stderr +++ b/src/tools/clippy/tests/ui/zero_repeat_side_effects_unfixable.stderr @@ -14,7 +14,11 @@ error: expression with side effects as the initial value in a zero-sized array i LL | let _data = [panic!(); 0]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: consider performing the side effect separately +help: consider performing the side effect separately + | +LL ~ panic!(); +LL + let _data: [!; 0] = []; + | error: aborting due to 2 previous errors diff --git a/src/tools/miri/src/lib.rs b/src/tools/miri/src/lib.rs index f41e3c20a7d54..204bb00a7ba76 100644 --- a/src/tools/miri/src/lib.rs +++ b/src/tools/miri/src/lib.rs @@ -13,7 +13,7 @@ #![feature(float_gamma)] #![feature(float_erf)] #![feature(map_try_insert)] -#![feature(never_type)] +#![cfg_attr(bootstrap, feature(never_type))] #![feature(try_blocks)] #![feature(io_error_more)] #![feature(io_error_inprogress)] diff --git a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.rs b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.rs index e77c8e06a0f9e..890f194180dbb 100644 --- a/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.rs +++ b/src/tools/miri/tests/fail/dangling_pointers/dangling_pointer_deref_match_never.rs @@ -2,7 +2,6 @@ //@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation #![allow(unreachable_code)] -#![feature(never_type)] fn main() { let p = { diff --git a/src/tools/miri/tests/fail/erroneous_const.rs b/src/tools/miri/tests/fail/erroneous_const.rs index 6e126ed701f88..736a881749c6d 100644 --- a/src/tools/miri/tests/fail/erroneous_const.rs +++ b/src/tools/miri/tests/fail/erroneous_const.rs @@ -1,6 +1,5 @@ //! Make sure we detect erroneous constants post-monomorphization even when they are unused. //! (https://github.com/rust-lang/miri/issues/1382) -#![feature(never_type)] struct PrintName(T); impl PrintName { diff --git a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.rs b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.rs index 34fef6b9ee556..2d7f8d2e46879 100644 --- a/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.rs +++ b/src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - #[allow(deprecated, invalid_value)] fn main() { let _ = unsafe { std::mem::uninitialized::() }; //~ERROR: constructing invalid value diff --git a/src/tools/miri/tests/fail/match/closures/uninhabited-variant1.rs b/src/tools/miri/tests/fail/match/closures/uninhabited-variant1.rs index 0a2dfe9a7f645..4a8c28857ae46 100644 --- a/src/tools/miri/tests/fail/match/closures/uninhabited-variant1.rs +++ b/src/tools/miri/tests/fail/match/closures/uninhabited-variant1.rs @@ -1,6 +1,5 @@ // Motivated by rust-lang/rust#138961, this shows how invalid discriminants interact with // closure captures. -#![feature(never_type)] #[repr(C)] #[allow(dead_code)] diff --git a/src/tools/miri/tests/fail/match/closures/uninhabited-variant2.rs b/src/tools/miri/tests/fail/match/closures/uninhabited-variant2.rs index 050e83884d1e2..3d88798f44b18 100644 --- a/src/tools/miri/tests/fail/match/closures/uninhabited-variant2.rs +++ b/src/tools/miri/tests/fail/match/closures/uninhabited-variant2.rs @@ -3,7 +3,6 @@ // // Test case with only one inhabited variant, for which rustc used to not emit // a discriminant read in the first place. See: rust-lang/miri#4778 -#![feature(never_type)] #[repr(C)] #[allow(dead_code)] diff --git a/src/tools/miri/tests/fail/match/only_inhabited_variant.rs b/src/tools/miri/tests/fail/match/only_inhabited_variant.rs index 2be5e8083aa7f..7457481a22ca2 100644 --- a/src/tools/miri/tests/fail/match/only_inhabited_variant.rs +++ b/src/tools/miri/tests/fail/match/only_inhabited_variant.rs @@ -1,5 +1,4 @@ // rust-lang/miri#4778 -#![feature(never_type)] #[repr(C)] #[allow(dead_code)] diff --git a/src/tools/miri/tests/fail/never_match_never.rs b/src/tools/miri/tests/fail/never_match_never.rs index 5f2f471bf6098..02b3eff13a377 100644 --- a/src/tools/miri/tests/fail/never_match_never.rs +++ b/src/tools/miri/tests/fail/never_match_never.rs @@ -1,7 +1,6 @@ // This should fail even without validation //@compile-flags: -Zmiri-disable-validation -#![feature(never_type)] #![allow(unreachable_code)] fn main() { diff --git a/src/tools/miri/tests/fail/never_say_never.rs b/src/tools/miri/tests/fail/never_say_never.rs index fd082e367a83a..457005391ae80 100644 --- a/src/tools/miri/tests/fail/never_say_never.rs +++ b/src/tools/miri/tests/fail/never_say_never.rs @@ -1,7 +1,6 @@ // This should fail even without validation //@compile-flags: -Zmiri-disable-validation -#![feature(never_type)] #![allow(unreachable_code)] fn main() { diff --git a/src/tools/miri/tests/fail/never_transmute_humans.rs b/src/tools/miri/tests/fail/never_transmute_humans.rs index cba3cc0ccf17b..559eb652555ac 100644 --- a/src/tools/miri/tests/fail/never_transmute_humans.rs +++ b/src/tools/miri/tests/fail/never_transmute_humans.rs @@ -1,8 +1,6 @@ // This should fail even without validation //@compile-flags: -Zmiri-disable-validation -#![feature(never_type)] - struct Human; fn main() { diff --git a/src/tools/miri/tests/fail/never_transmute_void.rs b/src/tools/miri/tests/fail/never_transmute_void.rs index a2db2ca9db61b..bc1095c815e7f 100644 --- a/src/tools/miri/tests/fail/never_transmute_void.rs +++ b/src/tools/miri/tests/fail/never_transmute_void.rs @@ -1,7 +1,6 @@ // This should fail even without validation //@compile-flags: -Zmiri-disable-validation -#![feature(never_type)] #![allow(unused, invalid_value)] mod m { diff --git a/src/tools/miri/tests/fail/validity/invalid_enum_op_discr_uninhabited.rs b/src/tools/miri/tests/fail/validity/invalid_enum_op_discr_uninhabited.rs index 3d1ae64b57826..96c7a613378ad 100644 --- a/src/tools/miri/tests/fail/validity/invalid_enum_op_discr_uninhabited.rs +++ b/src/tools/miri/tests/fail/validity/invalid_enum_op_discr_uninhabited.rs @@ -1,6 +1,5 @@ // Make sure we find these even with many checks disabled. //@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation -#![feature(never_type)] enum Never {} diff --git a/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.rs b/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.rs index 2e6be8b971c64..a3741a394d752 100644 --- a/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.rs +++ b/src/tools/miri/tests/fail/validity/ref_to_uninhabited1.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] use std::mem::{forget, transmute}; fn main() { diff --git a/src/tools/miri/tests/fail/validity/uninhabited_variant.rs b/src/tools/miri/tests/fail/validity/uninhabited_variant.rs index 303584423fdcf..4d6b4b84ca53f 100644 --- a/src/tools/miri/tests/fail/validity/uninhabited_variant.rs +++ b/src/tools/miri/tests/fail/validity/uninhabited_variant.rs @@ -1,6 +1,5 @@ // NOTE: this is essentially a smoke-test, with more comprehensive tests living in the rustc // repository at tests/ui/consts/const-eval/ub-enum.rs -#![feature(never_type)] #[repr(C)] #[allow(dead_code)] diff --git a/src/tools/miri/tests/pass/async-fn.rs b/src/tools/miri/tests/pass/async-fn.rs index 42c60bb4fabdd..a20caf3d9f515 100644 --- a/src/tools/miri/tests/pass/async-fn.rs +++ b/src/tools/miri/tests/pass/async-fn.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - use std::future::Future; // See if we can run a basic `async fn` diff --git a/src/tools/miri/tests/pass/coroutine.rs b/src/tools/miri/tests/pass/coroutine.rs index 96b60b515cb6d..6ecf867771262 100644 --- a/src/tools/miri/tests/pass/coroutine.rs +++ b/src/tools/miri/tests/pass/coroutine.rs @@ -1,6 +1,6 @@ //@revisions: stack tree //@[tree]compile-flags: -Zmiri-tree-borrows -#![feature(coroutines, coroutine_trait, never_type, stmt_expr_attributes)] +#![feature(coroutines, coroutine_trait, stmt_expr_attributes)] use std::fmt::Debug; use std::mem::ManuallyDrop; diff --git a/src/tools/miri/tests/pass/function_calls/abi_compat.rs b/src/tools/miri/tests/pass/function_calls/abi_compat.rs index cd48bd2accb27..3c0535adea94c 100644 --- a/src/tools/miri/tests/pass/function_calls/abi_compat.rs +++ b/src/tools/miri/tests/pass/function_calls/abi_compat.rs @@ -1,5 +1,3 @@ -#![feature(never_type)] - use std::rc::Rc; use std::{mem, num, ptr}; diff --git a/src/tools/miri/tests/pass/issues/issue-120337-irrefutable-let-ice.rs b/src/tools/miri/tests/pass/issues/issue-120337-irrefutable-let-ice.rs index 5af0d0e4bbd95..7380d700ab708 100644 --- a/src/tools/miri/tests/pass/issues/issue-120337-irrefutable-let-ice.rs +++ b/src/tools/miri/tests/pass/issues/issue-120337-irrefutable-let-ice.rs @@ -1,7 +1,6 @@ // Validation stops the test before the ICE we used to hit //@compile-flags: -Zmiri-disable-validation -#![feature(never_type)] #[derive(Copy, Clone)] pub enum E { A(!), diff --git a/src/tools/miri/tests/pass/loop-break-value.rs b/src/tools/miri/tests/pass/loop-break-value.rs index 74ab487b342a1..dffbfdaf06472 100644 --- a/src/tools/miri/tests/pass/loop-break-value.rs +++ b/src/tools/miri/tests/pass/loop-break-value.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unreachable_code)] #[allow(unused)] diff --git a/src/tools/miri/tests/pass/panic/catch_panic.rs b/src/tools/miri/tests/pass/panic/catch_panic.rs index 06d15a1a7f94e..bd26a79a0b8ec 100644 --- a/src/tools/miri/tests/pass/panic/catch_panic.rs +++ b/src/tools/miri/tests/pass/panic/catch_panic.rs @@ -1,4 +1,3 @@ -#![feature(never_type)] #![allow(unconditional_panic, non_fmt_panics)] use std::cell::Cell; diff --git a/src/tools/miri/tests/pass/underscore_pattern.rs b/src/tools/miri/tests/pass/underscore_pattern.rs index 2f203bdc01e45..44a1d02cc393e 100644 --- a/src/tools/miri/tests/pass/underscore_pattern.rs +++ b/src/tools/miri/tests/pass/underscore_pattern.rs @@ -1,5 +1,4 @@ // Various tests ensuring that underscore patterns really just construct the place, but don't check its contents. -#![feature(never_type)] use std::ptr; From 9f52eda15d942568d7b91dc3bd61c1095d70e14f Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 15 Aug 2025 02:10:40 +0200 Subject: [PATCH 07/14] Make `Infallible = !` --- library/core/src/convert/mod.rs | 102 +----------------------------- library/core/src/num/error.rs | 14 +--- library/core/src/ops/try_trait.rs | 2 +- library/std/src/process.rs | 8 --- 4 files changed, 3 insertions(+), 123 deletions(-) diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 4a4c7ee388f9e..e4e4b7f405c52 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -35,9 +35,6 @@ #![stable(feature = "rust1", since = "1.0.0")] -use crate::error::Error; -use crate::fmt; -use crate::hash::{Hash, Hasher}; use crate::marker::PointeeSized; mod num; @@ -899,102 +896,5 @@ impl const AsMut for str { /// } /// } /// ``` -/// -/// # Future compatibility -/// -/// This enum has the same role as [the `!` “never” type][never], -/// which is unstable in this version of Rust. -/// When `!` is stabilized, we plan to make `Infallible` a type alias to it: -/// -/// ```ignore (illustrates future std change) -/// pub type Infallible = !; -/// ``` -/// -/// … and eventually deprecate `Infallible`. -/// -/// However there is one case where `!` syntax can be used -/// before `!` is stabilized as a full-fledged type: in the position of a function’s return type. -/// Specifically, it is possible to have implementations for two different function pointer types: -/// -/// ``` -/// trait MyTrait {} -/// impl MyTrait for fn() -> ! {} -/// impl MyTrait for fn() -> std::convert::Infallible {} -/// ``` -/// -/// With `Infallible` being an enum, this code is valid. -/// However when `Infallible` becomes an alias for the never type, -/// the two `impl`s will start to overlap -/// and therefore will be disallowed by the language’s trait coherence rules. -#[stable(feature = "convert_infallible", since = "1.34.0")] -#[derive(Copy)] -pub enum Infallible {} - -#[stable(feature = "convert_infallible", since = "1.34.0")] -#[rustc_const_unstable(feature = "const_clone", issue = "142757")] -impl const Clone for Infallible { - fn clone(&self) -> Infallible { - match *self {} - } -} - -#[stable(feature = "convert_infallible", since = "1.34.0")] -impl fmt::Debug for Infallible { - fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result { - match *self {} - } -} - -#[stable(feature = "convert_infallible", since = "1.34.0")] -impl fmt::Display for Infallible { - fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result { - match *self {} - } -} - -#[stable(feature = "str_parse_error2", since = "1.8.0")] -impl Error for Infallible {} - -#[stable(feature = "convert_infallible", since = "1.34.0")] -#[rustc_const_unstable(feature = "const_cmp", issue = "143800")] -impl const PartialEq for Infallible { - fn eq(&self, _: &Infallible) -> bool { - match *self {} - } -} - -#[stable(feature = "convert_infallible", since = "1.34.0")] -#[rustc_const_unstable(feature = "const_cmp", issue = "143800")] -impl const Eq for Infallible {} - -#[stable(feature = "convert_infallible", since = "1.34.0")] -#[rustc_const_unstable(feature = "const_cmp", issue = "143800")] -impl const PartialOrd for Infallible { - fn partial_cmp(&self, _other: &Self) -> Option { - match *self {} - } -} - #[stable(feature = "convert_infallible", since = "1.34.0")] -#[rustc_const_unstable(feature = "const_cmp", issue = "143800")] -impl const Ord for Infallible { - fn cmp(&self, _other: &Self) -> crate::cmp::Ordering { - match *self {} - } -} - -#[stable(feature = "convert_infallible", since = "1.34.0")] -#[rustc_const_unstable(feature = "const_convert", issue = "143773")] -impl const From for Infallible { - #[inline] - fn from(x: !) -> Self { - x - } -} - -#[stable(feature = "convert_infallible_hash", since = "1.44.0")] -impl Hash for Infallible { - fn hash(&self, _: &mut H) { - match *self {} - } -} +pub type Infallible = !; diff --git a/library/core/src/num/error.rs b/library/core/src/num/error.rs index 71989ace1a746..28743e19f238a 100644 --- a/library/core/src/num/error.rs +++ b/library/core/src/num/error.rs @@ -1,6 +1,5 @@ //! Error types for conversion to integral types. -use crate::convert::Infallible; use crate::error::Error; use crate::fmt; @@ -28,23 +27,12 @@ impl fmt::Display for TryFromIntError { #[stable(feature = "try_from", since = "1.34.0")] impl Error for TryFromIntError {} -#[stable(feature = "try_from", since = "1.34.0")] -#[rustc_const_unstable(feature = "const_convert", issue = "143773")] -impl const From for TryFromIntError { - fn from(x: Infallible) -> TryFromIntError { - match x {} - } -} - #[stable(feature = "never_type", since = "CURRENT_RUSTC_VERSION")] #[rustc_const_unstable(feature = "const_convert", issue = "143773")] impl const From for TryFromIntError { #[inline] fn from(never: !) -> TryFromIntError { - // Match rather than coerce to make sure that code like - // `From for TryFromIntError` above will keep working - // when `Infallible` becomes an alias to `!`. - match never {} + never } } diff --git a/library/core/src/ops/try_trait.rs b/library/core/src/ops/try_trait.rs index 9521213e1bc7e..6f08642714c35 100644 --- a/library/core/src/ops/try_trait.rs +++ b/library/core/src/ops/try_trait.rs @@ -229,7 +229,7 @@ pub const trait Try: [const] FromResidual { all( from_desugaring = "QuestionMark", Self = "core::result::Result", - R = "core::option::Option", + R = "core::option::Option", ), message = "the `?` operator can only be used on `Result`s, not `Option`s, \ in {ItemContext} that returns `Result`", diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 69cbc113bb05a..a9c7958101f08 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -161,7 +161,6 @@ ))] mod tests; -use crate::convert::Infallible; use crate::ffi::OsStr; use crate::io::prelude::*; use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut}; @@ -2626,13 +2625,6 @@ impl Termination for ! { } } -#[stable(feature = "termination_trait_lib", since = "1.61.0")] -impl Termination for Infallible { - fn report(self) -> ExitCode { - match self {} - } -} - #[stable(feature = "termination_trait_lib", since = "1.61.0")] impl Termination for ExitCode { #[inline] From 174bbea562c0ac962d67cdb089818e202cb3b84e Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 15 Aug 2025 04:04:54 +0200 Subject: [PATCH 08/14] fixup tests to account for `Infallible = !` --- .../clippy/tests/ui/drop_non_drop.stderr | 2 +- .../item-collection/opaque-return-impls.rs | 2 +- tests/rustdoc-json/blanket_impls.rs | 3 +- tests/ui/consts/std/conjure_zst.stderr | 4 +-- .../generic-const-items/unsatisfied-bounds.rs | 4 +-- .../unsatisfied-bounds.stderr | 16 +++------ .../question-mark-result-err-mismatch.rs | 6 ++-- .../question-mark-result-err-mismatch.stderr | 6 ++-- .../try-block-bad-type-heterogeneous.stderr | 4 +-- tests/ui/try-trait/bad-interconversion.stderr | 24 +++++++------- tests/ui/try-trait/option-to-result.stderr | 2 +- tests/ui/uninhabited/void-branch.stderr | 33 ++++++++----------- 12 files changed, 46 insertions(+), 60 deletions(-) diff --git a/src/tools/clippy/tests/ui/drop_non_drop.stderr b/src/tools/clippy/tests/ui/drop_non_drop.stderr index 567a820990c60..252ba3915ed84 100644 --- a/src/tools/clippy/tests/ui/drop_non_drop.stderr +++ b/src/tools/clippy/tests/ui/drop_non_drop.stderr @@ -30,7 +30,7 @@ error: call to `std::mem::drop` with a value that does not implement `Drop`. Dro LL | drop(make_result_uninhabited_err(Foo)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: argument has type `std::result::Result` +note: argument has type `std::result::Result` --> tests/ui/drop_non_drop.rs:51:10 | LL | drop(make_result_uninhabited_err(Foo)); diff --git a/tests/codegen-units/item-collection/opaque-return-impls.rs b/tests/codegen-units/item-collection/opaque-return-impls.rs index 484fbe7fe62f1..d2781b356e976 100644 --- a/tests/codegen-units/item-collection/opaque-return-impls.rs +++ b/tests/codegen-units/item-collection/opaque-return-impls.rs @@ -79,7 +79,7 @@ pub fn foo3() -> Box> { //~ MONO_ITEM fn ::nth //~ MONO_ITEM fn ::size_hint //~ MONO_ITEM fn ::try_fold::, {closure@::spec_advance_by::{closure#0}}, std::option::Option>> -//~ MONO_ITEM fn > as std::ops::FromResidual>>::from_residual +//~ MONO_ITEM fn > as std::ops::FromResidual>>::from_residual //~ MONO_ITEM fn > as std::ops::Try>::branch //~ MONO_ITEM fn > as std::ops::Try>::from_output //~ MONO_ITEM fn foo3 diff --git a/tests/rustdoc-json/blanket_impls.rs b/tests/rustdoc-json/blanket_impls.rs index d500bf5af6bd7..780d92d41314f 100644 --- a/tests/rustdoc-json/blanket_impls.rs +++ b/tests/rustdoc-json/blanket_impls.rs @@ -3,6 +3,5 @@ #![no_std] //@ has "$.index[?(@.name=='Error')].inner.assoc_type" -//@ has "$.index[?(@.name=='Error')].inner.assoc_type.type.resolved_path" -//@ has "$.index[?(@.name=='Error')].inner.assoc_type.type.resolved_path.path" \"Infallible\" +//@ has "$.index[?(@.name=='Error')].inner.assoc_type.type.primitive" \"never\" pub struct ForBlanketTryFromImpl; diff --git a/tests/ui/consts/std/conjure_zst.stderr b/tests/ui/consts/std/conjure_zst.stderr index 0c4a978b81ee6..d4c9df07a393a 100644 --- a/tests/ui/consts/std/conjure_zst.stderr +++ b/tests/ui/consts/std/conjure_zst.stderr @@ -1,10 +1,10 @@ -error[E0080]: evaluation panicked: aborted execution: attempted to instantiate uninhabited type `Infallible` +error[E0080]: evaluation panicked: aborted execution: attempted to instantiate uninhabited type `!` --> $DIR/conjure_zst.rs:5:38 | LL | const INVALID: Infallible = unsafe { mem::conjure_zst() }; | ^^^^^^^^^^^^^^^^^^ evaluation of `INVALID` failed inside this call | -note: inside `conjure_zst::` +note: inside `conjure_zst::` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL error: aborting due to 1 previous error diff --git a/tests/ui/generic-const-items/unsatisfied-bounds.rs b/tests/ui/generic-const-items/unsatisfied-bounds.rs index 058799001725b..d203297c78e9e 100644 --- a/tests/ui/generic-const-items/unsatisfied-bounds.rs +++ b/tests/ui/generic-const-items/unsatisfied-bounds.rs @@ -28,7 +28,7 @@ impl

Trait

for () { fn main() { let () = C::; //~ ERROR the trait bound `String: Copy` is not satisfied - let () = K::<()>; //~ ERROR the trait bound `Infallible: From<()>` is not satisfied + let () = K::<()>; //~ ERROR the trait bound `!: From<()>` is not satisfied let _ = <() as Trait>>::A; //~ ERROR the trait bound `Vec: Copy` is not satisfied - let _ = <() as Trait<&'static str>>::B::<()>; //~ ERROR the trait bound `Infallible: From<()>` is not satisfied + let _ = <() as Trait<&'static str>>::B::<()>; //~ ERROR the trait bound `!: From<()>` is not satisfied } diff --git a/tests/ui/generic-const-items/unsatisfied-bounds.stderr b/tests/ui/generic-const-items/unsatisfied-bounds.stderr index dc243e342dd9a..06cd935fae4c0 100644 --- a/tests/ui/generic-const-items/unsatisfied-bounds.stderr +++ b/tests/ui/generic-const-items/unsatisfied-bounds.stderr @@ -10,16 +10,12 @@ note: required by a bound in `C` LL | const C: () = (); | ^^^^ required by this bound in `C` -error[E0277]: the trait bound `Infallible: From<()>` is not satisfied +error[E0277]: the trait bound `!: From<()>` is not satisfied --> $DIR/unsatisfied-bounds.rs:31:18 | LL | let () = K::<()>; - | ^^ the trait `From<()>` is not implemented for `Infallible` + | ^^ the trait `From<()>` is not implemented for `!` | -help: the trait `From<()>` is not implemented for `Infallible` - but trait `From` is implemented for it - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - = help: for that trait implementation, expected `!`, found `()` note: required by a bound in `K` --> $DIR/unsatisfied-bounds.rs:12:17 | @@ -44,16 +40,12 @@ LL | where LL | P: Copy; | ^^^^ required by this bound in `Trait::A` -error[E0277]: the trait bound `Infallible: From<()>` is not satisfied +error[E0277]: the trait bound `!: From<()>` is not satisfied --> $DIR/unsatisfied-bounds.rs:33:46 | LL | let _ = <() as Trait<&'static str>>::B::<()>; - | ^^ the trait `From<()>` is not implemented for `Infallible` + | ^^ the trait `From<()>` is not implemented for `!` | -help: the trait `From<()>` is not implemented for `Infallible` - but trait `From` is implemented for it - --> $SRC_DIR/core/src/convert/mod.rs:LL:COL - = help: for that trait implementation, expected `!`, found `()` note: required by a bound in `Trait::B` --> $DIR/unsatisfied-bounds.rs:21:21 | diff --git a/tests/ui/traits/question-mark-result-err-mismatch.rs b/tests/ui/traits/question-mark-result-err-mismatch.rs index f9ca6e0ab4483..bf6e219b86f71 100644 --- a/tests/ui/traits/question-mark-result-err-mismatch.rs +++ b/tests/ui/traits/question-mark-result-err-mismatch.rs @@ -18,7 +18,7 @@ fn foo() -> Result { //~ NOTE expected `String` because of this //~| NOTE in this expansion of desugaring of operator `?` //~| NOTE the trait `From<()>` is not implemented for `String` //~| NOTE the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait - //~| NOTE required for `Result` to implement `FromResidual>` + //~| NOTE required for `Result` to implement `FromResidual>` Ok(one.to_string()) } @@ -34,7 +34,7 @@ fn bar() -> Result<(), String> { //~ NOTE expected `String` because of this //~| NOTE this can't be annotated with `?` because it has type `Result<_, ()>` //~| NOTE the trait `From<()>` is not implemented for `String` //~| NOTE the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait - //~| NOTE required for `Result<(), String>` to implement `FromResidual>` + //~| NOTE required for `Result<(), String>` to implement `FromResidual>` //~| HELP `String` implements trait `From`: Ok(one) } @@ -53,7 +53,7 @@ fn baz() -> Result { //~ NOTE expected `String` because of this //~| NOTE in this expansion of desugaring of operator `?` //~| NOTE the trait `From<()>` is not implemented for `String` //~| NOTE the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait - //~| NOTE required for `Result` to implement `FromResidual>` + //~| NOTE required for `Result` to implement `FromResidual>` Ok(one.to_string()) } diff --git a/tests/ui/traits/question-mark-result-err-mismatch.stderr b/tests/ui/traits/question-mark-result-err-mismatch.stderr index 3739b508a8689..38639a9fb6229 100644 --- a/tests/ui/traits/question-mark-result-err-mismatch.stderr +++ b/tests/ui/traits/question-mark-result-err-mismatch.stderr @@ -14,7 +14,7 @@ LL | .map(|()| "")?; | ^ the trait `From<()>` is not implemented for `String` | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait - = note: required for `Result` to implement `FromResidual>` + = note: required for `Result` to implement `FromResidual>` error[E0277]: `?` couldn't convert the error to `String` --> $DIR/question-mark-result-err-mismatch.rs:29:25 @@ -37,7 +37,7 @@ LL | .map_err(|_| ())?; From> From> From - = note: required for `Result<(), String>` to implement `FromResidual>` + = note: required for `Result<(), String>` to implement `FromResidual>` error[E0277]: `?` couldn't convert the error to `String` --> $DIR/question-mark-result-err-mismatch.rs:49:11 @@ -55,7 +55,7 @@ LL | | })?; | this can't be annotated with `?` because it has type `Result<_, ()>` | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait - = note: required for `Result` to implement `FromResidual>` + = note: required for `Result` to implement `FromResidual>` error: aborting due to 3 previous errors diff --git a/tests/ui/try-block/try-block-bad-type-heterogeneous.stderr b/tests/ui/try-block/try-block-bad-type-heterogeneous.stderr index 4962534cf2945..403a8fee0aecc 100644 --- a/tests/ui/try-block/try-block-bad-type-heterogeneous.stderr +++ b/tests/ui/try-block/try-block-bad-type-heterogeneous.stderr @@ -8,9 +8,9 @@ LL | Err("")?; | = note: the question mark operation (`?`) implicitly performs a conversion on the error value using the `From` trait help: the trait `From<&str>` is not implemented for `TryFromSliceError` - but trait `From` is implemented for it + but trait `From` is implemented for it --> $SRC_DIR/core/src/array/mod.rs:LL:COL - = help: for that trait implementation, expected `Infallible`, found `&str` + = help: for that trait implementation, expected `!`, found `&str` error[E0271]: type mismatch resolving ` as Try>::Output == &str` --> $DIR/try-block-bad-type-heterogeneous.rs:12:9 diff --git a/tests/ui/try-trait/bad-interconversion.stderr b/tests/ui/try-trait/bad-interconversion.stderr index e1cc7a45e5de9..51a9a8d759338 100644 --- a/tests/ui/try-trait/bad-interconversion.stderr +++ b/tests/ui/try-trait/bad-interconversion.stderr @@ -38,7 +38,7 @@ error[E0277]: the `?` operator can only be used on `Result`s in a function that LL | fn control_flow_to_result() -> Result { | -------------------------------------------------- this function returns a `Result` LL | Ok(ControlFlow::Break(123)?) - | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Result` + | ^ this `?` produces `ControlFlow<{integer}, !>`, which is incompatible with `Result` error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in a function that returns `Option` --> $DIR/bad-interconversion.rs:20:22 @@ -46,7 +46,7 @@ error[E0277]: the `?` operator can only be used on `Option`s, not `Result`s, in LL | fn result_to_option() -> Option { | ------------------------------------ this function returns an `Option` LL | Some(Err("hello")?) - | ^ use `.ok()?` if you want to discard the `Result` error information + | ^ use `.ok()?` if you want to discard the `Result` error information error[E0277]: the `?` operator can only be used on `Option`s in a function that returns `Option` --> $DIR/bad-interconversion.rs:25:33 @@ -54,7 +54,7 @@ error[E0277]: the `?` operator can only be used on `Option`s in a function that LL | fn control_flow_to_option() -> Option { | ------------------------------------------ this function returns an `Option` LL | Some(ControlFlow::Break(123)?) - | ^ this `?` produces `ControlFlow<{integer}, Infallible>`, which is incompatible with `Option` + | ^ this `?` produces `ControlFlow<{integer}, !>`, which is incompatible with `Option` error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow` --> $DIR/bad-interconversion.rs:30:39 @@ -62,12 +62,12 @@ error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function LL | fn result_to_control_flow() -> ControlFlow { | -------------------------------------------------- this function returns a `ControlFlow` LL | ControlFlow::Continue(Err("hello")?) - | ^ this `?` produces `Result`, which is incompatible with `ControlFlow` + | ^ this `?` produces `Result`, which is incompatible with `ControlFlow` | -help: the trait `FromResidual>` is not implemented for `ControlFlow` - but trait `FromResidual>` is implemented for it +help: the trait `FromResidual>` is not implemented for `ControlFlow` + but trait `FromResidual>` is implemented for it --> $SRC_DIR/core/src/ops/control_flow.rs:LL:COL - = help: for that trait implementation, expected `ControlFlow`, found `Result` + = help: for that trait implementation, expected `ControlFlow`, found `Result` error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function that returns `ControlFlow` --> $DIR/bad-interconversion.rs:35:12 @@ -75,12 +75,12 @@ error[E0277]: the `?` operator can only be used on `ControlFlow`s in a function LL | fn option_to_control_flow() -> ControlFlow { | ----------------------------------------------- this function returns a `ControlFlow` LL | Some(3)?; - | ^ this `?` produces `Option`, which is incompatible with `ControlFlow` + | ^ this `?` produces `Option`, which is incompatible with `ControlFlow` | -help: the trait `FromResidual>` is not implemented for `ControlFlow` - but trait `FromResidual>` is implemented for it +help: the trait `FromResidual>` is not implemented for `ControlFlow` + but trait `FromResidual>` is implemented for it --> $SRC_DIR/core/src/ops/control_flow.rs:LL:COL - = help: for that trait implementation, expected `ControlFlow`, found `Option` + = help: for that trait implementation, expected `ControlFlow`, found `Option` error[E0277]: the `?` operator in a function that returns `ControlFlow` can only be used on other `ControlFlow`s (with the same Break type) --> $DIR/bad-interconversion.rs:41:29 @@ -88,7 +88,7 @@ error[E0277]: the `?` operator in a function that returns `ControlFlow` ca LL | fn control_flow_to_control_flow() -> ControlFlow { | ----------------------------------------------------- this function returns a `ControlFlow` LL | ControlFlow::Break(4_u8)?; - | ^ this `?` produces `ControlFlow`, which is incompatible with `ControlFlow` + | ^ this `?` produces `ControlFlow`, which is incompatible with `ControlFlow` | = note: unlike `Result`, there's no `From`-conversion performed for `ControlFlow` help: the trait `FromResidual>` is not implemented for `ControlFlow` diff --git a/tests/ui/try-trait/option-to-result.stderr b/tests/ui/try-trait/option-to-result.stderr index 8a4c4707942ce..6ae9d840e0696 100644 --- a/tests/ui/try-trait/option-to-result.stderr +++ b/tests/ui/try-trait/option-to-result.stderr @@ -14,7 +14,7 @@ LL | fn test_option() -> Option{ | ------------------------------- this function returns an `Option` LL | let a:Result = Ok(5); LL | a?; - | ^ use `.ok()?` if you want to discard the `Result` error information + | ^ use `.ok()?` if you want to discard the `Result` error information error: aborting due to 2 previous errors diff --git a/tests/ui/uninhabited/void-branch.stderr b/tests/ui/uninhabited/void-branch.stderr index 15693fc85f4b6..d9931ac66f2e8 100644 --- a/tests/ui/uninhabited/void-branch.stderr +++ b/tests/ui/uninhabited/void-branch.stderr @@ -1,16 +1,11 @@ error: unreachable expression - --> $DIR/void-branch.rs:10:13 - | -LL | std::mem::uninitialized::(); - | --------------------------------- any code following this expression is unreachable -LL | println!(); - | ^^^^^^^^^^ unreachable expression + --> $DIR/void-branch.rs:25:9 | -note: this expression has type `Void`, which is uninhabited - --> $DIR/void-branch.rs:9:13 +LL | infallible(); + | ------------ any code following this expression is unreachable +LL | println!() + | ^^^^^^^^^^ unreachable expression | -LL | std::mem::uninitialized::(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ note: the lint level is defined here --> $DIR/void-branch.rs:1:9 | @@ -18,18 +13,18 @@ LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ error: unreachable expression - --> $DIR/void-branch.rs:25:9 + --> $DIR/void-branch.rs:10:13 | -LL | infallible(); - | ------------ any code following this expression is unreachable -LL | println!() - | ^^^^^^^^^^ unreachable expression +LL | std::mem::uninitialized::(); + | --------------------------------- any code following this expression is unreachable +LL | println!(); + | ^^^^^^^^^^ unreachable expression | -note: this expression has type `Infallible`, which is uninhabited - --> $DIR/void-branch.rs:24:9 +note: this expression has type `Void`, which is uninhabited + --> $DIR/void-branch.rs:9:13 | -LL | infallible(); - | ^^^^^^^^^^^^ +LL | std::mem::uninitialized::(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to 2 previous errors From a1d794b63f2f940438d201b8bd7511ec84cc8fd8 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Wed, 22 Apr 2026 20:05:17 +0200 Subject: [PATCH 09/14] bless tests --- tests/ui/asm/x86_64/type-check-5.stderr | 6 +- .../ui/borrowck/suggest-assign-rvalue.stderr | 20 +- .../match/pattern-matching-should-fail.stderr | 16 +- .../migrations/mir_calls_to_shims.stderr | 2 +- ...habited-variant.exhaustive_patterns.stderr | 2 +- .../only-inhabited-variant.normal.stderr | 2 +- .../coerce-issue-49593-box-never.e2021.stderr | 4 +- tests/ui/coercion/coerce-to-bang-cast.stderr | 4 +- .../min_const_generics/complex-types.stderr | 14 +- tests/ui/consts/assert-type-intrinsics.stderr | 6 +- .../index-out-of-bounds-never-type.stderr | 6 +- .../const-eval/panic-assoc-never-type.stderr | 6 +- .../consts/const-eval/panic-never-type.stderr | 2 +- tests/ui/consts/const-eval/ub-enum.stderr | 30 +-- .../ui/consts/const-eval/ub-uninhabit.stderr | 8 +- .../detect-extra-ub.with_flag.stderr | 18 +- tests/ui/consts/validate_never_arrays.stderr | 6 +- .../feature-gate-exhaustive-patterns.stderr | 2 +- .../break-while-condition.stderr | 22 ++- tests/ui/impl-trait/issues/issue-58504.rs | 13 +- tests/ui/impl-trait/issues/issue-58504.stderr | 6 +- .../ui/layout/enum-scalar-pair-int-ptr.stderr | 4 +- tests/ui/layout/enum.stderr | 6 +- tests/ui/layout/struct.stderr | 4 +- .../unused-language-features.stderr | 10 +- tests/ui/lint/unused/must-use-ops.stderr | 42 ++--- .../must_use-result-unit-uninhabited.stderr | 12 +- tests/ui/lint/unused/must_use-unit.stderr | 6 +- .../loop-break-never-type-mismatch.stderr | 4 +- tests/ui/loops/loop-break-value.stderr | 58 +++--- .../basic/call-fn-never-arg-wrong-type.stderr | 4 +- .../basic/never-assign-wrong-type.stderr | 2 +- .../never_type/diverging-place-match.stderr | 22 +-- tests/ui/never_type/empty-never-array.stderr | 4 +- .../ui/never_type/exhaustive_patterns.stderr | 4 +- .../question_mark_from_never.rs | 2 +- ...try-block-never-type-fallback.e2021.stderr | 4 +- ...never-from-impl-is-reserved.current.stderr | 2 +- .../never-from-impl-is-reserved.next.stderr | 2 +- .../regress/never-in-range-pat.stderr | 2 +- .../regress/span-bug-issue-121445.stderr | 4 +- ...hesized-type-arguments-ice-issue-122345.rs | 1 - ...zed-type-arguments-ice-issue-122345.stderr | 15 +- ...bited-union-ref.exhaustive_patterns.stderr | 6 +- .../always-inhabited-union-ref.normal.stderr | 6 +- ...tch-check-notes.exhaustive_patterns.stderr | 14 +- .../empty-match-check-notes.normal.stderr | 14 +- .../empty-match.exhaustive_patterns.stderr | 80 ++++---- .../usefulness/empty-match.normal.stderr | 80 ++++---- .../empty-types.exhaustive_patterns.stderr | 100 +++++----- .../usefulness/empty-types.never_pats.stderr | 86 ++++----- .../usefulness/empty-types.normal.stderr | 86 ++++----- .../explain-unreachable-pats.stderr | 28 +-- tests/ui/pattern/usefulness/impl-trait.stderr | 32 ++-- ...privately-empty.exhaustive_patterns.stderr | 2 +- .../match-privately-empty.normal.stderr | 2 +- .../slice_of_empty.exhaustive_patterns.stderr | 2 +- .../usefulness/slice_of_empty.normal.stderr | 4 +- .../never-place-isnt-diverging.stderr | 4 +- tests/ui/reachable/expr_add.stderr | 4 +- tests/ui/reachable/expr_assign.stderr | 8 +- tests/ui/reachable/expr_call.stderr | 6 +- tests/ui/reachable/expr_method.stderr | 6 +- tests/ui/reachable/expr_unary.stderr | 6 +- .../reachable/never-assign-dead-code.stderr | 8 +- .../reachable/unwarned-match-on-never.stderr | 6 +- ...133063-never-arm-no-otherwise-block.stderr | 2 +- .../ICE-133117-duplicate-never-arm.stderr | 4 +- .../never-pattern-is-a-read.stderr | 2 +- .../uninhabited/coercions.stderr | 8 +- .../uninhabited/coercions_same_crate.stderr | 8 +- .../uninhabited/indirect_match.stderr | 16 +- ...rect_match_with_exhaustive_patterns.stderr | 16 +- .../issue-65157-repeated-match-arm.stderr | 2 +- .../uninhabited/match.stderr | 8 +- .../match_with_exhaustive_patterns.stderr | 4 +- .../uninhabited/patterns_same_crate.stderr | 10 +- tests/ui/sized-hierarchy/impls.rs | 2 +- .../stability-attribute-trait-impl.stderr | 2 +- tests/ui/statics/uninhabited-static.stderr | 20 +- tests/ui/symbol-names/types.legacy.stderr | 174 +++++++++--------- tests/ui/symbol-names/types.v0.stderr | 174 +++++++++--------- .../symbol-names/types.verbose-legacy.stderr | 174 +++++++++--------- tests/ui/transmutability/char.stderr | 12 +- ...ted-irrefutable.exhaustive_patterns.stderr | 4 +- .../uninhabited-irrefutable.normal.stderr | 4 +- .../uninhabited/uninhabited-patterns.stderr | 8 +- .../uninhabited-unstable-field.stderr | 8 +- tests/ui/unpretty/exhaustive.hir.stderr | 40 ++-- tests/ui/unpretty/exhaustive.hir.stdout | 6 +- 90 files changed, 852 insertions(+), 855 deletions(-) diff --git a/tests/ui/asm/x86_64/type-check-5.stderr b/tests/ui/asm/x86_64/type-check-5.stderr index 377e1d19f6c5c..0c471ee28d261 100644 --- a/tests/ui/asm/x86_64/type-check-5.stderr +++ b/tests/ui/asm/x86_64/type-check-5.stderr @@ -1,5 +1,5 @@ error[E0381]: used binding `x` isn't initialized - --> $DIR/type-check-5.rs:12:28 + --> $DIR/type-check-5.rs:10:28 | LL | let x: u64; | - binding declared here but left uninitialized @@ -12,7 +12,7 @@ LL | let x: u64 = 42; | ++++ error[E0381]: used binding `y` isn't initialized - --> $DIR/type-check-5.rs:15:9 + --> $DIR/type-check-5.rs:13:9 | LL | let mut y: u64; | ----- binding declared here but left uninitialized @@ -25,7 +25,7 @@ LL | let mut y: u64 = 42; | ++++ error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable - --> $DIR/type-check-5.rs:21:13 + --> $DIR/type-check-5.rs:19:13 | LL | let v: Vec = vec![0, 1, 2]; | ^ not mutable diff --git a/tests/ui/borrowck/suggest-assign-rvalue.stderr b/tests/ui/borrowck/suggest-assign-rvalue.stderr index 6ae893915aa99..db9e1457a9f51 100644 --- a/tests/ui/borrowck/suggest-assign-rvalue.stderr +++ b/tests/ui/borrowck/suggest-assign-rvalue.stderr @@ -1,5 +1,5 @@ error[E0381]: used binding `chaenomeles` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:14:11 + --> $DIR/suggest-assign-rvalue.rs:13:11 | LL | let chaenomeles; | ----------- binding declared here but left uninitialized @@ -12,7 +12,7 @@ LL | let chaenomeles = 42; | ++++ error[E0381]: used binding `my_float` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:23:30 + --> $DIR/suggest-assign-rvalue.rs:22:30 | LL | let my_float: f32; | -------- binding declared here but left uninitialized @@ -25,7 +25,7 @@ LL | let my_float: f32 = 3.14159; | +++++++++ error[E0381]: used binding `demo` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:26:28 + --> $DIR/suggest-assign-rvalue.rs:25:28 | LL | let demo: Demo; | ---- binding declared here but left uninitialized @@ -38,7 +38,7 @@ LL | let demo: Demo = Default::default(); | ++++++++++++++++++++ error[E0381]: used binding `demo_no` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:30:31 + --> $DIR/suggest-assign-rvalue.rs:29:31 | LL | let demo_no: DemoNoDef; | ------- binding declared here but left uninitialized @@ -51,7 +51,7 @@ LL | let demo_no: DemoNoDef = /* value */; | +++++++++++++ error[E0381]: used binding `arr` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:34:27 + --> $DIR/suggest-assign-rvalue.rs:33:27 | LL | let arr: [i32; 5]; | --- binding declared here but left uninitialized @@ -64,7 +64,7 @@ LL | let arr: [i32; 5] = [42; 5]; | +++++++++ error[E0381]: used binding `foo` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:37:27 + --> $DIR/suggest-assign-rvalue.rs:36:27 | LL | let foo: Vec<&str>; | --- binding declared here but left uninitialized @@ -77,7 +77,7 @@ LL | let foo: Vec<&str> = vec![]; | ++++++++ error[E0381]: used binding `my_string` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:41:31 + --> $DIR/suggest-assign-rvalue.rs:40:31 | LL | let my_string: String; | --------- binding declared here but left uninitialized @@ -90,7 +90,7 @@ LL | let my_string: String = Default::default(); | ++++++++++++++++++++ error[E0381]: used binding `my_int` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:45:28 + --> $DIR/suggest-assign-rvalue.rs:44:28 | LL | let my_int: &i32; | ------ binding declared here but left uninitialized @@ -103,7 +103,7 @@ LL | let my_int: &i32 = &42; | +++++ error[E0381]: used binding `hello` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:49:27 + --> $DIR/suggest-assign-rvalue.rs:48:27 | LL | let hello: &str; | ----- binding declared here but left uninitialized @@ -116,7 +116,7 @@ LL | let hello: &str = ""; | ++++ error[E0381]: used binding `never` isn't initialized - --> $DIR/suggest-assign-rvalue.rs:53:27 + --> $DIR/suggest-assign-rvalue.rs:52:27 | LL | let never: !; | ----- binding declared here but left uninitialized diff --git a/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr b/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr index e0d900a1eb564..cc46ea72e9901 100644 --- a/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr +++ b/tests/ui/closures/2229_closure_analysis/match/pattern-matching-should-fail.stderr @@ -1,5 +1,5 @@ error[E0381]: used binding `x` isn't initialized - --> $DIR/pattern-matching-should-fail.rs:8:23 + --> $DIR/pattern-matching-should-fail.rs:6:23 | LL | let x: !; | - binding declared here but left uninitialized @@ -7,7 +7,7 @@ LL | let c1 = || match x { }; | ^ `x` used here but it isn't initialized error[E0381]: used binding `x` isn't initialized - --> $DIR/pattern-matching-should-fail.rs:15:23 + --> $DIR/pattern-matching-should-fail.rs:13:23 | LL | let x: !; | - binding declared here but left uninitialized @@ -15,7 +15,7 @@ LL | let c2 = || match x { _ => () }; | ^ `x` used here but it isn't initialized error[E0381]: used binding `variant` isn't initialized - --> $DIR/pattern-matching-should-fail.rs:27:13 + --> $DIR/pattern-matching-should-fail.rs:25:13 | LL | let variant: !; | ------- binding declared here but left uninitialized @@ -26,7 +26,7 @@ LL | match variant { | ------- borrow occurs due to use in closure error[E0381]: used binding `variant` isn't initialized - --> $DIR/pattern-matching-should-fail.rs:39:13 + --> $DIR/pattern-matching-should-fail.rs:37:13 | LL | let variant: !; | ------- binding declared here but left uninitialized @@ -36,7 +36,7 @@ LL | match variant { | ------- borrow occurs due to use in closure error[E0381]: used binding `g` isn't initialized - --> $DIR/pattern-matching-should-fail.rs:54:15 + --> $DIR/pattern-matching-should-fail.rs:52:15 | LL | let g: !; | - binding declared here but left uninitialized @@ -45,7 +45,7 @@ LL | match g { }; | ^ `g` used here but it isn't initialized error[E0381]: used binding `t` isn't initialized - --> $DIR/pattern-matching-should-fail.rs:56:19 + --> $DIR/pattern-matching-should-fail.rs:54:19 | LL | let t: !; | - binding declared here but left uninitialized @@ -54,7 +54,7 @@ LL | match t { }; | ^ `t` used here but it isn't initialized error[E0004]: non-exhaustive patterns: type `u8` is non-empty - --> $DIR/pattern-matching-should-fail.rs:67:23 + --> $DIR/pattern-matching-should-fail.rs:65:23 | LL | let c1 = || match x { }; | ^ @@ -68,7 +68,7 @@ LL ~ }; | error[E0381]: used binding `x` isn't initialized - --> $DIR/pattern-matching-should-fail.rs:67:23 + --> $DIR/pattern-matching-should-fail.rs:65:23 | LL | let x: u8; | - binding declared here but left uninitialized diff --git a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr index f94451bd1fa0f..0db0759b88f67 100644 --- a/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr +++ b/tests/ui/closures/2229_closure_analysis/migrations/mir_calls_to_shims.stderr @@ -1,5 +1,5 @@ error: changes to closure capture in Rust 2021 will affect which traits the closure implements - --> $DIR/mir_calls_to_shims.rs:21:38 + --> $DIR/mir_calls_to_shims.rs:20:38 | LL | let result = panic::catch_unwind(move || { | ^^^^^^^ diff --git a/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.exhaustive_patterns.stderr b/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.exhaustive_patterns.stderr index 58a5348aa391a..e019f7939cd78 100644 --- a/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.exhaustive_patterns.stderr +++ b/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.exhaustive_patterns.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `r` as mutable more than once at a time - --> $DIR/only-inhabited-variant.rs:16:17 + --> $DIR/only-inhabited-variant.rs:15:17 | LL | let mut f = || { | -- first mutable borrow occurs here diff --git a/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.normal.stderr b/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.normal.stderr index 58a5348aa391a..e019f7939cd78 100644 --- a/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.normal.stderr +++ b/tests/ui/closures/2229_closure_analysis/only-inhabited-variant.normal.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `r` as mutable more than once at a time - --> $DIR/only-inhabited-variant.rs:16:17 + --> $DIR/only-inhabited-variant.rs:15:17 | LL | let mut f = || { | -- first mutable borrow occurs here diff --git a/tests/ui/coercion/coerce-issue-49593-box-never.e2021.stderr b/tests/ui/coercion/coerce-issue-49593-box-never.e2021.stderr index 214c37febc06b..f68e929d6a678 100644 --- a/tests/ui/coercion/coerce-issue-49593-box-never.e2021.stderr +++ b/tests/ui/coercion/coerce-issue-49593-box-never.e2021.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `(): std::error::Error` is not satisfied - --> $DIR/coerce-issue-49593-box-never.rs:28:5 + --> $DIR/coerce-issue-49593-box-never.rs:26:5 | LL | Box::new(x) | ^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()` @@ -7,7 +7,7 @@ LL | Box::new(x) = note: required for the cast from `Box<()>` to `Box<(dyn std::error::Error + 'static)>` error[E0277]: the trait bound `(): std::error::Error` is not satisfied - --> $DIR/coerce-issue-49593-box-never.rs:33:5 + --> $DIR/coerce-issue-49593-box-never.rs:31:5 | LL | raw_ptr(x) | ^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()` diff --git a/tests/ui/coercion/coerce-to-bang-cast.stderr b/tests/ui/coercion/coerce-to-bang-cast.stderr index 50e009aa25bb1..92d798ac12c15 100644 --- a/tests/ui/coercion/coerce-to-bang-cast.stderr +++ b/tests/ui/coercion/coerce-to-bang-cast.stderr @@ -1,11 +1,11 @@ error[E0605]: non-primitive cast: `i32` as `!` - --> $DIR/coerce-to-bang-cast.rs:4:13 + --> $DIR/coerce-to-bang-cast.rs:2:13 | LL | let y = {return; 22} as !; | ^^^^^^^^^^^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object error[E0605]: non-primitive cast: `i32` as `!` - --> $DIR/coerce-to-bang-cast.rs:9:13 + --> $DIR/coerce-to-bang-cast.rs:7:13 | LL | let y = 22 as !; | ^^^^^^^ an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object diff --git a/tests/ui/const-generics/min_const_generics/complex-types.stderr b/tests/ui/const-generics/min_const_generics/complex-types.stderr index 3233da6382381..a9d8b31f8457f 100644 --- a/tests/ui/const-generics/min_const_generics/complex-types.stderr +++ b/tests/ui/const-generics/min_const_generics/complex-types.stderr @@ -1,5 +1,5 @@ error: `[u8; 0]` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:3:21 + --> $DIR/complex-types.rs:1:21 | LL | struct Foo; | ^^^^^^^ @@ -11,7 +11,7 @@ LL + #![feature(min_adt_const_params)] | error: `()` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:6:21 + --> $DIR/complex-types.rs:4:21 | LL | struct Bar; | ^^ @@ -23,7 +23,7 @@ LL + #![feature(min_adt_const_params)] | error: `No` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:11:21 + --> $DIR/complex-types.rs:9:21 | LL | struct Fez; | ^^ @@ -35,7 +35,7 @@ LL + #![feature(min_adt_const_params)] | error: `&'static u8` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:14:21 + --> $DIR/complex-types.rs:12:21 | LL | struct Faz; | ^^^^^^^^^^^ @@ -51,7 +51,7 @@ LL + #![feature(unsized_const_params)] | error: `!` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:17:21 + --> $DIR/complex-types.rs:15:21 | LL | struct Fiz; | ^ @@ -59,7 +59,7 @@ LL | struct Fiz; = note: the only supported types are integers, `bool`, and `char` error: `()` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:20:19 + --> $DIR/complex-types.rs:18:19 | LL | enum Goo { A, B } | ^^ @@ -71,7 +71,7 @@ LL + #![feature(min_adt_const_params)] | error: `()` is forbidden as the type of a const generic parameter - --> $DIR/complex-types.rs:23:20 + --> $DIR/complex-types.rs:21:20 | LL | union Boo { a: () } | ^^ diff --git a/tests/ui/consts/assert-type-intrinsics.stderr b/tests/ui/consts/assert-type-intrinsics.stderr index 92fc90aebe42c..775b95ac30a40 100644 --- a/tests/ui/consts/assert-type-intrinsics.stderr +++ b/tests/ui/consts/assert-type-intrinsics.stderr @@ -1,17 +1,17 @@ error[E0080]: evaluation panicked: aborted execution: attempted to instantiate uninhabited type `!` - --> $DIR/assert-type-intrinsics.rs:11:9 + --> $DIR/assert-type-intrinsics.rs:10:9 | LL | MaybeUninit::::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `main::_BAD1` failed here error[E0080]: evaluation panicked: aborted execution: attempted to leave type `&i32` uninitialized, which is invalid - --> $DIR/assert-type-intrinsics.rs:15:9 + --> $DIR/assert-type-intrinsics.rs:14:9 | LL | intrinsics::assert_mem_uninitialized_valid::<&'static i32>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `main::_BAD2` failed here error[E0080]: evaluation panicked: aborted execution: attempted to zero-initialize type `&i32`, which is invalid - --> $DIR/assert-type-intrinsics.rs:19:9 + --> $DIR/assert-type-intrinsics.rs:18:9 | LL | intrinsics::assert_zero_valid::<&'static i32>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `main::_BAD3` failed here diff --git a/tests/ui/consts/const-eval/index-out-of-bounds-never-type.stderr b/tests/ui/consts/const-eval/index-out-of-bounds-never-type.stderr index 7e57e16aa4f03..495cc0eb8921b 100644 --- a/tests/ui/consts/const-eval/index-out-of-bounds-never-type.stderr +++ b/tests/ui/consts/const-eval/index-out-of-bounds-never-type.stderr @@ -1,17 +1,17 @@ error[E0080]: index out of bounds: the length is 0 but the index is 0 - --> $DIR/index-out-of-bounds-never-type.rs:10:61 + --> $DIR/index-out-of-bounds-never-type.rs:9:61 | LL | const VOID: ! = { let x = 0 * std::mem::size_of::(); [][x] }; | ^^^^^ evaluation of `PrintName::<()>::VOID` failed here note: erroneous constant encountered - --> $DIR/index-out-of-bounds-never-type.rs:16:13 + --> $DIR/index-out-of-bounds-never-type.rs:15:13 | LL | let _ = PrintName::::VOID; | ^^^^^^^^^^^^^^^^^^^^ note: the above error was encountered while instantiating `fn f::<()>` - --> $DIR/index-out-of-bounds-never-type.rs:20:5 + --> $DIR/index-out-of-bounds-never-type.rs:19:5 | LL | f::<()>(); | ^^^^^^^^^ diff --git a/tests/ui/consts/const-eval/panic-assoc-never-type.stderr b/tests/ui/consts/const-eval/panic-assoc-never-type.stderr index d3a293149287e..18cf327d9cd40 100644 --- a/tests/ui/consts/const-eval/panic-assoc-never-type.stderr +++ b/tests/ui/consts/const-eval/panic-assoc-never-type.stderr @@ -1,17 +1,17 @@ error[E0080]: evaluation panicked: explicit panic - --> $DIR/panic-assoc-never-type.rs:10:21 + --> $DIR/panic-assoc-never-type.rs:9:21 | LL | const VOID: ! = panic!(); | ^^^^^^^^ evaluation of `PrintName::VOID` failed here note: erroneous constant encountered - --> $DIR/panic-assoc-never-type.rs:15:13 + --> $DIR/panic-assoc-never-type.rs:14:13 | LL | let _ = PrintName::VOID; | ^^^^^^^^^^^^^^^ note: erroneous constant encountered - --> $DIR/panic-assoc-never-type.rs:15:13 + --> $DIR/panic-assoc-never-type.rs:14:13 | LL | let _ = PrintName::VOID; | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/consts/const-eval/panic-never-type.stderr b/tests/ui/consts/const-eval/panic-never-type.stderr index 317be64205ed7..4251737259518 100644 --- a/tests/ui/consts/const-eval/panic-never-type.stderr +++ b/tests/ui/consts/const-eval/panic-never-type.stderr @@ -1,5 +1,5 @@ error[E0080]: evaluation panicked: explicit panic - --> $DIR/panic-never-type.rs:4:17 + --> $DIR/panic-never-type.rs:3:17 | LL | const VOID: ! = panic!(); | ^^^^^^^^ evaluation of `VOID` failed here diff --git a/tests/ui/consts/const-eval/ub-enum.stderr b/tests/ui/consts/const-eval/ub-enum.stderr index bb2c58796b1c4..d9de9952f5006 100644 --- a/tests/ui/consts/const-eval/ub-enum.stderr +++ b/tests/ui/consts/const-eval/ub-enum.stderr @@ -1,5 +1,5 @@ error[E0080]: constructing invalid value of type Enum: at ., encountered 0x01, but expected a valid enum tag - --> $DIR/ub-enum.rs:30:1 + --> $DIR/ub-enum.rs:29:1 | LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) }; | ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value @@ -10,7 +10,7 @@ LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) }; } error[E0080]: unable to turn pointer into integer - --> $DIR/ub-enum.rs:33:1 + --> $DIR/ub-enum.rs:32:1 | LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) }; | ^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_ENUM_PTR` failed here @@ -19,7 +19,7 @@ LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) }; = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported error[E0080]: unable to turn pointer into integer - --> $DIR/ub-enum.rs:36:1 + --> $DIR/ub-enum.rs:35:1 | LL | const BAD_ENUM_WRAPPED: Wrap = unsafe { mem::transmute(&1) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_ENUM_WRAPPED` failed here @@ -28,7 +28,7 @@ LL | const BAD_ENUM_WRAPPED: Wrap = unsafe { mem::transmute(&1) }; = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported error[E0080]: constructing invalid value of type Enum2: at ., encountered 0x0, but expected a valid enum tag - --> $DIR/ub-enum.rs:48:1 + --> $DIR/ub-enum.rs:47:1 | LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) }; | ^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value @@ -39,7 +39,7 @@ LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) }; } error[E0080]: unable to turn pointer into integer - --> $DIR/ub-enum.rs:50:1 + --> $DIR/ub-enum.rs:49:1 | LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_ENUM2_PTR` failed here @@ -48,7 +48,7 @@ LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) }; = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported error[E0080]: unable to turn pointer into integer - --> $DIR/ub-enum.rs:53:1 + --> $DIR/ub-enum.rs:52:1 | LL | const BAD_ENUM2_WRAPPED: Wrap = unsafe { mem::transmute(&0) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_ENUM2_WRAPPED` failed here @@ -57,7 +57,7 @@ LL | const BAD_ENUM2_WRAPPED: Wrap = unsafe { mem::transmute(&0) }; = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported error[E0080]: reading memory at ALLOC0[0x%..0x%], but memory is uninitialized at [0x%..0x%], and this operation requires initialized memory - --> $DIR/ub-enum.rs:62:41 + --> $DIR/ub-enum.rs:61:41 | LL | const BAD_ENUM2_UNDEF: Enum2 = unsafe { MaybeUninit { uninit: () }.init }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_ENUM2_UNDEF` failed here @@ -67,7 +67,7 @@ LL | const BAD_ENUM2_UNDEF: Enum2 = unsafe { MaybeUninit { uninit: () }.init }; } error[E0080]: unable to turn pointer into integer - --> $DIR/ub-enum.rs:66:1 + --> $DIR/ub-enum.rs:65:1 | LL | const BAD_ENUM2_OPTION_PTR: Option = unsafe { mem::transmute(&0) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_ENUM2_OPTION_PTR` failed here @@ -76,7 +76,7 @@ LL | const BAD_ENUM2_OPTION_PTR: Option = unsafe { mem::transmute(&0) }; = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported error[E0080]: constructing invalid value of type UninhDiscriminant: at ., encountered an uninhabited enum variant - --> $DIR/ub-enum.rs:83:1 + --> $DIR/ub-enum.rs:82:1 | LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value @@ -87,7 +87,7 @@ LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute } error[E0080]: constructing invalid value of type UninhDiscriminant: at ., encountered 0x03, but expected a valid enum tag - --> $DIR/ub-enum.rs:85:1 + --> $DIR/ub-enum.rs:84:1 | LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value @@ -98,7 +98,7 @@ LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute } error[E0080]: constructing invalid value of type Option<(char, char)>: at ..0.1, encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`) - --> $DIR/ub-enum.rs:93:1 + --> $DIR/ub-enum.rs:92:1 | LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) })); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value @@ -109,19 +109,19 @@ LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::tran } error[E0080]: constructing invalid value of type Result<(i32, Never), (i32, !)>: at ., encountered an uninhabited enum variant - --> $DIR/ub-enum.rs:98:77 + --> $DIR/ub-enum.rs:97:77 | LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) }; | ^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_UNINHABITED_WITH_DATA1` failed here error[E0080]: constructing invalid value of type Result<(i32, !), (i32, Never)>: at ., encountered an uninhabited enum variant - --> $DIR/ub-enum.rs:100:77 + --> $DIR/ub-enum.rs:99:77 | LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) }; | ^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_UNINHABITED_WITH_DATA2` failed here error[E0080]: read discriminant of an uninhabited enum variant - --> $DIR/ub-enum.rs:106:9 + --> $DIR/ub-enum.rs:105:9 | LL | std::mem::discriminant(&*(&() as *const () as *const Never)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `TEST_ICE_89765` failed inside this call @@ -130,7 +130,7 @@ note: inside `discriminant::` --> $SRC_DIR/core/src/mem/mod.rs:LL:COL error[E0080]: constructing invalid value of type WideRangeDiscriminants: at ., encountered 0x0, but expected a valid enum tag - --> $DIR/ub-enum.rs:121:1 + --> $DIR/ub-enum.rs:120:1 | LL | const BAD_WIDE_RANGE_ENUM: WideRangeDiscriminants = unsafe { mem::transmute(0_i64) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value diff --git a/tests/ui/consts/const-eval/ub-uninhabit.stderr b/tests/ui/consts/const-eval/ub-uninhabit.stderr index 244cb96b69231..f1337b3cf1940 100644 --- a/tests/ui/consts/const-eval/ub-uninhabit.stderr +++ b/tests/ui/consts/const-eval/ub-uninhabit.stderr @@ -1,11 +1,11 @@ error[E0080]: constructing invalid value of type Bar: encountered a value of uninhabited type `Bar` - --> $DIR/ub-uninhabit.rs:20:35 + --> $DIR/ub-uninhabit.rs:19:35 | LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_BAD_BAD` failed here error[E0080]: constructing invalid value of type &Bar: encountered a reference pointing to uninhabited type Bar - --> $DIR/ub-uninhabit.rs:23:1 + --> $DIR/ub-uninhabit.rs:22:1 | LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) }; | ^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value @@ -16,13 +16,13 @@ LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) }; } error[E0080]: constructing invalid value of type [Bar; 1]: at [0], encountered a value of uninhabited type `Bar` - --> $DIR/ub-uninhabit.rs:26:42 + --> $DIR/ub-uninhabit.rs:25:42 | LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_BAD_ARRAY` failed here error[E0080]: constructing invalid value of type !: encountered a value of the never type `!` - --> $DIR/ub-uninhabit.rs:32:16 + --> $DIR/ub-uninhabit.rs:31:16 | LL | let _val = intrinsics::read_via_copy(ptr); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `READ_NEVER` failed here diff --git a/tests/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr b/tests/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr index a55a90dfb89a4..870f89733409b 100644 --- a/tests/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr +++ b/tests/ui/consts/extra-const-ub/detect-extra-ub.with_flag.stderr @@ -1,11 +1,11 @@ error[E0080]: constructing invalid value of type bool: encountered 0x03, but expected a boolean - --> $DIR/detect-extra-ub.rs:30:20 + --> $DIR/detect-extra-ub.rs:29:20 | LL | let _x: bool = transmute(3u8); | ^^^^^^^^^^^^^^ evaluation of `INVALID_BOOL` failed here error[E0080]: constructing invalid value of type usize: encountered a pointer, but expected an integer - --> $DIR/detect-extra-ub.rs:35:21 + --> $DIR/detect-extra-ub.rs:34:21 | LL | let _x: usize = transmute(&3u8); | ^^^^^^^^^^^^^^^ evaluation of `INVALID_PTR_IN_INT` failed here @@ -14,7 +14,7 @@ LL | let _x: usize = transmute(&3u8); = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported error[E0080]: constructing invalid value of type PtrSizedEnum: at ., encountered a pointer, but expected an integer - --> $DIR/detect-extra-ub.rs:40:28 + --> $DIR/detect-extra-ub.rs:39:28 | LL | let _x: PtrSizedEnum = transmute(&3u8); | ^^^^^^^^^^^^^^^ evaluation of `INVALID_PTR_IN_ENUM` failed here @@ -23,7 +23,7 @@ LL | let _x: PtrSizedEnum = transmute(&3u8); = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported error[E0080]: constructing invalid value of type (usize, usize): at .0, encountered a pointer, but expected an integer - --> $DIR/detect-extra-ub.rs:46:30 + --> $DIR/detect-extra-ub.rs:45:30 | LL | let _x: (usize, usize) = transmute(x); | ^^^^^^^^^^^^ evaluation of `INVALID_SLICE_TO_USIZE_TRANSMUTE` failed here @@ -32,13 +32,13 @@ LL | let _x: (usize, usize) = transmute(x); = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported error[E0080]: constructing invalid value of type &u32: encountered an unaligned reference (required 4 byte alignment but found 1) - --> $DIR/detect-extra-ub.rs:51:20 + --> $DIR/detect-extra-ub.rs:50:20 | LL | let _x: &u32 = transmute(&[0u8; 4]); | ^^^^^^^^^^^^^^^^^^^^ evaluation of `UNALIGNED_PTR` failed here error[E0080]: constructing invalid value of type fn(): encountered a maybe-null function pointer - --> $DIR/detect-extra-ub.rs:57:20 + --> $DIR/detect-extra-ub.rs:56:20 | LL | let _x: fn() = transmute({ | ____________________^ @@ -50,13 +50,13 @@ LL | | }); | |______^ evaluation of `MAYBE_NULL_FN_PTR` failed here error[E0080]: constructing invalid value of type UninhDiscriminant: at ., encountered an uninhabited enum variant - --> $DIR/detect-extra-ub.rs:68:13 + --> $DIR/detect-extra-ub.rs:67:13 | LL | let v = *addr_of!(data).cast::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `UNINHABITED_VARIANT` failed here error[E0080]: constructing invalid value of type [*const u8; 2]: at [0], encountered a partial pointer or a mix of pointers - --> $DIR/detect-extra-ub.rs:87:16 + --> $DIR/detect-extra-ub.rs:86:16 | LL | let _val = *(&mem as *const Align as *const [*const u8; 2]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `PARTIAL_POINTER` failed here @@ -65,7 +65,7 @@ LL | let _val = *(&mem as *const Align as *const [*const u8; 2]); = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported error[E0080]: constructing invalid value of type &[u8]: encountered invalid reference metadata: slice is bigger than largest supported object - --> $DIR/detect-extra-ub.rs:101:16 + --> $DIR/detect-extra-ub.rs:100:16 | LL | let _val = &*slice; | ^^^^^^^ evaluation of `OVERSIZED_REF` failed here diff --git a/tests/ui/consts/validate_never_arrays.stderr b/tests/ui/consts/validate_never_arrays.stderr index 517b632bdd7be..a147a52b60d5e 100644 --- a/tests/ui/consts/validate_never_arrays.stderr +++ b/tests/ui/consts/validate_never_arrays.stderr @@ -1,5 +1,5 @@ error[E0080]: constructing invalid value of type &[!; 1]: encountered a reference pointing to uninhabited type [!; 1] - --> $DIR/validate_never_arrays.rs:6:1 + --> $DIR/validate_never_arrays.rs:5:1 | LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; | ^^^^^^^^^^^^^^^^ it is undefined behavior to use this value @@ -10,7 +10,7 @@ LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; } error[E0080]: constructing invalid value of type &[!]: at .[0], encountered a value of the never type `!` - --> $DIR/validate_never_arrays.rs:9:1 + --> $DIR/validate_never_arrays.rs:8:1 | LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) }; | ^^^^^^^^^^^^^ it is undefined behavior to use this value @@ -21,7 +21,7 @@ LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) }; } error[E0080]: constructing invalid value of type &[!]: at .[0], encountered a value of the never type `!` - --> $DIR/validate_never_arrays.rs:10:1 + --> $DIR/validate_never_arrays.rs:9:1 | LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) }; | ^^^^^^^^^^^^^ it is undefined behavior to use this value diff --git a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index 614f382d67327..4a9dc6036289d 100644 --- a/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/tests/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -1,5 +1,5 @@ error[E0005]: refutable pattern in local binding - --> $DIR/feature-gate-exhaustive-patterns.rs:8:9 + --> $DIR/feature-gate-exhaustive-patterns.rs:6:9 | LL | let Ok(_x) = &foo(); | ^^^^^^ pattern `&Err(_)` not covered diff --git a/tests/ui/for-loop-while/break-while-condition.stderr b/tests/ui/for-loop-while/break-while-condition.stderr index 07a57424575fd..095c4032c3243 100644 --- a/tests/ui/for-loop-while/break-while-condition.stderr +++ b/tests/ui/for-loop-while/break-while-condition.stderr @@ -1,20 +1,23 @@ error[E0308]: mismatched types - --> $DIR/break-while-condition.rs:9:20 + --> $DIR/break-while-condition.rs:8:13 | -LL | let _: ! = { - | ____________________^ -LL | | 'a: while break 'a {}; -LL | | }; - | |_________^ expected `!`, found `()` +LL | 'a: while break 'a {} + | ^^^^^^^^^^^^^^^^^^^^^ expected `!`, found `()` | = note: expected type `!` found unit type `()` + = note: `while` loops evaluate to unit type `()` +help: consider adding a diverging expression here + | +LL | 'a: while break 'a {} /* `loop {}` or `panic!("...")` */ + | ++++++++++++++++++++++++++++++++++ error[E0308]: mismatched types - --> $DIR/break-while-condition.rs:16:13 + --> $DIR/break-while-condition.rs:15:13 | LL | / while false { -LL | | break +LL | | +LL | | break; LL | | } | |_____________^ expected `!`, found `()` | @@ -31,7 +34,8 @@ error[E0308]: mismatched types --> $DIR/break-while-condition.rs:24:13 | LL | / while false { -LL | | return +LL | | +LL | | return; LL | | } | |_____________^ expected `!`, found `()` | diff --git a/tests/ui/impl-trait/issues/issue-58504.rs b/tests/ui/impl-trait/issues/issue-58504.rs index 57119671680ed..a41668d4ef87b 100644 --- a/tests/ui/impl-trait/issues/issue-58504.rs +++ b/tests/ui/impl-trait/issues/issue-58504.rs @@ -1,12 +1,17 @@ -#![feature(coroutines, coroutine_trait, never_type)] +#![feature(coroutines, coroutine_trait)] use std::ops::Coroutine; -fn mk_gen() -> impl Coroutine { - #[coroutine] || { loop { yield; } } +fn mk_gen() -> impl Coroutine { + #[coroutine] + || { + loop { + yield; + } + } } fn main() { - let gens: [impl Coroutine;2] = [ mk_gen(), mk_gen() ]; + let gens: [impl Coroutine; 2] = [mk_gen(), mk_gen()]; //~^ ERROR `impl Trait` is not allowed in the type of variable bindings } diff --git a/tests/ui/impl-trait/issues/issue-58504.stderr b/tests/ui/impl-trait/issues/issue-58504.stderr index bc921d5cd2c87..5290d164c27aa 100644 --- a/tests/ui/impl-trait/issues/issue-58504.stderr +++ b/tests/ui/impl-trait/issues/issue-58504.stderr @@ -1,8 +1,8 @@ error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/issue-58504.rs:10:16 + --> $DIR/issue-58504.rs:15:16 | -LL | let gens: [impl Coroutine;2] = [ mk_gen(), mk_gen() ]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | let gens: [impl Coroutine; 2] = [mk_gen(), mk_gen()]; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `impl Trait` is only allowed in arguments and return types of functions and methods = note: see issue #63065 for more information diff --git a/tests/ui/layout/enum-scalar-pair-int-ptr.stderr b/tests/ui/layout/enum-scalar-pair-int-ptr.stderr index 5d54fd432371e..be144470a8af9 100644 --- a/tests/ui/layout/enum-scalar-pair-int-ptr.stderr +++ b/tests/ui/layout/enum-scalar-pair-int-ptr.stderr @@ -1,11 +1,11 @@ error: backend_repr: ScalarPair(Initialized { value: Int(I?, false), valid_range: $VALID_RANGE }, Initialized { value: Pointer(AddressSpace(0)), valid_range: $VALID_RANGE }) - --> $DIR/enum-scalar-pair-int-ptr.rs:12:1 + --> $DIR/enum-scalar-pair-int-ptr.rs:11:1 | LL | enum ScalarPairPointerWithInt { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: backend_repr: Memory { sized: true } - --> $DIR/enum-scalar-pair-int-ptr.rs:21:1 + --> $DIR/enum-scalar-pair-int-ptr.rs:20:1 | LL | enum NotScalarPairPointerWithSmallerInt { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/layout/enum.stderr b/tests/ui/layout/enum.stderr index 3b41129456dda..b0384fdc1f57f 100644 --- a/tests/ui/layout/enum.stderr +++ b/tests/ui/layout/enum.stderr @@ -1,5 +1,5 @@ error: align: Align(2 bytes) - --> $DIR/enum.rs:9:1 + --> $DIR/enum.rs:8:1 | LL | enum UninhabitedVariantAlign { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -11,13 +11,13 @@ LL | enum UninhabitedVariantSpace { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: backend_repr: ScalarPair(Initialized { value: Int(I8, false), valid_range: 0..=1 }, Initialized { value: Int(I8, false), valid_range: 0..=255 }) - --> $DIR/enum.rs:21:1 + --> $DIR/enum.rs:22:1 | LL | enum ScalarPairDifferingSign { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: size: Size(4 bytes) - --> $DIR/enum.rs:31:1 + --> $DIR/enum.rs:33:1 | LL | enum DefinedLayoutAllUninhabited { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/layout/struct.stderr b/tests/ui/layout/struct.stderr index 3fb18f767ca69..044f1df486d21 100644 --- a/tests/ui/layout/struct.stderr +++ b/tests/ui/layout/struct.stderr @@ -1,11 +1,11 @@ error: backend_repr: Memory { sized: true } - --> $DIR/struct.rs:9:1 + --> $DIR/struct.rs:8:1 | LL | struct AlignedZstPreventsScalar(i16, [i32; 0]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: backend_repr: Scalar(Initialized { value: Int(I32, true), valid_range: 0..=4294967295 }) - --> $DIR/struct.rs:12:1 + --> $DIR/struct.rs:11:1 | LL | struct AlignedZstButStillScalar(i32, [i16; 0]); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/unused-features/unused-language-features.stderr b/tests/ui/lint/unused-features/unused-language-features.stderr index 3cede1a6fe726..c17c12988ebbf 100644 --- a/tests/ui/lint/unused-features/unused-language-features.stderr +++ b/tests/ui/lint/unused-features/unused-language-features.stderr @@ -1,5 +1,5 @@ error: feature `coroutines` is declared but not used - --> $DIR/unused-language-features.rs:5:12 + --> $DIR/unused-language-features.rs:4:12 | LL | #![feature(coroutines)] | ^^^^^^^^^^ @@ -11,25 +11,25 @@ LL | #![deny(unused_features)] | ^^^^^^^^^^^^^^^ error: feature `coroutine_clone` is declared but not used - --> $DIR/unused-language-features.rs:7:12 + --> $DIR/unused-language-features.rs:6:12 | LL | #![feature(coroutine_clone)] | ^^^^^^^^^^^^^^^ error: feature `stmt_expr_attributes` is declared but not used - --> $DIR/unused-language-features.rs:9:12 + --> $DIR/unused-language-features.rs:8:12 | LL | #![feature(stmt_expr_attributes)] | ^^^^^^^^^^^^^^^^^^^^ error: feature `asm_unwind` is declared but not used - --> $DIR/unused-language-features.rs:11:12 + --> $DIR/unused-language-features.rs:10:12 | LL | #![feature(asm_unwind)] | ^^^^^^^^^^ error: feature `negative_impls` is declared but not used - --> $DIR/unused-language-features.rs:15:28 + --> $DIR/unused-language-features.rs:14:28 | LL | #![cfg_attr(all(), feature(negative_impls))] | ^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/unused/must-use-ops.stderr b/tests/ui/lint/unused/must-use-ops.stderr index 79a53d39cbf10..41594f47a1398 100644 --- a/tests/ui/lint/unused/must-use-ops.stderr +++ b/tests/ui/lint/unused/must-use-ops.stderr @@ -1,5 +1,5 @@ warning: unused comparison that must be used - --> $DIR/must-use-ops.rs:18:5 + --> $DIR/must-use-ops.rs:17:5 | LL | val == 1; | ^^^^^^^^ the comparison produces a value @@ -15,7 +15,7 @@ LL | let _ = val == 1; | +++++++ warning: unused comparison that must be used - --> $DIR/must-use-ops.rs:19:5 + --> $DIR/must-use-ops.rs:18:5 | LL | val < 1; | ^^^^^^^ the comparison produces a value @@ -26,7 +26,7 @@ LL | let _ = val < 1; | +++++++ warning: unused comparison that must be used - --> $DIR/must-use-ops.rs:20:5 + --> $DIR/must-use-ops.rs:19:5 | LL | val <= 1; | ^^^^^^^^ the comparison produces a value @@ -37,7 +37,7 @@ LL | let _ = val <= 1; | +++++++ warning: unused comparison that must be used - --> $DIR/must-use-ops.rs:21:5 + --> $DIR/must-use-ops.rs:20:5 | LL | val != 1; | ^^^^^^^^ the comparison produces a value @@ -48,7 +48,7 @@ LL | let _ = val != 1; | +++++++ warning: unused comparison that must be used - --> $DIR/must-use-ops.rs:22:5 + --> $DIR/must-use-ops.rs:21:5 | LL | val >= 1; | ^^^^^^^^ the comparison produces a value @@ -59,7 +59,7 @@ LL | let _ = val >= 1; | +++++++ warning: unused comparison that must be used - --> $DIR/must-use-ops.rs:23:5 + --> $DIR/must-use-ops.rs:22:5 | LL | val > 1; | ^^^^^^^ the comparison produces a value @@ -70,7 +70,7 @@ LL | let _ = val > 1; | +++++++ warning: unused arithmetic operation that must be used - --> $DIR/must-use-ops.rs:26:5 + --> $DIR/must-use-ops.rs:25:5 | LL | val + 2; | ^^^^^^^ the arithmetic operation produces a value @@ -81,7 +81,7 @@ LL | let _ = val + 2; | +++++++ warning: unused arithmetic operation that must be used - --> $DIR/must-use-ops.rs:27:5 + --> $DIR/must-use-ops.rs:26:5 | LL | val - 2; | ^^^^^^^ the arithmetic operation produces a value @@ -92,7 +92,7 @@ LL | let _ = val - 2; | +++++++ warning: unused arithmetic operation that must be used - --> $DIR/must-use-ops.rs:28:5 + --> $DIR/must-use-ops.rs:27:5 | LL | val / 2; | ^^^^^^^ the arithmetic operation produces a value @@ -103,7 +103,7 @@ LL | let _ = val / 2; | +++++++ warning: unused arithmetic operation that must be used - --> $DIR/must-use-ops.rs:29:5 + --> $DIR/must-use-ops.rs:28:5 | LL | val * 2; | ^^^^^^^ the arithmetic operation produces a value @@ -114,7 +114,7 @@ LL | let _ = val * 2; | +++++++ warning: unused arithmetic operation that must be used - --> $DIR/must-use-ops.rs:30:5 + --> $DIR/must-use-ops.rs:29:5 | LL | val % 2; | ^^^^^^^ the arithmetic operation produces a value @@ -125,7 +125,7 @@ LL | let _ = val % 2; | +++++++ warning: unused logical operation that must be used - --> $DIR/must-use-ops.rs:33:5 + --> $DIR/must-use-ops.rs:32:5 | LL | true && true; | ^^^^^^^^^^^^ the logical operation produces a value @@ -136,7 +136,7 @@ LL | let _ = true && true; | +++++++ warning: unused logical operation that must be used - --> $DIR/must-use-ops.rs:34:5 + --> $DIR/must-use-ops.rs:33:5 | LL | false || true; | ^^^^^^^^^^^^^ the logical operation produces a value @@ -147,7 +147,7 @@ LL | let _ = false || true; | +++++++ warning: unused bitwise operation that must be used - --> $DIR/must-use-ops.rs:37:5 + --> $DIR/must-use-ops.rs:36:5 | LL | 5 ^ val; | ^^^^^^^ the bitwise operation produces a value @@ -158,7 +158,7 @@ LL | let _ = 5 ^ val; | +++++++ warning: unused bitwise operation that must be used - --> $DIR/must-use-ops.rs:38:5 + --> $DIR/must-use-ops.rs:37:5 | LL | 5 & val; | ^^^^^^^ the bitwise operation produces a value @@ -169,7 +169,7 @@ LL | let _ = 5 & val; | +++++++ warning: unused bitwise operation that must be used - --> $DIR/must-use-ops.rs:39:5 + --> $DIR/must-use-ops.rs:38:5 | LL | 5 | val; | ^^^^^^^ the bitwise operation produces a value @@ -180,7 +180,7 @@ LL | let _ = 5 | val; | +++++++ warning: unused bitwise operation that must be used - --> $DIR/must-use-ops.rs:40:5 + --> $DIR/must-use-ops.rs:39:5 | LL | 5 << val; | ^^^^^^^^ the bitwise operation produces a value @@ -191,7 +191,7 @@ LL | let _ = 5 << val; | +++++++ warning: unused bitwise operation that must be used - --> $DIR/must-use-ops.rs:41:5 + --> $DIR/must-use-ops.rs:40:5 | LL | 5 >> val; | ^^^^^^^^ the bitwise operation produces a value @@ -202,7 +202,7 @@ LL | let _ = 5 >> val; | +++++++ warning: unused unary operation that must be used - --> $DIR/must-use-ops.rs:44:5 + --> $DIR/must-use-ops.rs:43:5 | LL | !val; | ^^^^ the unary operation produces a value @@ -213,7 +213,7 @@ LL | let _ = !val; | +++++++ warning: unused unary operation that must be used - --> $DIR/must-use-ops.rs:45:5 + --> $DIR/must-use-ops.rs:44:5 | LL | -val; | ^^^^ the unary operation produces a value @@ -224,7 +224,7 @@ LL | let _ = -val; | +++++++ warning: unused unary operation that must be used - --> $DIR/must-use-ops.rs:46:5 + --> $DIR/must-use-ops.rs:45:5 | LL | *val_pointer; | ^^^^^^^^^^^^ the unary operation produces a value diff --git a/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr b/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr index 31d6f6bcf2bc7..eee42d474eac9 100644 --- a/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr +++ b/tests/ui/lint/unused/must_use-result-unit-uninhabited.stderr @@ -1,5 +1,5 @@ error: unused `Result` that must be used - --> $DIR/must_use-result-unit-uninhabited.rs:80:5 + --> $DIR/must_use-result-unit-uninhabited.rs:79:5 | LL | result_unit_unit(); | ^^^^^^^^^^^^^^^^^^ @@ -16,7 +16,7 @@ LL | let _ = result_unit_unit(); | +++++++ error: unused `Result` that must be used - --> $DIR/must_use-result-unit-uninhabited.rs:84:5 + --> $DIR/must_use-result-unit-uninhabited.rs:83:5 | LL | result_unit_myuninhabited_nonexhaustive(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -28,7 +28,7 @@ LL | let _ = result_unit_myuninhabited_nonexhaustive(); | +++++++ error: unused `Result` that must be used - --> $DIR/must_use-result-unit-uninhabited.rs:86:5 + --> $DIR/must_use-result-unit-uninhabited.rs:85:5 | LL | result_unit_assoctype(S2); | ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -40,7 +40,7 @@ LL | let _ = result_unit_assoctype(S2); | +++++++ error: unused `Result` that must be used - --> $DIR/must_use-result-unit-uninhabited.rs:88:5 + --> $DIR/must_use-result-unit-uninhabited.rs:87:5 | LL | S2.method_use_assoc_type(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -52,7 +52,7 @@ LL | let _ = S2.method_use_assoc_type(); | +++++++ error: unused `ControlFlow` that must be used - --> $DIR/must_use-result-unit-uninhabited.rs:90:5 + --> $DIR/must_use-result-unit-uninhabited.rs:89:5 | LL | controlflow_unit(); | ^^^^^^^^^^^^^^^^^^ @@ -63,7 +63,7 @@ LL | let _ = controlflow_unit(); | +++++++ error: unused `Result` that must be used - --> $DIR/must_use-result-unit-uninhabited.rs:99:9 + --> $DIR/must_use-result-unit-uninhabited.rs:98:9 | LL | self.generate(); | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/lint/unused/must_use-unit.stderr b/tests/ui/lint/unused/must_use-unit.stderr index 993a19e5f04ed..b6e365a468173 100644 --- a/tests/ui/lint/unused/must_use-unit.stderr +++ b/tests/ui/lint/unused/must_use-unit.stderr @@ -1,11 +1,11 @@ error: unused return value of `foo` that must be used - --> $DIR/must_use-unit.rs:13:5 + --> $DIR/must_use-unit.rs:12:5 | LL | foo(); | ^^^^^ | note: the lint level is defined here - --> $DIR/must_use-unit.rs:2:9 + --> $DIR/must_use-unit.rs:1:9 | LL | #![deny(unused_must_use)] | ^^^^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | let _ = foo(); | +++++++ error: unused return value of `bar` that must be used - --> $DIR/must_use-unit.rs:15:5 + --> $DIR/must_use-unit.rs:14:5 | LL | bar(); | ^^^^^ diff --git a/tests/ui/loops/loop-break-never-type-mismatch.stderr b/tests/ui/loops/loop-break-never-type-mismatch.stderr index e6868f375e28d..684eee7d0245a 100644 --- a/tests/ui/loops/loop-break-never-type-mismatch.stderr +++ b/tests/ui/loops/loop-break-never-type-mismatch.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/loop-break-never-type-mismatch.rs:17:26 + --> $DIR/loop-break-never-type-mismatch.rs:15:26 | LL | fn loop_break_break() -> i32 { | ---------------- ^^^ expected `i32`, found `()` @@ -7,7 +7,7 @@ LL | fn loop_break_break() -> i32 { | implicitly returns `()` as its body has no tail or `return` expression error[E0308]: mismatched types - --> $DIR/loop-break-never-type-mismatch.rs:39:25 + --> $DIR/loop-break-never-type-mismatch.rs:37:25 | LL | fn loop_break_void() -> i32 { | --------------- ^^^ expected `i32`, found `()` diff --git a/tests/ui/loops/loop-break-value.stderr b/tests/ui/loops/loop-break-value.stderr index 8810d16ca5986..432f6be699cbf 100644 --- a/tests/ui/loops/loop-break-value.stderr +++ b/tests/ui/loops/loop-break-value.stderr @@ -1,5 +1,5 @@ warning: label name `'a` shadows a label name that is already in scope - --> $DIR/loop-break-value.rs:140:17 + --> $DIR/loop-break-value.rs:138:17 | LL | 'a: loop { | -- first declared here @@ -8,7 +8,7 @@ LL | let _ = 'a: loop { | ^^ label `'a` already in scope warning: label name `'a` shadows a label name that is already in scope - --> $DIR/loop-break-value.rs:152:17 + --> $DIR/loop-break-value.rs:150:17 | LL | 'a: loop { | -- first declared here @@ -17,7 +17,7 @@ LL | let _ = 'a: loop { | ^^ label `'a` already in scope error[E0425]: cannot find value `LOOP` in this scope - --> $DIR/loop-break-value.rs:99:15 + --> $DIR/loop-break-value.rs:97:15 | LL | 'LOOP: for _ in 0 .. 9 { | ----- a label with a similar name exists @@ -28,7 +28,7 @@ LL | break LOOP; | help: use the similarly named label: `'LOOP` warning: denote infinite loops with `loop { ... }` - --> $DIR/loop-break-value.rs:30:5 + --> $DIR/loop-break-value.rs:28:5 | LL | 'while_loop: while true { | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop` @@ -36,7 +36,7 @@ LL | 'while_loop: while true { = note: `#[warn(while_true)]` on by default error[E0571]: `break` with value from a `while` loop - --> $DIR/loop-break-value.rs:32:9 + --> $DIR/loop-break-value.rs:30:9 | LL | 'while_loop: while true { | ----------------------- you can't `break` with a value in a `while` loop @@ -56,7 +56,7 @@ LL + break 'while_loop; | error[E0571]: `break` with value from a `while` loop - --> $DIR/loop-break-value.rs:34:13 + --> $DIR/loop-break-value.rs:32:13 | LL | 'while_loop: while true { | ----------------------- you can't `break` with a value in a `while` loop @@ -71,7 +71,7 @@ LL + break 'while_loop; | error[E0571]: `break` with value from a `while` loop - --> $DIR/loop-break-value.rs:42:12 + --> $DIR/loop-break-value.rs:40:12 | LL | while let Some(_) = Some(()) { | ---------------------------- you can't `break` with a value in a `while` loop @@ -85,7 +85,7 @@ LL + if break { | error[E0571]: `break` with value from a `while` loop - --> $DIR/loop-break-value.rs:47:9 + --> $DIR/loop-break-value.rs:45:9 | LL | while let Some(_) = Some(()) { | ---------------------------- you can't `break` with a value in a `while` loop @@ -99,7 +99,7 @@ LL + break; | error[E0571]: `break` with value from a `while` loop - --> $DIR/loop-break-value.rs:53:13 + --> $DIR/loop-break-value.rs:51:13 | LL | 'while_let_loop: while let Some(_) = Some(()) { | --------------------------------------------- you can't `break` with a value in a `while` loop @@ -114,7 +114,7 @@ LL + break 'while_let_loop; | error[E0571]: `break` with value from a `for` loop - --> $DIR/loop-break-value.rs:60:9 + --> $DIR/loop-break-value.rs:58:9 | LL | for _ in &[1,2,3] { | ----------------- you can't `break` with a value in a `for` loop @@ -128,7 +128,7 @@ LL + break; | error[E0571]: `break` with value from a `for` loop - --> $DIR/loop-break-value.rs:61:9 + --> $DIR/loop-break-value.rs:59:9 | LL | for _ in &[1,2,3] { | ----------------- you can't `break` with a value in a `for` loop @@ -143,7 +143,7 @@ LL + break; | error[E0571]: `break` with value from a `for` loop - --> $DIR/loop-break-value.rs:68:13 + --> $DIR/loop-break-value.rs:66:13 | LL | 'for_loop: for _ in &[1,2,3] { | ---------------------------- you can't `break` with a value in a `for` loop @@ -158,7 +158,7 @@ LL + break 'for_loop; | error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:4:31 + --> $DIR/loop-break-value.rs:2:31 | LL | let val: ! = loop { break break; }; | --- ---- ^^^^^ expected `!`, found `()` @@ -170,7 +170,7 @@ LL | let val: ! = loop { break break; }; found unit type `()` error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:11:19 + --> $DIR/loop-break-value.rs:9:19 | LL | break "asdf"; | ------------ expected because of this `break` @@ -179,7 +179,7 @@ LL | break 123; | ^^^ expected `&str`, found integer error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:16:15 + --> $DIR/loop-break-value.rs:14:15 | LL | let _: i32 = loop { | - ---- this loop is expected to be of type `i32` @@ -189,7 +189,7 @@ LL | break "asdf"; | ^^^^^^ expected `i32`, found `&str` error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:21:31 + --> $DIR/loop-break-value.rs:19:31 | LL | let _: i32 = 'outer_loop: loop { | - ---- this loop is expected to be of type `i32` @@ -200,7 +200,7 @@ LL | break 'outer_loop "nope"; | ^^^^^^ expected `i32`, found `&str` error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:27:9 + --> $DIR/loop-break-value.rs:25:9 | LL | let _: Option = loop { | - ---- this loop is expected to be of type `Option` @@ -217,7 +217,7 @@ LL | break None; | ++++ error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:77:26 + --> $DIR/loop-break-value.rs:75:26 | LL | break; | ----- expected because of this `break` @@ -225,7 +225,7 @@ LL | break 'c 123; | ^^^ expected `()`, found integer error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:84:15 + --> $DIR/loop-break-value.rs:82:15 | LL | break (break, break); | ^-----^^-----^ @@ -238,7 +238,7 @@ LL | break (break, break); found tuple `(_, _)` error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:89:15 + --> $DIR/loop-break-value.rs:87:15 | LL | break; | ----- expected because of this `break` @@ -246,7 +246,7 @@ LL | break 2; | ^ expected `()`, found integer error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:94:9 + --> $DIR/loop-break-value.rs:92:9 | LL | break 2; | ------- expected because of this `break` @@ -259,7 +259,7 @@ LL | break /* value */; | +++++++++++ error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:112:9 + --> $DIR/loop-break-value.rs:110:9 | LL | break 'a 1; | ---------- expected because of this `break` @@ -273,7 +273,7 @@ LL | break /* value */; | +++++++++++ error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:124:9 + --> $DIR/loop-break-value.rs:122:9 | LL | break 'a 1; | ---------- expected because of this `break` @@ -287,7 +287,7 @@ LL | break 'a /* value */; | +++++++++++ error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:135:15 + --> $DIR/loop-break-value.rs:133:15 | LL | break; | ----- expected because of this `break` @@ -296,7 +296,7 @@ LL | break 2; | ^ expected `()`, found integer error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:144:17 + --> $DIR/loop-break-value.rs:142:17 | LL | break 2; | ------- expected because of this `break` @@ -310,7 +310,7 @@ LL | break 'a /* value */; | +++++++++++ error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:147:15 + --> $DIR/loop-break-value.rs:145:15 | LL | break; | ----- expected because of this `break` @@ -319,7 +319,7 @@ LL | break 2; | ^ expected `()`, found integer error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:156:17 + --> $DIR/loop-break-value.rs:154:17 | LL | break 'a 2; | ---------- expected because of this `break` @@ -333,7 +333,7 @@ LL | break 'a /* value */; | +++++++++++ error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:159:15 + --> $DIR/loop-break-value.rs:157:15 | LL | break; | ----- expected because of this `break` @@ -342,7 +342,7 @@ LL | break 2; | ^ expected `()`, found integer error[E0308]: mismatched types - --> $DIR/loop-break-value.rs:163:15 + --> $DIR/loop-break-value.rs:161:15 | LL | fn main() { | - expected `()` because of this return type diff --git a/tests/ui/never_type/basic/call-fn-never-arg-wrong-type.stderr b/tests/ui/never_type/basic/call-fn-never-arg-wrong-type.stderr index bdeb2fb906c78..bd5526c8c10c1 100644 --- a/tests/ui/never_type/basic/call-fn-never-arg-wrong-type.stderr +++ b/tests/ui/never_type/basic/call-fn-never-arg-wrong-type.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/call-fn-never-arg-wrong-type.rs:10:9 + --> $DIR/call-fn-never-arg-wrong-type.rs:8:9 | LL | foo("wow"); | --- ^^^^^ expected `!`, found `&str` @@ -9,7 +9,7 @@ LL | foo("wow"); = note: expected type `!` found reference `&'static str` note: function defined here - --> $DIR/call-fn-never-arg-wrong-type.rs:5:4 + --> $DIR/call-fn-never-arg-wrong-type.rs:3:4 | LL | fn foo(x: !) -> ! { | ^^^ ---- diff --git a/tests/ui/never_type/basic/never-assign-wrong-type.stderr b/tests/ui/never_type/basic/never-assign-wrong-type.stderr index dd890e4d163b3..c3d3bdd0f0f61 100644 --- a/tests/ui/never_type/basic/never-assign-wrong-type.stderr +++ b/tests/ui/never_type/basic/never-assign-wrong-type.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/never-assign-wrong-type.rs:6:16 + --> $DIR/never-assign-wrong-type.rs:4:16 | LL | let x: ! = "hello"; | - ^^^^^^^ expected `!`, found `&str` diff --git a/tests/ui/never_type/diverging-place-match.stderr b/tests/ui/never_type/diverging-place-match.stderr index 14300c4df05e4..1bffc97a42a72 100644 --- a/tests/ui/never_type/diverging-place-match.stderr +++ b/tests/ui/never_type/diverging-place-match.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:4:5 + --> $DIR/diverging-place-match.rs:2:5 | LL | / unsafe { LL | | @@ -13,7 +13,7 @@ LL | | } found unit type `()` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:14:5 + --> $DIR/diverging-place-match.rs:12:5 | LL | / unsafe { LL | | @@ -26,7 +26,7 @@ LL | | } found unit type `()` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:25:21 + --> $DIR/diverging-place-match.rs:23:21 | LL | let _: () = *x; | -- ^^ expected `()`, found `!` @@ -37,7 +37,7 @@ LL | let _: () = *x; found type `!` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:22:5 + --> $DIR/diverging-place-match.rs:20:5 | LL | / unsafe { LL | | @@ -51,7 +51,7 @@ LL | | } found unit type `()` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:31:5 + --> $DIR/diverging-place-match.rs:29:5 | LL | / unsafe { LL | | @@ -64,7 +64,7 @@ LL | | } found unit type `()` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:39:5 + --> $DIR/diverging-place-match.rs:37:5 | LL | / unsafe { LL | | @@ -78,7 +78,7 @@ LL | | } found unit type `()` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:51:18 + --> $DIR/diverging-place-match.rs:49:18 | LL | let (_ | 1i32) = *x; | ^^^^ -- this expression has type `!` @@ -89,7 +89,7 @@ LL | let (_ | 1i32) = *x; found type `i32` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:48:5 + --> $DIR/diverging-place-match.rs:46:5 | LL | / unsafe { LL | | @@ -103,7 +103,7 @@ LL | | } found unit type `()` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:61:14 + --> $DIR/diverging-place-match.rs:59:14 | LL | let (1i32 | _) = *x; | ^^^^ -- this expression has type `!` @@ -114,7 +114,7 @@ LL | let (1i32 | _) = *x; found type `i32` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:58:5 + --> $DIR/diverging-place-match.rs:56:5 | LL | / unsafe { LL | | @@ -128,7 +128,7 @@ LL | | } found unit type `()` error[E0308]: mismatched types - --> $DIR/diverging-place-match.rs:69:26 + --> $DIR/diverging-place-match.rs:67:26 | LL | let ref _x: () = *x; | ^^ expected `()`, found `!` diff --git a/tests/ui/never_type/empty-never-array.stderr b/tests/ui/never_type/empty-never-array.stderr index cd8a80e3d49d7..72984027dfdad 100644 --- a/tests/ui/never_type/empty-never-array.stderr +++ b/tests/ui/never_type/empty-never-array.stderr @@ -1,5 +1,5 @@ error[E0005]: refutable pattern in local binding - --> $DIR/empty-never-array.rs:12:9 + --> $DIR/empty-never-array.rs:10:9 | LL | let Helper::U(u) = Helper::T(t, []); | ^^^^^^^^^^^^ pattern `Helper::T(_, _)` not covered @@ -7,7 +7,7 @@ LL | let Helper::U(u) = Helper::T(t, []); = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Helper` defined here - --> $DIR/empty-never-array.rs:5:6 + --> $DIR/empty-never-array.rs:3:6 | LL | enum Helper { | ^^^^^^ diff --git a/tests/ui/never_type/exhaustive_patterns.stderr b/tests/ui/never_type/exhaustive_patterns.stderr index f8b582d1b50bf..9738510fa177e 100644 --- a/tests/ui/never_type/exhaustive_patterns.stderr +++ b/tests/ui/never_type/exhaustive_patterns.stderr @@ -1,5 +1,5 @@ error[E0005]: refutable pattern in local binding - --> $DIR/exhaustive_patterns.rs:24:9 + --> $DIR/exhaustive_patterns.rs:22:9 | LL | let Either::A(()) = foo(); | ^^^^^^^^^^^^^ pattern `Either::B(_)` not covered @@ -7,7 +7,7 @@ LL | let Either::A(()) = foo(); = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Either<(), !>` defined here - --> $DIR/exhaustive_patterns.rs:12:6 + --> $DIR/exhaustive_patterns.rs:10:6 | LL | enum Either { | ^^^^^^ diff --git a/tests/ui/never_type/fallback_change/question_mark_from_never.rs b/tests/ui/never_type/fallback_change/question_mark_from_never.rs index 8f5862a2a0ea2..1685b66b538ee 100644 --- a/tests/ui/never_type/fallback_change/question_mark_from_never.rs +++ b/tests/ui/never_type/fallback_change/question_mark_from_never.rs @@ -5,7 +5,7 @@ //@ revisions: unit never //@ check-pass #![allow(internal_features)] -#![feature(rustc_attrs, never_type)] +#![feature(rustc_attrs)] #![cfg_attr(unit, rustc_never_type_options(fallback = "unit"))] #![cfg_attr(never, rustc_never_type_options(fallback = "never"))] diff --git a/tests/ui/never_type/fallback_change/try-block-never-type-fallback.e2021.stderr b/tests/ui/never_type/fallback_change/try-block-never-type-fallback.e2021.stderr index 7e23c86bcbccc..3119c5ace905b 100644 --- a/tests/ui/never_type/fallback_change/try-block-never-type-fallback.e2021.stderr +++ b/tests/ui/never_type/fallback_change/try-block-never-type-fallback.e2021.stderr @@ -1,5 +1,5 @@ error[E0277]: the trait bound `!: From<()>` is not satisfied - --> $DIR/try-block-never-type-fallback.rs:20:9 + --> $DIR/try-block-never-type-fallback.rs:19:9 | LL | bar(try { x? }); | --- ^^^^^^^^^^ the trait `From<()>` is not implemented for `!` @@ -10,7 +10,7 @@ LL | bar(try { x? }); = help: you might have intended to use the type `()` here instead = note: required for `()` to implement `Into` note: required by a bound in `bar` - --> $DIR/try-block-never-type-fallback.rs:15:23 + --> $DIR/try-block-never-type-fallback.rs:14:23 | LL | fn bar(_: Result, u32>) { | ^^^^^^^ required by this bound in `bar` diff --git a/tests/ui/never_type/never-from-impl-is-reserved.current.stderr b/tests/ui/never_type/never-from-impl-is-reserved.current.stderr index 7868206950c34..dd001bf70c164 100644 --- a/tests/ui/never_type/never-from-impl-is-reserved.current.stderr +++ b/tests/ui/never_type/never-from-impl-is-reserved.current.stderr @@ -1,5 +1,5 @@ error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFoo` - --> $DIR/never-from-impl-is-reserved.rs:14:1 + --> $DIR/never-from-impl-is-reserved.rs:12:1 | LL | impl MyTrait for MyFoo {} | ---------------------- first implementation here diff --git a/tests/ui/never_type/never-from-impl-is-reserved.next.stderr b/tests/ui/never_type/never-from-impl-is-reserved.next.stderr index 7868206950c34..dd001bf70c164 100644 --- a/tests/ui/never_type/never-from-impl-is-reserved.next.stderr +++ b/tests/ui/never_type/never-from-impl-is-reserved.next.stderr @@ -1,5 +1,5 @@ error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFoo` - --> $DIR/never-from-impl-is-reserved.rs:14:1 + --> $DIR/never-from-impl-is-reserved.rs:12:1 | LL | impl MyTrait for MyFoo {} | ---------------------- first implementation here diff --git a/tests/ui/never_type/regress/never-in-range-pat.stderr b/tests/ui/never_type/regress/never-in-range-pat.stderr index c78be5350e0f0..977f486f598b7 100644 --- a/tests/ui/never_type/regress/never-in-range-pat.stderr +++ b/tests/ui/never_type/regress/never-in-range-pat.stderr @@ -1,5 +1,5 @@ error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/never-in-range-pat.rs:13:12 + --> $DIR/never-in-range-pat.rs:11:12 | LL | 0..x => {} | - ^ this is of type `!` but it should be `char` or numeric diff --git a/tests/ui/never_type/regress/span-bug-issue-121445.stderr b/tests/ui/never_type/regress/span-bug-issue-121445.stderr index 8c8bc133433a7..b211afa236fef 100644 --- a/tests/ui/never_type/regress/span-bug-issue-121445.stderr +++ b/tests/ui/never_type/regress/span-bug-issue-121445.stderr @@ -1,5 +1,5 @@ error[E0369]: no implementation for `SingleVariant | ()` - --> $DIR/span-bug-issue-121445.rs:8:9 + --> $DIR/span-bug-issue-121445.rs:6:9 | LL | let c2 = SingleVariant::Points(0) | ------------------------ SingleVariant @@ -10,7 +10,7 @@ LL | | }; | |_________- () | note: an implementation of `BitOr<()>` might be missing for `SingleVariant` - --> $DIR/span-bug-issue-121445.rs:13:1 + --> $DIR/span-bug-issue-121445.rs:11:1 | LL | enum SingleVariant { | ^^^^^^^^^^^^^^^^^^ must implement `BitOr<()>` diff --git a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs index db25ce440893d..4a2ef8f9ac0f4 100644 --- a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs +++ b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs @@ -5,7 +5,6 @@ fn main() { dealloc(ptr2, Layout::(x: !)(1, 1)); //~ ERROR `Trait(...)` syntax does not support named parameters //~^ ERROR cannot find function `dealloc` in this scope [E0425] //~| ERROR cannot find value `ptr2` in this scope [E0425] - //~| ERROR the `!` type is experimental [E0658] //~| ERROR cannot find function, tuple struct or tuple variant `Layout` in this scope [E0425] } } diff --git a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.stderr b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.stderr index a083883af219f..23a0e36dc9f2b 100644 --- a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.stderr +++ b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.stderr @@ -21,23 +21,12 @@ error[E0425]: cannot find value `ptr2` in this scope LL | dealloc(ptr2, Layout::(x: !)(1, 1)); | ^^^^ not found in this scope -error[E0658]: the `!` type is experimental - --> $DIR/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs:5:35 - | -LL | dealloc(ptr2, Layout::(x: !)(1, 1)); - | ^ - | - = note: see issue #35121 for more information - = help: add `#![feature(never_type)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - error[E0425]: cannot find function, tuple struct or tuple variant `Layout` in this scope --> $DIR/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs:5:23 | LL | dealloc(ptr2, Layout::(x: !)(1, 1)); | ^^^^^^ not found in this scope -error: aborting due to 5 previous errors +error: aborting due to 4 previous errors -Some errors have detailed explanations: E0425, E0658. -For more information about an error, try `rustc --explain E0425`. +For more information about this error, try `rustc --explain E0425`. diff --git a/tests/ui/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr index bc74069b3e774..cd5c283f9fd93 100644 --- a/tests/ui/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/always-inhabited-union-ref.exhaustive_patterns.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: type `&!` is non-empty - --> $DIR/always-inhabited-union-ref.rs:24:11 + --> $DIR/always-inhabited-union-ref.rs:23:11 | LL | match uninhab_ref() { | ^^^^^^^^^^^^^ @@ -14,13 +14,13 @@ LL + } | error[E0004]: non-exhaustive patterns: type `Foo` is non-empty - --> $DIR/always-inhabited-union-ref.rs:28:11 + --> $DIR/always-inhabited-union-ref.rs:27:11 | LL | match uninhab_union() { | ^^^^^^^^^^^^^^^ | note: `Foo` defined here - --> $DIR/always-inhabited-union-ref.rs:11:11 + --> $DIR/always-inhabited-union-ref.rs:10:11 | LL | pub union Foo { | ^^^ diff --git a/tests/ui/pattern/usefulness/always-inhabited-union-ref.normal.stderr b/tests/ui/pattern/usefulness/always-inhabited-union-ref.normal.stderr index bc74069b3e774..cd5c283f9fd93 100644 --- a/tests/ui/pattern/usefulness/always-inhabited-union-ref.normal.stderr +++ b/tests/ui/pattern/usefulness/always-inhabited-union-ref.normal.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: type `&!` is non-empty - --> $DIR/always-inhabited-union-ref.rs:24:11 + --> $DIR/always-inhabited-union-ref.rs:23:11 | LL | match uninhab_ref() { | ^^^^^^^^^^^^^ @@ -14,13 +14,13 @@ LL + } | error[E0004]: non-exhaustive patterns: type `Foo` is non-empty - --> $DIR/always-inhabited-union-ref.rs:28:11 + --> $DIR/always-inhabited-union-ref.rs:27:11 | LL | match uninhab_union() { | ^^^^^^^^^^^^^^^ | note: `Foo` defined here - --> $DIR/always-inhabited-union-ref.rs:11:11 + --> $DIR/always-inhabited-union-ref.rs:10:11 | LL | pub union Foo { | ^^^ diff --git a/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr index 4a435bcc8bad9..e72fdeeac3188 100644 --- a/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/empty-match-check-notes.exhaustive_patterns.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/empty-match-check-notes.rs:17:9 + --> $DIR/empty-match-check-notes.rs:16:9 | LL | _ => {} | ^------ @@ -9,13 +9,13 @@ LL | _ => {} | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types note: the lint level is defined here - --> $DIR/empty-match-check-notes.rs:7:9 + --> $DIR/empty-match-check-notes.rs:6:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-match-check-notes.rs:22:9 + --> $DIR/empty-match-check-notes.rs:21:9 | LL | _ if false => {} | ^--------------- @@ -26,7 +26,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-match-check-notes.rs:31:9 + --> $DIR/empty-match-check-notes.rs:30:9 | LL | _ => {} | ^------ @@ -37,7 +37,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-match-check-notes.rs:36:9 + --> $DIR/empty-match-check-notes.rs:35:9 | LL | _ if false => {} | ^--------------- @@ -48,7 +48,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0005]: refutable pattern in local binding - --> $DIR/empty-match-check-notes.rs:43:9 + --> $DIR/empty-match-check-notes.rs:42:9 | LL | let None = *x; | ^^^^ pattern `Some(_)` not covered @@ -63,7 +63,7 @@ LL | if let None = *x { todo!() }; | ++ +++++++++++ error[E0004]: non-exhaustive patterns: `0_u8..=u8::MAX` not covered - --> $DIR/empty-match-check-notes.rs:53:11 + --> $DIR/empty-match-check-notes.rs:52:11 | LL | match 0u8 { | ^^^ pattern `0_u8..=u8::MAX` not covered diff --git a/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr b/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr index 4a435bcc8bad9..e72fdeeac3188 100644 --- a/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr +++ b/tests/ui/pattern/usefulness/empty-match-check-notes.normal.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/empty-match-check-notes.rs:17:9 + --> $DIR/empty-match-check-notes.rs:16:9 | LL | _ => {} | ^------ @@ -9,13 +9,13 @@ LL | _ => {} | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types note: the lint level is defined here - --> $DIR/empty-match-check-notes.rs:7:9 + --> $DIR/empty-match-check-notes.rs:6:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-match-check-notes.rs:22:9 + --> $DIR/empty-match-check-notes.rs:21:9 | LL | _ if false => {} | ^--------------- @@ -26,7 +26,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-match-check-notes.rs:31:9 + --> $DIR/empty-match-check-notes.rs:30:9 | LL | _ => {} | ^------ @@ -37,7 +37,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-match-check-notes.rs:36:9 + --> $DIR/empty-match-check-notes.rs:35:9 | LL | _ if false => {} | ^--------------- @@ -48,7 +48,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0005]: refutable pattern in local binding - --> $DIR/empty-match-check-notes.rs:43:9 + --> $DIR/empty-match-check-notes.rs:42:9 | LL | let None = *x; | ^^^^ pattern `Some(_)` not covered @@ -63,7 +63,7 @@ LL | if let None = *x { todo!() }; | ++ +++++++++++ error[E0004]: non-exhaustive patterns: `0_u8..=u8::MAX` not covered - --> $DIR/empty-match-check-notes.rs:53:11 + --> $DIR/empty-match-check-notes.rs:52:11 | LL | match 0u8 { | ^^^ pattern `0_u8..=u8::MAX` not covered diff --git a/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr index b649aa122b255..8becc8e7c7eec 100644 --- a/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/empty-match.exhaustive_patterns.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: type `u8` is non-empty - --> $DIR/empty-match.rs:47:20 + --> $DIR/empty-match.rs:46:20 | LL | match_no_arms!(0u8); | ^^^ @@ -8,7 +8,7 @@ LL | match_no_arms!(0u8); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `i8` is non-empty - --> $DIR/empty-match.rs:48:20 + --> $DIR/empty-match.rs:47:20 | LL | match_no_arms!(0i8); | ^^^ @@ -17,7 +17,7 @@ LL | match_no_arms!(0i8); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `usize` is non-empty - --> $DIR/empty-match.rs:49:20 + --> $DIR/empty-match.rs:48:20 | LL | match_no_arms!(0usize); | ^^^^^^ @@ -26,7 +26,7 @@ LL | match_no_arms!(0usize); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `isize` is non-empty - --> $DIR/empty-match.rs:50:20 + --> $DIR/empty-match.rs:49:20 | LL | match_no_arms!(0isize); | ^^^^^^ @@ -35,13 +35,13 @@ LL | match_no_arms!(0isize); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty - --> $DIR/empty-match.rs:51:20 + --> $DIR/empty-match.rs:50:20 | LL | match_no_arms!(NonEmptyStruct1); | ^^^^^^^^^^^^^^^ | note: `NonEmptyStruct1` defined here - --> $DIR/empty-match.rs:22:12 + --> $DIR/empty-match.rs:21:12 | LL | struct NonEmptyStruct1; | ^^^^^^^^^^^^^^^ @@ -49,13 +49,13 @@ LL | struct NonEmptyStruct1; = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty - --> $DIR/empty-match.rs:52:20 + --> $DIR/empty-match.rs:51:20 | LL | match_no_arms!(NonEmptyStruct2(true)); | ^^^^^^^^^^^^^^^^^^^^^ | note: `NonEmptyStruct2` defined here - --> $DIR/empty-match.rs:23:12 + --> $DIR/empty-match.rs:22:12 | LL | struct NonEmptyStruct2(bool); | ^^^^^^^^^^^^^^^ @@ -63,13 +63,13 @@ LL | struct NonEmptyStruct2(bool); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty - --> $DIR/empty-match.rs:53:20 + --> $DIR/empty-match.rs:52:20 | LL | match_no_arms!((NonEmptyUnion1 { foo: () })); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `NonEmptyUnion1` defined here - --> $DIR/empty-match.rs:24:11 + --> $DIR/empty-match.rs:23:11 | LL | union NonEmptyUnion1 { | ^^^^^^^^^^^^^^ @@ -77,13 +77,13 @@ LL | union NonEmptyUnion1 { = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty - --> $DIR/empty-match.rs:54:20 + --> $DIR/empty-match.rs:53:20 | LL | match_no_arms!((NonEmptyUnion2 { foo: () })); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `NonEmptyUnion2` defined here - --> $DIR/empty-match.rs:27:11 + --> $DIR/empty-match.rs:26:11 | LL | union NonEmptyUnion2 { | ^^^^^^^^^^^^^^ @@ -91,13 +91,13 @@ LL | union NonEmptyUnion2 { = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered - --> $DIR/empty-match.rs:55:20 + --> $DIR/empty-match.rs:54:20 | LL | match_no_arms!(NonEmptyEnum1::Foo(true)); | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered | note: `NonEmptyEnum1` defined here - --> $DIR/empty-match.rs:31:10 + --> $DIR/empty-match.rs:30:10 | LL | enum NonEmptyEnum1 { | ^^^^^^^^^^^^^ @@ -107,13 +107,13 @@ LL | Foo(bool), = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered - --> $DIR/empty-match.rs:56:20 + --> $DIR/empty-match.rs:55:20 | LL | match_no_arms!(NonEmptyEnum2::Foo(true)); | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered | note: `NonEmptyEnum2` defined here - --> $DIR/empty-match.rs:34:10 + --> $DIR/empty-match.rs:33:10 | LL | enum NonEmptyEnum2 { | ^^^^^^^^^^^^^ @@ -125,13 +125,13 @@ LL | Bar, = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered - --> $DIR/empty-match.rs:57:20 + --> $DIR/empty-match.rs:56:20 | LL | match_no_arms!(NonEmptyEnum5::V1); | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered | note: `NonEmptyEnum5` defined here - --> $DIR/empty-match.rs:38:10 + --> $DIR/empty-match.rs:37:10 | LL | enum NonEmptyEnum5 { | ^^^^^^^^^^^^^ @@ -149,7 +149,7 @@ LL | V5, = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty - --> $DIR/empty-match.rs:58:20 + --> $DIR/empty-match.rs:57:20 | LL | match_no_arms!(array0_of_empty); | ^^^^^^^^^^^^^^^ @@ -158,7 +158,7 @@ LL | match_no_arms!(array0_of_empty); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `[!; N]` is non-empty - --> $DIR/empty-match.rs:59:20 + --> $DIR/empty-match.rs:58:20 | LL | match_no_arms!(arrayN_of_empty); | ^^^^^^^^^^^^^^^ @@ -167,7 +167,7 @@ LL | match_no_arms!(arrayN_of_empty); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: `0_u8..=u8::MAX` not covered - --> $DIR/empty-match.rs:61:24 + --> $DIR/empty-match.rs:60:24 | LL | match_guarded_arm!(0u8); | ^^^ pattern `0_u8..=u8::MAX` not covered @@ -181,7 +181,7 @@ LL + 0_u8..=u8::MAX => todo!() | error[E0004]: non-exhaustive patterns: `i8::MIN..=i8::MAX` not covered - --> $DIR/empty-match.rs:62:24 + --> $DIR/empty-match.rs:61:24 | LL | match_guarded_arm!(0i8); | ^^^ pattern `i8::MIN..=i8::MAX` not covered @@ -195,7 +195,7 @@ LL + i8::MIN..=i8::MAX => todo!() | error[E0004]: non-exhaustive patterns: `0_usize..` not covered - --> $DIR/empty-match.rs:63:24 + --> $DIR/empty-match.rs:62:24 | LL | match_guarded_arm!(0usize); | ^^^^^^ pattern `0_usize..` not covered @@ -209,7 +209,7 @@ LL + 0_usize.. => todo!() | error[E0004]: non-exhaustive patterns: `_` not covered - --> $DIR/empty-match.rs:64:24 + --> $DIR/empty-match.rs:63:24 | LL | match_guarded_arm!(0isize); | ^^^^^^ pattern `_` not covered @@ -223,13 +223,13 @@ LL + _ => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered - --> $DIR/empty-match.rs:65:24 + --> $DIR/empty-match.rs:64:24 | LL | match_guarded_arm!(NonEmptyStruct1); | ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered | note: `NonEmptyStruct1` defined here - --> $DIR/empty-match.rs:22:12 + --> $DIR/empty-match.rs:21:12 | LL | struct NonEmptyStruct1; | ^^^^^^^^^^^^^^^ @@ -242,13 +242,13 @@ LL + NonEmptyStruct1 => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered - --> $DIR/empty-match.rs:66:24 + --> $DIR/empty-match.rs:65:24 | LL | match_guarded_arm!(NonEmptyStruct2(true)); | ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered | note: `NonEmptyStruct2` defined here - --> $DIR/empty-match.rs:23:12 + --> $DIR/empty-match.rs:22:12 | LL | struct NonEmptyStruct2(bool); | ^^^^^^^^^^^^^^^ @@ -261,13 +261,13 @@ LL + NonEmptyStruct2(_) => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered - --> $DIR/empty-match.rs:67:24 + --> $DIR/empty-match.rs:66:24 | LL | match_guarded_arm!((NonEmptyUnion1 { foo: () })); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered | note: `NonEmptyUnion1` defined here - --> $DIR/empty-match.rs:24:11 + --> $DIR/empty-match.rs:23:11 | LL | union NonEmptyUnion1 { | ^^^^^^^^^^^^^^ @@ -280,13 +280,13 @@ LL + NonEmptyUnion1 { .. } => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered - --> $DIR/empty-match.rs:68:24 + --> $DIR/empty-match.rs:67:24 | LL | match_guarded_arm!((NonEmptyUnion2 { foo: () })); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered | note: `NonEmptyUnion2` defined here - --> $DIR/empty-match.rs:27:11 + --> $DIR/empty-match.rs:26:11 | LL | union NonEmptyUnion2 { | ^^^^^^^^^^^^^^ @@ -300,13 +300,13 @@ LL + NonEmptyUnion2 { .. } => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered - --> $DIR/empty-match.rs:69:24 + --> $DIR/empty-match.rs:68:24 | LL | match_guarded_arm!(NonEmptyEnum1::Foo(true)); | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered | note: `NonEmptyEnum1` defined here - --> $DIR/empty-match.rs:31:10 + --> $DIR/empty-match.rs:30:10 | LL | enum NonEmptyEnum1 { | ^^^^^^^^^^^^^ @@ -321,13 +321,13 @@ LL + NonEmptyEnum1::Foo(_) => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered - --> $DIR/empty-match.rs:70:24 + --> $DIR/empty-match.rs:69:24 | LL | match_guarded_arm!(NonEmptyEnum2::Foo(true)); | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered | note: `NonEmptyEnum2` defined here - --> $DIR/empty-match.rs:34:10 + --> $DIR/empty-match.rs:33:10 | LL | enum NonEmptyEnum2 { | ^^^^^^^^^^^^^ @@ -344,13 +344,13 @@ LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered - --> $DIR/empty-match.rs:71:24 + --> $DIR/empty-match.rs:70:24 | LL | ...ded_arm!(NonEmptyEnum5::V1); | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered | note: `NonEmptyEnum5` defined here - --> $DIR/empty-match.rs:38:10 + --> $DIR/empty-match.rs:37:10 | LL | enum NonEmptyEnum5 { | ^^^^^^^^^^^^^ @@ -373,7 +373,7 @@ LL + _ => todo!() | error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-match.rs:72:24 + --> $DIR/empty-match.rs:71:24 | LL | match_guarded_arm!(array0_of_empty); | ^^^^^^^^^^^^^^^ pattern `[]` not covered @@ -387,7 +387,7 @@ LL + [] => todo!() | error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-match.rs:73:24 + --> $DIR/empty-match.rs:72:24 | LL | match_guarded_arm!(arrayN_of_empty); | ^^^^^^^^^^^^^^^ pattern `[]` not covered diff --git a/tests/ui/pattern/usefulness/empty-match.normal.stderr b/tests/ui/pattern/usefulness/empty-match.normal.stderr index b649aa122b255..8becc8e7c7eec 100644 --- a/tests/ui/pattern/usefulness/empty-match.normal.stderr +++ b/tests/ui/pattern/usefulness/empty-match.normal.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: type `u8` is non-empty - --> $DIR/empty-match.rs:47:20 + --> $DIR/empty-match.rs:46:20 | LL | match_no_arms!(0u8); | ^^^ @@ -8,7 +8,7 @@ LL | match_no_arms!(0u8); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `i8` is non-empty - --> $DIR/empty-match.rs:48:20 + --> $DIR/empty-match.rs:47:20 | LL | match_no_arms!(0i8); | ^^^ @@ -17,7 +17,7 @@ LL | match_no_arms!(0i8); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `usize` is non-empty - --> $DIR/empty-match.rs:49:20 + --> $DIR/empty-match.rs:48:20 | LL | match_no_arms!(0usize); | ^^^^^^ @@ -26,7 +26,7 @@ LL | match_no_arms!(0usize); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `isize` is non-empty - --> $DIR/empty-match.rs:50:20 + --> $DIR/empty-match.rs:49:20 | LL | match_no_arms!(0isize); | ^^^^^^ @@ -35,13 +35,13 @@ LL | match_no_arms!(0isize); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `NonEmptyStruct1` is non-empty - --> $DIR/empty-match.rs:51:20 + --> $DIR/empty-match.rs:50:20 | LL | match_no_arms!(NonEmptyStruct1); | ^^^^^^^^^^^^^^^ | note: `NonEmptyStruct1` defined here - --> $DIR/empty-match.rs:22:12 + --> $DIR/empty-match.rs:21:12 | LL | struct NonEmptyStruct1; | ^^^^^^^^^^^^^^^ @@ -49,13 +49,13 @@ LL | struct NonEmptyStruct1; = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `NonEmptyStruct2` is non-empty - --> $DIR/empty-match.rs:52:20 + --> $DIR/empty-match.rs:51:20 | LL | match_no_arms!(NonEmptyStruct2(true)); | ^^^^^^^^^^^^^^^^^^^^^ | note: `NonEmptyStruct2` defined here - --> $DIR/empty-match.rs:23:12 + --> $DIR/empty-match.rs:22:12 | LL | struct NonEmptyStruct2(bool); | ^^^^^^^^^^^^^^^ @@ -63,13 +63,13 @@ LL | struct NonEmptyStruct2(bool); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `NonEmptyUnion1` is non-empty - --> $DIR/empty-match.rs:53:20 + --> $DIR/empty-match.rs:52:20 | LL | match_no_arms!((NonEmptyUnion1 { foo: () })); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `NonEmptyUnion1` defined here - --> $DIR/empty-match.rs:24:11 + --> $DIR/empty-match.rs:23:11 | LL | union NonEmptyUnion1 { | ^^^^^^^^^^^^^^ @@ -77,13 +77,13 @@ LL | union NonEmptyUnion1 { = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `NonEmptyUnion2` is non-empty - --> $DIR/empty-match.rs:54:20 + --> $DIR/empty-match.rs:53:20 | LL | match_no_arms!((NonEmptyUnion2 { foo: () })); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: `NonEmptyUnion2` defined here - --> $DIR/empty-match.rs:27:11 + --> $DIR/empty-match.rs:26:11 | LL | union NonEmptyUnion2 { | ^^^^^^^^^^^^^^ @@ -91,13 +91,13 @@ LL | union NonEmptyUnion2 { = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered - --> $DIR/empty-match.rs:55:20 + --> $DIR/empty-match.rs:54:20 | LL | match_no_arms!(NonEmptyEnum1::Foo(true)); | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered | note: `NonEmptyEnum1` defined here - --> $DIR/empty-match.rs:31:10 + --> $DIR/empty-match.rs:30:10 | LL | enum NonEmptyEnum1 { | ^^^^^^^^^^^^^ @@ -107,13 +107,13 @@ LL | Foo(bool), = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered - --> $DIR/empty-match.rs:56:20 + --> $DIR/empty-match.rs:55:20 | LL | match_no_arms!(NonEmptyEnum2::Foo(true)); | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered | note: `NonEmptyEnum2` defined here - --> $DIR/empty-match.rs:34:10 + --> $DIR/empty-match.rs:33:10 | LL | enum NonEmptyEnum2 { | ^^^^^^^^^^^^^ @@ -125,13 +125,13 @@ LL | Bar, = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered - --> $DIR/empty-match.rs:57:20 + --> $DIR/empty-match.rs:56:20 | LL | match_no_arms!(NonEmptyEnum5::V1); | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered | note: `NonEmptyEnum5` defined here - --> $DIR/empty-match.rs:38:10 + --> $DIR/empty-match.rs:37:10 | LL | enum NonEmptyEnum5 { | ^^^^^^^^^^^^^ @@ -149,7 +149,7 @@ LL | V5, = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or multiple match arms error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty - --> $DIR/empty-match.rs:58:20 + --> $DIR/empty-match.rs:57:20 | LL | match_no_arms!(array0_of_empty); | ^^^^^^^^^^^^^^^ @@ -158,7 +158,7 @@ LL | match_no_arms!(array0_of_empty); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: type `[!; N]` is non-empty - --> $DIR/empty-match.rs:59:20 + --> $DIR/empty-match.rs:58:20 | LL | match_no_arms!(arrayN_of_empty); | ^^^^^^^^^^^^^^^ @@ -167,7 +167,7 @@ LL | match_no_arms!(arrayN_of_empty); = help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern error[E0004]: non-exhaustive patterns: `0_u8..=u8::MAX` not covered - --> $DIR/empty-match.rs:61:24 + --> $DIR/empty-match.rs:60:24 | LL | match_guarded_arm!(0u8); | ^^^ pattern `0_u8..=u8::MAX` not covered @@ -181,7 +181,7 @@ LL + 0_u8..=u8::MAX => todo!() | error[E0004]: non-exhaustive patterns: `i8::MIN..=i8::MAX` not covered - --> $DIR/empty-match.rs:62:24 + --> $DIR/empty-match.rs:61:24 | LL | match_guarded_arm!(0i8); | ^^^ pattern `i8::MIN..=i8::MAX` not covered @@ -195,7 +195,7 @@ LL + i8::MIN..=i8::MAX => todo!() | error[E0004]: non-exhaustive patterns: `0_usize..` not covered - --> $DIR/empty-match.rs:63:24 + --> $DIR/empty-match.rs:62:24 | LL | match_guarded_arm!(0usize); | ^^^^^^ pattern `0_usize..` not covered @@ -209,7 +209,7 @@ LL + 0_usize.. => todo!() | error[E0004]: non-exhaustive patterns: `_` not covered - --> $DIR/empty-match.rs:64:24 + --> $DIR/empty-match.rs:63:24 | LL | match_guarded_arm!(0isize); | ^^^^^^ pattern `_` not covered @@ -223,13 +223,13 @@ LL + _ => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyStruct1` not covered - --> $DIR/empty-match.rs:65:24 + --> $DIR/empty-match.rs:64:24 | LL | match_guarded_arm!(NonEmptyStruct1); | ^^^^^^^^^^^^^^^ pattern `NonEmptyStruct1` not covered | note: `NonEmptyStruct1` defined here - --> $DIR/empty-match.rs:22:12 + --> $DIR/empty-match.rs:21:12 | LL | struct NonEmptyStruct1; | ^^^^^^^^^^^^^^^ @@ -242,13 +242,13 @@ LL + NonEmptyStruct1 => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyStruct2(_)` not covered - --> $DIR/empty-match.rs:66:24 + --> $DIR/empty-match.rs:65:24 | LL | match_guarded_arm!(NonEmptyStruct2(true)); | ^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyStruct2(_)` not covered | note: `NonEmptyStruct2` defined here - --> $DIR/empty-match.rs:23:12 + --> $DIR/empty-match.rs:22:12 | LL | struct NonEmptyStruct2(bool); | ^^^^^^^^^^^^^^^ @@ -261,13 +261,13 @@ LL + NonEmptyStruct2(_) => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyUnion1 { .. }` not covered - --> $DIR/empty-match.rs:67:24 + --> $DIR/empty-match.rs:66:24 | LL | match_guarded_arm!((NonEmptyUnion1 { foo: () })); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion1 { .. }` not covered | note: `NonEmptyUnion1` defined here - --> $DIR/empty-match.rs:24:11 + --> $DIR/empty-match.rs:23:11 | LL | union NonEmptyUnion1 { | ^^^^^^^^^^^^^^ @@ -280,13 +280,13 @@ LL + NonEmptyUnion1 { .. } => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyUnion2 { .. }` not covered - --> $DIR/empty-match.rs:68:24 + --> $DIR/empty-match.rs:67:24 | LL | match_guarded_arm!((NonEmptyUnion2 { foo: () })); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyUnion2 { .. }` not covered | note: `NonEmptyUnion2` defined here - --> $DIR/empty-match.rs:27:11 + --> $DIR/empty-match.rs:26:11 | LL | union NonEmptyUnion2 { | ^^^^^^^^^^^^^^ @@ -300,13 +300,13 @@ LL + NonEmptyUnion2 { .. } => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyEnum1::Foo(_)` not covered - --> $DIR/empty-match.rs:69:24 + --> $DIR/empty-match.rs:68:24 | LL | match_guarded_arm!(NonEmptyEnum1::Foo(true)); | ^^^^^^^^^^^^^^^^^^^^^^^^ pattern `NonEmptyEnum1::Foo(_)` not covered | note: `NonEmptyEnum1` defined here - --> $DIR/empty-match.rs:31:10 + --> $DIR/empty-match.rs:30:10 | LL | enum NonEmptyEnum1 { | ^^^^^^^^^^^^^ @@ -321,13 +321,13 @@ LL + NonEmptyEnum1::Foo(_) => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered - --> $DIR/empty-match.rs:70:24 + --> $DIR/empty-match.rs:69:24 | LL | match_guarded_arm!(NonEmptyEnum2::Foo(true)); | ^^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum2::Foo(_)` and `NonEmptyEnum2::Bar` not covered | note: `NonEmptyEnum2` defined here - --> $DIR/empty-match.rs:34:10 + --> $DIR/empty-match.rs:33:10 | LL | enum NonEmptyEnum2 { | ^^^^^^^^^^^^^ @@ -344,13 +344,13 @@ LL + NonEmptyEnum2::Foo(_) | NonEmptyEnum2::Bar => todo!() | error[E0004]: non-exhaustive patterns: `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered - --> $DIR/empty-match.rs:71:24 + --> $DIR/empty-match.rs:70:24 | LL | ...ded_arm!(NonEmptyEnum5::V1); | ^^^^^^^^^^^^^^^^^ patterns `NonEmptyEnum5::V1`, `NonEmptyEnum5::V2`, `NonEmptyEnum5::V3` and 2 more not covered | note: `NonEmptyEnum5` defined here - --> $DIR/empty-match.rs:38:10 + --> $DIR/empty-match.rs:37:10 | LL | enum NonEmptyEnum5 { | ^^^^^^^^^^^^^ @@ -373,7 +373,7 @@ LL + _ => todo!() | error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-match.rs:72:24 + --> $DIR/empty-match.rs:71:24 | LL | match_guarded_arm!(array0_of_empty); | ^^^^^^^^^^^^^^^ pattern `[]` not covered @@ -387,7 +387,7 @@ LL + [] => todo!() | error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-match.rs:73:24 + --> $DIR/empty-match.rs:72:24 | LL | match_guarded_arm!(arrayN_of_empty); | ^^^^^^^^^^^^^^^ pattern `[]` not covered diff --git a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr index 75a633cd49a3d..b070b4dad5649 100644 --- a/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/empty-types.exhaustive_patterns.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/empty-types.rs:47:9 + --> $DIR/empty-types.rs:46:9 | LL | _ => {} | ^------ @@ -9,13 +9,13 @@ LL | _ => {} | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types note: the lint level is defined here - --> $DIR/empty-types.rs:13:9 + --> $DIR/empty-types.rs:12:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:50:9 + --> $DIR/empty-types.rs:49:9 | LL | _x => {} | ^^------ @@ -26,7 +26,7 @@ LL | _x => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: type `&!` is non-empty - --> $DIR/empty-types.rs:54:11 + --> $DIR/empty-types.rs:53:11 | LL | match ref_never {} | ^^^^^^^^^ @@ -41,7 +41,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:68:9 + --> $DIR/empty-types.rs:67:9 | LL | (_, _) => {} | ^^^^^^------ @@ -52,7 +52,7 @@ LL | (_, _) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:74:9 + --> $DIR/empty-types.rs:73:9 | LL | _ => {} | ^------ @@ -63,7 +63,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:77:9 + --> $DIR/empty-types.rs:76:9 | LL | (_, _) => {} | ^^^^^^------ @@ -74,7 +74,7 @@ LL | (_, _) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:81:9 + --> $DIR/empty-types.rs:80:9 | LL | _ => {} | ^------ @@ -85,7 +85,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: `Ok(_)` not covered - --> $DIR/empty-types.rs:85:11 + --> $DIR/empty-types.rs:84:11 | LL | match res_u32_never {} | ^^^^^^^^^^^^^ pattern `Ok(_)` not covered @@ -104,7 +104,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:92:9 + --> $DIR/empty-types.rs:91:9 | LL | Err(_) => {} | ^^^^^^------ @@ -115,7 +115,7 @@ LL | Err(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:97:9 + --> $DIR/empty-types.rs:96:9 | LL | Err(_) => {} | ^^^^^^------ @@ -126,7 +126,7 @@ LL | Err(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered - --> $DIR/empty-types.rs:94:11 + --> $DIR/empty-types.rs:93:11 | LL | match res_u32_never { | ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered @@ -144,7 +144,7 @@ LL ~ Ok(1_u32..=u32::MAX) => todo!() | error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:100:9 + --> $DIR/empty-types.rs:99:9 | LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered @@ -158,7 +158,7 @@ LL | let Ok(_x) = res_u32_never.as_ref() else { todo!() }; | ++++++++++++++++ error: unreachable pattern - --> $DIR/empty-types.rs:110:9 + --> $DIR/empty-types.rs:109:9 | LL | _ => {} | ^------ @@ -169,7 +169,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:113:9 + --> $DIR/empty-types.rs:112:9 | LL | Ok(_) => {} | ^^^^^------ @@ -180,7 +180,7 @@ LL | Ok(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:116:9 + --> $DIR/empty-types.rs:115:9 | LL | Ok(_) => {} | ^^^^^------ @@ -191,7 +191,7 @@ LL | Ok(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:117:9 + --> $DIR/empty-types.rs:116:9 | LL | _ => {} | ^------ @@ -202,7 +202,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:120:9 + --> $DIR/empty-types.rs:119:9 | LL | Ok(_) => {} | ^^^^^------ @@ -213,7 +213,7 @@ LL | Ok(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:121:9 + --> $DIR/empty-types.rs:120:9 | LL | Err(_) => {} | ^^^^^^------ @@ -224,7 +224,7 @@ LL | Err(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:130:13 + --> $DIR/empty-types.rs:129:13 | LL | _ => {} | ^------ @@ -235,7 +235,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:133:13 + --> $DIR/empty-types.rs:132:13 | LL | _ if false => {} | ^--------------- @@ -246,7 +246,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:141:13 + --> $DIR/empty-types.rs:140:13 | LL | Some(_) => {} | ^^^^^^^------ @@ -257,7 +257,7 @@ LL | Some(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:145:13 + --> $DIR/empty-types.rs:144:13 | LL | None => {} | ---- matches all the relevant values @@ -265,7 +265,7 @@ LL | _ => {} | ^ no value can reach this error: unreachable pattern - --> $DIR/empty-types.rs:197:13 + --> $DIR/empty-types.rs:196:13 | LL | _ => {} | ^------ @@ -276,7 +276,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:202:13 + --> $DIR/empty-types.rs:201:13 | LL | _ => {} | ^------ @@ -287,7 +287,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:207:13 + --> $DIR/empty-types.rs:206:13 | LL | _ => {} | ^------ @@ -298,7 +298,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:212:13 + --> $DIR/empty-types.rs:211:13 | LL | _ => {} | ^------ @@ -309,7 +309,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:218:13 + --> $DIR/empty-types.rs:217:13 | LL | _ => {} | ^------ @@ -320,7 +320,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:279:9 + --> $DIR/empty-types.rs:278:9 | LL | _ => {} | ^------ @@ -331,7 +331,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:282:9 + --> $DIR/empty-types.rs:281:9 | LL | (_, _) => {} | ^^^^^^------ @@ -342,7 +342,7 @@ LL | (_, _) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:285:9 + --> $DIR/empty-types.rs:284:9 | LL | Ok(_) => {} | ^^^^^------ @@ -353,7 +353,7 @@ LL | Ok(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:286:9 + --> $DIR/empty-types.rs:285:9 | LL | Err(_) => {} | ^^^^^^------ @@ -364,7 +364,7 @@ LL | Err(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty - --> $DIR/empty-types.rs:325:11 + --> $DIR/empty-types.rs:324:11 | LL | match slice_never {} | ^^^^^^^^^^^ @@ -378,7 +378,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: `&[]` not covered - --> $DIR/empty-types.rs:336:11 + --> $DIR/empty-types.rs:335:11 | LL | match slice_never { | ^^^^^^^^^^^ pattern `&[]` not covered @@ -391,7 +391,7 @@ LL + &[] => todo!() | error[E0004]: non-exhaustive patterns: `&[]` not covered - --> $DIR/empty-types.rs:350:11 + --> $DIR/empty-types.rs:349:11 | LL | match slice_never { | ^^^^^^^^^^^ pattern `&[]` not covered @@ -405,7 +405,7 @@ LL + &[] => todo!() | error[E0004]: non-exhaustive patterns: type `[!]` is non-empty - --> $DIR/empty-types.rs:357:11 + --> $DIR/empty-types.rs:356:11 | LL | match *slice_never {} | ^^^^^^^^^^^^ @@ -419,7 +419,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:366:9 + --> $DIR/empty-types.rs:365:9 | LL | _ => {} | ^------ @@ -430,7 +430,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:369:9 + --> $DIR/empty-types.rs:368:9 | LL | [_, _, _] => {} | ^^^^^^^^^------ @@ -441,7 +441,7 @@ LL | [_, _, _] => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:372:9 + --> $DIR/empty-types.rs:371:9 | LL | [_, ..] => {} | ^^^^^^^------ @@ -452,7 +452,7 @@ LL | [_, ..] => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty - --> $DIR/empty-types.rs:386:11 + --> $DIR/empty-types.rs:385:11 | LL | match array_0_never {} | ^^^^^^^^^^^^^ @@ -466,7 +466,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:393:9 + --> $DIR/empty-types.rs:392:9 | LL | [] => {} | -- matches all the relevant values @@ -474,7 +474,7 @@ LL | _ => {} | ^ no value can reach this error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-types.rs:395:11 + --> $DIR/empty-types.rs:394:11 | LL | match array_0_never { | ^^^^^^^^^^^^^ pattern `[]` not covered @@ -488,7 +488,7 @@ LL + [] => todo!() | error: unreachable pattern - --> $DIR/empty-types.rs:414:9 + --> $DIR/empty-types.rs:413:9 | LL | Some(_) => {} | ^^^^^^^------ @@ -499,7 +499,7 @@ LL | Some(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:419:9 + --> $DIR/empty-types.rs:418:9 | LL | Some(_a) => {} | ^^^^^^^^------ @@ -510,7 +510,7 @@ LL | Some(_a) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:424:9 + --> $DIR/empty-types.rs:423:9 | LL | None => {} | ---- matches all the relevant values @@ -519,7 +519,7 @@ LL | _ => {} | ^ no value can reach this error: unreachable pattern - --> $DIR/empty-types.rs:429:9 + --> $DIR/empty-types.rs:428:9 | LL | None => {} | ---- matches all the relevant values @@ -528,7 +528,7 @@ LL | _a => {} | ^^ no value can reach this error: unreachable pattern - --> $DIR/empty-types.rs:601:9 + --> $DIR/empty-types.rs:600:9 | LL | _ => {} | ^------ @@ -539,7 +539,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:604:9 + --> $DIR/empty-types.rs:603:9 | LL | _x => {} | ^^------ @@ -550,7 +550,7 @@ LL | _x => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:607:9 + --> $DIR/empty-types.rs:606:9 | LL | _ if false => {} | ^--------------- @@ -561,7 +561,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:610:9 + --> $DIR/empty-types.rs:609:9 | LL | _x if false => {} | ^^--------------- diff --git a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr index 68a1bebf6b132..fc5c15af9077e 100644 --- a/tests/ui/pattern/usefulness/empty-types.never_pats.stderr +++ b/tests/ui/pattern/usefulness/empty-types.never_pats.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/empty-types.rs:47:9 + --> $DIR/empty-types.rs:46:9 | LL | _ => {} | ^------ @@ -9,13 +9,13 @@ LL | _ => {} | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types note: the lint level is defined here - --> $DIR/empty-types.rs:13:9 + --> $DIR/empty-types.rs:12:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:50:9 + --> $DIR/empty-types.rs:49:9 | LL | _x => {} | ^^------ @@ -26,7 +26,7 @@ LL | _x => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: type `&!` is non-empty - --> $DIR/empty-types.rs:54:11 + --> $DIR/empty-types.rs:53:11 | LL | match ref_never {} | ^^^^^^^^^ @@ -41,7 +41,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:81:9 + --> $DIR/empty-types.rs:80:9 | LL | _ => {} | ^------ @@ -52,7 +52,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: `Ok(_)` not covered - --> $DIR/empty-types.rs:85:11 + --> $DIR/empty-types.rs:84:11 | LL | match res_u32_never {} | ^^^^^^^^^^^^^ pattern `Ok(_)` not covered @@ -71,7 +71,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered - --> $DIR/empty-types.rs:94:11 + --> $DIR/empty-types.rs:93:11 | LL | match res_u32_never { | ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered @@ -89,7 +89,7 @@ LL ~ Ok(1_u32..=u32::MAX) => todo!() | error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:100:9 + --> $DIR/empty-types.rs:99:9 | LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered @@ -103,7 +103,7 @@ LL | let Ok(_x) = res_u32_never.as_ref() else { todo!() }; | ++++++++++++++++ error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:104:9 + --> $DIR/empty-types.rs:103:9 | LL | let Ok(_x) = &res_u32_never; | ^^^^^^ pattern `&Err(!)` not covered @@ -117,7 +117,7 @@ LL | let Ok(_x) = &res_u32_never else { todo!() }; | ++++++++++++++++ error: unreachable pattern - --> $DIR/empty-types.rs:130:13 + --> $DIR/empty-types.rs:129:13 | LL | _ => {} | ^------ @@ -128,7 +128,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:133:13 + --> $DIR/empty-types.rs:132:13 | LL | _ if false => {} | ^--------------- @@ -139,7 +139,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: `Some(!)` not covered - --> $DIR/empty-types.rs:154:15 + --> $DIR/empty-types.rs:153:15 | LL | match *ref_opt_void { | ^^^^^^^^^^^^^ pattern `Some(!)` not covered @@ -158,7 +158,7 @@ LL + Some(!) | error: unreachable pattern - --> $DIR/empty-types.rs:197:13 + --> $DIR/empty-types.rs:196:13 | LL | _ => {} | ^------ @@ -169,7 +169,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:202:13 + --> $DIR/empty-types.rs:201:13 | LL | _ => {} | ^------ @@ -180,7 +180,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:207:13 + --> $DIR/empty-types.rs:206:13 | LL | _ => {} | ^------ @@ -191,7 +191,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:212:13 + --> $DIR/empty-types.rs:211:13 | LL | _ => {} | ^------ @@ -202,7 +202,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:218:13 + --> $DIR/empty-types.rs:217:13 | LL | _ => {} | ^------ @@ -213,7 +213,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:279:9 + --> $DIR/empty-types.rs:278:9 | LL | _ => {} | ^------ @@ -224,7 +224,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:295:13 + --> $DIR/empty-types.rs:294:13 | LL | let Ok(_) = *ptr_result_never_err; | ^^^^^ pattern `Err(!)` not covered @@ -238,7 +238,7 @@ LL | if let Ok(_) = *ptr_result_never_err { todo!() }; | ++ +++++++++++ error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty - --> $DIR/empty-types.rs:314:11 + --> $DIR/empty-types.rs:313:11 | LL | match *x {} | ^^ @@ -252,7 +252,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty - --> $DIR/empty-types.rs:316:11 + --> $DIR/empty-types.rs:315:11 | LL | match *x {} | ^^ @@ -266,7 +266,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: `Ok(!)` and `Err(!)` not covered - --> $DIR/empty-types.rs:318:11 + --> $DIR/empty-types.rs:317:11 | LL | match *x {} | ^^ patterns `Ok(!)` and `Err(!)` not covered @@ -288,7 +288,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty - --> $DIR/empty-types.rs:320:11 + --> $DIR/empty-types.rs:319:11 | LL | match *x {} | ^^ @@ -302,7 +302,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty - --> $DIR/empty-types.rs:325:11 + --> $DIR/empty-types.rs:324:11 | LL | match slice_never {} | ^^^^^^^^^^^ @@ -316,7 +316,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: `&[!, ..]` not covered - --> $DIR/empty-types.rs:327:11 + --> $DIR/empty-types.rs:326:11 | LL | match slice_never { | ^^^^^^^^^^^ pattern `&[!, ..]` not covered @@ -330,7 +330,7 @@ LL + &[!, ..] | error[E0004]: non-exhaustive patterns: `&[]`, `&[!]` and `&[!, !]` not covered - --> $DIR/empty-types.rs:336:11 + --> $DIR/empty-types.rs:335:11 | LL | match slice_never { | ^^^^^^^^^^^ patterns `&[]`, `&[!]` and `&[!, !]` not covered @@ -343,7 +343,7 @@ LL + &[] | &[!] | &[!, !] => todo!() | error[E0004]: non-exhaustive patterns: `&[]` and `&[!, ..]` not covered - --> $DIR/empty-types.rs:350:11 + --> $DIR/empty-types.rs:349:11 | LL | match slice_never { | ^^^^^^^^^^^ patterns `&[]` and `&[!, ..]` not covered @@ -357,7 +357,7 @@ LL + &[] | &[!, ..] => todo!() | error[E0004]: non-exhaustive patterns: type `[!]` is non-empty - --> $DIR/empty-types.rs:357:11 + --> $DIR/empty-types.rs:356:11 | LL | match *slice_never {} | ^^^^^^^^^^^^ @@ -371,7 +371,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty - --> $DIR/empty-types.rs:386:11 + --> $DIR/empty-types.rs:385:11 | LL | match array_0_never {} | ^^^^^^^^^^^^^ @@ -385,7 +385,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:393:9 + --> $DIR/empty-types.rs:392:9 | LL | [] => {} | -- matches all the relevant values @@ -393,7 +393,7 @@ LL | _ => {} | ^ no value can reach this error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-types.rs:395:11 + --> $DIR/empty-types.rs:394:11 | LL | match array_0_never { | ^^^^^^^^^^^^^ pattern `[]` not covered @@ -407,7 +407,7 @@ LL + [] => todo!() | error[E0004]: non-exhaustive patterns: `&Some(!)` not covered - --> $DIR/empty-types.rs:449:11 + --> $DIR/empty-types.rs:448:11 | LL | match ref_opt_never { | ^^^^^^^^^^^^^ pattern `&Some(!)` not covered @@ -426,7 +426,7 @@ LL + &Some(!) | error[E0004]: non-exhaustive patterns: `Some(!)` not covered - --> $DIR/empty-types.rs:490:11 + --> $DIR/empty-types.rs:489:11 | LL | match *ref_opt_never { | ^^^^^^^^^^^^^^ pattern `Some(!)` not covered @@ -445,7 +445,7 @@ LL + Some(!) | error[E0004]: non-exhaustive patterns: `Err(!)` not covered - --> $DIR/empty-types.rs:538:11 + --> $DIR/empty-types.rs:537:11 | LL | match *ref_res_never { | ^^^^^^^^^^^^^^ pattern `Err(!)` not covered @@ -464,7 +464,7 @@ LL + Err(!) | error[E0004]: non-exhaustive patterns: `Err(!)` not covered - --> $DIR/empty-types.rs:549:11 + --> $DIR/empty-types.rs:548:11 | LL | match *ref_res_never { | ^^^^^^^^^^^^^^ pattern `Err(!)` not covered @@ -483,7 +483,7 @@ LL + Err(!) | error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty - --> $DIR/empty-types.rs:568:11 + --> $DIR/empty-types.rs:567:11 | LL | match *ref_tuple_half_never {} | ^^^^^^^^^^^^^^^^^^^^^ @@ -497,7 +497,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:601:9 + --> $DIR/empty-types.rs:600:9 | LL | _ => {} | ^------ @@ -508,7 +508,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:604:9 + --> $DIR/empty-types.rs:603:9 | LL | _x => {} | ^^------ @@ -519,7 +519,7 @@ LL | _x => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:607:9 + --> $DIR/empty-types.rs:606:9 | LL | _ if false => {} | ^--------------- @@ -530,7 +530,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:610:9 + --> $DIR/empty-types.rs:609:9 | LL | _x if false => {} | ^^--------------- @@ -541,7 +541,7 @@ LL | _x if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: `&!` not covered - --> $DIR/empty-types.rs:635:11 + --> $DIR/empty-types.rs:634:11 | LL | match ref_never { | ^^^^^^^^^ pattern `&!` not covered @@ -557,7 +557,7 @@ LL + &! | error[E0004]: non-exhaustive patterns: `Ok(!)` not covered - --> $DIR/empty-types.rs:651:11 + --> $DIR/empty-types.rs:650:11 | LL | match *ref_result_never { | ^^^^^^^^^^^^^^^^^ pattern `Ok(!)` not covered @@ -577,7 +577,7 @@ LL + Ok(!) | error[E0004]: non-exhaustive patterns: `Some(!)` not covered - --> $DIR/empty-types.rs:671:11 + --> $DIR/empty-types.rs:670:11 | LL | match *x { | ^^ pattern `Some(!)` not covered diff --git a/tests/ui/pattern/usefulness/empty-types.normal.stderr b/tests/ui/pattern/usefulness/empty-types.normal.stderr index 320959534e522..160d7987fd155 100644 --- a/tests/ui/pattern/usefulness/empty-types.normal.stderr +++ b/tests/ui/pattern/usefulness/empty-types.normal.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/empty-types.rs:47:9 + --> $DIR/empty-types.rs:46:9 | LL | _ => {} | ^------ @@ -9,13 +9,13 @@ LL | _ => {} | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types note: the lint level is defined here - --> $DIR/empty-types.rs:13:9 + --> $DIR/empty-types.rs:12:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/empty-types.rs:50:9 + --> $DIR/empty-types.rs:49:9 | LL | _x => {} | ^^------ @@ -26,7 +26,7 @@ LL | _x => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: type `&!` is non-empty - --> $DIR/empty-types.rs:54:11 + --> $DIR/empty-types.rs:53:11 | LL | match ref_never {} | ^^^^^^^^^ @@ -41,7 +41,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:81:9 + --> $DIR/empty-types.rs:80:9 | LL | _ => {} | ^------ @@ -52,7 +52,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: `Ok(_)` not covered - --> $DIR/empty-types.rs:85:11 + --> $DIR/empty-types.rs:84:11 | LL | match res_u32_never {} | ^^^^^^^^^^^^^ pattern `Ok(_)` not covered @@ -71,7 +71,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: `Ok(1_u32..=u32::MAX)` not covered - --> $DIR/empty-types.rs:94:11 + --> $DIR/empty-types.rs:93:11 | LL | match res_u32_never { | ^^^^^^^^^^^^^ pattern `Ok(1_u32..=u32::MAX)` not covered @@ -89,7 +89,7 @@ LL ~ Ok(1_u32..=u32::MAX) => todo!() | error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:100:9 + --> $DIR/empty-types.rs:99:9 | LL | let Ok(_x) = res_u32_never.as_ref(); | ^^^^^^ pattern `Err(_)` not covered @@ -103,7 +103,7 @@ LL | let Ok(_x) = res_u32_never.as_ref() else { todo!() }; | ++++++++++++++++ error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:104:9 + --> $DIR/empty-types.rs:103:9 | LL | let Ok(_x) = &res_u32_never; | ^^^^^^ pattern `&Err(_)` not covered @@ -117,7 +117,7 @@ LL | let Ok(_x) = &res_u32_never else { todo!() }; | ++++++++++++++++ error: unreachable pattern - --> $DIR/empty-types.rs:130:13 + --> $DIR/empty-types.rs:129:13 | LL | _ => {} | ^------ @@ -128,7 +128,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:133:13 + --> $DIR/empty-types.rs:132:13 | LL | _ if false => {} | ^--------------- @@ -139,7 +139,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:154:15 + --> $DIR/empty-types.rs:153:15 | LL | match *ref_opt_void { | ^^^^^^^^^^^^^ pattern `Some(_)` not covered @@ -158,7 +158,7 @@ LL + Some(_) => todo!() | error: unreachable pattern - --> $DIR/empty-types.rs:197:13 + --> $DIR/empty-types.rs:196:13 | LL | _ => {} | ^------ @@ -169,7 +169,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:202:13 + --> $DIR/empty-types.rs:201:13 | LL | _ => {} | ^------ @@ -180,7 +180,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:207:13 + --> $DIR/empty-types.rs:206:13 | LL | _ => {} | ^------ @@ -191,7 +191,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:212:13 + --> $DIR/empty-types.rs:211:13 | LL | _ => {} | ^------ @@ -202,7 +202,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:218:13 + --> $DIR/empty-types.rs:217:13 | LL | _ => {} | ^------ @@ -213,7 +213,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:279:9 + --> $DIR/empty-types.rs:278:9 | LL | _ => {} | ^------ @@ -224,7 +224,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0005]: refutable pattern in local binding - --> $DIR/empty-types.rs:295:13 + --> $DIR/empty-types.rs:294:13 | LL | let Ok(_) = *ptr_result_never_err; | ^^^^^ pattern `Err(_)` not covered @@ -238,7 +238,7 @@ LL | if let Ok(_) = *ptr_result_never_err { todo!() }; | ++ +++++++++++ error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty - --> $DIR/empty-types.rs:314:11 + --> $DIR/empty-types.rs:313:11 | LL | match *x {} | ^^ @@ -252,7 +252,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `(!, !)` is non-empty - --> $DIR/empty-types.rs:316:11 + --> $DIR/empty-types.rs:315:11 | LL | match *x {} | ^^ @@ -266,7 +266,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: `Ok(_)` and `Err(_)` not covered - --> $DIR/empty-types.rs:318:11 + --> $DIR/empty-types.rs:317:11 | LL | match *x {} | ^^ patterns `Ok(_)` and `Err(_)` not covered @@ -288,7 +288,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `[!; 3]` is non-empty - --> $DIR/empty-types.rs:320:11 + --> $DIR/empty-types.rs:319:11 | LL | match *x {} | ^^ @@ -302,7 +302,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `&[!]` is non-empty - --> $DIR/empty-types.rs:325:11 + --> $DIR/empty-types.rs:324:11 | LL | match slice_never {} | ^^^^^^^^^^^ @@ -316,7 +316,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered - --> $DIR/empty-types.rs:327:11 + --> $DIR/empty-types.rs:326:11 | LL | match slice_never { | ^^^^^^^^^^^ pattern `&[_, ..]` not covered @@ -330,7 +330,7 @@ LL + &[_, ..] => todo!() | error[E0004]: non-exhaustive patterns: `&[]`, `&[_]` and `&[_, _]` not covered - --> $DIR/empty-types.rs:336:11 + --> $DIR/empty-types.rs:335:11 | LL | match slice_never { | ^^^^^^^^^^^ patterns `&[]`, `&[_]` and `&[_, _]` not covered @@ -343,7 +343,7 @@ LL + &[] | &[_] | &[_, _] => todo!() | error[E0004]: non-exhaustive patterns: `&[]` and `&[_, ..]` not covered - --> $DIR/empty-types.rs:350:11 + --> $DIR/empty-types.rs:349:11 | LL | match slice_never { | ^^^^^^^^^^^ patterns `&[]` and `&[_, ..]` not covered @@ -357,7 +357,7 @@ LL + &[] | &[_, ..] => todo!() | error[E0004]: non-exhaustive patterns: type `[!]` is non-empty - --> $DIR/empty-types.rs:357:11 + --> $DIR/empty-types.rs:356:11 | LL | match *slice_never {} | ^^^^^^^^^^^^ @@ -371,7 +371,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `[!; 0]` is non-empty - --> $DIR/empty-types.rs:386:11 + --> $DIR/empty-types.rs:385:11 | LL | match array_0_never {} | ^^^^^^^^^^^^^ @@ -385,7 +385,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:393:9 + --> $DIR/empty-types.rs:392:9 | LL | [] => {} | -- matches all the relevant values @@ -393,7 +393,7 @@ LL | _ => {} | ^ no value can reach this error[E0004]: non-exhaustive patterns: `[]` not covered - --> $DIR/empty-types.rs:395:11 + --> $DIR/empty-types.rs:394:11 | LL | match array_0_never { | ^^^^^^^^^^^^^ pattern `[]` not covered @@ -407,7 +407,7 @@ LL + [] => todo!() | error[E0004]: non-exhaustive patterns: `&Some(_)` not covered - --> $DIR/empty-types.rs:449:11 + --> $DIR/empty-types.rs:448:11 | LL | match ref_opt_never { | ^^^^^^^^^^^^^ pattern `&Some(_)` not covered @@ -426,7 +426,7 @@ LL + &Some(_) => todo!() | error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:490:11 + --> $DIR/empty-types.rs:489:11 | LL | match *ref_opt_never { | ^^^^^^^^^^^^^^ pattern `Some(_)` not covered @@ -445,7 +445,7 @@ LL + Some(_) => todo!() | error[E0004]: non-exhaustive patterns: `Err(_)` not covered - --> $DIR/empty-types.rs:538:11 + --> $DIR/empty-types.rs:537:11 | LL | match *ref_res_never { | ^^^^^^^^^^^^^^ pattern `Err(_)` not covered @@ -464,7 +464,7 @@ LL + Err(_) => todo!() | error[E0004]: non-exhaustive patterns: `Err(_)` not covered - --> $DIR/empty-types.rs:549:11 + --> $DIR/empty-types.rs:548:11 | LL | match *ref_res_never { | ^^^^^^^^^^^^^^ pattern `Err(_)` not covered @@ -483,7 +483,7 @@ LL + Err(_) => todo!() | error[E0004]: non-exhaustive patterns: type `(u32, !)` is non-empty - --> $DIR/empty-types.rs:568:11 + --> $DIR/empty-types.rs:567:11 | LL | match *ref_tuple_half_never {} | ^^^^^^^^^^^^^^^^^^^^^ @@ -497,7 +497,7 @@ LL ~ } | error: unreachable pattern - --> $DIR/empty-types.rs:601:9 + --> $DIR/empty-types.rs:600:9 | LL | _ => {} | ^------ @@ -508,7 +508,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:604:9 + --> $DIR/empty-types.rs:603:9 | LL | _x => {} | ^^------ @@ -519,7 +519,7 @@ LL | _x => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:607:9 + --> $DIR/empty-types.rs:606:9 | LL | _ if false => {} | ^--------------- @@ -530,7 +530,7 @@ LL | _ if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/empty-types.rs:610:9 + --> $DIR/empty-types.rs:609:9 | LL | _x if false => {} | ^^--------------- @@ -541,7 +541,7 @@ LL | _x if false => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: `&_` not covered - --> $DIR/empty-types.rs:635:11 + --> $DIR/empty-types.rs:634:11 | LL | match ref_never { | ^^^^^^^^^ pattern `&_` not covered @@ -557,7 +557,7 @@ LL + &_ => todo!() | error[E0004]: non-exhaustive patterns: `Ok(_)` not covered - --> $DIR/empty-types.rs:651:11 + --> $DIR/empty-types.rs:650:11 | LL | match *ref_result_never { | ^^^^^^^^^^^^^^^^^ pattern `Ok(_)` not covered @@ -577,7 +577,7 @@ LL + Ok(_) => todo!() | error[E0004]: non-exhaustive patterns: `Some(_)` not covered - --> $DIR/empty-types.rs:671:11 + --> $DIR/empty-types.rs:670:11 | LL | match *x { | ^^ pattern `Some(_)` not covered diff --git a/tests/ui/pattern/usefulness/explain-unreachable-pats.stderr b/tests/ui/pattern/usefulness/explain-unreachable-pats.stderr index 8651be2055f53..a18454b2cf95a 100644 --- a/tests/ui/pattern/usefulness/explain-unreachable-pats.stderr +++ b/tests/ui/pattern/usefulness/explain-unreachable-pats.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:11:9 + --> $DIR/explain-unreachable-pats.rs:10:9 | LL | (1 | 2,) => {} | -------- matches all the relevant values @@ -8,19 +8,19 @@ LL | (2,) => {} | ^^^^ no value can reach this | note: the lint level is defined here - --> $DIR/explain-unreachable-pats.rs:3:9 + --> $DIR/explain-unreachable-pats.rs:2:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:22:9 + --> $DIR/explain-unreachable-pats.rs:21:9 | LL | (1 | 2,) => {} | ^^^^^^^^ no value can reach this | note: multiple earlier patterns match some of the same values - --> $DIR/explain-unreachable-pats.rs:22:9 + --> $DIR/explain-unreachable-pats.rs:21:9 | LL | (1,) => {} | ---- matches some of the same values @@ -32,13 +32,13 @@ LL | (1 | 2,) => {} | ^^^^^^^^ collectively making this unreachable error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:41:9 + --> $DIR/explain-unreachable-pats.rs:40:9 | LL | 1 ..= 6 => {} | ^^^^^^^ no value can reach this | note: multiple earlier patterns match some of the same values - --> $DIR/explain-unreachable-pats.rs:41:9 + --> $DIR/explain-unreachable-pats.rs:40:9 | LL | 1 => {} | - matches some of the same values @@ -56,7 +56,7 @@ LL | 1 ..= 6 => {} | ^^^^^^^ ...and 2 other patterns collectively make this unreachable error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:52:9 + --> $DIR/explain-unreachable-pats.rs:51:9 | LL | Err(_) => {} | ^^^^^^------ @@ -67,7 +67,7 @@ LL | Err(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:66:9 + --> $DIR/explain-unreachable-pats.rs:65:9 | LL | (Err(_), Err(_)) => {} | ^^^^^^^^^^^^^^^^------ @@ -78,7 +78,7 @@ LL | (Err(_), Err(_)) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:73:9 + --> $DIR/explain-unreachable-pats.rs:72:9 | LL | (Err(_), Err(_)) => {} | ^^^^^^^^^^^^^^^^------ @@ -89,7 +89,7 @@ LL | (Err(_), Err(_)) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:83:11 + --> $DIR/explain-unreachable-pats.rs:82:11 | LL | if let (0 | - matches all the relevant values @@ -98,13 +98,13 @@ LL | | 0, _) = (0, 0) {} | ^ no value can reach this error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:93:9 + --> $DIR/explain-unreachable-pats.rs:92:9 | LL | (_, true) => {} | ^^^^^^^^^ no value can reach this | note: multiple earlier patterns match some of the same values - --> $DIR/explain-unreachable-pats.rs:93:9 + --> $DIR/explain-unreachable-pats.rs:92:9 | LL | (true, _) => {} | --------- matches some of the same values @@ -116,7 +116,7 @@ LL | (_, true) => {} | ^^^^^^^^^ collectively making this unreachable error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:106:9 + --> $DIR/explain-unreachable-pats.rs:105:9 | LL | (true, _) => {} | --------- matches all the relevant values @@ -125,7 +125,7 @@ LL | (true, true) => {} | ^^^^^^^^^^^^ no value can reach this error: unreachable pattern - --> $DIR/explain-unreachable-pats.rs:118:9 + --> $DIR/explain-unreachable-pats.rs:117:9 | LL | (_, true, 0..10) => {} | ---------------- matches all the relevant values diff --git a/tests/ui/pattern/usefulness/impl-trait.stderr b/tests/ui/pattern/usefulness/impl-trait.stderr index 62045151968e2..6efa783cf63cb 100644 --- a/tests/ui/pattern/usefulness/impl-trait.stderr +++ b/tests/ui/pattern/usefulness/impl-trait.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/impl-trait.rs:17:13 + --> $DIR/impl-trait.rs:16:13 | LL | _ => {} | ^------ @@ -9,13 +9,13 @@ LL | _ => {} | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types note: the lint level is defined here - --> $DIR/impl-trait.rs:5:9 + --> $DIR/impl-trait.rs:4:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/impl-trait.rs:32:13 + --> $DIR/impl-trait.rs:31:13 | LL | _ => {} | ^------ @@ -26,7 +26,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:46:13 + --> $DIR/impl-trait.rs:45:13 | LL | Some(_) => {} | ^^^^^^^------ @@ -37,7 +37,7 @@ LL | Some(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:50:13 + --> $DIR/impl-trait.rs:49:13 | LL | None => {} | ---- matches all the relevant values @@ -45,7 +45,7 @@ LL | _ => {} | ^ no value can reach this error: unreachable pattern - --> $DIR/impl-trait.rs:60:13 + --> $DIR/impl-trait.rs:59:13 | LL | Some(_) => {} | ^^^^^^^------ @@ -56,7 +56,7 @@ LL | Some(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:64:13 + --> $DIR/impl-trait.rs:63:13 | LL | None => {} | ---- matches all the relevant values @@ -64,7 +64,7 @@ LL | _ => {} | ^ no value can reach this error: unreachable pattern - --> $DIR/impl-trait.rs:77:9 + --> $DIR/impl-trait.rs:76:9 | LL | _ => {} | ^------ @@ -75,7 +75,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:87:9 + --> $DIR/impl-trait.rs:86:9 | LL | _ => {} | - matches any value @@ -83,7 +83,7 @@ LL | Some((a, b)) => {} | ^^^^^^^^^^^^ no value can reach this error: unreachable pattern - --> $DIR/impl-trait.rs:96:13 + --> $DIR/impl-trait.rs:95:13 | LL | _ => {} | ^------ @@ -94,7 +94,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:108:9 + --> $DIR/impl-trait.rs:107:9 | LL | Some((a, b)) => {} | ------------ matches all the relevant values @@ -102,7 +102,7 @@ LL | Some((mut x, mut y)) => { | ^^^^^^^^^^^^^^^^^^^^ no value can reach this error: unreachable pattern - --> $DIR/impl-trait.rs:128:13 + --> $DIR/impl-trait.rs:127:13 | LL | _ => {} | - matches any value @@ -110,7 +110,7 @@ LL | Rec { n: 0, w: Some(Rec { n: 0, w: _ }) } => {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no value can reach this error: unreachable pattern - --> $DIR/impl-trait.rs:143:13 + --> $DIR/impl-trait.rs:142:13 | LL | _ => {} | ^------ @@ -121,7 +121,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:157:13 + --> $DIR/impl-trait.rs:156:13 | LL | _ => {} | ^------ @@ -132,7 +132,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: type `impl Copy` is non-empty - --> $DIR/impl-trait.rs:23:11 + --> $DIR/impl-trait.rs:22:11 | LL | match return_never_rpit(x) {} | ^^^^^^^^^^^^^^^^^^^^ @@ -146,7 +146,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `T` is non-empty - --> $DIR/impl-trait.rs:38:11 + --> $DIR/impl-trait.rs:37:11 | LL | match return_never_tait(x) {} | ^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr index 463e104f970c4..fef7b67ad7ae5 100644 --- a/tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/match-privately-empty.exhaustive_patterns.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered - --> $DIR/match-privately-empty.rs:14:11 + --> $DIR/match-privately-empty.rs:13:11 | LL | match private::DATA { | ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered diff --git a/tests/ui/pattern/usefulness/match-privately-empty.normal.stderr b/tests/ui/pattern/usefulness/match-privately-empty.normal.stderr index 463e104f970c4..fef7b67ad7ae5 100644 --- a/tests/ui/pattern/usefulness/match-privately-empty.normal.stderr +++ b/tests/ui/pattern/usefulness/match-privately-empty.normal.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not covered - --> $DIR/match-privately-empty.rs:14:11 + --> $DIR/match-privately-empty.rs:13:11 | LL | match private::DATA { | ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered diff --git a/tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr b/tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr index c4fcd67cfdbdc..f3b7fb0468cb3 100644 --- a/tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr +++ b/tests/ui/pattern/usefulness/slice_of_empty.exhaustive_patterns.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: `&[]` not covered - --> $DIR/slice_of_empty.rs:20:11 + --> $DIR/slice_of_empty.rs:19:11 | LL | match nevers { | ^^^^^^ pattern `&[]` not covered diff --git a/tests/ui/pattern/usefulness/slice_of_empty.normal.stderr b/tests/ui/pattern/usefulness/slice_of_empty.normal.stderr index c9afd1bfc9016..0b8125eba65d4 100644 --- a/tests/ui/pattern/usefulness/slice_of_empty.normal.stderr +++ b/tests/ui/pattern/usefulness/slice_of_empty.normal.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered - --> $DIR/slice_of_empty.rs:9:11 + --> $DIR/slice_of_empty.rs:8:11 | LL | match nevers { | ^^^^^^ pattern `&[_, ..]` not covered @@ -13,7 +13,7 @@ LL ~ &[_, ..] => todo!(), | error[E0004]: non-exhaustive patterns: `&[]` and `&[_, _, ..]` not covered - --> $DIR/slice_of_empty.rs:20:11 + --> $DIR/slice_of_empty.rs:19:11 | LL | match nevers { | ^^^^^^ patterns `&[]` and `&[_, _, ..]` not covered diff --git a/tests/ui/raw-ref-op/never-place-isnt-diverging.stderr b/tests/ui/raw-ref-op/never-place-isnt-diverging.stderr index 0a8340545eb78..39c37b3cf70db 100644 --- a/tests/ui/raw-ref-op/never-place-isnt-diverging.stderr +++ b/tests/ui/raw-ref-op/never-place-isnt-diverging.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/never-place-isnt-diverging.rs:4:5 + --> $DIR/never-place-isnt-diverging.rs:2:5 | LL | fn make_up_a_value() -> T { | - expected this type parameter @@ -15,7 +15,7 @@ LL | | } found unit type `()` error[E0308]: mismatched types - --> $DIR/never-place-isnt-diverging.rs:17:9 + --> $DIR/never-place-isnt-diverging.rs:15:9 | LL | fn make_up_a_pointer() -> *const T { | - -------- expected `*const T` because of return type diff --git a/tests/ui/reachable/expr_add.stderr b/tests/ui/reachable/expr_add.stderr index f4a56fcbcb2cc..a54e3275334ea 100644 --- a/tests/ui/reachable/expr_add.stderr +++ b/tests/ui/reachable/expr_add.stderr @@ -1,5 +1,5 @@ error: unreachable expression - --> $DIR/expr_add.rs:17:13 + --> $DIR/expr_add.rs:16:13 | LL | let x = Foo + return; | ^^^^^^------ @@ -8,7 +8,7 @@ LL | let x = Foo + return; | unreachable expression | note: the lint level is defined here - --> $DIR/expr_add.rs:3:9 + --> $DIR/expr_add.rs:2:9 | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/reachable/expr_assign.stderr b/tests/ui/reachable/expr_assign.stderr index cfbbe04db769d..c1a918ffb9f52 100644 --- a/tests/ui/reachable/expr_assign.stderr +++ b/tests/ui/reachable/expr_assign.stderr @@ -1,5 +1,5 @@ error: unreachable expression - --> $DIR/expr_assign.rs:10:5 + --> $DIR/expr_assign.rs:9:5 | LL | x = return; | ^^^^------ @@ -8,13 +8,13 @@ LL | x = return; | unreachable expression | note: the lint level is defined here - --> $DIR/expr_assign.rs:5:9 + --> $DIR/expr_assign.rs:4:9 | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ error: unreachable expression - --> $DIR/expr_assign.rs:20:9 + --> $DIR/expr_assign.rs:19:9 | LL | *p = return; | ^^^^^------ @@ -23,7 +23,7 @@ LL | *p = return; | unreachable expression error: unreachable expression - --> $DIR/expr_assign.rs:26:15 + --> $DIR/expr_assign.rs:25:15 | LL | *{return; &mut i} = 22; | ------ ^^^^^^ unreachable expression diff --git a/tests/ui/reachable/expr_call.stderr b/tests/ui/reachable/expr_call.stderr index a5ad9a329f06e..2d7675bbadc40 100644 --- a/tests/ui/reachable/expr_call.stderr +++ b/tests/ui/reachable/expr_call.stderr @@ -1,5 +1,5 @@ error: unreachable expression - --> $DIR/expr_call.rs:13:17 + --> $DIR/expr_call.rs:12:17 | LL | foo(return, 22); | ------ ^^ unreachable expression @@ -7,13 +7,13 @@ LL | foo(return, 22); | any code following this expression is unreachable | note: the lint level is defined here - --> $DIR/expr_call.rs:5:9 + --> $DIR/expr_call.rs:4:9 | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ error: unreachable call - --> $DIR/expr_call.rs:18:5 + --> $DIR/expr_call.rs:17:5 | LL | bar(return); | ^^^ ------ any code following this expression is unreachable diff --git a/tests/ui/reachable/expr_method.stderr b/tests/ui/reachable/expr_method.stderr index 41c3b8a39060f..1bf797ec06307 100644 --- a/tests/ui/reachable/expr_method.stderr +++ b/tests/ui/reachable/expr_method.stderr @@ -1,5 +1,5 @@ error: unreachable expression - --> $DIR/expr_method.rs:16:21 + --> $DIR/expr_method.rs:15:21 | LL | Foo.foo(return, 22); | ------ ^^ unreachable expression @@ -7,13 +7,13 @@ LL | Foo.foo(return, 22); | any code following this expression is unreachable | note: the lint level is defined here - --> $DIR/expr_method.rs:5:9 + --> $DIR/expr_method.rs:4:9 | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ error: unreachable call - --> $DIR/expr_method.rs:21:9 + --> $DIR/expr_method.rs:20:9 | LL | Foo.bar(return); | ^^^ ------ any code following this expression is unreachable diff --git a/tests/ui/reachable/expr_unary.stderr b/tests/ui/reachable/expr_unary.stderr index 7deca1b86021e..af4a1cce15b19 100644 --- a/tests/ui/reachable/expr_unary.stderr +++ b/tests/ui/reachable/expr_unary.stderr @@ -1,11 +1,11 @@ error[E0614]: type `!` cannot be dereferenced - --> $DIR/expr_unary.rs:8:16 + --> $DIR/expr_unary.rs:7:16 | LL | let x: ! = * { return; }; | ^^^^^^^^^^^^^ can't be dereferenced error: unreachable expression - --> $DIR/expr_unary.rs:8:16 + --> $DIR/expr_unary.rs:7:16 | LL | let x: ! = * { return; }; | ^^^^------^^^ @@ -14,7 +14,7 @@ LL | let x: ! = * { return; }; | unreachable expression | note: the lint level is defined here - --> $DIR/expr_unary.rs:5:9 + --> $DIR/expr_unary.rs:4:9 | LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ diff --git a/tests/ui/reachable/never-assign-dead-code.stderr b/tests/ui/reachable/never-assign-dead-code.stderr index 5660bde5c279b..521b82023c93b 100644 --- a/tests/ui/reachable/never-assign-dead-code.stderr +++ b/tests/ui/reachable/never-assign-dead-code.stderr @@ -1,5 +1,5 @@ warning: unreachable statement - --> $DIR/never-assign-dead-code.rs:11:5 + --> $DIR/never-assign-dead-code.rs:10:5 | LL | let x: ! = panic!("aah"); | ------------- any code following this expression is unreachable @@ -7,14 +7,14 @@ LL | drop(x); | ^^^^^^^^ unreachable statement | note: the lint level is defined here - --> $DIR/never-assign-dead-code.rs:7:9 + --> $DIR/never-assign-dead-code.rs:6:9 | LL | #![warn(unused)] | ^^^^^^ = note: `#[warn(unreachable_code)]` implied by `#[warn(unused)]` warning: unreachable call - --> $DIR/never-assign-dead-code.rs:11:5 + --> $DIR/never-assign-dead-code.rs:10:5 | LL | drop(x); | ^^^^ - any code following this expression is unreachable @@ -22,7 +22,7 @@ LL | drop(x); | unreachable call warning: unused variable: `x` - --> $DIR/never-assign-dead-code.rs:10:9 + --> $DIR/never-assign-dead-code.rs:9:9 | LL | let x: ! = panic!("aah"); | ^ help: if this is intentional, prefix it with an underscore: `_x` diff --git a/tests/ui/reachable/unwarned-match-on-never.stderr b/tests/ui/reachable/unwarned-match-on-never.stderr index a296d2a055e09..472f349947458 100644 --- a/tests/ui/reachable/unwarned-match-on-never.stderr +++ b/tests/ui/reachable/unwarned-match-on-never.stderr @@ -1,5 +1,5 @@ error: unreachable expression - --> $DIR/unwarned-match-on-never.rs:10:5 + --> $DIR/unwarned-match-on-never.rs:8:5 | LL | match x {} | - any code following this expression is unreachable @@ -14,7 +14,7 @@ LL | #![deny(unreachable_code)] | ^^^^^^^^^^^^^^^^ error: unreachable arm - --> $DIR/unwarned-match-on-never.rs:15:15 + --> $DIR/unwarned-match-on-never.rs:13:15 | LL | match (return) { | -------- any code following this expression is unreachable @@ -22,7 +22,7 @@ LL | () => () | ^^ unreachable arm error: unreachable expression - --> $DIR/unwarned-match-on-never.rs:21:5 + --> $DIR/unwarned-match-on-never.rs:19:5 | LL | return; | ------ any code following this expression is unreachable diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.stderr index cc451fed31805..adaaf2b35585f 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.stderr +++ b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133063-never-arm-no-otherwise-block.stderr @@ -1,5 +1,5 @@ error: a never pattern is always unreachable - --> $DIR/ICE-133063-never-arm-no-otherwise-block.rs:10:31 + --> $DIR/ICE-133063-never-arm-no-otherwise-block.rs:9:31 | LL | (!|!) if false => {} | ^^ diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133117-duplicate-never-arm.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133117-duplicate-never-arm.stderr index 5da9642dc1998..7b8ac6dc05fea 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133117-duplicate-never-arm.stderr +++ b/tests/ui/rfcs/rfc-0000-never_patterns/ICE-133117-duplicate-never-arm.stderr @@ -1,5 +1,5 @@ error: a never pattern is always unreachable - --> $DIR/ICE-133117-duplicate-never-arm.rs:9:26 + --> $DIR/ICE-133117-duplicate-never-arm.rs:8:26 | LL | (!|!) if true => {} | ^^ @@ -8,7 +8,7 @@ LL | (!|!) if true => {} | help: remove this expression error: a never pattern is always unreachable - --> $DIR/ICE-133117-duplicate-never-arm.rs:10:26 + --> $DIR/ICE-133117-duplicate-never-arm.rs:9:26 | LL | (!|!) if true => {} | ^^ diff --git a/tests/ui/rfcs/rfc-0000-never_patterns/never-pattern-is-a-read.stderr b/tests/ui/rfcs/rfc-0000-never_patterns/never-pattern-is-a-read.stderr index c415e26f6e277..5f8de55fc376d 100644 --- a/tests/ui/rfcs/rfc-0000-never_patterns/never-pattern-is-a-read.stderr +++ b/tests/ui/rfcs/rfc-0000-never_patterns/never-pattern-is-a-read.stderr @@ -1,5 +1,5 @@ error[E0133]: access to union field is unsafe and requires unsafe function or block - --> $DIR/never-pattern-is-a-read.rs:11:16 + --> $DIR/never-pattern-is-a-read.rs:10:16 | LL | let U { a: ! } = u; | ^ access to union field diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.stderr index c209caab5ecb6..7af8133ba2a94 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/coercions.rs:23:5 + --> $DIR/coercions.rs:22:5 | LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { | - expected `A` because of return type @@ -7,7 +7,7 @@ LL | x | ^ expected `A`, found `UninhabitedEnum` error[E0308]: mismatched types - --> $DIR/coercions.rs:27:5 + --> $DIR/coercions.rs:26:5 | LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A { | - expected `A` because of return type @@ -15,7 +15,7 @@ LL | x | ^ expected `A`, found `UninhabitedTupleStruct` error[E0308]: mismatched types - --> $DIR/coercions.rs:31:5 + --> $DIR/coercions.rs:30:5 | LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { | - expected `A` because of return type @@ -23,7 +23,7 @@ LL | x | ^ expected `A`, found `UninhabitedStruct` error[E0308]: mismatched types - --> $DIR/coercions.rs:35:5 + --> $DIR/coercions.rs:34:5 | LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A { | - expected `A` because of return type diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr index 289433edf6292..8c9c15e5adafd 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/coercions_same_crate.rs:30:5 + --> $DIR/coercions_same_crate.rs:28:5 | LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { | - expected `A` because of return type @@ -7,7 +7,7 @@ LL | x | ^ expected `A`, found `UninhabitedEnum` error[E0308]: mismatched types - --> $DIR/coercions_same_crate.rs:34:5 + --> $DIR/coercions_same_crate.rs:32:5 | LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) -> A { | - expected `A` because of return type @@ -15,7 +15,7 @@ LL | x | ^ expected `A`, found `UninhabitedTupleStruct` error[E0308]: mismatched types - --> $DIR/coercions_same_crate.rs:38:5 + --> $DIR/coercions_same_crate.rs:36:5 | LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { | - expected `A` because of return type @@ -23,7 +23,7 @@ LL | x | ^ expected `A`, found `UninhabitedStruct` error[E0308]: mismatched types - --> $DIR/coercions_same_crate.rs:42:5 + --> $DIR/coercions_same_crate.rs:40:5 | LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariants) -> A { | - expected `A` because of return type diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr index f332e6deeb82c..0a20b615f7eb8 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr @@ -1,11 +1,11 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedEnum` is non-empty - --> $DIR/indirect_match.rs:19:11 + --> $DIR/indirect_match.rs:18:11 | LL | match x {} | ^ | note: `IndirectUninhabitedEnum` defined here - --> $DIR/auxiliary/uninhabited.rs:32:1 + --> $DIR/auxiliary/uninhabited.rs:31:1 | LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -18,13 +18,13 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty - --> $DIR/indirect_match.rs:23:11 + --> $DIR/indirect_match.rs:22:11 | LL | match x {} | ^ | note: `IndirectUninhabitedStruct` defined here - --> $DIR/auxiliary/uninhabited.rs:34:1 + --> $DIR/auxiliary/uninhabited.rs:33:1 | LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -37,13 +37,13 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty - --> $DIR/indirect_match.rs:27:11 + --> $DIR/indirect_match.rs:26:11 | LL | match x {} | ^ | note: `IndirectUninhabitedTupleStruct` defined here - --> $DIR/auxiliary/uninhabited.rs:36:1 + --> $DIR/auxiliary/uninhabited.rs:35:1 | LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -56,13 +56,13 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty - --> $DIR/indirect_match.rs:33:11 + --> $DIR/indirect_match.rs:32:11 | LL | match x {} | ^ | note: `IndirectUninhabitedVariants` defined here - --> $DIR/auxiliary/uninhabited.rs:38:1 + --> $DIR/auxiliary/uninhabited.rs:37:1 | LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr index 48f3857bfa7f8..af95c5bcf456e 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr @@ -1,11 +1,11 @@ error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedEnum` is non-empty - --> $DIR/indirect_match_with_exhaustive_patterns.rs:22:11 + --> $DIR/indirect_match_with_exhaustive_patterns.rs:21:11 | LL | match x {} | ^ | note: `IndirectUninhabitedEnum` defined here - --> $DIR/auxiliary/uninhabited.rs:32:1 + --> $DIR/auxiliary/uninhabited.rs:31:1 | LL | pub struct IndirectUninhabitedEnum(UninhabitedEnum); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -18,13 +18,13 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedStruct` is non-empty - --> $DIR/indirect_match_with_exhaustive_patterns.rs:26:11 + --> $DIR/indirect_match_with_exhaustive_patterns.rs:25:11 | LL | match x {} | ^ | note: `IndirectUninhabitedStruct` defined here - --> $DIR/auxiliary/uninhabited.rs:34:1 + --> $DIR/auxiliary/uninhabited.rs:33:1 | LL | pub struct IndirectUninhabitedStruct(UninhabitedStruct); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -37,13 +37,13 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedTupleStruct` is non-empty - --> $DIR/indirect_match_with_exhaustive_patterns.rs:30:11 + --> $DIR/indirect_match_with_exhaustive_patterns.rs:29:11 | LL | match x {} | ^ | note: `IndirectUninhabitedTupleStruct` defined here - --> $DIR/auxiliary/uninhabited.rs:36:1 + --> $DIR/auxiliary/uninhabited.rs:35:1 | LL | pub struct IndirectUninhabitedTupleStruct(UninhabitedTupleStruct); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -56,13 +56,13 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `IndirectUninhabitedVariants` is non-empty - --> $DIR/indirect_match_with_exhaustive_patterns.rs:36:11 + --> $DIR/indirect_match_with_exhaustive_patterns.rs:35:11 | LL | match x {} | ^ | note: `IndirectUninhabitedVariants` defined here - --> $DIR/auxiliary/uninhabited.rs:38:1 + --> $DIR/auxiliary/uninhabited.rs:37:1 | LL | pub struct IndirectUninhabitedVariants(UninhabitedVariants); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr index 86df9ef9b564c..5436cd9e48331 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/issue-65157-repeated-match-arm.rs:15:9 + --> $DIR/issue-65157-repeated-match-arm.rs:14:9 | LL | PartiallyInhabitedVariants::Struct { .. } => {} | ----------------------------------------- matches all the relevant values diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.stderr index 0232e7106aab7..8dae46b4d7e9f 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.stderr @@ -1,11 +1,11 @@ error[E0004]: non-exhaustive patterns: type `uninhabited::UninhabitedEnum` is non-empty - --> $DIR/match.rs:14:11 + --> $DIR/match.rs:13:11 | LL | match x {} | ^ | note: `uninhabited::UninhabitedEnum` defined here - --> $DIR/auxiliary/uninhabited.rs:5:1 + --> $DIR/auxiliary/uninhabited.rs:4:1 | LL | pub enum UninhabitedEnum { | ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -18,13 +18,13 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `uninhabited::PrivatelyUninhabitedStruct` is non-empty - --> $DIR/match.rs:22:11 + --> $DIR/match.rs:21:11 | LL | match x {} | ^ | note: `uninhabited::PrivatelyUninhabitedStruct` defined here - --> $DIR/auxiliary/uninhabited.rs:15:1 + --> $DIR/auxiliary/uninhabited.rs:14:1 | LL | pub struct PrivatelyUninhabitedStruct { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr index d6f0bc724a98d..a3d20abbb37b2 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr @@ -1,11 +1,11 @@ error[E0004]: non-exhaustive patterns: type `UninhabitedEnum` is non-empty - --> $DIR/match_with_exhaustive_patterns.rs:17:11 + --> $DIR/match_with_exhaustive_patterns.rs:16:11 | LL | match x {} | ^ | note: `UninhabitedEnum` defined here - --> $DIR/auxiliary/uninhabited.rs:5:1 + --> $DIR/auxiliary/uninhabited.rs:4:1 | LL | pub enum UninhabitedEnum { | ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr index bd70a7b409149..cea452d034d2b 100644 --- a/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr +++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/patterns_same_crate.rs:53:9 + --> $DIR/patterns_same_crate.rs:52:9 | LL | Some(_x) => (), | ^^^^^^^^------- @@ -15,7 +15,7 @@ LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/patterns_same_crate.rs:58:9 + --> $DIR/patterns_same_crate.rs:57:9 | LL | Some(_x) => (), | ^^^^^^^^------- @@ -26,7 +26,7 @@ LL | Some(_x) => (), = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/patterns_same_crate.rs:62:15 + --> $DIR/patterns_same_crate.rs:61:15 | LL | while let PartiallyInhabitedVariants::Struct { x } = partially_inhabited_variant() { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ matches no values because `!` is uninhabited @@ -34,7 +34,7 @@ LL | while let PartiallyInhabitedVariants::Struct { x } = partially_inhabite = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/patterns_same_crate.rs:66:15 + --> $DIR/patterns_same_crate.rs:65:15 | LL | while let Some(_x) = uninhabited_struct() { | ^^^^^^^^ matches no values because `UninhabitedStruct` is uninhabited @@ -42,7 +42,7 @@ LL | while let Some(_x) = uninhabited_struct() { = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/patterns_same_crate.rs:69:15 + --> $DIR/patterns_same_crate.rs:68:15 | LL | while let Some(_x) = uninhabited_tuple_struct() { | ^^^^^^^^ matches no values because `UninhabitedTupleStruct` is uninhabited diff --git a/tests/ui/sized-hierarchy/impls.rs b/tests/ui/sized-hierarchy/impls.rs index 643f7bc7c46cb..6b6089243c3fd 100644 --- a/tests/ui/sized-hierarchy/impls.rs +++ b/tests/ui/sized-hierarchy/impls.rs @@ -3,7 +3,7 @@ #![allow(incomplete_features, internal_features)] #![feature(sized_hierarchy)] -#![feature(coroutines, extern_types, f16, never_type, unsized_fn_params)] +#![feature(coroutines, extern_types, f16, unsized_fn_params)] use std::fmt::Debug; use std::marker::{MetaSized, PointeeSized}; diff --git a/tests/ui/stability-attribute/stability-attribute-trait-impl.stderr b/tests/ui/stability-attribute/stability-attribute-trait-impl.stderr index c954282cbc7a2..1f6762795e618 100644 --- a/tests/ui/stability-attribute/stability-attribute-trait-impl.stderr +++ b/tests/ui/stability-attribute/stability-attribute-trait-impl.stderr @@ -18,7 +18,7 @@ LL | #[unstable(feature = "k", issue = "none")] error: module has missing stability attribute --> $DIR/stability-attribute-trait-impl.rs:1:1 | -LL | / #![feature(staged_api, never_type, rust_cold_cc)] +LL | / #![feature(staged_api, rust_cold_cc)] LL | | LL | | LL | | #[stable(feature = "a", since = "3.3.3")] diff --git a/tests/ui/statics/uninhabited-static.stderr b/tests/ui/statics/uninhabited-static.stderr index ccfb98a74f4a4..6805bb5b76abb 100644 --- a/tests/ui/statics/uninhabited-static.stderr +++ b/tests/ui/statics/uninhabited-static.stderr @@ -1,5 +1,5 @@ error: static of uninhabited type - --> $DIR/uninhabited-static.rs:11:1 + --> $DIR/uninhabited-static.rs:9:1 | LL | static VOID2: Void = unsafe { std::mem::transmute(()) }; | ^^^^^^^^^^^^^^^^^^ @@ -10,7 +10,7 @@ LL | static VOID2: Void = unsafe { std::mem::transmute(()) }; = note: `#[deny(uninhabited_static)]` (part of `#[deny(future_incompatible)]`) on by default error: static of uninhabited type - --> $DIR/uninhabited-static.rs:14:1 + --> $DIR/uninhabited-static.rs:12:1 | LL | static NEVER2: Void = unsafe { std::mem::transmute(()) }; | ^^^^^^^^^^^^^^^^^^^ @@ -20,7 +20,7 @@ LL | static NEVER2: Void = unsafe { std::mem::transmute(()) }; = note: for more information, see issue #74840 error: static of uninhabited type - --> $DIR/uninhabited-static.rs:5:5 + --> $DIR/uninhabited-static.rs:3:5 | LL | static VOID: Void; | ^^^^^^^^^^^^^^^^^ @@ -30,7 +30,7 @@ LL | static VOID: Void; = note: for more information, see issue #74840 error: static of uninhabited type - --> $DIR/uninhabited-static.rs:7:5 + --> $DIR/uninhabited-static.rs:5:5 | LL | static NEVER: !; | ^^^^^^^^^^^^^^^ @@ -40,13 +40,13 @@ LL | static NEVER: !; = note: for more information, see issue #74840 error[E0080]: constructing invalid value of type Void: encountered a value of uninhabited type `Void` - --> $DIR/uninhabited-static.rs:11:31 + --> $DIR/uninhabited-static.rs:9:31 | LL | static VOID2: Void = unsafe { std::mem::transmute(()) }; | ^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `VOID2` failed here error[E0080]: constructing invalid value of type Void: encountered a value of uninhabited type `Void` - --> $DIR/uninhabited-static.rs:14:32 + --> $DIR/uninhabited-static.rs:12:32 | LL | static NEVER2: Void = unsafe { std::mem::transmute(()) }; | ^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `NEVER2` failed here @@ -56,7 +56,7 @@ error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0080`. Future incompatibility report: Future breakage diagnostic: error: static of uninhabited type - --> $DIR/uninhabited-static.rs:11:1 + --> $DIR/uninhabited-static.rs:9:1 | LL | static VOID2: Void = unsafe { std::mem::transmute(()) }; | ^^^^^^^^^^^^^^^^^^ @@ -68,7 +68,7 @@ LL | static VOID2: Void = unsafe { std::mem::transmute(()) }; Future breakage diagnostic: error: static of uninhabited type - --> $DIR/uninhabited-static.rs:14:1 + --> $DIR/uninhabited-static.rs:12:1 | LL | static NEVER2: Void = unsafe { std::mem::transmute(()) }; | ^^^^^^^^^^^^^^^^^^^ @@ -80,7 +80,7 @@ LL | static NEVER2: Void = unsafe { std::mem::transmute(()) }; Future breakage diagnostic: error: static of uninhabited type - --> $DIR/uninhabited-static.rs:5:5 + --> $DIR/uninhabited-static.rs:3:5 | LL | static VOID: Void; | ^^^^^^^^^^^^^^^^^ @@ -92,7 +92,7 @@ LL | static VOID: Void; Future breakage diagnostic: error: static of uninhabited type - --> $DIR/uninhabited-static.rs:7:5 + --> $DIR/uninhabited-static.rs:5:5 | LL | static NEVER: !; | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/symbol-names/types.legacy.stderr b/tests/ui/symbol-names/types.legacy.stderr index 53f0c1e576665..a9922d9a957f9 100644 --- a/tests/ui/symbol-names/types.legacy.stderr +++ b/tests/ui/symbol-names/types.legacy.stderr @@ -1,521 +1,521 @@ error: symbol-name(_ZN1a1b16Type$LT$bool$GT$17h[HASH]E) - --> $DIR/types.rs:18:5 + --> $DIR/types.rs:17:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:18:5 + --> $DIR/types.rs:17:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:18:5 + --> $DIR/types.rs:17:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b16Type$LT$char$GT$17h[HASH]E) - --> $DIR/types.rs:27:5 + --> $DIR/types.rs:26:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:27:5 + --> $DIR/types.rs:26:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:27:5 + --> $DIR/types.rs:26:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b14Type$LT$i8$GT$17h[HASH]E) - --> $DIR/types.rs:36:5 + --> $DIR/types.rs:35:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:36:5 + --> $DIR/types.rs:35:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:36:5 + --> $DIR/types.rs:35:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i16$GT$17h[HASH]E) - --> $DIR/types.rs:45:5 + --> $DIR/types.rs:44:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:45:5 + --> $DIR/types.rs:44:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:45:5 + --> $DIR/types.rs:44:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i32$GT$17h[HASH]E) - --> $DIR/types.rs:54:5 + --> $DIR/types.rs:53:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:54:5 + --> $DIR/types.rs:53:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:54:5 + --> $DIR/types.rs:53:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i64$GT$17h[HASH]E) - --> $DIR/types.rs:63:5 + --> $DIR/types.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:63:5 + --> $DIR/types.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:63:5 + --> $DIR/types.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b14Type$LT$u8$GT$17h[HASH]E) - --> $DIR/types.rs:72:5 + --> $DIR/types.rs:71:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:72:5 + --> $DIR/types.rs:71:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:72:5 + --> $DIR/types.rs:71:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u16$GT$17h[HASH]E) - --> $DIR/types.rs:81:5 + --> $DIR/types.rs:80:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:81:5 + --> $DIR/types.rs:80:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:81:5 + --> $DIR/types.rs:80:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u32$GT$17h[HASH]E) - --> $DIR/types.rs:90:5 + --> $DIR/types.rs:89:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:90:5 + --> $DIR/types.rs:89:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:90:5 + --> $DIR/types.rs:89:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u64$GT$17h[HASH]E) - --> $DIR/types.rs:99:5 + --> $DIR/types.rs:98:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:99:5 + --> $DIR/types.rs:98:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:99:5 + --> $DIR/types.rs:98:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f16$GT$17h[HASH]E) - --> $DIR/types.rs:108:5 + --> $DIR/types.rs:107:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:108:5 + --> $DIR/types.rs:107:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:108:5 + --> $DIR/types.rs:107:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f32$GT$17h[HASH]E) - --> $DIR/types.rs:117:5 + --> $DIR/types.rs:116:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:117:5 + --> $DIR/types.rs:116:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:117:5 + --> $DIR/types.rs:116:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f64$GT$17h[HASH]E) - --> $DIR/types.rs:126:5 + --> $DIR/types.rs:125:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:126:5 + --> $DIR/types.rs:125:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:126:5 + --> $DIR/types.rs:125:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b16Type$LT$f128$GT$17h[HASH]E) - --> $DIR/types.rs:135:5 + --> $DIR/types.rs:134:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:135:5 + --> $DIR/types.rs:134:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:135:5 + --> $DIR/types.rs:134:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$str$GT$17h[HASH]E) - --> $DIR/types.rs:144:5 + --> $DIR/types.rs:143:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:144:5 + --> $DIR/types.rs:143:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:144:5 + --> $DIR/types.rs:143:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b17Type$LT$$u21$$GT$17h[HASH]E) - --> $DIR/types.rs:153:5 + --> $DIR/types.rs:152:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:153:5 + --> $DIR/types.rs:152:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:153:5 + --> $DIR/types.rs:152:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b20Type$LT$$LP$$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:162:5 + --> $DIR/types.rs:161:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<()>::h[HASH]) - --> $DIR/types.rs:162:5 + --> $DIR/types.rs:161:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<()>) - --> $DIR/types.rs:162:5 + --> $DIR/types.rs:161:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b25Type$LT$$LP$u8$C$$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:171:5 + --> $DIR/types.rs:170:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,)>::h[HASH]) - --> $DIR/types.rs:171:5 + --> $DIR/types.rs:170:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,)>) - --> $DIR/types.rs:171:5 + --> $DIR/types.rs:170:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b28Type$LT$$LP$u8$C$u16$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:180:5 + --> $DIR/types.rs:179:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,u16)>::h[HASH]) - --> $DIR/types.rs:180:5 + --> $DIR/types.rs:179:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,u16)>) - --> $DIR/types.rs:180:5 + --> $DIR/types.rs:179:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b34Type$LT$$LP$u8$C$u16$C$u32$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:189:5 + --> $DIR/types.rs:188:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,u16,u32)>::h[HASH]) - --> $DIR/types.rs:189:5 + --> $DIR/types.rs:188:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,u16,u32)>) - --> $DIR/types.rs:189:5 + --> $DIR/types.rs:188:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b28Type$LT$$BP$const$u20$u8$GT$17h[HASH]E) - --> $DIR/types.rs:198:5 + --> $DIR/types.rs:197:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<*const u8>::h[HASH]) - --> $DIR/types.rs:198:5 + --> $DIR/types.rs:197:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<*const u8>) - --> $DIR/types.rs:198:5 + --> $DIR/types.rs:197:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b26Type$LT$$BP$mut$u20$u8$GT$17h[HASH]E) - --> $DIR/types.rs:207:5 + --> $DIR/types.rs:206:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<*mut u8>::h[HASH]) - --> $DIR/types.rs:207:5 + --> $DIR/types.rs:206:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<*mut u8>) - --> $DIR/types.rs:207:5 + --> $DIR/types.rs:206:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b19Type$LT$$RF$str$GT$17h[HASH]E) - --> $DIR/types.rs:216:5 + --> $DIR/types.rs:215:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<&str>::h[HASH]) - --> $DIR/types.rs:216:5 + --> $DIR/types.rs:215:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<&str>) - --> $DIR/types.rs:216:5 + --> $DIR/types.rs:215:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b27Type$LT$$RF$mut$u20$str$GT$17h[HASH]E) - --> $DIR/types.rs:225:5 + --> $DIR/types.rs:224:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<&mut str>::h[HASH]) - --> $DIR/types.rs:225:5 + --> $DIR/types.rs:224:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<&mut str>) - --> $DIR/types.rs:225:5 + --> $DIR/types.rs:224:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$17h[HASH]E) - --> $DIR/types.rs:234:5 + --> $DIR/types.rs:233:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[u8; 0]>::h[HASH]) - --> $DIR/types.rs:234:5 + --> $DIR/types.rs:233:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[u8; 0]>) - --> $DIR/types.rs:234:5 + --> $DIR/types.rs:233:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b22Type$LT$fn$LP$$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:243:5 + --> $DIR/types.rs:242:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:243:5 + --> $DIR/types.rs:242:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:243:5 + --> $DIR/types.rs:242:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b60Type$LT$unsafe$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:252:5 + --> $DIR/types.rs:251:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:252:5 + --> $DIR/types.rs:251:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:252:5 + --> $DIR/types.rs:251:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b34Type$LT$$u5b$T$u3b$$u20$N$u5d$$GT$17h[HASH]E) - --> $DIR/types.rs:261:5 + --> $DIR/types.rs:260:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[T; N]>::h[HASH]) - --> $DIR/types.rs:261:5 + --> $DIR/types.rs:260:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[T; N]>) - --> $DIR/types.rs:261:5 + --> $DIR/types.rs:260:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$17h[HASH]E) - --> $DIR/types.rs:272:5 + --> $DIR/types.rs:271:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[u8; 0]>::h[HASH]) - --> $DIR/types.rs:272:5 + --> $DIR/types.rs:271:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[u8; 0]>) - --> $DIR/types.rs:272:5 + --> $DIR/types.rs:271:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/symbol-names/types.v0.stderr b/tests/ui/symbol-names/types.v0.stderr index 36e0306c18b4d..4ac96ca19a53a 100644 --- a/tests/ui/symbol-names/types.v0.stderr +++ b/tests/ui/symbol-names/types.v0.stderr @@ -1,521 +1,521 @@ error: symbol-name(_RMNvCsCRATE_HASH_1a1bINtB_4TypebE) - --> $DIR/types.rs:18:5 + --> $DIR/types.rs:17:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:18:5 + --> $DIR/types.rs:17:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:18:5 + --> $DIR/types.rs:17:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs_NvCsCRATE_HASH_1a1bINtB_4TypecE) - --> $DIR/types.rs:27:5 + --> $DIR/types.rs:26:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:27:5 + --> $DIR/types.rs:26:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:27:5 + --> $DIR/types.rs:26:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs0_NvCsCRATE_HASH_1a1bINtB_4TypeaE) - --> $DIR/types.rs:36:5 + --> $DIR/types.rs:35:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:36:5 + --> $DIR/types.rs:35:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:36:5 + --> $DIR/types.rs:35:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs1_NvCsCRATE_HASH_1a1bINtB_4TypesE) - --> $DIR/types.rs:45:5 + --> $DIR/types.rs:44:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:45:5 + --> $DIR/types.rs:44:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:45:5 + --> $DIR/types.rs:44:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs2_NvCsCRATE_HASH_1a1bINtB_4TypelE) - --> $DIR/types.rs:54:5 + --> $DIR/types.rs:53:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:54:5 + --> $DIR/types.rs:53:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:54:5 + --> $DIR/types.rs:53:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs3_NvCsCRATE_HASH_1a1bINtB_4TypexE) - --> $DIR/types.rs:63:5 + --> $DIR/types.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:63:5 + --> $DIR/types.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:63:5 + --> $DIR/types.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs4_NvCsCRATE_HASH_1a1bINtB_4TypehE) - --> $DIR/types.rs:72:5 + --> $DIR/types.rs:71:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:72:5 + --> $DIR/types.rs:71:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:72:5 + --> $DIR/types.rs:71:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs5_NvCsCRATE_HASH_1a1bINtB_4TypetE) - --> $DIR/types.rs:81:5 + --> $DIR/types.rs:80:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:81:5 + --> $DIR/types.rs:80:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:81:5 + --> $DIR/types.rs:80:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs6_NvCsCRATE_HASH_1a1bINtB_4TypemE) - --> $DIR/types.rs:90:5 + --> $DIR/types.rs:89:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:90:5 + --> $DIR/types.rs:89:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:90:5 + --> $DIR/types.rs:89:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs7_NvCsCRATE_HASH_1a1bINtB_4TypeyE) - --> $DIR/types.rs:99:5 + --> $DIR/types.rs:98:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:99:5 + --> $DIR/types.rs:98:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:99:5 + --> $DIR/types.rs:98:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs8_NvCsCRATE_HASH_1a1bINtB_4TypeC3f16E) - --> $DIR/types.rs:108:5 + --> $DIR/types.rs:107:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:108:5 + --> $DIR/types.rs:107:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:108:5 + --> $DIR/types.rs:107:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMs9_NvCsCRATE_HASH_1a1bINtB_4TypefE) - --> $DIR/types.rs:117:5 + --> $DIR/types.rs:116:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:117:5 + --> $DIR/types.rs:116:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:117:5 + --> $DIR/types.rs:116:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsa_NvCsCRATE_HASH_1a1bINtB_4TypedE) - --> $DIR/types.rs:126:5 + --> $DIR/types.rs:125:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:126:5 + --> $DIR/types.rs:125:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:126:5 + --> $DIR/types.rs:125:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsb_NvCsCRATE_HASH_1a1bINtB_4TypeC4f128E) - --> $DIR/types.rs:135:5 + --> $DIR/types.rs:134:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:135:5 + --> $DIR/types.rs:134:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:135:5 + --> $DIR/types.rs:134:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsc_NvCsCRATE_HASH_1a1bINtB_4TypeeE) - --> $DIR/types.rs:144:5 + --> $DIR/types.rs:143:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:144:5 + --> $DIR/types.rs:143:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:144:5 + --> $DIR/types.rs:143:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsd_NvCsCRATE_HASH_1a1bINtB_4TypezE) - --> $DIR/types.rs:153:5 + --> $DIR/types.rs:152:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:153:5 + --> $DIR/types.rs:152:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:153:5 + --> $DIR/types.rs:152:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMse_NvCsCRATE_HASH_1a1bINtB_4TypeuE) - --> $DIR/types.rs:162:5 + --> $DIR/types.rs:161:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:162:5 + --> $DIR/types.rs:161:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:162:5 + --> $DIR/types.rs:161:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsf_NvCsCRATE_HASH_1a1bINtB_4TypeThEE) - --> $DIR/types.rs:171:5 + --> $DIR/types.rs:170:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:171:5 + --> $DIR/types.rs:170:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:171:5 + --> $DIR/types.rs:170:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsg_NvCsCRATE_HASH_1a1bINtB_4TypeThtEE) - --> $DIR/types.rs:180:5 + --> $DIR/types.rs:179:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:180:5 + --> $DIR/types.rs:179:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:180:5 + --> $DIR/types.rs:179:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsh_NvCsCRATE_HASH_1a1bINtB_4TypeThtmEE) - --> $DIR/types.rs:189:5 + --> $DIR/types.rs:188:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:189:5 + --> $DIR/types.rs:188:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:189:5 + --> $DIR/types.rs:188:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsi_NvCsCRATE_HASH_1a1bINtB_4TypePhE) - --> $DIR/types.rs:198:5 + --> $DIR/types.rs:197:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:198:5 + --> $DIR/types.rs:197:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:198:5 + --> $DIR/types.rs:197:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsj_NvCsCRATE_HASH_1a1bINtB_4TypeOhE) - --> $DIR/types.rs:207:5 + --> $DIR/types.rs:206:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:207:5 + --> $DIR/types.rs:206:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:207:5 + --> $DIR/types.rs:206:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsk_NvCsCRATE_HASH_1a1bINtB_4TypeReE) - --> $DIR/types.rs:216:5 + --> $DIR/types.rs:215:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:216:5 + --> $DIR/types.rs:215:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:216:5 + --> $DIR/types.rs:215:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsl_NvCsCRATE_HASH_1a1bINtB_4TypeQeE) - --> $DIR/types.rs:225:5 + --> $DIR/types.rs:224:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:225:5 + --> $DIR/types.rs:224:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:225:5 + --> $DIR/types.rs:224:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsm_NvCsCRATE_HASH_1a1bINtB_4TypeAhj0_E) - --> $DIR/types.rs:234:5 + --> $DIR/types.rs:233:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:234:5 + --> $DIR/types.rs:233:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:234:5 + --> $DIR/types.rs:233:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsn_NvCsCRATE_HASH_1a1bINtB_4TypeFEuE) - --> $DIR/types.rs:243:5 + --> $DIR/types.rs:242:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:243:5 + --> $DIR/types.rs:242:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:243:5 + --> $DIR/types.rs:242:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMso_NvCsCRATE_HASH_1a1bINtB_4TypeFUKCEuE) - --> $DIR/types.rs:252:5 + --> $DIR/types.rs:251:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:252:5 + --> $DIR/types.rs:251:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:252:5 + --> $DIR/types.rs:251:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsp_NvCsCRATE_HASH_1a1bINtB_4TypeAppEB_) - --> $DIR/types.rs:261:5 + --> $DIR/types.rs:260:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:261:5 + --> $DIR/types.rs:260:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:261:5 + --> $DIR/types.rs:260:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_RMsq_NvCsCRATE_HASH_1a1bINtB_4TypeAhj0_E) - --> $DIR/types.rs:272:5 + --> $DIR/types.rs:271:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(>) - --> $DIR/types.rs:272:5 + --> $DIR/types.rs:271:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(>) - --> $DIR/types.rs:272:5 + --> $DIR/types.rs:271:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/symbol-names/types.verbose-legacy.stderr b/tests/ui/symbol-names/types.verbose-legacy.stderr index 53f0c1e576665..a9922d9a957f9 100644 --- a/tests/ui/symbol-names/types.verbose-legacy.stderr +++ b/tests/ui/symbol-names/types.verbose-legacy.stderr @@ -1,521 +1,521 @@ error: symbol-name(_ZN1a1b16Type$LT$bool$GT$17h[HASH]E) - --> $DIR/types.rs:18:5 + --> $DIR/types.rs:17:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:18:5 + --> $DIR/types.rs:17:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:18:5 + --> $DIR/types.rs:17:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b16Type$LT$char$GT$17h[HASH]E) - --> $DIR/types.rs:27:5 + --> $DIR/types.rs:26:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:27:5 + --> $DIR/types.rs:26:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:27:5 + --> $DIR/types.rs:26:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b14Type$LT$i8$GT$17h[HASH]E) - --> $DIR/types.rs:36:5 + --> $DIR/types.rs:35:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:36:5 + --> $DIR/types.rs:35:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:36:5 + --> $DIR/types.rs:35:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i16$GT$17h[HASH]E) - --> $DIR/types.rs:45:5 + --> $DIR/types.rs:44:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:45:5 + --> $DIR/types.rs:44:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:45:5 + --> $DIR/types.rs:44:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i32$GT$17h[HASH]E) - --> $DIR/types.rs:54:5 + --> $DIR/types.rs:53:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:54:5 + --> $DIR/types.rs:53:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:54:5 + --> $DIR/types.rs:53:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$i64$GT$17h[HASH]E) - --> $DIR/types.rs:63:5 + --> $DIR/types.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:63:5 + --> $DIR/types.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:63:5 + --> $DIR/types.rs:62:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b14Type$LT$u8$GT$17h[HASH]E) - --> $DIR/types.rs:72:5 + --> $DIR/types.rs:71:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:72:5 + --> $DIR/types.rs:71:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:72:5 + --> $DIR/types.rs:71:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u16$GT$17h[HASH]E) - --> $DIR/types.rs:81:5 + --> $DIR/types.rs:80:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:81:5 + --> $DIR/types.rs:80:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:81:5 + --> $DIR/types.rs:80:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u32$GT$17h[HASH]E) - --> $DIR/types.rs:90:5 + --> $DIR/types.rs:89:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:90:5 + --> $DIR/types.rs:89:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:90:5 + --> $DIR/types.rs:89:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$u64$GT$17h[HASH]E) - --> $DIR/types.rs:99:5 + --> $DIR/types.rs:98:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:99:5 + --> $DIR/types.rs:98:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:99:5 + --> $DIR/types.rs:98:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f16$GT$17h[HASH]E) - --> $DIR/types.rs:108:5 + --> $DIR/types.rs:107:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:108:5 + --> $DIR/types.rs:107:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:108:5 + --> $DIR/types.rs:107:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f32$GT$17h[HASH]E) - --> $DIR/types.rs:117:5 + --> $DIR/types.rs:116:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:117:5 + --> $DIR/types.rs:116:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:117:5 + --> $DIR/types.rs:116:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$f64$GT$17h[HASH]E) - --> $DIR/types.rs:126:5 + --> $DIR/types.rs:125:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:126:5 + --> $DIR/types.rs:125:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:126:5 + --> $DIR/types.rs:125:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b16Type$LT$f128$GT$17h[HASH]E) - --> $DIR/types.rs:135:5 + --> $DIR/types.rs:134:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:135:5 + --> $DIR/types.rs:134:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:135:5 + --> $DIR/types.rs:134:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b15Type$LT$str$GT$17h[HASH]E) - --> $DIR/types.rs:144:5 + --> $DIR/types.rs:143:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:144:5 + --> $DIR/types.rs:143:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:144:5 + --> $DIR/types.rs:143:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b17Type$LT$$u21$$GT$17h[HASH]E) - --> $DIR/types.rs:153:5 + --> $DIR/types.rs:152:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:153:5 + --> $DIR/types.rs:152:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:153:5 + --> $DIR/types.rs:152:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b20Type$LT$$LP$$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:162:5 + --> $DIR/types.rs:161:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<()>::h[HASH]) - --> $DIR/types.rs:162:5 + --> $DIR/types.rs:161:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<()>) - --> $DIR/types.rs:162:5 + --> $DIR/types.rs:161:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b25Type$LT$$LP$u8$C$$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:171:5 + --> $DIR/types.rs:170:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,)>::h[HASH]) - --> $DIR/types.rs:171:5 + --> $DIR/types.rs:170:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,)>) - --> $DIR/types.rs:171:5 + --> $DIR/types.rs:170:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b28Type$LT$$LP$u8$C$u16$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:180:5 + --> $DIR/types.rs:179:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,u16)>::h[HASH]) - --> $DIR/types.rs:180:5 + --> $DIR/types.rs:179:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,u16)>) - --> $DIR/types.rs:180:5 + --> $DIR/types.rs:179:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b34Type$LT$$LP$u8$C$u16$C$u32$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:189:5 + --> $DIR/types.rs:188:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<(u8,u16,u32)>::h[HASH]) - --> $DIR/types.rs:189:5 + --> $DIR/types.rs:188:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<(u8,u16,u32)>) - --> $DIR/types.rs:189:5 + --> $DIR/types.rs:188:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b28Type$LT$$BP$const$u20$u8$GT$17h[HASH]E) - --> $DIR/types.rs:198:5 + --> $DIR/types.rs:197:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<*const u8>::h[HASH]) - --> $DIR/types.rs:198:5 + --> $DIR/types.rs:197:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<*const u8>) - --> $DIR/types.rs:198:5 + --> $DIR/types.rs:197:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b26Type$LT$$BP$mut$u20$u8$GT$17h[HASH]E) - --> $DIR/types.rs:207:5 + --> $DIR/types.rs:206:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<*mut u8>::h[HASH]) - --> $DIR/types.rs:207:5 + --> $DIR/types.rs:206:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<*mut u8>) - --> $DIR/types.rs:207:5 + --> $DIR/types.rs:206:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b19Type$LT$$RF$str$GT$17h[HASH]E) - --> $DIR/types.rs:216:5 + --> $DIR/types.rs:215:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<&str>::h[HASH]) - --> $DIR/types.rs:216:5 + --> $DIR/types.rs:215:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<&str>) - --> $DIR/types.rs:216:5 + --> $DIR/types.rs:215:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b27Type$LT$$RF$mut$u20$str$GT$17h[HASH]E) - --> $DIR/types.rs:225:5 + --> $DIR/types.rs:224:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<&mut str>::h[HASH]) - --> $DIR/types.rs:225:5 + --> $DIR/types.rs:224:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<&mut str>) - --> $DIR/types.rs:225:5 + --> $DIR/types.rs:224:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$17h[HASH]E) - --> $DIR/types.rs:234:5 + --> $DIR/types.rs:233:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[u8; 0]>::h[HASH]) - --> $DIR/types.rs:234:5 + --> $DIR/types.rs:233:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[u8; 0]>) - --> $DIR/types.rs:234:5 + --> $DIR/types.rs:233:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b22Type$LT$fn$LP$$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:243:5 + --> $DIR/types.rs:242:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:243:5 + --> $DIR/types.rs:242:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:243:5 + --> $DIR/types.rs:242:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b60Type$LT$unsafe$u20$extern$u20$$u22$C$u22$$u20$fn$LP$$RP$$GT$17h[HASH]E) - --> $DIR/types.rs:252:5 + --> $DIR/types.rs:251:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type::h[HASH]) - --> $DIR/types.rs:252:5 + --> $DIR/types.rs:251:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type) - --> $DIR/types.rs:252:5 + --> $DIR/types.rs:251:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b34Type$LT$$u5b$T$u3b$$u20$N$u5d$$GT$17h[HASH]E) - --> $DIR/types.rs:261:5 + --> $DIR/types.rs:260:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[T; N]>::h[HASH]) - --> $DIR/types.rs:261:5 + --> $DIR/types.rs:260:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[T; N]>) - --> $DIR/types.rs:261:5 + --> $DIR/types.rs:260:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: symbol-name(_ZN1a1b35Type$LT$$u5b$u8$u3b$$u20$0$u5d$$GT$17h[HASH]E) - --> $DIR/types.rs:272:5 + --> $DIR/types.rs:271:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling(a::b::Type<[u8; 0]>::h[HASH]) - --> $DIR/types.rs:272:5 + --> $DIR/types.rs:271:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ error: demangling-alt(a::b::Type<[u8; 0]>) - --> $DIR/types.rs:272:5 + --> $DIR/types.rs:271:5 | LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/transmutability/char.stderr b/tests/ui/transmutability/char.stderr index 98e7ae9c0d49c..b15d4c83e29b3 100644 --- a/tests/ui/transmutability/char.stderr +++ b/tests/ui/transmutability/char.stderr @@ -1,11 +1,11 @@ error[E0277]: `main::Char<(), !, !>` cannot be safely transmuted into `char` - --> $DIR/char.rs:35:39 + --> $DIR/char.rs:34:39 | LL | is_transmutable::, char>(); | ^^^^ at least one value of `main::Char<(), !, !>` isn't a bit-valid value of `char` | note: required by a bound in `is_transmutable` - --> $DIR/char.rs:8:10 + --> $DIR/char.rs:7:10 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -14,13 +14,13 @@ LL | Dst: TransmuteFrom, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `main::Char` cannot be safely transmuted into `char` - --> $DIR/char.rs:37:39 + --> $DIR/char.rs:36:39 | LL | is_transmutable::, char>(); | ^^^^ at least one value of `main::Char` isn't a bit-valid value of `char` | note: required by a bound in `is_transmutable` - --> $DIR/char.rs:8:10 + --> $DIR/char.rs:7:10 | LL | pub fn is_transmutable() | --------------- required by a bound in this function @@ -29,13 +29,13 @@ LL | Dst: TransmuteFrom, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` error[E0277]: `main::Char` cannot be safely transmuted into `char` - --> $DIR/char.rs:39:39 + --> $DIR/char.rs:38:39 | LL | is_transmutable::, char>(); | ^^^^ at least one value of `main::Char` isn't a bit-valid value of `char` | note: required by a bound in `is_transmutable` - --> $DIR/char.rs:8:10 + --> $DIR/char.rs:7:10 | LL | pub fn is_transmutable() | --------------- required by a bound in this function diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr b/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr index a4270c29ff35b..4c11e97fdd810 100644 --- a/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr +++ b/tests/ui/uninhabited/uninhabited-irrefutable.exhaustive_patterns.stderr @@ -1,5 +1,5 @@ error[E0005]: refutable pattern in local binding - --> $DIR/uninhabited-irrefutable.rs:30:9 + --> $DIR/uninhabited-irrefutable.rs:29:9 | LL | let Foo::D(_y, _z) = x; | ^^^^^^^^^^^^^^ pattern `Foo::A(_)` not covered @@ -7,7 +7,7 @@ LL | let Foo::D(_y, _z) = x; = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Foo` defined here - --> $DIR/uninhabited-irrefutable.rs:19:6 + --> $DIR/uninhabited-irrefutable.rs:18:6 | LL | enum Foo { | ^^^ diff --git a/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr b/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr index a4270c29ff35b..4c11e97fdd810 100644 --- a/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr +++ b/tests/ui/uninhabited/uninhabited-irrefutable.normal.stderr @@ -1,5 +1,5 @@ error[E0005]: refutable pattern in local binding - --> $DIR/uninhabited-irrefutable.rs:30:9 + --> $DIR/uninhabited-irrefutable.rs:29:9 | LL | let Foo::D(_y, _z) = x; | ^^^^^^^^^^^^^^ pattern `Foo::A(_)` not covered @@ -7,7 +7,7 @@ LL | let Foo::D(_y, _z) = x; = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html note: `Foo` defined here - --> $DIR/uninhabited-irrefutable.rs:19:6 + --> $DIR/uninhabited-irrefutable.rs:18:6 | LL | enum Foo { | ^^^ diff --git a/tests/ui/uninhabited/uninhabited-patterns.stderr b/tests/ui/uninhabited/uninhabited-patterns.stderr index 62113c82a3648..d2964694c2ebf 100644 --- a/tests/ui/uninhabited/uninhabited-patterns.stderr +++ b/tests/ui/uninhabited/uninhabited-patterns.stderr @@ -1,5 +1,5 @@ error[E0004]: non-exhaustive patterns: `Ok(_)` not covered - --> $DIR/uninhabited-patterns.rs:34:11 + --> $DIR/uninhabited-patterns.rs:33:11 | LL | match x { | ^ pattern `Ok(_)` not covered @@ -17,7 +17,7 @@ LL ~ Ok(_) => todo!(), | error: unreachable pattern - --> $DIR/uninhabited-patterns.rs:43:9 + --> $DIR/uninhabited-patterns.rs:42:9 | LL | Err(Ok(_y)) => (), | ^^^^^^^^^^^------- @@ -27,13 +27,13 @@ LL | Err(Ok(_y)) => (), | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types note: the lint level is defined here - --> $DIR/uninhabited-patterns.rs:4:9 + --> $DIR/uninhabited-patterns.rs:3:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/uninhabited-patterns.rs:46:15 + --> $DIR/uninhabited-patterns.rs:45:15 | LL | while let Some(_y) = foo() { | ^^^^^^^^ matches no values because `NotSoSecretlyEmpty` is uninhabited diff --git a/tests/ui/uninhabited/uninhabited-unstable-field.stderr b/tests/ui/uninhabited/uninhabited-unstable-field.stderr index a0c9f9366a6b5..84ddfb5c32de9 100644 --- a/tests/ui/uninhabited/uninhabited-unstable-field.stderr +++ b/tests/ui/uninhabited/uninhabited-unstable-field.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/uninhabited-unstable-field.rs:24:9 + --> $DIR/uninhabited-unstable-field.rs:23:9 | LL | Foo { .. } => {} | ^^^^^^^^^^------ @@ -9,13 +9,13 @@ LL | Foo { .. } => {} | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types note: the lint level is defined here - --> $DIR/uninhabited-unstable-field.rs:9:9 + --> $DIR/uninhabited-unstable-field.rs:8:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/uninhabited-unstable-field.rs:31:9 + --> $DIR/uninhabited-unstable-field.rs:30:9 | LL | _ => {} | ^------ @@ -26,7 +26,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/uninhabited-unstable-field.rs:41:9 + --> $DIR/uninhabited-unstable-field.rs:40:9 | LL | MyCoroutineState::Complete(_) => {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^------ diff --git a/tests/ui/unpretty/exhaustive.hir.stderr b/tests/ui/unpretty/exhaustive.hir.stderr index f6800fc9c1e6f..0f7e6f4b09dc1 100644 --- a/tests/ui/unpretty/exhaustive.hir.stderr +++ b/tests/ui/unpretty/exhaustive.hir.stderr @@ -1,17 +1,17 @@ error[E0697]: closures cannot be static - --> $DIR/exhaustive.rs:211:9 + --> $DIR/exhaustive.rs:210:9 | LL | static || value; | ^^^^^^^^^ error[E0697]: closures cannot be static - --> $DIR/exhaustive.rs:212:9 + --> $DIR/exhaustive.rs:211:9 | LL | static move || value; | ^^^^^^^^^^^^^^ error[E0728]: `await` is only allowed inside `async` functions and blocks - --> $DIR/exhaustive.rs:241:13 + --> $DIR/exhaustive.rs:240:13 | LL | fn expr_await() { | --------------- this is not `async` @@ -20,19 +20,19 @@ LL | fut.await; | ^^^^^ only allowed inside `async` functions and blocks error: in expressions, `_` can only be used on the left-hand side of an assignment - --> $DIR/exhaustive.rs:292:9 + --> $DIR/exhaustive.rs:291:9 | LL | _; | ^ `_` not allowed here error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:302:9 + --> $DIR/exhaustive.rs:301:9 | LL | x::(); | ^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:303:9 + --> $DIR/exhaustive.rs:302:9 | LL | x::(T, T) -> T; | ^^^^^^^^^^^^^^ only `Fn` traits may use parentheses @@ -44,31 +44,31 @@ LL + x:: -> T; | error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:304:9 + --> $DIR/exhaustive.rs:303:9 | LL | crate::() -> ()::expressions::() -> ()::expr_path; | ^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:304:26 + --> $DIR/exhaustive.rs:303:26 | LL | crate::() -> ()::expressions::() -> ()::expr_path; | ^^^^^^^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:307:9 + --> $DIR/exhaustive.rs:306:9 | LL | core::()::marker::()::PhantomData; | ^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:307:19 + --> $DIR/exhaustive.rs:306:19 | LL | core::()::marker::()::PhantomData; | ^^^^^^^^^^ only `Fn` traits may use parentheses error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks - --> $DIR/exhaustive.rs:394:9 + --> $DIR/exhaustive.rs:393:9 | LL | yield; | ^^^^^ @@ -79,7 +79,7 @@ LL | #[coroutine] fn expr_yield() { | ++++++++++++ error[E0703]: invalid ABI: found `C++` - --> $DIR/exhaustive.rs:474:23 + --> $DIR/exhaustive.rs:473:23 | LL | unsafe extern "C++" {} | ^^^^^ invalid ABI @@ -87,7 +87,7 @@ LL | unsafe extern "C++" {} = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions error: `..` patterns are not allowed here - --> $DIR/exhaustive.rs:681:13 + --> $DIR/exhaustive.rs:680:13 | LL | let ..; | ^^ @@ -95,13 +95,13 @@ LL | let ..; = note: only allowed in tuple, tuple struct, and slice patterns error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:796:16 + --> $DIR/exhaustive.rs:795:16 | LL | let _: T() -> !; | ^^^^^^^^ only `Fn` traits may use parentheses error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:810:16 + --> $DIR/exhaustive.rs:809:16 | LL | let _: impl Send; | ^^^^^^^^^ @@ -112,7 +112,7 @@ LL | let _: impl Send; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:811:16 + --> $DIR/exhaustive.rs:810:16 | LL | let _: impl Send + 'static; | ^^^^^^^^^^^^^^^^^^^ @@ -123,7 +123,7 @@ LL | let _: impl Send + 'static; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:812:16 + --> $DIR/exhaustive.rs:811:16 | LL | let _: impl 'static + Send; | ^^^^^^^^^^^^^^^^^^^ @@ -134,7 +134,7 @@ LL | let _: impl 'static + Send; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:813:16 + --> $DIR/exhaustive.rs:812:16 | LL | let _: impl ?Sized; | ^^^^^^^^^^^ @@ -145,7 +145,7 @@ LL | let _: impl ?Sized; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:814:16 + --> $DIR/exhaustive.rs:813:16 | LL | let _: impl [const] Clone; | ^^^^^^^^^^^^^^^^^^ @@ -156,7 +156,7 @@ LL | let _: impl [const] Clone; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:815:16 + --> $DIR/exhaustive.rs:814:16 | LL | let _: impl for<'a> Send; | ^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/unpretty/exhaustive.hir.stdout b/tests/ui/unpretty/exhaustive.hir.stdout index 78403e1704dca..2d3a15ea57052 100644 --- a/tests/ui/unpretty/exhaustive.hir.stdout +++ b/tests/ui/unpretty/exhaustive.hir.stdout @@ -12,9 +12,9 @@ #![attr = Feature([auto_traits#0, box_patterns#0, builtin_syntax#0, const_trait_impl#0, coroutines#0, decl_macro#0, deref_patterns#0, explicit_tail_calls#0, gen_blocks#0, more_qualified_paths#0, never_patterns#0, -never_type#0, pattern_types#0, pattern_type_macro#0, prelude_import#0, -specialization#0, trace_macros#0, trait_alias#0, try_blocks#0, -try_blocks_heterogeneous#0, yeet_expr#0])] +pattern_types#0, pattern_type_macro#0, prelude_import#0, specialization#0, +trace_macros#0, trait_alias#0, try_blocks#0, try_blocks_heterogeneous#0, +yeet_expr#0])] extern crate std; #[attr = PreludeImport] use std::prelude::rust_2024::*; From 2ff61adf76e665eb4d3a1118d4ef939e4e1c33d0 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Wed, 22 Apr 2026 20:08:09 +0200 Subject: [PATCH 10/14] mir-opt tests shut up --- ...test.ElaborateDrops.after.panic-unwind.mir | 10 +- .../issue_72181_1.main.built.after.mir | 4 +- ...g.aggregate.JumpThreading.panic-abort.diff | 51 -- ....aggregate.JumpThreading.panic-unwind.diff | 51 -- ...regate_copy.JumpThreading.panic-abort.diff | 56 -- ...egate_copy.JumpThreading.panic-unwind.diff | 56 -- ...ding.assume.JumpThreading.panic-abort.diff | 39 - ...ing.assume.JumpThreading.panic-unwind.diff | 39 - ...bitwise_not.JumpThreading.panic-abort.diff | 46 -- ...itwise_not.JumpThreading.panic-unwind.diff | 46 -- ..._conditions.JumpThreading.panic-abort.diff | 530 ------------- ...conditions.JumpThreading.panic-unwind.diff | 547 -------------- ...ustom_discr.JumpThreading.panic-abort.diff | 63 -- ...stom_discr.JumpThreading.panic-unwind.diff | 63 -- ...reading.dfa.JumpThreading.panic-abort.diff | 68 -- ...eading.dfa.JumpThreading.panic-unwind.diff | 68 -- ...ppearing_bb.JumpThreading.panic-abort.diff | 79 -- ...pearing_bb.JumpThreading.panic-unwind.diff | 79 -- ...icate_chain.JumpThreading.panic-abort.diff | 45 -- ...cate_chain.JumpThreading.panic-unwind.diff | 45 -- ...ding.floats.JumpThreading.panic-abort.diff | 59 -- ...ing.floats.JumpThreading.panic-unwind.diff | 59 -- ...ng.identity.JumpThreading.panic-abort.diff | 143 ---- ...g.identity.JumpThreading.panic-unwind.diff | 143 ---- ...logical_not.JumpThreading.panic-abort.diff | 46 -- ...ogical_not.JumpThreading.panic-unwind.diff | 46 -- ...tiple_match.JumpThreading.panic-abort.diff | 54 -- ...iple_match.JumpThreading.panic-unwind.diff | 54 -- ...mutable_ref.JumpThreading.panic-abort.diff | 54 -- ...utable_ref.JumpThreading.panic-unwind.diff | 54 -- ...iscriminant.JumpThreading.panic-abort.diff | 26 - ...scriminant.JumpThreading.panic-unwind.diff | 26 - ...numbered_bb.JumpThreading.panic-abort.diff | 61 -- ...umbered_bb.JumpThreading.panic-unwind.diff | 61 -- tests/mir-opt/jump_threading.rs | 695 ------------------ ...too_complex.JumpThreading.panic-abort.diff | 103 --- ...oo_complex.JumpThreading.panic-unwind.diff | 103 --- ...g.two_reads.JumpThreading.panic-abort.diff | 56 -- ....two_reads.JumpThreading.panic-unwind.diff | 56 -- ...n_traits.PreCodegen.after.panic-unwind.mir | 6 +- ...mple_option_map.ezmap.PreCodegen.after.mir | 50 -- ...map_via_question_mark.PreCodegen.after.mir | 79 -- .../mir-opt/pre-codegen/simple_option_map.rs | 42 -- ...e_const_switch.identity.JumpThreading.diff | 16 +- 44 files changed, 18 insertions(+), 4059 deletions(-) delete mode 100644 tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.chained_conditions.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.chained_conditions.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.dfa.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.dfa.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.logical_not.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.logical_not.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.rs delete mode 100644 tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/jump_threading.two_reads.JumpThreading.panic-abort.diff delete mode 100644 tests/mir-opt/jump_threading.two_reads.JumpThreading.panic-unwind.diff delete mode 100644 tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir delete mode 100644 tests/mir-opt/pre-codegen/simple_option_map.map_via_question_mark.PreCodegen.after.mir delete mode 100644 tests/mir-opt/pre-codegen/simple_option_map.rs diff --git a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir index 1fc75018c8625..d44db1eb1c8c6 100644 --- a/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir +++ b/tests/mir-opt/issue_62289.test.ElaborateDrops.after.panic-unwind.mir @@ -6,12 +6,12 @@ fn test() -> Option> { let mut _2: std::boxed::Box>; let mut _3: std::boxed::Box>; let mut _4: u32; - let mut _5: std::ops::ControlFlow, u32>; + let mut _5: std::ops::ControlFlow, u32>; let mut _6: std::option::Option; let mut _7: isize; - let _8: std::option::Option; + let _8: std::option::Option; let mut _9: !; - let mut _10: std::option::Option; + let mut _10: std::option::Option; let _11: u32; scope 1 { debug residual => _8; @@ -63,10 +63,10 @@ fn test() -> Option> { bb5: { StorageLive(_8); - _8 = copy ((_5 as Break).0: std::option::Option); + _8 = copy ((_5 as Break).0: std::option::Option); StorageLive(_10); _10 = copy _8; - _0 = > as FromResidual>>::from_residual(move _10) -> [return: bb6, unwind: bb13]; + _0 = > as FromResidual>>::from_residual(move _10) -> [return: bb6, unwind: bb13]; } bb6: { diff --git a/tests/mir-opt/issue_72181_1.main.built.after.mir b/tests/mir-opt/issue_72181_1.main.built.after.mir index 398a4bcb3ab3e..15b76d8d71f28 100644 --- a/tests/mir-opt/issue_72181_1.main.built.after.mir +++ b/tests/mir-opt/issue_72181_1.main.built.after.mir @@ -1,8 +1,8 @@ // MIR for `main` after built | User Type Annotations -| 0: user_ty: Canonical { value: Ty(Void), max_universe: U0, var_kinds: [] }, span: $DIR/issue_72181_1.rs:17:12: 17:16, inferred_ty: Void -| 1: user_ty: Canonical { value: Ty(Void), max_universe: U0, var_kinds: [] }, span: $DIR/issue_72181_1.rs:17:12: 17:16, inferred_ty: Void +| 0: user_ty: Canonical { value: Ty(Void), max_universe: U0, var_kinds: [] }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void +| 1: user_ty: Canonical { value: Ty(Void), max_universe: U0, var_kinds: [] }, span: $DIR/issue_72181_1.rs:16:12: 16:16, inferred_ty: Void | fn main() -> () { let mut _0: (); diff --git a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff deleted file mode 100644 index 89d04c557f125..0000000000000 --- a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,51 +0,0 @@ -- // MIR for `aggregate` before JumpThreading -+ // MIR for `aggregate` after JumpThreading - - fn aggregate() -> u8 { - let mut _0: u8; - let _1: u8; - let _2: u8; - let mut _3: (u8, u8); - let mut _4: bool; - let mut _5: u8; - scope 1 { - debug a => _1; - debug b => _2; - } - - bb0: { - StorageLive(_3); - _3 = const aggregate::FOO; - StorageLive(_1); - _1 = copy (_3.0: u8); - StorageLive(_2); - _2 = copy (_3.1: u8); - StorageDead(_3); - StorageLive(_4); - StorageLive(_5); - _5 = copy _1; - _4 = Eq(move _5, const 7_u8); -- switchInt(move _4) -> [0: bb2, otherwise: bb1]; -+ goto -> bb2; - } - - bb1: { - StorageDead(_5); - _0 = copy _2; - goto -> bb3; - } - - bb2: { - StorageDead(_5); - _0 = copy _1; - goto -> bb3; - } - - bb3: { - StorageDead(_4); - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff deleted file mode 100644 index 89d04c557f125..0000000000000 --- a/tests/mir-opt/jump_threading.aggregate.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,51 +0,0 @@ -- // MIR for `aggregate` before JumpThreading -+ // MIR for `aggregate` after JumpThreading - - fn aggregate() -> u8 { - let mut _0: u8; - let _1: u8; - let _2: u8; - let mut _3: (u8, u8); - let mut _4: bool; - let mut _5: u8; - scope 1 { - debug a => _1; - debug b => _2; - } - - bb0: { - StorageLive(_3); - _3 = const aggregate::FOO; - StorageLive(_1); - _1 = copy (_3.0: u8); - StorageLive(_2); - _2 = copy (_3.1: u8); - StorageDead(_3); - StorageLive(_4); - StorageLive(_5); - _5 = copy _1; - _4 = Eq(move _5, const 7_u8); -- switchInt(move _4) -> [0: bb2, otherwise: bb1]; -+ goto -> bb2; - } - - bb1: { - StorageDead(_5); - _0 = copy _2; - goto -> bb3; - } - - bb2: { - StorageDead(_5); - _0 = copy _1; - goto -> bb3; - } - - bb3: { - StorageDead(_4); - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff deleted file mode 100644 index 4d639d89f0d12..0000000000000 --- a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,56 +0,0 @@ -- // MIR for `aggregate_copy` before JumpThreading -+ // MIR for `aggregate_copy` after JumpThreading - - fn aggregate_copy() -> u32 { - let mut _0: u32; - let _1: (u32, u32); - let mut _4: bool; - let mut _5: u32; - scope 1 { - debug a => _1; - let _2: (u32, u32); - scope 2 { - debug b => _2; - let _3: u32; - scope 3 { - debug c => _3; - } - } - } - - bb0: { - StorageLive(_1); - _1 = const aggregate_copy::Foo; - StorageLive(_2); - _2 = copy _1; - StorageLive(_3); - _3 = copy (_2.1: u32); - StorageLive(_4); - StorageLive(_5); - _5 = copy _3; - _4 = Eq(move _5, const 2_u32); -- switchInt(move _4) -> [0: bb2, otherwise: bb1]; -+ goto -> bb2; - } - - bb1: { - StorageDead(_5); - _0 = copy (_2.0: u32); - goto -> bb3; - } - - bb2: { - StorageDead(_5); - _0 = const 13_u32; - goto -> bb3; - } - - bb3: { - StorageDead(_4); - StorageDead(_3); - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff deleted file mode 100644 index 4d639d89f0d12..0000000000000 --- a/tests/mir-opt/jump_threading.aggregate_copy.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,56 +0,0 @@ -- // MIR for `aggregate_copy` before JumpThreading -+ // MIR for `aggregate_copy` after JumpThreading - - fn aggregate_copy() -> u32 { - let mut _0: u32; - let _1: (u32, u32); - let mut _4: bool; - let mut _5: u32; - scope 1 { - debug a => _1; - let _2: (u32, u32); - scope 2 { - debug b => _2; - let _3: u32; - scope 3 { - debug c => _3; - } - } - } - - bb0: { - StorageLive(_1); - _1 = const aggregate_copy::Foo; - StorageLive(_2); - _2 = copy _1; - StorageLive(_3); - _3 = copy (_2.1: u32); - StorageLive(_4); - StorageLive(_5); - _5 = copy _3; - _4 = Eq(move _5, const 2_u32); -- switchInt(move _4) -> [0: bb2, otherwise: bb1]; -+ goto -> bb2; - } - - bb1: { - StorageDead(_5); - _0 = copy (_2.0: u32); - goto -> bb3; - } - - bb2: { - StorageDead(_5); - _0 = const 13_u32; - goto -> bb3; - } - - bb3: { - StorageDead(_4); - StorageDead(_3); - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff deleted file mode 100644 index 519cb0f0ab1df..0000000000000 --- a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,39 +0,0 @@ -- // MIR for `assume` before JumpThreading -+ // MIR for `assume` after JumpThreading - - fn assume(_1: u8, _2: bool) -> u8 { - let mut _0: u8; - - bb0: { - switchInt(copy _1) -> [7: bb1, otherwise: bb2]; - } - - bb1: { - assume(copy _2); -- goto -> bb3; -+ goto -> bb6; - } - - bb2: { - goto -> bb3; - } - - bb3: { - switchInt(copy _2) -> [0: bb4, otherwise: bb5]; - } - - bb4: { - _0 = const 4_u8; - return; - } - - bb5: { - _0 = const 5_u8; - return; -+ } -+ -+ bb6: { -+ goto -> bb5; - } - } - diff --git a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff deleted file mode 100644 index 519cb0f0ab1df..0000000000000 --- a/tests/mir-opt/jump_threading.assume.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,39 +0,0 @@ -- // MIR for `assume` before JumpThreading -+ // MIR for `assume` after JumpThreading - - fn assume(_1: u8, _2: bool) -> u8 { - let mut _0: u8; - - bb0: { - switchInt(copy _1) -> [7: bb1, otherwise: bb2]; - } - - bb1: { - assume(copy _2); -- goto -> bb3; -+ goto -> bb6; - } - - bb2: { - goto -> bb3; - } - - bb3: { - switchInt(copy _2) -> [0: bb4, otherwise: bb5]; - } - - bb4: { - _0 = const 4_u8; - return; - } - - bb5: { - _0 = const 5_u8; - return; -+ } -+ -+ bb6: { -+ goto -> bb5; - } - } - diff --git a/tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-abort.diff deleted file mode 100644 index c3272f21d6c12..0000000000000 --- a/tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,46 +0,0 @@ -- // MIR for `bitwise_not` before JumpThreading -+ // MIR for `bitwise_not` after JumpThreading - - fn bitwise_not() -> i32 { - let mut _0: i32; - let _1: i32; - let mut _2: bool; - let mut _3: i32; - let mut _4: i32; - scope 1 { - debug a => _1; - } - - bb0: { - StorageLive(_1); - _1 = const 1_i32; - StorageLive(_2); - StorageLive(_3); - StorageLive(_4); - _4 = copy _1; - _3 = Not(move _4); - StorageDead(_4); - _2 = Eq(move _3, const 0_i32); -- switchInt(move _2) -> [0: bb2, otherwise: bb1]; -+ goto -> bb2; - } - - bb1: { - StorageDead(_3); - _0 = const 1_i32; - goto -> bb3; - } - - bb2: { - StorageDead(_3); - _0 = const 0_i32; - goto -> bb3; - } - - bb3: { - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-unwind.diff deleted file mode 100644 index c3272f21d6c12..0000000000000 --- a/tests/mir-opt/jump_threading.bitwise_not.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,46 +0,0 @@ -- // MIR for `bitwise_not` before JumpThreading -+ // MIR for `bitwise_not` after JumpThreading - - fn bitwise_not() -> i32 { - let mut _0: i32; - let _1: i32; - let mut _2: bool; - let mut _3: i32; - let mut _4: i32; - scope 1 { - debug a => _1; - } - - bb0: { - StorageLive(_1); - _1 = const 1_i32; - StorageLive(_2); - StorageLive(_3); - StorageLive(_4); - _4 = copy _1; - _3 = Not(move _4); - StorageDead(_4); - _2 = Eq(move _3, const 0_i32); -- switchInt(move _2) -> [0: bb2, otherwise: bb1]; -+ goto -> bb2; - } - - bb1: { - StorageDead(_3); - _0 = const 1_i32; - goto -> bb3; - } - - bb2: { - StorageDead(_3); - _0 = const 0_i32; - goto -> bb3; - } - - bb3: { - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.chained_conditions.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.chained_conditions.JumpThreading.panic-abort.diff deleted file mode 100644 index a59d76b05a99f..0000000000000 --- a/tests/mir-opt/jump_threading.chained_conditions.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,530 +0,0 @@ -- // MIR for `chained_conditions` before JumpThreading -+ // MIR for `chained_conditions` after JumpThreading - - fn chained_conditions() -> u8 { - let mut _0: u8; - let _1: chained_conditions::BacktraceStyle; - let mut _2: std::option::Option; - let mut _3: &std::option::Option; - let mut _4: isize; - let _5: std::string::String; - let _6: &std::string::String; - let mut _7: bool; - let mut _8: &&std::string::String; - let _9: &std::string::String; - let mut _10: &&str; - let _11: &str; - let _12: std::string::String; - let _13: &std::string::String; - let mut _14: bool; - let mut _15: &&std::string::String; - let _16: &std::string::String; - let mut _17: &&str; - let _18: &str; - let mut _19: isize; - let mut _20: &&str; - let mut _21: &&str; - let mut _22: bool; - let mut _23: bool; - let mut _24: isize; - let mut _25: isize; - let mut _26: isize; - scope 1 { - debug format => _1; - } - scope 2 { - debug x => _5; - debug x => _6; - } - scope 3 { - debug x => _12; - debug x => _13; - } - scope 4 (inlined std::cmp::impls:: for &String>::eq) { - let mut _27: &std::string::String; - let mut _28: &str; - scope 5 (inlined >::eq) { - scope 6 (inlined #[track_caller] >::index) { - let _29: &str; - scope 7 (inlined String::as_str) { - let _30: &[u8]; - scope 8 (inlined Vec::::as_slice) { - let _31: *const [u8]; - let mut _32: *const u8; - let mut _33: usize; - scope 9 (inlined Vec::::as_ptr) { - scope 10 (inlined alloc::raw_vec::RawVec::::ptr) { - scope 11 (inlined alloc::raw_vec::RawVecInner::ptr::) { - scope 12 (inlined alloc::raw_vec::RawVecInner::non_null::) { - let mut _34: std::ptr::NonNull; - scope 13 (inlined std::ptr::Unique::::cast::) { - scope 14 (inlined NonNull::::cast::) { - scope 15 (inlined NonNull::::as_ptr) { - } - } - } - scope 16 (inlined std::ptr::Unique::::as_non_null_ptr) { - } - } - scope 17 (inlined NonNull::::as_ptr) { - } - } - } - } - } - scope 18 (inlined from_utf8_unchecked) { - } - } - scope 19 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { - } - } - scope 20 (inlined #[track_caller] core::str::traits:: for str>::index) { - scope 21 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { - } - } - scope 22 (inlined core::str::traits::::eq) { - let mut _35: &&[u8]; - let _36: &[u8]; - let mut _37: &&[u8]; - let _38: &[u8]; - scope 23 (inlined core::str::::as_bytes) { - } - scope 24 (inlined core::str::::as_bytes) { - } - scope 25 (inlined std::cmp::impls::::eq) { - scope 26 (inlined core::slice::cmp::::eq) { - let _39: usize; - let mut _40: bool; - let mut _41: usize; - let mut _42: *const u8; - let mut _43: *const u8; - scope 27 { - scope 28 (inlined core::slice::::as_ptr) { - let mut _44: *const [u8]; - } - scope 29 (inlined core::slice::::as_ptr) { - let mut _45: *const [u8]; - } - scope 30 (inlined >::equal_same_length) { - let mut _46: i32; - scope 31 { - } - } - } - } - } - } - } - } - scope 32 (inlined std::cmp::impls:: for &String>::eq) { - let mut _47: &std::string::String; - let mut _48: &str; - scope 33 (inlined >::eq) { - scope 34 (inlined #[track_caller] >::index) { - let _49: &str; - scope 35 (inlined String::as_str) { - let _50: &[u8]; - scope 36 (inlined Vec::::as_slice) { - let _51: *const [u8]; - let mut _52: *const u8; - let mut _53: usize; - scope 37 (inlined Vec::::as_ptr) { - scope 38 (inlined alloc::raw_vec::RawVec::::ptr) { - scope 39 (inlined alloc::raw_vec::RawVecInner::ptr::) { - scope 40 (inlined alloc::raw_vec::RawVecInner::non_null::) { - let mut _54: std::ptr::NonNull; - scope 41 (inlined std::ptr::Unique::::cast::) { - scope 42 (inlined NonNull::::cast::) { - scope 43 (inlined NonNull::::as_ptr) { - } - } - } - scope 44 (inlined std::ptr::Unique::::as_non_null_ptr) { - } - } - scope 45 (inlined NonNull::::as_ptr) { - } - } - } - } - } - scope 46 (inlined from_utf8_unchecked) { - } - } - scope 47 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { - } - } - scope 48 (inlined #[track_caller] core::str::traits:: for str>::index) { - scope 49 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { - } - } - scope 50 (inlined core::str::traits::::eq) { - let mut _55: &&[u8]; - let _56: &[u8]; - let mut _57: &&[u8]; - let _58: &[u8]; - scope 51 (inlined core::str::::as_bytes) { - } - scope 52 (inlined core::str::::as_bytes) { - } - scope 53 (inlined std::cmp::impls::::eq) { - scope 54 (inlined core::slice::cmp::::eq) { - let _59: usize; - let mut _60: bool; - let mut _61: usize; - let mut _62: *const u8; - let mut _63: *const u8; - scope 55 { - scope 56 (inlined core::slice::::as_ptr) { - let mut _64: *const [u8]; - } - scope 57 (inlined core::slice::::as_ptr) { - let mut _65: *const [u8]; - } - scope 58 (inlined >::equal_same_length) { - let mut _66: i32; - scope 59 { - } - } - } - } - } - } - } - } - - bb0: { - _22 = const false; - _23 = const false; - StorageLive(_1); - StorageLive(_2); - _2 = env_var() -> [return: bb1, unwind unreachable]; - } - - bb1: { - _22 = const true; - _23 = const true; - _4 = discriminant(_2); - switchInt(move _4) -> [0: bb3, 1: bb4, otherwise: bb2]; - } - - bb2: { - unreachable; - } - - bb3: { - _1 = chained_conditions::BacktraceStyle::Off; -- goto -> bb18; -+ goto -> bb29; - } - - bb4: { - StorageLive(_6); - _6 = &((_2 as Some).0: std::string::String); - StorageLive(_7); - StorageLive(_8); - StorageLive(_9); - _9 = &(*_6); - _8 = &_9; - StorageLive(_10); - _21 = const chained_conditions::promoted[1]; - _10 = &(*_21); - StorageLive(_27); - StorageLive(_28); - _27 = copy (*_8); - _28 = copy (*_10); - StorageLive(_29); - StorageLive(_30); - StorageLive(_31); - StorageLive(_32); - StorageLive(_34); - _34 = copy ((((((*_27).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); - _32 = copy _34 as *const u8 (Transmute); - StorageDead(_34); - StorageLive(_33); - _33 = copy (((*_27).0: std::vec::Vec).1: usize); - _31 = *const [u8] from (copy _32, move _33); - StorageDead(_33); - StorageDead(_32); - _30 = &(*_31); - StorageDead(_31); - _29 = copy _30 as &str (Transmute); - StorageDead(_30); - StorageLive(_36); - StorageLive(_38); - _36 = copy _29 as &[u8] (Transmute); - _38 = copy _28 as &[u8] (Transmute); - StorageLive(_39); - _39 = PtrMetadata(copy _36); - StorageLive(_40); - StorageLive(_41); - _41 = PtrMetadata(copy _38); - _40 = Eq(copy _39, move _41); - switchInt(move _40) -> [0: bb20, otherwise: bb19]; - } - - bb5: { - StorageDead(_10); - StorageDead(_9); - StorageDead(_8); - StorageDead(_7); - StorageLive(_5); - _23 = const false; - _5 = move ((_2 as Some).0: std::string::String); - _1 = chained_conditions::BacktraceStyle::Full; - drop(_5) -> [return: bb7, unwind unreachable]; - } - - bb6: { - StorageDead(_10); - StorageDead(_9); - StorageDead(_8); - StorageDead(_7); - StorageDead(_6); - StorageLive(_13); - _13 = &((_2 as Some).0: std::string::String); - StorageLive(_14); - StorageLive(_15); - StorageLive(_16); - _16 = &(*_13); - _15 = &_16; - StorageLive(_17); - _20 = const chained_conditions::promoted[0]; - _17 = &(*_20); - StorageLive(_47); - StorageLive(_48); - _47 = copy (*_15); - _48 = copy (*_17); - StorageLive(_49); - StorageLive(_50); - StorageLive(_51); - StorageLive(_52); - StorageLive(_54); - _54 = copy ((((((*_47).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); - _52 = copy _54 as *const u8 (Transmute); - StorageDead(_54); - StorageLive(_53); - _53 = copy (((*_47).0: std::vec::Vec).1: usize); - _51 = *const [u8] from (copy _52, move _53); - StorageDead(_53); - StorageDead(_52); - _50 = &(*_51); - StorageDead(_51); - _49 = copy _50 as &str (Transmute); - StorageDead(_50); - StorageLive(_56); - StorageLive(_58); - _56 = copy _49 as &[u8] (Transmute); - _58 = copy _48 as &[u8] (Transmute); - StorageLive(_59); - _59 = PtrMetadata(copy _56); - StorageLive(_60); - StorageLive(_61); - _61 = PtrMetadata(copy _58); - _60 = Eq(copy _59, move _61); - switchInt(move _60) -> [0: bb24, otherwise: bb23]; - } - - bb7: { - StorageDead(_5); - StorageDead(_6); -- goto -> bb18; -+ goto -> bb27; - } - - bb8: { - StorageDead(_17); - StorageDead(_16); - StorageDead(_15); - StorageDead(_14); - StorageLive(_12); - _23 = const false; - _12 = move ((_2 as Some).0: std::string::String); - _1 = chained_conditions::BacktraceStyle::Off; - drop(_12) -> [return: bb10, unwind unreachable]; - } - - bb9: { - StorageDead(_17); - StorageDead(_16); - StorageDead(_15); - StorageDead(_14); - StorageDead(_13); - _1 = chained_conditions::BacktraceStyle::Short; -- goto -> bb18; -+ goto -> bb29; - } - - bb10: { - StorageDead(_12); - StorageDead(_13); -- goto -> bb18; -+ goto -> bb27; - } - - bb11: { - _0 = const 3_u8; - goto -> bb14; - } - - bb12: { - _0 = const 2_u8; - goto -> bb14; - } - - bb13: { - _0 = const 1_u8; - goto -> bb14; - } - - bb14: { - StorageDead(_1); - return; - } - - bb15: { - _22 = const false; - _23 = const false; - StorageDead(_2); - _19 = discriminant(_1); - switchInt(move _19) -> [0: bb13, 1: bb12, 2: bb11, otherwise: bb2]; - } - - bb16: { - switchInt(copy _23) -> [0: bb15, otherwise: bb17]; - } - - bb17: { - drop(((_2 as Some).0: std::string::String)) -> [return: bb15, unwind unreachable]; - } - - bb18: { - _24 = discriminant(_2); - switchInt(move _24) -> [1: bb16, otherwise: bb15]; - } - - bb19: { - StorageDead(_41); - StorageLive(_42); - StorageLive(_44); - _44 = &raw const (*_36); - _42 = copy _44 as *const u8 (PtrToPtr); - StorageDead(_44); - StorageLive(_43); - StorageLive(_45); - _45 = &raw const (*_38); - _43 = copy _45 as *const u8 (PtrToPtr); - StorageDead(_45); - StorageLive(_46); - _46 = compare_bytes(move _42, move _43, move _39) -> [return: bb22, unwind unreachable]; - } - - bb20: { - StorageDead(_41); - _7 = const false; -- goto -> bb21; -+ goto -> bb32; - } - - bb21: { - StorageDead(_40); - StorageDead(_39); - StorageDead(_38); - StorageDead(_36); - StorageDead(_29); - StorageDead(_28); - StorageDead(_27); - switchInt(move _7) -> [0: bb6, otherwise: bb5]; - } - - bb22: { - _7 = Eq(move _46, const 0_i32); - StorageDead(_46); - StorageDead(_43); - StorageDead(_42); - goto -> bb21; - } - - bb23: { - StorageDead(_61); - StorageLive(_62); - StorageLive(_64); - _64 = &raw const (*_56); - _62 = copy _64 as *const u8 (PtrToPtr); - StorageDead(_64); - StorageLive(_63); - StorageLive(_65); - _65 = &raw const (*_58); - _63 = copy _65 as *const u8 (PtrToPtr); - StorageDead(_65); - StorageLive(_66); - _66 = compare_bytes(move _62, move _63, move _59) -> [return: bb26, unwind unreachable]; - } - - bb24: { - StorageDead(_61); - _14 = const false; -- goto -> bb25; -+ goto -> bb31; - } - - bb25: { - StorageDead(_60); - StorageDead(_59); - StorageDead(_58); - StorageDead(_56); - StorageDead(_49); - StorageDead(_48); - StorageDead(_47); - switchInt(move _14) -> [0: bb9, otherwise: bb8]; - } - - bb26: { - _14 = Eq(move _66, const 0_i32); - StorageDead(_66); - StorageDead(_63); - StorageDead(_62); - goto -> bb25; -+ } -+ -+ bb27: { -+ _24 = discriminant(_2); -+ switchInt(move _24) -> [1: bb28, otherwise: bb15]; -+ } -+ -+ bb28: { -+ goto -> bb15; -+ } -+ -+ bb29: { -+ _24 = discriminant(_2); -+ switchInt(move _24) -> [1: bb30, otherwise: bb15]; -+ } -+ -+ bb30: { -+ goto -> bb17; -+ } -+ -+ bb31: { -+ StorageDead(_60); -+ StorageDead(_59); -+ StorageDead(_58); -+ StorageDead(_56); -+ StorageDead(_49); -+ StorageDead(_48); -+ StorageDead(_47); -+ goto -> bb9; -+ } -+ -+ bb32: { -+ StorageDead(_40); -+ StorageDead(_39); -+ StorageDead(_38); -+ StorageDead(_36); -+ StorageDead(_29); -+ StorageDead(_28); -+ StorageDead(_27); -+ goto -> bb6; - } - } - diff --git a/tests/mir-opt/jump_threading.chained_conditions.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.chained_conditions.JumpThreading.panic-unwind.diff deleted file mode 100644 index b0811ab7f0685..0000000000000 --- a/tests/mir-opt/jump_threading.chained_conditions.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,547 +0,0 @@ -- // MIR for `chained_conditions` before JumpThreading -+ // MIR for `chained_conditions` after JumpThreading - - fn chained_conditions() -> u8 { - let mut _0: u8; - let _1: chained_conditions::BacktraceStyle; - let mut _2: std::option::Option; - let mut _3: &std::option::Option; - let mut _4: isize; - let _5: std::string::String; - let _6: &std::string::String; - let mut _7: bool; - let mut _8: &&std::string::String; - let _9: &std::string::String; - let mut _10: &&str; - let _11: &str; - let _12: std::string::String; - let _13: &std::string::String; - let mut _14: bool; - let mut _15: &&std::string::String; - let _16: &std::string::String; - let mut _17: &&str; - let _18: &str; - let mut _19: isize; - let mut _20: &&str; - let mut _21: &&str; - let mut _22: bool; - let mut _23: bool; - let mut _24: isize; - let mut _25: isize; - let mut _26: isize; - scope 1 { - debug format => _1; - } - scope 2 { - debug x => _5; - debug x => _6; - } - scope 3 { - debug x => _12; - debug x => _13; - } - scope 4 (inlined std::cmp::impls:: for &String>::eq) { - let mut _27: &std::string::String; - let mut _28: &str; - scope 5 (inlined >::eq) { - scope 6 (inlined #[track_caller] >::index) { - let _29: &str; - scope 7 (inlined String::as_str) { - let _30: &[u8]; - scope 8 (inlined Vec::::as_slice) { - let _31: *const [u8]; - let mut _32: *const u8; - let mut _33: usize; - scope 9 (inlined Vec::::as_ptr) { - scope 10 (inlined alloc::raw_vec::RawVec::::ptr) { - scope 11 (inlined alloc::raw_vec::RawVecInner::ptr::) { - scope 12 (inlined alloc::raw_vec::RawVecInner::non_null::) { - let mut _34: std::ptr::NonNull; - scope 13 (inlined std::ptr::Unique::::cast::) { - scope 14 (inlined NonNull::::cast::) { - scope 15 (inlined NonNull::::as_ptr) { - } - } - } - scope 16 (inlined std::ptr::Unique::::as_non_null_ptr) { - } - } - scope 17 (inlined NonNull::::as_ptr) { - } - } - } - } - } - scope 18 (inlined from_utf8_unchecked) { - } - } - scope 19 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { - } - } - scope 20 (inlined #[track_caller] core::str::traits:: for str>::index) { - scope 21 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { - } - } - scope 22 (inlined core::str::traits::::eq) { - let mut _35: &&[u8]; - let _36: &[u8]; - let mut _37: &&[u8]; - let _38: &[u8]; - scope 23 (inlined core::str::::as_bytes) { - } - scope 24 (inlined core::str::::as_bytes) { - } - scope 25 (inlined std::cmp::impls::::eq) { - scope 26 (inlined core::slice::cmp::::eq) { - let _39: usize; - let mut _40: bool; - let mut _41: usize; - let mut _42: *const u8; - let mut _43: *const u8; - scope 27 { - scope 28 (inlined core::slice::::as_ptr) { - let mut _44: *const [u8]; - } - scope 29 (inlined core::slice::::as_ptr) { - let mut _45: *const [u8]; - } - scope 30 (inlined >::equal_same_length) { - let mut _46: i32; - scope 31 { - } - } - } - } - } - } - } - } - scope 32 (inlined std::cmp::impls:: for &String>::eq) { - let mut _47: &std::string::String; - let mut _48: &str; - scope 33 (inlined >::eq) { - scope 34 (inlined #[track_caller] >::index) { - let _49: &str; - scope 35 (inlined String::as_str) { - let _50: &[u8]; - scope 36 (inlined Vec::::as_slice) { - let _51: *const [u8]; - let mut _52: *const u8; - let mut _53: usize; - scope 37 (inlined Vec::::as_ptr) { - scope 38 (inlined alloc::raw_vec::RawVec::::ptr) { - scope 39 (inlined alloc::raw_vec::RawVecInner::ptr::) { - scope 40 (inlined alloc::raw_vec::RawVecInner::non_null::) { - let mut _54: std::ptr::NonNull; - scope 41 (inlined std::ptr::Unique::::cast::) { - scope 42 (inlined NonNull::::cast::) { - scope 43 (inlined NonNull::::as_ptr) { - } - } - } - scope 44 (inlined std::ptr::Unique::::as_non_null_ptr) { - } - } - scope 45 (inlined NonNull::::as_ptr) { - } - } - } - } - } - scope 46 (inlined from_utf8_unchecked) { - } - } - scope 47 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { - } - } - scope 48 (inlined #[track_caller] core::str::traits:: for str>::index) { - scope 49 (inlined #[track_caller] core::str::traits:: for RangeFull>::index) { - } - } - scope 50 (inlined core::str::traits::::eq) { - let mut _55: &&[u8]; - let _56: &[u8]; - let mut _57: &&[u8]; - let _58: &[u8]; - scope 51 (inlined core::str::::as_bytes) { - } - scope 52 (inlined core::str::::as_bytes) { - } - scope 53 (inlined std::cmp::impls::::eq) { - scope 54 (inlined core::slice::cmp::::eq) { - let _59: usize; - let mut _60: bool; - let mut _61: usize; - let mut _62: *const u8; - let mut _63: *const u8; - scope 55 { - scope 56 (inlined core::slice::::as_ptr) { - let mut _64: *const [u8]; - } - scope 57 (inlined core::slice::::as_ptr) { - let mut _65: *const [u8]; - } - scope 58 (inlined >::equal_same_length) { - let mut _66: i32; - scope 59 { - } - } - } - } - } - } - } - } - - bb0: { - _22 = const false; - _23 = const false; - StorageLive(_1); - StorageLive(_2); - _22 = const true; - _23 = const true; - _2 = env_var() -> [return: bb1, unwind continue]; - } - - bb1: { - _4 = discriminant(_2); - switchInt(move _4) -> [0: bb3, 1: bb4, otherwise: bb2]; - } - - bb2: { - unreachable; - } - - bb3: { - _1 = chained_conditions::BacktraceStyle::Off; -- goto -> bb19; -+ goto -> bb33; - } - - bb4: { - StorageLive(_6); - _6 = &((_2 as Some).0: std::string::String); - StorageLive(_7); - StorageLive(_8); - StorageLive(_9); - _9 = &(*_6); - _8 = &_9; - StorageLive(_10); - _21 = const chained_conditions::promoted[1]; - _10 = &(*_21); - StorageLive(_27); - StorageLive(_28); - _27 = copy (*_8); - _28 = copy (*_10); - StorageLive(_29); - StorageLive(_30); - StorageLive(_31); - StorageLive(_32); - StorageLive(_34); - _34 = copy ((((((*_27).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); - _32 = copy _34 as *const u8 (Transmute); - StorageDead(_34); - StorageLive(_33); - _33 = copy (((*_27).0: std::vec::Vec).1: usize); - _31 = *const [u8] from (copy _32, move _33); - StorageDead(_33); - StorageDead(_32); - _30 = &(*_31); - StorageDead(_31); - _29 = copy _30 as &str (Transmute); - StorageDead(_30); - StorageLive(_36); - StorageLive(_38); - _36 = copy _29 as &[u8] (Transmute); - _38 = copy _28 as &[u8] (Transmute); - StorageLive(_39); - _39 = PtrMetadata(copy _36); - StorageLive(_40); - StorageLive(_41); - _41 = PtrMetadata(copy _38); - _40 = Eq(copy _39, move _41); - switchInt(move _40) -> [0: bb24, otherwise: bb23]; - } - - bb5: { - StorageDead(_10); - StorageDead(_9); - StorageDead(_8); - StorageDead(_7); - StorageLive(_5); - _23 = const false; - _5 = move ((_2 as Some).0: std::string::String); - _1 = chained_conditions::BacktraceStyle::Full; - drop(_5) -> [return: bb7, unwind: bb22]; - } - - bb6: { - StorageDead(_10); - StorageDead(_9); - StorageDead(_8); - StorageDead(_7); - StorageDead(_6); - StorageLive(_13); - _13 = &((_2 as Some).0: std::string::String); - StorageLive(_14); - StorageLive(_15); - StorageLive(_16); - _16 = &(*_13); - _15 = &_16; - StorageLive(_17); - _20 = const chained_conditions::promoted[0]; - _17 = &(*_20); - StorageLive(_47); - StorageLive(_48); - _47 = copy (*_15); - _48 = copy (*_17); - StorageLive(_49); - StorageLive(_50); - StorageLive(_51); - StorageLive(_52); - StorageLive(_54); - _54 = copy ((((((*_47).0: std::vec::Vec).0: alloc::raw_vec::RawVec).0: alloc::raw_vec::RawVecInner).0: std::ptr::Unique).0: std::ptr::NonNull); - _52 = copy _54 as *const u8 (Transmute); - StorageDead(_54); - StorageLive(_53); - _53 = copy (((*_47).0: std::vec::Vec).1: usize); - _51 = *const [u8] from (copy _52, move _53); - StorageDead(_53); - StorageDead(_52); - _50 = &(*_51); - StorageDead(_51); - _49 = copy _50 as &str (Transmute); - StorageDead(_50); - StorageLive(_56); - StorageLive(_58); - _56 = copy _49 as &[u8] (Transmute); - _58 = copy _48 as &[u8] (Transmute); - StorageLive(_59); - _59 = PtrMetadata(copy _56); - StorageLive(_60); - StorageLive(_61); - _61 = PtrMetadata(copy _58); - _60 = Eq(copy _59, move _61); - switchInt(move _60) -> [0: bb28, otherwise: bb27]; - } - - bb7: { - StorageDead(_5); - StorageDead(_6); -- goto -> bb19; -+ goto -> bb31; - } - - bb8: { - StorageDead(_17); - StorageDead(_16); - StorageDead(_15); - StorageDead(_14); - StorageLive(_12); - _23 = const false; - _12 = move ((_2 as Some).0: std::string::String); - _1 = chained_conditions::BacktraceStyle::Off; - drop(_12) -> [return: bb10, unwind: bb22]; - } - - bb9: { - StorageDead(_17); - StorageDead(_16); - StorageDead(_15); - StorageDead(_14); - StorageDead(_13); - _1 = chained_conditions::BacktraceStyle::Short; -- goto -> bb19; -+ goto -> bb33; - } - - bb10: { - StorageDead(_12); - StorageDead(_13); -- goto -> bb19; -+ goto -> bb31; - } - - bb11: { - _0 = const 3_u8; - goto -> bb14; - } - - bb12: { - _0 = const 2_u8; - goto -> bb14; - } - - bb13: { - _0 = const 1_u8; - goto -> bb14; - } - - bb14: { - StorageDead(_1); - return; - } - - bb15 (cleanup): { - resume; - } - - bb16: { - _22 = const false; - _23 = const false; - StorageDead(_2); - _19 = discriminant(_1); - switchInt(move _19) -> [0: bb13, 1: bb12, 2: bb11, otherwise: bb2]; - } - - bb17: { - switchInt(copy _23) -> [0: bb16, otherwise: bb18]; - } - - bb18: { - drop(((_2 as Some).0: std::string::String)) -> [return: bb16, unwind: bb15]; - } - - bb19: { - _24 = discriminant(_2); - switchInt(move _24) -> [1: bb17, otherwise: bb16]; - } - - bb20 (cleanup): { - switchInt(copy _23) -> [0: bb15, otherwise: bb21]; - } - - bb21 (cleanup): { - drop(((_2 as Some).0: std::string::String)) -> [return: bb15, unwind terminate(cleanup)]; - } - - bb22 (cleanup): { - _26 = discriminant(_2); - switchInt(move _26) -> [1: bb20, otherwise: bb15]; - } - - bb23: { - StorageDead(_41); - StorageLive(_42); - StorageLive(_44); - _44 = &raw const (*_36); - _42 = copy _44 as *const u8 (PtrToPtr); - StorageDead(_44); - StorageLive(_43); - StorageLive(_45); - _45 = &raw const (*_38); - _43 = copy _45 as *const u8 (PtrToPtr); - StorageDead(_45); - StorageLive(_46); - _46 = compare_bytes(move _42, move _43, move _39) -> [return: bb26, unwind unreachable]; - } - - bb24: { - StorageDead(_41); - _7 = const false; -- goto -> bb25; -+ goto -> bb36; - } - - bb25: { - StorageDead(_40); - StorageDead(_39); - StorageDead(_38); - StorageDead(_36); - StorageDead(_29); - StorageDead(_28); - StorageDead(_27); - switchInt(move _7) -> [0: bb6, otherwise: bb5]; - } - - bb26: { - _7 = Eq(move _46, const 0_i32); - StorageDead(_46); - StorageDead(_43); - StorageDead(_42); - goto -> bb25; - } - - bb27: { - StorageDead(_61); - StorageLive(_62); - StorageLive(_64); - _64 = &raw const (*_56); - _62 = copy _64 as *const u8 (PtrToPtr); - StorageDead(_64); - StorageLive(_63); - StorageLive(_65); - _65 = &raw const (*_58); - _63 = copy _65 as *const u8 (PtrToPtr); - StorageDead(_65); - StorageLive(_66); - _66 = compare_bytes(move _62, move _63, move _59) -> [return: bb30, unwind unreachable]; - } - - bb28: { - StorageDead(_61); - _14 = const false; -- goto -> bb29; -+ goto -> bb35; - } - - bb29: { - StorageDead(_60); - StorageDead(_59); - StorageDead(_58); - StorageDead(_56); - StorageDead(_49); - StorageDead(_48); - StorageDead(_47); - switchInt(move _14) -> [0: bb9, otherwise: bb8]; - } - - bb30: { - _14 = Eq(move _66, const 0_i32); - StorageDead(_66); - StorageDead(_63); - StorageDead(_62); - goto -> bb29; -+ } -+ -+ bb31: { -+ _24 = discriminant(_2); -+ switchInt(move _24) -> [1: bb32, otherwise: bb16]; -+ } -+ -+ bb32: { -+ goto -> bb16; -+ } -+ -+ bb33: { -+ _24 = discriminant(_2); -+ switchInt(move _24) -> [1: bb34, otherwise: bb16]; -+ } -+ -+ bb34: { -+ goto -> bb18; -+ } -+ -+ bb35: { -+ StorageDead(_60); -+ StorageDead(_59); -+ StorageDead(_58); -+ StorageDead(_56); -+ StorageDead(_49); -+ StorageDead(_48); -+ StorageDead(_47); -+ goto -> bb9; -+ } -+ -+ bb36: { -+ StorageDead(_40); -+ StorageDead(_39); -+ StorageDead(_38); -+ StorageDead(_36); -+ StorageDead(_29); -+ StorageDead(_28); -+ StorageDead(_27); -+ goto -> bb6; - } - } - diff --git a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff deleted file mode 100644 index 0b11a0d188fb8..0000000000000 --- a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,63 +0,0 @@ -- // MIR for `custom_discr` before JumpThreading -+ // MIR for `custom_discr` after JumpThreading - - fn custom_discr(_1: bool) -> u8 { - debug x => _1; - let mut _0: u8; - let mut _2: CustomDiscr; - let mut _3: bool; - let mut _4: u8; - - bb0: { - StorageLive(_2); - StorageLive(_3); - _3 = copy _1; - switchInt(move _3) -> [0: bb2, otherwise: bb1]; - } - - bb1: { - _2 = CustomDiscr::A; -- goto -> bb3; -+ goto -> bb7; - } - - bb2: { - _2 = CustomDiscr::B; -- goto -> bb3; -+ goto -> bb8; - } - - bb3: { - StorageDead(_3); - _4 = discriminant(_2); - switchInt(move _4) -> [35: bb5, otherwise: bb4]; - } - - bb4: { - _0 = const 13_u8; - goto -> bb6; - } - - bb5: { - _0 = const 5_u8; - goto -> bb6; - } - - bb6: { - StorageDead(_2); - return; -+ } -+ -+ bb7: { -+ StorageDead(_3); -+ _4 = discriminant(_2); -+ goto -> bb5; -+ } -+ -+ bb8: { -+ StorageDead(_3); -+ _4 = discriminant(_2); -+ goto -> bb4; - } - } - diff --git a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff deleted file mode 100644 index 0b11a0d188fb8..0000000000000 --- a/tests/mir-opt/jump_threading.custom_discr.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,63 +0,0 @@ -- // MIR for `custom_discr` before JumpThreading -+ // MIR for `custom_discr` after JumpThreading - - fn custom_discr(_1: bool) -> u8 { - debug x => _1; - let mut _0: u8; - let mut _2: CustomDiscr; - let mut _3: bool; - let mut _4: u8; - - bb0: { - StorageLive(_2); - StorageLive(_3); - _3 = copy _1; - switchInt(move _3) -> [0: bb2, otherwise: bb1]; - } - - bb1: { - _2 = CustomDiscr::A; -- goto -> bb3; -+ goto -> bb7; - } - - bb2: { - _2 = CustomDiscr::B; -- goto -> bb3; -+ goto -> bb8; - } - - bb3: { - StorageDead(_3); - _4 = discriminant(_2); - switchInt(move _4) -> [35: bb5, otherwise: bb4]; - } - - bb4: { - _0 = const 13_u8; - goto -> bb6; - } - - bb5: { - _0 = const 5_u8; - goto -> bb6; - } - - bb6: { - StorageDead(_2); - return; -+ } -+ -+ bb7: { -+ StorageDead(_3); -+ _4 = discriminant(_2); -+ goto -> bb5; -+ } -+ -+ bb8: { -+ StorageDead(_3); -+ _4 = discriminant(_2); -+ goto -> bb4; - } - } - diff --git a/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-abort.diff deleted file mode 100644 index 8009721fa5c58..0000000000000 --- a/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,68 +0,0 @@ -- // MIR for `dfa` before JumpThreading -+ // MIR for `dfa` after JumpThreading - - fn dfa() -> () { - let mut _0: (); - let mut _1: DFA; - let mut _2: !; - let mut _3: (); - let mut _4: isize; - let mut _5: DFA; - let mut _6: DFA; - let mut _7: DFA; - let mut _8: !; - scope 1 { - debug state => _1; - } - - bb0: { - StorageLive(_1); - _1 = DFA::A; - StorageLive(_2); - goto -> bb1; - } - - bb1: { - _4 = discriminant(_1); - switchInt(move _4) -> [0: bb6, 1: bb5, 2: bb4, 3: bb3, otherwise: bb2]; - } - - bb2: { - unreachable; - } - - bb3: { - _0 = const (); - StorageDead(_2); - StorageDead(_1); - return; - } - - bb4: { - StorageLive(_7); - _7 = DFA::D; - _1 = move _7; - _3 = const (); - StorageDead(_7); - goto -> bb1; - } - - bb5: { - StorageLive(_6); - _6 = DFA::C; - _1 = move _6; - _3 = const (); - StorageDead(_6); - goto -> bb1; - } - - bb6: { - StorageLive(_5); - _5 = DFA::B; - _1 = move _5; - _3 = const (); - StorageDead(_5); - goto -> bb1; - } - } - diff --git a/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-unwind.diff deleted file mode 100644 index 8009721fa5c58..0000000000000 --- a/tests/mir-opt/jump_threading.dfa.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,68 +0,0 @@ -- // MIR for `dfa` before JumpThreading -+ // MIR for `dfa` after JumpThreading - - fn dfa() -> () { - let mut _0: (); - let mut _1: DFA; - let mut _2: !; - let mut _3: (); - let mut _4: isize; - let mut _5: DFA; - let mut _6: DFA; - let mut _7: DFA; - let mut _8: !; - scope 1 { - debug state => _1; - } - - bb0: { - StorageLive(_1); - _1 = DFA::A; - StorageLive(_2); - goto -> bb1; - } - - bb1: { - _4 = discriminant(_1); - switchInt(move _4) -> [0: bb6, 1: bb5, 2: bb4, 3: bb3, otherwise: bb2]; - } - - bb2: { - unreachable; - } - - bb3: { - _0 = const (); - StorageDead(_2); - StorageDead(_1); - return; - } - - bb4: { - StorageLive(_7); - _7 = DFA::D; - _1 = move _7; - _3 = const (); - StorageDead(_7); - goto -> bb1; - } - - bb5: { - StorageLive(_6); - _6 = DFA::C; - _1 = move _6; - _3 = const (); - StorageDead(_6); - goto -> bb1; - } - - bb6: { - StorageLive(_5); - _5 = DFA::B; - _1 = move _5; - _3 = const (); - StorageDead(_5); - goto -> bb1; - } - } - diff --git a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff deleted file mode 100644 index 4955d05214ff4..0000000000000 --- a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,79 +0,0 @@ -- // MIR for `disappearing_bb` before JumpThreading -+ // MIR for `disappearing_bb` after JumpThreading - - fn disappearing_bb(_1: u8) -> u8 { - let mut _0: u8; - let mut _2: bool; - let mut _3: bool; - - bb0: { - _2 = const true; - _3 = const true; - switchInt(copy _1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; - } - - bb1: { - _3 = const false; -- goto -> bb4; -+ goto -> bb10; - } - - bb2: { - unreachable; - } - - bb3: { - _2 = const false; -- goto -> bb4; -+ goto -> bb13; - } - - bb4: { - switchInt(copy _3) -> [0: bb5, otherwise: bb7]; - } - - bb5: { - switchInt(copy _2) -> [0: bb6, otherwise: bb8]; - } - - bb6: { - return; - } - - bb7: { - goto -> bb5; - } - - bb8: { -+ goto -> bb6; -+ } -+ -+ bb9: { -+ switchInt(copy _3) -> [0: bb5, otherwise: bb7]; -+ } -+ -+ bb10: { -+ goto -> bb11; -+ } -+ -+ bb11: { -+ goto -> bb8; -+ } -+ -+ bb12: { -+ switchInt(copy _3) -> [0: bb5, otherwise: bb7]; -+ } -+ -+ bb13: { -+ goto -> bb14; -+ } -+ -+ bb14: { -+ goto -> bb15; -+ } -+ -+ bb15: { - goto -> bb6; - } - } - diff --git a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff deleted file mode 100644 index 4955d05214ff4..0000000000000 --- a/tests/mir-opt/jump_threading.disappearing_bb.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,79 +0,0 @@ -- // MIR for `disappearing_bb` before JumpThreading -+ // MIR for `disappearing_bb` after JumpThreading - - fn disappearing_bb(_1: u8) -> u8 { - let mut _0: u8; - let mut _2: bool; - let mut _3: bool; - - bb0: { - _2 = const true; - _3 = const true; - switchInt(copy _1) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; - } - - bb1: { - _3 = const false; -- goto -> bb4; -+ goto -> bb10; - } - - bb2: { - unreachable; - } - - bb3: { - _2 = const false; -- goto -> bb4; -+ goto -> bb13; - } - - bb4: { - switchInt(copy _3) -> [0: bb5, otherwise: bb7]; - } - - bb5: { - switchInt(copy _2) -> [0: bb6, otherwise: bb8]; - } - - bb6: { - return; - } - - bb7: { - goto -> bb5; - } - - bb8: { -+ goto -> bb6; -+ } -+ -+ bb9: { -+ switchInt(copy _3) -> [0: bb5, otherwise: bb7]; -+ } -+ -+ bb10: { -+ goto -> bb11; -+ } -+ -+ bb11: { -+ goto -> bb8; -+ } -+ -+ bb12: { -+ switchInt(copy _3) -> [0: bb5, otherwise: bb7]; -+ } -+ -+ bb13: { -+ goto -> bb14; -+ } -+ -+ bb14: { -+ goto -> bb15; -+ } -+ -+ bb15: { - goto -> bb6; - } - } - diff --git a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff deleted file mode 100644 index 083a6e7487a05..0000000000000 --- a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,45 +0,0 @@ -- // MIR for `duplicate_chain` before JumpThreading -+ // MIR for `duplicate_chain` after JumpThreading - - fn duplicate_chain(_1: bool) -> u8 { - let mut _0: u8; - let mut _2: u8; - let mut _3: i32; - let mut _4: i32; - - bb0: { - switchInt(copy _1) -> [1: bb1, otherwise: bb2]; - } - - bb1: { - _2 = const 5_u8; - goto -> bb3; - } - - bb2: { - _2 = const 5_u8; - goto -> bb3; - } - - bb3: { - _3 = const 13_i32; - goto -> bb4; - } - - bb4: { - _4 = const 15_i32; -- switchInt(copy _2) -> [5: bb5, otherwise: bb6]; -+ goto -> bb5; - } - - bb5: { - _0 = const 7_u8; - return; - } - - bb6: { - _0 = const 9_u8; - return; - } - } - diff --git a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff deleted file mode 100644 index 083a6e7487a05..0000000000000 --- a/tests/mir-opt/jump_threading.duplicate_chain.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,45 +0,0 @@ -- // MIR for `duplicate_chain` before JumpThreading -+ // MIR for `duplicate_chain` after JumpThreading - - fn duplicate_chain(_1: bool) -> u8 { - let mut _0: u8; - let mut _2: u8; - let mut _3: i32; - let mut _4: i32; - - bb0: { - switchInt(copy _1) -> [1: bb1, otherwise: bb2]; - } - - bb1: { - _2 = const 5_u8; - goto -> bb3; - } - - bb2: { - _2 = const 5_u8; - goto -> bb3; - } - - bb3: { - _3 = const 13_i32; - goto -> bb4; - } - - bb4: { - _4 = const 15_i32; -- switchInt(copy _2) -> [5: bb5, otherwise: bb6]; -+ goto -> bb5; - } - - bb5: { - _0 = const 7_u8; - return; - } - - bb6: { - _0 = const 9_u8; - return; - } - } - diff --git a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff deleted file mode 100644 index 1192f7c23e15d..0000000000000 --- a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,59 +0,0 @@ -- // MIR for `floats` before JumpThreading -+ // MIR for `floats` after JumpThreading - - fn floats() -> u32 { - let mut _0: u32; - let _1: f64; - let mut _2: bool; - let mut _3: bool; - let mut _4: f64; - scope 1 { - debug x => _1; - } - - bb0: { - StorageLive(_1); - StorageLive(_2); - _2 = const true; -- switchInt(move _2) -> [0: bb2, otherwise: bb1]; -+ goto -> bb1; - } - - bb1: { - _1 = const -0f64; - goto -> bb3; - } - - bb2: { - _1 = const 1f64; - goto -> bb3; - } - - bb3: { - StorageDead(_2); - StorageLive(_3); - StorageLive(_4); - _4 = copy _1; - _3 = Eq(move _4, const 0f64); - switchInt(move _3) -> [0: bb5, otherwise: bb4]; - } - - bb4: { - StorageDead(_4); - _0 = const 0_u32; - goto -> bb6; - } - - bb5: { - StorageDead(_4); - _0 = const 1_u32; - goto -> bb6; - } - - bb6: { - StorageDead(_3); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff deleted file mode 100644 index 1192f7c23e15d..0000000000000 --- a/tests/mir-opt/jump_threading.floats.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,59 +0,0 @@ -- // MIR for `floats` before JumpThreading -+ // MIR for `floats` after JumpThreading - - fn floats() -> u32 { - let mut _0: u32; - let _1: f64; - let mut _2: bool; - let mut _3: bool; - let mut _4: f64; - scope 1 { - debug x => _1; - } - - bb0: { - StorageLive(_1); - StorageLive(_2); - _2 = const true; -- switchInt(move _2) -> [0: bb2, otherwise: bb1]; -+ goto -> bb1; - } - - bb1: { - _1 = const -0f64; - goto -> bb3; - } - - bb2: { - _1 = const 1f64; - goto -> bb3; - } - - bb3: { - StorageDead(_2); - StorageLive(_3); - StorageLive(_4); - _4 = copy _1; - _3 = Eq(move _4, const 0f64); - switchInt(move _3) -> [0: bb5, otherwise: bb4]; - } - - bb4: { - StorageDead(_4); - _0 = const 0_u32; - goto -> bb6; - } - - bb5: { - StorageDead(_4); - _0 = const 1_u32; - goto -> bb6; - } - - bb6: { - StorageDead(_3); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff deleted file mode 100644 index ec4a93c9a4e17..0000000000000 --- a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,143 +0,0 @@ -- // MIR for `identity` before JumpThreading -+ // MIR for `identity` after JumpThreading - - fn identity(_1: Result) -> Result { - debug x => _1; - let mut _0: std::result::Result; - let mut _2: i32; - let mut _3: std::ops::ControlFlow, i32>; - let mut _4: std::result::Result; - let mut _5: isize; - let _6: std::result::Result; - let mut _7: !; - let mut _8: std::result::Result; - let _9: i32; - scope 1 { - debug residual => _6; - scope 2 { - scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { - let mut _14: isize; - let _15: i32; - let mut _16: i32; - let mut _17: bool; - scope 9 { - scope 10 (inlined >::from) { - } - } - } - } - } - scope 3 { - debug val => _9; - scope 4 { - } - } - scope 5 (inlined as Try>::branch) { - let mut _10: isize; - let _11: i32; - let _12: i32; - let mut _13: std::result::Result; - scope 6 { - } - scope 7 { - } - } - - bb0: { - StorageLive(_2); - StorageLive(_3); - StorageLive(_4); - _4 = copy _1; - StorageLive(_10); - _10 = discriminant(_4); - switchInt(move _10) -> [0: bb7, 1: bb6, otherwise: bb1]; - } - - bb1: { - unreachable; - } - - bb2: { - StorageLive(_9); - _9 = copy ((_3 as Continue).0: i32); - _2 = copy _9; - StorageDead(_9); - _0 = Result::::Ok(move _2); - StorageDead(_2); - StorageDead(_3); - goto -> bb4; - } - - bb3: { - StorageLive(_6); - _6 = copy ((_3 as Break).0: std::result::Result); - StorageLive(_8); - _8 = copy _6; - StorageLive(_14); - StorageLive(_17); - _14 = discriminant(_8); - _17 = Eq(copy _14, const 1_isize); - assume(move _17); - StorageLive(_15); - _15 = move ((_8 as Err).0: i32); - StorageLive(_16); - _16 = move _15; - _0 = Result::::Err(move _16); - StorageDead(_16); - StorageDead(_15); - StorageDead(_17); - StorageDead(_14); - StorageDead(_8); - StorageDead(_6); - StorageDead(_2); - StorageDead(_3); - goto -> bb4; - } - - bb4: { - return; - } - - bb5: { - StorageDead(_10); - StorageDead(_4); - _5 = discriminant(_3); - switchInt(move _5) -> [0: bb2, 1: bb3, otherwise: bb1]; - } - - bb6: { - StorageLive(_12); - _12 = move ((_4 as Err).0: i32); - StorageLive(_13); - _13 = Result::::Err(copy _12); - _3 = ControlFlow::, i32>::Break(move _13); - StorageDead(_13); - StorageDead(_12); -- goto -> bb5; -+ goto -> bb8; - } - - bb7: { - StorageLive(_11); - _11 = move ((_4 as Ok).0: i32); - _3 = ControlFlow::, i32>::Continue(copy _11); - StorageDead(_11); -- goto -> bb5; -+ goto -> bb9; -+ } -+ -+ bb8: { -+ StorageDead(_10); -+ StorageDead(_4); -+ _5 = discriminant(_3); -+ goto -> bb3; -+ } -+ -+ bb9: { -+ StorageDead(_10); -+ StorageDead(_4); -+ _5 = discriminant(_3); -+ goto -> bb2; - } - } - diff --git a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff deleted file mode 100644 index ec4a93c9a4e17..0000000000000 --- a/tests/mir-opt/jump_threading.identity.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,143 +0,0 @@ -- // MIR for `identity` before JumpThreading -+ // MIR for `identity` after JumpThreading - - fn identity(_1: Result) -> Result { - debug x => _1; - let mut _0: std::result::Result; - let mut _2: i32; - let mut _3: std::ops::ControlFlow, i32>; - let mut _4: std::result::Result; - let mut _5: isize; - let _6: std::result::Result; - let mut _7: !; - let mut _8: std::result::Result; - let _9: i32; - scope 1 { - debug residual => _6; - scope 2 { - scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { - let mut _14: isize; - let _15: i32; - let mut _16: i32; - let mut _17: bool; - scope 9 { - scope 10 (inlined >::from) { - } - } - } - } - } - scope 3 { - debug val => _9; - scope 4 { - } - } - scope 5 (inlined as Try>::branch) { - let mut _10: isize; - let _11: i32; - let _12: i32; - let mut _13: std::result::Result; - scope 6 { - } - scope 7 { - } - } - - bb0: { - StorageLive(_2); - StorageLive(_3); - StorageLive(_4); - _4 = copy _1; - StorageLive(_10); - _10 = discriminant(_4); - switchInt(move _10) -> [0: bb7, 1: bb6, otherwise: bb1]; - } - - bb1: { - unreachable; - } - - bb2: { - StorageLive(_9); - _9 = copy ((_3 as Continue).0: i32); - _2 = copy _9; - StorageDead(_9); - _0 = Result::::Ok(move _2); - StorageDead(_2); - StorageDead(_3); - goto -> bb4; - } - - bb3: { - StorageLive(_6); - _6 = copy ((_3 as Break).0: std::result::Result); - StorageLive(_8); - _8 = copy _6; - StorageLive(_14); - StorageLive(_17); - _14 = discriminant(_8); - _17 = Eq(copy _14, const 1_isize); - assume(move _17); - StorageLive(_15); - _15 = move ((_8 as Err).0: i32); - StorageLive(_16); - _16 = move _15; - _0 = Result::::Err(move _16); - StorageDead(_16); - StorageDead(_15); - StorageDead(_17); - StorageDead(_14); - StorageDead(_8); - StorageDead(_6); - StorageDead(_2); - StorageDead(_3); - goto -> bb4; - } - - bb4: { - return; - } - - bb5: { - StorageDead(_10); - StorageDead(_4); - _5 = discriminant(_3); - switchInt(move _5) -> [0: bb2, 1: bb3, otherwise: bb1]; - } - - bb6: { - StorageLive(_12); - _12 = move ((_4 as Err).0: i32); - StorageLive(_13); - _13 = Result::::Err(copy _12); - _3 = ControlFlow::, i32>::Break(move _13); - StorageDead(_13); - StorageDead(_12); -- goto -> bb5; -+ goto -> bb8; - } - - bb7: { - StorageLive(_11); - _11 = move ((_4 as Ok).0: i32); - _3 = ControlFlow::, i32>::Continue(copy _11); - StorageDead(_11); -- goto -> bb5; -+ goto -> bb9; -+ } -+ -+ bb8: { -+ StorageDead(_10); -+ StorageDead(_4); -+ _5 = discriminant(_3); -+ goto -> bb3; -+ } -+ -+ bb9: { -+ StorageDead(_10); -+ StorageDead(_4); -+ _5 = discriminant(_3); -+ goto -> bb2; - } - } - diff --git a/tests/mir-opt/jump_threading.logical_not.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.logical_not.JumpThreading.panic-abort.diff deleted file mode 100644 index ad8be1ef5a18e..0000000000000 --- a/tests/mir-opt/jump_threading.logical_not.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,46 +0,0 @@ -- // MIR for `logical_not` before JumpThreading -+ // MIR for `logical_not` after JumpThreading - - fn logical_not() -> i32 { - let mut _0: i32; - let _1: bool; - let mut _2: bool; - let mut _3: bool; - let mut _4: bool; - scope 1 { - debug a => _1; - } - - bb0: { - StorageLive(_1); - _1 = const false; - StorageLive(_2); - StorageLive(_3); - StorageLive(_4); - _4 = copy _1; - _3 = Not(move _4); - StorageDead(_4); - _2 = Eq(move _3, const true); -- switchInt(move _2) -> [0: bb2, otherwise: bb1]; -+ goto -> bb1; - } - - bb1: { - StorageDead(_3); - _0 = const 1_i32; - goto -> bb3; - } - - bb2: { - StorageDead(_3); - _0 = const 0_i32; - goto -> bb3; - } - - bb3: { - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.logical_not.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.logical_not.JumpThreading.panic-unwind.diff deleted file mode 100644 index ad8be1ef5a18e..0000000000000 --- a/tests/mir-opt/jump_threading.logical_not.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,46 +0,0 @@ -- // MIR for `logical_not` before JumpThreading -+ // MIR for `logical_not` after JumpThreading - - fn logical_not() -> i32 { - let mut _0: i32; - let _1: bool; - let mut _2: bool; - let mut _3: bool; - let mut _4: bool; - scope 1 { - debug a => _1; - } - - bb0: { - StorageLive(_1); - _1 = const false; - StorageLive(_2); - StorageLive(_3); - StorageLive(_4); - _4 = copy _1; - _3 = Not(move _4); - StorageDead(_4); - _2 = Eq(move _3, const true); -- switchInt(move _2) -> [0: bb2, otherwise: bb1]; -+ goto -> bb1; - } - - bb1: { - StorageDead(_3); - _0 = const 1_i32; - goto -> bb3; - } - - bb2: { - StorageDead(_3); - _0 = const 0_i32; - goto -> bb3; - } - - bb3: { - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff deleted file mode 100644 index 09c0ad6d48560..0000000000000 --- a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,54 +0,0 @@ -- // MIR for `multiple_match` before JumpThreading -+ // MIR for `multiple_match` after JumpThreading - - fn multiple_match(_1: u8) -> u8 { - let mut _0: u8; - let mut _2: u8; - let mut _3: u8; - - bb0: { - switchInt(copy _1) -> [3: bb1, otherwise: bb2]; - } - - bb1: { - _2 = copy _1; -- switchInt(copy _2) -> [3: bb3, otherwise: bb4]; -+ goto -> bb3; - } - - bb2: { - _3 = copy _1; -- switchInt(copy _3) -> [3: bb5, otherwise: bb6]; -+ goto -> bb6; - } - - bb3: { - _0 = const 5_u8; - return; - } - - bb4: { - _0 = const 7_u8; - return; - } - - bb5: { - _0 = const 9_u8; - return; - } - - bb6: { - switchInt(copy _3) -> [1: bb7, otherwise: bb8]; - } - - bb7: { - _0 = const 9_u8; - return; - } - - bb8: { - _0 = const 11_u8; - return; - } - } - diff --git a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff deleted file mode 100644 index 09c0ad6d48560..0000000000000 --- a/tests/mir-opt/jump_threading.multiple_match.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,54 +0,0 @@ -- // MIR for `multiple_match` before JumpThreading -+ // MIR for `multiple_match` after JumpThreading - - fn multiple_match(_1: u8) -> u8 { - let mut _0: u8; - let mut _2: u8; - let mut _3: u8; - - bb0: { - switchInt(copy _1) -> [3: bb1, otherwise: bb2]; - } - - bb1: { - _2 = copy _1; -- switchInt(copy _2) -> [3: bb3, otherwise: bb4]; -+ goto -> bb3; - } - - bb2: { - _3 = copy _1; -- switchInt(copy _3) -> [3: bb5, otherwise: bb6]; -+ goto -> bb6; - } - - bb3: { - _0 = const 5_u8; - return; - } - - bb4: { - _0 = const 7_u8; - return; - } - - bb5: { - _0 = const 9_u8; - return; - } - - bb6: { - switchInt(copy _3) -> [1: bb7, otherwise: bb8]; - } - - bb7: { - _0 = const 9_u8; - return; - } - - bb8: { - _0 = const 11_u8; - return; - } - } - diff --git a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff deleted file mode 100644 index bb47f57b542a5..0000000000000 --- a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,54 +0,0 @@ -- // MIR for `mutable_ref` before JumpThreading -+ // MIR for `mutable_ref` after JumpThreading - - fn mutable_ref() -> bool { - let mut _0: bool; - let mut _1: i32; - let _3: (); - let mut _4: bool; - let mut _5: i32; - scope 1 { - debug x => _1; - let _2: *mut i32; - scope 2 { - debug a => _2; - } - } - - bb0: { - StorageLive(_1); - _1 = const 5_i32; - StorageLive(_2); - _2 = &raw mut _1; - _1 = const 7_i32; - StorageLive(_3); - (*_2) = const 8_i32; - _3 = const (); - StorageDead(_3); - StorageLive(_4); - StorageLive(_5); - _5 = copy _1; - _4 = Eq(move _5, const 7_i32); - switchInt(move _4) -> [0: bb2, otherwise: bb1]; - } - - bb1: { - StorageDead(_5); - _0 = const true; - goto -> bb3; - } - - bb2: { - StorageDead(_5); - _0 = const false; - goto -> bb3; - } - - bb3: { - StorageDead(_4); - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff deleted file mode 100644 index bb47f57b542a5..0000000000000 --- a/tests/mir-opt/jump_threading.mutable_ref.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,54 +0,0 @@ -- // MIR for `mutable_ref` before JumpThreading -+ // MIR for `mutable_ref` after JumpThreading - - fn mutable_ref() -> bool { - let mut _0: bool; - let mut _1: i32; - let _3: (); - let mut _4: bool; - let mut _5: i32; - scope 1 { - debug x => _1; - let _2: *mut i32; - scope 2 { - debug a => _2; - } - } - - bb0: { - StorageLive(_1); - _1 = const 5_i32; - StorageLive(_2); - _2 = &raw mut _1; - _1 = const 7_i32; - StorageLive(_3); - (*_2) = const 8_i32; - _3 = const (); - StorageDead(_3); - StorageLive(_4); - StorageLive(_5); - _5 = copy _1; - _4 = Eq(move _5, const 7_i32); - switchInt(move _4) -> [0: bb2, otherwise: bb1]; - } - - bb1: { - StorageDead(_5); - _0 = const true; - goto -> bb3; - } - - bb2: { - StorageDead(_5); - _0 = const false; - goto -> bb3; - } - - bb3: { - StorageDead(_4); - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff deleted file mode 100644 index 7014146cb8624..0000000000000 --- a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,26 +0,0 @@ -- // MIR for `mutate_discriminant` before JumpThreading -+ // MIR for `mutate_discriminant` after JumpThreading - - fn mutate_discriminant() -> u8 { - let mut _0: u8; - let mut _1: std::option::Option; - let mut _2: isize; - - bb0: { - discriminant(_1) = 1; - (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; - _2 = discriminant(_1); - switchInt(copy _2) -> [0: bb1, otherwise: bb2]; - } - - bb1: { - _0 = const 1_u8; - return; - } - - bb2: { - _0 = const 2_u8; - unreachable; - } - } - diff --git a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff deleted file mode 100644 index 7014146cb8624..0000000000000 --- a/tests/mir-opt/jump_threading.mutate_discriminant.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,26 +0,0 @@ -- // MIR for `mutate_discriminant` before JumpThreading -+ // MIR for `mutate_discriminant` after JumpThreading - - fn mutate_discriminant() -> u8 { - let mut _0: u8; - let mut _1: std::option::Option; - let mut _2: isize; - - bb0: { - discriminant(_1) = 1; - (((_1 as variant#1).0: NonZeroUsize).0: usize) = const 0_usize; - _2 = discriminant(_1); - switchInt(copy _2) -> [0: bb1, otherwise: bb2]; - } - - bb1: { - _0 = const 1_u8; - return; - } - - bb2: { - _0 = const 2_u8; - unreachable; - } - } - diff --git a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff deleted file mode 100644 index c8edd704ff9bd..0000000000000 --- a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,61 +0,0 @@ -- // MIR for `renumbered_bb` before JumpThreading -+ // MIR for `renumbered_bb` after JumpThreading - - fn renumbered_bb(_1: bool) -> u8 { - let mut _0: u8; - let mut _2: bool; - let mut _3: bool; - - bb0: { - _3 = const false; - switchInt(copy _1) -> [1: bb1, otherwise: bb2]; - } - - bb1: { - _2 = const false; -- goto -> bb3; -+ goto -> bb9; - } - - bb2: { - _2 = copy _1; - _3 = copy _1; - goto -> bb3; - } - - bb3: { - switchInt(copy _2) -> [0: bb4, otherwise: bb5]; - } - - bb4: { - switchInt(copy _3) -> [0: bb6, otherwise: bb7]; - } - - bb5: { - _0 = const 7_u8; - return; - } - - bb6: { - _0 = const 9_u8; - return; - } - - bb7: { - _0 = const 11_u8; - return; -+ } -+ -+ bb8: { -+ switchInt(copy _2) -> [0: bb4, otherwise: bb5]; -+ } -+ -+ bb9: { -+ goto -> bb10; -+ } -+ -+ bb10: { -+ goto -> bb6; - } - } - diff --git a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff deleted file mode 100644 index c8edd704ff9bd..0000000000000 --- a/tests/mir-opt/jump_threading.renumbered_bb.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,61 +0,0 @@ -- // MIR for `renumbered_bb` before JumpThreading -+ // MIR for `renumbered_bb` after JumpThreading - - fn renumbered_bb(_1: bool) -> u8 { - let mut _0: u8; - let mut _2: bool; - let mut _3: bool; - - bb0: { - _3 = const false; - switchInt(copy _1) -> [1: bb1, otherwise: bb2]; - } - - bb1: { - _2 = const false; -- goto -> bb3; -+ goto -> bb9; - } - - bb2: { - _2 = copy _1; - _3 = copy _1; - goto -> bb3; - } - - bb3: { - switchInt(copy _2) -> [0: bb4, otherwise: bb5]; - } - - bb4: { - switchInt(copy _3) -> [0: bb6, otherwise: bb7]; - } - - bb5: { - _0 = const 7_u8; - return; - } - - bb6: { - _0 = const 9_u8; - return; - } - - bb7: { - _0 = const 11_u8; - return; -+ } -+ -+ bb8: { -+ switchInt(copy _2) -> [0: bb4, otherwise: bb5]; -+ } -+ -+ bb9: { -+ goto -> bb10; -+ } -+ -+ bb10: { -+ goto -> bb6; - } - } - diff --git a/tests/mir-opt/jump_threading.rs b/tests/mir-opt/jump_threading.rs deleted file mode 100644 index 39a2f16c5ad6f..0000000000000 --- a/tests/mir-opt/jump_threading.rs +++ /dev/null @@ -1,695 +0,0 @@ -//@ test-mir-pass: JumpThreading -//@ compile-flags: -Zmir-enable-passes=+Inline -// EMIT_MIR_FOR_EACH_PANIC_STRATEGY - -#![feature(try_trait_v2)] -#![feature(custom_mir, core_intrinsics, rustc_attrs)] - -use std::intrinsics::mir::*; -use std::ops::ControlFlow; - -fn too_complex(x: Result) -> Option { - // CHECK-LABEL: fn too_complex( - // CHECK: bb0: { - // CHECK: switchInt(move {{_.*}}) -> [0: bb3, 1: bb2, otherwise: bb1]; - // CHECK: bb1: { - // CHECK: unreachable; - // CHECK: bb2: { - // CHECK: [[controlflow:_.*]] = ControlFlow::::Break( - // CHECK: goto -> bb8; - // CHECK: bb3: { - // CHECK: [[controlflow]] = ControlFlow::::Continue( - // CHECK: goto -> bb9; - // CHECK: bb4: { - // CHECK: switchInt(move _8) -> [0: bb6, 1: bb5, otherwise: bb1]; - // CHECK: bb5: { - // CHECK: {{_.*}} = copy (([[controlflow]] as Break).0: usize); - // CHECK: _0 = Option::::None; - // CHECK: goto -> bb7; - // CHECK: bb6: { - // CHECK: {{_.*}} = copy (([[controlflow]] as Continue).0: i32); - // CHECK: _0 = Option::::Some( - // CHECK: goto -> bb7; - // CHECK: bb7: { - // CHECK: return; - // CHECK: bb8: { - // CHECK: goto -> bb5; - // CHECK: bb9: { - // CHECK: goto -> bb6; - match { - match x { - Ok(v) => ControlFlow::Continue(v), - Err(r) => ControlFlow::Break(r), - } - } { - ControlFlow::Continue(v) => Some(v), - ControlFlow::Break(r) => None, - } -} - -fn identity(x: Result) -> Result { - // CHECK-LABEL: fn identity( - // CHECK: bb0: { - // CHECK: [[x:_.*]] = copy _1; - // CHECK: switchInt(move {{_.*}}) -> [0: bb7, 1: bb6, otherwise: bb1]; - // CHECK: bb1: { - // CHECK: unreachable; - // CHECK: bb2: { - // CHECK: {{_.*}} = copy (([[controlflow:_.*]] as Continue).0: i32); - // CHECK: _0 = Result::::Ok( - // CHECK: goto -> bb4; - // CHECK: bb3: { - // CHECK: {{_.*}} = copy (([[controlflow]] as Break).0: std::result::Result); - // CHECK: _0 = Result::::Err( - // CHECK: goto -> bb4; - // CHECK: bb4: { - // CHECK: return; - // CHECK: bb5: { - // CHECK: switchInt(move _5) -> [0: bb2, 1: bb3, otherwise: bb1]; - // CHECK: bb6: { - // CHECK: {{_.*}} = move (([[x]] as Err).0: i32); - // CHECK: [[controlflow]] = ControlFlow::, i32>::Break( - // CHECK: goto -> bb8; - // CHECK: bb7: { - // CHECK: {{_.*}} = move (([[x]] as Ok).0: i32); - // CHECK: [[controlflow]] = ControlFlow::, i32>::Continue( - // CHECK: goto -> bb9; - // CHECK: bb8: { - // CHECK: goto -> bb3; - // CHECK: bb9: { - // CHECK: goto -> bb2; - Ok(x?) -} - -fn two_reads() -> i32 { - // CHECK-LABEL: fn two_reads( - // CHECK: debug a => [[a:_.*]]; - // CHECK: debug b => [[b:_.*]]; - // CHECK: debug c => [[c:_.*]]; - // CHECK: bb0: { - // CHECK: [[a]] = const 2_i32; - // CHECK: [[b]] = copy [[a]]; - // CHECK: [[c]] = copy [[a]]; - // CHECK: [[tmp:_.*]] = copy [[c]]; - // CHECK: [[eq:_.*]] = Eq(move [[tmp]], const 2_i32); - // CHECK: goto -> bb1; - // CHECK: bb1: { - // CHECK: _0 = const 0_i32; - // CHECK: goto -> bb3; - // CHECK: bb2: { - // CHECK: _0 = const 1_i32; - // CHECK: goto -> bb3; - // CHECK: bb3: { - // CHECK: return; - let a = 2; - let b = a; - let c = a; - if c == 2 { 0 } else { 1 } -} - -enum DFA { - A, - B, - C, - D, -} - -/// Check that we do not thread through a loop header, -/// to avoid creating an irreducible CFG. -fn dfa() { - // CHECK-LABEL: fn dfa( - // CHECK: bb0: { - // CHECK: {{_.*}} = DFA::A; - // CHECK: goto -> bb1; - // CHECK: bb1: { - // CHECK: switchInt({{.*}}) -> [0: bb6, 1: bb5, 2: bb4, 3: bb3, otherwise: bb2]; - // CHECK: bb2: { - // CHECK: unreachable; - // CHECK: bb3: { - // CHECK: return; - // CHECK: bb4: { - // CHECK: {{_.*}} = DFA::D; - // CHECK: goto -> bb1; - // CHECK: bb5: { - // CHECK: {{_.*}} = DFA::C; - // CHECK: goto -> bb1; - // CHECK: bb6: { - // CHECK: {{_.*}} = DFA::B; - // CHECK: goto -> bb1; - let mut state = DFA::A; - loop { - match state { - DFA::A => state = DFA::B, - DFA::B => state = DFA::C, - DFA::C => state = DFA::D, - DFA::D => return, - } - } -} - -#[repr(u8)] -enum CustomDiscr { - A = 35, - B = 73, - C = 99, -} - -/// Verify that we correctly match the discriminant value, and not its index. -fn custom_discr(x: bool) -> u8 { - // CHECK-LABEL: fn custom_discr( - // CHECK: bb0: { - // CHECK: switchInt({{.*}}) -> [0: bb2, otherwise: bb1]; - // CHECK: bb1: { - // CHECK: {{_.*}} = CustomDiscr::A; - // CHECK: goto -> bb7; - // CHECK: bb2: { - // CHECK: {{_.*}} = CustomDiscr::B; - // CHECK: goto -> bb8; - // CHECK: bb3: { - // CHECK: switchInt(move _4) -> [35: bb5, otherwise: bb4]; - // CHECK: bb4: { - // CHECK: _0 = const 13_u8; - // CHECK: goto -> bb6; - // CHECK: bb5: { - // CHECK: _0 = const 5_u8; - // CHECK: goto -> bb6; - // CHECK: bb6: { - // CHECK: return; - // CHECK: bb7: { - // CHECK: goto -> bb5; - // CHECK: bb8: { - // CHECK: goto -> bb4; - match if x { CustomDiscr::A } else { CustomDiscr::B } { - CustomDiscr::A => 5, - _ => 13, - } -} - -#[custom_mir(dialect = "runtime", phase = "post-cleanup")] -fn multiple_match(x: u8) -> u8 { - // CHECK-LABEL: fn multiple_match( - mir! { - { - // CHECK: bb0: { - // CHECK: switchInt(copy [[x:_.*]]) -> [3: bb1, otherwise: bb2]; - match x { 3 => bb1, _ => bb2 } - } - bb1 = { - // We know `x == 3`, so we can take `bb3`. - // CHECK: bb1: { - // CHECK: {{_.*}} = copy [[x]]; - // CHECK: goto -> bb3; - let y = x; - match y { 3 => bb3, _ => bb4 } - } - bb2 = { - // We know `x != 3`, so we can take `bb6`. - // CHECK: bb2: { - // CHECK: [[z:_.*]] = copy [[x]]; - // CHECK: goto -> bb6; - let z = x; - match z { 3 => bb5, _ => bb6 } - } - bb3 = { - // CHECK: bb3: { - // CHECK: _0 = const 5_u8; - // CHECK: return; - RET = 5; - Return() - } - bb4 = { - // CHECK: bb4: { - // CHECK: _0 = const 7_u8; - // CHECK: return; - RET = 7; - Return() - } - bb5 = { - // CHECK: bb5: { - // CHECK: _0 = const 9_u8; - // CHECK: return; - RET = 9; - Return() - } - bb6 = { - // We know `z != 3`, so we CANNOT take `bb7`. - // CHECK: bb6: { - // CHECK: switchInt(copy [[z]]) -> [1: bb7, otherwise: bb8]; - match z { 1 => bb7, _ => bb8 } - } - bb7 = { - // CHECK: bb7: { - // CHECK: _0 = const 9_u8; - // CHECK: return; - RET = 9; - Return() - } - bb8 = { - // CHECK: bb8: { - // CHECK: _0 = const 11_u8; - // CHECK: return; - RET = 11; - Return() - } - } -} - -/// Both 1-3-4 and 2-3-4 are threadable. As 1 and 2 are the only predecessors of 3, -/// verify that we only thread the 3-4 part. -#[custom_mir(dialect = "runtime", phase = "post-cleanup")] -fn duplicate_chain(x: bool) -> u8 { - // CHECK-LABEL: fn duplicate_chain( - mir! { - let a: u8; - { - // CHECK: bb0: { - // CHECK: switchInt({{.*}}) -> [1: bb1, otherwise: bb2]; - match x { true => bb1, _ => bb2 } - } - bb1 = { - // CHECK: bb1: { - // CHECK: [[a:_.*]] = const 5_u8; - // CHECK: goto -> bb3; - a = 5; - Goto(bb3) - } - bb2 = { - // CHECK: bb2: { - // CHECK: [[a]] = const 5_u8; - // CHECK: goto -> bb3; - a = 5; - Goto(bb3) - } - bb3 = { - // CHECK: bb3: { - // CHECK: {{_.*}} = const 13_i32; - // CHECK: goto -> bb4; - let b = 13; - Goto(bb4) - } - bb4 = { - // CHECK: bb4: { - // CHECK: {{_.*}} = const 15_i32; - // CHECK: goto -> bb5; - let c = 15; - match a { 5 => bb5, _ => bb6 } - } - bb5 = { - // CHECK: bb5: { - // CHECK: _0 = const 7_u8; - // CHECK: return; - RET = 7; - Return() - } - bb6 = { - // CHECK: bb6: { - // CHECK: _0 = const 9_u8; - // CHECK: return; - RET = 9; - Return() - } - } -} - -#[rustc_layout_scalar_valid_range_start(1)] -#[rustc_nonnull_optimization_guaranteed] -struct NonZeroUsize(usize); - -/// Verify that we correctly discard threads that may mutate a discriminant by aliasing. -#[custom_mir(dialect = "runtime", phase = "post-cleanup")] -fn mutate_discriminant() -> u8 { - // CHECK-LABEL: fn mutate_discriminant( - // CHECK-NOT: goto -> {{bb.*}}; - // CHECK: switchInt( - // CHECK-NOT: goto -> {{bb.*}}; - mir! { - let x: Option; - { - SetDiscriminant(x, 1); - // This assignment overwrites the niche in which the discriminant is stored. - place!(Field(Field(Variant(x, 1), 0), 0)) = 0_usize; - // So we cannot know the value of this discriminant. - let a = Discriminant(x); - match a { - 0 => bb1, - _ => bad, - } - } - bb1 = { - RET = 1; - Return() - } - bad = { - RET = 2; - Unreachable() - } - } -} - -/// Verify that we do not try to reason when there are mutable pointers involved. -fn mutable_ref() -> bool { - // CHECK-LABEL: fn mutable_ref( - // CHECK-NOT: goto -> {{bb.*}}; - // CHECK: switchInt( - // CHECK: goto -> [[bbret:bb.*]]; - // CHECK: goto -> [[bbret]]; - // CHECK: [[bbret]]: { - // CHECK-NOT: {{bb.*}}: { - // CHECK: return; - let mut x = 5; - let a = std::ptr::addr_of_mut!(x); - x = 7; - unsafe { *a = 8 }; - if x == 7 { true } else { false } -} - -/// This function has 2 TOs: 1-3-4 and 0-1-3-4-6. -/// We verify that the second TO does not modify 3 once the first has been applied. -#[custom_mir(dialect = "runtime", phase = "post-cleanup")] -fn renumbered_bb(x: bool) -> u8 { - // CHECK-LABEL: fn renumbered_bb( - mir! { - let a: bool; - let b: bool; - { - // CHECK: bb0: { - // CHECK: switchInt({{.*}}) -> [1: bb1, otherwise: bb2]; - b = false; - match x { true => bb1, _ => bb2 } - } - bb1 = { - // CHECK: bb1: { - // CHECK: goto -> bb9; - a = false; - Goto(bb3) - } - bb2 = { - // CHECK: bb2: { - // CHECK: goto -> bb3; - a = x; - b = x; - Goto(bb3) - } - bb3 = { - // CHECK: bb3: { - // CHECK: switchInt({{.*}}) -> [0: bb4, otherwise: bb5]; - match a { false => bb4, _ => bb5 } - } - bb4 = { - // CHECK: bb4: { - // CHECK: switchInt({{.*}}) -> [0: bb6, otherwise: bb7]; - match b { false => bb6, _ => bb7 } - } - bb5 = { - // CHECK: bb5: { - // CHECK: _0 = const 7_u8; - RET = 7; - Return() - } - bb6 = { - // CHECK: bb6: { - // CHECK: _0 = const 9_u8; - RET = 9; - Return() - } - bb7 = { - // CHECK: bb7: { - // CHECK: _0 = const 11_u8; - RET = 11; - Return() - } - // Duplicate of bb3. - // CHECK: bb8: { - // CHECK: switchInt(copy _2) -> [0: bb4, otherwise: bb5]; - // Duplicate of bb8. - // CHECK: bb9: { - // CHECK: goto -> bb10; - // Duplicate of bb4. - // CHECK: bb10: { - // CHECK: goto -> bb6; - } -} - -/// This function has 3 TOs: 1-4-5, 0-1-4-7-5-8 and 3-4-7-5-6 -/// After applying the first TO, we create bb9 to replace 4, and rename 1-4 edge by 1-9. The -/// second TO may try to thread non-existing edge 9-4. -/// This test verifies that we preserve semantics by bailing out of this second TO. -#[custom_mir(dialect = "runtime", phase = "post-cleanup")] -fn disappearing_bb(x: u8) -> u8 { - // CHECK-LABEL: fn disappearing_bb( - mir! { - let a: bool; - let b: bool; - { - // CHECK: bb0: { - a = true; - b = true; - // CHECK: switchInt({{.*}}) -> [0: bb3, 1: bb3, 2: bb1, otherwise: bb2]; - match x { 0 => bb3, 1 => bb3, 2 => bb1, _ => bb2 } - } - bb1 = { - // CHECK: bb1: { - // CHECK: goto -> bb10; - b = false; - Goto(bb4) - } - bb2 = { - // CHECK: bb2: { - // CHECK: unreachable; - Unreachable() - } - bb3 = { - // CHECK: bb3: { - // CHECK: goto -> bb13; - a = false; - Goto(bb4) - } - bb4 = { - match b { false => bb5, _ => bb7 } - } - bb5 = { - match a { false => bb6, _ => bb8 } - } - bb6 = { - Return() - } - bb7 = { - Goto(bb5) - } - bb8 = { - Goto(bb6) - } - // CHECK: bb9: { - // CHECK: switchInt(copy _3) -> [0: bb5, otherwise: bb7]; - // CHECK: bb10: { - // CHECK: goto -> bb11; - // CHECK: bb11: { - // CHECK: goto -> bb8; - // CHECK: bb12: { - // CHECK: switchInt(copy _3) -> [0: bb5, otherwise: bb7]; - // CHECK: bb13: { - // CHECK: goto -> bb14; - // CHECK: bb14: { - // CHECK: goto -> bb15; - // CHECK: bb15: { - // CHECK: goto -> bb6; - } -} - -/// Verify that we can thread jumps when we assign from an aggregate constant. -fn aggregate() -> u8 { - // CHECK-LABEL: fn aggregate( - // CHECK: debug a => [[a:_.*]]; - // CHECK: debug b => [[b:_.*]]; - // CHECK-NOT: switchInt( - // CHECK: [[a2:_.*]] = copy [[a]]; - // CHECK: {{_.*}} = Eq(move [[a2]], const 7_u8); - // CHECK-NEXT: goto -> [[bb:bb.*]]; - // CHECK: [[bb]]: { - // CHECK-NOT: } - // CHECK: _0 = copy [[a]]; - - const FOO: (u8, u8) = (5, 13); - - let (a, b) = FOO; - if a == 7 { b } else { a } -} - -/// Verify that we can leverage the existence of an `Assume` terminator. -#[custom_mir(dialect = "runtime", phase = "post-cleanup")] -fn assume(a: u8, b: bool) -> u8 { - // CHECK-LABEL: fn assume( - mir! { - { - // CHECK: bb0: { - // CHECK-NEXT: switchInt(copy _1) -> [7: bb1, otherwise: bb2] - match a { 7 => bb1, _ => bb2 } - } - bb1 = { - // CHECK: bb1: { - // CHECK-NEXT: assume(copy _2); - // CHECK-NEXT: goto -> bb6; - Assume(b); - Goto(bb3) - } - bb2 = { - // CHECK: bb2: { - // CHECK-NEXT: goto -> bb3; - Goto(bb3) - } - bb3 = { - // CHECK: bb3: { - // CHECK-NEXT: switchInt(copy _2) -> [0: bb4, otherwise: bb5]; - match b { false => bb4, _ => bb5 } - } - bb4 = { - // CHECK: bb4: { - // CHECK-NEXT: _0 = const 4_u8; - // CHECK-NEXT: return; - RET = 4; - Return() - } - bb5 = { - // CHECK: bb5: { - // CHECK-NEXT: _0 = const 5_u8; - // CHECK-NEXT: return; - RET = 5; - Return() - } - // CHECK: bb6: { - // CHECK-NEXT: goto -> bb5; - } -} - -/// Verify that jump threading succeeds seeing through copies of aggregates. -fn aggregate_copy() -> u32 { - // CHECK-LABEL: fn aggregate_copy( - // CHECK: debug a => [[a:_.*]]; - // CHECK: debug b => [[b:_.*]]; - // CHECK: debug c => [[c:_.*]]; - // CHECK-NOT: switchInt( - // CHECK: [[c2:_.*]] = copy [[c]]; - // CHECK: {{_.*}} = Eq(move [[c2]], const 2_u32); - // CHECK-NEXT: goto -> [[bb:bb.*]]; - // CHECK: [[bb]]: { - // CHECK-NOT: } - // CHECK: _0 = const 13_u32; - - const Foo: (u32, u32) = (5, 3); - - let a = Foo; - // This copies a tuple, we want to ensure that the threading condition on `b.1` propagates to a - // condition on `a.1`. - let b = a; - let c = b.1; - if c == 2 { b.0 } else { 13 } -} - -fn floats() -> u32 { - // CHECK-LABEL: fn floats( - // CHECK: switchInt( - - // Test for issue #128243, where float equality was assumed to be bitwise. - // When adding float support, it must be ensured that this continues working properly. - let x = if true { -0.0 } else { 1.0 }; - if x == 0.0 { 0 } else { 1 } -} - -pub fn bitwise_not() -> i32 { - // CHECK-LABEL: fn bitwise_not( - // CHECK: debug a => [[a:_.*]]; - // CHECK: [[a2:_.*]] = copy [[a]]; - // CHECK: [[not:_.*]] = Not(move [[a2]]); - // CHECK: {{_.*}} = Eq(move [[not]], const 0_i32); - // CHECK-NEXT: goto -> [[bb:bb.*]]; - // CHECK: [[bb]]: { - // CHECK-NOT: } - // CHECK: _0 = const 0_i32; - - // Test for #131195, which was optimizing `!a == b` into `a != b`. - let a = 1; - if !a == 0 { 1 } else { 0 } -} - -pub fn logical_not() -> i32 { - // CHECK-LABEL: fn logical_not( - // CHECK: debug a => [[a:_.*]]; - // CHECK: [[a2:_.*]] = copy [[a]]; - // CHECK: [[not:_.*]] = Not(move [[a2]]); - // CHECK: {{_.*}} = Eq(move [[not]], const true); - // CHECK-NEXT: goto -> [[bb:bb.*]]; - // CHECK: [[bb]]: { - // CHECK-NOT: } - // CHECK: _0 = const 1_i32; - - let a = false; - if !a == true { 1 } else { 0 } -} - -/// Verify that we correctly handle threading multiple conditions on the same bb. -/// One version of the implementation was buggy and mutated a bb that would be duplicated later. -fn chained_conditions() -> u8 { - // CHECK-LABEL: fn chained_conditions( - - #[inline(never)] - fn env_var() -> Option { - None - } - - enum BacktraceStyle { - Off, - Short, - Full, - }; - - let format = match env_var() { - Some(x) if &x == "full" => BacktraceStyle::Full, - Some(x) if &x == "0" => BacktraceStyle::Off, - Some(_) => BacktraceStyle::Short, - None => BacktraceStyle::Off, - }; - - match format { - BacktraceStyle::Off => 1, - BacktraceStyle::Short => 2, - BacktraceStyle::Full => 3, - } -} - -fn main() { - // CHECK-LABEL: fn main( - too_complex(Ok(0)); - identity(Ok(0)); - custom_discr(false); - dfa(); - multiple_match(5); - duplicate_chain(false); - mutate_discriminant(); - mutable_ref(); - renumbered_bb(true); - disappearing_bb(7); - aggregate(); - assume(7, false); - floats(); - bitwise_not(); - logical_not(); -} - -// EMIT_MIR jump_threading.too_complex.JumpThreading.diff -// EMIT_MIR jump_threading.identity.JumpThreading.diff -// EMIT_MIR jump_threading.two_reads.JumpThreading.diff -// EMIT_MIR jump_threading.custom_discr.JumpThreading.diff -// EMIT_MIR jump_threading.dfa.JumpThreading.diff -// EMIT_MIR jump_threading.multiple_match.JumpThreading.diff -// EMIT_MIR jump_threading.duplicate_chain.JumpThreading.diff -// EMIT_MIR jump_threading.mutate_discriminant.JumpThreading.diff -// EMIT_MIR jump_threading.mutable_ref.JumpThreading.diff -// EMIT_MIR jump_threading.renumbered_bb.JumpThreading.diff -// EMIT_MIR jump_threading.disappearing_bb.JumpThreading.diff -// EMIT_MIR jump_threading.aggregate.JumpThreading.diff -// EMIT_MIR jump_threading.assume.JumpThreading.diff -// EMIT_MIR jump_threading.aggregate_copy.JumpThreading.diff -// EMIT_MIR jump_threading.floats.JumpThreading.diff -// EMIT_MIR jump_threading.bitwise_not.JumpThreading.diff -// EMIT_MIR jump_threading.logical_not.JumpThreading.diff -// EMIT_MIR jump_threading.chained_conditions.JumpThreading.diff diff --git a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff deleted file mode 100644 index 6e0cf5ec41abd..0000000000000 --- a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,103 +0,0 @@ -- // MIR for `too_complex` before JumpThreading -+ // MIR for `too_complex` after JumpThreading - - fn too_complex(_1: Result) -> Option { - debug x => _1; - let mut _0: std::option::Option; - let mut _2: std::ops::ControlFlow; - let mut _3: isize; - let _4: i32; - let mut _5: i32; - let _6: usize; - let mut _7: usize; - let mut _8: isize; - let _9: i32; - let mut _10: i32; - let _11: usize; - scope 1 { - debug v => _4; - } - scope 2 { - debug r => _6; - } - scope 3 { - debug v => _9; - } - scope 4 { - debug r => _11; - } - - bb0: { - StorageLive(_2); - _3 = discriminant(_1); - switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1]; - } - - bb1: { - unreachable; - } - - bb2: { - StorageLive(_6); - _6 = copy ((_1 as Err).0: usize); - StorageLive(_7); - _7 = copy _6; - _2 = ControlFlow::::Break(move _7); - StorageDead(_7); - StorageDead(_6); -- goto -> bb4; -+ goto -> bb8; - } - - bb3: { - StorageLive(_4); - _4 = copy ((_1 as Ok).0: i32); - StorageLive(_5); - _5 = copy _4; - _2 = ControlFlow::::Continue(move _5); - StorageDead(_5); - StorageDead(_4); -- goto -> bb4; -+ goto -> bb9; - } - - bb4: { - _8 = discriminant(_2); - switchInt(move _8) -> [0: bb6, 1: bb5, otherwise: bb1]; - } - - bb5: { - StorageLive(_11); - _11 = copy ((_2 as Break).0: usize); - _0 = Option::::None; - StorageDead(_11); - goto -> bb7; - } - - bb6: { - StorageLive(_9); - _9 = copy ((_2 as Continue).0: i32); - StorageLive(_10); - _10 = copy _9; - _0 = Option::::Some(move _10); - StorageDead(_10); - StorageDead(_9); - goto -> bb7; - } - - bb7: { - StorageDead(_2); - return; -+ } -+ -+ bb8: { -+ _8 = discriminant(_2); -+ goto -> bb5; -+ } -+ -+ bb9: { -+ _8 = discriminant(_2); -+ goto -> bb6; - } - } - diff --git a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff deleted file mode 100644 index 6e0cf5ec41abd..0000000000000 --- a/tests/mir-opt/jump_threading.too_complex.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,103 +0,0 @@ -- // MIR for `too_complex` before JumpThreading -+ // MIR for `too_complex` after JumpThreading - - fn too_complex(_1: Result) -> Option { - debug x => _1; - let mut _0: std::option::Option; - let mut _2: std::ops::ControlFlow; - let mut _3: isize; - let _4: i32; - let mut _5: i32; - let _6: usize; - let mut _7: usize; - let mut _8: isize; - let _9: i32; - let mut _10: i32; - let _11: usize; - scope 1 { - debug v => _4; - } - scope 2 { - debug r => _6; - } - scope 3 { - debug v => _9; - } - scope 4 { - debug r => _11; - } - - bb0: { - StorageLive(_2); - _3 = discriminant(_1); - switchInt(move _3) -> [0: bb3, 1: bb2, otherwise: bb1]; - } - - bb1: { - unreachable; - } - - bb2: { - StorageLive(_6); - _6 = copy ((_1 as Err).0: usize); - StorageLive(_7); - _7 = copy _6; - _2 = ControlFlow::::Break(move _7); - StorageDead(_7); - StorageDead(_6); -- goto -> bb4; -+ goto -> bb8; - } - - bb3: { - StorageLive(_4); - _4 = copy ((_1 as Ok).0: i32); - StorageLive(_5); - _5 = copy _4; - _2 = ControlFlow::::Continue(move _5); - StorageDead(_5); - StorageDead(_4); -- goto -> bb4; -+ goto -> bb9; - } - - bb4: { - _8 = discriminant(_2); - switchInt(move _8) -> [0: bb6, 1: bb5, otherwise: bb1]; - } - - bb5: { - StorageLive(_11); - _11 = copy ((_2 as Break).0: usize); - _0 = Option::::None; - StorageDead(_11); - goto -> bb7; - } - - bb6: { - StorageLive(_9); - _9 = copy ((_2 as Continue).0: i32); - StorageLive(_10); - _10 = copy _9; - _0 = Option::::Some(move _10); - StorageDead(_10); - StorageDead(_9); - goto -> bb7; - } - - bb7: { - StorageDead(_2); - return; -+ } -+ -+ bb8: { -+ _8 = discriminant(_2); -+ goto -> bb5; -+ } -+ -+ bb9: { -+ _8 = discriminant(_2); -+ goto -> bb6; - } - } - diff --git a/tests/mir-opt/jump_threading.two_reads.JumpThreading.panic-abort.diff b/tests/mir-opt/jump_threading.two_reads.JumpThreading.panic-abort.diff deleted file mode 100644 index 090e9d37b4f93..0000000000000 --- a/tests/mir-opt/jump_threading.two_reads.JumpThreading.panic-abort.diff +++ /dev/null @@ -1,56 +0,0 @@ -- // MIR for `two_reads` before JumpThreading -+ // MIR for `two_reads` after JumpThreading - - fn two_reads() -> i32 { - let mut _0: i32; - let _1: i32; - let mut _4: bool; - let mut _5: i32; - scope 1 { - debug a => _1; - let _2: i32; - scope 2 { - debug b => _2; - let _3: i32; - scope 3 { - debug c => _3; - } - } - } - - bb0: { - StorageLive(_1); - _1 = const 2_i32; - StorageLive(_2); - _2 = copy _1; - StorageLive(_3); - _3 = copy _1; - StorageLive(_4); - StorageLive(_5); - _5 = copy _3; - _4 = Eq(move _5, const 2_i32); -- switchInt(move _4) -> [0: bb2, otherwise: bb1]; -+ goto -> bb1; - } - - bb1: { - StorageDead(_5); - _0 = const 0_i32; - goto -> bb3; - } - - bb2: { - StorageDead(_5); - _0 = const 1_i32; - goto -> bb3; - } - - bb3: { - StorageDead(_4); - StorageDead(_3); - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/jump_threading.two_reads.JumpThreading.panic-unwind.diff b/tests/mir-opt/jump_threading.two_reads.JumpThreading.panic-unwind.diff deleted file mode 100644 index 090e9d37b4f93..0000000000000 --- a/tests/mir-opt/jump_threading.two_reads.JumpThreading.panic-unwind.diff +++ /dev/null @@ -1,56 +0,0 @@ -- // MIR for `two_reads` before JumpThreading -+ // MIR for `two_reads` after JumpThreading - - fn two_reads() -> i32 { - let mut _0: i32; - let _1: i32; - let mut _4: bool; - let mut _5: i32; - scope 1 { - debug a => _1; - let _2: i32; - scope 2 { - debug b => _2; - let _3: i32; - scope 3 { - debug c => _3; - } - } - } - - bb0: { - StorageLive(_1); - _1 = const 2_i32; - StorageLive(_2); - _2 = copy _1; - StorageLive(_3); - _3 = copy _1; - StorageLive(_4); - StorageLive(_5); - _5 = copy _3; - _4 = Eq(move _5, const 2_i32); -- switchInt(move _4) -> [0: bb2, otherwise: bb1]; -+ goto -> bb1; - } - - bb1: { - StorageDead(_5); - _0 = const 0_i32; - goto -> bb3; - } - - bb2: { - StorageDead(_5); - _0 = const 1_i32; - goto -> bb3; - } - - bb3: { - StorageDead(_4); - StorageDead(_3); - StorageDead(_2); - StorageDead(_1); - return; - } - } - diff --git a/tests/mir-opt/pre-codegen/option_bubble_debug.option_traits.PreCodegen.after.panic-unwind.mir b/tests/mir-opt/pre-codegen/option_bubble_debug.option_traits.PreCodegen.after.panic-unwind.mir index b42aea38d3e35..77186f414f981 100644 --- a/tests/mir-opt/pre-codegen/option_bubble_debug.option_traits.PreCodegen.after.panic-unwind.mir +++ b/tests/mir-opt/pre-codegen/option_bubble_debug.option_traits.PreCodegen.after.panic-unwind.mir @@ -3,12 +3,12 @@ fn option_traits(_1: Option) -> Option { debug x => _1; let mut _0: std::option::Option; - let mut _2: std::ops::ControlFlow, u32>; + let mut _2: std::ops::ControlFlow, u32>; let mut _3: isize; let _4: u32; let mut _5: u32; scope 1 { - debug residual => const Option::::None; + debug residual => const Option::::None; scope 2 { } } @@ -34,7 +34,7 @@ fn option_traits(_1: Option) -> Option { } bb3: { - _0 = ops::try_trait::residual_into_try_type::, u32>(const Option::::None) -> [return: bb4, unwind continue]; + _0 = ops::try_trait::residual_into_try_type::, u32>(const Option::::None) -> [return: bb4, unwind continue]; } bb4: { diff --git a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir deleted file mode 100644 index 876fa96dfb6fe..0000000000000 --- a/tests/mir-opt/pre-codegen/simple_option_map.ezmap.PreCodegen.after.mir +++ /dev/null @@ -1,50 +0,0 @@ -// MIR for `ezmap` after PreCodegen - -fn ezmap(_1: Option) -> Option { - debug x => _1; - let mut _0: std::option::Option; - scope 1 (inlined map::) { - let mut _2: isize; - let _3: i32; - let mut _4: i32; - scope 2 { - scope 3 (inlined ezmap::{closure#0}) { - } - } - } - - bb0: { - StorageLive(_2); - _2 = discriminant(_1); - switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb4]; - } - - bb1: { - _0 = const Option::::None; - goto -> bb3; - } - - bb2: { - StorageLive(_3); - _3 = copy ((_1 as Some).0: i32); - StorageLive(_4); - _4 = Add(copy _3, const 1_i32); - _0 = Option::::Some(move _4); - StorageDead(_4); - StorageDead(_3); - goto -> bb3; - } - - bb3: { - StorageDead(_2); - return; - } - - bb4: { - unreachable; - } -} - -ALLOC0 (size: 8, align: 4) { - 00 00 00 00 __ __ __ __ │ ....░░░░ -} diff --git a/tests/mir-opt/pre-codegen/simple_option_map.map_via_question_mark.PreCodegen.after.mir b/tests/mir-opt/pre-codegen/simple_option_map.map_via_question_mark.PreCodegen.after.mir deleted file mode 100644 index ff0396b168f8b..0000000000000 --- a/tests/mir-opt/pre-codegen/simple_option_map.map_via_question_mark.PreCodegen.after.mir +++ /dev/null @@ -1,79 +0,0 @@ -// MIR for `map_via_question_mark` after PreCodegen - -fn map_via_question_mark(_1: Option) -> Option { - debug x => _1; - let mut _0: std::option::Option; - let mut _4: std::option::Option; - let mut _7: std::ops::ControlFlow, i32>; - let _8: i32; - let mut _9: i32; - scope 1 { - debug residual => const Option::::None; - scope 2 { - scope 7 (inlined as FromResidual>>::from_residual) { - let mut _3: isize; - let mut _5: bool; - } - } - } - scope 3 { - debug val => _8; - scope 4 { - } - } - scope 5 (inlined as Try>::branch) { - let mut _2: isize; - let _6: i32; - scope 6 { - } - } - - bb0: { - StorageLive(_9); - StorageLive(_7); - StorageLive(_2); - _2 = discriminant(_1); - switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb4]; - } - - bb1: { - StorageDead(_2); - StorageLive(_3); - StorageLive(_5); - _3 = discriminant(_4); - _5 = Eq(copy _3, const 0_isize); - assume(move _5); - _0 = const Option::::None; - StorageDead(_5); - StorageDead(_3); - StorageDead(_9); - StorageDead(_7); - goto -> bb3; - } - - bb2: { - StorageLive(_6); - _6 = copy ((_1 as Some).0: i32); - _7 = ControlFlow::, i32>::Continue(copy _6); - StorageDead(_6); - StorageDead(_2); - _8 = copy ((_7 as Continue).0: i32); - _9 = Add(copy _8, const 1_i32); - _0 = Option::::Some(move _9); - StorageDead(_9); - StorageDead(_7); - goto -> bb3; - } - - bb3: { - return; - } - - bb4: { - unreachable; - } -} - -ALLOC0 (size: 8, align: 4) { - 00 00 00 00 __ __ __ __ │ ....░░░░ -} diff --git a/tests/mir-opt/pre-codegen/simple_option_map.rs b/tests/mir-opt/pre-codegen/simple_option_map.rs deleted file mode 100644 index f0d7b51a64397..0000000000000 --- a/tests/mir-opt/pre-codegen/simple_option_map.rs +++ /dev/null @@ -1,42 +0,0 @@ -//@ compile-flags: -O -C debuginfo=0 -Zmir-opt-level=2 - -#[inline] -fn map(slf: Option, f: F) -> Option -where - F: FnOnce(T) -> U, -{ - match slf { - Some(x) => Some(f(x)), - None => None, - } -} - -// EMIT_MIR simple_option_map.ezmap.PreCodegen.after.mir -pub fn ezmap(x: Option) -> Option { - // We expect this to all be inlined, as though it was written without the - // combinator and without the closure, using just a plain match. - - // CHECK-LABEL: fn ezmap - // CHECK: [[INNER:_.+]] = copy ((_1 as Some).0: i32); - // CHECK: [[SUCC:_.+]] = Add({{copy|move}} [[INNER]], const 1_i32); - // CHECK: _0 = Option::::Some({{copy|move}} [[SUCC]]); - map(x, |n| n + 1) -} - -// EMIT_MIR simple_option_map.map_via_question_mark.PreCodegen.after.mir -pub fn map_via_question_mark(x: Option) -> Option { - // FIXME(#138544): Ideally this would optimize out the `ControlFlow` local. - - // CHECK-LABEL: fn map_via_question_mark - // CHECK: [[INNER:_.+]] = copy ((_1 as Some).0: i32); - // CHECK: [[TEMP1:_.+]] = ControlFlow::, i32>::Continue(copy [[INNER]]); - // CHECK: [[TEMP2:_.+]] = copy (([[TEMP1]] as Continue).0: i32); - // CHECK: [[SUCC:_.+]] = Add({{copy|move}} [[TEMP2]], const 1_i32); - // CHECK: _0 = Option::::Some({{copy|move}} [[SUCC]]); - Some(x? + 1) -} - -fn main() { - assert_eq!(None, ezmap(None)); - assert_eq!(None, map_via_question_mark(None)); -} diff --git a/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff b/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff index 5bc79f76b3706..be29296044837 100644 --- a/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff +++ b/tests/mir-opt/separate_const_switch.identity.JumpThreading.diff @@ -4,14 +4,14 @@ fn identity(_1: Result) -> Result { debug x => _1; let mut _0: std::result::Result; - let mut _2: std::ops::ControlFlow, i32>; + let mut _2: std::ops::ControlFlow, i32>; let mut _3: isize; - let _4: std::result::Result; + let _4: std::result::Result; let _5: i32; scope 1 { debug residual => _4; scope 2 { - scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { + scope 8 (inlined #[track_caller] as FromResidual>>::from_residual) { let mut _10: isize; let _11: i32; let mut _12: bool; @@ -31,7 +31,7 @@ let mut _6: isize; let _7: i32; let _8: i32; - let mut _9: std::result::Result; + let mut _9: std::result::Result; scope 6 { } scope 7 { @@ -58,7 +58,7 @@ bb3: { StorageLive(_4); - _4 = copy ((_2 as Break).0: std::result::Result); + _4 = copy ((_2 as Break).0: std::result::Result); StorageLive(_10); StorageLive(_12); _10 = discriminant(_4); @@ -85,8 +85,8 @@ StorageLive(_8); _8 = copy ((_1 as Err).0: i32); StorageLive(_9); - _9 = Result::::Err(copy _8); - _2 = ControlFlow::, i32>::Break(move _9); + _9 = Result::::Err(copy _8); + _2 = ControlFlow::, i32>::Break(move _9); StorageDead(_9); StorageDead(_8); - goto -> bb4; @@ -96,7 +96,7 @@ bb6: { StorageLive(_7); _7 = copy ((_1 as Ok).0: i32); - _2 = ControlFlow::, i32>::Continue(copy _7); + _2 = ControlFlow::, i32>::Continue(copy _7); StorageDead(_7); - goto -> bb4; + goto -> bb8; From 56fd4bbde56d628e092cf705bec78a2fc79ee768 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 24 Apr 2026 13:46:01 +0200 Subject: [PATCH 11/14] allow my patch to be used --- src/tools/tidy/src/extdeps.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/tidy/src/extdeps.rs b/src/tools/tidy/src/extdeps.rs index 7999386a3c298..631d7f68ad097 100644 --- a/src/tools/tidy/src/extdeps.rs +++ b/src/tools/tidy/src/extdeps.rs @@ -11,6 +11,8 @@ const ALLOWED_SOURCES: &[&str] = &[ r#""registry+https://github.com/rust-lang/crates.io-index""#, // This is `rust_team_data` used by `site` in src/tools/rustc-perf, r#""git+https://github.com/rust-lang/team#a5260e76d3aa894c64c56e6ddc8545b9a98043ec""#, + // cargo depends on gix which breaks with Infallible = !, fallback = () + r#""git+https://github.com/WaffleLapkin/gitoxide.git?rev=5f35221159e1e31292aa5e706c7d495e53e061a2#5f35221159e1e31292aa5e706c7d495e53e061a2""#, ]; /// Checks for external package sources. `root` is the path to the directory that contains the From 534e9dd3af067b1172ce1f985805872e7fac217e Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 24 Apr 2026 13:49:25 +0200 Subject: [PATCH 12/14] fixup cargo --- src/tools/cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/cargo b/src/tools/cargo index 06ac0e7c05770..f66761d148060 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit 06ac0e7c05770a8c7bbf67bdd12fa1a1eefdc8ae +Subproject commit f66761d148060caf20d70aea403740d0aece4d3c From cb4b20b10723b65ccde4d9b6b1030de85869d249 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 24 Apr 2026 15:00:59 +0200 Subject: [PATCH 13/14] =?UTF-8?q?=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0?= =?UTF-8?q?=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/build_helper/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/build_helper/src/lib.rs b/src/build_helper/src/lib.rs index e23a158ac0598..6ecff61e2916d 100644 --- a/src/build_helper/src/lib.rs +++ b/src/build_helper/src/lib.rs @@ -14,7 +14,7 @@ pub mod util; /// The default set of crates for opt-dist to collect LLVM profiles. pub const LLVM_PGO_CRATES: &[&str] = &[ "syn-2.0.101", - "cargo-0.87.1", + // "cargo-0.87.1", "serde-1.0.219", "ripgrep-14.1.1", "regex-automata-0.4.8", @@ -26,7 +26,7 @@ pub const LLVM_PGO_CRATES: &[&str] = &[ pub const RUSTC_PGO_CRATES: &[&str] = &[ "externs", "ctfe-stress-5", - "cargo-0.87.1", + // "cargo-0.87.1", "token-stream-stress", "match-stress", "tuple-stress", From babc577d99db036230a4f4908523a12936800c6b Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 24 Apr 2026 15:05:44 +0200 Subject: [PATCH 14/14] illformed-element-type.rs --- .../illformed-element-type.stderr | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/ui/scalable-vectors/illformed-element-type.stderr b/tests/ui/scalable-vectors/illformed-element-type.stderr index 52a4346570702..f8ca8b76215f7 100644 --- a/tests/ui/scalable-vectors/illformed-element-type.stderr +++ b/tests/ui/scalable-vectors/illformed-element-type.stderr @@ -1,5 +1,5 @@ error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:16:1 + --> $DIR/illformed-element-type.rs:15:1 | LL | struct TyChar(char); | ^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | struct TyChar(char); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:20:1 + --> $DIR/illformed-element-type.rs:19:1 | LL | struct TyConstPtr(*const u8); | ^^^^^^^^^^^^^^^^^ @@ -15,7 +15,7 @@ LL | struct TyConstPtr(*const u8); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:24:1 + --> $DIR/illformed-element-type.rs:23:1 | LL | struct TyMutPtr(*mut u8); | ^^^^^^^^^^^^^^^ @@ -23,7 +23,7 @@ LL | struct TyMutPtr(*mut u8); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:28:1 + --> $DIR/illformed-element-type.rs:27:1 | LL | struct TyStruct(Foo); | ^^^^^^^^^^^^^^^ @@ -31,7 +31,7 @@ LL | struct TyStruct(Foo); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:32:1 + --> $DIR/illformed-element-type.rs:31:1 | LL | struct TyEnum(Bar); | ^^^^^^^^^^^^^ @@ -39,7 +39,7 @@ LL | struct TyEnum(Bar); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:36:1 + --> $DIR/illformed-element-type.rs:35:1 | LL | struct TyUnion(Baz); | ^^^^^^^^^^^^^^ @@ -47,7 +47,7 @@ LL | struct TyUnion(Baz); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:40:1 + --> $DIR/illformed-element-type.rs:39:1 | LL | struct TyForeign(Qux); | ^^^^^^^^^^^^^^^^ @@ -55,7 +55,7 @@ LL | struct TyForeign(Qux); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:44:1 + --> $DIR/illformed-element-type.rs:43:1 | LL | struct TyArray([u32; 4]); | ^^^^^^^^^^^^^^ @@ -63,7 +63,7 @@ LL | struct TyArray([u32; 4]); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:48:1 + --> $DIR/illformed-element-type.rs:47:1 | LL | struct TySlice([u32]); | ^^^^^^^^^^^^^^ @@ -71,7 +71,7 @@ LL | struct TySlice([u32]); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:52:1 + --> $DIR/illformed-element-type.rs:51:1 | LL | struct TyRef<'a>(&'a u32); | ^^^^^^^^^^^^^^^^ @@ -79,7 +79,7 @@ LL | struct TyRef<'a>(&'a u32); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:56:1 + --> $DIR/illformed-element-type.rs:55:1 | LL | struct TyFnPtr(fn(u32) -> u32); | ^^^^^^^^^^^^^^ @@ -87,7 +87,7 @@ LL | struct TyFnPtr(fn(u32) -> u32); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:60:1 + --> $DIR/illformed-element-type.rs:59:1 | LL | struct TyDyn(dyn std::io::Write); | ^^^^^^^^^^^^ @@ -95,7 +95,7 @@ LL | struct TyDyn(dyn std::io::Write); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:64:1 + --> $DIR/illformed-element-type.rs:63:1 | LL | struct TyNever(!); | ^^^^^^^^^^^^^^ @@ -103,7 +103,7 @@ LL | struct TyNever(!); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:68:1 + --> $DIR/illformed-element-type.rs:67:1 | LL | struct TyTuple((u32, u32)); | ^^^^^^^^^^^^^^ @@ -111,7 +111,7 @@ LL | struct TyTuple((u32, u32)); = help: only `u*`, `i*`, `f*` and `bool` types are accepted error: element type of a scalable vector must be a primitive scalar - --> $DIR/illformed-element-type.rs:78:1 + --> $DIR/illformed-element-type.rs:77:1 | LL | struct TyInvalidAlias(InvalidAlias); | ^^^^^^^^^^^^^^^^^^^^^