Convert a kw::Empty occurrence to sym::dummy.

`adjust_ident_and_get_scope` returns the symbol it receives unchanged,
and the call site ignores the returned symbol, so this symbol is unused.
This commit is contained in:
Nicholas Nethercote 2025-03-11 14:14:08 +11:00
parent 0b2d7062c4
commit 4eadaff184

View file

@ -40,7 +40,7 @@ use rustc_middle::ty::{
use rustc_middle::{bug, span_bug};
use rustc_session::lint;
use rustc_span::hygiene::Transparency;
use rustc_span::{Ident, Span, Symbol, kw, sym};
use rustc_span::{Ident, Span, Symbol, sym};
use tracing::debug;
use {rustc_attr_parsing as attr, rustc_hir as hir};
@ -935,8 +935,8 @@ impl<'tcx> NamePrivacyVisitor<'tcx> {
}
// definition of the field
let ident = Ident::new(kw::Empty, use_ctxt);
let def_id = self.tcx.adjust_ident_and_get_scope(ident, def.did(), hir_id).1;
let ident = Ident::new(sym::dummy, use_ctxt);
let (_, def_id) = self.tcx.adjust_ident_and_get_scope(ident, def.did(), hir_id);
!field.vis.is_accessible_from(def_id, self.tcx)
}