Repository navigation
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.
Description
Activity
- addedA-trait-systemArea: Trait systemArea: Trait systemI-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/SoundnessC-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.
on Jul 21, 2022 - addedI-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}
on Jul 21, 2022 - addedE-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.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.
on Jul 21, 2022 after #99552 has landed, we should be able to fix this by:
- rename
found_param_tytofound_uncovered_ty - also use that function for
ty::Projection - add tests + update the error message to also make sense for projections
- run crater
- rename
WG-prioritization assigning priority (Zulip discussion).
@rustbot label -I-prioritize +P-high
- addedP-highHigh priorityHigh priorityand removedI-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}
on Jul 21, 2022 @rustbot claim
4 remaining items
- added a commit that references this issue
on Dec 7, 2023 - added a commit that references this issue
on Jan 18, 2024 - added a commit that references this issue
on Feb 26, 2024 - added a commit that references this issue
on Apr 30, 2024 - moved this from unblocked to new solver everywhere in T-types unsound issues
on Apr 30, 2024 - addedS-triggers-future-incompat-lintStatus: This bug triggers a future-incompatibility lintStatus: This bug triggers a future-incompatibility lint
on Sep 14, 2024
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
Projects
- StatusShow more project fieldsfuture 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