-
-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Nonsensical "trait bound is not satisfied" error on trait method definition #161621
Copy link
Copy link
Open
Labels
A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.I-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}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.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-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
Activity
Metadata
Metadata
Assignees
Labels
A-dyn-traitArea: trait objects, vtable layoutArea: trait objects, vtable layoutA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.I-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}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.WG-trait-system-refactorThe Rustc Trait System Refactor Initiative (-Znext-solver)The Rustc Trait System Refactor Initiative (-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.
I tried this code:
I expected to see this happen: the code compiles correctly.
Instead, this happened:
RustaceansAreAwesomelook like an implementation detail that shouldn't have leaked.(Args, Self::Output): SignatureToFnPtrshould follow from thewherebound on the trait definition.fn method(&self)is replaced withfn method(self).This looks like two different regressions in the two trait solvers. I bisected the old solver regression to #138174, @jnkel bisected the next solver regression to #156976. Tentatively marking as regression-from-stable-to-stable, but it's old enough that this might not be useful (the last version where this worked by default is nightly-2025-03-12)...
Meta
rustc --version --verbose:@rustbot label +A-trait-system +T-compiler +regression-from-stable-to-stable