-
-
Notifications
You must be signed in to change notification settings - Fork 17.4k
assoc types in binders can pass wf check but error when trying to normalize via impl #161405
Copy link
Copy link
Open
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-coherenceArea: CoherenceArea: CoherenceA-higher-rankedArea: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)A-impossible-boundsArea: Issues related to have impossible trait bounds in scope (impossible predicates)Area: Issues related to have impossible trait bounds in scope (impossible predicates)C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-mediumMedium priorityMedium priorityT-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.
Description
Activity
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)A-coherenceArea: CoherenceArea: CoherenceA-higher-rankedArea: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)A-impossible-boundsArea: Issues related to have impossible trait bounds in scope (impossible predicates)Area: Issues related to have impossible trait bounds in scope (impossible predicates)C-bugCategory: This is a bug.Category: This is a bug.I-unsoundIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessIssue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessP-mediumMedium priorityMedium priorityT-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.
Type
Projects
- StatusShow more project fieldsnew solver everywhere
I've been using LLMs to find soundness issues in various programs, including rust. This bug was discussed on zulip (t-types thread) where @lcnr diagnosed the root cause and believes it affects stable (and also identified the regressing PR). Filing the bug here.
I tried this code:
compiled with
-Znext-solver.I expected to see this happen: the program is rejected
Instead, this happened:
-Znext-solveraccepts it and the program printsFrom @lcnr's analysis, the underlying issue also affects stable, : https://rust.godbolt.org/z/7scG3Pqjh (and a second demonstration in
impossible_predicates: https://rust.godbolt.org/z/fG6v7K6fP). Also found the regression to be #144064 (comment) (https://rust.godbolt.org/z/Mb4ExdjeG).Meta
Root cause (analysis by lcnr)