Skip to content

Commit 069b933

Browse files
authored
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).
2 parents 3fc3142 + 3651401 commit 069b933

30 files changed

+18
-20
lines changed

Diff for: src/tools/tidy/src/issues.txt

-2
Original file line numberDiff line numberDiff line change
@@ -968,8 +968,6 @@
968968
"ui/errors/issue-89280-emitter-overflow-splice-lines.rs",
969969
"ui/errors/issue-99572-impl-trait-on-pointer.rs",
970970
"ui/expr/if/issue-4201.rs",
971-
"ui/extenv/issue-110547.rs",
972-
"ui/extenv/issue-55897.rs",
973971
"ui/extern/auxiliary/issue-80074-macro-2.rs",
974972
"ui/extern/auxiliary/issue-80074-macro.rs",
975973
"ui/extern/issue-10025.rs",

Diff for: src/tools/tidy/src/ui_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const ENTRY_LIMIT: usize = 900;
1818
// FIXME: The following limits should be reduced eventually.
1919

2020
const ISSUES_ENTRY_LIMIT: usize = 1750;
21-
const ROOT_ENTRY_LIMIT: usize = 866;
21+
const ROOT_ENTRY_LIMIT: usize = 859;
2222

2323
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2424
"rs", // test source files

Diff for: tests/ui/extenv/extenv-arg-2-not-string-literal.stderr renamed to tests/ui/env-macro/env-arg-2-not-string-literal.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected string literal
2-
--> $DIR/extenv-arg-2-not-string-literal.rs:1:25
2+
--> $DIR/env-arg-2-not-string-literal.rs:1:25
33
|
44
LL | fn main() { env!("one", 10); }
55
| ^^
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: tests/ui/extenv/extenv-escaped-var.stderr renamed to tests/ui/env-macro/env-escaped-var.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: environment variable `\t` not defined at compile time
2-
--> $DIR/extenv-escaped-var.rs:2:5
2+
--> $DIR/env-escaped-var.rs:2:5
33
|
44
LL | env!("\t");
55
| ^^^^^^^^^^
File renamed without changes.

Diff for: tests/ui/extenv/extenv-no-args.stderr renamed to tests/ui/env-macro/env-no-args.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `env!()` takes 1 or 2 arguments
2-
--> $DIR/extenv-no-args.rs:1:13
2+
--> $DIR/env-no-args.rs:1:13
33
|
44
LL | fn main() { env!(); }
55
| ^^^^^^

Diff for: tests/ui/extenv/extenv-not-defined-custom.stderr renamed to tests/ui/env-macro/env-not-defined-custom.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: my error message
2-
--> $DIR/extenv-not-defined-custom.rs:1:13
2+
--> $DIR/env-not-defined-custom.rs:1:13
33
|
44
LL | fn main() { env!("__HOPEFULLY_NOT_DEFINED__", "my error message"); }
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Diff for: tests/ui/extenv/extenv-not-defined-default.stderr renamed to tests/ui/env-macro/env-not-defined-default.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: environment variable `CARGO__HOPEFULLY_NOT_DEFINED__` not defined at compile time
2-
--> $DIR/extenv-not-defined-default.rs:2:5
2+
--> $DIR/env-not-defined-default.rs:2:5
33
|
44
LL | env!("CARGO__HOPEFULLY_NOT_DEFINED__");
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File renamed without changes.

Diff for: tests/ui/extenv/extenv-not-string-literal.stderr renamed to tests/ui/env-macro/env-not-string-literal.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: expected string literal
2-
--> $DIR/extenv-not-string-literal.rs:1:18
2+
--> $DIR/env-not-string-literal.rs:1:18
33
|
44
LL | fn main() { env!(10, "two"); }
55
| ^^
File renamed without changes.

Diff for: tests/ui/extenv/extenv-too-many-args.stderr renamed to tests/ui/env-macro/env-too-many-args.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: `env!()` takes 1 or 2 arguments
2-
--> $DIR/extenv-too-many-args.rs:1:13
2+
--> $DIR/env-too-many-args.rs:1:13
33
|
44
LL | fn main() { env!("one", "two", "three"); }
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File renamed without changes.

