diff options
Diffstat (limited to 'src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs')
-rw-r--r-- | src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs b/src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs new file mode 100644 index 000000000..856dc7a3f --- /dev/null +++ b/src/test/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(&())> { + //~^ ERROR: the trait bound `(): AsRef<(dyn for<'r> Fn(&'r ()) + 'static)>` is not satisfied [E0277] + //[edition2021]~| ERROR: trait objects must include the `dyn` keyword [E0782] + todo!() +} + +fn main() {} |