]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/type-alias-impl-trait/issue-53092.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / issue-53092.rs
index e7a8bf19a1b9b51e213529bd696c3f7b8dedac3a..1be5b46d6df682f606c3164377909ad0a84a78c5 100644 (file)
@@ -1,15 +1,17 @@
 #![feature(type_alias_impl_trait)]
 #![allow(dead_code)]
 
-// check-pass
-// known-bug #53092 #90409
-
 type Bug<T, U> = impl Fn(T) -> U + Copy;
 
-const CONST_BUG: Bug<u8, ()> = unsafe { std::mem::transmute(|_: u8| ()) };
+union Moo {
+    x: Bug<u8, ()>,
+    y: (),
+}
+
+const CONST_BUG: Bug<u8, ()> = unsafe { Moo { y: () }.x };
 
 fn make_bug<T, U: From<T>>() -> Bug<T, U> {
-    |x| x.into()
+    |x| x.into() //~ ERROR the trait bound `U: From<T>` is not satisfied
 }
 
 fn main() {