diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 58812faa500a4..3790b2f34b3c7 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -1339,14 +1339,11 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { }; let (sig, map) = tcx.replace_late_bound_regions(sig, |br| { use crate::renumber::{BoundRegionInfo, RegionCtxt}; - use rustc_span::Symbol; let region_ctxt_fn = || { let reg_info = match br.kind { ty::BoundRegionKind::BrAnon(Some(span)) => BoundRegionInfo::Span(span), - ty::BoundRegionKind::BrAnon(..) => { - BoundRegionInfo::Name(Symbol::intern("anon")) - } + ty::BoundRegionKind::BrAnon(..) => BoundRegionInfo::Name(sym::anon), ty::BoundRegionKind::BrNamed(_, name) => BoundRegionInfo::Name(name), ty::BoundRegionKind::BrEnv => BoundRegionInfo::Name(sym::env), }; diff --git a/compiler/rustc_borrowck/src/type_check/relate_tys.rs b/compiler/rustc_borrowck/src/type_check/relate_tys.rs index a0e365387234e..6b64e65518f5b 100644 --- a/compiler/rustc_borrowck/src/type_check/relate_tys.rs +++ b/compiler/rustc_borrowck/src/type_check/relate_tys.rs @@ -126,7 +126,7 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx> let reg_info = match placeholder.bound.kind { ty::BoundRegionKind::BrAnon(Some(span)) => BoundRegionInfo::Span(span), - ty::BoundRegionKind::BrAnon(..) => BoundRegionInfo::Name(Symbol::intern("anon")), + ty::BoundRegionKind::BrAnon(..) => BoundRegionInfo::Name(sym::anon), ty::BoundRegionKind::BrNamed(_, name) => BoundRegionInfo::Name(name), ty::BoundRegionKind::BrEnv => BoundRegionInfo::Name(sym::env), }; diff --git a/compiler/rustc_borrowck/src/universal_regions.rs b/compiler/rustc_borrowck/src/universal_regions.rs index cc351c6343148..35dfc1f7d129a 100644 --- a/compiler/rustc_borrowck/src/universal_regions.rs +++ b/compiler/rustc_borrowck/src/universal_regions.rs @@ -24,7 +24,7 @@ use rustc_infer::infer::NllRegionVariableOrigin; use rustc_middle::ty::fold::TypeFoldable; use rustc_middle::ty::{self, InlineConstSubsts, InlineConstSubstsParts, RegionVid, Ty, TyCtxt}; use rustc_middle::ty::{InternalSubsts, SubstsRef}; -use rustc_span::symbol::kw; +use rustc_span::symbol::{kw, sym}; use rustc_span::Symbol; use std::iter; @@ -783,7 +783,7 @@ impl<'cx, 'tcx> InferCtxtExt<'tcx> for BorrowckInferCtxt<'cx, 'tcx> { let region_vid = { let name = match br.kind.get_name() { Some(name) => name, - _ => Symbol::intern("anon"), + _ => sym::anon, }; self.next_nll_region_var(origin, || RegionCtxt::Bound(BoundRegionInfo::Name(name))) diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index e941a4058de6f..086ceebd24d60 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -1637,7 +1637,7 @@ impl<'tcx> Region<'tcx> { pub fn get_name_or_anon(self) -> Symbol { match self.get_name() { Some(name) => name, - None => Symbol::intern("anon"), + None => sym::anon, } } diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 7affad9aa0171..84a4f10b8ab13 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -357,6 +357,7 @@ symbols! { always, and, and_then, + anon, anonymous_lifetime_in_impl_trait, any, append_const_msg,