remove rustc_attr_data_structures

This commit is contained in:
Jana Dönszelmann
2025-07-31 11:00:40 +02:00
parent 64ca23b623
commit e1d3ad89c7
186 changed files with 380 additions and 452 deletions

View File

@@ -2,13 +2,14 @@ use std::cell::LazyCell;
use std::ops::ControlFlow;
use rustc_abi::{ExternAbi, FieldIdx};
use rustc_attr_data_structures::ReprAttr::ReprPacked;
use rustc_attr_data_structures::{AttributeKind, find_attr};
use rustc_data_structures::unord::{UnordMap, UnordSet};
use rustc_errors::codes::*;
use rustc_errors::{EmissionGuarantee, MultiSpan};
use rustc_hir as hir;
use rustc_hir::attrs::AttributeKind;
use rustc_hir::attrs::ReprAttr::ReprPacked;
use rustc_hir::def::{CtorKind, DefKind};
use rustc_hir::{LangItem, Node, intravisit};
use rustc_hir::{LangItem, Node, attrs, find_attr, intravisit};
use rustc_infer::infer::{RegionVariableOrigin, TyCtxtInferExt};
use rustc_infer::traits::{Obligation, ObligationCauseCode, WellFormedLoc};
use rustc_lint_defs::builtin::{
@@ -32,7 +33,6 @@ use rustc_trait_selection::traits;
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
use tracing::{debug, instrument};
use ty::TypingMode;
use {rustc_attr_data_structures as attrs, rustc_hir as hir};
use super::compare_impl_item::check_type_bounds;
use super::*;
@@ -1401,7 +1401,7 @@ fn check_simd(tcx: TyCtxt<'_>, sp: Span, def_id: LocalDefId) {
pub(super) fn check_packed(tcx: TyCtxt<'_>, sp: Span, def: ty::AdtDef<'_>) {
let repr = def.repr();
if repr.packed() {
if let Some(reprs) = attrs::find_attr!(tcx.get_all_attrs(def.did()), attrs::AttributeKind::Repr { reprs, .. } => reprs)
if let Some(reprs) = find_attr!(tcx.get_all_attrs(def.did()), attrs::AttributeKind::Repr { reprs, .. } => reprs)
{
for (r, _) in reprs {
if let ReprPacked(pack) = r
@@ -1536,7 +1536,7 @@ pub(super) fn check_transparent<'tcx>(tcx: TyCtxt<'tcx>, adt: ty::AdtDef<'tcx>)
ty::Array(ty, _) => check_non_exhaustive(tcx, *ty),
ty::Adt(def, args) => {
if !def.did().is_local()
&& !attrs::find_attr!(
&& !find_attr!(
tcx.get_all_attrs(def.did()),
AttributeKind::PubTransparent(_)
)
@@ -1622,7 +1622,7 @@ fn check_enum(tcx: TyCtxt<'_>, def_id: LocalDefId) {
def.destructor(tcx); // force the destructor to be evaluated
if def.variants().is_empty() {
attrs::find_attr!(
find_attr!(
tcx.get_all_attrs(def_id),
attrs::AttributeKind::Repr { reprs, first_span } => {
struct_span_code_err!(

View File

@@ -1,9 +1,9 @@
use std::ops::Not;
use rustc_abi::ExternAbi;
use rustc_attr_data_structures::{AttributeKind, find_attr};
use rustc_hir as hir;
use rustc_hir::Node;
use rustc_hir::attrs::AttributeKind;
use rustc_hir::{Node, find_attr};
use rustc_infer::infer::TyCtxtInferExt;
use rustc_middle::span_bug;
use rustc_middle::ty::{self, TyCtxt, TypingMode};