about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-08-10 13:44:09 +0000
committerbors <bors@rust-lang.org>2019-08-10 13:44:09 +0000
commitbe3fb0cd2cc408eb4cc9c1d71f9cedb2c974dcd9 (patch)
treefe885a011883ee12dac655f48cea6a471b5ff281 /src/test
parent6f70adcb18e5dc8df0672898a8404fd05a9c32cb (diff)
parent808f98378e28d9e32c6ac76ced921bc2c1fc8114 (diff)
downloadrust-be3fb0cd2cc408eb4cc9c1d71f9cedb2c974dcd9.tar.gz
rust-be3fb0cd2cc408eb4cc9c1d71f9cedb2c974dcd9.zip
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
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/hygiene/privacy-early.rs17
-rw-r--r--src/test/ui/hygiene/privacy-early.stderr21
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs2
-rw-r--r--src/test/ui/resolve/resolve-bad-visibility.rs4
-rw-r--r--src/test/ui/resolve/resolve-bad-visibility.stderr21
-rw-r--r--src/test/ui/resolve/visibility-indeterminate.rs5
-rw-r--r--src/test/ui/resolve/visibility-indeterminate.stderr19
-rw-r--r--src/test/ui/span/visibility-ty-params.stderr14
8 files changed, 82 insertions, 21 deletions
diff --git a/src/test/ui/hygiene/privacy-early.rs b/src/test/ui/hygiene/privacy-early.rs
new file mode 100644
index 00000000000..58fc74d65a5
--- /dev/null
+++ b/src/test/ui/hygiene/privacy-early.rs
@@ -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!();
+}
diff --git a/src/test/ui/hygiene/privacy-early.stderr b/src/test/ui/hygiene/privacy-early.stderr
new file mode 100644
index 00000000000..60e50e05fc3
--- /dev/null
+++ b/src/test/ui/hygiene/privacy-early.stderr
@@ -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`.
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
index ae44b371f4f..877940c7403 100644
--- a/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
+++ b/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-pick-original-type-alias-impl-trait.rs
@@ -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
 
diff --git a/src/test/ui/resolve/resolve-bad-visibility.rs b/src/test/ui/resolve/resolve-bad-visibility.rs
index d86c300c93f..7d48bb97b10 100644
--- a/src/test/ui/resolve/resolve-bad-visibility.rs
+++ b/src/test/ui/resolve/resolve-bad-visibility.rs
@@ -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,
diff --git a/src/test/ui/resolve/resolve-bad-visibility.stderr b/src/test/ui/resolve/resolve-bad-visibility.stderr
index b8004a48a67..d2fb7c7a9e6 100644
--- a/src/test/ui/resolve/resolve-bad-visibility.stderr
+++ b/src/test/ui/resolve/resolve-bad-visibility.stderr
@@ -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`.
diff --git a/src/test/ui/resolve/visibility-indeterminate.rs b/src/test/ui/resolve/visibility-indeterminate.rs
new file mode 100644
index 00000000000..595eaf440c9
--- /dev/null
+++ b/src/test/ui/resolve/visibility-indeterminate.rs
@@ -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
diff --git a/src/test/ui/resolve/visibility-indeterminate.stderr b/src/test/ui/resolve/visibility-indeterminate.stderr
new file mode 100644
index 00000000000..a259c8090b3
--- /dev/null
+++ b/src/test/ui/resolve/visibility-indeterminate.stderr
@@ -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`.
diff --git a/src/test/ui/span/visibility-ty-params.stderr b/src/test/ui/span/visibility-ty-params.stderr
index cdbede3c197..c2f0711b0c8 100644
--- a/src/test/ui/span/visibility-ty-params.stderr
+++ b/src/test/ui/span/visibility-ty-params.stderr
@@ -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