Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4382b5d

Browse files
authoredAug 15, 2019
Rollup merge of rust-lang#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 rust-lang#60869 r? @petrochenkov
2 parents f9d3c4e + 01587b1 commit 4382b5d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+361
-272
lines changed
 

‎src/libcore/clone.rs

-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ pub trait Clone : Sized {
135135

136136
/// Derive macro generating an impl of the trait `Clone`.
137137
#[rustc_builtin_macro]
138-
#[rustc_macro_transparency = "semitransparent"]
139138
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
140139
#[allow_internal_unstable(core_intrinsics, derive_clone_copy)]
141140
pub macro Clone($item:item) { /* compiler built-in */ }

‎src/libcore/cmp.rs

-4
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
202202

203203
/// Derive macro generating an impl of the trait `PartialEq`.
204204
#[rustc_builtin_macro]
205-
#[rustc_macro_transparency = "semitransparent"]
206205
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
207206
#[allow_internal_unstable(core_intrinsics)]
208207
pub macro PartialEq($item:item) { /* compiler built-in */ }
@@ -265,7 +264,6 @@ pub trait Eq: PartialEq<Self> {
265264

266265
/// Derive macro generating an impl of the trait `Eq`.
267266
#[rustc_builtin_macro]
268-
#[rustc_macro_transparency = "semitransparent"]
269267
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
270268
#[allow_internal_unstable(core_intrinsics, derive_eq)]
271269
pub macro Eq($item:item) { /* compiler built-in */ }
@@ -616,7 +614,6 @@ pub trait Ord: Eq + PartialOrd<Self> {
616614

617615
/// Derive macro generating an impl of the trait `Ord`.
618616
#[rustc_builtin_macro]
619-
#[rustc_macro_transparency = "semitransparent"]
620617
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
621618
#[allow_internal_unstable(core_intrinsics)]
622619
pub macro Ord($item:item) { /* compiler built-in */ }
@@ -865,7 +862,6 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
865862

866863
/// Derive macro generating an impl of the trait `PartialOrd`.
867864
#[rustc_builtin_macro]
868-
#[rustc_macro_transparency = "semitransparent"]
869865
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
870866
#[allow_internal_unstable(core_intrinsics)]
871867
pub macro PartialOrd($item:item) { /* compiler built-in */ }

0 commit comments

Comments
 (0)
Please sign in to comment.