From 600b8247a8008b8e4fb2f6b6f61207ba85aba363 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 10 Jul 2020 10:14:55 +1000 Subject: [PATCH] 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. --- src/librustc_span/symbol.rs | 2 +- .../traits/error_reporting/on_unimplemented.rs | 2 +- src/librustc_trait_selection/traits/on_unimplemented.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/librustc_span/symbol.rs b/src/librustc_span/symbol.rs index 277ca8fa5b1..75f588918a0 100644 --- a/src/librustc_span/symbol.rs +++ b/src/librustc_span/symbol.rs @@ -145,6 +145,7 @@ symbols! { HashSet, Input, IntoIterator, + ItemContext, Iterator, Layout, LintPass, @@ -553,7 +554,6 @@ symbols! { issue_5723_bootstrap, issue_tracker_base_url, item, - item_context: "ItemContext", item_like_imports, iter, keyword, diff --git a/src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs b/src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs index ec51dddc2c8..d2b9f84af33 100644 --- a/src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs +++ b/src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs @@ -126,7 +126,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { let mut flags = vec![]; flags.push(( - sym::item_context, + sym::ItemContext, self.describe_enclosure(obligation.cause.body_id).map(|s| s.to_owned()), )); diff --git a/src/librustc_trait_selection/traits/on_unimplemented.rs b/src/librustc_trait_selection/traits/on_unimplemented.rs index a1dfa838e7a..deb33708681 100644 --- a/src/librustc_trait_selection/traits/on_unimplemented.rs +++ b/src/librustc_trait_selection/traits/on_unimplemented.rs @@ -286,7 +286,7 @@ impl<'tcx> OnUnimplementedFormatString { // `{from_desugaring}` is allowed Position::ArgumentNamed(s) if s == sym::from_desugaring => (), // `{ItemContext}` is allowed - Position::ArgumentNamed(s) if s == sym::item_context => (), + Position::ArgumentNamed(s) if s == sym::ItemContext => (), // So is `{A}` if A is a type parameter Position::ArgumentNamed(s) => { match generics.params.iter().find(|param| param.name == s) { @@ -350,7 +350,7 @@ impl<'tcx> OnUnimplementedFormatString { let s = self.0.as_str(); let parser = Parser::new(&s, None, None, false, ParseMode::Format); - let item_context = (options.get(&sym::item_context)).unwrap_or(&empty_string); + let item_context = (options.get(&sym::ItemContext)).unwrap_or(&empty_string); parser .map(|p| match p { Piece::String(s) => s, @@ -364,7 +364,7 @@ impl<'tcx> OnUnimplementedFormatString { } else if s == sym::from_desugaring || s == sym::from_method { // don't break messages using these two arguments incorrectly &empty_string - } else if s == sym::item_context { + } else if s == sym::ItemContext { &item_context } else { bug!(