-
- Notifications
You must be signed in to change notification settings - Fork 14.3k
Open
Labels
A-coherenceArea: CoherenceArea: CoherenceA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.P-mediumMedium priorityMedium priorityS-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueS-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.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
I tried this code:
trait Trait {} struct W<T>(T); impl<T, U> Trait for W<(<&Self as IntoIterator>, W<U>)> where W<T>: Trait, W<U>: Trait, { } fn impls<T: Trait>() {} fn main() { impls::<W<_>>(); }I expected to see this happen:
The compilation process should complete successfully, and any errors in the code should be reported with diagnostic messages.
Instead, this happened:
The compiler hangs indefinitely and appears to never terminate.
Meta
rustc --version --verbose:
rustc 1.85.1 (4eb161250 2025-03-15) binary: rustc commit-hash: 4eb161250e340c8f48f66e2b929ef4a5bed7c181 commit-date: 2025-03-15 host: x86_64-pc-windows-msvc release: 1.85.1 LLVM version: 19.1.7 Backtrace
error: expected `::`, found `,` --> .\temp.rs:7:48 | 7 | impl<T, U> Trait for W<(<&Self as IntoIterator>, W<U>)> | ^ expected `::` error: expected `::`, found `,` --> .\temp.rs:7:48 | 7 | impl<T, U> Trait for W<(<&Self as IntoIterator>, W<U>)> | ^ expected `::` | help: expressions must be enclosed in braces to be used as const generic arguments | 7 | impl<T, U> Trait for W<{ (<&Self as IntoIterator>, W<U>) }> | + + error[E0747]: constant provided when a type was expected --> .\temp.rs:7:24 | 7 | impl<T, U> Trait for W<(<&Self as IntoIterator>, W<U>)> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Metadata
Metadata
Assignees
Labels
A-coherenceArea: CoherenceArea: CoherenceA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.Issue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.P-mediumMedium priorityMedium priorityS-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueS-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.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.fixed-by-next-solverFixed by the next-generation trait solver, `-Znext-solver`.Fixed by the next-generation trait solver, `-Znext-solver`.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.