1
Fork 0

Rollup merge of #138253 - mu001999-contrib:fix-138241, r=jdonszelmann

Continue to check attr if meet empty repr for adt

Fixes #138241

Returning while checking ReprEmpty results in missing the check for the next repr
This commit is contained in:
Matthias Krüger 2025-03-09 16:41:53 +01:00 committed by GitHub
commit 469f48db7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 1 deletions

View file

@ -1998,7 +1998,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
// catch `repr()` with no arguments, applied to an item (i.e. not `#![repr()]`)
if item.is_some() {
match target {
Target::Struct | Target::Union | Target::Enum => {}
Target::Struct | Target::Union | Target::Enum => continue,
Target::Fn | Target::Method(_) => {
feature_err(
&self.tcx.sess,