Closed
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
Area: Associated items (types, constants & functions)Area: Type systemCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Issue: A soundness hole (worst kind of bug), see: https://en.wikipedia.org/wiki/SoundnessMedium priorityRelevant to the compiler team, which will review and decide on the PR/issue.