-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-inferenceArea: Type inferenceArea: Type inferenceA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.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`.
Description
I tried this code:
trait Foo<T> {
fn method();
}
fn test<T, U>()
where
T: Foo<(i32,)>,
(U,): Sized,
{
<T as Foo<(_,)>>::method();
}
I expected to see it work (in the old solver).
Instead, it did not:
error[E0277]: the trait bound `T: Foo<(U,)>` is not satisfied
--> src/lib.rs:10:6
|
10 | <T as Foo<(_,)>>::method();
| ^ the trait `Foo<(U,)>` is not implemented for `T`
Meta
stable 1.85 rust, beta rust, and nightly feb 28 2025
Metadata
Metadata
Assignees
Labels
A-inferenceArea: Type inferenceArea: Type inferenceA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.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`.