rust/tests/ui/issues/issue-41053.rs
Lukas Wirth eae7fe1bdb Use non-2015 edition paths in tests that do not test for their resolution
This allows for testing these tests on editions other than 2015
2025-06-03 13:35:31 +02:00

24 lines
458 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 crate::Trait for issue_41053::Test {
fn foo(&self) {}
}
Some(Box::new(issue_41053::Test))
}
}
fn main() {
Foo.next().unwrap().foo();
}