]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generic-associated-types/issue-68656-unsized-values.rs
Rollup merge of #82308 - estebank:issue-82290, r=lcnr
[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 //~^ WARNING the feature `generic_associated_types` is incomplete and may not
5
6 trait UnsafeCopy<T: Copy> {
7     type Item<'a>: std::ops::Deref<Target = T>;
8
9     fn bug<'a>(item: &Self::Item<'a>) -> () {
10         let x: T = **item;
11         &x as *const _;
12     }
13 }
14
15 impl<T: Copy + std::ops::Deref> UnsafeCopy<T> for T {
16     type Item<'a> = T;
17     //~^ ERROR type mismatch resolving `<T as Deref>::Target == T`
18 }
19
20 fn main() {
21     <&'static str>::bug(&"");
22 }