Rollup merge of #69497 - Zoxc:ast-fragment-error, r=petrochenkov

Don't unwind when hitting the macro expansion recursion limit

This removes one use of `FatalError.raise()`.

r? @petrochenkov
This commit is contained in:
Dylan DPC 2020-03-21 13:06:33 +01:00 committed by GitHub
commit a6596f2a4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 8 deletions

View file

@ -13,7 +13,7 @@ macro_rules! pat_macro {
pat_macro!(A{a:a, b:0, c:_, ..});
};
($a:pat) => {
$a
$a //~ ERROR expected expression
};
}

View file

@ -49,5 +49,16 @@ LL | my_recursive_macro!();
= note: expanding `my_recursive_macro! { }`
= note: to `my_recursive_macro ! () ;`
error: aborting due to 2 previous errors
error: expected expression, found `A { a: a, b: 0, c: _, .. }`
--> $DIR/trace_faulty_macros.rs:16:9
|
LL | $a
| ^^ expected expression
...
LL | let a = pat_macro!();
| ------------ in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors