diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/traits/ice-with-dyn-pointee-errors.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/traits/ice-with-dyn-pointee-errors.rs b/tests/ui/traits/ice-with-dyn-pointee-errors.rs new file mode 100644 index 000000000..46cef2c8b --- /dev/null +++ b/tests/ui/traits/ice-with-dyn-pointee-errors.rs @@ -0,0 +1,15 @@ +#![feature(ptr_metadata)] +// Address issue #112737 -- ICE with dyn Pointee +extern crate core; +use core::ptr::Pointee; + +fn unknown_sized_object_ptr_in(_: &(impl Pointee<Metadata = ()> + ?Sized)) {} + +fn raw_pointer_in(x: &dyn Pointee<Metadata = ()>) { + unknown_sized_object_ptr_in(x) + //~^ ERROR type mismatch resolving `<dyn Pointee<Metadata = ()> as Pointee>::Metadata == ()` +} + +fn main() { + raw_pointer_in(&42) +} |