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
2024-12-15 01:55:03 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
4f773af1cc
rust
/
tests
/
ui
/
extoption_env-not-defined.rs
6 lines
97 B
Rust
Raw
Normal View
History
Unescape
Escape
tests: Add missing run-pass annotations
2019-07-26 21:54:25 +00:00
// run-pass
Fix run-pass tests to have 'pub fn main' This is required by the check-fast target because each test is slurped up into a submodule.
2013-09-25 07:43:37 +00:00
pub
fn
main
(
)
{
Fixed option_env! type The type of the result of option_env! was not fully specified in the None case, leading to type check failures in the case where the variable was not defined (e.g. option_env!("FOO").is_none()).
2013-08-10 18:09:30 +00:00
assert!
(
option_env!
(
"
__HOPEFULLY_DOESNT_EXIST__
"
)
.
is_none
(
)
)
;
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
}
Reference in New Issue
Copy Permalink