Rollup merge of #35672 - yossi-k:issue/35323, r=GuillaumeGomez
Update E0322 to new format Fixes #35323. Part of #35233. r? @GuillaumeGomez
This commit is contained in:
commit
eac17f1ee8
2 changed files with 7 additions and 2 deletions
|
|
@ -335,8 +335,10 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
|
|||
|
||||
// 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() {
|
||||
|
|
|
|||
|
|
@ -22,12 +22,15 @@ struct NotSync;
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue