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

@ -386,7 +386,8 @@ pub fn from_fn_attrs<'ll, 'tcx>(
) {
let span = cx
.tcx
.get_attr(instance.def_id(), sym::target_feature)
.get_attrs(instance.def_id(), sym::target_feature)
.next()
.map_or_else(|| cx.tcx.def_span(instance.def_id()), |a| a.span);
let msg = format!(
"the target features {} must all be either enabled or disabled together",