Skip to content

Commit f22fd36

Browse files
authored
Merge pull request rust-lang#4184 from rust-lang/rustup-2025-02-08
Automatic Rustup
2 parents 66c54d9 + 510e844 commit f22fd36

File tree

198 files changed

+1802
-1250
lines changed

Some content is hidden

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

198 files changed

+1802
-1250
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 19 deletions
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

compiler/rustc_abi/src/callconv.rs

Lines changed: 7 additions & 70 deletions
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
Lines changed: 63 additions & 0 deletions
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+
}

compiler/rustc_abi/src/layout/ty.rs

Lines changed: 8 additions & 4 deletions
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)

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,6 @@ pub enum LLVMRustResult {
6969
Failure,
7070
}
7171

72-
/// Translation of LLVM's MachineTypes enum, defined in llvm\include\llvm\BinaryFormat\COFF.h.
73-
///
74-
/// We include only architectures supported on Windows.
75-
#[derive(Copy, Clone, PartialEq)]
76-
#[repr(C)]
77-
pub enum LLVMMachineType {
78-
AMD64 = 0x8664,
79-
I386 = 0x14c,
80-
ARM64 = 0xaa64,
81-
ARM64EC = 0xa641,
82-
ARM = 0x01c0,
83-
}
84-
8572
/// Must match the layout of `LLVMRustModuleFlagMergeBehavior`.
8673
///
8774
/// When merging modules (e.g. during LTO), their metadata flags are combined. Conflicts are
@@ -645,16 +632,6 @@ pub enum ThreadLocalMode {
645632
LocalExec,
646633
}
647634

648-
/// LLVMRustTailCallKind
649-
#[derive(Copy, Clone)]
650-
#[repr(C)]
651-
pub enum TailCallKind {
652-
None,
653-
Tail,
654-
MustTail,
655-
NoTail,
656-
}
657-
658635
/// LLVMRustChecksumKind
659636
#[derive(Copy, Clone)]
660637
#[repr(C)]
@@ -773,7 +750,6 @@ pub struct Builder<'a>(InvariantOpaque<'a>);
773750
#[repr(C)]
774751
pub struct PassManager<'a>(InvariantOpaque<'a>);
775752
unsafe extern "C" {
776-
pub type Pass;
777753
pub type TargetMachine;
778754
pub type Archive;
779755
}
@@ -799,7 +775,6 @@ unsafe extern "C" {
799775
}
800776

801777
pub type DiagnosticHandlerTy = unsafe extern "C" fn(&DiagnosticInfo, *mut c_void);
802-
pub type InlineAsmDiagHandlerTy = unsafe extern "C" fn(&SMDiagnostic, *const c_void, c_uint);
803778

