]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc_typeck/coherence/orphan.rs
Imported Upstream version 1.1.0+dfsg1
[rustc.git] / src / librustc_typeck / coherence / orphan.rs
index b450e6b398a6a00d8ef1dd716c198559f829f8a2..4c9fe6492e9ca530430ea1884d5b5532b781e087 100644 (file)
@@ -316,12 +316,17 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
                     }
                 }
 
-                // Disallow *all* explicit impls of `Sized` for now.
+                // Disallow *all* explicit impls of `Sized` and `Unsize` for now.
                 if Some(trait_def_id) == self.tcx.lang_items.sized_trait() {
                     span_err!(self.tcx.sess, item.span, E0322,
                               "explicit impls for the `Sized` trait are not permitted");
                     return;
                 }
+                if Some(trait_def_id) == self.tcx.lang_items.unsize_trait() {
+                    span_err!(self.tcx.sess, item.span, E0328,
+                              "explicit impls for the `Unsize` trait are not permitted");
+                    return;
+                }
             }
             ast::ItemDefaultImpl(..) => {
                 // "Trait" impl