From 3c0d5ee3ff47c75b796a63cef7f741a765dae332 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Mon, 20 Dec 2021 22:09:20 +0100 Subject: [PATCH] Experiment with panic() vs panic!(). --- library/core/src/macros/mod.rs | 9 ++- library/core/src/option.rs | 6 +- ...76432.test.SimplifyComparisonIntegral.diff | 77 +++---------------- ...ue_59352.num_to_digit.PreCodegen.after.mir | 63 ++++++++++----- .../ui/consts/const-eval/const_panic.stderr | 8 +- .../consts/const-eval/const_panic_2021.stderr | 8 +- .../const-eval/const_panic_libcore_bin.stderr | 4 +- .../issue-87258_a.stderr | 2 +- .../issue-87258_b.stderr | 2 +- src/test/ui/proc-macro/quote-debug.stdout | 8 +- 10 files changed, 79 insertions(+), 108 deletions(-) diff --git a/library/core/src/macros/mod.rs b/library/core/src/macros/mod.rs index b18508186a618..af6718df6536f 100644 --- a/library/core/src/macros/mod.rs +++ b/library/core/src/macros/mod.rs @@ -589,9 +589,10 @@ macro_rules! writeln { /// ``` #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] +#[allow_internal_unstable(core_panic)] macro_rules! unreachable { () => ({ - $crate::panic!("internal error: entered unreachable code") + $crate::panicking::panic("internal error: entered unreachable code") }); ($msg:expr $(,)?) => ({ $crate::unreachable!("{}", $msg) @@ -674,8 +675,9 @@ macro_rules! unreachable { /// ``` #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] +#[allow_internal_unstable(core_panic)] macro_rules! unimplemented { - () => ($crate::panic!("not implemented")); + () => ($crate::panicking::panic("not implemented")); ($($arg:tt)+) => ($crate::panic!("not implemented: {}", $crate::format_args!($($arg)+))); } @@ -735,8 +737,9 @@ macro_rules! unimplemented { /// ``` #[macro_export] #[stable(feature = "todo_macro", since = "1.40.0")] +#[allow_internal_unstable(core_panic)] macro_rules! todo { - () => ($crate::panic!("not yet implemented")); + () => ($crate::panicking::panic("not yet implemented")); ($($arg:tt)+) => ($crate::panic!("not yet implemented: {}", $crate::format_args!($($arg)+))); } diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 8969c6f617130..e6312b8b2d947 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -501,6 +501,7 @@ #![stable(feature = "rust1", since = "1.0.0")] use crate::iter::{FromIterator, FusedIterator, TrustedLen}; +use crate::panicking::{panic, panic_str}; use crate::pin::Pin; use crate::{ convert, hint, mem, @@ -755,7 +756,7 @@ impl Option { pub const fn unwrap(self) -> T { match self { Some(val) => val, - None => panic!("called `Option::unwrap()` on a `None` value"), + None => panic("called `Option::unwrap()` on a `None` value"), } } @@ -1815,8 +1816,9 @@ impl Option> { #[cfg_attr(feature = "panic_immediate_abort", inline)] #[cold] #[track_caller] +#[rustc_const_unstable(feature = "const_option", issue = "67441")] const fn expect_failed(msg: &str) -> ! { - panic!("{}", msg) + panic_str(msg) } ///////////////////////////////////////////////////////////////////////////// diff --git a/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff b/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff index 30c547b86ceb7..57485993dced0 100644 --- a/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff +++ b/src/test/mir-opt/issue_76432.test.SimplifyComparisonIntegral.diff @@ -21,34 +21,18 @@ 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/panic.rs:LL:COL - let mut _23: std::fmt::Arguments; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL - let mut _24: &[&str]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _25: &[&str; 1]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _26: &[&str; 1]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let _27: [&str; 1]; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - let mut _28: &[std::fmt::ArgumentV1]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL - let mut _29: &[std::fmt::ArgumentV1; 0]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL - let _30: &[std::fmt::ArgumentV1; 0]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL - let _31: [std::fmt::ArgumentV1; 0]; // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL - let mut _32: (); // in scope 0 at $SRC_DIR/core/src/panic.rs:LL:COL - let mut _36: &[T; 3]; // in scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + let mut _22: !; // in scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL + let mut _23: &[T; 3]; // in scope 0 at $DIR/issue_76432.rs:7:19: 7:29 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 let _14: &T; // in scope 1 at $DIR/issue_76432.rs:9:18: 9:24 let _15: &T; // in scope 1 at $DIR/issue_76432.rs:9:26: 9:32 - let _33: (); // in scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - let mut _34: &[std::fmt::ArgumentV1; 0]; // in scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - let mut _35: &[&str; 1]; // in scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL scope 2 { debug v1 => _13; // in scope 2 at $DIR/issue_76432.rs:9:10: 9:16 debug v2 => _14; // in scope 2 at $DIR/issue_76432.rs:9:18: 9:24 debug v3 => _15; // in scope 2 at $DIR/issue_76432.rs:9:26: 9:32 } - scope 3 { - debug _args => _33; // in scope 3 at $SRC_DIR/core/src/panic.rs:LL:COL - } } bb0: { @@ -68,59 +52,31 @@ StorageDead(_6); // scope 0 at $DIR/issue_76432.rs:7:28: 7:29 _4 = &_5; // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 _3 = _4; // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 - StorageLive(_36); // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 - _36 = _3; // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + StorageLive(_23); // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 + _23 = _3; // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 _2 = move _3 as &[T] (Pointer(Unsize)); // scope 0 at $DIR/issue_76432.rs:7:19: 7:29 StorageDead(_3); // scope 0 at $DIR/issue_76432.rs:7:28: 7:29 StorageDead(_4); // scope 0 at $DIR/issue_76432.rs:7:29: 7:30 StorageLive(_9); // scope 1 at $DIR/issue_76432.rs:8:5: 11:6 _10 = const 3_usize; // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 - StorageDead(_36); // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 + StorageDead(_23); // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 _11 = const 3_usize; // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 _12 = const true; // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 goto -> bb2; // scope 1 at $DIR/issue_76432.rs:9:9: 9:33 } bb1: { - StorageLive(_22); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - StorageLive(_23); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - StorageLive(_24); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_25); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_26); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _35 = const test::::promoted[1]; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - // ty::Const - // + ty: &[&str; 1] - // + val: Unevaluated(test, [T], Some(promoted[1])) + 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 // mir::Constant // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL - // + literal: Const { ty: &[&str; 1], val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:6 ~ issue_76432[HASH]::test), const_param_did: None }, substs_: Some([T]), promoted: Some(promoted[1]) }) } - _26 = _35; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _25 = _26; // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - _24 = move _25 as &[&str] (Pointer(Unsize)); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageDead(_25); // scope 1 at $SRC_DIR/core/src/macros/mod.rs:LL:COL - StorageLive(_28); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - StorageLive(_29); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - StorageLive(_30); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - StorageLive(_32); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - StorageLive(_33); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - nop; // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - StorageDead(_33); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - _34 = const test::::promoted[0]; // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL + // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(Scalar()) } // ty::Const - // + ty: &[std::fmt::ArgumentV1; 0] - // + val: Unevaluated(test, [T], Some(promoted[0])) + // + ty: &str + // + val: Value(Slice { data: Allocation { bytes: [105, 110, 116, 101, 114, 110, 97, 108, 32, 101, 114, 114, 111, 114, 58, 32, 101, 110, 116, 101, 114, 101, 100, 32, 117, 110, 114, 101, 97, 99, 104, 97, 98, 108, 101, 32, 99, 111, 100, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1099511627775], len: Size { raw: 40 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 40 }) // mir::Constant - // + span: $SRC_DIR/core/src/panic.rs:LL:COL - // + literal: Const { ty: &[std::fmt::ArgumentV1; 0], val: Unevaluated(Unevaluated { def: WithOptConstParam { did: DefId(0:6 ~ issue_76432[HASH]::test), const_param_did: None }, substs_: Some([T]), promoted: Some(promoted[0]) }) } - _30 = _34; // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - _29 = _30; // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - _28 = move _29 as &[std::fmt::ArgumentV1] (Pointer(Unsize)); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - StorageDead(_29); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - _23 = Arguments::new_v1(move _24, move _28) -> bb3; // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - // mir::Constant - // + span: $SRC_DIR/core/src/panic.rs:LL:COL - // + user_ty: UserType(5) - // + literal: Const { ty: fn(&[&'static str], &[std::fmt::ArgumentV1]) -> std::fmt::Arguments {std::fmt::Arguments::new_v1}, val: Value(Scalar()) } + // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL + // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [105, 110, 116, 101, 114, 110, 97, 108, 32, 101, 114, 114, 111, 114, 58, 32, 101, 110, 116, 101, 114, 101, 100, 32, 117, 110, 114, 101, 97, 99, 104, 97, 98, 108, 101, 32, 99, 111, 100, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [1099511627775], len: Size { raw: 40 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 40 }) } } bb2: { @@ -158,14 +114,5 @@ StorageDead(_2); // scope 0 at $DIR/issue_76432.rs:12:1: 12:2 return; // scope 0 at $DIR/issue_76432.rs:12:2: 12:2 } - - bb3: { - StorageDead(_28); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - StorageDead(_24); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - panic_fmt(move _23); // scope 1 at $SRC_DIR/core/src/panic.rs:LL:COL - // mir::Constant - // + span: $SRC_DIR/core/src/panic.rs:LL:COL - // + literal: Const { ty: for<'r> fn(std::fmt::Arguments<'r>) -> ! {std::rt::panic_fmt}, val: Value(Scalar()) } - } } diff --git a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir b/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir index 2bbc882103108..d028f0b989a68 100644 --- a/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir +++ b/src/test/mir-opt/issues/issue_59352.num_to_digit.PreCodegen.after.mir @@ -7,7 +7,7 @@ fn num_to_digit(_1: char) -> u32 { let mut _3: std::option::Option; // in scope 0 at $DIR/issue-59352.rs:14:26: 14:41 let mut _4: char; // in scope 0 at $DIR/issue-59352.rs:14:26: 14:29 let mut _5: u32; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:23 - let mut _10: isize; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + let mut _11: isize; // in scope 0 at $DIR/issue-59352.rs:14:8: 14:23 scope 1 (inlined char::methods::::is_digit) { // at $DIR/issue-59352.rs:14:8: 14:23 debug self => _2; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23 debug radix => _5; // in scope 1 at $DIR/issue-59352.rs:14:8: 14:23 @@ -19,6 +19,13 @@ fn num_to_digit(_1: char) -> u32 { let mut _9: isize; // in scope 2 at $DIR/issue-59352.rs:14:8: 14:23 } } + scope 3 (inlined #[track_caller] Option::::unwrap) { // at $DIR/issue-59352.rs:14:26: 14:50 + debug self => _3; // in scope 3 at $DIR/issue-59352.rs:14:26: 14:50 + let mut _10: isize; // in scope 3 at $DIR/issue-59352.rs:14:26: 14:50 + scope 4 { + debug val => _0; // in scope 4 at $DIR/issue-59352.rs:14:26: 14:50 + } + } bb0: { StorageLive(_2); // scope 0 at $DIR/issue-59352.rs:14:8: 14:11 @@ -29,14 +36,14 @@ fn num_to_digit(_1: char) -> u32 { StorageLive(_7); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 StorageLive(_8); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 _8 = _2; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 - _7 = char::methods::::to_digit(move _8, const 8_u32) -> bb6; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 + _7 = char::methods::::to_digit(move _8, const 8_u32) -> bb5; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 // mir::Constant // + span: $DIR/issue-59352.rs:14:8: 14:23 // + literal: Const { ty: fn(char, u32) -> std::option::Option {std::char::methods::::to_digit}, val: Value(Scalar()) } } bb1: { - StorageDead(_10); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + StorageDead(_11); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 StorageLive(_3); // scope 0 at $DIR/issue-59352.rs:14:26: 14:41 StorageLive(_4); // scope 0 at $DIR/issue-59352.rs:14:26: 14:29 _4 = _1; // scope 0 at $DIR/issue-59352.rs:14:26: 14:29 @@ -48,39 +55,57 @@ fn num_to_digit(_1: char) -> u32 { bb2: { StorageDead(_4); // scope 0 at $DIR/issue-59352.rs:14:40: 14:41 - _0 = Option::::unwrap(move _3) -> bb3; // scope 0 at $DIR/issue-59352.rs:14:26: 14:50 - // mir::Constant - // + span: $DIR/issue-59352.rs:14:42: 14:48 - // + literal: Const { ty: fn(std::option::Option) -> u32 {std::option::Option::::unwrap}, val: Value(Scalar()) } + StorageLive(_10); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50 + _10 = discriminant(_3); // scope 3 at $DIR/issue-59352.rs:14:26: 14:50 + switchInt(move _10) -> [0_isize: bb6, 1_isize: bb8, otherwise: bb7]; // scope 3 at $DIR/issue-59352.rs:14:26: 14:50 } bb3: { - StorageDead(_3); // scope 0 at $DIR/issue-59352.rs:14:49: 14:50 - goto -> bb5; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63 - } - - bb4: { - StorageDead(_10); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + StorageDead(_11); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 _0 = const 0_u32; // scope 0 at $DIR/issue-59352.rs:14:60: 14:61 - goto -> bb5; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63 + goto -> bb4; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63 } - bb5: { + bb4: { return; // scope 0 at $DIR/issue-59352.rs:15:2: 15:2 } - bb6: { + bb5: { _6 = &_7; // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 StorageDead(_8); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 StorageLive(_9); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 _9 = discriminant((*_6)); // scope 2 at $DIR/issue-59352.rs:14:8: 14:23 - StorageLive(_10); // scope 2 at $DIR/issue-59352.rs:14:8: 14:23 - _10 = move _9; // scope 2 at $DIR/issue-59352.rs:14:8: 14:23 + StorageLive(_11); // scope 2 at $DIR/issue-59352.rs:14:8: 14:23 + _11 = move _9; // scope 2 at $DIR/issue-59352.rs:14:8: 14:23 StorageDead(_9); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 StorageDead(_6); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 StorageDead(_7); // scope 1 at $DIR/issue-59352.rs:14:8: 14:23 StorageDead(_5); // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 StorageDead(_2); // scope 0 at $DIR/issue-59352.rs:14:22: 14:23 - switchInt(move _10) -> [1_isize: bb1, otherwise: bb4]; // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + switchInt(move _11) -> [1_isize: bb1, otherwise: bb3]; // scope 0 at $DIR/issue-59352.rs:14:8: 14:23 + } + + bb6: { + core::panicking::panic(const "called `Option::unwrap()` on a `None` value"); // scope 3 at $DIR/issue-59352.rs:14:26: 14:50 + // mir::Constant + // + span: $DIR/issue-59352.rs:14:26: 14:50 + // + literal: Const { ty: fn(&'static str) -> ! {core::panicking::panic}, val: Value(Scalar()) } + // ty::Const + // + ty: &str + // + val: Value(Slice { data: Allocation { bytes: [99, 97, 108, 108, 101, 100, 32, 96, 79, 112, 116, 105, 111, 110, 58, 58, 117, 110, 119, 114, 97, 112, 40, 41, 96, 32, 111, 110, 32, 97, 32, 96, 78, 111, 110, 101, 96, 32, 118, 97, 108, 117, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [8796093022207], len: Size { raw: 43 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 43 }) + // mir::Constant + // + span: $DIR/issue-59352.rs:14:26: 14:50 + // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [99, 97, 108, 108, 101, 100, 32, 96, 79, 112, 116, 105, 111, 110, 58, 58, 117, 110, 119, 114, 97, 112, 40, 41, 96, 32, 111, 110, 32, 97, 32, 96, 78, 111, 110, 101, 96, 32, 118, 97, 108, 117, 101], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [8796093022207], len: Size { raw: 43 } }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 43 }) } + } + + bb7: { + unreachable; // scope 3 at $DIR/issue-59352.rs:14:26: 14:50 + } + + bb8: { + _0 = move ((_3 as Some).0: u32); // scope 3 at $DIR/issue-59352.rs:14:26: 14:50 + StorageDead(_10); // scope 0 at $DIR/issue-59352.rs:14:26: 14:50 + StorageDead(_3); // scope 0 at $DIR/issue-59352.rs:14:49: 14:50 + goto -> bb4; // scope 0 at $DIR/issue-59352.rs:14:5: 14:63 } } diff --git a/src/test/ui/consts/const-eval/const_panic.stderr b/src/test/ui/consts/const-eval/const_panic.stderr index 59eaa098cfe94..8da697fe7ef3b 100644 --- a/src/test/ui/consts/const-eval/const_panic.stderr +++ b/src/test/ui/consts/const-eval/const_panic.stderr @@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed LL | const Y: () = std::unreachable!(); | ^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:12:15 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `std::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant value failed --> $DIR/const_panic.rs:15:15 @@ -28,7 +28,7 @@ error[E0080]: evaluation of constant value failed LL | const X: () = std::unimplemented!(); | ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic.rs:15:15 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `std::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant value failed --> $DIR/const_panic.rs:18:15 @@ -68,7 +68,7 @@ error[E0080]: evaluation of constant value failed LL | const Y_CORE: () = core::unreachable!(); | ^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:30:20 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `core::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant value failed --> $DIR/const_panic.rs:33:20 @@ -76,7 +76,7 @@ error[E0080]: evaluation of constant value failed LL | const X_CORE: () = core::unimplemented!(); | ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic.rs:33:20 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `core::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant value failed --> $DIR/const_panic.rs:36:20 diff --git a/src/test/ui/consts/const-eval/const_panic_2021.stderr b/src/test/ui/consts/const-eval/const_panic_2021.stderr index f59fae29a467d..62fe1715fecb5 100644 --- a/src/test/ui/consts/const-eval/const_panic_2021.stderr +++ b/src/test/ui/consts/const-eval/const_panic_2021.stderr @@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed LL | const C: () = std::unreachable!(); | ^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_2021.rs:12:15 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `std::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant value failed --> $DIR/const_panic_2021.rs:15:15 @@ -28,7 +28,7 @@ error[E0080]: evaluation of constant value failed LL | const D: () = std::unimplemented!(); | ^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic_2021.rs:15:15 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `std::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant value failed --> $DIR/const_panic_2021.rs:18:15 @@ -60,7 +60,7 @@ error[E0080]: evaluation of constant value failed LL | const C_CORE: () = core::unreachable!(); | ^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_2021.rs:27:20 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `core::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant value failed --> $DIR/const_panic_2021.rs:30:20 @@ -68,7 +68,7 @@ error[E0080]: evaluation of constant value failed LL | const D_CORE: () = core::unimplemented!(); | ^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic_2021.rs:30:20 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `core::unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant value failed --> $DIR/const_panic_2021.rs:33:20 diff --git a/src/test/ui/consts/const-eval/const_panic_libcore_bin.stderr b/src/test/ui/consts/const-eval/const_panic_libcore_bin.stderr index 0a747dc905874..52c0c13636687 100644 --- a/src/test/ui/consts/const-eval/const_panic_libcore_bin.stderr +++ b/src/test/ui/consts/const-eval/const_panic_libcore_bin.stderr @@ -12,7 +12,7 @@ error[E0080]: evaluation of constant value failed LL | const Y: () = unreachable!(); | ^^^^^^^^^^^^^^ the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic_libcore_bin.rs:11:15 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0080]: evaluation of constant value failed --> $DIR/const_panic_libcore_bin.rs:14:15 @@ -20,7 +20,7 @@ error[E0080]: evaluation of constant value failed LL | const X: () = unimplemented!(); | ^^^^^^^^^^^^^^^^ the evaluated program panicked at 'not implemented', $DIR/const_panic_libcore_bin.rs:14:15 | - = note: this error originates in the macro `$crate::panic::panic_2021` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/src/test/ui/generic-associated-types/issue-87258_a.stderr b/src/test/ui/generic-associated-types/issue-87258_a.stderr index f9f6616ba4565..93513a4563f07 100644 --- a/src/test/ui/generic-associated-types/issue-87258_a.stderr +++ b/src/test/ui/generic-associated-types/issue-87258_a.stderr @@ -4,7 +4,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea LL | fn foo<'a>() -> Self::FooFuture<'a> { | ^^^^^^^^^^^^^^^^^^^ | - = note: hidden type `Struct<'_>` captures lifetime '_#38r + = note: hidden type `Struct<'_>` captures lifetime '_#7r error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/issue-87258_b.stderr b/src/test/ui/generic-associated-types/issue-87258_b.stderr index bfef92ee0410d..e077a423400df 100644 --- a/src/test/ui/generic-associated-types/issue-87258_b.stderr +++ b/src/test/ui/generic-associated-types/issue-87258_b.stderr @@ -4,7 +4,7 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appea LL | fn foo<'a>() -> Self::FooFuture<'a> { | ^^^^^^^^^^^^^^^^^^^ | - = note: hidden type `Struct<'_>` captures lifetime '_#38r + = note: hidden type `Struct<'_>` captures lifetime '_#7r error: aborting due to previous error diff --git a/src/test/ui/proc-macro/quote-debug.stdout b/src/test/ui/proc-macro/quote-debug.stdout index 32fa95fdc64b6..4bdc04b9ac430 100644 --- a/src/test/ui/proc-macro/quote-debug.stdout +++ b/src/test/ui/proc-macro/quote-debug.stdout @@ -36,13 +36,7 @@ fn main() { lit } else { { - ::core::panicking::panic_fmt(::core::fmt::Arguments::new_v1(&["internal error: entered unreachable code"], - &match () - { - _args - => - [], - })) + ::core::panicking::panic("internal error: entered unreachable code") } } })),