Skip to content

Commit adcb3d3

Browse files
committed
Auto merge of #144740 - jdonszelmann:rollup-nprgqnm, r=jdonszelmann
Rollup of 6 pull requests Successful merges: - #144688 (Uniform `enter_trace_span!` and add documentation) - #144702 (stall `ConstArgHasType` in `compute_goal_fast_path`) - #144711 (Consider operator's span when computing binop expr span) - #144712 (Deduplicate `IntTy`/`UintTy`/`FloatTy`.) - #144726 (merge rustc_attr_data_structures into rustc_hir) - #144733 (fix: Match width of ascii and unicode secondary file start) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3fb1b53 + e2ae91b commit adcb3d3

File tree

221 files changed

+796
-921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+796
-921
lines changed

Cargo.lock

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3417,6 +3417,7 @@ dependencies = [
34173417
"rustc_data_structures",
34183418
"rustc_macros",
34193419
"rustc_serialize",
3420+
"rustc_span",
34203421
]
34213422

34223423
[[package]]
@@ -3426,7 +3427,6 @@ dependencies = [
34263427
"rustc_abi",
34273428
"rustc_ast",
34283429
"rustc_ast_pretty",
3429-
"rustc_attr_data_structures",
34303430
"rustc_attr_parsing",
34313431
"rustc_data_structures",
34323432
"rustc_errors",
@@ -3476,28 +3476,13 @@ dependencies = [
34763476
"thin-vec",
34773477
]
34783478

3479-
[[package]]
3480-
name = "rustc_attr_data_structures"
3481-
version = "0.0.0"
3482-
dependencies = [
3483-
"rustc_abi",
3484-
"rustc_ast",
3485-
"rustc_ast_pretty",
3486-
"rustc_data_structures",
3487-
"rustc_macros",
3488-
"rustc_serialize",
3489-
"rustc_span",
3490-
"thin-vec",
3491-
]
3492-
34933479
[[package]]
34943480
name = "rustc_attr_parsing"
34953481
version = "0.0.0"
34963482
dependencies = [
34973483
"rustc_abi",
34983484
"rustc_ast",
34993485
"rustc_ast_pretty",
3500-
"rustc_attr_data_structures",
35013486
"rustc_errors",
35023487
"rustc_feature",
35033488
"rustc_fluent_macro",
@@ -3553,7 +3538,6 @@ version = "0.0.0"
35533538
dependencies = [
35543539
"rustc_ast",
35553540
"rustc_ast_pretty",
3556-
"rustc_attr_data_structures",
35573541
"rustc_attr_parsing",
35583542
"rustc_data_structures",
35593543
"rustc_errors",
@@ -3589,7 +3573,6 @@ dependencies = [
35893573
"rustc-demangle",
35903574
"rustc_abi",
35913575
"rustc_ast",
3592-
"rustc_attr_data_structures",
35933576
"rustc_codegen_ssa",
35943577
"rustc_data_structures",
35953578
"rustc_errors",
@@ -3630,7 +3613,6 @@ dependencies = [
36303613
"rustc_abi",
36313614
"rustc_arena",
36323615
"rustc_ast",
3633-
"rustc_attr_data_structures",
36343616
"rustc_attr_parsing",
36353617
"rustc_data_structures",
36363618
"rustc_errors",
@@ -3668,7 +3650,6 @@ dependencies = [
36683650
"rustc_abi",
36693651
"rustc_apfloat",
36703652
"rustc_ast",
3671-
"rustc_attr_data_structures",
36723653
"rustc_data_structures",
36733654
"rustc_errors",
36743655
"rustc_fluent_macro",
@@ -3814,7 +3795,6 @@ dependencies = [
38143795
"rustc_abi",
38153796
"rustc_ast",
38163797
"rustc_ast_pretty",
3817-
"rustc_attr_data_structures",
38183798
"rustc_data_structures",
38193799
"rustc_error_codes",
38203800
"rustc_error_messages",
@@ -3844,7 +3824,6 @@ dependencies = [
38443824
"rustc_ast",
38453825
"rustc_ast_passes",
38463826
"rustc_ast_pretty",
3847-
"rustc_attr_data_structures",
38483827
"rustc_attr_parsing",
38493828
"rustc_data_structures",
38503829
"rustc_errors",
@@ -3868,8 +3847,8 @@ dependencies = [
38683847
name = "rustc_feature"
38693848
version = "0.0.0"
38703849
dependencies = [
3871-
"rustc_attr_data_structures",
38723850
"rustc_data_structures",
3851+
"rustc_hir",
38733852
"rustc_span",
38743853
"serde",
38753854
"serde_json",
@@ -3914,7 +3893,7 @@ dependencies = [
39143893
"rustc_abi",
39153894
"rustc_arena",
39163895
"rustc_ast",
3917-
"rustc_attr_data_structures",
3896+
"rustc_ast_pretty",
39183897
"rustc_data_structures",
39193898
"rustc_hashes",
39203899
"rustc_index",
@@ -3935,7 +3914,6 @@ dependencies = [
39353914
"rustc_abi",
39363915
"rustc_arena",
39373916
"rustc_ast",
3938-
"rustc_attr_data_structures",
39393917
"rustc_attr_parsing",
39403918
"rustc_data_structures",
39413919
"rustc_errors",
@@ -3962,7 +3940,6 @@ dependencies = [
39623940
"rustc_abi",
39633941
"rustc_ast",
39643942
"rustc_ast_pretty",
3965-
"rustc_attr_data_structures",
39663943
"rustc_hir",
39673944
"rustc_span",
39683945
]
@@ -3974,7 +3951,6 @@ dependencies = [
39743951
"itertools",
39753952
"rustc_abi",
39763953
"rustc_ast",
3977-
"rustc_attr_data_structures",
39783954
"rustc_attr_parsing",
39793955
"rustc_data_structures",
39803956
"rustc_errors",
@@ -4120,7 +4096,6 @@ dependencies = [
41204096
"rustc_abi",
41214097
"rustc_ast",
41224098
"rustc_ast_pretty",
4123-
"rustc_attr_data_structures",
41244099
"rustc_attr_parsing",
41254100
"rustc_data_structures",
41264101
"rustc_errors",
@@ -4194,7 +4169,6 @@ dependencies = [
41944169
"odht",
41954170
"rustc_abi",
41964171
"rustc_ast",
4197-
"rustc_attr_data_structures",
41984172
"rustc_attr_parsing",
41994173
"rustc_data_structures",
42004174
"rustc_errors",
@@ -4230,7 +4204,6 @@ dependencies = [
42304204
"rustc_arena",
42314205
"rustc_ast",
42324206
"rustc_ast_ir",
4233-
"rustc_attr_data_structures",
42344207
"rustc_data_structures",
42354208
"rustc_error_messages",
42364209
"rustc_errors",
@@ -4264,7 +4237,6 @@ dependencies = [
42644237
"rustc_apfloat",
42654238
"rustc_arena",
42664239
"rustc_ast",
4267-
"rustc_attr_data_structures",
42684240
"rustc_data_structures",
42694241
"rustc_errors",
42704242
"rustc_fluent_macro",
@@ -4311,7 +4283,6 @@ dependencies = [
43114283
"rustc_abi",
43124284
"rustc_arena",
43134285
"rustc_ast",
4314-
"rustc_attr_data_structures",
43154286
"rustc_const_eval",
43164287
"rustc_data_structures",
43174288
"rustc_errors",
@@ -4337,7 +4308,6 @@ version = "0.0.0"
43374308
dependencies = [
43384309
"rustc_abi",
43394310
"rustc_ast",
4340-
"rustc_attr_data_structures",
43414311
"rustc_data_structures",
43424312
"rustc_errors",
43434313
"rustc_fluent_macro",
@@ -4408,7 +4378,6 @@ dependencies = [
44084378
"rustc_ast",
44094379
"rustc_ast_lowering",
44104380
"rustc_ast_pretty",
4411-
"rustc_attr_data_structures",
44124381
"rustc_attr_parsing",
44134382
"rustc_data_structures",
44144383
"rustc_errors",
@@ -4455,7 +4424,6 @@ name = "rustc_privacy"
44554424
version = "0.0.0"
44564425
dependencies = [
44574426
"rustc_ast",
4458-
"rustc_attr_data_structures",
44594427
"rustc_data_structures",
44604428
"rustc_errors",
44614429
"rustc_fluent_macro",
@@ -4530,7 +4498,6 @@ dependencies = [
45304498
"parking_lot",
45314499
"rustc_abi",
45324500
"rustc_ast",
4533-
"rustc_attr_data_structures",
45344501
"rustc_data_structures",
45354502
"rustc_errors",
45364503
"rustc_feature",
@@ -4557,7 +4524,6 @@ dependencies = [
45574524
"rustc_arena",
45584525
"rustc_ast",
45594526
"rustc_ast_pretty",
4560-
"rustc_attr_data_structures",
45614527
"rustc_attr_parsing",
45624528
"rustc_data_structures",
45634529
"rustc_errors",
@@ -4720,7 +4686,6 @@ dependencies = [
47204686
"itertools",
47214687
"rustc_abi",
47224688
"rustc_ast",
4723-
"rustc_attr_data_structures",
47244689
"rustc_data_structures",
47254690
"rustc_errors",
47264691
"rustc_fluent_macro",

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use std::{cmp, fmt};
2323

2424
pub use GenericArgs::*;
2525
pub use UnsafeSource::*;
26-
pub use rustc_ast_ir::{Movability, Mutability, Pinnedness};
26+
pub use rustc_ast_ir::{FloatTy, IntTy, Movability, Mutability, Pinnedness, UintTy};
2727
use rustc_data_structures::packed::Pu128;
2828
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
2929
use rustc_data_structures::stack::ensure_sufficient_stack;
@@ -2285,105 +2285,6 @@ pub struct FnSig {
22852285
pub span: Span,
22862286
}
22872287

2288-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
2289-
#[derive(Encodable, Decodable, HashStable_Generic)]
2290-
pub enum FloatTy {
2291-
F16,
2292-
F32,
2293-
F64,
2294-
F128,
2295-
}
2296-
2297-
impl FloatTy {
2298-
pub fn name_str(self) -> &'static str {
2299-
match self {
2300-
FloatTy::F16 => "f16",
2301-
FloatTy::F32 => "f32",
2302-
FloatTy::F64 => "f64",
2303-
FloatTy::F128 => "f128",
2304-
}
2305-
}
2306-
2307-
pub fn name(self) -> Symbol {
2308-
match self {
2309-
FloatTy::F16 => sym::f16,
2310-
FloatTy::F32 => sym::f32,
2311-
FloatTy::F64 => sym::f64,
2312-
FloatTy::F128 => sym::f128,
2313-
}
2314-
}
2315-
}
2316-
2317-
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
2318-
#[derive(Encodable, Decodable, HashStable_Generic)]
2319-
pub enum IntTy {
2320-
Isize,
2321-
I8,
2322-
I16,
2323-
I32,
2324-
I64,
2325-
I128,
2326-
}
2327-
2328-
impl IntTy {
2329-
pub fn name_str(&self) -> &'static str {
2330-
match *self {
2331-
IntTy::Isize => "isize",
2332-
IntTy::I8 => "i8",
2333-
IntTy::I16 => "i16",
2334-
IntTy::I32 => "i32",
2335-
IntTy::I64 => "i64",
2336-
IntTy::I128 => "i128",
2337-
}
2338-
}
2339-
2340-
pub fn name(&self) -> Symbol {
2341-
match *self {
2342-
IntTy::Isize => sym::isize,
2343-
IntTy::I8 => sym::i8,
2344-
IntTy::I16 => sym::i16,
2345-
IntTy::I32 => sym::i32,
2346-
IntTy::I64 => sym::i64,
2347-
IntTy::I128 => sym::i128,
2348-
}
2349-
}
2350-
}
2351-
2352-
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy, Debug)]
2353-
#[derive(Encodable, Decodable, HashStable_Generic)]
2354-
pub enum UintTy {
2355-
Usize,
2356-
U8,
2357-
U16,
2358-
U32,
2359-
U64,
2360-
U128,
2361-
}
2362-
2363-
impl UintTy {
2364-
pub fn name_str(&self) -> &'static str {
2365-
match *self {
2366-
UintTy::Usize => "usize",
2367-
UintTy::U8 => "u8",
2368-
UintTy::U16 => "u16",
2369-
UintTy::U32 => "u32",
2370-
UintTy::U64 => "u64",
2371-
UintTy::U128 => "u128",
2372-
}
2373-
}
2374-
2375-
pub fn name(&self) -> Symbol {
2376-
match *self {
2377-
UintTy::Usize => sym::usize,
2378-
UintTy::U8 => sym::u8,
2379-
UintTy::U16 => sym::u16,
2380-
UintTy::U32 => sym::u32,
2381-
UintTy::U64 => sym::u64,
2382-
UintTy::U128 => sym::u128,
2383-
}
2384-
}
2385-
}
2386-
23872288
/// A constraint on an associated item.
23882289
///
23892290
/// ### Examples

compiler/rustc_ast/src/util/literal.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,15 @@ impl fmt::Display for LitKind {
190190
LitKind::Int(n, ty) => {
191191
write!(f, "{n}")?;
192192
match ty {
193-
ast::LitIntType::Unsigned(ty) => write!(f, "{}", ty.name())?,
194-
ast::LitIntType::Signed(ty) => write!(f, "{}", ty.name())?,
193+
ast::LitIntType::Unsigned(ty) => write!(f, "{}", ty.name_str())?,
194+
ast::LitIntType::Signed(ty) => write!(f, "{}", ty.name_str())?,
195195
ast::LitIntType::Unsuffixed => {}
196196
}
197197
}
198198
LitKind::Float(symbol, ty) => {
199199
write!(f, "{symbol}")?;
200200
match ty {
201-
ast::LitFloatType::Suffixed(ty) => write!(f, "{}", ty.name())?,
201+
ast::LitFloatType::Suffixed(ty) => write!(f, "{}", ty.name_str())?,
202202
ast::LitFloatType::Unsuffixed => {}
203203
}
204204
}

compiler/rustc_ast_ir/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@ edition = "2024"
88
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
99
rustc_macros = { path = "../rustc_macros", optional = true }
1010
rustc_serialize = { path = "../rustc_serialize", optional = true }
11+
rustc_span = { path = "../rustc_span", optional = true }
1112
# tidy-alphabetical-end
1213

1314
[features]
15+
# tidy-alphabetical-start
1416
default = ["nightly"]
1517
nightly = [
16-
"dep:rustc_serialize",
1718
"dep:rustc_data_structures",
1819
"dep:rustc_macros",
20+
"dep:rustc_serialize",
21+
"dep:rustc_span",
1922
]
23+
# tidy-alphabetical-end

0 commit comments

Comments
 (0)