blob: 951dd9e97d268ec81274dc44f21fb895b57d35dd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
trait UnsafeCopy<'a, T: Copy>
where
for<'b> <Self as UnsafeCopy<'b, T>>::Item: std::ops::Deref<Target = T>,
{
type Item;
fn bug(item: &Self::Item) -> () {
let x: T = **item;
&x as *const _;
}
}
impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T {
//~^ type mismatch resolving `<T as Deref>::Target == T`
type Item = T;
}
pub fn main() {
<&'static str>::bug(&"");
}
|