about summary refs log tree commit diff
path: root/compiler/rustc_builtin_macros/src/global_allocator.rs
diff options
context:
space:
mode:
authorHe1pa <18012015693@163.com>2023-06-21 19:01:53 +0800
committerHe1pa <18012015693@163.com>2023-06-25 01:32:30 +0800
commit8af8a95a64cd765273aae3f4dc0aa50faab148c9 (patch)
tree06252a6f90b3ff73ea2a1bb495c39f462f5863d9 /compiler/rustc_builtin_macros/src/global_allocator.rs
parented1ce580ec27ffcfda1a95512e69185442f75ebe (diff)
downloadrust-8af8a95a64cd765273aae3f4dc0aa50faab148c9.tar.gz
rust-8af8a95a64cd765273aae3f4dc0aa50faab148c9.zip
Migrate some rustc_builtin_macros to SessionDiagnostic
Diffstat (limited to 'compiler/rustc_builtin_macros/src/global_allocator.rs')
-rw-r--r--compiler/rustc_builtin_macros/src/global_allocator.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_builtin_macros/src/global_allocator.rs b/compiler/rustc_builtin_macros/src/global_allocator.rs
index f0d378d12f7..5772471931f 100644
--- a/compiler/rustc_builtin_macros/src/global_allocator.rs
+++ b/compiler/rustc_builtin_macros/src/global_allocator.rs
@@ -1,5 +1,6 @@
 use crate::util::check_builtin_macro_attribute;
 
+use crate::errors;
 use rustc_ast::expand::allocator::{
     global_fn_name, AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS,
 };
@@ -34,7 +35,7 @@ pub fn expand(
         {
             (item, true, ecx.with_def_site_ctxt(ty.span))
         } else {
-            ecx.sess.parse_sess.span_diagnostic.span_err(item.span(), "allocators must be statics");
+            ecx.sess.parse_sess.span_diagnostic.emit_err(errors::AllocMustStatics{span: item.span()});
             return vec![orig_item];
         };