about summary refs log tree commit diff
path: root/compiler/rustc_interface
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2025-07-24 12:21:41 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2025-07-25 23:46:28 +0200
commit96340f67146ff73fb3d308b848d8c7ed62888ca1 (patch)
tree0381dc0156c0cd3a17b4a814b90d990296a9ece3 /compiler/rustc_interface
parenta955f1cd09a027363729ceed919952d09f76f28e (diff)
downloadrust-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.rs4
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>| {