rust/tests/ui/issues/issue-41053.rs

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

24 lines
453 B
Rust
Raw Normal View History

//@ run-pass
//@ aux-build:issue-41053.rs
#![allow(non_local_definitions)]
pub trait Trait { fn foo(&self) {} }
pub struct Foo;
impl Iterator for Foo {
2019-05-28 18:47:21 +00:00
type Item = Box<dyn Trait>;
fn next(&mut self) -> Option<Box<dyn Trait>> {
extern crate issue_41053;
impl ::Trait for issue_41053::Test {
fn foo(&self) {}
}
Some(Box::new(issue_41053::Test))
}
}
fn main() {
Foo.next().unwrap().foo();
}