about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2022-07-15 12:22:36 -0500
committerAaron Hill <aa1ronham@gmail.com>2022-07-15 17:47:14 -0500
commitc7b31d0ac983fdf7693a0029fdb0e16247c6599d (patch)
tree8ee17584e23a0a5cd6eecf58994a30b61c29817b /src/test
parent116819f54f062a2f425deac4ec29245038c26613 (diff)
Correctly handle path stability for 'use tree' items
PR #5956 started checking the stability of path segments.
However, this was not applied to 'use tree' items
(e.g. 'use some::path::{ItemOne, ItemTwo}') due to the way
that we desugar these items in HIR lowering.

This PR modifies 'use tree' lowering to preserve resolution
information, which is needed by stability checking.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/lint/lint-output-format.rs1
-rw-r--r--src/test/ui/lint/lint-output-format.stderr12
-rw-r--r--src/test/ui/stability-attribute/stable-in-unstable.rs8
-rw-r--r--src/test/ui/stability-attribute/stable-in-unstable.stderr20
4 files changed, 38 insertions, 3 deletions
diff --git a/src/test/ui/lint/lint-output-format.rs b/src/test/ui/lint/lint-output-format.rs
index 169a98c9483..67e8ec8f13b 100644
--- a/src/test/ui/lint/lint-output-format.rs
+++ b/src/test/ui/lint/lint-output-format.rs
@@ -5,6 +5,7 @@
 
 extern crate lint_output_format; //~ ERROR use of unstable library feature
 use lint_output_format::{foo, bar}; //~ ERROR use of unstable library feature
+//~| ERROR use of unstable library feature
 
 fn main() {
     let _x = foo();
diff --git a/src/test/ui/lint/lint-output-format.stderr b/src/test/ui/lint/lint-output-format.stderr
index 3bc1d6fc135..0db79a1564f 100644
--- a/src/test/ui/lint/lint-output-format.stderr
+++ b/src/test/ui/lint/lint-output-format.stderr
@@ -7,6 +7,14 @@ LL | extern crate lint_output_format;
    = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'unstable_test_feature'
+  --> $DIR/lint-output-format.rs:7:26
+   |
+LL | use lint_output_format::{foo, bar};
+   |                          ^^^
+   |
+   = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+
+error[E0658]: use of unstable library feature 'unstable_test_feature'
   --> $DIR/lint-output-format.rs:7:31
    |
 LL | use lint_output_format::{foo, bar};
@@ -15,13 +23,13 @@ LL | use lint_output_format::{foo, bar};
    = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'unstable_test_feature'
-  --> $DIR/lint-output-format.rs:11:14
+  --> $DIR/lint-output-format.rs:12:14
    |
 LL |     let _y = bar();
    |              ^^^
    |
    = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
 
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/stability-attribute/stable-in-unstable.rs b/src/test/ui/stability-attribute/stable-in-unstable.rs
index 272a1a97234..226367c3992 100644
--- a/src/test/ui/stability-attribute/stable-in-unstable.rs
+++ b/src/test/ui/stability-attribute/stable-in-unstable.rs
@@ -44,3 +44,11 @@ mod isolated5 {
 
     impl stable_in_unstable_std::old_stable_module::OldTrait for LocalType {}
 }
+
+mod isolated6 {
+    use stable_in_unstable_core::new_unstable_module::{OldTrait}; //~ ERROR use of unstable library feature 'unstable_test_feature'
+}
+
+mod isolated7 {
+    use stable_in_unstable_core::new_unstable_module::*; //~ ERROR use of unstable library feature 'unstable_test_feature'
+}
diff --git a/src/test/ui/stability-attribute/stable-in-unstable.stderr b/src/test/ui/stability-attribute/stable-in-unstable.stderr
index e123d83584c..b5e3e5f1202 100644
--- a/src/test/ui/stability-attribute/stable-in-unstable.stderr
+++ b/src/test/ui/stability-attribute/stable-in-unstable.stderr
@@ -34,6 +34,24 @@ LL |     impl stable_in_unstable_core::new_unstable_module::OldTrait for LocalTy
    = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information
    = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
 
-error: aborting due to 4 previous errors
+error[E0658]: use of unstable library feature 'unstable_test_feature'
+  --> $DIR/stable-in-unstable.rs:49:56
+   |
+LL |     use stable_in_unstable_core::new_unstable_module::{OldTrait};
+   |                                                        ^^^^^^^^
+   |
+   = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information
+   = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+
+error[E0658]: use of unstable library feature 'unstable_test_feature'
+  --> $DIR/stable-in-unstable.rs:53:9
+   |
+LL |     use stable_in_unstable_core::new_unstable_module::*;
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information
+   = help: add `#![feature(unstable_test_feature)]` to the crate attributes to enable
+
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0658`.