Skip to content

Commit 2d7773a

Browse files
authored
Rollup merge of rust-lang#81647 - m-ou-se:assert-2021-fix, r=petrochenkov
Fix bug with assert!() calling the wrong edition of panic!(). The span of `panic!` produced by the `assert` macro did not carry the right edition. This changes `assert` to call the right version. Also adds tests for the 2021 edition of panic and assert, that would've caught this.
2 parents 43cb392 + 95687ae commit 2d7773a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/macros/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ pub(crate) mod builtin {
12341234
#[rustc_builtin_macro]
12351235
#[macro_export]
12361236
#[rustc_diagnostic_item = "assert_macro"]
1237-
#[allow_internal_unstable(core_panic)]
1237+
#[allow_internal_unstable(core_panic, edition_panic)]
12381238
macro_rules! assert {
12391239
($cond:expr $(,)?) => {{ /* compiler built-in */ }};
12401240
($cond:expr, $($arg:tt)+) => {{ /* compiler built-in */ }};

0 commit comments

Comments
 (0)