]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_driver/driver.rs
Attempt to fix hygiene for global_allocator
[rust.git] / src / librustc_driver / driver.rs
index c18a089268659e06668c04083748f609239539f9..feeac9d938b6a4b01a352293d6fa54b0a355d2b6 100644 (file)
@@ -1051,10 +1051,19 @@ pub fn phase_2_configure_and_expand_inner<'a, F>(
         });
     }
 
+    // Expand global allocators, which are treated as an in-tree proc macro
     krate = time(sess, "creating allocators", || {
-        allocator::expand::modify(&sess.parse_sess, &mut resolver, krate, sess.diagnostic())
+        allocator::expand::modify(
+            &sess.parse_sess,
+            &mut resolver,
+            krate,
+            crate_name.to_string(),
+            sess.diagnostic(),
+        )
     });
 
+    // Done with macro expansion!
+
     after_expand(&krate)?;
 
     if sess.opts.debugging_opts.input_stats {