about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <nnethercote@mozilla.com>2020-07-10 10:14:55 +1000
committerNicholas Nethercote <nnethercote@mozilla.com>2020-07-16 16:53:31 +1000
commit600b8247a8008b8e4fb2f6b6f61207ba85aba363 (patch)
tree96b89b9644a01ddb5030f5d768a69b6f1fd6a473
parentfd8f1772347d122b223ef573aeaa34cfa93ceec5 (diff)
downloadrust-600b8247a8008b8e4fb2f6b6f61207ba85aba363.tar.gz
rust-600b8247a8008b8e4fb2f6b6f61207ba85aba363.zip
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.
-rw-r--r--src/librustc_span/symbol.rs2
-rw-r--r--src/librustc_trait_selection/traits/error_reporting/on_unimplemented.rs2
-rw-r--r--src/librustc_trait_selection/traits/on_unimplemented.rs6
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!(