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