From da75d32083c15a540ef3dd45e47d172a199e1a9c Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sat, 9 Jan 2021 17:04:25 +0100 Subject: [PATCH 1/9] Remove unused allow_internal_unstable on core::panic. --- library/core/src/macros/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 1634aff7b4dc9..c75eddaac173c 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -1,6 +1,6 @@ #[doc(include = "panic.md")] #[macro_export] -#[allow_internal_unstable(core_panic, const_caller_location)] +#[allow_internal_unstable(core_panic)] #[stable(feature = "core", since = "1.6.0")] #[rustc_diagnostic_item = "core_panic_macro"] macro_rules! panic { From 53c7f3f10181f8791074cd76446c0cdda34132d6 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sat, 9 Jan 2021 16:52:06 +0100 Subject: [PATCH 2/9] Implement new panic!() behaviour for Rust 2021. --- compiler/rustc_builtin_macros/src/lib.rs | 3 ++ compiler/rustc_builtin_macros/src/panic.rs | 39 ++++++++++++++++++++++ compiler/rustc_lint/src/panic_fmt.rs | 11 +++--- compiler/rustc_span/src/symbol.rs | 4 +++ library/core/src/macros/mod.rs | 14 ++++++++ library/core/src/panic.rs | 34 +++++++++++++++++++ library/std/src/lib.rs | 1 + library/std/src/macros.rs | 14 ++++++++ library/std/src/panic.rs | 30 +++++++++++++++++ 9 files changed, 144 insertions(+), 6 deletions(-) create mode 100644 compiler/rustc_builtin_macros/src/panic.rs diff --git a/compiler/rustc_builtin_macros/src/lib.rs b/compiler/rustc_builtin_macros/src/lib.rs index ed76d51231d0b..32c06324384f4 100644 --- a/compiler/rustc_builtin_macros/src/lib.rs +++ b/compiler/rustc_builtin_macros/src/lib.rs @@ -34,6 +34,7 @@ mod global_allocator; mod global_asm; mod llvm_asm; mod log_syntax; +mod panic; mod source_util; mod test; mod trace_macros; @@ -82,6 +83,8 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand, edition: Editi log_syntax: log_syntax::expand_log_syntax, module_path: source_util::expand_mod, option_env: env::expand_option_env, + core_panic_macro: panic::expand_panic, + std_panic_macro: panic::expand_panic, stringify: source_util::expand_stringify, trace_macros: trace_macros::expand_trace_macros, } diff --git a/compiler/rustc_builtin_macros/src/panic.rs b/compiler/rustc_builtin_macros/src/panic.rs new file mode 100644 index 0000000000000..2babee16f07c4 --- /dev/null +++ b/compiler/rustc_builtin_macros/src/panic.rs @@ -0,0 +1,39 @@ +use rustc_ast::ptr::P; +use rustc_ast::tokenstream::{DelimSpan, TokenStream}; +use rustc_ast::*; +use rustc_expand::base::*; +use rustc_span::symbol::sym; +use rustc_span::Span; + +pub fn expand_panic<'cx>( + cx: &'cx mut ExtCtxt<'_>, + sp: Span, + tts: TokenStream, +) -> Box { + let panic = if sp.rust_2021() { sym::panic_2021 } else { sym::panic_2015 }; + + let sp = cx.with_call_site_ctxt(sp); + + MacEager::expr( + cx.expr( + sp, + ExprKind::MacCall(MacCall { + path: Path { + span: sp, + segments: cx + .std_path(&[sym::panic, panic]) + .into_iter() + .map(|ident| PathSegment::from_ident(ident)) + .collect(), + tokens: None, + }, + args: P(MacArgs::Delimited( + DelimSpan::from_single(sp), + MacDelimiter::Parenthesis, + tts, + )), + prior_type_ascription: None, + }), + ), + ) +} diff --git a/compiler/rustc_lint/src/panic_fmt.rs b/compiler/rustc_lint/src/panic_fmt.rs index 0d2b20989b0c3..775edc4803531 100644 --- a/compiler/rustc_lint/src/panic_fmt.rs +++ b/compiler/rustc_lint/src/panic_fmt.rs @@ -19,10 +19,9 @@ declare_lint! { /// /// ### Explanation /// - /// `panic!("{}")` panics with the message `"{}"`, as a `panic!()` invocation - /// with a single argument does not use `format_args!()`. - /// A future edition of Rust will interpret this string as format string, - /// which would break this. + /// In Rust 2018 and earlier, `panic!("{}")` panics with the message `"{}"`, + /// as a `panic!()` invocation with a single argument does not use `format_args!()`. + /// Rust 2021 interprets this string as format string, which breaks this. PANIC_FMT, Warn, "detect braces in single-argument panic!() invocations", @@ -50,8 +49,8 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc if let ast::LitKind::Str(sym, _) = lit.node { let mut expn = f.span.ctxt().outer_expn_data(); if let Some(id) = expn.macro_def_id { - if cx.tcx.is_diagnostic_item(sym::std_panic_macro, id) - || cx.tcx.is_diagnostic_item(sym::core_panic_macro, id) + if cx.tcx.is_diagnostic_item(sym::std_panic_2015_macro, id) + || cx.tcx.is_diagnostic_item(sym::core_panic_2015_macro, id) { let fmt = sym.as_str(); if !fmt.contains(&['{', '}'][..]) { diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index b6cf584d875f1..2708db25c5918 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -398,6 +398,7 @@ symbols! { copysignf64, core, core_intrinsics, + core_panic_2015_macro, core_panic_macro, cosf32, cosf64, @@ -794,6 +795,8 @@ symbols! { owned_box, packed, panic, + panic_2015, + panic_2021, panic_abort, panic_bounds_check, panic_handler, @@ -1095,6 +1098,7 @@ symbols! { staticlib, std, std_inject, + std_panic_2015_macro, std_panic_macro, stmt, stmt_expr_attributes, diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index c75eddaac173c..f5cd479460cd7 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -1,3 +1,4 @@ +#[cfg(bootstrap)] #[doc(include = "panic.md")] #[macro_export] #[allow_internal_unstable(core_panic)] @@ -18,6 +19,19 @@ macro_rules! panic { ); } +#[cfg(not(bootstrap))] +#[doc(include = "panic.md")] +#[macro_export] +#[rustc_builtin_macro = "core_panic_macro"] +#[allow_internal_unstable(edition_panic)] +#[stable(feature = "core", since = "1.6.0")] +#[rustc_diagnostic_item = "core_panic_macro"] +macro_rules! panic { + // Expands to either `$crate::panic_2015` or `$crate::panic_2021` + // depending on the edition of the caller. + ($($arg:tt)*) => { /* compiler built-in */ }; +} + /// Asserts that two expressions are equal to each other (using [`PartialEq`]). /// /// On panic, this macro will print the values of the expressions with their diff --git a/library/core/src/panic.rs b/library/core/src/panic.rs index 03bb849509ad4..cbb10c324c495 100644 --- a/library/core/src/panic.rs +++ b/library/core/src/panic.rs @@ -5,6 +5,40 @@ use crate::any::Any; use crate::fmt; +#[doc(hidden)] +#[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")] +#[allow_internal_unstable(core_panic)] +#[rustc_diagnostic_item = "core_panic_2015_macro"] +#[rustc_macro_transparency = "semitransparent"] +pub macro panic_2015 { + () => ( + $crate::panicking::panic("explicit panic") + ), + ($msg:literal $(,)?) => ( + $crate::panicking::panic($msg) + ), + ($msg:expr $(,)?) => ( + $crate::panicking::panic_str($msg) + ), + ($fmt:expr, $($arg:tt)+) => ( + $crate::panicking::panic_fmt($crate::format_args!($fmt, $($arg)+)) + ), +} + +#[doc(hidden)] +#[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")] +#[allow_internal_unstable(core_panic)] +#[rustc_diagnostic_item = "core_panic_2021_macro"] +#[rustc_macro_transparency = "semitransparent"] +pub macro panic_2021 { + () => ( + $crate::panicking::panic("explicit panic") + ), + ($($t:tt)+) => ( + $crate::panicking::panic_fmt($crate::format_args!($($t)+)) + ), +} + /// A struct providing information about a panic. /// /// `PanicInfo` structure is passed to a panic hook set by the [`set_hook`] diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 15ef5d1619ba3..df982543f188a 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -258,6 +258,7 @@ #![feature(dropck_eyepatch)] #![feature(duration_constants)] #![feature(duration_zero)] +#![feature(edition_panic)] #![feature(exact_size_is_empty)] #![feature(exhaustive_patterns)] #![feature(extend_one)] diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index 5a70aa070e870..89ecfaadfefaa 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -4,6 +4,7 @@ //! library. Each macro is available for use when linking against the standard //! library. +#[cfg(bootstrap)] #[doc(include = "../../core/src/macros/panic.md")] #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] @@ -17,6 +18,19 @@ macro_rules! panic { }); } +#[cfg(not(bootstrap))] +#[doc(include = "../../core/src/macros/panic.md")] +#[macro_export] +#[rustc_builtin_macro = "std_panic_macro"] +#[stable(feature = "rust1", since = "1.0.0")] +#[allow_internal_unstable(edition_panic)] +#[cfg_attr(not(test), rustc_diagnostic_item = "std_panic_macro")] +macro_rules! panic { + // Expands to either `$crate::panic_2015` or `$crate::panic_2021` + // depending on the edition of the caller. + ($($arg:tt)*) => { /* compiler built-in */ }; +} + /// Prints to the standard output. /// /// Equivalent to the [`println!`] macro except that a newline is not printed at diff --git a/library/std/src/panic.rs b/library/std/src/panic.rs index d18b94b6c1aef..fef0fcca80749 100644 --- a/library/std/src/panic.rs +++ b/library/std/src/panic.rs @@ -17,6 +17,36 @@ use crate::sync::{Arc, Mutex, RwLock}; use crate::task::{Context, Poll}; use crate::thread::Result; +#[doc(hidden)] +#[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")] +#[allow_internal_unstable(libstd_sys_internals)] +#[cfg_attr(not(test), rustc_diagnostic_item = "std_panic_2015_macro")] +#[rustc_macro_transparency = "semitransparent"] +pub macro panic_2015 { + () => ({ + $crate::rt::begin_panic("explicit panic") + }), + ($msg:expr $(,)?) => ({ + $crate::rt::begin_panic($msg) + }), + ($fmt:expr, $($arg:tt)+) => ({ + $crate::rt::begin_panic_fmt(&$crate::format_args!($fmt, $($arg)+)) + }), +} + +#[doc(hidden)] +#[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")] +#[allow_internal_unstable(libstd_sys_internals)] +#[rustc_macro_transparency = "semitransparent"] +pub macro panic_2021 { + () => ({ + $crate::rt::begin_panic("explicit panic") + }), + ($($t:tt)+) => ({ + $crate::rt::begin_panic_fmt(&$crate::format_args!($($t)+)) + }), +} + #[stable(feature = "panic_hooks", since = "1.10.0")] pub use crate::panicking::{set_hook, take_hook}; From 348d4516f56fb743483eff9579538ff299fc420a Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sat, 9 Jan 2021 19:27:38 +0100 Subject: [PATCH 3/9] Fix panic_fmt lint for new panic!() -> panic_2015!() expansion. --- compiler/rustc_lint/src/panic_fmt.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_lint/src/panic_fmt.rs b/compiler/rustc_lint/src/panic_fmt.rs index 775edc4803531..4a6aca72acbbe 100644 --- a/compiler/rustc_lint/src/panic_fmt.rs +++ b/compiler/rustc_lint/src/panic_fmt.rs @@ -74,9 +74,15 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc let n_arguments = (&mut fmt_parser).filter(|a| matches!(a, Piece::NextArgument(_))).count(); - // Unwrap another level of macro expansion if this panic!() - // was expanded from assert!() or debug_assert!(). - for &assert in &[sym::assert_macro, sym::debug_assert_macro] { + // Unwrap more levels of macro expansion, as panic_2015!() + // was likely expanded from panic!() and possibly from + // [debug_]assert!(). + for &assert in &[ + sym::std_panic_macro, + sym::core_panic_macro, + sym::assert_macro, + sym::debug_assert_macro, + ] { let parent = expn.call_site.ctxt().outer_expn_data(); if parent .macro_def_id From dfe6bfef3e1c8062994eef5955be0d81a23048ab Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sun, 10 Jan 2021 15:38:18 +0100 Subject: [PATCH 4/9] Update expected test output. --- .../const-eval/feature-gate-const_panic.stderr | 12 ++++++------ src/test/ui/consts/const-eval/unwind-abort.stderr | 2 +- src/test/ui/consts/const-unwrap.stderr | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr b/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr index 56746c04f5cd7..29c98c45c4e4c 100644 --- a/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr +++ b/src/test/ui/consts/const-eval/feature-gate-const_panic.stderr @@ -9,20 +9,20 @@ LL | const Z: () = panic!("cheese"); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: panicking in constants is unstable - --> $DIR/feature-gate-const_panic.rs:9:15 + --> $DIR/feature-gate-const_panic.rs:6:15 | -LL | const X: () = unimplemented!(); - | ^^^^^^^^^^^^^^^^ +LL | const Y: () = unreachable!(); + | ^^^^^^^^^^^^^^ | = note: see issue #51999 for more information = help: add `#![feature(const_panic)]` to the crate attributes to enable = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0658]: panicking in constants is unstable - --> $DIR/feature-gate-const_panic.rs:6:15 + --> $DIR/feature-gate-const_panic.rs:9:15 | -LL | const Y: () = unreachable!(); - | ^^^^^^^^^^^^^^ +LL | const X: () = unimplemented!(); + | ^^^^^^^^^^^^^^^^ | = note: see issue #51999 for more information = help: add `#![feature(const_panic)]` to the crate attributes to enable diff --git a/src/test/ui/consts/const-eval/unwind-abort.stderr b/src/test/ui/consts/const-eval/unwind-abort.stderr index eee1a35a0dc88..8a90fdfc5751b 100644 --- a/src/test/ui/consts/const-eval/unwind-abort.stderr +++ b/src/test/ui/consts/const-eval/unwind-abort.stderr @@ -5,7 +5,7 @@ LL | panic!() | ^^^^^^^^ | | | the evaluated program panicked at 'explicit panic', $DIR/unwind-abort.rs:5:5 - | inside `foo` at $SRC_DIR/std/src/macros.rs:LL:COL + | inside `foo` at $SRC_DIR/std/src/panic.rs:LL:COL | inside `_` at $DIR/unwind-abort.rs:8:15 ... LL | const _: () = foo(); diff --git a/src/test/ui/consts/const-unwrap.stderr b/src/test/ui/consts/const-unwrap.stderr index 6500baab0771a..b2e037c69cb00 100644 --- a/src/test/ui/consts/const-unwrap.stderr +++ b/src/test/ui/consts/const-unwrap.stderr @@ -5,7 +5,7 @@ LL | None => panic!("called `Option::unwrap()` on a `None` value"), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | the evaluated program panicked at 'called `Option::unwrap()` on a `None` value', $DIR/const-unwrap.rs:9:38 - | inside `Option::::unwrap` at $SRC_DIR/core/src/macros/mod.rs:LL:COL + | inside `Option::::unwrap` at $SRC_DIR/core/src/panic.rs:LL:COL | inside `BAR` at $DIR/const-unwrap.rs:9:18 | ::: $DIR/const-unwrap.rs:9:1 From 932f723bd233e50e8fc0404f4096071fa1c6ae0a Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sun, 10 Jan 2021 15:54:56 +0100 Subject: [PATCH 5/9] Formatting. --- library/core/src/macros/mod.rs | 4 +++- library/std/src/macros.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index f5cd479460cd7..36c390babebe9 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -29,7 +29,9 @@ macro_rules! panic { macro_rules! panic { // Expands to either `$crate::panic_2015` or `$crate::panic_2021` // depending on the edition of the caller. - ($($arg:tt)*) => { /* compiler built-in */ }; + ($($arg:tt)*) => { + /* compiler built-in */ + }; } /// Asserts that two expressions are equal to each other (using [`PartialEq`]). diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index 89ecfaadfefaa..cc021ff345eb3 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -28,7 +28,9 @@ macro_rules! panic { macro_rules! panic { // Expands to either `$crate::panic_2015` or `$crate::panic_2021` // depending on the edition of the caller. - ($($arg:tt)*) => { /* compiler built-in */ }; + ($($arg:tt)*) => { + /* compiler built-in */ + }; } /// Prints to the standard output. From e1b3d094abd634a9c1d77a7f226c180da7ed19b2 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sun, 10 Jan 2021 18:28:40 +0100 Subject: [PATCH 6/9] Update miri_unleashed test output. --- .../const_refers_to_static_cross_crate.rs | 1 + .../const_refers_to_static_cross_crate.stderr | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs index 08d68b039bead..ba3b61a3fa732 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs @@ -32,6 +32,7 @@ const U8_MUT3: &u8 = { //~ NOTE unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None => panic!() } } //~^ WARN [const_err] //~| NOTE constant accesses static + //~| NOTE in this expansion of panic! }; pub fn test(x: &[u8; 1]) -> bool { diff --git a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr index b65e50eb9f419..743fa326e7afe 100644 --- a/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr +++ b/src/test/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr @@ -11,7 +11,7 @@ LL | | }; = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:39:9 + --> $DIR/const_refers_to_static_cross_crate.rs:40:9 | LL | SLICE_MUT => true, | ^^^^^^^^^ @@ -29,7 +29,7 @@ LL | | }; = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:48:9 + --> $DIR/const_refers_to_static_cross_crate.rs:49:9 | LL | U8_MUT => true, | ^^^^^^ @@ -52,7 +52,7 @@ LL | #[warn(const_err)] | ^^^^^^^^^ error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:59:9 + --> $DIR/const_refers_to_static_cross_crate.rs:60:9 | LL | U8_MUT2 => true, | ^^^^^^^ @@ -65,6 +65,7 @@ LL | | unsafe { match static_cross_crate::OPT_ZERO { Some(ref u) => u, None | | ^^^^^^^^^^^ constant accesses static LL | | LL | | +LL | | LL | | }; | |__- | @@ -75,31 +76,31 @@ LL | #[warn(const_err)] | ^^^^^^^^^ error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:67:9 + --> $DIR/const_refers_to_static_cross_crate.rs:68:9 | LL | U8_MUT3 => true, | ^^^^^^^ error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:39:9 + --> $DIR/const_refers_to_static_cross_crate.rs:40:9 | LL | SLICE_MUT => true, | ^^^^^^^^^ error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:48:9 + --> $DIR/const_refers_to_static_cross_crate.rs:49:9 | LL | U8_MUT => true, | ^^^^^^ error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:59:9 + --> $DIR/const_refers_to_static_cross_crate.rs:60:9 | LL | U8_MUT2 => true, | ^^^^^^^ error: could not evaluate constant pattern - --> $DIR/const_refers_to_static_cross_crate.rs:67:9 + --> $DIR/const_refers_to_static_cross_crate.rs:68:9 | LL | U8_MUT3 => true, | ^^^^^^^ From 105b85f53c48c2f1e7be66a08a18ac82a9e0273f Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sun, 10 Jan 2021 19:39:17 +0100 Subject: [PATCH 7/9] Update mir-opt test output. --- ...l_flow_simplification.hello.ConstProp.diff | 10 +- .../issue_73223.main.PreCodegen.32bit.diff | 100 ++++----- .../issue_73223.main.PreCodegen.64bit.diff | 100 ++++----- ..._73223.main.SimplifyArmIdentity.32bit.diff | 206 +++++++++--------- ..._73223.main.SimplifyArmIdentity.64bit.diff | 206 +++++++++--------- ...76432.test.SimplifyComparisonIntegral.diff | 8 +- ...wrap.SimplifyCfg-elaborate-drops.after.mir | 10 +- 7 files changed, 320 insertions(+), 320 deletions(-) diff --git a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff index 0d06c4960b363..60fb90688e393 100644 --- a/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff +++ b/src/test/mir-opt/const_prop/control_flow_simplification.hello.ConstProp.diff @@ -4,7 +4,7 @@ fn hello() -> () { let mut _0: (); // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14 let mut _1: bool; // in scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 - let mut _2: !; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _2: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL bb0: { StorageLive(_1); // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21 @@ -21,16 +21,16 @@ } bb2: { - StorageLive(_2); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + StorageLive(_2); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL + begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/std/src/macros.rs:LL:COL + // + span: $SRC_DIR/std/src/panic.rs:LL:COL // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar()) } // ty::Const // + ty: &str // + val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) // mir::Constant - // + span: $SRC_DIR/std/src/macros.rs:LL:COL + // + span: $SRC_DIR/std/src/panic.rs:LL:COL // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) } } } diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff index 4db83c5c683d2..8caf932d74e16 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.32bit.diff @@ -11,16 +11,16 @@ let mut _9: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _10: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _11: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _12: std::fmt::Arguments; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _12: std::fmt::Arguments; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _13: &[&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _14: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _15: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _16: (&&i32, &&i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _14: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let _15: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _16: (&&i32, &&i32); // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let _17: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _18: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _19: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _20: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _21: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _20: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _21: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL scope 1 { debug split => _1; // in scope 1 at $DIR/issue-73223.rs:2:9: 2:14 let _4: std::option::Option; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14 @@ -34,30 +34,30 @@ scope 5 { debug arg0 => _24; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug arg1 => _27; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 6 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug x => _24; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug f => _23; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _22: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _23: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _24: &&i32; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 6 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug x => _24; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + debug f => _23; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _22: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _23: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _24: &&i32; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL scope 7 { } } - scope 8 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug x => _27; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug f => _26; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _25: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _26: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _27: &&i32; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 8 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug x => _27; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + debug f => _26; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _25: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _26: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _27: &&i32; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL scope 9 { } } } - scope 10 (inlined Arguments::new_v1) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug pieces => (_12.0: &[&str]); // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug args => _29; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _28: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _29: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 10 (inlined Arguments::new_v1) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug pieces => (_12.0: &[&str]); // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + debug args => _29; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _28: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _29: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL } } } @@ -120,7 +120,7 @@ // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) } (_12.0: &[&str]) = move _13 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_15); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _17 = _7; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_16.0: &&i32) = &_17; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -128,63 +128,63 @@ StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _19 = _8; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _18 = &_19; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_16.1: &&i32) = move _18; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_16.1: &&i32) = move _18; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_18); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL _24 = (_16.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _27 = (_16.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _23 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar()) } - StorageLive(_22); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _22 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _23) -> bb3; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_22); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _22 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _23) -> bb3; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute:: fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar()) } } bb3: { - (_20.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_20.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar()) } } bb4: { - (_20.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _22; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_22); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_20.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _22; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_22); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL _26 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar()) } - StorageLive(_25); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _25 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _26) -> bb5; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _25 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _26) -> bb5; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute:: fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar()) } } bb5: { - (_21.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _27) -> bb6; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_21.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _27) -> bb6; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar()) } } bb6: { - (_21.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _25; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_25); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _15 = [move _20, move _21]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _14 = &_15; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _29 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_28); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_28) = 0; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_12.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _28; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_12.2: &[std::fmt::ArgumentV1]) = move _29; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_28); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - core::panicking::panic_fmt(move _12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_21.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _25; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_25); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _15 = [move _20, move _21]; // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + _14 = &_15; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + _29 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_28); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + discriminant(_28) = 0; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_12.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _28; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_12.2: &[std::fmt::ArgumentV1]) = move _29; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_28); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + core::panicking::panic_fmt(move _12); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: for<'r> fn(std::fmt::Arguments<'r>) -> ! {core::panicking::panic_fmt}, val: Value(Scalar()) } } } diff --git a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff index 4db83c5c683d2..8caf932d74e16 100644 --- a/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.PreCodegen.64bit.diff @@ -11,16 +11,16 @@ let mut _9: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _10: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _11: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _12: std::fmt::Arguments; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _12: std::fmt::Arguments; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _13: &[&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _14: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _15: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _16: (&&i32, &&i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _14: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let _15: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _16: (&&i32, &&i32); // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let _17: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _18: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _19: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _20: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _21: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _20: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _21: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL scope 1 { debug split => _1; // in scope 1 at $DIR/issue-73223.rs:2:9: 2:14 let _4: std::option::Option; // in scope 1 at $DIR/issue-73223.rs:7:9: 7:14 @@ -34,30 +34,30 @@ scope 5 { debug arg0 => _24; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug arg1 => _27; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 6 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug x => _24; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug f => _23; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _22: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _23: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _24: &&i32; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 6 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug x => _24; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + debug f => _23; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _22: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _23: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _24: &&i32; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL scope 7 { } } - scope 8 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug x => _27; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug f => _26; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _25: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _26: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _27: &&i32; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 8 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug x => _27; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + debug f => _26; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _25: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _26: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _27: &&i32; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL scope 9 { } } } - scope 10 (inlined Arguments::new_v1) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug pieces => (_12.0: &[&str]); // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug args => _29; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _28: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _29: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 10 (inlined Arguments::new_v1) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug pieces => (_12.0: &[&str]); // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + debug args => _29; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _28: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _29: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL } } } @@ -120,7 +120,7 @@ // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: &[&str; 3], val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ issue_73223[317d]::main), const_param_did: None }, [], Some(promoted[0])) } (_12.0: &[&str]) = move _13 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_15); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_15); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _17 = _7; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL (_16.0: &&i32) = &_17; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -128,63 +128,63 @@ StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _19 = _8; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _18 = &_19; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_16.1: &&i32) = move _18; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_16.1: &&i32) = move _18; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_18); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL _24 = (_16.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _27 = (_16.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _23 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar()) } - StorageLive(_22); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _22 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _23) -> bb3; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_22); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _22 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _23) -> bb3; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute:: fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar()) } } bb3: { - (_20.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_20.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _24) -> bb4; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar()) } } bb4: { - (_20.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _22; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_22); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_20.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _22; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_22); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL _26 = <&i32 as Debug>::fmt as for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> (Pointer(ReifyFnPointer)); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar()) } - StorageLive(_25); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _25 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _26) -> bb5; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _25 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _26) -> bb5; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute:: fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar()) } } bb5: { - (_21.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _27) -> bb6; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_21.0: &core::fmt::Opaque) = transmute::<&&i32, &core::fmt::Opaque>(move _27) -> bb6; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar()) } } bb6: { - (_21.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _25; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_25); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _15 = [move _20, move _21]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _14 = &_15; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _29 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_28); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_28) = 0; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_12.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _28; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_12.2: &[std::fmt::ArgumentV1]) = move _29; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_28); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - core::panicking::panic_fmt(move _12); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_21.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _25; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_25); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _15 = [move _20, move _21]; // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + _14 = &_15; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + _29 = move _14 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_28); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + discriminant(_28) = 0; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_12.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _28; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_12.2: &[std::fmt::ArgumentV1]) = move _29; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_28); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + core::panicking::panic_fmt(move _12); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: for<'r> fn(std::fmt::Arguments<'r>) -> ! {core::panicking::panic_fmt}, val: Value(Scalar()) } } } diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff index 4e362f3556b20..5a8e2598ff4ef 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.32bit.diff @@ -18,25 +18,25 @@ let mut _16: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _17: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _18: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _19: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _20: std::fmt::Arguments; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _19: !; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _20: std::fmt::Arguments; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _21: &[&str]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _22: &[&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _23: &[&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _24: [&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _25: &[std::fmt::ArgumentV1]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _26: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _27: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _28: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _29: (&&i32, &&i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _25: &[std::fmt::ArgumentV1]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _26: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let _27: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let _28: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _29: (&&i32, &&i32); // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _30: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _31: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _32: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _33: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _36: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _36: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _37: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _38: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _39: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _39: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _40: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _41: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 1 { @@ -56,33 +56,33 @@ scope 5 { debug arg0 => _34; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug arg1 => _35; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 6 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug x => _37; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug f => _38; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _44: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _45: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _46: &core::fmt::Opaque; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _47: &&i32; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 6 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug x => _37; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + debug f => _38; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _44: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _45: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _46: &core::fmt::Opaque; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _47: &&i32; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL scope 7 { } } - scope 8 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug x => _40; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug f => _41; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _48: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _49: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _50: &core::fmt::Opaque; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _51: &&i32; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 8 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug x => _40; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + debug f => _41; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _48: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _49: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _50: &core::fmt::Opaque; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _51: &&i32; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL scope 9 { } } } - scope 10 (inlined Arguments::new_v1) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug pieces => _21; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug args => _25; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _52: &[&str]; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _53: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _54: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 10 (inlined Arguments::new_v1) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug pieces => _21; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + debug args => _25; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _52: &[&str]; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _53: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _54: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL } } } @@ -168,8 +168,8 @@ } bb4: { - StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_19); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_20); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_21); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_22); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_23); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -184,11 +184,11 @@ _22 = _23; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _21 = move _22 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_22); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_25); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_26); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_27); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_28); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_29); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_26); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_27); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_28); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_29); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_30); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_31); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _31 = _13; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -197,15 +197,15 @@ StorageLive(_33); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _33 = _14; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _32 = &_33; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_29.0: &&i32) = move _30; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_29.1: &&i32) = move _32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_30); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_29.0: &&i32) = move _30; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + (_29.1: &&i32) = move _32; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_32); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_30); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_34); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _34 = (_29.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_35); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _35 = (_29.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_36); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_36); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_37); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _37 = _34; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_38); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -213,35 +213,35 @@ // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar()) } - StorageLive(_44); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_45); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _45 = _38; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _44 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _45) -> bb5; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_44); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_45); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _45 = _38; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _44 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _45) -> bb5; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute:: fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar()) } } bb5: { - StorageDead(_45); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_46); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_47); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _47 = _37; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _46 = transmute::<&&i32, &core::fmt::Opaque>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_45); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_46); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_47); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _47 = _37; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _46 = transmute::<&&i32, &core::fmt::Opaque>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar()) } } bb6: { - StorageDead(_47); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_36.0: &core::fmt::Opaque) = move _46; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_36.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _44; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_46); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_44); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_38); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_37); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_47); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + (_36.0: &core::fmt::Opaque) = move _46; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + (_36.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _44; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_46); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_44); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_38); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_37); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_39); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_40); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _40 = _35; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_41); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -249,60 +249,60 @@ // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar()) } - StorageLive(_48); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_49); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _49 = _41; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _48 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _49) -> bb7; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_48); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_49); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _49 = _41; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _48 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _49) -> bb7; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute:: fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar()) } } bb7: { - StorageDead(_49); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_50); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_51); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _51 = _40; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _50 = transmute::<&&i32, &core::fmt::Opaque>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_49); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_50); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_51); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _51 = _40; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _50 = transmute::<&&i32, &core::fmt::Opaque>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar()) } } bb8: { - StorageDead(_51); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_39.0: &core::fmt::Opaque) = move _50; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_39.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _48; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_50); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_48); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_41); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_40); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _28 = [move _36, move _39]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_36); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_35); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_34); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _27 = &_28; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _26 = _27; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_26); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_52); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _52 = _21; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_53); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_53) = 0; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_54); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _54 = _25; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_20.0: &[&str]) = move _52; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_20.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _53; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_20.2: &[std::fmt::ArgumentV1]) = move _54; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_54); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_53); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_52); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_25); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_21); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - core::panicking::panic_fmt(move _20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_51); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + (_39.0: &core::fmt::Opaque) = move _50; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + (_39.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _48; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_50); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_48); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_41); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_40); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + _28 = [move _36, move _39]; // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_39); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_36); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_35); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_34); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + _27 = &_28; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + _26 = _27; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_26); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_52); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + _52 = _21; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_53); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + discriminant(_53) = 0; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_54); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + _54 = _25; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_20.0: &[&str]) = move _52; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_20.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _53; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_20.2: &[std::fmt::ArgumentV1]) = move _54; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_54); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_53); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_52); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_25); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_21); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + core::panicking::panic_fmt(move _20); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: for<'r> fn(std::fmt::Arguments<'r>) -> ! {core::panicking::panic_fmt}, val: Value(Scalar()) } } } diff --git a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff index 4e362f3556b20..5a8e2598ff4ef 100644 --- a/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff +++ b/src/test/mir-opt/issue_73223.main.SimplifyArmIdentity.64bit.diff @@ -18,25 +18,25 @@ let mut _16: bool; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _17: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _18: i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _19: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _20: std::fmt::Arguments; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _19: !; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _20: std::fmt::Arguments; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _21: &[&str]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _22: &[&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _23: &[&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _24: [&str; 3]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _25: &[std::fmt::ArgumentV1]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _26: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _27: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _28: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _29: (&&i32, &&i32); // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _25: &[std::fmt::ArgumentV1]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _26: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let _27: &[std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let _28: [std::fmt::ArgumentV1; 2]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _29: (&&i32, &&i32); // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _30: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _31: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _32: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let _33: &i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _36: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _36: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _37: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _38: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _39: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _39: std::fmt::ArgumentV1; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL let mut _40: &&i32; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL let mut _41: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 1 { @@ -56,33 +56,33 @@ scope 5 { debug arg0 => _34; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL debug arg1 => _35; // in scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - scope 6 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug x => _37; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug f => _38; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _44: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _45: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _46: &core::fmt::Opaque; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _47: &&i32; // in scope 6 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 6 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug x => _37; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + debug f => _38; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _44: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _45: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _46: &core::fmt::Opaque; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _47: &&i32; // in scope 6 at $SRC_DIR/core/src/panic.rs:LL:COL scope 7 { } } - scope 8 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug x => _40; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug f => _41; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _48: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _49: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _50: &core::fmt::Opaque; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _51: &&i32; // in scope 8 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 8 (inlined ArgumentV1::new::<&i32>) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug x => _40; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + debug f => _41; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _48: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _49: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _50: &core::fmt::Opaque; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _51: &&i32; // in scope 8 at $SRC_DIR/core/src/panic.rs:LL:COL scope 9 { } } } - scope 10 (inlined Arguments::new_v1) { // at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug pieces => _21; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - debug args => _25; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _52: &[&str]; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _53: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _54: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + scope 10 (inlined Arguments::new_v1) { // at $SRC_DIR/core/src/panic.rs:LL:COL + debug pieces => _21; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + debug args => _25; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _52: &[&str]; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _53: std::option::Option<&[std::fmt::rt::v1::Argument]>; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + let mut _54: &[std::fmt::ArgumentV1]; // in scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL } } } @@ -168,8 +168,8 @@ } bb4: { - StorageLive(_19); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_19); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_20); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_21); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_22); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_23); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -184,11 +184,11 @@ _22 = _23; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _21 = move _22 as &[&str] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageDead(_22); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_25); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_26); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_27); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_28); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_29); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_25); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_26); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_27); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_28); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_29); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_30); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_31); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _31 = _13; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -197,15 +197,15 @@ StorageLive(_33); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _33 = _14; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _32 = &_33; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_29.0: &&i32) = move _30; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_29.1: &&i32) = move _32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_30); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + (_29.0: &&i32) = move _30; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + (_29.1: &&i32) = move _32; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_32); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_30); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_34); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _34 = (_29.0: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_35); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _35 = (_29.1: &&i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_36); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_36); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_37); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _37 = _34; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_38); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -213,35 +213,35 @@ // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar()) } - StorageLive(_44); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_45); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _45 = _38; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _44 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _45) -> bb5; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_44); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_45); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _45 = _38; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _44 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _45) -> bb5; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute:: fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar()) } } bb5: { - StorageDead(_45); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_46); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_47); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _47 = _37; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _46 = transmute::<&&i32, &core::fmt::Opaque>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_45); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_46); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_47); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _47 = _37; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + _46 = transmute::<&&i32, &core::fmt::Opaque>(move _47) -> bb6; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar()) } } bb6: { - StorageDead(_47); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_36.0: &core::fmt::Opaque) = move _46; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_36.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _44; // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_46); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_44); // scope 7 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_38); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_37); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_47); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + (_36.0: &core::fmt::Opaque) = move _46; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + (_36.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _44; // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_46); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_44); // scope 7 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_38); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_37); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_39); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL StorageLive(_40); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL _40 = _35; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL StorageLive(_41); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL @@ -249,60 +249,60 @@ // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL // + literal: Const { ty: for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {<&i32 as std::fmt::Debug>::fmt}, val: Value(Scalar()) } - StorageLive(_48); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_49); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _49 = _41; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _48 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _49) -> bb7; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_48); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_49); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _49 = _41; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _48 = transmute:: fn(&'r &i32, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>(move _49) -> bb7; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(for<'r, 's, 't0> fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) -> for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error> {std::intrinsics::transmute:: fn(&'r &i32, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>, for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>>}, val: Value(Scalar()) } } bb7: { - StorageDead(_49); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_50); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_51); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _51 = _40; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _50 = transmute::<&&i32, &core::fmt::Opaque>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_49); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_50); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_51); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _51 = _40; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + _50 = transmute::<&&i32, &core::fmt::Opaque>(move _51) -> bb8; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(&&i32) -> &core::fmt::Opaque {std::intrinsics::transmute::<&&i32, &core::fmt::Opaque>}, val: Value(Scalar()) } } bb8: { - StorageDead(_51); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_39.0: &core::fmt::Opaque) = move _50; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_39.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _48; // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_50); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_48); // scope 9 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_41); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_40); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _28 = [move _36, move _39]; // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_39); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_36); // scope 5 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_35); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_34); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _27 = &_28; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _26 = _27; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_26); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_52); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _52 = _21; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_53); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - discriminant(_53) = 0; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_54); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _54 = _25; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_20.0: &[&str]) = move _52; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_20.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _53; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - (_20.2: &[std::fmt::ArgumentV1]) = move _54; // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_54); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_53); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_52); // scope 10 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_25); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_21); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - core::panicking::panic_fmt(move _20); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageDead(_51); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + (_39.0: &core::fmt::Opaque) = move _50; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + (_39.1: for<'r, 's, 't0> fn(&'r core::fmt::Opaque, &'s mut std::fmt::Formatter<'t0>) -> std::result::Result<(), std::fmt::Error>) = move _48; // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_50); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_48); // scope 9 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_41); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_40); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + _28 = [move _36, move _39]; // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_39); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_36); // scope 5 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_35); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_34); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + _27 = &_28; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + _26 = _27; // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + _25 = move _26 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_26); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_52); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + _52 = _21; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_53); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + discriminant(_53) = 0; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageLive(_54); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + _54 = _25; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_20.0: &[&str]) = move _52; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_20.1: std::option::Option<&[std::fmt::rt::v1::Argument]>) = move _53; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + (_20.2: &[std::fmt::ArgumentV1]) = move _54; // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_54); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_53); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_52); // scope 10 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_25); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + StorageDead(_21); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL + core::panicking::panic_fmt(move _20); // scope 4 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: for<'r> fn(std::fmt::Arguments<'r>) -> ! {core::panicking::panic_fmt}, val: Value(Scalar()) } } } diff --git a/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff b/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff index 6450a2a22c6ca..7913ad260e893 100644 --- a/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff @@ -21,7 +21,7 @@ let mut _19: *const T; // in scope 0 at $DIR/issue_76432.rs:9:54: 9:68 let mut _20: *const T; // in scope 0 at $DIR/issue_76432.rs:9:70: 9:84 let mut _21: *const T; // in scope 0 at $DIR/issue_76432.rs:9:70: 9:84 - let mut _22: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _22: !; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL scope 1 { debug v => _2; // in scope 1 at $DIR/issue_76432.rs:7:9: 7:10 let _13: &T; // in scope 1 at $DIR/issue_76432.rs:9:10: 9:16 @@ -64,10 +64,10 @@ } bb1: { - StorageLive(_22); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - core::panicking::panic(const "internal error: entered unreachable code"); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + StorageLive(_22); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL + core::panicking::panic(const "internal error: entered unreachable code"); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + span: $SRC_DIR/core/src/panic.rs:LL:COL // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(Scalar()) } // ty::Const // + ty: &str diff --git a/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir b/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir index 1e4b329830bd5..75e0656dd7bbf 100644 --- a/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir +++ b/src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir @@ -5,7 +5,7 @@ fn unwrap(_1: Option) -> T { let mut _0: T; // return place in scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:33: 7:34 let mut _2: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16 let _3: T; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15 - let mut _4: !; // in scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + let mut _4: !; // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL let mut _5: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 let mut _6: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 let mut _7: isize; // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2 @@ -19,16 +19,16 @@ fn unwrap(_1: Option) -> T { } bb1: { - StorageLive(_4); // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL - begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/std/src/macros.rs:LL:COL + StorageLive(_4); // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL + begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL // mir::Constant - // + span: $SRC_DIR/std/src/macros.rs:LL:COL + // + span: $SRC_DIR/std/src/panic.rs:LL:COL // + literal: Const { ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}, val: Value(Scalar()) } // ty::Const // + ty: &str // + val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) // mir::Constant - // + span: $SRC_DIR/std/src/macros.rs:LL:COL + // + span: $SRC_DIR/std/src/panic.rs:LL:COL // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [101, 120, 112, 108, 105, 99, 105, 116, 32, 112, 97, 110, 105, 99], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [16383], len: Size { raw: 14 } }, size: Size { raw: 14 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 14 }) } } From 00c5996af0233bcda5d6b750671939936334f191 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Tue, 12 Jan 2021 18:23:20 +0100 Subject: [PATCH 8/9] Use correct path in panic!() comment. --- library/core/src/macros/mod.rs | 2 +- library/std/src/macros.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index 36c390babebe9..de346afe6f367 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -27,7 +27,7 @@ macro_rules! panic { #[stable(feature = "core", since = "1.6.0")] #[rustc_diagnostic_item = "core_panic_macro"] macro_rules! panic { - // Expands to either `$crate::panic_2015` or `$crate::panic_2021` + // Expands to either `$crate::panic::panic_2015` or `$crate::panic::panic_2021` // depending on the edition of the caller. ($($arg:tt)*) => { /* compiler built-in */ diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index cc021ff345eb3..b59d22cba09b4 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -26,7 +26,7 @@ macro_rules! panic { #[allow_internal_unstable(edition_panic)] #[cfg_attr(not(test), rustc_diagnostic_item = "std_panic_macro")] macro_rules! panic { - // Expands to either `$crate::panic_2015` or `$crate::panic_2021` + // Expands to either `$crate::panic::panic_2015` or `$crate::panic::panic_2021` // depending on the edition of the caller. ($($arg:tt)*) => { /* compiler built-in */ From c5273bdfb266c35e8eab9413aa8d58d27fdbe114 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sat, 9 Jan 2021 20:11:08 +0100 Subject: [PATCH 9/9] Make std::panic_2021 an alias for core::panic_2021. --- library/std/src/panic.rs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/library/std/src/panic.rs b/library/std/src/panic.rs index fef0fcca80749..9f544fae97917 100644 --- a/library/std/src/panic.rs +++ b/library/std/src/panic.rs @@ -36,16 +36,7 @@ pub macro panic_2015 { #[doc(hidden)] #[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")] -#[allow_internal_unstable(libstd_sys_internals)] -#[rustc_macro_transparency = "semitransparent"] -pub macro panic_2021 { - () => ({ - $crate::rt::begin_panic("explicit panic") - }), - ($($t:tt)+) => ({ - $crate::rt::begin_panic_fmt(&$crate::format_args!($($t)+)) - }), -} +pub use core::panic::panic_2021; #[stable(feature = "panic_hooks", since = "1.10.0")] pub use crate::panicking::{set_hook, take_hook};