summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/issue-95311.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/issue-95311.rs')
-rw-r--r--tests/ui/traits/issue-95311.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/traits/issue-95311.rs b/tests/ui/traits/issue-95311.rs
new file mode 100644
index 000000000..9d40d254a
--- /dev/null
+++ b/tests/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() {}