From d7072b5bb42eb005ab3adac2605f175d8719e1f1 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Thu, 28 Jun 2018 00:12:17 +0300 Subject: Fix rebase --- src/libsyntax_pos/symbol.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libsyntax_pos') 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()) } -- cgit 1.4.1-3-g733a5