]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/issue-95311.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / issue-95311.rs
1 // check-pass
2
3 // Test to check that pointee trait doesn't let region variables escape into the cache
4
5 #![feature(ptr_metadata)]
6
7 trait Bar: Sized + 'static {}
8
9 struct Foo<B: Bar> {
10     marker: std::marker::PhantomData<B>,
11 }
12
13 impl<B: Bar> Foo<B> {
14     fn foo<T: ?Sized>(value: &T) {
15         std::ptr::metadata(value);
16     }
17 }
18
19 fn main() {}