summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs')
-rw-r--r--tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs
new file mode 100644
index 000000000..bed81c4bc
--- /dev/null
+++ b/tests/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs
@@ -0,0 +1,12 @@
+// revisions: edition2015 edition2021
+//[edition2021]edition:2021
+
+#![allow(warnings)]
+
+fn ice() -> impl AsRef<Fn(&())> {
+ //[edition2015]~^ ERROR: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied [E0277]
+ //[edition2021]~^^ ERROR: trait objects must include the `dyn` keyword [E0782]
+ todo!()
+}
+
+fn main() {}