Rollup merge of #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.
This commit is contained in:
commit
7f2eeb10c7
4 changed files with 54 additions and 3 deletions
|
@ -1234,7 +1234,7 @@ pub(crate) mod builtin {
|
|||
#[rustc_builtin_macro]
|
||||
#[macro_export]
|
||||
#[rustc_diagnostic_item = "assert_macro"]
|
||||
#[allow_internal_unstable(core_panic)]
|
||||
#[allow_internal_unstable(core_panic, edition_panic)]
|
||||
macro_rules! assert {
|
||||
($cond:expr $(,)?) => {{ /* compiler built-in */ }};
|
||||
($cond:expr, $($arg:tt)+) => {{ /* compiler built-in */ }};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue