Skip to content

Commit 684b7b7

Browse files
committed
don't depend on rustc_attr_parsing if rustc_data_structures will do
1 parent dcecb99 commit 684b7b7

File tree

26 files changed

+61
-62
lines changed

26 files changed

+61
-62
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3410,7 +3410,7 @@ dependencies = [
34103410
"rustc-demangle",
34113411
"rustc_abi",
34123412
"rustc_ast",
3413-
"rustc_attr_parsing",
3413+
"rustc_attr_data_structures",
34143414
"rustc_codegen_ssa",
34153415
"rustc_data_structures",
34163416
"rustc_errors",
@@ -3490,7 +3490,7 @@ dependencies = [
34903490
"rustc_abi",
34913491
"rustc_apfloat",
34923492
"rustc_ast",
3493-
"rustc_attr_parsing",
3493+
"rustc_attr_data_structures",
34943494
"rustc_data_structures",
34953495
"rustc_errors",
34963496
"rustc_fluent_macro",
@@ -3754,7 +3754,7 @@ dependencies = [
37543754
"rustc_abi",
37553755
"rustc_arena",
37563756
"rustc_ast",
3757-
"rustc_attr_parsing",
3757+
"rustc_attr_data_structures",
37583758
"rustc_data_structures",
37593759
"rustc_errors",
37603760
"rustc_feature",
@@ -3791,7 +3791,7 @@ dependencies = [
37913791
"itertools",
37923792
"rustc_abi",
37933793
"rustc_ast",
3794-
"rustc_attr_parsing",
3794+
"rustc_attr_data_structures",
37953795
"rustc_data_structures",
37963796
"rustc_errors",
37973797
"rustc_fluent_macro",
@@ -4122,7 +4122,7 @@ dependencies = [
41224122
"rustc_abi",
41234123
"rustc_arena",
41244124
"rustc_ast",
4125-
"rustc_attr_parsing",
4125+
"rustc_attr_data_structures",
41264126
"rustc_const_eval",
41274127
"rustc_data_structures",
41284128
"rustc_errors",
@@ -4148,7 +4148,7 @@ version = "0.0.0"
41484148
dependencies = [
41494149
"rustc_abi",
41504150
"rustc_ast",
4151-
"rustc_attr_parsing",
4151+
"rustc_attr_data_structures",
41524152
"rustc_data_structures",
41534153
"rustc_errors",
41544154
"rustc_fluent_macro",
@@ -4218,7 +4218,7 @@ dependencies = [
42184218
"rustc_ast",
42194219
"rustc_ast_lowering",
42204220
"rustc_ast_pretty",
4221-
"rustc_attr_parsing",
4221+
"rustc_attr_data_structures",
42224222
"rustc_data_structures",
42234223
"rustc_errors",
42244224
"rustc_expand",
@@ -4264,7 +4264,7 @@ name = "rustc_privacy"
42644264
version = "0.0.0"
42654265
dependencies = [
42664266
"rustc_ast",
4267-
"rustc_attr_parsing",
4267+
"rustc_attr_data_structures",
42684268
"rustc_data_structures",
42694269
"rustc_errors",
42704270
"rustc_fluent_macro",

compiler/rustc_codegen_llvm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ object = { version = "0.36.3", default-features = false, features = ["std", "rea
1919
rustc-demangle = "0.1.21"
2020
rustc_abi = { path = "../rustc_abi" }
2121
rustc_ast = { path = "../rustc_ast" }
22-
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
22+
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
2323
rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
2424
rustc_data_structures = { path = "../rustc_data_structures" }
2525
rustc_errors = { path = "../rustc_errors" }

compiler/rustc_codegen_llvm/src/attributes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Set and unset common attributes on LLVM values.
2-
use rustc_attr_parsing::{InlineAttr, InstructionSetAttr, OptimizeAttr};
2+
use rustc_attr_data_structures::{InlineAttr, InstructionSetAttr, OptimizeAttr};
33
use rustc_codegen_ssa::traits::*;
44
use rustc_hir::def_id::DefId;
55
use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, PatchableFunctionEntry};

compiler/rustc_codegen_llvm/src/callee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub(crate) fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'t
103103
// This is a monomorphization of a generic function.
104104
if !(cx.tcx.sess.opts.share_generics()
105105
|| tcx.codegen_fn_attrs(instance_def_id).inline
106-
== rustc_attr_parsing::InlineAttr::Never)
106+
== rustc_attr_data_structures::InlineAttr::Never)
107107
{
108108
// When not sharing generics, all instances are in the same
109109
// crate and have hidden visibility.

compiler/rustc_const_eval/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ either = "1"
99
rustc_abi = { path = "../rustc_abi" }
1010
rustc_apfloat = "0.2.0"
1111
rustc_ast = { path = "../rustc_ast" }
12-
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
12+
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
1313
rustc_data_structures = { path = "../rustc_data_structures" }
1414
rustc_errors = { path = "../rustc_errors" }
1515
rustc_fluent_macro = { path = "../rustc_fluent_macro" }

compiler/rustc_const_eval/src/check_consts/check.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::mem;
66
use std::num::NonZero;
77
use std::ops::Deref;
88

9-
use rustc_attr_parsing::{ConstStability, StabilityLevel};
9+
use rustc_attr_data_structures as attrs;
1010
use rustc_errors::{Diag, ErrorGuaranteed};
1111
use rustc_hir::def::DefKind;
1212
use rustc_hir::def_id::DefId;
@@ -475,7 +475,7 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
475475
/// Check the const stability of the given item (fn or trait).
476476
fn check_callee_stability(&mut self, def_id: DefId) {
477477
match self.tcx.lookup_const_stability(def_id) {
478-
Some(ConstStability { level: StabilityLevel::Stable { .. }, .. }) => {
478+
Some(attrs::ConstStability { level: attrs::StabilityLevel::Stable { .. }, .. }) => {
479479
// All good.
480480
}
481481
None => {
@@ -491,8 +491,8 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
491491
});
492492
}
493493
}
494-
Some(ConstStability {
495-
level: StabilityLevel::Unstable { implied_by: implied_feature, issue, .. },
494+
Some(attrs::ConstStability {
495+
level: attrs::StabilityLevel::Unstable { implied_by: implied_feature, issue, .. },
496496
feature,
497497
..
498498
}) => {
@@ -918,8 +918,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
918918
});
919919
}
920920
}
921-
Some(ConstStability {
922-
level: StabilityLevel::Unstable { .. },
921+
Some(attrs::ConstStability {
922+
level: attrs::StabilityLevel::Unstable { .. },
923923
feature,
924924
..
925925
}) => {
@@ -930,7 +930,10 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
930930
suggestion: self.crate_inject_span(),
931931
});
932932
}
933-
Some(ConstStability { level: StabilityLevel::Stable { .. }, .. }) => {
933+
Some(attrs::ConstStability {
934+
level: attrs::StabilityLevel::Stable { .. },
935+
..
936+
}) => {
934937
// All good. Note that a `#[rustc_const_stable]` intrinsic (meaning it
935938
// can be *directly* invoked from stable const code) does not always
936939
// have the `#[rustc_intrinsic_const_stable_indirect]` attribute (which controls

compiler/rustc_const_eval/src/check_consts/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
//! has interior mutability or needs to be dropped, as well as the visitor that emits errors when
55
//! it finds operations that are invalid in a certain context.
66
7-
use rustc_attr_parsing::{AttributeKind, find_attr};
87
use rustc_errors::DiagCtxtHandle;
9-
use rustc_hir as hir;
108
use rustc_hir::def_id::{DefId, LocalDefId};
119
use rustc_middle::ty::{self, PolyFnSig, TyCtxt};
1210
use rustc_middle::{bug, mir};
1311
use rustc_span::Symbol;
12+
use {rustc_attr_data_structures as attrs, rustc_hir as hir};
1413

1514
pub use self::qualifs::Qualif;
1615

@@ -83,7 +82,7 @@ pub fn rustc_allow_const_fn_unstable(
8382
) -> bool {
8483
let attrs = tcx.hir_attrs(tcx.local_def_id_to_hir_id(def_id));
8584

86-
find_attr!(attrs, AttributeKind::AllowConstFnUnstable(syms) if syms.contains(&feature_gate))
85+
attrs::find_attr!(attrs, attrs::AttributeKind::AllowConstFnUnstable(syms) if syms.contains(&feature_gate))
8786
}
8887

8988
/// Returns `true` if the given `def_id` (trait or function) is "safe to expose on stable".

compiler/rustc_hir_analysis/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ itertools = "0.12"
1313
rustc_abi = { path = "../rustc_abi" }
1414
rustc_arena = { path = "../rustc_arena" }
1515
rustc_ast = { path = "../rustc_ast" }
16-
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
16+
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
1717
rustc_data_structures = { path = "../rustc_data_structures" }
1818
rustc_errors = { path = "../rustc_errors" }
1919
rustc_feature = { path = "../rustc_feature" }

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use std::cell::LazyCell;
22
use std::ops::ControlFlow;
33

44
use rustc_abi::FieldIdx;
5-
use rustc_attr_parsing::AttributeKind;
6-
use rustc_attr_parsing::ReprAttr::ReprPacked;
5+
use rustc_attr_data_structures::ReprAttr::ReprPacked;
76
use rustc_data_structures::unord::{UnordMap, UnordSet};
87
use rustc_errors::MultiSpan;
98
use rustc_errors::codes::*;
@@ -31,7 +30,7 @@ use rustc_trait_selection::traits;
3130
use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
3231
use tracing::{debug, instrument};
3332
use ty::TypingMode;
34-
use {rustc_attr_parsing as attr, rustc_hir as hir};
33+
use {rustc_attr_data_structures as attrs, rustc_hir as hir};
3534

3635
use super::compare_impl_item::check_type_bounds;
3736
use super::*;
@@ -1154,7 +1153,7 @@ pub(super) fn check_packed(tcx: TyCtxt<'_>, sp: Span, def: ty::AdtDef<'_>) {
11541153
let repr = def.repr();
11551154
if repr.packed() {
11561155
if let Some(reprs) =
1157-
attr::find_attr!(tcx.get_all_attrs(def.did()), AttributeKind::Repr(r) => r)
1156+
attrs::find_attr!(tcx.get_all_attrs(def.did()), attrs::AttributeKind::Repr(r) => r)
11581157
{
11591158
for (r, _) in reprs {
11601159
if let ReprPacked(pack) = r
@@ -1371,9 +1370,9 @@ fn check_enum(tcx: TyCtxt<'_>, def_id: LocalDefId) {
13711370
def.destructor(tcx); // force the destructor to be evaluated
13721371

13731372
if def.variants().is_empty() {
1374-
attr::find_attr!(
1373+
attrs::find_attr!(
13751374
tcx.get_all_attrs(def_id),
1376-
AttributeKind::Repr(rs) => {
1375+
attrs::AttributeKind::Repr(rs) => {
13771376
struct_span_code_err!(
13781377
tcx.dcx(),
13791378
rs.first().unwrap().1,

compiler/rustc_hir_typeck/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2024"
88
itertools = "0.12"
99
rustc_abi = { path = "../rustc_abi" }
1010
rustc_ast = { path = "../rustc_ast" }
11-
rustc_attr_parsing = { path = "../rustc_attr_parsing" }
11+
rustc_attr_data_structures = { path = "../rustc_attr_data_structures" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_errors = { path = "../rustc_errors" }
1414
rustc_fluent_macro = { path = "../rustc_fluent_macro" }

0 commit comments

Comments
 (0)