Skip to content

Commit

Permalink
repr_transparent_external_private_fields: treat `rustc_pub_transparen…
Browse files Browse the repository at this point in the history
…t` types as local
  • Loading branch information
GrigorenkoPV committed Aug 24, 2024
1 parent 9c778f2 commit 814185a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_hir_analysis/src/check/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1259,7 +1259,8 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
ty::Tuple(list) => list.iter().try_for_each(|t| check_non_exhaustive(tcx, t)),
ty::Array(ty, _) => check_non_exhaustive(tcx, *ty),
ty::Adt(def, args) => {
if !def.did().is_local() {
if !def.did().is_local() && !tcx.has_attr(def.did(), sym::rustc_pub_transparent)
{
let non_exhaustive = def.is_variant_list_non_exhaustive()
|| def
.variants()
Expand Down

0 comments on commit 814185a

Please sign in to comment.