-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
orphan check incorrectly handles projections #99554
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-coherence
Area: Coherence
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
E-medium
Call for participation: Medium difficulty. Experience needed to fix: Intermediate.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-high
High priority
S-triggers-future-incompat-lint
Status: This bug triggers a future-incompatibility lint
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Comments
after #99552 has landed, we should be able to fix this by:
|
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
@rustbot claim |
Discussed in the types team on-site meetup thing: Concluded that we should explore having the orphan check normalize first but having the "is knowable" check remain syntactic (not normalize). |
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 7, 2023
Normalize trait ref before orphan check & consider ty params in alias types to be uncovered Fixes rust-lang#99554. r? lcnr
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jan 18, 2024
Normalize trait ref before orphan check & consider ty params in alias types to be uncovered Fixes rust-lang#99554. r? lcnr
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 26, 2024
Normalize trait ref before orphan check & consider ty params in alias types to be uncovered Fixes rust-lang#99554, fixes rust-lang/types-team#104. Supersedes rust-lang#100555. r? lcnr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-associated-items
Area: Associated items (types, constants & functions)
A-coherence
Area: Coherence
A-trait-system
Area: Trait system
C-bug
Category: This is a bug.
E-medium
Call for participation: Medium difficulty. Experience needed to fix: Intermediate.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
I-unsound
Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/Soundness
P-high
High priority
S-triggers-future-incompat-lint
Status: This bug triggers a future-incompatibility lint
T-types
Relevant to the types team, which will review and decide on the PR/issue.
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
b
overlaps with an implimpl<U> Foreign<T, LocalTy> for LocalTy
in another cratec
which 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
The text was updated successfully, but these errors were encountered: