Skip to content

Commit 714b6ec

Browse files
committed
Rename sym::item_context as sym::ItemContext.
Because it represents the symbol `ItemContext`, and `sym` identifiers are supposed to match the actual symbol whenever possible.
1 parent de3f2d1 commit 714b6ec

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/librustc_span/symbol.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ symbols! {
140140
HashSet,
141141
Input,
142142
IntoIterator,
143+
ItemContext,
143144
Iterator,
144145
LintPass,
145146
None,
@@ -495,7 +496,6 @@ symbols! {
495496
issue_5723_bootstrap,
496497
issue_tracker_base_url,
497498
item,
498-
item_context: "ItemContext",
499499
item_like_imports,
500500
iter,
501501
keyword,

src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
126126

127127
let mut flags = vec![];
128128
flags.push((
129-
sym::item_context,
129+
sym::ItemContext,
130130
self.describe_enclosure(obligation.cause.body_id).map(|s| s.to_owned()),
131131
));
132132

src/librustc_trait_selection/traits/on_unimplemented.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl<'tcx> OnUnimplementedFormatString {
286286
// `{from_desugaring}` is allowed
287287
Position::ArgumentNamed(s) if s == sym::from_desugaring => (),
288288
// `{ItemContext}` is allowed
289-
Position::ArgumentNamed(s) if s == sym::item_context => (),
289+
Position::ArgumentNamed(s) if s == sym::ItemContext => (),
290290
// So is `{A}` if A is a type parameter
291291
Position::ArgumentNamed(s) => {
292292
match generics.params.iter().find(|param| param.name == s) {
@@ -350,7 +350,7 @@ impl<'tcx> OnUnimplementedFormatString {
350350

351351
let s = self.0.as_str();
352352
let parser = Parser::new(&s, None, None, false, ParseMode::Format);
353-
let item_context = (options.get(&sym::item_context)).unwrap_or(&empty_string);
353+
let item_context = (options.get(&sym::ItemContext)).unwrap_or(&empty_string);
354354
parser
355355
.map(|p| match p {
356356
Piece::String(s) => s,
@@ -364,7 +364,7 @@ impl<'tcx> OnUnimplementedFormatString {
364364
} else if s == sym::from_desugaring || s == sym::from_method {
365365
// don't break messages using these two arguments incorrectly
366366
&empty_string
367-
} else if s == sym::item_context {
367+
} else if s == sym::ItemContext {
368368
&item_context
369369
} else {
370370
bug!(

0 commit comments

Comments
 (0)