summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs')
-rw-r--r--tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs b/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs
new file mode 100644
index 000000000..57d688492
--- /dev/null
+++ b/tests/ui/impl-trait/fresh-lifetime-from-bare-trait-obj-114664.rs
@@ -0,0 +1,22 @@
+// edition:2015
+// check-pass
+// issue: 114664
+
+fn ice() -> impl AsRef<Fn(&())> {
+ //~^ WARN trait objects without an explicit `dyn` are deprecated
+ //~| WARN trait objects without an explicit `dyn` are deprecated
+ //~| 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!
+ //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+ Foo
+}
+
+struct Foo;
+impl AsRef<dyn Fn(&())> for Foo {
+ fn as_ref(&self) -> &(dyn for<'a> Fn(&'a ()) + 'static) {
+ todo!()
+ }
+}
+
+pub fn main() {}