-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-type-systemArea: Type systemArea: Type systemE-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-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
UPDATE: Mentoring instructions for fixing this bug can be found here.
There are some calls to add obligations to a fulfillment context but it's never checked.
Some examples of code that shouldn't compile:
trait TransmuteTarget: Sized {
type Out: Sized;
}
// Can't use generic impl here.
impl TransmuteTarget for String {
type Out = String;
}
trait Transmute: TransmuteTarget {
const FROM: Self::Out;
}
impl<T: TransmuteTarget> Transmute for T {
// Associated type projections aren't checked (obligation fulfillment).
const FROM: &'static str = "foo";
}
trait Foo {
const NAME: &'static str;
}
impl<'a> Foo for &'a () {
// Lifetimes aren't checked (regionck).
const NAME: &'a str = "unit";
}
cc @rust-lang/compiler
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-type-systemArea: Type systemArea: Type systemE-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-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.