1
Fork 0

get_attr should check that no duplicates are allowed

This commit is contained in:
yukang 2022-09-06 14:16:54 +08:00
parent 676afc5149
commit 00b10a5552
7 changed files with 38 additions and 5 deletions

View file

@ -1459,7 +1459,7 @@ fn check_enum<'tcx>(tcx: TyCtxt<'tcx>, vs: &'tcx [hir::Variant<'tcx>], def_id: L
def.destructor(tcx); // force the destructor to be evaluated
if vs.is_empty() {
if let Some(attr) = tcx.get_attr(def_id.to_def_id(), sym::repr) {
if let Some(attr) = tcx.get_attrs(def_id.to_def_id(), sym::repr).next() {
struct_span_err!(
tcx.sess,
attr.span,