2024-02-16 14:02:50 -06:00
|
|
|
//@ edition:2015
|
|
|
|
//@ check-pass
|
2023-08-10 22:13:35 -05:00
|
|
|
// issue: 114664
|
|
|
|
|
|
|
|
fn ice() -> impl AsRef<Fn(&())> {
|
|
|
|
//~^ WARN trait objects without an explicit `dyn` are deprecated
|
|
|
|
//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
2024-03-20 11:52:54 -05:00
|
|
|
//~| WARN trait objects without an explicit `dyn` are deprecated
|
|
|
|
//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
2023-08-10 22:13:35 -05:00
|
|
|
Foo
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
impl AsRef<dyn Fn(&())> for Foo {
|
|
|
|
fn as_ref(&self) -> &(dyn for<'a> Fn(&'a ()) + 'static) {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {}
|