We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cargo.toml:
Cargo.toml
[package] name = "foo" version = "0.0.1" authors = [] build = "build.rs"
src/lib.rs:
src/lib.rs
fn it_works() { println!("{}", env!("OUT_DIR")); }
build.rs:
build.rs
fn main() { }
Now, cargo build works and the first part of cargo test works, but when it gets to the doc tests, it falls apart:
cargo build
cargo test
$ cargo test Compiling foo v0.0.1 (file:///tmp/foo) /tmp/foo/src/lib.rs:1:1: 3:2 warning: function is never used: `it_works`, #[warn(dead_code)] on by default /tmp/foo/src/lib.rs:1 fn it_works() { /tmp/foo/src/lib.rs:2 println!("{}", env!("OUT_DIR")); /tmp/foo/src/lib.rs:3 } Running target/foo-9c5c49d595bfa18b running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured Doc-tests foo /tmp/foo/src/lib.rs:2:5: 2:37 error: environment variable `OUT_DIR` not defined /tmp/foo/src/lib.rs:2 println!("{}", env!("OUT_DIR")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error task '<main>' panicked at 'Box<Any>', /home/chris/rust/src/libsyntax/diagnostic.rs:142
This is completely crippling.
I presume the other environment variables aren’t set either, but I haven’t checked.
The text was updated successfully, but these errors were encountered:
Fixed in #897
Sorry, something went wrong.
OUT_DIR
No branches or pull requests
Cargo.toml
:src/lib.rs
:build.rs
:Now,
cargo build
works and the first part ofcargo test
works, but when it gets to the doc tests, it falls apart:This is completely crippling.
I presume the other environment variables aren’t set either, but I haven’t checked.
The text was updated successfully, but these errors were encountered: