Skip to content

Commit 67ba6a6

Browse files
authored
Merge pull request #2244 from rust-lang/rustc-pull
Rustc pull update
2 parents cf15b33 + 81f21f0 commit 67ba6a6

File tree

1,646 files changed

+27731
-15066
lines changed

Some content is hidden

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

1,646 files changed

+27731
-15066
lines changed

Diff for: .github/workflows/ci.yml

-19
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ jobs:
6262
name: ${{ matrix.full_name }}
6363
needs: [ calculate_matrix ]
6464
runs-on: "${{ matrix.os }}"
65-
defaults:
66-
run:
67-
shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash' }}
6865
timeout-minutes: 360
6966
env:
7067
CI_JOB_NAME: ${{ matrix.name }}
@@ -80,22 +77,6 @@ jobs:
8077
# Check the `calculate_matrix` job to see how is the matrix defined.
8178
include: ${{ fromJSON(needs.calculate_matrix.outputs.jobs) }}
8279
steps:
83-
- if: contains(matrix.os, 'windows')
84-
uses: msys2/[email protected]
85-
with:
86-
# i686 jobs use mingw32. x86_64 and cross-compile jobs use mingw64.
87-
msystem: ${{ contains(matrix.name, 'i686') && 'mingw32' || 'mingw64' }}
88-
# don't try to download updates for already installed packages
89-
update: false
90-
# don't try to use the msys that comes built-in to the github runner,
91-
# so we can control what is installed (i.e. not python)
92-
release: true
93-
# Inherit the full path from the Windows environment, with MSYS2's */bin/
94-
# dirs placed in front. This lets us run Windows-native Python etc.
95-
path-type: inherit
96-
install: >
97-
make
98-
9980
- name: disable git crlf conversion
10081
run: git config --global core.autocrlf false
10182

Diff for: Cargo.lock

+21-9
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ name = "anyhow"
186186
version = "1.0.95"
187187
source = "registry+https://github.com/rust-lang/crates.io-index"
188188
checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04"
189+
dependencies = [
190+
"backtrace",
191+
]
189192