Diff for: tests/ui/extenv/issue-55897.stderr renamed to tests/ui/env-macro/error-recovery-issue-55897.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: environment variable `NON_EXISTENT` not defined at compile time
2-
--> $DIR/issue-55897.rs:10:22
2+
--> $DIR/error-recovery-issue-55897.rs:10:22
33
|
44
LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs"));
55
| ^^^^^^^^^^^^^^^^^^^^
@@ -8,13 +8,13 @@ LL | include!(concat!(env!("NON_EXISTENT"), "/data.rs"));
88
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
99

1010
error: suffixes on string literals are invalid
11-
--> $DIR/issue-55897.rs:15:22
11+
--> $DIR/error-recovery-issue-55897.rs:15:22
1212
|
1313
LL | include!(concat!("NON_EXISTENT"suffix, "/data.rs"));
1414
| ^^^^^^^^^^^^^^^^^^^^ invalid suffix `suffix`
1515

1616
error[E0432]: unresolved import `prelude`
17-
--> $DIR/issue-55897.rs:1:5
17+
--> $DIR/error-recovery-issue-55897.rs:1:5
1818
|
1919
LL | use prelude::*;
2020
| ^^^^^^^
@@ -23,7 +23,7 @@ LL | use prelude::*;
2323
| help: a similar path exists: `std::prelude`
2424

2525
error[E0432]: unresolved import `env`
26-
--> $DIR/issue-55897.rs:4:9
26+
--> $DIR/error-recovery-issue-55897.rs:4:9
2727
|
2828
LL | use env;
2929
| ^^^ no `env` in the root
File renamed without changes.

Diff for: tests/ui/extenv/issue-110547.stderr renamed to tests/ui/env-macro/name-whitespace-issue-110547.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: environment variable `\t` not defined at compile time
2-
--> $DIR/issue-110547.rs:4:5
2+
--> $DIR/name-whitespace-issue-110547.rs:4:5
33
|
44
LL | env!{"\t"};
55
| ^^^^^^^^^^
@@ -8,7 +8,7 @@ LL | env!{"\t"};
88
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
99

1010
error: environment variable `\t` not defined at compile time
11-
--> $DIR/issue-110547.rs:5:5
11+
--> $DIR/name-whitespace-issue-110547.rs:5:5
1212
|
1313
LL | env!("\t");
1414
| ^^^^^^^^^^
@@ -17,7 +17,7 @@ LL | env!("\t");
1717
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
1818

1919
error: environment variable `\u{2069}` not defined at compile time
20-
--> $DIR/issue-110547.rs:6:5
20+
--> $DIR/name-whitespace-issue-110547.rs:6:5
2121
|
2222
LL | env!("\u{2069}");
2323
| ^^^^^^^^^^^^^^^^
File renamed without changes.

Diff for: tests/ui/extoption_env-no-args.stderr renamed to tests/ui/env-macro/option_env-no-args.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: option_env! takes 1 argument
2-
--> $DIR/extoption_env-no-args.rs:1:13
2+
--> $DIR/option_env-no-args.rs:1:13
33
|
44
LL | fn main() { option_env!(); }
55
| ^^^^^^^^^^^^^
File renamed without changes.

Diff for: tests/ui/extoption_env-not-string-literal.stderr renamed to tests/ui/env-macro/option_env-not-string-literal.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: argument must be a string literal
2-
--> $DIR/extoption_env-not-string-literal.rs:1:25
2+
--> $DIR/option_env-not-string-literal.rs:1:25
33
|
44
LL | fn main() { option_env!(10); }
55
| ^^

Diff for: tests/ui/extoption_env-too-many-args.stderr renamed to tests/ui/env-macro/option_env-too-many-args.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: option_env! takes 1 argument
2-
--> $DIR/extoption_env-too-many-args.rs:1:13
2+
--> $DIR/option_env-too-many-args.rs:1:13
33
|
44
LL | fn main() { option_env!("one", "two"); }
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)