diff options
Diffstat (limited to 'src/test/ui/generic-associated-types/issue-68656-unsized-values.rs')
-rw-r--r-- | src/test/ui/generic-associated-types/issue-68656-unsized-values.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs b/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs new file mode 100644 index 000000000..c0d933362 --- /dev/null +++ b/src/test/ui/generic-associated-types/issue-68656-unsized-values.rs @@ -0,0 +1,21 @@ +// Regression test for #68656 + +#![feature(generic_associated_types)] + +trait UnsafeCopy<T: Copy> { + type Item<'a>: std::ops::Deref<Target = T>; + + fn bug<'a>(item: &Self::Item<'a>) -> () { + let x: T = **item; + &x as *const _; + } +} + +impl<T: Copy + std::ops::Deref> UnsafeCopy<T> for T { + type Item<'a> = T; + //~^ ERROR type mismatch resolving `<T as Deref>::Target == T` +} + +fn main() { + <&'static str>::bug(&""); +} |