2024-02-16 20:02:50 +00:00
|
|
|
//@ run-pass
|
|
|
|
|
//@ aux-build:issue-41053.rs
|
2017-04-04 18:11:03 +03:00
|
|
|
|
2024-01-26 17:14:38 +01:00
|
|
|
#![allow(non_local_definitions)]
|
|
|
|
|
|
2017-04-04 18:11:03 +03:00
|
|
|
pub trait Trait { fn foo(&self) {} }
|
|
|
|
|
|
|
|
|
|
pub struct Foo;
|
|
|
|
|
|
|
|
|
|
impl Iterator for Foo {
|
2019-05-28 14:47:21 -04:00
|
|
|
type Item = Box<dyn Trait>;
|
|
|
|
|
fn next(&mut self) -> Option<Box<dyn Trait>> {
|
2017-04-04 18:11:03 +03: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();
|
|
|
|
|
}
|