]> git.lizzy.rs Git - rust.git/commit
Auto merge of #63462 - matthewjasper:hygienic-builtin-derives, r=petrochenkov
authorbors <bors@rust-lang.org>
Sat, 17 Aug 2019 12:53:53 +0000 (12:53 +0000)
committerbors <bors@rust-lang.org>
Sat, 17 Aug 2019 12:53:53 +0000 (12:53 +0000)
commitd65e272a9fe3e61aa5f229c5358e35a909435575
treecb52efb29cd5d4c1136659f99c16d730a879d752
parentac60ca0643feb3452688a9ca97c839c155742915
parent1c0a5469edcb11bdbfd44a1eb227aacd95aff0ca
Auto merge of #63462 - matthewjasper:hygienic-builtin-derives, r=petrochenkov

Opaque builtin derive macros

* Buiilt-in derives are now opaque macros
    * This required limiting the visibility of some previously unexposed functions in `core`.
    * This also required the change to `Ident` serialization.
* All gensyms are replaced with hygienic identifiers
* Use hygiene to avoid most other name-resolution issues with buiilt-in derives.
    *  As far as I know the only remaining case that breaks is an ADT that has the same name as one of its parameters. Fixing this completely seemed to be more effort than it's worth.
* Remove gensym in `Ident::decode`, which lead to linker errors due to `inline` being gensymmed.
    * `Ident`now panics if incremental compilation tries to serialize it (it currently doesn't).
    * `Ident` no longer uses `gensym` to emulate cross-crate hygiene. It only applied to reexports.
    * `SyntaxContext` is no longer serializable.
    * The long-term fix for this is to properly implement cross-crate hygiene, but this seemed to be acceptable for now.
* Move type/const parameter shadowing checks to `resolve`
    * This was previously split between resolve and type checking. The type checking pass compared `InternedString`s, not Identifiers.
* Removed the `SyntaxContext` from `{ast, hir}::{InlineAsm, GlobalAsm}`

cc #60869
r? @petrochenkov