Skip to content

Commit 7975779

Browse files
committed
Add sym::anon.
1 parent bd7f301 commit 7975779

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

Diff for: compiler/rustc_borrowck/src/type_check/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1339,14 +1339,11 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
13391339
};
13401340
let (sig, map) = tcx.replace_late_bound_regions(sig, |br| {
13411341
use crate::renumber::{BoundRegionInfo, RegionCtxt};
1342-
use rustc_span::Symbol;
13431342

13441343
let region_ctxt_fn = || {
13451344
let reg_info = match br.kind {
13461345
ty::BoundRegionKind::BrAnon(Some(span)) => BoundRegionInfo::Span(span),
1347-
ty::BoundRegionKind::BrAnon(..) => {
1348-
BoundRegionInfo::Name(Symbol::intern("anon"))
1349-
}
1346+
ty::BoundRegionKind::BrAnon(..) => BoundRegionInfo::Name(sym::anon),
13501347
ty::BoundRegionKind::BrNamed(_, name) => BoundRegionInfo::Name(name),
13511348
ty::BoundRegionKind::BrEnv => BoundRegionInfo::Name(sym::env),
13521349
};

Diff for: compiler/rustc_borrowck/src/type_check/relate_tys.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx>
126126

127127
let reg_info = match placeholder.bound.kind {
128128
ty::BoundRegionKind::BrAnon(Some(span)) => BoundRegionInfo::Span(span),
129-
ty::BoundRegionKind::BrAnon(..) => BoundRegionInfo::Name(Symbol::intern("anon")),
129+
ty::BoundRegionKind::BrAnon(..) => BoundRegionInfo::Name(sym::anon),
130130
ty::BoundRegionKind::BrNamed(_, name) => BoundRegionInfo::Name(name),
131131
ty::BoundRegionKind::BrEnv => BoundRegionInfo::Name(sym::env),
132132
};

Diff for: compiler/rustc_borrowck/src/universal_regions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use rustc_infer::infer::NllRegionVariableOrigin;
2424
use rustc_middle::ty::fold::TypeFoldable;
2525
use rustc_middle::ty::{self, InlineConstSubsts, InlineConstSubstsParts, RegionVid, Ty, TyCtxt};
2626
use rustc_middle::ty::{InternalSubsts, SubstsRef};
27-
use rustc_span::symbol::kw;
27+
use rustc_span::symbol::{kw, sym};
2828
use rustc_span::Symbol;
2929
use std::iter;
3030

@@ -783,7 +783,7 @@ impl<'cx, 'tcx> InferCtxtExt<'tcx> for BorrowckInferCtxt<'cx, 'tcx> {
783783
let region_vid = {
784784
let name = match br.kind.get_name() {
785785
Some(name) => name,
786-
_ => Symbol::intern("anon"),
786+
_ => sym::anon,
787787
};
788788

789789
self.next_nll_region_var(origin, || RegionCtxt::Bound(BoundRegionInfo::Name(name)))

Diff for: compiler/rustc_middle/src/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1637,7 +1637,7 @@ impl<'tcx> Region<'tcx> {
16371637
pub fn get_name_or_anon(self) -> Symbol {
16381638
match self.get_name() {
16391639
Some(name) => name,
1640-
None => Symbol::intern("anon"),
1640+
None => sym::anon,
16411641
}
16421642
}
16431643

Diff for: compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ symbols! {
357357
always,
358358
and,
359359
and_then,
360+
anon,
360361
anonymous_lifetime_in_impl_trait,
361362
any,
362363
append_const_msg,

0 commit comments

Comments
 (0)