From 076064f3129863e7b568570588bd893017535f03 Mon Sep 17 00:00:00 2001 From: Jason Newcomb Date: Wed, 26 Nov 2025 06:02:20 -0500 Subject: [PATCH] Mark method receivers in builtin derives as being from the derive. --- compiler/rustc_builtin_macros/src/deriving/generic/mod.rs | 2 +- compiler/rustc_expand/src/build.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs index baffc525d95a0..66a22ff16b193 100644 --- a/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/generic/mod.rs @@ -1055,7 +1055,7 @@ impl<'a> MethodDef<'a> { let args = { let self_arg = explicit_self.map(|explicit_self| { - let ident = Ident::with_dummy_span(kw::SelfLower).with_span_pos(span); + let ident = Ident::new(kw::SelfLower, span); ast::Param::from_self(ast::AttrVec::default(), explicit_self, ident) }); let nonself_args = diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs index 6be65b0fff16f..c5ffcfd6e04dd 100644 --- a/compiler/rustc_expand/src/build.rs +++ b/compiler/rustc_expand/src/build.rs @@ -315,7 +315,7 @@ impl<'a> ExtCtxt<'a> { self.expr_path(self.path_ident(span, id)) } pub fn expr_self(&self, span: Span) -> Box { - self.expr_ident(span, Ident::with_dummy_span(kw::SelfLower)) + self.expr_ident(span, Ident::new(kw::SelfLower, span)) } pub fn expr_macro_call(&self, span: Span, call: Box) -> Box {