-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
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
ICE in library/test/src/lib.rs:356 on Nightly when running doc-tests, where the first doc-test is executed twice in a row. #81852
Comments
This is now a regression from stable to beta. |
cc @andersk, do you have time to take a look? |
It seems like the underlying problem is that it’s possible for different tests to collide to the same struct S;
trait A {}
trait B {}
macro_rules! whoops {
() => {
/// ```
/// assert_eq!(1, 1);
/// ```
impl A for S {}
/// ```
/// assert_eq!(1, 1);
/// ```
impl B for S {}
};
}
whoops!(); Before #81367, this produced
and now it panics. We should fix the underlying problem, but a simple band-aid for beta would be to turn the |
I’ve submitted that workaround as #82274. |
libtest: Fix unwrap panic on duplicate TestDesc It is possible for different tests to collide to the same `TestDesc` when macros are involved. That is a bug, but it didn’t cause a panic until rust-lang#81367. For now, change the code to ignore this problem. Fixes rust-lang#81852. This will need to be applied to `beta` too.
It is possible for different tests to collide to the same TestDesc when macros are involved. That is a bug, but it didn’t cause a panic until rust-lang#81367. For now, change the code to ignore this problem. Fixes rust-lang#81852. Signed-off-by: Anders Kaseorg <andersk@mit.edu> (cherry picked from commit 1605af0)
This more robustly avoids problems with duplicate TestDesc. See rust-lang#81852 and rust-lang#82274. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
libtest: Index tests by a unique TestId This more robustly avoids problems with duplicate `TestDesc`. See rust-lang#81852 and rust-lang#82274. Cc `@Mark-Simulacrum.`
Hi,
When running doc-tests with the latest Nightly on my crate, I get an ICE after the first doc-test is executed twice in a row.
The issue does not occur on Stable.
The issue seems to be caused when multiple threads are used for doc-tests.
The ICE is caused by
unwrap()
in /library/test/src/lib.rs:356.The issue occured on the
x86_64-pc-windows-msvc
andx86_64-unknown-linux-gnu
targets. Curiously, there are multiple targets on which it does not occur (according to Travic CI builds).The Travis CI build status is available here : https://travis-ci.com/github/yoanlcq/vek/builds/216330500.
Steps to reproduce
vek
crate;a18c2dc5af092caba2daae232d168f1c75c5d039
;cargo test --doc
orcargo test --doc -- --test-threads 2
.The actual number of threads does not seem to matter as long as there is more than one.
In my case, specifying
-- --test-threads 2
was not necessary, since I think the number of threads is determined automatically in this case.Code
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: