This website requires JavaScript.
Explore
Help
Sign In
nordic-dev.net
/
rust
Watch
2
Star
0
Fork
0
You've already forked rust
mirror of
https://github.com/rust-lang/rust.git
synced
2025-05-02 13:07:37 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
453b51a65a
rust
/
tests
/
ui
/
env-macro
/
env-not-string-literal.rs
2 lines
66 B
Rust
Raw
Normal View
History
Unescape
Escape
env! syntax extension changes env! aborts compilation of the specified environment variable is not defined and takes an optional second argument containing a custom error message. option_env! creates an Option<&'static str> containing the value of the environment variable. There are no run-pass tests that check the behavior when the environment variable is defined since the test framework doesn't support setting environment variables at compile time as opposed to runtime. However, both env! and option_env! are used inside of rustc itself, which should act as a sufficient test. Close #2248
2013-08-07 04:50:23 +00:00
fn
main
(
)
{
env!
(
10
,
"
two
"
)
;
}
//~ ERROR: expected string literal
Reference in New Issue
Copy Permalink