diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-24 12:21:41 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-07-25 23:46:28 +0200 |
| commit | 96340f67146ff73fb3d308b848d8c7ed62888ca1 (patch) | |
| tree | 0381dc0156c0cd3a17b4a814b90d990296a9ece3 /compiler/rustc_interface | |
| parent | a955f1cd09a027363729ceed919952d09f76f28e (diff) | |
| download | rust-96340f67146ff73fb3d308b848d8c7ed62888ca1.tar.gz rust-96340f67146ff73fb3d308b848d8c7ed62888ca1.zip | |
Stop compilation if macro expansion failed
Diffstat (limited to 'compiler/rustc_interface')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index fb6897c7d89..057fbe2fc4e 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -208,6 +208,10 @@ fn configure_and_expand( // Expand macros now! let krate = sess.time("expand_crate", || ecx.monotonic_expander().expand_crate(krate)); + if ecx.nb_macro_errors > 0 { + sess.dcx().abort_if_errors(); + } + // The rest is error reporting and stats sess.psess.buffered_lints.with_lock(|buffered_lints: &mut Vec<BufferedEarlyLint>| { |
