Rollup merge of #129487 - GrigorenkoPV:repr_transparent_external_private_fields, r=compiler-errors
repr_transparent_external_private_fields: special-case some std types Fixes #129470 ```@rustbot``` label +A-lint +L-repr_transparent_external_private_fields
This commit is contained in:
commit
9c59e97ded
13 changed files with 113 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue