]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/hr-associated-type-projection-1.rs
Merge commit '8da837185714cefbb261e93e9846afb11c1dc60e' into sync-rustfmt-subtree
[rust.git] / src / test / ui / associated-types / hr-associated-type-projection-1.rs
1 trait UnsafeCopy<'a, T: Copy>
2 where
3     for<'b> <Self as UnsafeCopy<'b, T>>::Item: std::ops::Deref<Target = T>,
4 {
5     type Item;
6
7     fn bug(item: &Self::Item) -> () {
8         let x: T = **item;
9         &x as *const _;
10     }
11 }
12
13 impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T {
14     //~^ type mismatch resolving `<T as Deref>::Target == T`
15     type Item = T;
16 }
17
18 pub fn main() {
19     <&'static str>::bug(&"");
20 }