]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-41053.rs
Rollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnay
[rust.git] / src / test / ui / issues / issue-41053.rs
1 // run-pass
2 // aux-build:issue-41053.rs
3
4 pub trait Trait { fn foo(&self) {} }
5
6 pub struct Foo;
7
8 impl Iterator for Foo {
9     type Item = Box<dyn Trait>;
10     fn next(&mut self) -> Option<Box<dyn Trait>> {
11         extern crate issue_41053;
12         impl ::Trait for issue_41053::Test {
13             fn foo(&self) {}
14         }
15         Some(Box::new(issue_41053::Test))
16     }
17 }
18
19 fn main() {
20     Foo.next().unwrap().foo();
21 }