Rollup merge of #122657 - beetrees:option-env-tests, r=compiler-errors,Nilstrieb

Move `option_env!` and `env!` tests to the `env-macro` directory

This PR moves the `option_env!` tests to there own directory (`extoption_env`), matching the naming convention used by the tests for `env!` (which live in the `extenv` directory).
This commit is contained in:
Matthias Krüger 2024-03-18 06:58:50 +01:00 committed by GitHub
commit 069b93335f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
30 changed files with 18 additions and 20 deletions

View File

@ -968,8 +968,6 @@
"ui/errors/issue-89280-emitter-overflow-splice-lines.rs", "ui/errors/issue-89280-emitter-overflow-splice-lines.rs",
"ui/errors/issue-99572-impl-trait-on-pointer.rs", "ui/errors/issue-99572-impl-trait-on-pointer.rs",
"ui/expr/if/issue-4201.rs", "ui/expr/if/issue-4201.rs",
"ui/extenv/issue-110547.rs",
"ui/extenv/issue-55897.rs",
"ui/extern/auxiliary/issue-80074-macro-2.rs", "ui/extern/auxiliary/issue-80074-macro-2.rs",
"ui/extern/auxiliary/issue-80074-macro.rs", "ui/extern/auxiliary/issue-80074-macro.rs",
"ui/extern/issue-10025.rs", "ui/extern/issue-10025.rs",

View File

@ -18,7 +18,7 @@
// FIXME: The following limits should be reduced eventually. // FIXME: The following limits should be reduced eventually.
const ISSUES_ENTRY_LIMIT: usize = 1750; const ISSUES_ENTRY_LIMIT: usize = 1750;
const ROOT_ENTRY_LIMIT: usize = 866; const ROOT_ENTRY_LIMIT: usize = 859;
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
"rs", // test source files "rs", // test source files

View File

@ -1,5 +1,5 @@
error: expected string literal error: expected string literal
--> $DIR/extenv-arg-2-not-string-literal.rs:1:25 --> $DIR/env-arg-2-not-string-literal.rs:1:25
| |
LL | fn main() { env!("one", 10); } LL | fn main() { env!("one", 10); }
| ^^ | ^^

View File

@ -1,5 +1,5 @@
error: environment variable `\t` not defined at compile time error: environment variable `\t` not defined at compile time
--> $DIR/extenv-escaped-var.rs:2:5 --> $DIR/env-escaped-var.rs:2:5
| |
LL | env!("\t"); LL | env!("\t");
| ^^^^^^^^^^ | ^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: `env!()` takes 1 or 2 arguments error: `env!()` takes 1 or 2 arguments
--> $DIR/extenv-no-args.rs:1:13 --> $DIR/env-no-args.rs:1:13
| |
LL | fn main() { env!(); } LL | fn main() { env!(); }
| ^^^^^^ | ^^^^^^

View File

