-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
builtin_macros: raw str in diagnostic output
If a raw string was used in the `env!` invocation, then it should also be shown in the diagnostic messages as a raw string. Signed-off-by: David Wood <david@davidtw.co>
- Loading branch information
Showing
6 changed files
with
73 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
// unset-rustc-env:oopsie | ||
// unset-rustc-env:a""a | ||
|
||
env![r#"oopsie"#]; | ||
//~^ ERROR environment variable `oopsie` not defined at compile time | ||
|
||
env![r#"a""a"#]; | ||
//~^ ERROR environment variable `a""a` not defined at compile time | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
error: environment variable `oopsie` not defined at compile time | ||
--> $DIR/builtin-env-issue-114010.rs:3:1 | ||
--> $DIR/builtin-env-issue-114010.rs:4:1 | ||
| | ||
LL | env![r#"oopsie"#]; | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: use `std::env::var("oopsie")` to read the variable at run time | ||
= help: use `std::env::var(r#"oopsie"#)` to read the variable at run time | ||
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to previous error | ||
error: environment variable `a""a` not defined at compile time | ||
--> $DIR/builtin-env-issue-114010.rs:7:1 | ||
| | ||
LL | env![r#"a""a"#]; | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= help: use `std::env::var(r#"a""a"#)` to read the variable at run time | ||
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to 2 previous errors | ||
|