Auto merge of #148600 - folkertdev:pass-indirectly-reuse-attrs, r= · rust-lang/rust@1869732 (original) (raw)
File tree
1 file changed
lines changed
- compiler/rustc_middle/src/ty
1 file changed
lines changed
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1512,9 +1512,8 @@ impl<'tcx> TyCtxt<'tcx> { | ||
| 1512 | 1512 | field_shuffle_seed ^= user_seed; |
| 1513 | 1513 | } |
| 1514 | 1514 | |
| 1515 | -if let Some(reprs) = | |
| 1516 | -find_attr!(self.get_all_attrs(did), AttributeKind::Repr { reprs, .. } => reprs) | |
| 1517 | -{ | |
| 1515 | +let attributes = self.get_all_attrs(did); | |
| 1516 | +if let Some(reprs) = find_attr!(attributes, AttributeKind::Repr { reprs, .. } => reprs) { | |
| 1518 | 1517 | for (r, _) in reprs { |
| 1519 | 1518 | flags.insert(match *r { |
| 1520 | 1519 | attr::ReprRust => ReprFlags::empty(), |
| @@ -1574,10 +1573,7 @@ impl<'tcx> TyCtxt<'tcx> { | ||
| 1574 | 1573 | } |
| 1575 | 1574 | |
| 1576 | 1575 | // See `TyAndLayout::pass_indirectly_in_non_rustic_abis` for details. |
| 1577 | -if find_attr!( | |
| 1578 | -self.get_all_attrs(did), | |
| 1579 | -AttributeKind::RustcPassIndirectlyInNonRusticAbis(..) | |
| 1580 | -) { | |
| 1576 | +if find_attr!(attributes, AttributeKind::RustcPassIndirectlyInNonRusticAbis(..)) { | |
| 1581 | 1577 | flags.insert(ReprFlags::PASS_INDIRECTLY_IN_NON_RUSTIC_ABIS); |
| 1582 | 1578 | } |
| 1583 | 1579 |