Skip to content

Commit 79fa6ce

Browse files
committed
Inline AllocFnFactory kind field
1 parent f8d8ffa commit 79fa6ce

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/rustc_builtin_macros/src/global_allocator.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ pub fn expand(
4040

4141
// Generate a bunch of new items using the AllocFnFactory
4242
let span = ecx.with_def_site_ctxt(item.span);
43-
let f =
44-
AllocFnFactory { span, ty_span, kind: AllocatorKind::Global, global: item.ident, cx: ecx };
43+
let f = AllocFnFactory { span, ty_span, global: item.ident, cx: ecx };
4544

4645
// Generate item statements for the allocator methods.
4746
let stmts = ALLOCATOR_METHODS.iter().map(|method| f.allocator_fn(method)).collect();
@@ -63,7 +62,6 @@ pub fn expand(
6362
struct AllocFnFactory<'a, 'b> {
6463
span: Span,
6564
ty_span: Span,
66-
kind: AllocatorKind,
6765
global: Ident,
6866
cx: &'b ExtCtxt<'a>,
6967
}
@@ -92,7 +90,7 @@ impl AllocFnFactory<'_, '_> {
9290
}));
9391
let item = self.cx.item(
9492
self.span,
95-
Ident::from_str_and_span(&self.kind.fn_name(method.name), self.span),
93+
Ident::from_str_and_span(&AllocatorKind::Global.fn_name(method.name), self.span),
9694
self.attrs(),
9795
kind,
9896
);

0 commit comments

Comments
 (0)