Update error message for E0084

This commit is contained in:
pliniker 2016-08-18 16:27:33 -04:00
parent 43c090ed69
commit 161cb36159
2 changed files with 8 additions and 3 deletions

View File

@ -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);

View File

@ -9,7 +9,9 @@
// except according to those terms.
#[repr(i32)]
enum Foo {} //~ ERROR E0084
enum Foo {}
//~^ ERROR E0084
//~| unsupported enum representation
fn main() {
}