rust/src/libsyntax_ext
kennytm 34d9ffec17
Rollup merge of #48934 - Phlosioneer:42453-debug-hygene, r=petrochenkov
Fix hygene issue when deriving Debug

The code for several of the core traits doesn't use hygenic macros.
This isn't a problem, except for the Debug trait, which is the only
one that uses a variable, named "builder".

Variables can't share names with unit structs, so attempting to
[derive(Debug)] on any type while a unit struct with the name
"builder" was in scope would result in an error.

This commit just changes the name of the variable to
"__debug_trait_builder", because I couldn't figure out how to get a
list of all unit structs in-scope from within the derive expansion
function. If someone wants to have a unit struct with
the exact name "__debug_trait_builder", they'll just have to do it
without a [derive(Debug)].

I also checked the implementations of the other built-in derives to
ensure they didn't declare any variables.
2018-03-13 00:54:33 +08:00
..
deriving Fix hygene issue when deriving Debug 2018-03-11 10:03:23 -04:00
asm.rs Make inline assembly volatile if it has no outputs. Fixes #46026 2018-02-05 15:56:44 +01:00
Cargo.toml Replace Rc with Lrc for shared data 2018-03-02 10:48:52 +01:00
cfg.rs libsyntax/ext: trailing commas in builtin macros 2018-02-07 12:48:21 -05:00
compile_error.rs Stabilize the compile_error_macro feature 2017-07-25 07:09:31 -07:00
concat.rs Produce expansion info for more builtin macros 2017-09-04 11:03:19 +02:00
concat_idents.rs Produce expansion info for more builtin macros 2017-09-04 11:03:19 +02:00
env.rs Produce expansion info for more builtin macros 2017-09-04 11:03:19 +02:00
format.rs while let all the things 2018-03-05 15:58:54 -03:00
format_foreign.rs Use Try syntax for Option in place of macros or match 2017-12-09 14:18:33 -08:00
global_asm.rs Replace dummy spans with empty spans 2018-02-18 00:10:40 +09:00
lib.rs Replace Rc with Lrc for shared data 2018-03-02 10:48:52 +01:00
log_syntax.rs make emit_feature_err take a ParseSess 2016-09-26 07:07:41 +02:00
proc_macro_impl.rs Do not capture stderr in the compiler. Instead just panic silently for fatal errors 2018-01-26 04:52:30 +01:00
proc_macro_registrar.rs Change ast::Visibility to Spanned type 2018-02-18 00:10:40 +09:00
trace_macros.rs Move syntax::util::interner -> syntax::symbol, cleanup. 2016-11-20 23:40:20 +00:00