-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
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-criticalCritical priorityCritical 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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Description
struct Foo<T>(T);
trait GoodBye {
type Forget;
}
impl<T> GoodBye for T {
type Forget = ();
}
trait NeedsWf<'a, 'b> {
type Assoc;
}
impl<'a, 'b> NeedsWf<'a, 'b> for Foo<<&'a &'b () as GoodBye>::Forget> {
type Assoc = &'a &'b ();
}
fn main() {}
this compiles with #100676 because we now assume unnormalized types in the impl header to be well formed when computing implied bounds. We don't check that when using the impl so we should be able to transmute lifetimes with this, though I haven't tried that yet.
Going to fix that myself once I am back home in 2 weeks. cc @rust-lang/types
Metadata
Metadata
Assignees
Labels
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-criticalCritical priorityCritical 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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
lcnr commentedon Aug 23, 2022
assigning
P-critical
after a very long and deep discussion in https://rust-lang.zulipchat.com/#narrow/stream/245100-t-compiler.2Fwg-prioritization.2Falerts/topic/.23100910.20wfcheck.20incorrectly.20assumes.20unnormalized.20types.20to.20b.E2.80.A6pnkfelix commentedon Aug 24, 2022
(FYI I also nominated PR #100676 for discussion at T-compiler meeting, essentially because of this associated issue; I hadn't seen that this was tagged as P-critical at that time. I'm leaving it nominated for now, just to ensure doubly that we discuss the matter.)
lcnr commentedon Aug 25, 2022
this is an existing issue on stable if we prevent the projection from normalizing in the impl while normalizing it when using the impl:
that's the same issue as #98543, which has been only fixed for function signatures
edit: that's #100051
Auto merge of rust-lang#100989 - lcnr:implied-bounds-uwu, r=spastorino