diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /src/test/ui/empty | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/empty')
29 files changed, 0 insertions, 1023 deletions
diff --git a/src/test/ui/empty/auxiliary/empty-struct.rs b/src/test/ui/empty/auxiliary/empty-struct.rs deleted file mode 100644 index 3fb40f6bf..000000000 --- a/src/test/ui/empty/auxiliary/empty-struct.rs +++ /dev/null @@ -1,9 +0,0 @@ -pub struct XEmpty1 {} -pub struct XEmpty2; -pub struct XEmpty6(); - -pub enum XE { - XEmpty3 {}, - XEmpty4, - XEmpty5(), -} diff --git a/src/test/ui/empty/auxiliary/two_macros.rs b/src/test/ui/empty/auxiliary/two_macros.rs deleted file mode 100644 index 2330c75c8..000000000 --- a/src/test/ui/empty/auxiliary/two_macros.rs +++ /dev/null @@ -1,5 +0,0 @@ -#[macro_export] -macro_rules! macro_one { () => ("one") } - -#[macro_export] -macro_rules! macro_two { () => ("two") } diff --git a/src/test/ui/empty/empty-attributes.rs b/src/test/ui/empty/empty-attributes.rs deleted file mode 100644 index d319227b2..000000000 --- a/src/test/ui/empty/empty-attributes.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(lint_reasons)] - -#![deny(unused_attributes)] -#![allow()] //~ ERROR unused attribute -#![expect()] //~ ERROR unused attribute -#![warn()] //~ ERROR unused attribute -#![deny()] //~ ERROR unused attribute -#![forbid()] //~ ERROR unused attribute -#![feature()] //~ ERROR unused attribute - -#[repr()] //~ ERROR unused attribute -pub struct S; - -#[target_feature()] //~ ERROR unused attribute -pub unsafe fn foo() {} - -fn main() {} diff --git a/src/test/ui/empty/empty-attributes.stderr b/src/test/ui/empty/empty-attributes.stderr deleted file mode 100644 index 01d0d5a6b..000000000 --- a/src/test/ui/empty/empty-attributes.stderr +++ /dev/null @@ -1,71 +0,0 @@ -error: unused attribute - --> $DIR/empty-attributes.rs:11:1 - | -LL | #[repr()] - | ^^^^^^^^^ help: remove this attribute - | - = note: attribute `repr` with an empty list has no effect -note: the lint level is defined here - --> $DIR/empty-attributes.rs:3:9 - | -LL | #![deny(unused_attributes)] - | ^^^^^^^^^^^^^^^^^ - -error: unused attribute - --> $DIR/empty-attributes.rs:14:1 - | -LL | #[target_feature()] - | ^^^^^^^^^^^^^^^^^^^ help: remove this attribute - | - = note: attribute `target_feature` with an empty list has no effect - -error: unused attribute - --> $DIR/empty-attributes.rs:4:1 - | -LL | #![allow()] - | ^^^^^^^^^^^ help: remove this attribute - | - = note: attribute `allow` with an empty list has no effect - -error: unused attribute - --> $DIR/empty-attributes.rs:5:1 - | -LL | #![expect()] - | ^^^^^^^^^^^^ help: remove this attribute - | - = note: attribute `expect` with an empty list has no effect - -error: unused attribute - --> $DIR/empty-attributes.rs:6:1 - | -LL | #![warn()] - | ^^^^^^^^^^ help: remove this attribute - | - = note: attribute `warn` with an empty list has no effect - -error: unused attribute - --> $DIR/empty-attributes.rs:7:1 - | -LL | #![deny()] - | ^^^^^^^^^^ help: remove this attribute - | - = note: attribute `deny` with an empty list has no effect - -error: unused attribute - --> $DIR/empty-attributes.rs:8:1 - | -LL | #![forbid()] - | ^^^^^^^^^^^^ help: remove this attribute - | - = note: attribute `forbid` with an empty list has no effect - -error: unused attribute - --> $DIR/empty-attributes.rs:9:1 - | -LL | #![feature()] - | ^^^^^^^^^^^^^ help: remove this attribute - | - = note: attribute `feature` with an empty list has no effect - -error: aborting due to 8 previous errors - diff --git a/src/test/ui/empty/empty-comment.rs b/src/test/ui/empty/empty-comment.rs deleted file mode 100644 index 174274d28..000000000 --- a/src/test/ui/empty/empty-comment.rs +++ /dev/null @@ -1,11 +0,0 @@ -// `/**/` was previously regarded as a doc comment because it starts with `/**` and ends with `*/`. -// This could break some internal logic that assumes the length of a doc comment is at least 5, -// leading to an ICE. - -macro_rules! one_arg_macro { - ($fmt:expr) => (print!(concat!($fmt, "\n"))); -} - -fn main() { - one_arg_macro!(/**/); //~ ERROR unexpected end -} diff --git a/src/test/ui/empty/empty-comment.stderr b/src/test/ui/empty/empty-comment.stderr deleted file mode 100644 index 7cc8d8fe9..000000000 --- a/src/test/ui/empty/empty-comment.stderr +++ /dev/null @@ -1,17 +0,0 @@ -error: unexpected end of macro invocation - --> $DIR/empty-comment.rs:10:5 - | -LL | macro_rules! one_arg_macro { - | -------------------------- when calling this macro -... -LL | one_arg_macro!(/**/); - | ^^^^^^^^^^^^^^^^^^^^ missing tokens in macro arguments - | -note: while trying to match meta-variable `$fmt:expr` - --> $DIR/empty-comment.rs:6:6 - | -LL | ($fmt:expr) => (print!(concat!($fmt, "\n"))); - | ^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/empty/empty-linkname.rs b/src/test/ui/empty/empty-linkname.rs deleted file mode 100644 index 7113d913c..000000000 --- a/src/test/ui/empty/empty-linkname.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[link(name = "")] //~ ERROR: link name must not be empty -extern "C" {} - -fn main() {} diff --git a/src/test/ui/empty/empty-linkname.stderr b/src/test/ui/empty/empty-linkname.stderr deleted file mode 100644 index adcf3670d..000000000 --- a/src/test/ui/empty/empty-linkname.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0454]: link name must not be empty - --> $DIR/empty-linkname.rs:1:15 - | -LL | #[link(name = "")] - | ^^ empty link name - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0454`. diff --git a/src/test/ui/empty/empty-macro-use.rs b/src/test/ui/empty/empty-macro-use.rs deleted file mode 100644 index 846004e66..000000000 --- a/src/test/ui/empty/empty-macro-use.rs +++ /dev/null @@ -1,9 +0,0 @@ -// aux-build:two_macros.rs - -#[macro_use()] -extern crate two_macros; - -pub fn main() { - macro_two!(); - //~^ ERROR cannot find macro -} diff --git a/src/test/ui/empty/empty-macro-use.stderr b/src/test/ui/empty/empty-macro-use.stderr deleted file mode 100644 index 700f6616a..000000000 --- a/src/test/ui/empty/empty-macro-use.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error: cannot find macro `macro_two` in this scope - --> $DIR/empty-macro-use.rs:7:5 - | -LL | macro_two!(); - | ^^^^^^^^^ - | - = note: consider importing this macro: - two_macros::macro_two - -error: aborting due to previous error - diff --git a/src/test/ui/empty/empty-never-array.rs b/src/test/ui/empty/empty-never-array.rs deleted file mode 100644 index 3de2b1a78..000000000 --- a/src/test/ui/empty/empty-never-array.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(never_type)] - -enum Helper<T, U> { - T(T, [!; 0]), - #[allow(dead_code)] - U(U), -} - -fn transmute<T, U>(t: T) -> U { - let Helper::U(u) = Helper::T(t, []); - //~^ ERROR refutable pattern in local binding: `Helper::T(_, _)` not covered - u -} - -fn main() { - println!("{:?}", transmute::<&str, (*const u8, u64)>("type safety")); -} diff --git a/src/test/ui/empty/empty-never-array.stderr b/src/test/ui/empty/empty-never-array.stderr deleted file mode 100644 index adf782743..000000000 --- a/src/test/ui/empty/empty-never-array.stderr +++ /dev/null @@ -1,28 +0,0 @@ -error[E0005]: refutable pattern in local binding: `Helper::T(_, _)` not covered - --> $DIR/empty-never-array.rs:10:9 - | -LL | let Helper::U(u) = Helper::T(t, []); - | ^^^^^^^^^^^^ pattern `Helper::T(_, _)` not covered - | - = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant - = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html -note: `Helper<T, U>` defined here - --> $DIR/empty-never-array.rs:4:5 - | -LL | enum Helper<T, U> { - | ------ -LL | T(T, [!; 0]), - | ^ not covered - = note: the matched value is of type `Helper<T, U>` -help: you might want to use `if let` to ignore the variant that isn't matched - | -LL | let u = if let Helper::U(u) = Helper::T(t, []) { u } else { todo!() }; - | ++++++++++ ++++++++++++++++++++++ -help: alternatively, you might want to use let else to handle the variant that isn't matched - | -LL | let Helper::U(u) = Helper::T(t, []) else { todo!() }; - | ++++++++++++++++ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0005`. diff --git a/src/test/ui/empty/empty-struct-braces-expr.rs b/src/test/ui/empty/empty-struct-braces-expr.rs deleted file mode 100644 index 2aab3e777..000000000 --- a/src/test/ui/empty/empty-struct-braces-expr.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Can't use empty braced struct as constant or constructor function - -// aux-build:empty-struct.rs - -extern crate empty_struct; -use empty_struct::*; - -struct Empty1 {} - -enum E { - Empty3 {} -} - -fn main() { - let e1 = Empty1; //~ ERROR expected value, found struct `Empty1` - let e1 = Empty1(); - //~^ ERROR expected function, tuple struct or tuple variant, found struct `Empty1` - let e3 = E::Empty3; //~ ERROR expected value, found struct variant `E::Empty3` - let e3 = E::Empty3(); - //~^ ERROR expected value, found struct variant `E::Empty3` - - let xe1 = XEmpty1; //~ ERROR expected value, found struct `XEmpty1` - let xe1 = XEmpty1(); - //~^ ERROR expected function, tuple struct or tuple variant, found struct `XEmpty1` - let xe3 = XE::Empty3; //~ ERROR no variant or associated item named `Empty3` found for enum - let xe3 = XE::Empty3(); //~ ERROR no variant or associated item named `Empty3` found for enum - - XE::Empty1 {}; //~ ERROR no variant named `Empty1` found for enum `empty_struct::XE` -} diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr deleted file mode 100644 index e1a7a02a5..000000000 --- a/src/test/ui/empty/empty-struct-braces-expr.stderr +++ /dev/null @@ -1,130 +0,0 @@ -error[E0423]: expected value, found struct `Empty1` - --> $DIR/empty-struct-braces-expr.rs:15:14 - | -LL | struct Empty1 {} - | ---------------- `Empty1` defined here -... -LL | let e1 = Empty1; - | ^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:2:1 - | -LL | pub struct XEmpty2; - | ------------------ similarly named unit struct `XEmpty2` defined here - | -help: use struct literal syntax instead - | -LL | let e1 = Empty1 {}; - | ~~~~~~~~~ -help: a unit struct with a similar name exists - | -LL | let e1 = XEmpty2; - | ~~~~~~~ - -error[E0423]: expected value, found struct `XEmpty1` - --> $DIR/empty-struct-braces-expr.rs:22:15 - | -LL | let xe1 = XEmpty1; - | ^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:1:1 - | -LL | pub struct XEmpty1 {} - | ------------------ `XEmpty1` defined here -LL | pub struct XEmpty2; - | ------------------ similarly named unit struct `XEmpty2` defined here - | -help: use struct literal syntax instead - | -LL | let xe1 = XEmpty1 {}; - | ~~~~~~~~~~ -help: a unit struct with a similar name exists - | -LL | let xe1 = XEmpty2; - | ~~~~~~~ - -error[E0423]: expected function, tuple struct or tuple variant, found struct `Empty1` - --> $DIR/empty-struct-braces-expr.rs:16:14 - | -LL | struct Empty1 {} - | ---------------- `Empty1` defined here -... -LL | let e1 = Empty1(); - | ^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:2:1 - | -LL | pub struct XEmpty2; - | ------------------ similarly named unit struct `XEmpty2` defined here - | -help: use struct literal syntax instead - | -LL | let e1 = Empty1 {}; - | ~~~~~~~~~ -help: a unit struct with a similar name exists - | -LL | let e1 = XEmpty2(); - | ~~~~~~~ - -error[E0533]: expected value, found struct variant `E::Empty3` - --> $DIR/empty-struct-braces-expr.rs:18:14 - | -LL | let e3 = E::Empty3; - | ^^^^^^^^^ not a value - -error[E0533]: expected value, found struct variant `E::Empty3` - --> $DIR/empty-struct-braces-expr.rs:19:14 - | -LL | let e3 = E::Empty3(); - | ^^^^^^^^^ not a value - -error[E0423]: expected function, tuple struct or tuple variant, found struct `XEmpty1` - --> $DIR/empty-struct-braces-expr.rs:23:15 - | -LL | let xe1 = XEmpty1(); - | ^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:1:1 - | -LL | pub struct XEmpty1 {} - | ------------------ `XEmpty1` defined here -LL | pub struct XEmpty2; - | ------------------ similarly named unit struct `XEmpty2` defined here - | -help: use struct literal syntax instead - | -LL | let xe1 = XEmpty1 {}; - | ~~~~~~~~~~ -help: a unit struct with a similar name exists - | -LL | let xe1 = XEmpty2(); - | ~~~~~~~ - -error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope - --> $DIR/empty-struct-braces-expr.rs:25:19 - | -LL | let xe3 = XE::Empty3; - | ^^^^^^ - | | - | variant or associated item not found in `empty_struct::XE` - | help: there is a variant with a similar name: `XEmpty3` - -error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope - --> $DIR/empty-struct-braces-expr.rs:26:19 - | -LL | let xe3 = XE::Empty3(); - | ^^^^^^ - | | - | variant or associated item not found in `empty_struct::XE` - | help: there is a variant with a similar name: `XEmpty3` - -error[E0599]: no variant named `Empty1` found for enum `empty_struct::XE` - --> $DIR/empty-struct-braces-expr.rs:28:9 - | -LL | XE::Empty1 {}; - | ^^^^^^ help: there is a variant with a similar name: `XEmpty3` - -error: aborting due to 9 previous errors - -Some errors have detailed explanations: E0423, E0533, E0599. -For more information about an error, try `rustc --explain E0423`. diff --git a/src/test/ui/empty/empty-struct-braces-pat-1.rs b/src/test/ui/empty/empty-struct-braces-pat-1.rs deleted file mode 100644 index 9bed93f9c..000000000 --- a/src/test/ui/empty/empty-struct-braces-pat-1.rs +++ /dev/null @@ -1,34 +0,0 @@ -// Can't use empty braced struct as constant pattern - -// aux-build:empty-struct.rs - -extern crate empty_struct; -use empty_struct::*; - -struct Empty1 {} - -enum E { - Empty3 {} -} - -fn main() { - let e1 = Empty1 {}; - let e3 = E::Empty3 {}; - let xe1 = XEmpty1 {}; - let xe3 = XE::XEmpty3 {}; - - match e1 { - Empty1 => () // Not an error, `Empty1` is interpreted as a new binding - } - match e3 { - E::Empty3 => () - //~^ ERROR expected unit struct, unit variant or constant, found struct variant `E::Empty3` - } - match xe1 { - XEmpty1 => () // Not an error, `XEmpty1` is interpreted as a new binding - } - match xe3 { - XE::XEmpty3 => () - //~^ ERROR expected unit struct, unit variant or constant, found struct variant `XE::XEmpty3` - } -} diff --git a/src/test/ui/empty/empty-struct-braces-pat-1.stderr b/src/test/ui/empty/empty-struct-braces-pat-1.stderr deleted file mode 100644 index 14e09fc27..000000000 --- a/src/test/ui/empty/empty-struct-braces-pat-1.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0533]: expected unit struct, unit variant or constant, found struct variant `E::Empty3` - --> $DIR/empty-struct-braces-pat-1.rs:24:9 - | -LL | E::Empty3 => () - | ^^^^^^^^^ not a unit struct, unit variant or constant - -error[E0533]: expected unit struct, unit variant or constant, found struct variant `XE::XEmpty3` - --> $DIR/empty-struct-braces-pat-1.rs:31:9 - | -LL | XE::XEmpty3 => () - | ^^^^^^^^^^^ not a unit struct, unit variant or constant - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0533`. diff --git a/src/test/ui/empty/empty-struct-braces-pat-2.rs b/src/test/ui/empty/empty-struct-braces-pat-2.rs deleted file mode 100644 index cfe4641f3..000000000 --- a/src/test/ui/empty/empty-struct-braces-pat-2.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Can't use empty braced struct as enum pattern - -// aux-build:empty-struct.rs - -extern crate empty_struct; -use empty_struct::*; - -struct Empty1 {} - -fn main() { - let e1 = Empty1 {}; - let xe1 = XEmpty1 {}; - - match e1 { - Empty1() => () //~ ERROR expected tuple struct or tuple variant, found struct `Empty1` - } - match xe1 { - XEmpty1() => () //~ ERROR expected tuple struct or tuple variant, found struct `XEmpty1` - } - match e1 { - Empty1(..) => () //~ ERROR expected tuple struct or tuple variant, found struct `Empty1` - } - match xe1 { - XEmpty1(..) => () //~ ERROR expected tuple struct or tuple variant, found struct `XEmpty1` - } -} diff --git a/src/test/ui/empty/empty-struct-braces-pat-2.stderr b/src/test/ui/empty/empty-struct-braces-pat-2.stderr deleted file mode 100644 index 7fb5cb203..000000000 --- a/src/test/ui/empty/empty-struct-braces-pat-2.stderr +++ /dev/null @@ -1,95 +0,0 @@ -error[E0532]: expected tuple struct or tuple variant, found struct `Empty1` - --> $DIR/empty-struct-braces-pat-2.rs:15:9 - | -LL | struct Empty1 {} - | ---------------- `Empty1` defined here -... -LL | Empty1() => () - | ^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:3:1 - | -LL | pub struct XEmpty6(); - | ------------------ similarly named tuple struct `XEmpty6` defined here - | -help: use struct pattern syntax instead - | -LL | Empty1 {} => () - | ~~~~~~~~~ -help: a tuple struct with a similar name exists - | -LL | XEmpty6() => () - | ~~~~~~~ - -error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1` - --> $DIR/empty-struct-braces-pat-2.rs:18:9 - | -LL | XEmpty1() => () - | ^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:1:1 - | -LL | pub struct XEmpty1 {} - | ------------------ `XEmpty1` defined here -LL | pub struct XEmpty2; -LL | pub struct XEmpty6(); - | ------------------ similarly named tuple struct `XEmpty6` defined here - | -help: use struct pattern syntax instead - | -LL | XEmpty1 {} => () - | ~~~~~~~~~~ -help: a tuple struct with a similar name exists - | -LL | XEmpty6() => () - | ~~~~~~~ - -error[E0532]: expected tuple struct or tuple variant, found struct `Empty1` - --> $DIR/empty-struct-braces-pat-2.rs:21:9 - | -LL | struct Empty1 {} - | ---------------- `Empty1` defined here -... -LL | Empty1(..) => () - | ^^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:3:1 - | -LL | pub struct XEmpty6(); - | ------------------ similarly named tuple struct `XEmpty6` defined here - | -help: use struct pattern syntax instead - | -LL | Empty1 {} => () - | ~~~~~~~~~ -help: a tuple struct with a similar name exists - | -LL | XEmpty6(..) => () - | ~~~~~~~ - -error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1` - --> $DIR/empty-struct-braces-pat-2.rs:24:9 - | -LL | XEmpty1(..) => () - | ^^^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:1:1 - | -LL | pub struct XEmpty1 {} - | ------------------ `XEmpty1` defined here -LL | pub struct XEmpty2; -LL | pub struct XEmpty6(); - | ------------------ similarly named tuple struct `XEmpty6` defined here - | -help: use struct pattern syntax instead - | -LL | XEmpty1 {} => () - | ~~~~~~~~~~ -help: a tuple struct with a similar name exists - | -LL | XEmpty6(..) => () - | ~~~~~~~ - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/empty/empty-struct-braces-pat-3.rs b/src/test/ui/empty/empty-struct-braces-pat-3.rs deleted file mode 100644 index 54d547eef..000000000 --- a/src/test/ui/empty/empty-struct-braces-pat-3.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Can't use empty braced struct as enum pattern - -// aux-build:empty-struct.rs - -extern crate empty_struct; -use empty_struct::*; - -enum E { - Empty3 {} -} - -fn main() { - let e3 = E::Empty3 {}; - let xe3 = XE::XEmpty3 {}; - - match e3 { - E::Empty3() => () - //~^ ERROR expected tuple struct or tuple variant, found struct variant `E::Empty3` - } - match xe3 { - XE::XEmpty3() => () - //~^ ERROR expected tuple struct or tuple variant, found struct variant `XE::XEmpty3` - } - match e3 { - E::Empty3(..) => () - //~^ ERROR expected tuple struct or tuple variant, found struct variant `E::Empty3` - } - match xe3 { - XE::XEmpty3(..) => () - //~^ ERROR expected tuple struct or tuple variant, found struct variant `XE::XEmpty3 - } -} diff --git a/src/test/ui/empty/empty-struct-braces-pat-3.stderr b/src/test/ui/empty/empty-struct-braces-pat-3.stderr deleted file mode 100644 index 00c8b12e6..000000000 --- a/src/test/ui/empty/empty-struct-braces-pat-3.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0164]: expected tuple struct or tuple variant, found struct variant `E::Empty3` - --> $DIR/empty-struct-braces-pat-3.rs:17:9 - | -LL | E::Empty3() => () - | ^^^^^^^^^^^ not a tuple struct or tuple variant - -error[E0164]: expected tuple struct or tuple variant, found struct variant `XE::XEmpty3` - --> $DIR/empty-struct-braces-pat-3.rs:21:9 - | -LL | XE::XEmpty3() => () - | ^^^^^^^^^^^^^ not a tuple struct or tuple variant - -error[E0164]: expected tuple struct or tuple variant, found struct variant `E::Empty3` - --> $DIR/empty-struct-braces-pat-3.rs:25:9 - | -LL | E::Empty3(..) => () - | ^^^^^^^^^^^^^ not a tuple struct or tuple variant - -error[E0164]: expected tuple struct or tuple variant, found struct variant `XE::XEmpty3` - --> $DIR/empty-struct-braces-pat-3.rs:29:9 - | -LL | XE::XEmpty3(..) => () - | ^^^^^^^^^^^^^^^ not a tuple struct or tuple variant - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0164`. diff --git a/src/test/ui/empty/empty-struct-tuple-pat.rs b/src/test/ui/empty/empty-struct-tuple-pat.rs deleted file mode 100644 index 47da8a306..000000000 --- a/src/test/ui/empty/empty-struct-tuple-pat.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Can't use unit struct as enum pattern - -// aux-build:empty-struct.rs - -extern crate empty_struct; -use empty_struct::*; - -struct Empty2(); - -enum E { - Empty4() -} - -// remove attribute after warning cycle and promoting warnings to errors -fn main() { - let e2 = Empty2(); - let e4 = E::Empty4(); - let xe6 = XEmpty6(); - let xe5 = XE::XEmpty5(); - - match e2 { - Empty2 => () //~ ERROR match bindings cannot shadow tuple structs - } - match xe6 { - XEmpty6 => () //~ ERROR match bindings cannot shadow tuple structs - } - - match e4 { - E::Empty4 => () - //~^ ERROR expected unit struct, unit variant or constant, found tuple variant `E::Empty4` - } - match xe5 { - XE::XEmpty5 => (), - //~^ ERROR expected unit struct, unit variant or constant, found tuple variant `XE::XEmpty5` - _ => {}, - } -} diff --git a/src/test/ui/empty/empty-struct-tuple-pat.stderr b/src/test/ui/empty/empty-struct-tuple-pat.stderr deleted file mode 100644 index 8d0f75d20..000000000 --- a/src/test/ui/empty/empty-struct-tuple-pat.stderr +++ /dev/null @@ -1,59 +0,0 @@ -error[E0530]: match bindings cannot shadow tuple structs - --> $DIR/empty-struct-tuple-pat.rs:22:9 - | -LL | struct Empty2(); - | ---------------- the tuple struct `Empty2` is defined here -... -LL | Empty2 => () - | ^^^^^^ - | | - | cannot be named the same as a tuple struct - | help: try specify the pattern arguments: `Empty2(..)` - -error[E0530]: match bindings cannot shadow tuple structs - --> $DIR/empty-struct-tuple-pat.rs:25:9 - | -LL | use empty_struct::*; - | --------------- the tuple struct `XEmpty6` is imported here -... -LL | XEmpty6 => () - | ^^^^^^^ - | | - | cannot be named the same as a tuple struct - | help: try specify the pattern arguments: `XEmpty6(..)` - -error[E0532]: expected unit struct, unit variant or constant, found tuple variant `E::Empty4` - --> $DIR/empty-struct-tuple-pat.rs:29:9 - | -LL | Empty4() - | -------- `E::Empty4` defined here -... -LL | E::Empty4 => () - | ^^^^^^^^^ help: use the tuple variant pattern syntax instead: `E::Empty4()` - -error[E0532]: expected unit struct, unit variant or constant, found tuple variant `XE::XEmpty5` - --> $DIR/empty-struct-tuple-pat.rs:33:9 - | -LL | XE::XEmpty5 => (), - | ^^^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:7:5 - | -LL | XEmpty4, - | ------- similarly named unit variant `XEmpty4` defined here -LL | XEmpty5(), - | ------- `XE::XEmpty5` defined here - | -help: use the tuple variant pattern syntax instead - | -LL | XE::XEmpty5(/* fields */) => (), - | ~~~~~~~~~~~~~~~~~~~~~~~~~ -help: a unit variant with a similar name exists - | -LL | XE::XEmpty4 => (), - | ~~~~~~~ - -error: aborting due to 4 previous errors - -Some errors have detailed explanations: E0530, E0532. -For more information about an error, try `rustc --explain E0530`. diff --git a/src/test/ui/empty/empty-struct-unit-expr.rs b/src/test/ui/empty/empty-struct-unit-expr.rs deleted file mode 100644 index 8f3688a2a..000000000 --- a/src/test/ui/empty/empty-struct-unit-expr.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Can't use unit struct as constructor function - -// aux-build:empty-struct.rs - -extern crate empty_struct; -use empty_struct::*; - -struct Empty2; - -enum E { - Empty4 -} - -fn main() { - let e2 = Empty2(); //~ ERROR expected function, found struct `Empty2` - let e4 = E::Empty4(); - //~^ ERROR expected function, found enum variant `E::Empty4` [E0618] - let xe2 = XEmpty2(); //~ ERROR expected function, found struct `XEmpty2` - let xe4 = XE::XEmpty4(); - //~^ ERROR expected function, found enum variant `XE::XEmpty4` [E0618] -} diff --git a/src/test/ui/empty/empty-struct-unit-expr.stderr b/src/test/ui/empty/empty-struct-unit-expr.stderr deleted file mode 100644 index e97209527..000000000 --- a/src/test/ui/empty/empty-struct-unit-expr.stderr +++ /dev/null @@ -1,65 +0,0 @@ -error[E0618]: expected function, found struct `Empty2` - --> $DIR/empty-struct-unit-expr.rs:15:14 - | -LL | struct Empty2; - | ------------- struct `Empty2` defined here -... -LL | let e2 = Empty2(); - | ^^^^^^-- - | | - | call expression requires function - | -help: `Empty2` is a unit struct, and does not take parentheses to be constructed - | -LL - let e2 = Empty2(); -LL + let e2 = Empty2; - | - -error[E0618]: expected function, found enum variant `E::Empty4` - --> $DIR/empty-struct-unit-expr.rs:16:14 - | -LL | Empty4 - | ------ enum variant `E::Empty4` defined here -... -LL | let e4 = E::Empty4(); - | ^^^^^^^^^-- - | | - | call expression requires function - | -help: `E::Empty4` is a unit enum variant, and does not take parentheses to be constructed - | -LL - let e4 = E::Empty4(); -LL + let e4 = E::Empty4; - | - -error[E0618]: expected function, found struct `XEmpty2` - --> $DIR/empty-struct-unit-expr.rs:18:15 - | -LL | let xe2 = XEmpty2(); - | ^^^^^^^-- - | | - | call expression requires function - | -help: `XEmpty2` is a unit struct, and does not take parentheses to be constructed - | -LL - let xe2 = XEmpty2(); -LL + let xe2 = XEmpty2; - | - -error[E0618]: expected function, found enum variant `XE::XEmpty4` - --> $DIR/empty-struct-unit-expr.rs:19:15 - | -LL | let xe4 = XE::XEmpty4(); - | ^^^^^^^^^^^-- - | | - | call expression requires function - | -help: `XE::XEmpty4` is a unit enum variant, and does not take parentheses to be constructed - | -LL - let xe4 = XE::XEmpty4(); -LL + let xe4 = XE::XEmpty4; - | - -error: aborting due to 4 previous errors - -For more information about this error, try `rustc --explain E0618`. diff --git a/src/test/ui/empty/empty-struct-unit-pat.rs b/src/test/ui/empty/empty-struct-unit-pat.rs deleted file mode 100644 index 44a1e9e3d..000000000 --- a/src/test/ui/empty/empty-struct-unit-pat.rs +++ /dev/null @@ -1,54 +0,0 @@ -// Can't use unit struct as tuple struct pattern - -// aux-build:empty-struct.rs - -extern crate empty_struct; -use empty_struct::*; - -struct Empty2; - -enum E { - Empty4 -} - -fn main() { - let e2 = Empty2; - let e4 = E::Empty4; - let xe2 = XEmpty2; - let xe4 = XE::XEmpty4; - - match e2 { - Empty2() => () //~ ERROR expected tuple struct or tuple variant, found unit struct `Empty2` - } - match xe2 { - XEmpty2() => () - //~^ ERROR expected tuple struct or tuple variant, found unit struct `XEmpty2` - } - match e2 { - Empty2(..) => () - //~^ ERROR expected tuple struct or tuple variant, found unit struct `Empty2` - } - match xe2 { - XEmpty2(..) => () - //~^ ERROR expected tuple struct or tuple variant, found unit struct `XEmpty2` - } - - match e4 { - E::Empty4() => () - //~^ ERROR expected tuple struct or tuple variant, found unit variant `E::Empty4` - } - match xe4 { - XE::XEmpty4() => (), - //~^ ERROR expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` - _ => {}, - } - match e4 { - E::Empty4(..) => () - //~^ ERROR expected tuple struct or tuple variant, found unit variant `E::Empty4` - } - match xe4 { - XE::XEmpty4(..) => (), - //~^ ERROR expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` - _ => {}, - } -} diff --git a/src/test/ui/empty/empty-struct-unit-pat.stderr b/src/test/ui/empty/empty-struct-unit-pat.stderr deleted file mode 100644 index 5c0b4cffa..000000000 --- a/src/test/ui/empty/empty-struct-unit-pat.stderr +++ /dev/null @@ -1,155 +0,0 @@ -error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2` - --> $DIR/empty-struct-unit-pat.rs:21:9 - | -LL | struct Empty2; - | -------------- `Empty2` defined here -... -LL | Empty2() => () - | ^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:3:1 - | -LL | pub struct XEmpty6(); - | ------------------ similarly named tuple struct `XEmpty6` defined here - | -help: use this syntax instead - | -LL | Empty2 => () - | ~~~~~~ -help: a tuple struct with a similar name exists - | -LL | XEmpty6() => () - | ~~~~~~~ - -error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2` - --> $DIR/empty-struct-unit-pat.rs:24:9 - | -LL | XEmpty2() => () - | ^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:2:1 - | -LL | pub struct XEmpty2; - | ------------------ `XEmpty2` defined here -LL | pub struct XEmpty6(); - | ------------------ similarly named tuple struct `XEmpty6` defined here - | -help: use this syntax instead - | -LL | XEmpty2 => () - | ~~~~~~~ -help: a tuple struct with a similar name exists - | -LL | XEmpty6() => () - | ~~~~~~~ - -error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2` - --> $DIR/empty-struct-unit-pat.rs:28:9 - | -LL | struct Empty2; - | -------------- `Empty2` defined here -... -LL | Empty2(..) => () - | ^^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:3:1 - | -LL | pub struct XEmpty6(); - | ------------------ similarly named tuple struct `XEmpty6` defined here - | -help: use this syntax instead - | -LL | Empty2 => () - | ~~~~~~ -help: a tuple struct with a similar name exists - | -LL | XEmpty6(..) => () - | ~~~~~~~ - -error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2` - --> $DIR/empty-struct-unit-pat.rs:32:9 - | -LL | XEmpty2(..) => () - | ^^^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:2:1 - | -LL | pub struct XEmpty2; - | ------------------ `XEmpty2` defined here -LL | pub struct XEmpty6(); - | ------------------ similarly named tuple struct `XEmpty6` defined here - | -help: use this syntax instead - | -LL | XEmpty2 => () - | ~~~~~~~ -help: a tuple struct with a similar name exists - | -LL | XEmpty6(..) => () - | ~~~~~~~ - -error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` - --> $DIR/empty-struct-unit-pat.rs:37:9 - | -LL | Empty4 - | ------ `E::Empty4` defined here -... -LL | E::Empty4() => () - | ^^^^^^^^^^^ help: use this syntax instead: `E::Empty4` - -error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` - --> $DIR/empty-struct-unit-pat.rs:41:9 - | -LL | XE::XEmpty4() => (), - | ^^^^^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:7:5 - | -LL | XEmpty4, - | ------- `XE::XEmpty4` defined here -LL | XEmpty5(), - | ------- similarly named tuple variant `XEmpty5` defined here - | -help: use this syntax instead - | -LL | XE::XEmpty4 => (), - | ~~~~~~~~~~~ -help: a tuple variant with a similar name exists - | -LL | XE::XEmpty5() => (), - | ~~~~~~~ - -error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4` - --> $DIR/empty-struct-unit-pat.rs:46:9 - | -LL | Empty4 - | ------ `E::Empty4` defined here -... -LL | E::Empty4(..) => () - | ^^^^^^^^^^^^^ help: use this syntax instead: `E::Empty4` - -error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` - --> $DIR/empty-struct-unit-pat.rs:50:9 - | -LL | XE::XEmpty4(..) => (), - | ^^^^^^^^^^^^^^^ - | - ::: $DIR/auxiliary/empty-struct.rs:7:5 - | -LL | XEmpty4, - | ------- `XE::XEmpty4` defined here -LL | XEmpty5(), - | ------- similarly named tuple variant `XEmpty5` defined here - | -help: use this syntax instead - | -LL | XE::XEmpty4 => (), - | ~~~~~~~~~~~ -help: a tuple variant with a similar name exists - | -LL | XE::XEmpty5(..) => (), - | ~~~~~~~ - -error: aborting due to 8 previous errors - -For more information about this error, try `rustc --explain E0532`. diff --git a/src/test/ui/empty/issue-37026.rs b/src/test/ui/empty/issue-37026.rs deleted file mode 100644 index fd678a717..000000000 --- a/src/test/ui/empty/issue-37026.rs +++ /dev/null @@ -1,8 +0,0 @@ -// aux-build:empty-struct.rs - -extern crate empty_struct; - -fn main() { - let empty_struct::XEmpty2 = (); //~ ERROR mismatched types - let empty_struct::XEmpty6(..) = (); //~ ERROR mismatched types -} diff --git a/src/test/ui/empty/issue-37026.stderr b/src/test/ui/empty/issue-37026.stderr deleted file mode 100644 index 48a4a5bca..000000000 --- a/src/test/ui/empty/issue-37026.stderr +++ /dev/null @@ -1,19 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/issue-37026.rs:6:9 - | -LL | let empty_struct::XEmpty2 = (); - | ^^^^^^^^^^^^^^^^^^^^^ -- this expression has type `()` - | | - | expected `()`, found struct `XEmpty2` - -error[E0308]: mismatched types - --> $DIR/issue-37026.rs:7:9 - | -LL | let empty_struct::XEmpty6(..) = (); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ -- this expression has type `()` - | | - | expected `()`, found struct `XEmpty6` - -error: aborting due to 2 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/empty/no-link.rs b/src/test/ui/empty/no-link.rs deleted file mode 100644 index c80e61b45..000000000 --- a/src/test/ui/empty/no-link.rs +++ /dev/null @@ -1,9 +0,0 @@ -// check-pass -// aux-build:empty-struct.rs - -#[no_link] -extern crate empty_struct; - -fn main() { - empty_struct::XEmpty1 {}; -} |