Repository navigation
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
Copy link
Copy link
Closed
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
Activity
- addedC-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Feb 7, 2021 - addedA-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
on Feb 7, 2021 - addedT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.and removedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Feb 7, 2021 This is now a regression from stable to beta.
- addedregression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Exampleand removedregression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
on Feb 18, 2021 - removedE-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
on Feb 18, 2021 cc @andersk, do you have time to take a look?
- removedT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.Relevant to the rustdoc team, which will review and decide on the PR/issue.
on Feb 18, 2021 It seems like the underlying problem is that it’s possible for different tests to collide to the same
TestDescwhen macros are involved. Minimal example: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
running 2 tests test src/lib.rs - S (line 19) ... ok test src/lib.rs - S (line 19) ... ok test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.15sand now it panics.
We should fix the underlying problem, but a simple band-aid for beta would be to turn the
unwrapinto anif let. The only side effect would be that we don’t get the benefits of #81367 in the presence of these collisions.Reacted by jyn- added a commit that references this issue
on Feb 18, 2021 I’ve submitted that workaround as #82274.
- added a commit that references this issue
on Feb 19, 2021 - removedI-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}Issue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
on Feb 28, 2021 - added a commit that references this issue
on Mar 10, 2021
Metadata
Metadata
Assignees
Labels
A-libtestArea: `#[test]` / the `test` libraryArea: `#[test]` / the `test` libraryC-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
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-msvcandx86_64-unknown-linux-gnutargets. 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
vekcrate;a18c2dc5af092caba2daae232d168f1c75c5d039;cargo test --docorcargo 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 2was not necessary, since I think the number of threads is determined automatically in this case.Code
Meta
rustc --version --verbose:Error output
Backtrace