Open
Description
The code is generated by a fuzzer and reduced manually
I tried this code:
trait Trait {}
struct W<T>(T);
impl<T> Trait for W<W<T>>
where
W < T > : for < 'a > Trait,
W < T > : for < 'a > Trait,
{ }
fn func<T: Trait>() {}
fn main() {
func::<W<_>>();
}
Running the code with rustc
causes an infinite loop. This is the first time I've encountered a hang issue, and I'm not sure how to check if it's a duplicate problem.
Meta
rustc --version --verbose
:
rustc 1.89.0-nightly (5526a2f47 2025-06-20)
binary: rustc
commit-hash: 5526a2f47cd676ceeedc08cf71ae75ce2e9284ae
commit-date: 2025-06-20
host: x86_64-pc-windows-msvc
release: 1.89.0-nightly
LLVM version: 20.1.7
Error output
<None>
-Z time-passes
time: 0.000; rss: 16MB -> 17MB ( +1MB) parse_crate
time: 0.000; rss: 20MB -> 20MB ( +0MB) crate_injection
time: 0.007; rss: 20MB -> 23MB ( +3MB) expand_crate
time: 0.008; rss: 20MB -> 23MB ( +3MB) macro_expand_crate
time: 0.000; rss: 23MB -> 23MB ( +0MB) AST_validation
time: 0.000; rss: 23MB -> 23MB ( +0MB) finalize_imports
time: 0.000; rss: 23MB -> 23MB ( +0MB) compute_effective_visibilities
time: 0.000; rss: 23MB -> 23MB ( +0MB) finalize_macro_resolutions
time: 0.000; rss: 23MB -> 23MB ( +0MB) late_resolve_crate
time: 0.000; rss: 23MB -> 23MB ( +0MB) resolve_main
time: 0.000; rss: 23MB -> 23MB ( +0MB) resolve_check_unused
time: 0.000; rss: 23MB -> 23MB ( +0MB) resolve_postprocess
time: 0.007; rss: 23MB -> 23MB ( +1MB) resolve_crate
time: 0.000; rss: 23MB -> 23MB ( +0MB) write_dep_info
time: 0.000; rss: 24MB -> 24MB ( +0MB) complete_gated_feature_checking
time: 0.000; rss: 24MB -> 24MB ( +0MB) drop_ast
time: 0.000; rss: 25MB -> 25MB ( +0MB) looking_for_entry_point
time: 0.000; rss: 25MB -> 25MB ( +0MB) looking_for_derive_registrar
time: 0.000; rss: 26MB -> 26MB ( +0MB) unused_lib_feature_checking
time: 0.003; rss: 25MB -> 26MB ( +1MB) misc_checking_1
time: 0.002; rss: 26MB -> 31MB ( +5MB) coherence_checking
Metadata
Metadata
Assignees
Labels
Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)Area: Trait systemCategory: This is a bug.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Relevant to the compiler team, which will review and decide on the PR/issue.Fixed by the next-generation trait solver, `-Znext-solver`.