diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/conditional-compilation | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/conditional-compilation')
68 files changed, 0 insertions, 1311 deletions
diff --git a/src/test/ui/conditional-compilation/auxiliary/namespaced_enums.rs b/src/test/ui/conditional-compilation/auxiliary/namespaced_enums.rs deleted file mode 100644 index d3548c76c..000000000 --- a/src/test/ui/conditional-compilation/auxiliary/namespaced_enums.rs +++ /dev/null @@ -1,10 +0,0 @@ -pub enum Foo { - A, - B(isize), - C { a: isize }, -} - -impl Foo { - pub fn foo() {} - pub fn bar(&self) {} -} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-1.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-1.rs deleted file mode 100644 index d20e79b9d..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-1.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --cfg a(b=c) -// error-pattern: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\") -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-1.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-1.stderr deleted file mode 100644 index 3a12e9786..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-1.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\") - diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-2.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-2.rs deleted file mode 100644 index 48d656a4a..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-2.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --cfg a{b} -// error-pattern: invalid `--cfg` argument: `a{b}` (expected `key` or `key="value"`) -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-2.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-2.stderr deleted file mode 100644 index b92e1fd3d..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-2.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--cfg` argument: `a{b}` (expected `key` or `key="value"`) - diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-3.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-3.rs deleted file mode 100644 index 96ac7828c..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-3.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --cfg a::b -// error-pattern: invalid `--cfg` argument: `a::b` (argument key must be an identifier) -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-3.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-3.stderr deleted file mode 100644 index 5412f7ffd..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-3.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--cfg` argument: `a::b` (argument key must be an identifier) - diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-4.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-4.rs deleted file mode 100644 index e7dfa17b4..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-4.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --cfg a(b) -// error-pattern: invalid `--cfg` argument: `a(b)` (expected `key` or `key="value"`) -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-4.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-4.stderr deleted file mode 100644 index 6853a69b9..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-4.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--cfg` argument: `a(b)` (expected `key` or `key="value"`) - diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-5.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-5.rs deleted file mode 100644 index a939f4510..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-5.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --cfg a=10 -// error-pattern: invalid `--cfg` argument: `a=10` (argument value must be a string) -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-5.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-5.stderr deleted file mode 100644 index aafc4e898..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-5.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--cfg` argument: `a=10` (argument value must be a string) - diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-6.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-6.rs deleted file mode 100644 index 9fa726f93..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-6.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --cfg a{ -// error-pattern: invalid `--cfg` argument: `a{` (expected `key` or `key="value"`) -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-6.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-6.stderr deleted file mode 100644 index 7d2087b4b..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-6.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--cfg` argument: `a{` (expected `key` or `key="value"`) - diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-7.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-7.rs deleted file mode 100644 index 149142f63..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-7.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Regression test for issue #89358. - -// compile-flags: --cfg a" -// error-pattern: unterminated double quote string -// error-pattern: this error occurred on the command line diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-7.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-7.stderr deleted file mode 100644 index 919709c84..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-7.stderr +++ /dev/null @@ -1,4 +0,0 @@ -error[E0765]: unterminated double quote string - | - = note: this error occurred on the command line: `--cfg=a"` - diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-8.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-8.rs deleted file mode 100644 index 1d7fa7885..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-8.rs +++ /dev/null @@ -1,3 +0,0 @@ -// compile-flags: --cfg ) -// error-pattern: invalid `--cfg` argument: `)` (expected `key` or `key="value"`) -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-8.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-8.stderr deleted file mode 100644 index 7bb181412..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-8.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--cfg` argument: `)` (expected `key` or `key="value"`) - diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-9.rs b/src/test/ui/conditional-compilation/cfg-arg-invalid-9.rs deleted file mode 100644 index 628b335c8..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-9.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Test for missing quotes around value, issue #66450. -// compile-flags: --cfg key=value -// error-pattern: invalid `--cfg` argument: `key=value` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\") -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-arg-invalid-9.stderr b/src/test/ui/conditional-compilation/cfg-arg-invalid-9.stderr deleted file mode 100644 index 985b52522..000000000 --- a/src/test/ui/conditional-compilation/cfg-arg-invalid-9.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--cfg` argument: `key=value` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\") - diff --git a/src/test/ui/conditional-compilation/cfg-attr-cfg-2.rs b/src/test/ui/conditional-compilation/cfg-attr-cfg-2.rs deleted file mode 100644 index 898c5bac8..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-cfg-2.rs +++ /dev/null @@ -1,9 +0,0 @@ -// -// error-pattern: `main` function not found -// compile-flags: --cfg foo - -// main is conditionally compiled, but the conditional compilation -// is conditional too! - -#[cfg_attr(foo, cfg(bar))] -fn main() { } diff --git a/src/test/ui/conditional-compilation/cfg-attr-cfg-2.stderr b/src/test/ui/conditional-compilation/cfg-attr-cfg-2.stderr deleted file mode 100644 index d61872c48..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-cfg-2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0601]: `main` function not found in crate `cfg_attr_cfg_2` - --> $DIR/cfg-attr-cfg-2.rs:9:14 - | -LL | fn main() { } - | ^ consider adding a `main` function to `$DIR/cfg-attr-cfg-2.rs` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/conditional-compilation/cfg-attr-crate-2.rs b/src/test/ui/conditional-compilation/cfg-attr-crate-2.rs deleted file mode 100644 index 7dbeba53a..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-crate-2.rs +++ /dev/null @@ -1,8 +0,0 @@ -// https://github.com/rust-lang/rust/issues/21833#issuecomment-72353044 - -// compile-flags: --cfg broken - -#![crate_type = "lib"] -#![cfg_attr(broken, no_core)] //~ ERROR the `#[no_core]` attribute is an experimental feature - -pub struct S {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-crate-2.stderr b/src/test/ui/conditional-compilation/cfg-attr-crate-2.stderr deleted file mode 100644 index 4997ca4db..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-crate-2.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: the `#[no_core]` attribute is an experimental feature - --> $DIR/cfg-attr-crate-2.rs:6:21 - | -LL | #![cfg_attr(broken, no_core)] - | ^^^^^^^ - | - = note: see issue #29639 <https://github.com/rust-lang/rust/issues/29639> for more information - = help: add `#![feature(no_core)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.rs b/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.rs deleted file mode 100644 index 2600ec7c4..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.rs +++ /dev/null @@ -1,13 +0,0 @@ -// Check that `#[cfg_attr($PREDICATE,)]` triggers the `unused_attribute` lint. - -// compile-flags: --cfg TRUE - -#![deny(unused)] - -#[cfg_attr(FALSE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes -fn _f() {} - -#[cfg_attr(TRUE,)] //~ ERROR `#[cfg_attr]` does not expand to any attributes -fn _g() {} - -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.stderr b/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.stderr deleted file mode 100644 index 87b698813..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-empty-is-unused.stderr +++ /dev/null @@ -1,21 +0,0 @@ -error: `#[cfg_attr]` does not expand to any attributes - --> $DIR/cfg-attr-empty-is-unused.rs:7:1 - | -LL | #[cfg_attr(FALSE,)] - | ^^^^^^^^^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/cfg-attr-empty-is-unused.rs:5:9 - | -LL | #![deny(unused)] - | ^^^^^^ - = note: `#[deny(unused_attributes)]` implied by `#[deny(unused)]` - -error: `#[cfg_attr]` does not expand to any attributes - --> $DIR/cfg-attr-empty-is-unused.rs:10:1 - | -LL | #[cfg_attr(TRUE,)] - | ^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.rs b/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.rs deleted file mode 100644 index 496d196c9..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.rs +++ /dev/null @@ -1,4 +0,0 @@ -#[cfg(foo(bar))] //~ ERROR invalid predicate `foo` -fn check() {} - -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.stderr b/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.stderr deleted file mode 100644 index 96c571ebe..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-invalid-predicate.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0537]: invalid predicate `foo` - --> $DIR/cfg-attr-invalid-predicate.rs:1:7 - | -LL | #[cfg(foo(bar))] - | ^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0537`. diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs deleted file mode 100644 index 0c7e7cad0..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-false.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Test that cfg_attr doesn't emit any attributes when the -// configuration variable is false. This mirrors `cfg-attr-multi-true.rs` - -// build-pass (FIXME(62277): could be check-pass?) - -#![warn(unused_must_use)] - -#[cfg_attr(any(), deprecated, must_use)] -struct Struct {} - -impl Struct { - fn new() -> Struct { - Struct {} - } -} - -fn main() { - Struct::new(); -} diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs deleted file mode 100644 index 42ffb71e3..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.rs +++ /dev/null @@ -1,7 +0,0 @@ -// compile-flags: --cfg broken - -#![crate_type = "lib"] -#![cfg_attr(broken, no_core, no_std)] -//~^ ERROR the `#[no_core]` attribute is an experimental feature - -pub struct S {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr deleted file mode 100644 index c8762d15d..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-1.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: the `#[no_core]` attribute is an experimental feature - --> $DIR/cfg-attr-multi-invalid-1.rs:4:21 - | -LL | #![cfg_attr(broken, no_core, no_std)] - | ^^^^^^^ - | - = note: see issue #29639 <https://github.com/rust-lang/rust/issues/29639> for more information - = help: add `#![feature(no_core)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs deleted file mode 100644 index 29690e284..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.rs +++ /dev/null @@ -1,7 +0,0 @@ -// compile-flags: --cfg broken - -#![crate_type = "lib"] -#![cfg_attr(broken, no_std, no_core)] -//~^ ERROR the `#[no_core]` attribute is an experimental feature - -pub struct S {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr b/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr deleted file mode 100644 index e75b1c5b4..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-invalid-2.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: the `#[no_core]` attribute is an experimental feature - --> $DIR/cfg-attr-multi-invalid-2.rs:4:29 - | -LL | #![cfg_attr(broken, no_std, no_core)] - | ^^^^^^^ - | - = note: see issue #29639 <https://github.com/rust-lang/rust/issues/29639> for more information - = help: add `#![feature(no_core)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-true.rs b/src/test/ui/conditional-compilation/cfg-attr-multi-true.rs deleted file mode 100644 index 876d8b079..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-true.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Test that cfg_attr with multiple attributes actually emits both attributes. -// This is done by emitting two attributes that cause new warnings, and then -// triggering those warnings. - -// build-pass (FIXME(62277): could be check-pass?) - -#![warn(unused_must_use)] - -#[cfg_attr(all(), deprecated, must_use)] -struct MustUseDeprecated {} - -impl MustUseDeprecated { //~ warning: use of deprecated - fn new() -> MustUseDeprecated { //~ warning: use of deprecated - MustUseDeprecated {} //~ warning: use of deprecated - } -} - -fn main() { - MustUseDeprecated::new(); //~ warning: use of deprecated - //~| warning: unused `MustUseDeprecated` that must be used -} diff --git a/src/test/ui/conditional-compilation/cfg-attr-multi-true.stderr b/src/test/ui/conditional-compilation/cfg-attr-multi-true.stderr deleted file mode 100644 index fbfcd4565..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-multi-true.stderr +++ /dev/null @@ -1,40 +0,0 @@ -warning: use of deprecated struct `MustUseDeprecated` - --> $DIR/cfg-attr-multi-true.rs:12:6 - | -LL | impl MustUseDeprecated { - | ^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(deprecated)]` on by default - -warning: use of deprecated struct `MustUseDeprecated` - --> $DIR/cfg-attr-multi-true.rs:19:5 - | -LL | MustUseDeprecated::new(); - | ^^^^^^^^^^^^^^^^^ - -warning: use of deprecated struct `MustUseDeprecated` - --> $DIR/cfg-attr-multi-true.rs:13:17 - | -LL | fn new() -> MustUseDeprecated { - | ^^^^^^^^^^^^^^^^^ - -warning: use of deprecated struct `MustUseDeprecated` - --> $DIR/cfg-attr-multi-true.rs:14:9 - | -LL | MustUseDeprecated {} - | ^^^^^^^^^^^^^^^^^ - -warning: unused `MustUseDeprecated` that must be used - --> $DIR/cfg-attr-multi-true.rs:19:5 - | -LL | MustUseDeprecated::new(); - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | -note: the lint level is defined here - --> $DIR/cfg-attr-multi-true.rs:7:9 - | -LL | #![warn(unused_must_use)] - | ^^^^^^^^^^^^^^^ - -warning: 5 warnings emitted - diff --git a/src/test/ui/conditional-compilation/cfg-attr-parse.rs b/src/test/ui/conditional-compilation/cfg-attr-parse.rs deleted file mode 100644 index 8ca31c118..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-parse.rs +++ /dev/null @@ -1,55 +0,0 @@ -// Parse `cfg_attr` with varying numbers of attributes and trailing commas - -// Completely empty `cfg_attr` input -#[cfg_attr()] //~ error: malformed `cfg_attr` attribute input -struct NoConfigurationPredicate; - -// Zero attributes, zero trailing comma (comma manatory here) -#[cfg_attr(all())] //~ error: expected `,`, found end of `cfg_attr` -struct A0C0; - -// Zero attributes, one trailing comma -#[cfg_attr(all(),)] // Ok -struct A0C1; - -// Zero attributes, two trailing commas -#[cfg_attr(all(),,)] //~ ERROR expected identifier -struct A0C2; - -// One attribute, no trailing comma -#[cfg_attr(all(), must_use)] // Ok -struct A1C0; - -// One attribute, one trailing comma -#[cfg_attr(all(), must_use,)] // Ok -struct A1C1; - -// One attribute, two trailing commas -#[cfg_attr(all(), must_use,,)] //~ ERROR expected identifier -struct A1C2; - -// Two attributes, no trailing comma -#[cfg_attr(all(), must_use, deprecated)] // Ok -struct A2C0; - -// Two attributes, one trailing comma -#[cfg_attr(all(), must_use, deprecated,)] // Ok -struct A2C1; - -// Two attributes, two trailing commas -#[cfg_attr(all(), must_use, deprecated,,)] //~ ERROR expected identifier -struct A2C2; - -// Wrong delimiter `[` -#[cfg_attr[all(),,]] -//~^ ERROR wrong `cfg_attr` delimiters -//~| ERROR expected identifier, found `,` -struct BracketZero; - -// Wrong delimiter `{` -#[cfg_attr{all(),,}] -//~^ ERROR wrong `cfg_attr` delimiters -//~| ERROR expected identifier, found `,` -struct BraceZero; - -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-parse.stderr b/src/test/ui/conditional-compilation/cfg-attr-parse.stderr deleted file mode 100644 index 8084a6220..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-parse.stderr +++ /dev/null @@ -1,86 +0,0 @@ -error: malformed `cfg_attr` attribute input - --> $DIR/cfg-attr-parse.rs:4:1 - | -LL | #[cfg_attr()] - | ^^^^^^^^^^^^^ help: missing condition and attribute: `#[cfg_attr(condition, attribute, other_attribute, ...)]` - | - = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> - -error: expected `,`, found end of `cfg_attr` input - --> $DIR/cfg-attr-parse.rs:8:17 - | -LL | #[cfg_attr(all())] - | ^ expected `,` - | - = help: the valid syntax is `#[cfg_attr(condition, attribute, other_attribute, ...)]` - = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> - -error: expected identifier, found `,` - --> $DIR/cfg-attr-parse.rs:16:18 - | -LL | #[cfg_attr(all(),,)] - | ^ expected identifier - | - = help: the valid syntax is `#[cfg_attr(condition, attribute, other_attribute, ...)]` - = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> - -error: expected identifier, found `,` - --> $DIR/cfg-attr-parse.rs:28:28 - | -LL | #[cfg_attr(all(), must_use,,)] - | ^ expected identifier - | - = help: the valid syntax is `#[cfg_attr(condition, attribute, other_attribute, ...)]` - = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> - -error: expected identifier, found `,` - --> $DIR/cfg-attr-parse.rs:40:40 - | -LL | #[cfg_attr(all(), must_use, deprecated,,)] - | ^ expected identifier - | - = help: the valid syntax is `#[cfg_attr(condition, attribute, other_attribute, ...)]` - = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> - -error: wrong `cfg_attr` delimiters - --> $DIR/cfg-attr-parse.rs:44:11 - | -LL | #[cfg_attr[all(),,]] - | ^^^^^^^^^ - | -help: the delimiters should be `(` and `)` - | -LL | #[cfg_attr(all(),,)] - | ~ ~ - -error: expected identifier, found `,` - --> $DIR/cfg-attr-parse.rs:44:18 - | -LL | #[cfg_attr[all(),,]] - | ^ expected identifier - | - = help: the valid syntax is `#[cfg_attr(condition, attribute, other_attribute, ...)]` - = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> - -error: wrong `cfg_attr` delimiters - --> $DIR/cfg-attr-parse.rs:50:11 - | -LL | #[cfg_attr{all(),,}] - | ^^^^^^^^^ - | -help: the delimiters should be `(` and `)` - | -LL | #[cfg_attr(all(),,)] - | ~ ~ - -error: expected identifier, found `,` - --> $DIR/cfg-attr-parse.rs:50:18 - | -LL | #[cfg_attr{all(),,}] - | ^ expected identifier - | - = help: the valid syntax is `#[cfg_attr(condition, attribute, other_attribute, ...)]` - = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> - -error: aborting due to 9 previous errors - diff --git a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs deleted file mode 100644 index 408eaffcc..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.rs +++ /dev/null @@ -1,39 +0,0 @@ -#[cfg] //~ ERROR `cfg` is not followed by parentheses -struct S1; - -#[cfg = 10] //~ ERROR `cfg` is not followed by parentheses -struct S2; - -#[cfg()] //~ ERROR `cfg` predicate is not specified -struct S3; - -#[cfg(a, b)] //~ ERROR multiple `cfg` predicates are specified -struct S4; - -#[cfg("str")] //~ ERROR `cfg` predicate key cannot be a literal -struct S5; - -#[cfg(a::b)] //~ ERROR `cfg` predicate key must be an identifier -struct S6; - -#[cfg(a())] //~ ERROR invalid predicate `a` -struct S7; - -#[cfg(a = 10)] //~ ERROR literal in `cfg` predicate value must be a string -struct S8; - -#[cfg(a = b"hi")] //~ ERROR literal in `cfg` predicate value must be a string -struct S9; - -macro_rules! generate_s10 { - ($expr: expr) => { - #[cfg(feature = $expr)] - //~^ ERROR expected unsuffixed literal or identifier, found `concat!("nonexistent")` - //~| ERROR expected unsuffixed literal or identifier, found `concat!("nonexistent")` - struct S10; - } -} - -generate_s10!(concat!("nonexistent")); - -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr deleted file mode 100644 index d4bd673b8..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-syntax-validation.stderr +++ /dev/null @@ -1,82 +0,0 @@ -error: `cfg` is not followed by parentheses - --> $DIR/cfg-attr-syntax-validation.rs:1:1 - | -LL | #[cfg] - | ^^^^^^ help: expected syntax is: `cfg(/* predicate */)` - -error: `cfg` is not followed by parentheses - --> $DIR/cfg-attr-syntax-validation.rs:4:1 - | -LL | #[cfg = 10] - | ^^^^^^^^^^^ help: expected syntax is: `cfg(/* predicate */)` - -error: `cfg` predicate is not specified - --> $DIR/cfg-attr-syntax-validation.rs:7:1 - | -LL | #[cfg()] - | ^^^^^^^^ - -error: multiple `cfg` predicates are specified - --> $DIR/cfg-attr-syntax-validation.rs:10:10 - | -LL | #[cfg(a, b)] - | ^ - -error: `cfg` predicate key cannot be a literal - --> $DIR/cfg-attr-syntax-validation.rs:13:7 - | -LL | #[cfg("str")] - | ^^^^^ - -error: `cfg` predicate key must be an identifier - --> $DIR/cfg-attr-syntax-validation.rs:16:7 - | -LL | #[cfg(a::b)] - | ^^^^ - -error[E0537]: invalid predicate `a` - --> $DIR/cfg-attr-syntax-validation.rs:19:7 - | -LL | #[cfg(a())] - | ^^^ - -error[E0565]: literal in `cfg` predicate value must be a string - --> $DIR/cfg-attr-syntax-validation.rs:22:11 - | -LL | #[cfg(a = 10)] - | ^^ - -error[E0565]: literal in `cfg` predicate value must be a string - --> $DIR/cfg-attr-syntax-validation.rs:25:11 - | -LL | #[cfg(a = b"hi")] - | -^^^^ - | | - | help: consider removing the prefix - -error: expected unsuffixed literal or identifier, found `concat!("nonexistent")` - --> $DIR/cfg-attr-syntax-validation.rs:30:25 - | -LL | #[cfg(feature = $expr)] - | ^^^^^ -... -LL | generate_s10!(concat!("nonexistent")); - | ------------------------------------- in this macro invocation - | - = note: this error originates in the macro `generate_s10` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: expected unsuffixed literal or identifier, found `concat!("nonexistent")` - --> $DIR/cfg-attr-syntax-validation.rs:30:25 - | -LL | #[cfg(feature = $expr)] - | ^^^^^ -... -LL | generate_s10!(concat!("nonexistent")); - | ------------------------------------- in this macro invocation - | - = note: this error originates in the macro `generate_s10` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to 11 previous errors - -Some errors have detailed explanations: E0537, E0565. -For more information about an error, try `rustc --explain E0537`. diff --git a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs b/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs deleted file mode 100644 index 45b757e92..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.rs +++ /dev/null @@ -1,11 +0,0 @@ -macro_rules! foo { - () => { - #[cfg_attr(all(), unknown)] - //~^ ERROR cannot find attribute `unknown` in this scope - fn foo() {} - } -} - -foo!(); - -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr b/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr deleted file mode 100644 index fc8df6552..000000000 --- a/src/test/ui/conditional-compilation/cfg-attr-unknown-attribute-macro-expansion.stderr +++ /dev/null @@ -1,13 +0,0 @@ -error: cannot find attribute `unknown` in this scope - --> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:3:27 - | -LL | #[cfg_attr(all(), unknown)] - | ^^^^^^^ -... -LL | foo!(); - | ------ in this macro invocation - | - = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: aborting due to previous error - diff --git a/src/test/ui/conditional-compilation/cfg-empty-codemap.rs b/src/test/ui/conditional-compilation/cfg-empty-codemap.rs deleted file mode 100644 index 9e34cacf7..000000000 --- a/src/test/ui/conditional-compilation/cfg-empty-codemap.rs +++ /dev/null @@ -1,8 +0,0 @@ -// Tests that empty source_maps don't ICE (#23301) - -// compile-flags: --cfg "" - -// error-pattern: invalid `--cfg` argument: `""` (expected `key` or `key="value"`) - -pub fn main() { -} diff --git a/src/test/ui/conditional-compilation/cfg-empty-codemap.stderr b/src/test/ui/conditional-compilation/cfg-empty-codemap.stderr deleted file mode 100644 index 128e3cd73..000000000 --- a/src/test/ui/conditional-compilation/cfg-empty-codemap.stderr +++ /dev/null @@ -1,2 +0,0 @@ -error: invalid `--cfg` argument: `""` (expected `key` or `key="value"`) - diff --git a/src/test/ui/conditional-compilation/cfg-generic-params.rs b/src/test/ui/conditional-compilation/cfg-generic-params.rs deleted file mode 100644 index 53aa35563..000000000 --- a/src/test/ui/conditional-compilation/cfg-generic-params.rs +++ /dev/null @@ -1,40 +0,0 @@ -// compile-flags:--cfg yes - -fn f_lt<#[cfg(yes)] 'a: 'a, #[cfg(no)] T>() {} -fn f_ty<#[cfg(no)] 'a: 'a, #[cfg(yes)] T>() {} - -type FnGood = for<#[cfg(yes)] 'a, #[cfg(no)] T> fn(); // OK -type FnBad = for<#[cfg(no)] 'a, #[cfg(yes)] T> fn(); -//~^ ERROR only lifetime parameters can be used in this context - -type PolyGood = dyn for<#[cfg(yes)] 'a, #[cfg(no)] T> Copy; // OK -type PolyBad = dyn for<#[cfg(no)] 'a, #[cfg(yes)] T> Copy; -//~^ ERROR only lifetime parameters can be used in this context - -struct WhereGood where for<#[cfg(yes)] 'a, #[cfg(no)] T> u8: Copy; // OK -struct WhereBad where for<#[cfg(no)] 'a, #[cfg(yes)] T> u8: Copy; -//~^ ERROR only lifetime parameters can be used in this context - -fn f_lt_no<#[cfg_attr(no, unknown)] 'a>() {} // OK -fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {} -//~^ ERROR cannot find attribute `unknown` in this scope -fn f_ty_no<#[cfg_attr(no, unknown)] T>() {} // OK -fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {} -//~^ ERROR cannot find attribute `unknown` in this scope - -type FnNo = for<#[cfg_attr(no, unknown)] 'a> fn(); // OK -type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn(); -//~^ ERROR cannot find attribute `unknown` in this scope - -type PolyNo = dyn for<#[cfg_attr(no, unknown)] 'a> Copy; // OK -type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy; -//~^ ERROR cannot find attribute `unknown` in this scope - -struct WhereNo where for<#[cfg_attr(no, unknown)] 'a> u8: Copy; // OK -struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy; -//~^ ERROR cannot find attribute `unknown` in this scope - -fn main() { - f_lt::<'static>(); - f_ty::<u8>(); -} diff --git a/src/test/ui/conditional-compilation/cfg-generic-params.stderr b/src/test/ui/conditional-compilation/cfg-generic-params.stderr deleted file mode 100644 index 4d6560e96..000000000 --- a/src/test/ui/conditional-compilation/cfg-generic-params.stderr +++ /dev/null @@ -1,50 +0,0 @@ -error: only lifetime parameters can be used in this context - --> $DIR/cfg-generic-params.rs:7:45 - | -LL | type FnBad = for<#[cfg(no)] 'a, #[cfg(yes)] T> fn(); - | ^ - -error: only lifetime parameters can be used in this context - --> $DIR/cfg-generic-params.rs:11:51 - | -LL | type PolyBad = dyn for<#[cfg(no)] 'a, #[cfg(yes)] T> Copy; - | ^ - -error: only lifetime parameters can be used in this context - --> $DIR/cfg-generic-params.rs:15:54 - | -LL | struct WhereBad where for<#[cfg(no)] 'a, #[cfg(yes)] T> u8: Copy; - | ^ - -error: cannot find attribute `unknown` in this scope - --> $DIR/cfg-generic-params.rs:19:29 - | -LL | fn f_lt_yes<#[cfg_attr(yes, unknown)] 'a>() {} - | ^^^^^^^ - -error: cannot find attribute `unknown` in this scope - --> $DIR/cfg-generic-params.rs:22:29 - | -LL | fn f_ty_yes<#[cfg_attr(yes, unknown)] T>() {} - | ^^^^^^^ - -error: cannot find attribute `unknown` in this scope - --> $DIR/cfg-generic-params.rs:26:34 - | -LL | type FnYes = for<#[cfg_attr(yes, unknown)] 'a> fn(); - | ^^^^^^^ - -error: cannot find attribute `unknown` in this scope - --> $DIR/cfg-generic-params.rs:30:40 - | -LL | type PolyYes = dyn for<#[cfg_attr(yes, unknown)] 'a> Copy; - | ^^^^^^^ - -error: cannot find attribute `unknown` in this scope - --> $DIR/cfg-generic-params.rs:34:43 - | -LL | struct WhereYes where for<#[cfg_attr(yes, unknown)] 'a> u8: Copy; - | ^^^^^^^ - -error: aborting due to 8 previous errors - diff --git a/src/test/ui/conditional-compilation/cfg-in-crate-1.rs b/src/test/ui/conditional-compilation/cfg-in-crate-1.rs deleted file mode 100644 index 8561cd830..000000000 --- a/src/test/ui/conditional-compilation/cfg-in-crate-1.rs +++ /dev/null @@ -1,3 +0,0 @@ -// error-pattern: `main` function not found - -#![cfg(bar)] diff --git a/src/test/ui/conditional-compilation/cfg-in-crate-1.stderr b/src/test/ui/conditional-compilation/cfg-in-crate-1.stderr deleted file mode 100644 index ff72c43ef..000000000 --- a/src/test/ui/conditional-compilation/cfg-in-crate-1.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0601]: `main` function not found in crate `cfg_in_crate_1` - --> $DIR/cfg-in-crate-1.rs:3:13 - | -LL | #![cfg(bar)] - | ^ consider adding a `main` function to `$DIR/cfg-in-crate-1.rs` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0601`. diff --git a/src/test/ui/conditional-compilation/cfg-non-opt-expr.rs b/src/test/ui/conditional-compilation/cfg-non-opt-expr.rs deleted file mode 100644 index 0ddbd8a15..000000000 --- a/src/test/ui/conditional-compilation/cfg-non-opt-expr.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![feature(stmt_expr_attributes)] -#![feature(custom_test_frameworks)] - -fn main() { - let _ = #[cfg(unset)] (); - //~^ ERROR removing an expression is not supported in this position - let _ = 1 + 2 + #[cfg(unset)] 3; - //~^ ERROR removing an expression is not supported in this position - let _ = [1, 2, 3][#[cfg(unset)] 1]; - //~^ ERROR removing an expression is not supported in this position -} diff --git a/src/test/ui/conditional-compilation/cfg-non-opt-expr.stderr b/src/test/ui/conditional-compilation/cfg-non-opt-expr.stderr deleted file mode 100644 index 933b7dc18..000000000 --- a/src/test/ui/conditional-compilation/cfg-non-opt-expr.stderr +++ /dev/null @@ -1,20 +0,0 @@ -error: removing an expression is not supported in this position - --> $DIR/cfg-non-opt-expr.rs:5:13 - | -LL | let _ = #[cfg(unset)] (); - | ^^^^^^^^^^^^^ - -error: removing an expression is not supported in this position - --> $DIR/cfg-non-opt-expr.rs:7:21 - | -LL | let _ = 1 + 2 + #[cfg(unset)] 3; - | ^^^^^^^^^^^^^ - -error: removing an expression is not supported in this position - --> $DIR/cfg-non-opt-expr.rs:9:23 - | -LL | let _ = [1, 2, 3][#[cfg(unset)] 1]; - | ^^^^^^^^^^^^^ - -error: aborting due to 3 previous errors - diff --git a/src/test/ui/conditional-compilation/cfg_accessible-bugs.rs b/src/test/ui/conditional-compilation/cfg_accessible-bugs.rs deleted file mode 100644 index ae18bc55c..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-bugs.rs +++ /dev/null @@ -1,18 +0,0 @@ -// This test is a collection of test that should pass. -// -// check-fail - -#![feature(cfg_accessible)] -#![feature(trait_alias)] - -trait TraitAlias = std::fmt::Debug + Send; - -// FIXME: Currently shows "cannot determine" but should be `false` -#[cfg_accessible(unresolved)] //~ ERROR cannot determine -const C: bool = true; - -// FIXME: Currently shows "not sure" but should be `false` -#[cfg_accessible(TraitAlias::unresolved)] //~ ERROR not sure whether the path is accessible or not -const D: bool = true; - -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr b/src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr deleted file mode 100644 index 81f023878..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-bugs.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-bugs.rs:15:18 - | -LL | #[cfg_accessible(TraitAlias::unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: cannot determine whether the path is accessible or not - --> $DIR/cfg_accessible-bugs.rs:11:1 - | -LL | #[cfg_accessible(unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to 2 previous errors - diff --git a/src/test/ui/conditional-compilation/cfg_accessible-input-validation.rs b/src/test/ui/conditional-compilation/cfg_accessible-input-validation.rs deleted file mode 100644 index c51c908a4..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-input-validation.rs +++ /dev/null @@ -1,24 +0,0 @@ -#![feature(cfg_accessible)] - -#[cfg_accessible] //~ ERROR malformed `cfg_accessible` attribute input -struct S1; - -#[cfg_accessible = "value"] //~ ERROR malformed `cfg_accessible` attribute input -struct S2; - -#[cfg_accessible()] //~ ERROR `cfg_accessible` path is not specified -struct S3; - -#[cfg_accessible(std, core)] //~ ERROR multiple `cfg_accessible` paths are specified -struct S4; - -#[cfg_accessible("std")] //~ ERROR `cfg_accessible` path cannot be a literal -struct S5; - -#[cfg_accessible(std = "value")] //~ ERROR `cfg_accessible` path cannot accept arguments -struct S6; - -#[cfg_accessible(std(value))] //~ ERROR `cfg_accessible` path cannot accept arguments -struct S7; - -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg_accessible-input-validation.stderr b/src/test/ui/conditional-compilation/cfg_accessible-input-validation.stderr deleted file mode 100644 index 86706c766..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-input-validation.stderr +++ /dev/null @@ -1,44 +0,0 @@ -error: malformed `cfg_accessible` attribute input - --> $DIR/cfg_accessible-input-validation.rs:3:1 - | -LL | #[cfg_accessible] - | ^^^^^^^^^^^^^^^^^ help: must be of the form: `#[cfg_accessible(path)]` - -error: malformed `cfg_accessible` attribute input - --> $DIR/cfg_accessible-input-validation.rs:6:1 - | -LL | #[cfg_accessible = "value"] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[cfg_accessible(path)]` - -error: `cfg_accessible` path is not specified - --> $DIR/cfg_accessible-input-validation.rs:9:1 - | -LL | #[cfg_accessible()] - | ^^^^^^^^^^^^^^^^^^^ - -error: multiple `cfg_accessible` paths are specified - --> $DIR/cfg_accessible-input-validation.rs:12:23 - | -LL | #[cfg_accessible(std, core)] - | ^^^^ - -error: `cfg_accessible` path cannot be a literal - --> $DIR/cfg_accessible-input-validation.rs:15:18 - | -LL | #[cfg_accessible("std")] - | ^^^^^ - -error: `cfg_accessible` path cannot accept arguments - --> $DIR/cfg_accessible-input-validation.rs:18:18 - | -LL | #[cfg_accessible(std = "value")] - | ^^^^^^^^^^^^^ - -error: `cfg_accessible` path cannot accept arguments - --> $DIR/cfg_accessible-input-validation.rs:21:18 - | -LL | #[cfg_accessible(std(value))] - | ^^^^^^^^^^ - -error: aborting due to 7 previous errors - diff --git a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2015.stderr b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2015.stderr deleted file mode 100644 index 7d5dd5890..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2015.stderr +++ /dev/null @@ -1,122 +0,0 @@ -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:14:18 - | -LL | #[cfg_accessible(Struct::existing)] - | ^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:16:18 - | -LL | #[cfg_accessible(Struct::unresolved)] - | ^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:25:18 - | -LL | #[cfg_accessible(Union::existing)] - | ^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:27:18 - | -LL | #[cfg_accessible(Union::unresolved)] - | ^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:36:18 - | -LL | #[cfg_accessible(Enum::Existing::existing)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:38:18 - | -LL | #[cfg_accessible(Enum::Existing::unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:40:18 - | -LL | #[cfg_accessible(Enum::unresolved)] - | ^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:50:18 - | -LL | #[cfg_accessible(Trait::existing)] - | ^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:52:18 - | -LL | #[cfg_accessible(Trait::unresolved)] - | ^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:59:18 - | -LL | #[cfg_accessible(TypeAlias::existing)] - | ^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:61:18 - | -LL | #[cfg_accessible(TypeAlias::unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:70:18 - | -LL | #[cfg_accessible(ForeignType::unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:79:18 - | -LL | #[cfg_accessible(AssocType::AssocType::unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:84:18 - | -LL | #[cfg_accessible(u8::unresolved)] - | ^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:86:18 - | -LL | #[cfg_accessible(u8::is_ascii)] - | ^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: aborting due to 15 previous errors - diff --git a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2021.stderr b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2021.stderr deleted file mode 100644 index 7d5dd5890..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.edition2021.stderr +++ /dev/null @@ -1,122 +0,0 @@ -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:14:18 - | -LL | #[cfg_accessible(Struct::existing)] - | ^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:16:18 - | -LL | #[cfg_accessible(Struct::unresolved)] - | ^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:25:18 - | -LL | #[cfg_accessible(Union::existing)] - | ^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:27:18 - | -LL | #[cfg_accessible(Union::unresolved)] - | ^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:36:18 - | -LL | #[cfg_accessible(Enum::Existing::existing)] - | ^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:38:18 - | -LL | #[cfg_accessible(Enum::Existing::unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:40:18 - | -LL | #[cfg_accessible(Enum::unresolved)] - | ^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:50:18 - | -LL | #[cfg_accessible(Trait::existing)] - | ^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:52:18 - | -LL | #[cfg_accessible(Trait::unresolved)] - | ^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:59:18 - | -LL | #[cfg_accessible(TypeAlias::existing)] - | ^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:61:18 - | -LL | #[cfg_accessible(TypeAlias::unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:70:18 - | -LL | #[cfg_accessible(ForeignType::unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:79:18 - | -LL | #[cfg_accessible(AssocType::AssocType::unresolved)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:84:18 - | -LL | #[cfg_accessible(u8::unresolved)] - | ^^^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: not sure whether the path is accessible or not - --> $DIR/cfg_accessible-not_sure.rs:86:18 - | -LL | #[cfg_accessible(u8::is_ascii)] - | ^^^^^^^^^^^^ - | - = note: the type may have associated items, but we are currently not checking them - -error: aborting due to 15 previous errors - diff --git a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs b/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs deleted file mode 100644 index 99a7949db..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-not_sure.rs +++ /dev/null @@ -1,89 +0,0 @@ -// revisions: edition2015 edition2021 -// [edition2015]compile-flags: --edition=2015 -// [edition2021]compile-flags: --edition=2021 - -#![feature(extern_types)] -#![feature(cfg_accessible)] - -// Struct::unresolved - error - -struct Struct { - existing: u8, -} - -#[cfg_accessible(Struct::existing)] //~ ERROR not sure -const A: bool = true; -#[cfg_accessible(Struct::unresolved)] //~ ERROR not sure -const B: bool = true; - -// Union::unresolved - error - -struct Union { - existing: u8, -} - -#[cfg_accessible(Union::existing)] //~ ERROR not sure -const A: bool = true; -#[cfg_accessible(Union::unresolved)] //~ ERROR not sure -const B: bool = true; - -// Enum::unresolved - error - -enum Enum { - Existing { existing: u8 }, -} - -#[cfg_accessible(Enum::Existing::existing)] //~ ERROR not sure -const A: bool = true; -#[cfg_accessible(Enum::Existing::unresolved)] //~ ERROR not sure -const B: bool = true; -#[cfg_accessible(Enum::unresolved)] //~ ERROR not sure -const C: bool = true; - -// Trait::unresolved - false or error, depending on edition (error if you can write Trait::foo -// instead of <dyn Trait>::foo for methods like impl dyn Trait { fn foo() {} }) - -trait Trait {} -impl dyn Trait { fn existing() {} } - -// FIXME: Should be an error for edition > 2015 -#[cfg_accessible(Trait::existing)] //~ ERROR not sure -const A: bool = true; -#[cfg_accessible(Trait::unresolved)] //~ ERROR not sure -const B: bool = true; - -// TypeAlias::unresolved - error - -type TypeAlias = Struct; - -#[cfg_accessible(TypeAlias::existing)] //~ ERROR not sure -const A: bool = true; -#[cfg_accessible(TypeAlias::unresolved)] //~ ERROR not sure -const B: bool = true; - -// ForeignType::unresolved - error - -extern { - type ForeignType; -} - -#[cfg_accessible(ForeignType::unresolved)] //~ ERROR not sure -const A: bool = true; - -// AssocType::unresolved - error - -trait AssocType { - type AssocType; -} - -#[cfg_accessible(AssocType::AssocType::unresolved)] //~ ERROR not sure -const A: bool = true; - -// PrimitiveType::unresolved - error - -#[cfg_accessible(u8::unresolved)] //~ ERROR not sure -const A: bool = true; -#[cfg_accessible(u8::is_ascii)] //~ ERROR not sure -const B: bool = true; - -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg_accessible-private.rs b/src/test/ui/conditional-compilation/cfg_accessible-private.rs deleted file mode 100644 index 5b095675c..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-private.rs +++ /dev/null @@ -1,21 +0,0 @@ -// check-pass - -#![feature(cfg_accessible)] - -mod private { - struct Struct; - enum Enum{} - union Union{_a:u8} -} - -#[cfg_accessible(private::Struct)] -const A: bool = true; - -#[cfg_accessible(private::Enum)] -const A: bool = true; - -#[cfg_accessible(private::Union)] -const A: bool = true; - -const A: bool = false; // Will conflict if any of those is accessible -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg_accessible-stuck.rs b/src/test/ui/conditional-compilation/cfg_accessible-stuck.rs deleted file mode 100644 index 50504a44c..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-stuck.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![feature(cfg_accessible)] - -#[cfg_accessible(Z)] // OK, recovered after the other `cfg_accessible` produces an error. -struct S; - -#[cfg_accessible(S)] //~ ERROR cannot determine whether the path is accessible or not -struct Z; - -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg_accessible-stuck.stderr b/src/test/ui/conditional-compilation/cfg_accessible-stuck.stderr deleted file mode 100644 index 33af7d625..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-stuck.stderr +++ /dev/null @@ -1,8 +0,0 @@ -error: cannot determine whether the path is accessible or not - --> $DIR/cfg_accessible-stuck.rs:6:1 - | -LL | #[cfg_accessible(S)] - | ^^^^^^^^^^^^^^^^^^^^ - -error: aborting due to previous error - diff --git a/src/test/ui/conditional-compilation/cfg_accessible-unstable.rs b/src/test/ui/conditional-compilation/cfg_accessible-unstable.rs deleted file mode 100644 index e9247e67a..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-unstable.rs +++ /dev/null @@ -1,2 +0,0 @@ -#[cfg_accessible(std)] //~ ERROR use of unstable library feature 'cfg_accessible' -fn main() {} diff --git a/src/test/ui/conditional-compilation/cfg_accessible-unstable.stderr b/src/test/ui/conditional-compilation/cfg_accessible-unstable.stderr deleted file mode 100644 index 2f55b9559..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible-unstable.stderr +++ /dev/null @@ -1,12 +0,0 @@ -error[E0658]: use of unstable library feature 'cfg_accessible': `cfg_accessible` is not fully implemented - --> $DIR/cfg_accessible-unstable.rs:1:3 - | -LL | #[cfg_accessible(std)] - | ^^^^^^^^^^^^^^ - | - = note: see issue #64797 <https://github.com/rust-lang/rust/issues/64797> for more information - = help: add `#![feature(cfg_accessible)]` to the crate attributes to enable - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0658`. diff --git a/src/test/ui/conditional-compilation/cfg_accessible.rs b/src/test/ui/conditional-compilation/cfg_accessible.rs deleted file mode 100644 index df380d0d1..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible.rs +++ /dev/null @@ -1,55 +0,0 @@ -#![feature(cfg_accessible)] - -mod m { - pub struct ExistingPublic; - struct ExistingPrivate; -} - -trait Trait { - type Assoc; -} - -enum Enum { - Existing, -} - -#[cfg_accessible(Enum)] -struct ExistingResolved; - -#[cfg_accessible(Enum::Existing)] -struct ExistingResolvedVariant; - -#[cfg_accessible(m::ExistingPublic)] -struct ExistingPublic; - -#[cfg_accessible(m::ExistingPrivate)] -struct ExistingPrivate; - -#[cfg_accessible(m::NonExistent)] -struct NonExistingPrivate; - -#[cfg_accessible(n::AccessibleExpanded)] // OK, `cfg_accessible` can wait and retry. -struct AccessibleExpanded; - -#[cfg_accessible(Trait::Assoc)] -struct AccessibleTraitAssoc; - -macro_rules! generate_accessible_expanded { - () => { - mod n { - pub struct AccessibleExpanded; - } - }; -} - -generate_accessible_expanded!(); - -fn main() { - ExistingPublic; - AccessibleExpanded; - AccessibleTraitAssoc; - - ExistingPrivate; //~ ERROR cannot find - NonExistingPrivate; //~ ERROR cannot find - NonExistingTraitAlias; //~ ERROR cannot find -} diff --git a/src/test/ui/conditional-compilation/cfg_accessible.stderr b/src/test/ui/conditional-compilation/cfg_accessible.stderr deleted file mode 100644 index e3731a1ad..000000000 --- a/src/test/ui/conditional-compilation/cfg_accessible.stderr +++ /dev/null @@ -1,27 +0,0 @@ -error[E0425]: cannot find value `ExistingPrivate` in this scope - --> $DIR/cfg_accessible.rs:52:5 - | -LL | ExistingPrivate; - | ^^^^^^^^^^^^^^^ not found in this scope - | -note: unit struct `m::ExistingPrivate` exists but is inaccessible - --> $DIR/cfg_accessible.rs:5:5 - | -LL | struct ExistingPrivate; - | ^^^^^^^^^^^^^^^^^^^^^^^ not accessible - -error[E0425]: cannot find value `NonExistingPrivate` in this scope - --> $DIR/cfg_accessible.rs:53:5 - | -LL | NonExistingPrivate; - | ^^^^^^^^^^^^^^^^^^ not found in this scope - -error[E0425]: cannot find value `NonExistingTraitAlias` in this scope - --> $DIR/cfg_accessible.rs:54:5 - | -LL | NonExistingTraitAlias; - | ^^^^^^^^^^^^^^^^^^^^^ not found in this scope - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0425`. diff --git a/src/test/ui/conditional-compilation/cfg_attr_path.rs b/src/test/ui/conditional-compilation/cfg_attr_path.rs deleted file mode 100644 index efb718b78..000000000 --- a/src/test/ui/conditional-compilation/cfg_attr_path.rs +++ /dev/null @@ -1,13 +0,0 @@ -// check-pass - -#![deny(unused_attributes)] // c.f #35584 - -mod auxiliary { - #[cfg_attr(any(), path = "nonexistent_file.rs")] pub mod namespaced_enums; - #[cfg_attr(all(), path = "namespaced_enums.rs")] pub mod nonexistent_file; -} - -fn main() { - let _ = auxiliary::namespaced_enums::Foo::A; - let _ = auxiliary::nonexistent_file::Foo::A; -} diff --git a/src/test/ui/conditional-compilation/inner-cfg-non-inline-mod.rs b/src/test/ui/conditional-compilation/inner-cfg-non-inline-mod.rs deleted file mode 100644 index af5a6462e..000000000 --- a/src/test/ui/conditional-compilation/inner-cfg-non-inline-mod.rs +++ /dev/null @@ -1,7 +0,0 @@ -// check-pass - -mod module_with_cfg; - -mod module_with_cfg {} // Ok, the module above is configured away by an inner attribute. - -fn main() {} diff --git a/src/test/ui/conditional-compilation/issue-34028.rs b/src/test/ui/conditional-compilation/issue-34028.rs deleted file mode 100644 index d761c0c82..000000000 --- a/src/test/ui/conditional-compilation/issue-34028.rs +++ /dev/null @@ -1,10 +0,0 @@ -// check-pass - -macro_rules! m { - () => { #[cfg(any())] fn f() {} } -} - -trait T {} -impl T for () { m!(); } - -fn main() {} diff --git a/src/test/ui/conditional-compilation/module_with_cfg.rs b/src/test/ui/conditional-compilation/module_with_cfg.rs deleted file mode 100644 index 56c4baadf..000000000 --- a/src/test/ui/conditional-compilation/module_with_cfg.rs +++ /dev/null @@ -1,3 +0,0 @@ -// ignore-test - -#![cfg_attr(all(), cfg(FALSE))] diff --git a/src/test/ui/conditional-compilation/test-cfg.rs b/src/test/ui/conditional-compilation/test-cfg.rs deleted file mode 100644 index 8750bae00..000000000 --- a/src/test/ui/conditional-compilation/test-cfg.rs +++ /dev/null @@ -1,8 +0,0 @@ -// compile-flags: --cfg foo - -#[cfg(all(foo, bar))] // foo AND bar -fn foo() {} - -fn main() { - foo(); //~ ERROR cannot find function `foo` in this scope -} diff --git a/src/test/ui/conditional-compilation/test-cfg.stderr b/src/test/ui/conditional-compilation/test-cfg.stderr deleted file mode 100644 index c35fe2f94..000000000 --- a/src/test/ui/conditional-compilation/test-cfg.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0425]: cannot find function `foo` in this scope - --> $DIR/test-cfg.rs:7:5 - | -LL | foo(); - | ^^^ not found in this scope - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0425`. |