From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../use/auxiliary/extern-use-primitive-type-lib.rs | 3 - src/test/ui/use/auxiliary/use-from-trait-xc.rs | 29 --------- src/test/ui/use/issue-18986.rs | 10 ---- src/test/ui/use/issue-18986.stderr | 9 --- .../use/issue-60976-extern-use-primitive-type.rs | 7 --- src/test/ui/use/use-after-move-based-on-type.rs | 5 -- .../ui/use/use-after-move-based-on-type.stderr | 19 ------ .../use/use-after-move-implicity-coerced-object.rs | 30 ---------- .../use-after-move-implicity-coerced-object.stderr | 23 ------- .../ui/use/use-after-move-self-based-on-type.rs | 21 ------- .../use/use-after-move-self-based-on-type.stderr | 19 ------ src/test/ui/use/use-after-move-self.rs | 19 ------ src/test/ui/use/use-after-move-self.stderr | 19 ------ src/test/ui/use/use-associated-const.rs | 13 ---- src/test/ui/use/use-associated-const.stderr | 9 --- src/test/ui/use/use-crate-self.rs | 4 -- src/test/ui/use/use-crate-self.stderr | 8 --- src/test/ui/use/use-from-trait-xc.rs | 26 -------- src/test/ui/use/use-from-trait-xc.stderr | 70 ---------------------- src/test/ui/use/use-from-trait.rs | 22 ------- src/test/ui/use/use-from-trait.stderr | 34 ----------- src/test/ui/use/use-keyword.rs | 17 ------ src/test/ui/use/use-keyword.stderr | 22 ------- src/test/ui/use/use-meta-mismatch.rs | 5 -- src/test/ui/use/use-meta-mismatch.stderr | 9 --- src/test/ui/use/use-mod.rs | 19 ------ src/test/ui/use/use-mod.stderr | 33 ---------- src/test/ui/use/use-mod/use-mod-2.rs | 11 ---- src/test/ui/use/use-mod/use-mod-2.stderr | 15 ----- src/test/ui/use/use-mod/use-mod-3.rs | 12 ---- src/test/ui/use/use-mod/use-mod-3.stderr | 27 --------- src/test/ui/use/use-mod/use-mod-4.rs | 7 --- src/test/ui/use/use-mod/use-mod-4.stderr | 42 ------------- src/test/ui/use/use-mod/use-mod-5.rs | 13 ---- src/test/ui/use/use-mod/use-mod-5.stderr | 19 ------ src/test/ui/use/use-mod/use-mod-6.rs | 13 ---- src/test/ui/use/use-mod/use-mod-6.stderr | 19 ------ src/test/ui/use/use-nested-groups-error.rs | 15 ----- src/test/ui/use/use-nested-groups-error.stderr | 12 ---- .../ui/use/use-nested-groups-unused-imports.rs | 24 -------- .../ui/use/use-nested-groups-unused-imports.stderr | 26 -------- src/test/ui/use/use-paths-as-items.rs | 9 --- src/test/ui/use/use-paths-as-items.stderr | 13 ---- src/test/ui/use/use-self-type.rs | 11 ---- src/test/ui/use/use-self-type.stderr | 16 ----- src/test/ui/use/use-super-global-path.rs | 16 ----- src/test/ui/use/use-super-global-path.stderr | 21 ------- 47 files changed, 845 deletions(-) delete mode 100644 src/test/ui/use/auxiliary/extern-use-primitive-type-lib.rs delete mode 100644 src/test/ui/use/auxiliary/use-from-trait-xc.rs delete mode 100644 src/test/ui/use/issue-18986.rs delete mode 100644 src/test/ui/use/issue-18986.stderr delete mode 100644 src/test/ui/use/issue-60976-extern-use-primitive-type.rs delete mode 100644 src/test/ui/use/use-after-move-based-on-type.rs delete mode 100644 src/test/ui/use/use-after-move-based-on-type.stderr delete mode 100644 src/test/ui/use/use-after-move-implicity-coerced-object.rs delete mode 100644 src/test/ui/use/use-after-move-implicity-coerced-object.stderr delete mode 100644 src/test/ui/use/use-after-move-self-based-on-type.rs delete mode 100644 src/test/ui/use/use-after-move-self-based-on-type.stderr delete mode 100644 src/test/ui/use/use-after-move-self.rs delete mode 100644 src/test/ui/use/use-after-move-self.stderr delete mode 100644 src/test/ui/use/use-associated-const.rs delete mode 100644 src/test/ui/use/use-associated-const.stderr delete mode 100644 src/test/ui/use/use-crate-self.rs delete mode 100644 src/test/ui/use/use-crate-self.stderr delete mode 100644 src/test/ui/use/use-from-trait-xc.rs delete mode 100644 src/test/ui/use/use-from-trait-xc.stderr delete mode 100644 src/test/ui/use/use-from-trait.rs delete mode 100644 src/test/ui/use/use-from-trait.stderr delete mode 100644 src/test/ui/use/use-keyword.rs delete mode 100644 src/test/ui/use/use-keyword.stderr delete mode 100644 src/test/ui/use/use-meta-mismatch.rs delete mode 100644 src/test/ui/use/use-meta-mismatch.stderr delete mode 100644 src/test/ui/use/use-mod.rs delete mode 100644 src/test/ui/use/use-mod.stderr delete mode 100644 src/test/ui/use/use-mod/use-mod-2.rs delete mode 100644 src/test/ui/use/use-mod/use-mod-2.stderr delete mode 100644 src/test/ui/use/use-mod/use-mod-3.rs delete mode 100644 src/test/ui/use/use-mod/use-mod-3.stderr delete mode 100644 src/test/ui/use/use-mod/use-mod-4.rs delete mode 100644 src/test/ui/use/use-mod/use-mod-4.stderr delete mode 100644 src/test/ui/use/use-mod/use-mod-5.rs delete mode 100644 src/test/ui/use/use-mod/use-mod-5.stderr delete mode 100644 src/test/ui/use/use-mod/use-mod-6.rs delete mode 100644 src/test/ui/use/use-mod/use-mod-6.stderr delete mode 100644 src/test/ui/use/use-nested-groups-error.rs delete mode 100644 src/test/ui/use/use-nested-groups-error.stderr delete mode 100644 src/test/ui/use/use-nested-groups-unused-imports.rs delete mode 100644 src/test/ui/use/use-nested-groups-unused-imports.stderr delete mode 100644 src/test/ui/use/use-paths-as-items.rs delete mode 100644 src/test/ui/use/use-paths-as-items.stderr delete mode 100644 src/test/ui/use/use-self-type.rs delete mode 100644 src/test/ui/use/use-self-type.stderr delete mode 100644 src/test/ui/use/use-super-global-path.rs delete mode 100644 src/test/ui/use/use-super-global-path.stderr (limited to 'src/test/ui/use') diff --git a/src/test/ui/use/auxiliary/extern-use-primitive-type-lib.rs b/src/test/ui/use/auxiliary/extern-use-primitive-type-lib.rs deleted file mode 100644 index 3c7756ef7..000000000 --- a/src/test/ui/use/auxiliary/extern-use-primitive-type-lib.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --edition=2018 - -pub use u32; diff --git a/src/test/ui/use/auxiliary/use-from-trait-xc.rs b/src/test/ui/use/auxiliary/use-from-trait-xc.rs deleted file mode 100644 index 4abe11941..000000000 --- a/src/test/ui/use/auxiliary/use-from-trait-xc.rs +++ /dev/null @@ -1,29 +0,0 @@ -pub use self::sub::{Bar, Baz}; - -pub trait Trait { - fn foo(&self); - type Assoc; - const CONST: u32; -} - -struct Foo; - -impl Foo { - pub fn new() {} - - pub const C: u32 = 0; -} - -mod sub { - pub struct Bar; - - impl Bar { - pub fn new() {} - } - - pub enum Baz {} - - impl Baz { - pub fn new() {} - } -} diff --git a/src/test/ui/use/issue-18986.rs b/src/test/ui/use/issue-18986.rs deleted file mode 100644 index f0b292f29..000000000 --- a/src/test/ui/use/issue-18986.rs +++ /dev/null @@ -1,10 +0,0 @@ -// aux-build:use-from-trait-xc.rs - -extern crate use_from_trait_xc; -pub use use_from_trait_xc::Trait; - -fn main() { - match () { - Trait { x: 42 } => () //~ ERROR expected struct, variant or union type, found trait `Trait` - } -} diff --git a/src/test/ui/use/issue-18986.stderr b/src/test/ui/use/issue-18986.stderr deleted file mode 100644 index 6c23178c7..000000000 --- a/src/test/ui/use/issue-18986.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0574]: expected struct, variant or union type, found trait `Trait` - --> $DIR/issue-18986.rs:8:9 - | -LL | Trait { x: 42 } => () - | ^^^^^ not a struct, variant or union type - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0574`. diff --git a/src/test/ui/use/issue-60976-extern-use-primitive-type.rs b/src/test/ui/use/issue-60976-extern-use-primitive-type.rs deleted file mode 100644 index 4cd458302..000000000 --- a/src/test/ui/use/issue-60976-extern-use-primitive-type.rs +++ /dev/null @@ -1,7 +0,0 @@ -// Regression test for #60976: ICE (with <=1.36.0) when another file had `use ;`. -// check-pass -// aux-build:extern-use-primitive-type-lib.rs - -extern crate extern_use_primitive_type_lib; - -fn main() {} diff --git a/src/test/ui/use/use-after-move-based-on-type.rs b/src/test/ui/use/use-after-move-based-on-type.rs deleted file mode 100644 index ba7aa0345..000000000 --- a/src/test/ui/use/use-after-move-based-on-type.rs +++ /dev/null @@ -1,5 +0,0 @@ -fn main() { - let x = "Hello!".to_string(); - let _y = x; - println!("{}", x); //~ ERROR borrow of moved value -} diff --git a/src/test/ui/use/use-after-move-based-on-type.stderr b/src/test/ui/use/use-after-move-based-on-type.stderr deleted file mode 100644 index 7b4d24549..000000000 --- a/src/test/ui/use/use-after-move-based-on-type.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0382]: borrow of moved value: `x` - --> $DIR/use-after-move-based-on-type.rs:4:20 - | -LL | let x = "Hello!".to_string(); - | - move occurs because `x` has type `String`, which does not implement the `Copy` trait -LL | let _y = x; - | - value moved here -LL | println!("{}", x); - | ^ value borrowed here after move - | - = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) -help: consider cloning the value if the performance cost is acceptable - | -LL | let _y = x.clone(); - | ++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/use/use-after-move-implicity-coerced-object.rs b/src/test/ui/use/use-after-move-implicity-coerced-object.rs deleted file mode 100644 index 47fbb5bf1..000000000 --- a/src/test/ui/use/use-after-move-implicity-coerced-object.rs +++ /dev/null @@ -1,30 +0,0 @@ -use std::fmt; - -struct Number { - n: i64 -} - -impl fmt::Display for Number { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", self.n) - } -} - -struct List { - list: Vec> } - -impl List { - fn push(&mut self, n: Box) { - self.list.push(n); - } -} - -fn main() { - - let n: Box<_> = Number { n: 42 }.into(); - let mut l: Box<_> = List { list: Vec::new() }.into(); - l.push(n); - - let x = n.to_string(); - //~^ ERROR: borrow of moved value: `n` -} diff --git a/src/test/ui/use/use-after-move-implicity-coerced-object.stderr b/src/test/ui/use/use-after-move-implicity-coerced-object.stderr deleted file mode 100644 index dfa0c0483..000000000 --- a/src/test/ui/use/use-after-move-implicity-coerced-object.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0382]: borrow of moved value: `n` - --> $DIR/use-after-move-implicity-coerced-object.rs:28:13 - | -LL | let n: Box<_> = Number { n: 42 }.into(); - | - move occurs because `n` has type `Box`, which does not implement the `Copy` trait -LL | let mut l: Box<_> = List { list: Vec::new() }.into(); -LL | l.push(n); - | - value moved here -LL | -LL | let x = n.to_string(); - | ^^^^^^^^^^^^^ value borrowed here after move - | -note: consider changing this parameter type in method `push` to borrow instead if owning the value isn't necessary - --> $DIR/use-after-move-implicity-coerced-object.rs:17:27 - | -LL | fn push(&mut self, n: Box) { - | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^ this parameter takes ownership of the value - | | - | in this method - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/use/use-after-move-self-based-on-type.rs b/src/test/ui/use/use-after-move-self-based-on-type.rs deleted file mode 100644 index 932583495..000000000 --- a/src/test/ui/use/use-after-move-self-based-on-type.rs +++ /dev/null @@ -1,21 +0,0 @@ -struct S { - x: isize, -} - -impl Drop for S { - fn drop(&mut self) {} -} - -impl S { - pub fn foo(self) -> isize { - self.bar(); - return self.x; //~ ERROR use of moved value: `self` - } - - pub fn bar(self) {} -} - -fn main() { - let x = S { x: 1 }; - println!("{}", x.foo()); -} diff --git a/src/test/ui/use/use-after-move-self-based-on-type.stderr b/src/test/ui/use/use-after-move-self-based-on-type.stderr deleted file mode 100644 index 7fdc4ab25..000000000 --- a/src/test/ui/use/use-after-move-self-based-on-type.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0382]: use of moved value: `self` - --> $DIR/use-after-move-self-based-on-type.rs:12:16 - | -LL | pub fn foo(self) -> isize { - | ---- move occurs because `self` has type `S`, which does not implement the `Copy` trait -LL | self.bar(); - | ----- `self` moved due to this method call -LL | return self.x; - | ^^^^^^ value used here after move - | -note: this function takes ownership of the receiver `self`, which moves `self` - --> $DIR/use-after-move-self-based-on-type.rs:15:16 - | -LL | pub fn bar(self) {} - | ^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/use/use-after-move-self.rs b/src/test/ui/use/use-after-move-self.rs deleted file mode 100644 index f7a3c0ecc..000000000 --- a/src/test/ui/use/use-after-move-self.rs +++ /dev/null @@ -1,19 +0,0 @@ -struct S { - x: Box, -} - - - -impl S { - pub fn foo(self) -> isize { - self.bar(); - return *self.x; //~ ERROR use of moved value: `self` - } - - pub fn bar(self) {} -} - -fn main() { - let x = S { x: 1.into() }; - println!("{}", x.foo()); -} diff --git a/src/test/ui/use/use-after-move-self.stderr b/src/test/ui/use/use-after-move-self.stderr deleted file mode 100644 index 073deee63..000000000 --- a/src/test/ui/use/use-after-move-self.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0382]: use of moved value: `self` - --> $DIR/use-after-move-self.rs:10:16 - | -LL | pub fn foo(self) -> isize { - | ---- move occurs because `self` has type `S`, which does not implement the `Copy` trait -LL | self.bar(); - | ----- `self` moved due to this method call -LL | return *self.x; - | ^^^^^^^ value used here after move - | -note: this function takes ownership of the receiver `self`, which moves `self` - --> $DIR/use-after-move-self.rs:13:16 - | -LL | pub fn bar(self) {} - | ^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0382`. diff --git a/src/test/ui/use/use-associated-const.rs b/src/test/ui/use/use-associated-const.rs deleted file mode 100644 index 714fbdabb..000000000 --- a/src/test/ui/use/use-associated-const.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![allow(unused_imports)] - -pub mod foo { - pub struct Foo; - - impl Foo { - pub const BAR: i32 = 0; - } -} - -use foo::Foo::BAR; //~ ERROR unresolved import `foo::Foo` - -fn main() {} diff --git a/src/test/ui/use/use-associated-const.stderr b/src/test/ui/use/use-associated-const.stderr deleted file mode 100644 index 4bc0d7e61..000000000 --- a/src/test/ui/use/use-associated-const.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0432]: unresolved import `foo::Foo` - --> $DIR/use-associated-const.rs:11:10 - | -LL | use foo::Foo::BAR; - | ^^^ `Foo` is a struct, not a module - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/use/use-crate-self.rs b/src/test/ui/use/use-crate-self.rs deleted file mode 100644 index 65ab94814..000000000 --- a/src/test/ui/use/use-crate-self.rs +++ /dev/null @@ -1,4 +0,0 @@ -use crate::{self}; - //~^ ERROR crate root imports need to be explicitly named: `use crate as name;` - -fn main() {} diff --git a/src/test/ui/use/use-crate-self.stderr b/src/test/ui/use/use-crate-self.stderr deleted file mode 100644 index dd4036bff..000000000 --- a/src/test/ui/use/use-crate-self.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: crate root imports need to be explicitly named: `use crate as name;` - --> $DIR/use-crate-self.rs:1:13 - | -LL | use crate::{self}; - | ^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/use/use-from-trait-xc.rs b/src/test/ui/use/use-from-trait-xc.rs deleted file mode 100644 index 695ed66a1..000000000 --- a/src/test/ui/use/use-from-trait-xc.rs +++ /dev/null @@ -1,26 +0,0 @@ -// aux-build:use-from-trait-xc.rs - -extern crate use_from_trait_xc; - -use use_from_trait_xc::Trait::foo; -//~^ ERROR `foo` is not directly importable - -use use_from_trait_xc::Trait::Assoc; -//~^ ERROR `Assoc` is not directly importable - -use use_from_trait_xc::Trait::CONST; -//~^ ERROR `CONST` is not directly importable - -use use_from_trait_xc::Foo::new; //~ ERROR struct `Foo` is private -//~^ ERROR unresolved import `use_from_trait_xc::Foo` - -use use_from_trait_xc::Foo::C; //~ ERROR struct `Foo` is private -//~^ ERROR unresolved import `use_from_trait_xc::Foo` - -use use_from_trait_xc::Bar::new as bnew; -//~^ ERROR unresolved import `use_from_trait_xc::Bar` - -use use_from_trait_xc::Baz::new as baznew; -//~^ ERROR unresolved import `use_from_trait_xc::Baz::new` - -fn main() {} diff --git a/src/test/ui/use/use-from-trait-xc.stderr b/src/test/ui/use/use-from-trait-xc.stderr deleted file mode 100644 index 4c4c2f622..000000000 --- a/src/test/ui/use/use-from-trait-xc.stderr +++ /dev/null @@ -1,70 +0,0 @@ -error[E0253]: `foo` is not directly importable - --> $DIR/use-from-trait-xc.rs:5:5 - | -LL | use use_from_trait_xc::Trait::foo; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly - -error[E0253]: `Assoc` is not directly importable - --> $DIR/use-from-trait-xc.rs:8:5 - | -LL | use use_from_trait_xc::Trait::Assoc; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly - -error[E0253]: `CONST` is not directly importable - --> $DIR/use-from-trait-xc.rs:11:5 - | -LL | use use_from_trait_xc::Trait::CONST; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly - -error[E0432]: unresolved import `use_from_trait_xc::Foo` - --> $DIR/use-from-trait-xc.rs:14:24 - | -LL | use use_from_trait_xc::Foo::new; - | ^^^ `Foo` is a struct, not a module - -error[E0432]: unresolved import `use_from_trait_xc::Foo` - --> $DIR/use-from-trait-xc.rs:17:24 - | -LL | use use_from_trait_xc::Foo::C; - | ^^^ `Foo` is a struct, not a module - -error[E0432]: unresolved import `use_from_trait_xc::Bar` - --> $DIR/use-from-trait-xc.rs:20:24 - | -LL | use use_from_trait_xc::Bar::new as bnew; - | ^^^ `Bar` is a struct, not a module - -error[E0432]: unresolved import `use_from_trait_xc::Baz::new` - --> $DIR/use-from-trait-xc.rs:23:5 - | -LL | use use_from_trait_xc::Baz::new as baznew; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `new` in `sub::Baz` - -error[E0603]: struct `Foo` is private - --> $DIR/use-from-trait-xc.rs:14:24 - | -LL | use use_from_trait_xc::Foo::new; - | ^^^ private struct - | -note: the struct `Foo` is defined here - --> $DIR/auxiliary/use-from-trait-xc.rs:9:1 - | -LL | struct Foo; - | ^^^^^^^^^^ - -error[E0603]: struct `Foo` is private - --> $DIR/use-from-trait-xc.rs:17:24 - | -LL | use use_from_trait_xc::Foo::C; - | ^^^ private struct - | -note: the struct `Foo` is defined here - --> $DIR/auxiliary/use-from-trait-xc.rs:9:1 - | -LL | struct Foo; - | ^^^^^^^^^^ - -error: aborting due to 9 previous errors - -Some errors have detailed explanations: E0253, E0432, E0603. -For more information about an error, try `rustc --explain E0253`. diff --git a/src/test/ui/use/use-from-trait.rs b/src/test/ui/use/use-from-trait.rs deleted file mode 100644 index eab4bb6e3..000000000 --- a/src/test/ui/use/use-from-trait.rs +++ /dev/null @@ -1,22 +0,0 @@ -use Trait::foo; //~ ERROR `foo` is not directly importable -use Trait::Assoc; //~ ERROR `Assoc` is not directly importable -use Trait::C; //~ ERROR `C` is not directly importable - -use Foo::new; //~ ERROR unresolved import `Foo` [E0432] - -use Foo::C2; //~ ERROR unresolved import `Foo` [E0432] - -pub trait Trait { - fn foo(); - type Assoc; - const C: u32; -} - -struct Foo; - -impl Foo { - fn new() {} - const C2: u32 = 0; -} - -fn main() {} diff --git a/src/test/ui/use/use-from-trait.stderr b/src/test/ui/use/use-from-trait.stderr deleted file mode 100644 index a5b0e356b..000000000 --- a/src/test/ui/use/use-from-trait.stderr +++ /dev/null @@ -1,34 +0,0 @@ -error[E0253]: `foo` is not directly importable - --> $DIR/use-from-trait.rs:1:5 - | -LL | use Trait::foo; - | ^^^^^^^^^^ cannot be imported directly - -error[E0253]: `Assoc` is not directly importable - --> $DIR/use-from-trait.rs:2:5 - | -LL | use Trait::Assoc; - | ^^^^^^^^^^^^ cannot be imported directly - -error[E0253]: `C` is not directly importable - --> $DIR/use-from-trait.rs:3:5 - | -LL | use Trait::C; - | ^^^^^^^^ cannot be imported directly - -error[E0432]: unresolved import `Foo` - --> $DIR/use-from-trait.rs:5:5 - | -LL | use Foo::new; - | ^^^ `Foo` is a struct, not a module - -error[E0432]: unresolved import `Foo` - --> $DIR/use-from-trait.rs:7:5 - | -LL | use Foo::C2; - | ^^^ `Foo` is a struct, not a module - -error: aborting due to 5 previous errors - -Some errors have detailed explanations: E0253, E0432. -For more information about an error, try `rustc --explain E0253`. diff --git a/src/test/ui/use/use-keyword.rs b/src/test/ui/use/use-keyword.rs deleted file mode 100644 index c30c2e06c..000000000 --- a/src/test/ui/use/use-keyword.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Check that imports with nakes super and self don't fail during parsing -// FIXME: this shouldn't fail during name resolution either - -mod a { - mod b { - use self as A; - //~^ ERROR `self` imports are only allowed within a { } list - use super as B; - //~^ ERROR unresolved import `super` [E0432] - //~| no `super` in the root - use super::{self as C}; - //~^ ERROR unresolved import `super` [E0432] - //~| no `super` in the root - } -} - -fn main() {} diff --git a/src/test/ui/use/use-keyword.stderr b/src/test/ui/use/use-keyword.stderr deleted file mode 100644 index 501d14be5..000000000 --- a/src/test/ui/use/use-keyword.stderr +++ /dev/null @@ -1,22 +0,0 @@ -error[E0429]: `self` imports are only allowed within a { } list - --> $DIR/use-keyword.rs:6:13 - | -LL | use self as A; - | ^^^^ - -error[E0432]: unresolved import `super` - --> $DIR/use-keyword.rs:8:13 - | -LL | use super as B; - | ^^^^^^^^^^ no `super` in the root - -error[E0432]: unresolved import `super` - --> $DIR/use-keyword.rs:11:21 - | -LL | use super::{self as C}; - | ^^^^^^^^^ no `super` in the root - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0429, E0432. -For more information about an error, try `rustc --explain E0429`. diff --git a/src/test/ui/use/use-meta-mismatch.rs b/src/test/ui/use/use-meta-mismatch.rs deleted file mode 100644 index 975209efb..000000000 --- a/src/test/ui/use/use-meta-mismatch.rs +++ /dev/null @@ -1,5 +0,0 @@ -// error-pattern:can't find crate for `fake_crate` - -extern crate fake_crate as extra; - -fn main() { } diff --git a/src/test/ui/use/use-meta-mismatch.stderr b/src/test/ui/use/use-meta-mismatch.stderr deleted file mode 100644 index 62b71fe8e..000000000 --- a/src/test/ui/use/use-meta-mismatch.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0463]: can't find crate for `fake_crate` - --> $DIR/use-meta-mismatch.rs:3:1 - | -LL | extern crate fake_crate as extra; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0463`. diff --git a/src/test/ui/use/use-mod.rs b/src/test/ui/use/use-mod.rs deleted file mode 100644 index 87064c6a4..000000000 --- a/src/test/ui/use/use-mod.rs +++ /dev/null @@ -1,19 +0,0 @@ -use foo::bar::{ - self, -//~^ ERROR `self` import can only appear once in an import list - Bar, - self -//~^ ERROR the name `bar` is defined multiple times -}; - -use {self}; -//~^ ERROR `self` import can only appear in an import list with a non-empty prefix - -mod foo { - pub mod bar { - pub struct Bar; - pub struct Baz; - } -} - -fn main() {} diff --git a/src/test/ui/use/use-mod.stderr b/src/test/ui/use/use-mod.stderr deleted file mode 100644 index 0cae5eb14..000000000 --- a/src/test/ui/use/use-mod.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0430]: `self` import can only appear once in an import list - --> $DIR/use-mod.rs:2:5 - | -LL | self, - | ^^^^ can only appear once in an import list -... -LL | self - | ---- another `self` import appears here - -error[E0431]: `self` import can only appear in an import list with a non-empty prefix - --> $DIR/use-mod.rs:9:6 - | -LL | use {self}; - | ^^^^ can only appear in an import list with a non-empty prefix - -error[E0252]: the name `bar` is defined multiple times - --> $DIR/use-mod.rs:5:5 - | -LL | self, - | ---- previous import of the module `bar` here -... -LL | self - | ^^^^ - | | - | `bar` reimported here - | help: remove unnecessary import - | - = note: `bar` must be defined only once in the type namespace of this module - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0252, E0430, E0431. -For more information about an error, try `rustc --explain E0252`. diff --git a/src/test/ui/use/use-mod/use-mod-2.rs b/src/test/ui/use/use-mod/use-mod-2.rs deleted file mode 100644 index 9373a62ba..000000000 --- a/src/test/ui/use/use-mod/use-mod-2.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod foo { - use self::{self}; - //~^ ERROR unresolved import `self` [E0432] - //~| no `self` in the root - - use super::{self}; - //~^ ERROR unresolved import `super` [E0432] - //~| no `super` in the root -} - -fn main() {} diff --git a/src/test/ui/use/use-mod/use-mod-2.stderr b/src/test/ui/use/use-mod/use-mod-2.stderr deleted file mode 100644 index 843767849..000000000 --- a/src/test/ui/use/use-mod/use-mod-2.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0432]: unresolved import `self` - --> $DIR/use-mod-2.rs:2:16 - | -LL | use self::{self}; - | ^^^^ no `self` in the root - -error[E0432]: unresolved import `super` - --> $DIR/use-mod-2.rs:6:17 - | -LL | use super::{self}; - | ^^^^ no `super` in the root - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/use/use-mod/use-mod-3.rs b/src/test/ui/use/use-mod/use-mod-3.rs deleted file mode 100644 index 0afa486b9..000000000 --- a/src/test/ui/use/use-mod/use-mod-3.rs +++ /dev/null @@ -1,12 +0,0 @@ -use foo::bar::{ //~ ERROR module `bar` is private - self -}; -use foo::bar::{ //~ ERROR module `bar` is private - Bar -}; - -mod foo { - mod bar { pub type Bar = isize; } -} - -fn main() {} diff --git a/src/test/ui/use/use-mod/use-mod-3.stderr b/src/test/ui/use/use-mod/use-mod-3.stderr deleted file mode 100644 index 1b12b3c6f..000000000 --- a/src/test/ui/use/use-mod/use-mod-3.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0603]: module `bar` is private - --> $DIR/use-mod-3.rs:1:10 - | -LL | use foo::bar::{ - | ^^^ private module - | -note: the module `bar` is defined here - --> $DIR/use-mod-3.rs:9:5 - | -LL | mod bar { pub type Bar = isize; } - | ^^^^^^^ - -error[E0603]: module `bar` is private - --> $DIR/use-mod-3.rs:4:10 - | -LL | use foo::bar::{ - | ^^^ private module - | -note: the module `bar` is defined here - --> $DIR/use-mod-3.rs:9:5 - | -LL | mod bar { pub type Bar = isize; } - | ^^^^^^^ - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/use/use-mod/use-mod-4.rs b/src/test/ui/use/use-mod/use-mod-4.rs deleted file mode 100644 index 46ae8ddad..000000000 --- a/src/test/ui/use/use-mod/use-mod-4.rs +++ /dev/null @@ -1,7 +0,0 @@ -use foo::self; //~ ERROR unresolved import `foo` -//~^ ERROR `self` imports are only allowed within a { } list - -use std::mem::self; -//~^ ERROR `self` imports are only allowed within a { } list - -fn main() {} diff --git a/src/test/ui/use/use-mod/use-mod-4.stderr b/src/test/ui/use/use-mod/use-mod-4.stderr deleted file mode 100644 index 0b4fbadb4..000000000 --- a/src/test/ui/use/use-mod/use-mod-4.stderr +++ /dev/null @@ -1,42 +0,0 @@ -error[E0429]: `self` imports are only allowed within a { } list - --> $DIR/use-mod-4.rs:1:8 - | -LL | use foo::self; - | ^^^^^^ - | -help: consider importing the module directly - | -LL - use foo::self; -LL + use foo; - | -help: alternatively, use the multi-path `use` syntax to import `self` - | -LL | use foo::{self}; - | + + - -error[E0429]: `self` imports are only allowed within a { } list - --> $DIR/use-mod-4.rs:4:13 - | -LL | use std::mem::self; - | ^^^^^^ - | -help: consider importing the module directly - | -LL - use std::mem::self; -LL + use std::mem; - | -help: alternatively, use the multi-path `use` syntax to import `self` - | -LL | use std::mem::{self}; - | + + - -error[E0432]: unresolved import `foo` - --> $DIR/use-mod-4.rs:1:5 - | -LL | use foo::self; - | ^^^^^^^^^ no `foo` in the root - -error: aborting due to 3 previous errors - -Some errors have detailed explanations: E0429, E0432. -For more information about an error, try `rustc --explain E0429`. diff --git a/src/test/ui/use/use-mod/use-mod-5.rs b/src/test/ui/use/use-mod/use-mod-5.rs deleted file mode 100644 index df5b423ec..000000000 --- a/src/test/ui/use/use-mod/use-mod-5.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod foo { - pub mod bar { - pub fn drop() {} - } -} - -use foo::bar::self; -//~^ ERROR `self` imports are only allowed within a { } list - -fn main() { - // Because of error recovery this shouldn't error - bar::drop(); -} diff --git a/src/test/ui/use/use-mod/use-mod-5.stderr b/src/test/ui/use/use-mod/use-mod-5.stderr deleted file mode 100644 index 62859e261..000000000 --- a/src/test/ui/use/use-mod/use-mod-5.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0429]: `self` imports are only allowed within a { } list - --> $DIR/use-mod-5.rs:7:13 - | -LL | use foo::bar::self; - | ^^^^^^ - | -help: consider importing the module directly - | -LL - use foo::bar::self; -LL + use foo::bar; - | -help: alternatively, use the multi-path `use` syntax to import `self` - | -LL | use foo::bar::{self}; - | + + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0429`. diff --git a/src/test/ui/use/use-mod/use-mod-6.rs b/src/test/ui/use/use-mod/use-mod-6.rs deleted file mode 100644 index 1f8777dac..000000000 --- a/src/test/ui/use/use-mod/use-mod-6.rs +++ /dev/null @@ -1,13 +0,0 @@ -mod foo { - pub mod bar { - pub fn drop() {} - } -} - -use foo::bar::self as abc; -//~^ ERROR `self` imports are only allowed within a { } list - -fn main() { - // Because of error recovery this shouldn't error - abc::drop(); -} diff --git a/src/test/ui/use/use-mod/use-mod-6.stderr b/src/test/ui/use/use-mod/use-mod-6.stderr deleted file mode 100644 index 2d2c90067..000000000 --- a/src/test/ui/use/use-mod/use-mod-6.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0429]: `self` imports are only allowed within a { } list - --> $DIR/use-mod-6.rs:7:13 - | -LL | use foo::bar::self as abc; - | ^^^^^^ - | -help: consider importing the module directly - | -LL - use foo::bar::self as abc; -LL + use foo::bar as abc; - | -help: alternatively, use the multi-path `use` syntax to import `self` - | -LL | use foo::bar::{self as abc}; - | + + - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0429`. diff --git a/src/test/ui/use/use-nested-groups-error.rs b/src/test/ui/use/use-nested-groups-error.rs deleted file mode 100644 index d8b189d19..000000000 --- a/src/test/ui/use/use-nested-groups-error.rs +++ /dev/null @@ -1,15 +0,0 @@ -mod a { - pub mod b1 { - pub enum C2 {} - } - - pub enum B2 {} -} - -use a::{b1::{C1, C2}, B2}; -//~^ ERROR unresolved import `a::b1::C1` - -fn main() { - let _: C2; - let _: B2; -} diff --git a/src/test/ui/use/use-nested-groups-error.stderr b/src/test/ui/use/use-nested-groups-error.stderr deleted file mode 100644 index 7234c8ec6..000000000 --- a/src/test/ui/use/use-nested-groups-error.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0432]: unresolved import `a::b1::C1` - --> $DIR/use-nested-groups-error.rs:9:14 - | -LL | use a::{b1::{C1, C2}, B2}; - | ^^ - | | - | no `C1` in `a::b1` - | help: a similar name exists in the module: `C2` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0432`. diff --git a/src/test/ui/use/use-nested-groups-unused-imports.rs b/src/test/ui/use/use-nested-groups-unused-imports.rs deleted file mode 100644 index ca6b8ba94..000000000 --- a/src/test/ui/use/use-nested-groups-unused-imports.rs +++ /dev/null @@ -1,24 +0,0 @@ -#![allow(dead_code)] -#![deny(unused_imports)] - -mod foo { - pub mod bar { - pub mod baz { - pub struct Bar(); - } - pub mod foobar {} - } - - pub struct Foo(); -} - -use foo::{Foo, bar::{baz::{}, foobar::*}, *}; - //~^ ERROR unused imports: `*`, `Foo`, `baz::{}`, `foobar::*` -use foo::bar::baz::{*, *}; - //~^ ERROR unused import: `*` -use foo::{}; - //~^ ERROR unused import: `foo::{}` - -fn main() { - let _: Bar; -} diff --git a/src/test/ui/use/use-nested-groups-unused-imports.stderr b/src/test/ui/use/use-nested-groups-unused-imports.stderr deleted file mode 100644 index 6610f8ecd..000000000 --- a/src/test/ui/use/use-nested-groups-unused-imports.stderr +++ /dev/null @@ -1,26 +0,0 @@ -error: unused imports: `*`, `Foo`, `baz::{}`, `foobar::*` - --> $DIR/use-nested-groups-unused-imports.rs:15:11 - | -LL | use foo::{Foo, bar::{baz::{}, foobar::*}, *}; - | ^^^ ^^^^^^^ ^^^^^^^^^ ^ - | -note: the lint level is defined here - --> $DIR/use-nested-groups-unused-imports.rs:2:9 - | -LL | #![deny(unused_imports)] - | ^^^^^^^^^^^^^^ - -error: unused import: `*` - --> $DIR/use-nested-groups-unused-imports.rs:17:24 - | -LL | use foo::bar::baz::{*, *}; - | ^ - -error: unused import: `foo::{}` - --> $DIR/use-nested-groups-unused-imports.rs:19:5 - | -LL | use foo::{}; - | ^^^^^^^ - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/use/use-paths-as-items.rs b/src/test/ui/use/use-paths-as-items.rs deleted file mode 100644 index 7b5eb56b1..000000000 --- a/src/test/ui/use/use-paths-as-items.rs +++ /dev/null @@ -1,9 +0,0 @@ -// Each path node in a `use` declaration must be treated as an item. If not, the following code -// will trigger an ICE. -// -// Related issue: #25763 - -use std::{mem, ptr}; -use std::mem; //~ ERROR the name `mem` is defined multiple times - -fn main() {} diff --git a/src/test/ui/use/use-paths-as-items.stderr b/src/test/ui/use/use-paths-as-items.stderr deleted file mode 100644 index b09001a9b..000000000 --- a/src/test/ui/use/use-paths-as-items.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error[E0252]: the name `mem` is defined multiple times - --> $DIR/use-paths-as-items.rs:7:5 - | -LL | use std::{mem, ptr}; - | --- previous import of the module `mem` here -LL | use std::mem; - | ^^^^^^^^ `mem` reimported here - | - = note: `mem` must be defined only once in the type namespace of this module - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0252`. diff --git a/src/test/ui/use/use-self-type.rs b/src/test/ui/use/use-self-type.rs deleted file mode 100644 index 3b4ce4297..000000000 --- a/src/test/ui/use/use-self-type.rs +++ /dev/null @@ -1,11 +0,0 @@ -struct S; - -impl S { - fn f() {} - fn g() { - use Self::f; //~ ERROR unresolved import - pub(in Self::f) struct Z; //~ ERROR failed to resolve: `Self` - } -} - -fn main() {} diff --git a/src/test/ui/use/use-self-type.stderr b/src/test/ui/use/use-self-type.stderr deleted file mode 100644 index e61539411..000000000 --- a/src/test/ui/use/use-self-type.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions - --> $DIR/use-self-type.rs:7:16 - | -LL | pub(in Self::f) struct Z; - | ^^^^ `Self` is only available in impls, traits, and type definitions - -error[E0432]: unresolved import `Self` - --> $DIR/use-self-type.rs:6:13 - | -LL | use Self::f; - | ^^^^ `Self` is only available in impls, traits, and type definitions - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0432, E0433. -For more information about an error, try `rustc --explain E0432`. diff --git a/src/test/ui/use/use-super-global-path.rs b/src/test/ui/use/use-super-global-path.rs deleted file mode 100644 index 64bfd14b7..000000000 --- a/src/test/ui/use/use-super-global-path.rs +++ /dev/null @@ -1,16 +0,0 @@ -#![allow(unused)] - -struct S; -struct Z; - -mod foo { - use ::super::{S, Z}; //~ ERROR global paths cannot start with `super` - //~| ERROR global paths cannot start with `super` - - pub fn g() { - use ::super::main; //~ ERROR global paths cannot start with `super` - main(); - } -} - -fn main() { foo::g(); } diff --git a/src/test/ui/use/use-super-global-path.stderr b/src/test/ui/use/use-super-global-path.stderr deleted file mode 100644 index 7014a12e9..000000000 --- a/src/test/ui/use/use-super-global-path.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error[E0433]: failed to resolve: global paths cannot start with `super` - --> $DIR/use-super-global-path.rs:7:11 - | -LL | use ::super::{S, Z}; - | ^^^^^ global paths cannot start with `super` - -error[E0433]: failed to resolve: global paths cannot start with `super` - --> $DIR/use-super-global-path.rs:7:11 - | -LL | use ::super::{S, Z}; - | ^^^^^ global paths cannot start with `super` - -error[E0433]: failed to resolve: global paths cannot start with `super` - --> $DIR/use-super-global-path.rs:11:15 - | -LL | use ::super::main; - | ^^^^^ global paths cannot start with `super` - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0433`. -- cgit v1.2.3