Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update E0322 to new format #35672

Merged
merged 1 commit into from
Aug 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/librustc_typeck/coherence/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,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() {
Expand Down
3 changes: 3 additions & 0 deletions src/test/compile-fail/coherence-impls-sized.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down