]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/hr-associated-type-projection-1.rs
Auto merge of #76210 - Mark-Simulacrum:tracing-update, r=oli-obk
[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     //~^ ERROR the trait bound `<T as UnsafeCopy<'b, T>>::Item: Deref` is not satisfied
15     type Item = T;
16     //~^ ERROR the trait bound `for<'b> <T as UnsafeCopy<'b, T>>::Item: Deref
17 }
18
19 pub fn main() {
20     <&'static str>::bug(&"");
21 }