Replace Symbol::intern
calls with preinterned symbols
This commit is contained in:
parent
72d2db7bf4
commit
71b698c0b8
15 changed files with 40 additions and 35 deletions
|
@ -861,8 +861,10 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
|
|||
// First up we check for global allocators. Look at the crate graph here
|
||||
// and see what's a global allocator, including if we ourselves are a
|
||||
// global allocator.
|
||||
let mut global_allocator =
|
||||
self.cstore.has_global_allocator.then(|| Symbol::intern("this crate"));
|
||||
#[cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
|
||||
let this_crate = Symbol::intern("this crate");
|
||||
|
||||
let mut global_allocator = self.cstore.has_global_allocator.then_some(this_crate);
|
||||
for (_, data) in self.cstore.iter_crate_data() {
|
||||
if data.has_global_allocator() {
|
||||
match global_allocator {
|
||||
|
@ -876,8 +878,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
}
|
||||
let mut alloc_error_handler =
|
||||
self.cstore.has_alloc_error_handler.then(|| Symbol::intern("this crate"));
|
||||
let mut alloc_error_handler = self.cstore.has_alloc_error_handler.then_some(this_crate);
|
||||
for (_, data) in self.cstore.iter_crate_data() {
|
||||
if data.has_alloc_error_handler() {
|
||||
match alloc_error_handler {
|
||||
|
|
|
@ -872,6 +872,7 @@ impl MetadataBlob {
|
|||
|
||||
let def_kind = root.tables.def_kind.get(blob, item).unwrap();
|
||||
let def_key = root.tables.def_keys.get(blob, item).unwrap().decode(blob);
|
||||
#[cfg_attr(not(bootstrap), allow(rustc::symbol_intern_string_literal))]
|
||||
let def_name = if item == CRATE_DEF_INDEX {
|
||||
rustc_span::symbol::kw::Crate
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue