Auto merge of #63437 - Centril:rollup-ryx881p, r=Centril
Rollup of 4 pull requests Successful merges: - #63400 (Try to break resolve into more isolated parts) - #63425 (Cleanup historical stability comments) - #63429 (.gitignore: Readd `/tmp/`) - #63432 (Cleanup & Simplify stuff in lowering) Failed merges: r? @ghost
This commit is contained in:
commit
be3fb0cd2c
20 changed files with 4498 additions and 4415 deletions
17
src/test/ui/hygiene/privacy-early.rs
Normal file
17
src/test/ui/hygiene/privacy-early.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// edition:2018
|
||||
|
||||
#![feature(decl_macro)]
|
||||
|
||||
mod foo {
|
||||
fn f() {}
|
||||
macro f() {}
|
||||
|
||||
pub macro m() {
|
||||
use f as g; //~ ERROR `f` is private, and cannot be re-exported
|
||||
f!();
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
foo::m!();
|
||||
}
|
||||
21
src/test/ui/hygiene/privacy-early.stderr
Normal file
21
src/test/ui/hygiene/privacy-early.stderr
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
error[E0364]: `f` is private, and cannot be re-exported
|
||||
--> $DIR/privacy-early.rs:10:13
|
||||
|
|
||||
LL | use f as g;
|
||||
| ^^^^^^
|
||||
...
|
||||
LL | foo::m!();
|
||||
| ---------- in this macro invocation
|
||||
|
|
||||
note: consider marking `f` as `pub` in the imported module
|
||||
--> $DIR/privacy-early.rs:10:13
|
||||
|
|
||||
LL | use f as g;
|
||||
| ^^^^^^
|
||||
...
|
||||
LL | foo::m!();
|
||||
| ---------- in this macro invocation
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0364`.
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
// edition:2018
|
||||
// build-pass (FIXME(62277): could be check-pass?)
|
||||
// check-pass
|
||||
// revisions: migrate mir
|
||||
//[mir]compile-flags: -Z borrowck=mir
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@ trait Tr {}
|
|||
pub(in E) struct S; //~ ERROR expected module, found enum `E`
|
||||
pub(in Tr) struct Z; //~ ERROR expected module, found trait `Tr`
|
||||
pub(in std::vec) struct F; //~ ERROR visibilities can only be restricted to ancestor modules
|
||||
pub(in nonexistent) struct G; //~ ERROR cannot find module `nonexistent` in the crate root
|
||||
pub(in too_soon) struct H; //~ ERROR cannot find module `too_soon` in the crate root
|
||||
pub(in nonexistent) struct G; //~ ERROR failed to resolve
|
||||
pub(in too_soon) struct H; //~ ERROR failed to resolve
|
||||
|
||||
// Visibilities are resolved eagerly without waiting for modules becoming fully populated.
|
||||
// Visibilities can only use ancestor modules legally which are always available in time,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,3 @@
|
|||
error: visibilities can only be restricted to ancestor modules
|
||||
--> $DIR/resolve-bad-visibility.rs:6:8
|
||||
|
|
||||
LL | pub(in std::vec) struct F;
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0577]: expected module, found enum `E`
|
||||
--> $DIR/resolve-bad-visibility.rs:4:8
|
||||
|
|
||||
|
|
@ -16,17 +10,24 @@ error[E0577]: expected module, found trait `Tr`
|
|||
LL | pub(in Tr) struct Z;
|
||||
| ^^ not a module
|
||||
|
||||
error[E0578]: cannot find module `nonexistent` in the crate root
|
||||
error: visibilities can only be restricted to ancestor modules
|
||||
--> $DIR/resolve-bad-visibility.rs:6:8
|
||||
|
|
||||
LL | pub(in std::vec) struct F;
|
||||
| ^^^^^^^^
|
||||
|
||||
error[E0433]: failed to resolve: maybe a missing crate `nonexistent`?
|
||||
--> $DIR/resolve-bad-visibility.rs:7:8
|
||||
|
|
||||
LL | pub(in nonexistent) struct G;
|
||||
| ^^^^^^^^^^^ not found in the crate root
|
||||
| ^^^^^^^^^^^ maybe a missing crate `nonexistent`?
|
||||
|
||||
error[E0578]: cannot find module `too_soon` in the crate root
|
||||
error[E0433]: failed to resolve: maybe a missing crate `too_soon`?
|
||||
--> $DIR/resolve-bad-visibility.rs:8:8
|
||||
|
|
||||
LL | pub(in too_soon) struct H;
|
||||
| ^^^^^^^^ not found in the crate root
|
||||
| ^^^^^^^^ maybe a missing crate `too_soon`?
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0433`.
|
||||
|
|
|
|||
5
src/test/ui/resolve/visibility-indeterminate.rs
Normal file
5
src/test/ui/resolve/visibility-indeterminate.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// edition:2018
|
||||
|
||||
foo!(); //~ ERROR cannot find macro `foo!` in this scope
|
||||
|
||||
pub(in ::bar) struct Baz {} //~ ERROR cannot determine resolution for the visibility
|
||||
19
src/test/ui/resolve/visibility-indeterminate.stderr
Normal file
19
src/test/ui/resolve/visibility-indeterminate.stderr
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
error[E0578]: cannot determine resolution for the visibility
|
||||
--> $DIR/visibility-indeterminate.rs:5:8
|
||||
|
|
||||
LL | pub(in ::bar) struct Baz {}
|
||||
| ^^^^^
|
||||
|
||||
error: cannot find macro `foo!` in this scope
|
||||
--> $DIR/visibility-indeterminate.rs:3:1
|
||||
|
|
||||
LL | foo!();
|
||||
| ^^^
|
||||
|
||||
error[E0601]: `main` function not found in crate `visibility_indeterminate`
|
||||
|
|
||||
= note: consider adding a `main` function to `$DIR/visibility-indeterminate.rs`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0601`.
|
||||
|
|
@ -4,19 +4,17 @@ error: unexpected generic arguments in path
|
|||
LL | m!{ S<u8> }
|
||||
| ^^^^^
|
||||
|
||||
error[E0577]: expected module, found struct `S`
|
||||
--> $DIR/visibility-ty-params.rs:6:5
|
||||
|
|
||||
LL | m!{ S<u8> }
|
||||
| ^^^^^ not a module
|
||||
|
||||
error: unexpected generic arguments in path
|
||||
--> $DIR/visibility-ty-params.rs:10:9
|
||||
|
|
||||
LL | m!{ m<> }
|
||||
| ^^^
|
||||
|
||||
error[E0577]: expected module, found struct `S`
|
||||
--> $DIR/visibility-ty-params.rs:6:5
|
||||
|
|
||||
LL | m!{ S<u8> }
|
||||
| -^^^^
|
||||
| |
|
||||
| help: a module with a similar name exists: `m`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue