]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-68656-unsized-values.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / generic-associated-types / issue-68656-unsized-values.rs
1 // Regression test for #68656
2
3 #![feature(generic_associated_types)]
4
5 trait UnsafeCopy<T: Copy> {
6     type Item<'a>: std::ops::Deref<Target = T>;
7
8     fn bug<'a>(item: &Self::Item<'a>) -> () {
9         let x: T = **item;
10         &x as *const _;
11     }
12 }
13
14 impl<T: Copy + std::ops::Deref> UnsafeCopy<T> for T {
15     type Item<'a> = T;
16     //~^ ERROR type mismatch resolving `<T as Deref>::Target == T`
17 }
18
19 fn main() {
20     <&'static str>::bug(&"");
21 }