-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
orphan check incorrectly handles projections #99554
Copy link
Copy link
Open
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-coherenceArea: CoherenceArea: CoherenceA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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-highHigh priorityHigh priorityS-triggers-future-incompat-lintStatus: This bug triggers a future-incompatibility lintStatus: This bug triggers a future-incompatibility lintT-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.
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-coherenceArea: CoherenceArea: CoherenceA-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.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-highHigh priorityHigh priorityS-triggers-future-incompat-lintStatus: This bug triggers a future-incompatibility lintStatus: This bug triggers a future-incompatibility lintT-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
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
future compat lint
We consider projections to be foreign types during orphan check
rust/compiler/rustc_trait_selection/src/traits/coherence.rs
Lines 780 to 782 in 7ed044c
but do not consider them to be parameters when checking for uncovered types
rust/compiler/rustc_trait_selection/src/traits/coherence.rs
Line 621 in ceeb5ad
This is more obvious after #99552
this means that the following impl passes the orphan check even though it shouldn't
The impl in
boverlaps with an implimpl<U> Foreign<T, LocalTy> for LocalTyin another cratecwhich passes the orphan check.While I wasn't able to cause runtime UB with this, I was able to get an ICE during
codegen_fulfill_obligation: https://github.com/lcnr/orphan-check-ubcc @rust-lang/types