rust/tests/ui/impl-trait/in-trait/sized-rpits-dont-need-pointer-like.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
235 B
Rust
Raw Normal View History

//@ check-pass
// Make sure that we don't enforce that an RPIT that has `where Self: Sized` is pointer-like.
trait Foo {
fn foo() -> impl Sized where Self: Sized {}
}
impl Foo for () {}
fn main() {
let x: &dyn Foo = &();
}