diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/traits/issue-95311.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/traits/issue-95311.rs b/src/test/ui/traits/issue-95311.rs new file mode 100644 index 000000000..9d40d254a --- /dev/null +++ b/src/test/ui/traits/issue-95311.rs @@ -0,0 +1,19 @@ +// check-pass + +// Test to check that pointee trait doesn't let region variables escape into the cache + +#![feature(ptr_metadata)] + +trait Bar: Sized + 'static {} + +struct Foo<B: Bar> { + marker: std::marker::PhantomData<B>, +} + +impl<B: Bar> Foo<B> { + fn foo<T: ?Sized>(value: &T) { + std::ptr::metadata(value); + } +} + +fn main() {} |