rust/tests/ui/macros/failed-to-reparse-issue-137874.rs
Nicholas Nethercote b9e13cb539 Apply Recovery::Forbidden when reparsing pasted macro fragments.
Fixes #137874.

Removes `tests/crashes/137874.rs`; the new test is simpler (defines its
own macro) but tests the same thing.

The changes to the output of `tests/ui/associated-consts/issue-93835.rs`
partly undo the changes seen when `NtTy` was removed in #133436, which
is good.
2025-04-04 13:24:26 +11:00

12 lines
286 B
Rust

// This originally crashed because `Recovery::Forbidden` wasn't being applied
// when fragments pasted by declarative macros were reparsed.
macro_rules! m {
($p:pat) => {
if let $p = 0 {}
}
}
fn main() {
m!(0X0); //~ ERROR invalid base prefix for number literal
}