rust/tests/ui/impl-trait/in-trait/object-safety-sized.rs

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

24 lines
377 B
Rust
Raw Normal View History

// check-pass
// revisions: current next
//[next] compile-flags: -Ztrait-solver=next
#![feature(return_position_impl_trait_in_trait)]
fn main() {
let vec: Vec<Box<dyn Trait>> = Vec::new();
for i in vec {
i.fn_2();
}
}
trait OtherTrait {}
trait Trait {
fn fn_1(&self) -> impl OtherTrait
where
Self: Sized;
fn fn_2(&self) -> bool;
}