Skip to content

Commit

Permalink
Rollup merge of rust-lang#35804 - pliniker:master, r=jonathandturner
Browse files Browse the repository at this point in the history
Update error message for E0084

Fixes rust-lang#35792 as part of rust-lang#35233

r? @jonathandturner
  • Loading branch information
Jonathan Turner authored Aug 20, 2016
2 parents a36ff81 + 161cb36 commit 15277eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1245,8 +1245,11 @@ pub fn check_enum_variants<'a,'tcx>(ccx: &CrateCtxt<'a,'tcx>,
let hint = *ccx.tcx.lookup_repr_hints(def_id).get(0).unwrap_or(&attr::ReprAny);

if hint != attr::ReprAny && vs.is_empty() {
span_err!(ccx.tcx.sess, sp, E0084,
"unsupported representation for zero-variant enum");
struct_span_err!(
ccx.tcx.sess, sp, E0084,
"unsupported representation for zero-variant enum")
.span_label(sp, &format!("unsupported enum representation"))
.emit();
}

let repr_type_ty = ccx.tcx.enum_repr_type(Some(&hint)).to_ty(ccx.tcx);
Expand Down
4 changes: 3 additions & 1 deletion src/test/compile-fail/E0084.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
// except according to those terms.

#[repr(i32)]
enum Foo {} //~ ERROR E0084
enum Foo {}
//~^ ERROR E0084
//~| unsupported enum representation

fn main() {
}

0 comments on commit 15277eb

Please sign in to comment.