summary refs log tree commit diff
path: root/src/libsyntax_pos/hygiene.rs
AgeCommit message (Collapse)AuthorLines
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-7/+4
2018-01-12Auto merge of #46551 - jseyfried:improve_legacy_modern_macro_interaction, r=nrcbors-0/+39
macros: improve 1.0/2.0 interaction This PR supports using unhygienic macros from hygienic macros without breaking the latter's hygiene. ```rust // crate A: #[macro_export] macro_rules! m1 { () => { f(); // unhygienic: this macro needs `f` in its environment fn g() {} // (1) unhygienic: `g` is usable outside the macro definition } } // crate B: #![feature(decl_macro)] extern crate A; use A::m1; macro m2() { fn f() {} // (2) m1!(); // After this PR, `f()` in the expansion resolves to (2), not (3) g(); // After this PR, this resolves to `fn g() {}` from the above expansion. // Today, it is a resolution error. } fn test() { fn f() {} // (3) m2!(); // Today, `m2!()` can see (3) even though it should be hygienic. fn g() {} // Today, this conflicts with `fn g() {}` from the expansion, even though it should be hygienic. } ``` Once this PR lands, you can make an existing unhygienic macro hygienic by wrapping it in a hygienic macro. There is an [example](https://github.com/rust-lang/rust/pull/46551/commits/b766fa887dc0e4b923a38751fe4d570e35a75710) of this in the tests. r? @nrc
2018-01-01Fix docs for future pulldown migrationMalo Jaffré-4/+7
2017-12-14incr.comp.: Speed up span hashing by caching expansion context hashes.Michael Woerister-0/+9
2017-12-13Improve interaction between macros 2.0 and `macro_rules!`.Jeffrey Seyfried-0/+39
2017-12-12Refactor `MarkData` field `modern: bool` to `kind: MarkKind`.Jeffrey Seyfried-14/+28
2017-12-01incr.comp.: Properly hash and encode macro expansion information.Michael Woerister-4/+29
2017-09-23Compress "small" spans to 32 bits and intern "large" spansVadim Petrochenkov-1/+1
2017-08-18Auto merge of #43832 - huntiep:compiler-desugaring-enum, r=nikomatsakisbors-3/+23
Implement CompilerDesugaringKind enum This is the first step outlined in #35946. I think that the variants of `CompilerDesugaringKind` should be changed, I didn't know what the official names for `...` and `<-` are. I'm not to sure how tests for the compiler work, but I would imagine that tests should be added such that `Symbol::intern(s) == CompilerDesugaringKind::from(s).as_symbol()` for valid `s`.
2017-08-16Use direct references to CompilerDesugaringKindHunter Praska-12/+0
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-1/+1
Like #43008 (f668999), but _much more aggressive_.
2017-08-12Implement CompilerDesugaringKind enumHunter Praska-3/+35
2017-08-12syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros.Eduard-Mihai Burtescu-0/+3
2017-06-26Simplify `hygiene::Mark` application, andJeffrey Seyfried-15/+9
remove variant `Token::SubstNt` in favor of `quoted::TokenTree::MetaVar`.
2017-05-25Improve efficiency.Jeffrey Seyfried-6/+13
2017-05-25Hygienize `librustc_typeck`.Jeffrey Seyfried-1/+19
2017-05-25Hygienize `librustc_resolve`.Jeffrey Seyfried-22/+170
2017-03-29Merge `ExpnId` and `SyntaxContext`.Jeffrey Seyfried-7/+87
2017-03-29Move `syntax::ext::hygiene` to `syntax_pos::hygiene`.Jeffrey Seyfried-0/+122