diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-28 00:12:17 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2018-06-28 11:04:51 +0300 |
| commit | d7072b5bb42eb005ab3adac2605f175d8719e1f1 (patch) | |
| tree | 3d1d4884e8f468d106dc742d6fc855fcd7532ac6 /src/libsyntax_pos | |
| parent | 554b4282d8597e620b415463afc203d4b9e61fef (diff) | |
| download | rust-d7072b5bb42eb005ab3adac2605f175d8719e1f1.tar.gz rust-d7072b5bb42eb005ab3adac2605f175d8719e1f1.zip | |
Fix rebase
Diffstat (limited to 'src/libsyntax_pos')
| -rw-r--r-- | src/libsyntax_pos/symbol.rs | 5 |
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()) } |
