2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2019-03-12 00:49:17 +00:00
|
|
|
//@ aux-build:issue-41053.rs
|
2017-04-04 15:11:03 +00:00
|
|
|
|
2024-01-26 16:14:38 +00:00
|
|
|
#![allow(non_local_definitions)]
|
|
|
|
|
2017-04-04 15:11:03 +00:00
|
|
|
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>> {
|
2017-04-04 15:11:03 +00:00
|
|
|
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();
|
|
|
|
}
|