@ -1,5 +1,5 @@
error: my error message error: my error message
--> $DIR/extenv-not-defined-custom.rs:1:13 --> $DIR/env-not-defined-custom.rs:1:13
| |
LL | fn main() { env!("__HOPEFULLY_NOT_DEFINED__", "my error message"); } LL | fn main() { env!("__HOPEFULLY_NOT_DEFINED__", "my error message"); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: environment variable `CARGO__HOPEFULLY_NOT_DEFINED__` not defined at compile time error: environment variable `CARGO__HOPEFULLY_NOT_DEFINED__` not defined at compile time
--> $DIR/extenv-not-defined-default.rs:2:5 --> $DIR/env-not-defined-default.rs:2:5
| |
LL | env!("CARGO__HOPEFULLY_NOT_DEFINED__"); LL | env!("CARGO__HOPEFULLY_NOT_DEFINED__");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: expected string literal error: expected string literal
--> $DIR/extenv-not-string-literal.rs:1:18 --> $DIR/env-not-string-literal.rs:1:18
| |
LL | fn main() { env!(10, "two"); } LL | fn main() { env!(10, "two"); }
| ^^ | ^^

View File

@ -1,5 +1,5 @@
error: `env!()` takes 1 or 2 arguments error: `env!()` takes 1 or 2 arguments
--> $DIR/extenv-too-many-args.rs:1:13 --> $DIR/env-too-many-args.rs:1:13
| |
LL | fn main() { env!("one", "two", "three"); } LL | fn main() { env!("one", "two", "three"); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: environment variable `NON_EXISTENT` not defined at compile time error: environment variable `NON_EXISTENT` not defined at compile time
--> $DIR/issue-55897.rs:10:22 --> $DIR/error-recovery-issue-55897.rs:10:22
| |
LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs")); LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs"));
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
@ -8,13 +8,13 @@ LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs"));
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
error: suffixes on string literals are invalid error: suffixes on string literals are invalid
--> $DIR/issue-55897.rs:15:22 --> $DIR/error-recovery-issue-55897.rs:15:22
| |
LL | include!(concat!("NON_EXISTENT"suffix, "/data.rs")); LL | include!(concat!("NON_EXISTENT"suffix, "/data.rs"));
| ^^^^^^^^^^^^^^^^^^^^ invalid suffix `suffix` | ^^^^^^^^^^^^^^^^^^^^ invalid suffix `suffix`
error[E0432]: unresolved import `prelude` error[E0432]: unresolved import `prelude`
--> $DIR/issue-55897.rs:1:5 --> $DIR/error-recovery-issue-55897.rs:1:5
| |
LL | use prelude::*; LL | use prelude::*;
| ^^^^^^^ | ^^^^^^^
@ -23,7 +23,7 @@ LL | use prelude::*;
| help: a similar path exists: `std::prelude` | help: a similar path exists: `std::prelude`
error[E0432]: unresolved import `env` error[E0432]: unresolved import `env`
--> $DIR/issue-55897.rs:4:9 --> $DIR/error-recovery-issue-55897.rs:4:9
| |
LL | use env; LL | use env;
| ^^^ no `env` in the root | ^^^ no `env` in the root

View File

@ -1,5 +1,5 @@
error: environment variable `\t` not defined at compile time error: environment variable `\t` not defined at compile time
--> $DIR/issue-110547.rs:4:5 --> $DIR/name-whitespace-issue-110547.rs:4:5
| |
LL | env!{"\t"}; LL | env!{"\t"};
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -8,7 +8,7 @@ LL | env!{"\t"};
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
error: environment variable `\t` not defined at compile time error: environment variable `\t` not defined at compile time
--> $DIR/issue-110547.rs:5:5 --> $DIR/name-whitespace-issue-110547.rs:5:5
| |
LL | env!("\t"); LL | env!("\t");
| ^^^^^^^^^^ | ^^^^^^^^^^
@ -17,7 +17,7 @@ LL | env!("\t");
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
error: environment variable `\u{2069}` not defined at compile time error: environment variable `\u{2069}` not defined at compile time
--> $DIR/issue-110547.rs:6:5 --> $DIR/name-whitespace-issue-110547.rs:6:5
| |
LL | env!("\u{2069}"); LL | env!("\u{2069}");
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: option_env! takes 1 argument error: option_env! takes 1 argument
--> $DIR/extoption_env-no-args.rs:1:13 --> $DIR/option_env-no-args.rs:1:13
| |
LL | fn main() { option_env!(); } LL | fn main() { option_env!(); }
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: argument must be a string literal error: argument must be a string literal
--> $DIR/extoption_env-not-string-literal.rs:1:25 --> $DIR/option_env-not-string-literal.rs:1:25
| |
LL | fn main() { option_env!(10); } LL | fn main() { option_env!(10); }
| ^^ | ^^

View File

@ -1,5 +1,5 @@
error: option_env! takes 1 argument error: option_env! takes 1 argument
--> $DIR/extoption_env-too-many-args.rs:1:13 --> $DIR/option_env-too-many-args.rs:1:13
| |
LL | fn main() { option_env!("one", "two"); } LL | fn main() { option_env!("one", "two"); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^