mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
23 lines
453 B
Rust
23 lines
453 B
Rust
//@ run-pass
|
|
//@ aux-build:issue-41053.rs
|
|
|
|
#![allow(non_local_definitions)]
|
|
|
|
pub trait Trait { fn foo(&self) {} }
|
|
|
|
pub struct Foo;
|
|
|
|
impl Iterator for Foo {
|
|
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();
|
|
}
|