Skip to content

Commit 5286a5a

Browse files
committed
Update E0322 to new format
1 parent 4c02363 commit 5286a5a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/librustc_typeck/coherence/orphan.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,10 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
331331

332332
// Disallow *all* explicit impls of `Sized` and `Unsize` for now.
333333
if Some(trait_def_id) == self.tcx.lang_items.sized_trait() {
334-
span_err!(self.tcx.sess, item.span, E0322,
335-
"explicit impls for the `Sized` trait are not permitted");
334+
struct_span_err!(self.tcx.sess, item.span, E0322,
335+
"explicit impls for the `Sized` trait are not permitted")
336+
.span_label(item.span, &format!("impl of 'Sized' not allowed"))
337+
.emit();
336338
return;
337339
}
338340
if Some(trait_def_id) == self.tcx.lang_items.unsize_trait() {

src/test/compile-fail/coherence-impls-sized.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ struct NotSync;
2222
impl !Sync for NotSync {}
2323

2424
impl Sized for TestE {} //~ ERROR E0322
25+
//~^ impl of 'Sized' not allowed
2526

2627
impl Sized for MyType {} //~ ERROR E0322
28+
//~^ impl of 'Sized' not allowed
2729

2830
impl Sized for (MyType, MyType) {} //~ ERROR E0117
2931

3032
impl Sized for &'static NotSync {} //~ ERROR E0322
33+
//~^ impl of 'Sized' not allowed
3134

3235
impl Sized for [MyType] {} //~ ERROR E0117
3336

0 commit comments

Comments
 (0)