diff options
| author | bors <bors@rust-lang.org> | 2019-09-15 08:17:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-09-15 08:17:57 +0000 |
| commit | 117cdf35d46cb4dbb246e300a492c860a86233be (patch) | |
| tree | 109e3227f1b4076c99874c94dc9aa1d554781f2b /src/libsyntax/parse/parser | |
| parent | 8bf776d5c2fc88624d2562e493aab0d324a3b7d8 (diff) | |
| parent | 8ab67c8f560a730b8978f4a42deb70d01ca1cdfc (diff) | |
| download | rust-117cdf35d46cb4dbb246e300a492c860a86233be.tar.gz rust-117cdf35d46cb4dbb246e300a492c860a86233be.zip | |
Auto merge of #64469 - matthewjasper:increase-hygiene-use, r=petrochenkov
Cleanup handling of hygiene for built-in macros
This makes most identifiers generated by built-in macros use def-site hygiene, not only the ones that previously used gensyms.
* `ExtCtxt::ident_of` now takes a `Span` and is preferred to `Ident::{from_str, from_str_and_span}`
* Remove `Span::with_legacy_ctxt`
* `assert` now uses call-site hygiene because it needs to resolve `panic` unhygienically.
* `concat_idents` now uses call-site hygiene because it wouldn't be very useful with def-site hygiene.
* everything else is moved to def-site hygiene
r? @petrochenkov
Diffstat (limited to 'src/libsyntax/parse/parser')
| -rw-r--r-- | src/libsyntax/parse/parser/item.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser/item.rs b/src/libsyntax/parse/parser/item.rs index baae6155f34..cf196645e4f 100644 --- a/src/libsyntax/parse/parser/item.rs +++ b/src/libsyntax/parse/parser/item.rs @@ -1256,7 +1256,7 @@ impl<'a> Parser<'a> { for part in idents { fixed_name.push_str(&format!("_{}", part.name)); } - ident = Ident::from_str(&fixed_name).with_span_pos(fixed_name_sp); + ident = Ident::from_str_and_span(&fixed_name, fixed_name_sp); self.struct_span_err(fixed_name_sp, error_msg) .span_label(fixed_name_sp, "dash-separated idents are not valid") |
