-
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.F-return_position_impl_trait_in_trait`#![feature(return_position_impl_trait_in_trait)]``#![feature(return_position_impl_trait_in_trait)]`T-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
I tried this code:
#![feature(return_position_impl_trait_in_trait)]
trait Foo {
fn test() -> impl Sized;
}
impl<'a, T> Foo for T {
fn test() -> &'a () { &() }
}
I expected to see this happen: Fails saying something about unconstrained lifetime parameters
Instead, this happened: Passes 😢
We'll just have to generalize enforce_impl_params_are_constrained
to check RPITITs too.
I haven't made a test that actually turns this into an unsoundness, or even really thought if it's unsound, but if conceptually RPITITs are supposed to act like anonymous associated types, this probably shouldn't pass.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-return_position_impl_trait_in_trait`#![feature(return_position_impl_trait_in_trait)]``#![feature(return_position_impl_trait_in_trait)]`T-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.
Type
Projects
Status
Done