rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.86k stars 2.43k forks source link

plugins not working in doc tests #1512

Closed BurntSushi closed 9 years ago

BurntSushi commented 9 years ago

I don't know if this is a Cargo bug or a rustdoc bug, but my guess is that Cargo isn't passing the right flags to rustdoc? Not sure. Anyway, here's my Cargo.toml and src/lib.rs. And the result:

[andrew@Liger regex-macro-doc] cargo test --verbose
       Fresh regex v0.1.27
       Fresh regex_macros v0.1.15
       Fresh regex-macro-doc v0.0.1 (file:///tmp/regex-macro-doc)
     Running `/tmp/regex-macro-doc/target/debug/regex_macro_doc-68cb5f18687e3033`

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured

   Doc-tests regex-macro-doc
     Running `rustdoc --test /tmp/regex-macro-doc/src/lib.rs --crate-name regex_macro_doc -L dependency=/tmp/regex-macro-doc/target/debug/deps --extern regex=/tmp/regex-macro-doc/target/debug/deps/libregex-792c67aed9f650b7.rlib --extern regex_macro_doc=/tmp/regex-macro-doc/target/debug/libregex_macro_doc-7a0562b1795f245b.rlib`
/tmp/regex-macro-doc/src/lib.rs:2:11: 2:23 error: can't find crate for `regex_macros`
/tmp/regex-macro-doc/src/lib.rs:2 #![plugin(regex_macros)]
                                            ^~~~~~~~~~~~
error: aborting due to previous error
thread '<unnamed>' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:153
thread '<main>' panicked at 'child thread None panicked', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/thread/mod.rs:703

Version info:

[andrew@Liger regex-macro-doc] mr show-default
multirust: default toolchain: nightly
multirust: default location: /home/andrew/.multirust/toolchains/nightly

rustc 1.0.0-nightly (93f7fe32d 2015-04-10) (built 2015-04-11)
cargo 0.0.1-pre-nightly (72c2e3d 2015-04-10) (built 2015-04-10)
filipegoncalves commented 9 years ago

Same happening here with peg_syntax_ext:

test result: ok. 45 passed; 0 failed; 0 ignored; 0 measured

   Doc-tests config
     Running `rustdoc --test /home/filipe/dev/rust-dev/rust-config/src/lib.rs --crate-name config -L dependency=/home/filipe/dev/rust-dev/rust-config/target/debug/deps --extern config=/home/filipe/dev/rust-dev/rust-config/target/debug/libconfig-9b5fbedce7a5072c.rlib`
/home/filipe/dev/rust-dev/rust-config/src/lib.rs:4:11: 4:25 error: can't find crate for `peg_syntax_ext`
/home/filipe/dev/rust-dev/rust-config/src/lib.rs:4 #![plugin(peg_syntax_ext)]
                                                             ^~~~~~~~~~~~~~
error: aborting due to previous error
thread '<unnamed>' panicked at 'Box<Any>', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:153
thread '<main>' panicked at 'child thread None panicked', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/libstd/thread/mod.rs:703

Tested with rustc 1.0.0-nightly (93f7fe32d 2015-04-10) (built 2015-04-11).

Travis log: https://travis-ci.org/filipegoncalves/rust-config/builds/58076955