]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/type-alias-impl-trait/not_a_defining_use.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / not_a_defining_use.rs
index 02485b24e7b8a5fc3d0c04658a2dc880b71fd28e..f29b980dfd0e578e0177ea2a574c3d18ff6b1c2d 100644 (file)
@@ -7,6 +7,7 @@ fn main() {}
 type Two<T, U> = impl Debug;
 
 fn two<T: Debug>(t: T) -> Two<T, u32> {
+    //~^ ERROR non-defining opaque type use in defining scope
     (t, 4i8)
 }
 
@@ -24,9 +25,7 @@ impl Bar for u32 {
     const FOO: i32 = 42;
 }
 
-// this should work! But it requires `two` and `three` not to be defining uses,
-// just restricting uses
-fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> { //~ concrete type differs from previous
+fn four<T: Debug, U: Bar>(t: T) -> Two<T, U> {
     (t, <U as Bar>::FOO)
 }