about summary refs log tree commit diff
path: root/src/libsyntax_pos
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-06-28 00:12:17 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-06-28 11:04:51 +0300
commitd7072b5bb42eb005ab3adac2605f175d8719e1f1 (patch)
tree3d1d4884e8f468d106dc742d6fc855fcd7532ac6 /src/libsyntax_pos
parent554b4282d8597e620b415463afc203d4b9e61fef (diff)
downloadrust-d7072b5bb42eb005ab3adac2605f175d8719e1f1.tar.gz
rust-d7072b5bb42eb005ab3adac2605f175d8719e1f1.zip
Fix rebase
Diffstat (limited to 'src/libsyntax_pos')
-rw-r--r--src/libsyntax_pos/symbol.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs
index b92553842bc..bb64dad1208 100644
--- a/src/libsyntax_pos/symbol.rs
+++ b/src/libsyntax_pos/symbol.rs
@@ -59,6 +59,11 @@ impl Ident {
         Ident::new(Symbol::intern(self.as_str().trim_left_matches('\'')), self.span)
     }
 
+    /// "Normalize" ident for use in comparisons using "item hygiene".
+    /// Identifiers with same string value become same if they came from the same "modern" macro
+    /// (e.g. `macro` item, but not `macro_rules` item) and stay different if they came from
+    /// different "modern" macros.
+    /// Technically, this operation strips all non-opaque marks from ident's syntactic context.
     pub fn modern(self) -> Ident {
         Ident::new(self.name, self.span.modern())
     }