Rollup merge of #63535 - petrochenkov:expndata, r=matthewjasper

Continue refactoring resolve and hygiene

The general goal is addressing FIXMEs from the previous PRs.

Merging similar data structures (+ prerequisites for such merging), accounting for the fact that all `ExpnId`s have associated data in `HygieneData` now (less `Option`s).

Also, some renaming.
This should be the last renaming session in this area, I think.

r? @matthewjasper
This commit is contained in:
Mazdak Farrokhzad 2019-08-16 08:26:36 +02:00 committed by GitHub
commit 6e9e6ea39b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 636 additions and 728 deletions

View file

@ -4,17 +4,17 @@ error: cannot find macro `__build_diagnostic_array!` in this scope
LL | __build_diagnostic_array!(DIAGNOSTICS);
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: cannot find macro `__register_diagnostic!` in this scope
--> $DIR/feature-gate-rustc-diagnostic-macros.rs:4:1
|
LL | __register_diagnostic!(E0001);
| ^^^^^^^^^^^^^^^^^^^^^
error: cannot find macro `__diagnostic_used!` in this scope
--> $DIR/feature-gate-rustc-diagnostic-macros.rs:8:5
|
LL | __diagnostic_used!(E0001);
| ^^^^^^^^^^^^^^^^^
error: cannot find macro `__register_diagnostic!` in this scope
--> $DIR/feature-gate-rustc-diagnostic-macros.rs:4:1
|
LL | __register_diagnostic!(E0001);
| ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors

View file

@ -1,3 +1,11 @@
error: cannot find macro `panic!` in this scope
--> $DIR/no_implicit_prelude.rs:16:9
|
LL | assert_eq!(0, 0);
| ^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type or module `Vec`
--> $DIR/no_implicit_prelude.rs:11:9
|
@ -7,14 +15,6 @@ LL | fn f() { ::bar::m!(); }
LL | Vec::new();
| ^^^ use of undeclared type or module `Vec`
error: cannot find macro `panic!` in this scope
--> $DIR/no_implicit_prelude.rs:16:9
|
LL | assert_eq!(0, 0);
| ^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error[E0599]: no method named `clone` found for type `()` in the current scope
--> $DIR/no_implicit_prelude.rs:12:12
|

View file

@ -21,25 +21,6 @@ LL | use inner1::*;
| ^^^^^^^^^
= help: consider adding an explicit import of `exported` to disambiguate
error[E0659]: `include` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/local-modularized-tricky-fail-1.rs:46:1
|
LL | include!();
| ^^^^^^^ ambiguous name
|
= note: `include` could refer to a macro from prelude
note: `include` could also refer to the macro defined here
--> $DIR/local-modularized-tricky-fail-1.rs:17:5
|
LL | / macro_rules! include {
LL | | () => ()
LL | | }
| |_____^
...
LL | define_include!();
| ------------------ in this macro invocation
= help: use `crate::include` to refer to this macro unambiguously
error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/local-modularized-tricky-fail-1.rs:35:5
|
@ -59,6 +40,25 @@ LL | define_panic!();
| ---------------- in this macro invocation
= help: use `crate::panic` to refer to this macro unambiguously
error[E0659]: `include` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/local-modularized-tricky-fail-1.rs:46:1
|
LL | include!();
| ^^^^^^^ ambiguous name
|
= note: `include` could refer to a macro from prelude
note: `include` could also refer to the macro defined here
--> $DIR/local-modularized-tricky-fail-1.rs:17:5
|
LL | / macro_rules! include {
LL | | () => ()
LL | | }
| |_____^
...
LL | define_include!();
| ------------------ in this macro invocation
= help: use `crate::include` to refer to this macro unambiguously
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0659`.

View file

@ -13,20 +13,6 @@ LL | use foo::*;
= help: consider adding an explicit import of `panic` to disambiguate
= help: or use `self::panic` to refer to this macro unambiguously
error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/shadow_builtin_macros.rs:20:14
|
LL | fn f() { panic!(); }
| ^^^^^ ambiguous name
|
= note: `panic` could refer to a macro from prelude
note: `panic` could also refer to the macro imported here
--> $DIR/shadow_builtin_macros.rs:19:26
|
LL | ::two_macros::m!(use foo::panic;);
| ^^^^^^^^^^
= help: use `self::panic` to refer to this macro unambiguously
error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/shadow_builtin_macros.rs:33:5
|
@ -62,6 +48,20 @@ note: `n` could also refer to the macro imported here
LL | #[macro_use(n)]
| ^
error[E0659]: `panic` is ambiguous (macro-expanded name vs less macro-expanded name from outer scope during import/macro resolution)
--> $DIR/shadow_builtin_macros.rs:20:14
|
LL | fn f() { panic!(); }
| ^^^^^ ambiguous name
|
= note: `panic` could refer to a macro from prelude
note: `panic` could also refer to the macro imported here
--> $DIR/shadow_builtin_macros.rs:19:26
|
LL | ::two_macros::m!(use foo::panic;);
| ^^^^^^^^^^
= help: use `self::panic` to refer to this macro unambiguously
error: aborting due to 4 previous errors
For more information about this error, try `rustc --explain E0659`.

View file

@ -1,9 +1,3 @@
error: cannot find attribute macro `marco_use` in this scope
--> $DIR/issue-49074.rs:3:3
|
LL | #[marco_use] // typo
| ^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_use`
error: cannot find macro `bar!` in this scope
--> $DIR/issue-49074.rs:12:4
|
@ -12,5 +6,11 @@ LL | bar!();
|
= help: have you added the `#[macro_use]` on the module/import?
error: cannot find attribute macro `marco_use` in this scope
--> $DIR/issue-49074.rs:3:3
|
LL | #[marco_use] // typo
| ^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_use`
error: aborting due to 2 previous errors

View file

@ -88,18 +88,6 @@ error: expected derive macro, found macro `crate::my_macro`
LL | #[derive(crate::my_macro)]
| ^^^^^^^^^^^^^^^ not a derive macro
error: cannot find attribute macro `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:38:3
|
LL | #[my_macro]
| ^^^^^^^^
error: cannot find derive macro `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:48:10
|
LL | #[derive(my_macro)]
| ^^^^^^^^
error: cannot find macro `my_macro_attr!` in this scope
--> $DIR/macro-namespace-reserved-2.rs:28:5
|
@ -112,5 +100,17 @@ error: cannot find macro `MyTrait!` in this scope
LL | MyTrait!();
| ^^^^^^^
error: cannot find attribute macro `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:38:3
|
LL | #[my_macro]
| ^^^^^^^^
error: cannot find derive macro `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:48:10
|
LL | #[derive(my_macro)]
| ^^^^^^^^
error: aborting due to 19 previous errors

View file

@ -7,12 +7,6 @@ LL | #[rustc_attribute_should_be_reserved]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
error: cannot find attribute macro `rustc_attribute_should_be_reserved` in this scope
--> $DIR/reserved-attr-on-macro.rs:1:3
|
LL | #[rustc_attribute_should_be_reserved]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: cannot determine resolution for the macro `foo`
--> $DIR/reserved-attr-on-macro.rs:10:5
|
@ -21,6 +15,12 @@ LL | foo!();
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot find attribute macro `rustc_attribute_should_be_reserved` in this scope
--> $DIR/reserved-attr-on-macro.rs:1:3
|
LL | #[rustc_attribute_should_be_reserved]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`.