190193
[[package]]
191194
name = "ar_archive_writer"
@@ -1095,9 +1098,9 @@ dependencies = [
10951098

10961099
[[package]]
10971100
name = "elsa"
1098-
version = "1.7.1"
1101+
version = "1.11.0"
10991102
source = "registry+https://github.com/rust-lang/crates.io-index"
1100-
checksum = "848fe615fbb0a74d9ae68dcaa510106d32e37d9416207bbea4bd008bd89c47ed"
1103+
checksum = "2343daaeabe09879d4ea058bb4f1e63da3fc07dadc6634e01bda1b3d6a9d9d2b"
11011104
dependencies = [
11021105
"stable_deref_trait",
11031106
]
@@ -1195,6 +1198,17 @@ version = "2.3.0"
11951198
source = "registry+https://github.com/rust-lang/crates.io-index"
11961199
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
11971200

1201+
[[package]]
1202+
name = "features-status-dump"
1203+
version = "0.1.0"
1204+
dependencies = [
1205+
"anyhow",
1206+
"clap",
1207+
"serde",
1208+
"serde_json",
1209+
"tidy",
1210+
]
1211+
11981212
[[package]]
11991213
name = "field-offset"
12001214
version = "0.3.6"
@@ -3273,13 +3287,6 @@ dependencies = [
32733287
"tikv-jemalloc-sys",
32743288
]
32753289

3276-
[[package]]
3277-
name = "rustc-perf-wrapper"
3278-
version = "0.1.0"
3279-
dependencies = [
3280-
"clap",
3281-
]
3282-
32833290
[[package]]
32843291
name = "rustc-rayon"
32853292
version = "0.5.1"
@@ -3386,6 +3393,7 @@ dependencies = [
33863393
name = "rustc_ast_lowering"
33873394
version = "0.0.0"
33883395
dependencies = [
3396+
"rustc_abi",
33893397
"rustc_ast",
33903398
"rustc_ast_pretty",
33913399
"rustc_data_structures",
@@ -3408,6 +3416,7 @@ name = "rustc_ast_passes"
34083416
version = "0.0.0"
34093417
dependencies = [
34103418
"itertools",
3419+
"rustc_abi",
34113420
"rustc_ast",
34123421
"rustc_ast_pretty",
34133422
"rustc_attr_parsing",
@@ -4001,6 +4010,7 @@ version = "0.0.0"
40014010
dependencies = [
40024011
"rustc-rayon",
40034012
"rustc-rayon-core",
4013+
"rustc_abi",
40044014
"rustc_ast",
40054015
"rustc_ast_lowering",
40064016
"rustc_ast_passes",
@@ -4050,6 +4060,7 @@ name = "rustc_lexer"
40504060
version = "0.0.0"
40514061
dependencies = [
40524062
"expect-test",
4063+
"memchr",
40534064
"unicode-properties",
40544065
"unicode-xid",
40554066
]
@@ -5418,6 +5429,7 @@ dependencies = [
54185429
"regex",
54195430
"rustc-hash 2.1.0",
54205431
"semver",
5432+
"serde",
54215433
"similar",
54225434
"termcolor",
54235435
"walkdir",

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ members = [
4545
"src/tools/rustdoc-gui-test",
4646
"src/tools/opt-dist",
4747
"src/tools/coverage-dump",
48-
"src/tools/rustc-perf-wrapper",
4948
"src/tools/wasm-component-ld",
49+
"src/tools/features-status-dump",
5050
]
5151

5252
exclude = [

Diff for: compiler/rustc_abi/src/callconv.rs

+7-70
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,10 @@
1-
mod abi {
2-
pub(crate) use crate::Primitive::*;
3-
pub(crate) use crate::Variants;
4-
}
5-
6-
#[cfg(feature = "nightly")]
7-
use rustc_macros::HashStable_Generic;
8-
9-
use crate::{Align, HasDataLayout, Size};
101
#[cfg(feature = "nightly")]
112
use crate::{BackendRepr, FieldsShape, TyAbiInterface, TyAndLayout};
3+
use crate::{Primitive, Size, Variants};
124

13-
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
14-
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
15-
pub enum RegKind {
16-
Integer,
17-
Float,
18-
Vector,
19-
}
20-
21-
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
22-
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
23-
pub struct Reg {
24-
pub kind: RegKind,
25-
pub size: Size,
26-
}
27-
28-
macro_rules! reg_ctor {
29-
($name:ident, $kind:ident, $bits:expr) => {
30-
pub fn $name() -> Reg {
31-
Reg { kind: RegKind::$kind, size: Size::from_bits($bits) }
32-
}
33-
};
34-
}
35-
36-
impl Reg {
37-
reg_ctor!(i8, Integer, 8);
38-
reg_ctor!(i16, Integer, 16);
39-
reg_ctor!(i32, Integer, 32);
40-
reg_ctor!(i64, Integer, 64);
41-
reg_ctor!(i128, Integer, 128);
42-
43-
reg_ctor!(f32, Float, 32);
44-
reg_ctor!(f64, Float, 64);
45-
}
5+
mod reg;
466

47-
impl Reg {
48-
pub fn align<C: HasDataLayout>(&self, cx: &C) -> Align {
49-
let dl = cx.data_layout();
50-
match self.kind {
51-
RegKind::Integer => match self.size.bits() {
52-
1 => dl.i1_align.abi,
53-
2..=8 => dl.i8_align.abi,
54-
9..=16 => dl.i16_align.abi,
55-
17..=32 => dl.i32_align.abi,
56-
33..=64 => dl.i64_align.abi,
57-
65..=128 => dl.i128_align.abi,
58-
_ => panic!("unsupported integer: {self:?}"),
59-
},
60-
RegKind::Float => match self.size.bits() {
61-
16 => dl.f16_align.abi,
62-
32 => dl.f32_align.abi,
63-
64 => dl.f64_align.abi,
64-
128 => dl.f128_align.abi,
65-
_ => panic!("unsupported float: {self:?}"),
66-
},
67-
RegKind::Vector => dl.vector_align(self.size).abi,
68-
}
69-
}
70-
}
7+
pub use reg::{Reg, RegKind};
718

729
/// Return value from the `homogeneous_aggregate` test function.
7310
#[derive(Copy, Clone, Debug)]
@@ -134,8 +71,8 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
13471
// The primitive for this algorithm.
13572
BackendRepr::Scalar(scalar) => {
13673
let kind = match scalar.primitive() {
137-
abi::Int(..) | abi::Pointer(_) => RegKind::Integer,
138-
abi::Float(_) => RegKind::Float,
74+
Primitive::Int(..) | Primitive::Pointer(_) => RegKind::Integer,
75+
Primitive::Float(_) => RegKind::Float,
13976
};
14077
Ok(HomogeneousAggregate::Homogeneous(Reg { kind, size: self.size }))
14178
}
@@ -206,8 +143,8 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
206143
let (mut result, mut total) = from_fields_at(*self, Size::ZERO)?;
207144

208145
match &self.variants {
209-
abi::Variants::Single { .. } | abi::Variants::Empty => {}
210-
abi::Variants::Multiple { variants, .. } => {
146+
Variants::Single { .. } | Variants::Empty => {}
147+
Variants::Multiple { variants, .. } => {
211148
// Treat enum variants like union members.
212149
// HACK(eddyb) pretend the `enum` field (discriminant)
213150
// is at the start of every variant (otherwise the gap

Diff for: compiler/rustc_abi/src/callconv/reg.rs

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#[cfg(feature = "nightly")]
2+
use rustc_macros::HashStable_Generic;
3+
4+
use crate::{Align, HasDataLayout, Size};
5+
6+
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
7+
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
8+
pub enum RegKind {
9+
Integer,
10+
Float,
11+
Vector,
12+
}
13+
14+
#[cfg_attr(feature = "nightly", derive(HashStable_Generic))]
15+
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
16+
pub struct Reg {
17+
pub kind: RegKind,
18+
pub size: Size,
19+
}
20+
21+
macro_rules! reg_ctor {
22+
($name:ident, $kind:ident, $bits:expr) => {
23+
pub fn $name() -> Reg {
24+
Reg { kind: RegKind::$kind, size: Size::from_bits($bits) }
25+
}
26+
};
27+
}
28+
29+
impl Reg {
30+
reg_ctor!(i8, Integer, 8);
31+
reg_ctor!(i16, Integer, 16);
32+
reg_ctor!(i32, Integer, 32);
33+
reg_ctor!(i64, Integer, 64);
34+
reg_ctor!(i128, Integer, 128);
35+
36+
reg_ctor!(f32, Float, 32);
37+
reg_ctor!(f64, Float, 64);
38+
}
39+
40+
impl Reg {
41+
pub fn align<C: HasDataLayout>(&self, cx: &C) -> Align {
42+
let dl = cx.data_layout();
43+
match self.kind {
44+
RegKind::Integer => match self.size.bits() {
45+
1 => dl.i1_align.abi,
46+
2..=8 => dl.i8_align.abi,
47+
9..=16 => dl.i16_align.abi,
48+
17..=32 => dl.i32_align.abi,
49+
33..=64 => dl.i64_align.abi,
50+
65..=128 => dl.i128_align.abi,
51+
_ => panic!("unsupported integer: {self:?}"),
52+
},
53+
RegKind::Float => match self.size.bits() {
54+
16 => dl.f16_align.abi,
55+
32 => dl.f32_align.abi,
56+
64 => dl.f64_align.abi,
57+
128 => dl.f128_align.abi,
58+
_ => panic!("unsupported float: {self:?}"),
59+
},
60+
RegKind::Vector => dl.vector_align(self.size).abi,
61+
}
62+
}
63+
}
File renamed without changes.

Diff for: compiler/rustc_abi/src/layout/ty.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
use std::fmt;
22
use std::ops::Deref;
33

4-
use Float::*;
5-
use Primitive::*;
64
use rustc_data_structures::intern::Interned;
75
use rustc_macros::HashStable_Generic;
86

7+
use crate::{
8+
AbiAndPrefAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche,
9+
PointeeInfo, Primitive, Scalar, Size, TargetDataLayout, Variants,
10+
};
11+
912
// Explicitly import `Float` to avoid ambiguity with `Primitive::Float`.
10-
use crate::{Float, *};
1113

1214
rustc_index::newtype_index! {
1315
/// The *source-order* index of a field in a variant.
@@ -197,7 +199,9 @@ impl<'a, Ty> TyAndLayout<'a, Ty> {
197199
C: HasDataLayout,
198200
{
199201
match self.backend_repr {
200-
BackendRepr::Scalar(scalar) => matches!(scalar.primitive(), Float(F32 | F64)),
202+
BackendRepr::Scalar(scalar) => {
203+
matches!(scalar.primitive(), Primitive::Float(Float::F32 | Float::F64))
204+
}
201205
BackendRepr::Memory { .. } => {
202206
if self.fields.count() == 1 && self.fields.offset(0).bytes() == 0 {
203207
self.field(cx, 0).is_single_fp_element(cx)

Diff for: compiler/rustc_abi/src/lib.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -1184,10 +1184,13 @@ impl Scalar {
11841184
#[inline]
11851185
pub fn is_bool(&self) -> bool {
11861186
use Integer::*;
1187-
matches!(self, Scalar::Initialized {
1188-
value: Primitive::Int(I8, false),
1189-
valid_range: WrappingRange { start: 0, end: 1 }
1190-
})
1187+
matches!(
1188+
self,
1189+
Scalar::Initialized {
1190+
value: Primitive::Int(I8, false),
1191+
valid_range: WrappingRange { start: 0, end: 1 }
1192+
}
1193+
)
11911194
}
11921195

11931196
/// Get the primitive representation of this type, ignoring the valid range and whether the

0 commit comments

Comments
 (0)