rust/src/libsyntax_pos
bors 0c5740feb2 Auto merge of #49986 - zofrex:better-derived-argument-names, r=Manishearth
Provide better names for builtin deriving-generated attributes

First attempt at fixing #49967

Not in love with any choices here, don't be shy if you aren't happy with anything :)

I've tested that this produces nicer names in documentation, and that it no longer has issues conflicting with constants with the same name. (I guess we _could_ make a test for that... unsure if that would be valuable)

In all cases I took the names from the methods as declared in the relevant trait.

In some cases I had to prepend the names with _ otherwise there were errors about un-used variables. I'm uneasy with the inconsistency... do they all need to be like that? Is there a way to generate an alternate impl or use a different name (`_`?) in the cases where the arguments are not used?

Lastly the gensym addition to Ident I implemented largely as suggested, but I want to point out it's a little circuitous (at least, as far as I understand it). `cx.ident_of(name)` is just `Ident::from_str`, so we create an Ident then another Ident from it. `Ident::with_empty_ctxt(Symbol::gensym(string))` may or may not be equivalent, I don't know if it's important to intern it _then_ gensym it. It seems like either we could use that, or if we do want a new method to make this convenient, it could be on Ident instead (`from_str_gensymed`?)
2018-04-25 01:50:56 +00:00
..
Cargo.toml Remove syntax and syntax_pos thread locals 2018-03-14 11:56:01 +01:00
hygiene.rs Remove unwanted auto-linking and update 2018-04-16 23:37:11 +02:00
lib.rs Move deny(warnings) into rustbuild 2018-04-08 16:59:14 -06:00
span_encoding.rs Remove syntax and syntax_pos thread locals 2018-03-14 11:56:01 +01:00
symbol.rs Auto merge of #49986 - zofrex:better-derived-argument-names, r=Manishearth 2018-04-25 01:50:56 +00:00