Repository navigation
endless loop by running cargo test with toolchain 2024-05-14 #125269
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.L-non_local_definitionsLint: non_local_definitionsLint: non_local_definitionsP-highHigh priorityHigh priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-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.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-Znext-solver)regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
I tried this code:
(sorry, i couldn't extract a minimal example and reproduce it)
git clone https://gitlab.com/veloren/veloren
cd veloren
git checkout e48fc4c2b235ceab3c1a551292c45c46d47e7130
cd common
cargo testI expected to see this happen: ElimCase doctest in line 86 to finish after some time
Instead, this happened: the tests takes endless (i waited 2 hours in CI)
Meta
rustc --version --verbose:
rustc 1.80.0-nightly (ab14f944a 2024-05-13)
binary: rustc
commit-hash: ab14f944afe4234db378ced3801e637eae6c0f30
commit-date: 2024-05-13
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.4
cargo test:
Doc-tests veloren_common
running 14 tests
test common/src/terrain/block.rs - terrain::block::Block (line 120) ... ignored
...
test common/src/typed.rs - typed::ElimCase (line 107) ... ok
...
test common/src/typed.rs - typed::ElimCase (line 86) has been running for over 60 seconds
code in the doc-test in question:
/// ```
/// veloren_common::make_case_elim!(
/// my_type_module,
/// #[repr(u32)]
/// #[derive(Clone,Copy)]
/// pub enum MyType {
/// Constr1 = 0,
/// #[typed(pure)] Constr2(arg : u8) = 1,
/// /* ..., */
/// }
/// );
/// ```
Workaround
As workaround we added a main function to the doctest, as the test doesnt execute code so far (only defines stuff) it then runs immediately again
https://gitlab.com/veloren/veloren/-/commit/3cc4b947ebd049dcdf82ca4a66a815d32d4d43f8
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-compiletimeIssue: Problems and improvements with respect to compile times.Issue: Problems and improvements with respect to compile times.L-non_local_definitionsLint: non_local_definitionsLint: non_local_definitionsP-highHigh priorityHigh priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-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.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-Znext-solver)regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Activity
lukas-code commentedon May 19, 2024
This regressed in #123594, where the new solver got enabled for the
non_local_definitionslint.It looks like the core issue here is some kind of exponential runtime in the new solver when there are many bounds on associated types.
Also, this is unrelated to
rustdocand can be reproduced with justrustc."minimal" repro
lqd commentedon May 20, 2024
cc @lcnr could the couple search graph PRs helping on fuchsia also help here?
[-][rustdoc] endless loop by running `cargo test` with toolchain 2024-05-14[/-][+]endless loop by running `cargo test` with toolchain 2024-05-14[/+]lcnr commentedon May 20, 2024
looking into it, thanks @lukas-code for the minimization.
apiraino commentedon May 21, 2024
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-high
Rollup merge of rust-lang#125343 - lcnr:eagerly-normalize-added-goals…
Rollup merge of rust-lang#125343 - lcnr:eagerly-normalize-added-goals…
Rollup merge of rust-lang#125343 - lcnr:eagerly-normalize-added-goals…
Unrolled build for rust-lang#125343