804779
pub mod debuginfo {
805780
use std::ptr;
@@ -853,7 +828,6 @@ pub mod debuginfo {
853828
pub type DIFile = DIScope;
854829
pub type DILexicalBlock = DIScope;
855830
pub type DISubprogram = DIScope;
856-
pub type DINameSpace = DIScope;
857831
pub type DIType = DIDescriptor;
858832
pub type DIBasicType = DIType;
859833
pub type DIDerivedType = DIType;
@@ -1809,7 +1783,6 @@ unsafe extern "C" {
18091783
Name: *const c_char,
18101784
NameLen: size_t,
18111785
) -> Option<&Value>;
1812-
pub fn LLVMRustSetTailCallKind(CallInst: &Value, TKC: TailCallKind);
18131786

18141787
// Operations on attributes
18151788
pub fn LLVMRustCreateAttrNoValue(C: &Context, attr: AttributeKind) -> &Attribute;
@@ -2586,8 +2559,6 @@ unsafe extern "C" {
25862559

25872560
pub fn LLVMRustGetElementTypeArgIndex(CallSite: &Value) -> i32;
25882561

2589-
pub fn LLVMRustIsBitcode(ptr: *const u8, len: usize) -> bool;
2590-
25912562
pub fn LLVMRustLLVMHasZlibCompressionForDebugSymbols() -> bool;
25922563

25932564
pub fn LLVMRustLLVMHasZstdCompressionForDebugSymbols() -> bool;

compiler/rustc_feature/src/accepted.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ macro_rules! declare_features {
99
$(#[doc = $doc:tt])* (accepted, $feature:ident, $ver:expr, $issue:expr),
1010
)+) => {
1111
/// Formerly unstable features that have now been accepted (stabilized).
12-
pub const ACCEPTED_LANG_FEATURES: &[Feature] = &[
12+
pub static ACCEPTED_LANG_FEATURES: &[Feature] = &[
1313
$(Feature {
1414
name: sym::$feature,
1515
since: $ver,
@@ -400,6 +400,9 @@ declare_features! (
400400
/// Allows `#[track_caller]` to be used which provides
401401
/// accurate caller location reporting during panic (RFC 2091).
402402
(accepted, track_caller, "1.46.0", Some(47809)),
403+
/// Allows dyn upcasting trait objects via supertraits.
404+
/// Dyn upcasting is casting, e.g., `dyn Foo -> dyn Bar` where `Foo: Bar`.
405+
(accepted, trait_upcasting, "CURRENT_RUSTC_VERSION", Some(65991)),
403406
/// Allows #[repr(transparent)] on univariant enums (RFC 2645).
404407
(accepted, transparent_enums, "1.42.0", Some(60405)),
405408
/// Allows indexing tuples.

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ pub struct BuiltinAttribute {
318318

319319
/// Attributes that have a special meaning to rustc or rustdoc.
320320
#[rustfmt::skip]
321-
pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
321+
pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
322322
// ==========================================================================
323323
// Stable attributes:
324324
// ==========================================================================

compiler/rustc_feature/src/removed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ macro_rules! declare_features {
1414
$(#[doc = $doc:tt])* (removed, $feature:ident, $ver:expr, $issue:expr, $reason:expr),
1515
)+) => {
1616
/// Formerly unstable features that have now been removed.
17-
pub const REMOVED_LANG_FEATURES: &[RemovedFeature] = &[
17+
pub static REMOVED_LANG_FEATURES: &[RemovedFeature] = &[
1818
$(RemovedFeature {
1919
feature: Feature {
2020
name: sym::$feature,

compiler/rustc_feature/src/unstable.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ macro_rules! declare_features {
104104
)+) => {
105105
/// Unstable language features that are being implemented or being
106106
/// considered for acceptance (stabilization) or removal.
107-
pub const UNSTABLE_LANG_FEATURES: &[Feature] = &[
107+
pub static UNSTABLE_LANG_FEATURES: &[Feature] = &[
108108
$(Feature {
109109
name: sym::$feature,
110110
since: $ver,
@@ -636,9 +636,6 @@ declare_features! (
636636
(unstable, thread_local, "1.0.0", Some(29594)),
637637
/// Allows defining `trait X = A + B;` alias items.
638638
(unstable, trait_alias, "1.24.0", Some(41517)),
639-
/// Allows dyn upcasting trait objects via supertraits.
640-
/// Dyn upcasting is casting, e.g., `dyn Foo -> dyn Bar` where `Foo: Bar`.
641-
(unstable, trait_upcasting, "1.56.0", Some(65991)),
642639
/// Allows for transmuting between arrays with sizes that contain generic consts.
643640
(unstable, transmute_generic_consts, "1.70.0", Some(109929)),
644641
/// Allows #[repr(transparent)] on unions (RFC 2645).

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,10 @@ pub fn expr_to_string(ann: &dyn PpAnn, pat: &hir::Expr<'_>) -> String {
325325
to_string(ann, |s| s.print_expr(pat))
326326
}
327327

328+
pub fn item_to_string(ann: &dyn PpAnn, pat: &hir::Item<'_>) -> String {
329+
to_string(ann, |s| s.print_item(pat))
330+
}
331+
328332
impl<'a> State<'a> {
329333
fn bclose_maybe_open(&mut self, span: rustc_span::Span, close_box: bool) {
330334
self.maybe_print_comment(span.hi());

0 commit comments

Comments
 (0)