]> git.lizzy.rs Git - rust.git/commitdiff
Update E0322 to new format
authorYossi Konstantinovsky <yosyossii@gmail.com>
Sun, 14 Aug 2016 18:57:33 +0000 (21:57 +0300)
committerYossi Konstantinovsky <yosyossii@gmail.com>
Sun, 14 Aug 2016 18:57:33 +0000 (21:57 +0300)
src/librustc_typeck/coherence/orphan.rs
src/test/compile-fail/coherence-impls-sized.rs

index 15d4026254fa57ec1c8f2ee03cb25e99c81916a9..e950af5c13389a76f531ab57216e2bcd44d65e14 100644 (file)
@@ -331,8 +331,10 @@ fn check_item(&self, item: &hir::Item) {
 
                 // 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");
+                    struct_span_err!(self.tcx.sess, item.span, E0322,
+                              "explicit impls for the `Sized` trait are not permitted")
+                        .span_label(item.span, &format!("impl of 'Sized' not allowed"))
+                        .emit();
                     return;
                 }
                 if Some(trait_def_id) == self.tcx.lang_items.unsize_trait() {
index 167067cb5fc0aec45ac48d9c282b1f5703875bbb..79767e5157b14b34e65a7d341de5c87fa068fb7d 100644 (file)
@@ -22,12 +22,15 @@ enum TestE {
 impl !Sync for NotSync {}
 
 impl Sized for TestE {} //~ ERROR E0322
+//~^ impl of 'Sized' not allowed
 
 impl Sized for MyType {} //~ ERROR E0322
+//~^ impl of 'Sized' not allowed
 
 impl Sized for (MyType, MyType) {} //~ ERROR E0117
 
 impl Sized for &'static NotSync {} //~ ERROR E0322
+//~^ impl of 'Sized' not allowed
 
 impl Sized for [MyType] {} //~ ERROR E0117