Skip to content

Commit 0274a30

Browse files
authored
Merge branch 'main' into merge-strict-provenance-lints
2 parents 6e531ef + a1e52fc commit 0274a30

2,841 files changed

Lines changed: 54079 additions & 26554 deletions

File tree

Some content is hidden

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

.github/workflows/dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ jobs:
9494
uses: actions/checkout@v5
9595

9696
- name: download Cargo.lock from update job
97-
uses: actions/download-artifact@v4
97+
uses: actions/download-artifact@v8
9898
with:
9999
name: Cargo-lock
100100
- name: download cargo-update log from update job
101-
uses: actions/download-artifact@v4
101+
uses: actions/download-artifact@v8
102102
with:
103103
name: cargo-updates
104104

Cargo.lock

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ dependencies = [
6464

6565
[[package]]
6666
name = "annotate-snippets"
67-
version = "0.12.15"
67+
version = "0.12.16"
6868
source = "registry+https://github.com/rust-lang/crates.io-index"
69-
checksum = "92570a3f9c98e7e84df84b71d0965ac99b1871fcd75a3773a3bd1bad13f64cf7"
69+
checksum = "f211a51805bc641f3ad5b7664c77d2547af685cc33b4cd8d31964027a46f13f1"
7070
dependencies = [
7171
"anstyle",
7272
"memchr",
@@ -153,9 +153,9 @@ checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61"
153153

154154
[[package]]
155155
name = "ar_archive_writer"
156-
version = "0.5.1"
156+
version = "0.5.2"
157157
source = "registry+https://github.com/rust-lang/crates.io-index"
158-
checksum = "7eb93bbb63b9c227414f6eb3a0adfddca591a8ce1e9b60661bb08969b87e340b"
158+
checksum = "4087686b4b0a3427190bae57a1d9a478dbb2d40c5dc1bd6e2b6d797913bdd348"
159159
dependencies = [
160160
"object 0.37.3",
161161
]
@@ -3958,7 +3958,7 @@ dependencies = [
39583958
name = "rustc_errors"
39593959
version = "0.0.0"
39603960
dependencies = [
3961-
"annotate-snippets 0.12.15",
3961+
"annotate-snippets 0.12.16",
39623962
"anstream",
39633963
"anstyle",
39643964
"derive_setters",
@@ -4010,9 +4010,7 @@ dependencies = [
40104010
name = "rustc_feature"
40114011
version = "0.0.0"
40124012
dependencies = [
4013-
"rustc_ast",
40144013
"rustc_data_structures",
4015-
"rustc_hir",
40164014
"rustc_span",
40174015
"serde",
40184016
"serde_json",
@@ -5950,15 +5948,15 @@ checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
59505948

59515949
[[package]]
59525950
name = "ui_test"
5953-
version = "0.30.5"
5951+
version = "0.30.7"
59545952
source = "registry+https://github.com/rust-lang/crates.io-index"
5955-
checksum = "980133b75aa9a95dc94feaf629d92d22c1172186f1fa1266b91f5b91414cf9a5"
5953+
checksum = "8c8811281d587a786747c0c49245925016c07767bc996305bdd34d5ce076786a"
59565954
dependencies = [
59575955
"annotate-snippets 0.11.5",
59585956
"anyhow",
59595957
"bstr",
5960-
"cargo-platform 0.1.9",
5961-
"cargo_metadata 0.18.1",
5958+
"cargo-platform 0.3.1",
5959+
"cargo_metadata 0.23.1",
59625960
"color-eyre",
59635961
"colored",
59645962
"comma",
@@ -6070,6 +6068,7 @@ checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
60706068
name = "unicode-table-generator"
60716069
version = "0.1.0"
60726070
dependencies = [
6071+
"rustc-hash 2.1.1",
60736072
"ucd-parse",
60746073
]
60756074

RELEASES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Compatibility Notes
7777
- [For `export_name`, `link_name`, and `link_section` attributes, if multiple of the same attribute is present, the first one now takes precedence.](https://github.com/rust-lang/rust/pull/153041)
7878
- [Update the minimum external LLVM to 21](https://github.com/rust-lang/rust/pull/153684)
7979
- On `avr` targets, C's `double` type is 32-bit by default, so [change `c_double` to `f32` on `avr` targets to match](https://github.com/rust-lang/rust/pull/154647). This is a breaking change, but necessary to make `c_double` match C's double.
80+
- [`BTreeMap::append()` was optimized, which may now cause panics for types with incorrect `Ord` impls](https://github.com/rust-lang/rust/pull/153107)
8081

8182
<a id="1.96.0-Internal-Changes"></a>
8283

compiler/rustc_abi/src/canon_abi.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ pub enum CanonAbi {
2828
Rust,
2929
RustCold,
3030
RustPreserveNone,
31+
RustTail,
3132

3233
/// An ABI that rustc does not know how to call or define.
3334
Custom,
@@ -59,7 +60,10 @@ pub enum CanonAbi {
5960
impl CanonAbi {
6061
pub fn is_rustic_abi(self) -> bool {
6162
match self {
62-
CanonAbi::Rust | CanonAbi::RustCold | CanonAbi::RustPreserveNone => true,
63+
CanonAbi::Rust
64+
| CanonAbi::RustCold
65+
| CanonAbi::RustPreserveNone
66+
| CanonAbi::RustTail => true,
6367
CanonAbi::C
6468
| CanonAbi::Custom
6569
| CanonAbi::Swift
@@ -81,6 +85,7 @@ impl fmt::Display for CanonAbi {
8185
CanonAbi::Rust => ExternAbi::Rust,
8286
CanonAbi::RustCold => ExternAbi::RustCold,
8387
CanonAbi::RustPreserveNone => ExternAbi::RustPreserveNone,
88+
CanonAbi::RustTail => ExternAbi::RustTail,
8489
CanonAbi::Custom => ExternAbi::Custom,
8590
CanonAbi::Swift => ExternAbi::Swift,
8691
CanonAbi::Arm(arm_call) => match arm_call {

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ pub enum ExternAbi {
4949
/// forcing callers to save all registers.
5050
RustPreserveNone,
5151

52+
/// Ensures that calls in tail position can always be optimized into a jump.
53+
///
54+
/// This ABI is not stable, and relies on LLVM implementation details.
55+
RustTail,
56+
5257
/// Unstable impl detail that directly uses Rust types to describe the ABI to LLVM.
5358
/// Even normally-compatible Rust types can become ABI-incompatible with this ABI!
5459
Unadjusted,
@@ -205,6 +210,7 @@ abi_impls! {
205210
System { unwind: true } =><= "system-unwind",
206211
SysV64 { unwind: false } =><= "sysv64",
207212
SysV64 { unwind: true } =><= "sysv64-unwind",
213+
RustTail =><= "tail",
208214
Thiscall { unwind: false } =><= "thiscall",
209215
Thiscall { unwind: true } =><= "thiscall-unwind",
210216
Unadjusted =><= "unadjusted",
@@ -280,7 +286,7 @@ impl ExternAbi {
280286
/// - are subject to change between compiler versions
281287
pub fn is_rustic_abi(self) -> bool {
282288
use ExternAbi::*;
283-
matches!(self, Rust | RustCall | RustCold | RustPreserveNone)
289+
matches!(self, Rust | RustCall | RustCold | RustPreserveNone | RustTail)
284290
}
285291

286292
/// Returns whether the ABI supports C variadics. This only controls whether we allow *imports*
@@ -354,6 +360,7 @@ impl ExternAbi {
354360
| Self::SysV64 { .. }
355361
| Self::Win64 { .. }
356362
| Self::RustPreserveNone
363+
| Self::RustTail
357364
| Self::Swift => true,
358365
}
359366
}

compiler/rustc_ast/src/ast.rs

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ use rustc_data_structures::tagged_ptr::Tag;
3131
use rustc_macros::{Decodable, Encodable, StableHash, Walkable};
3232
pub use rustc_span::AttrId;
3333
use rustc_span::{
34-
ByteSymbol, DUMMY_SP, ErrorGuaranteed, Ident, Span, Spanned, Symbol, kw, respan, sym,
34+
ByteSymbol, DUMMY_SP, ErrorGuaranteed, Ident, LocalExpnId, Span, Spanned, Symbol, kw, respan,
35+
sym,
3536
};
3637
use thin_vec::{ThinVec, thin_vec};
3738

@@ -509,8 +510,6 @@ pub enum WherePredicateKind {
509510
BoundPredicate(WhereBoundPredicate),
510511
/// A lifetime predicate (e.g., `'a: 'b + 'c`).
511512
RegionPredicate(WhereRegionPredicate),
512-
/// An equality predicate (unsupported).
513-
EqPredicate(WhereEqPredicate),
514513
}
515514

516515
/// A type bound.
@@ -3053,9 +3052,30 @@ impl FnDecl {
30533052
pub fn has_self(&self) -> bool {
30543053
self.inputs.get(0).is_some_and(Param::is_self)
30553054
}
3055+
30563056
pub fn c_variadic(&self) -> bool {
30573057
self.inputs.last().is_some_and(|arg| matches!(arg.ty.kind, TyKind::CVarArgs))
30583058
}
3059+
3060+
/// The marker index for "no splatted arguments".
3061+
/// Must have the same value as `FnSigKind::NO_SPLATTED_ARG_INDEX` and `FnDeclFlags::NO_SPLATTED_ARG_INDEX`.
3062+
pub const NO_SPLATTED_ARG_INDEX: u16 = u16::MAX;
3063+
3064+
/// Returns a splatted argument index, if any are present.
3065+
pub fn splatted(&self) -> Option<u16> {
3066+
self.inputs.iter().enumerate().find_map(|(index, arg)| {
3067+
if index == Self::NO_SPLATTED_ARG_INDEX as usize {
3068+
// AST validation has already checked the splatted argument index is valid, so just
3069+
// ignore invalid indexes here.
3070+
None
3071+
} else {
3072+
arg.attrs
3073+
.iter()
3074+
.any(|attr| attr.has_name(sym::splat))
3075+
.then_some(u16::try_from(index).unwrap())
3076+
}
3077+
})
3078+
}
30593079
}
30603080

30613081
/// Is the trait definition an auto trait?
@@ -3908,6 +3928,13 @@ pub struct EiiImpl {
39083928
pub is_default: bool,
39093929
}
39103930

3931+
#[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq, Eq)]
3932+
pub enum DelegationSource {
3933+
Single,
3934+
List(LocalExpnId),
3935+
Glob,
3936+
}
3937+
39113938
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]
39123939
pub struct Delegation {
39133940
/// Path resolution id.
@@ -3918,7 +3945,14 @@ pub struct Delegation {
39183945
pub rename: Option<Ident>,
39193946
pub body: Option<Box<Block>>,
39203947
/// The item was expanded from a glob delegation item.
3921-
pub from_glob: bool,
3948+
#[visitable(ignore)]
3949+
pub source: DelegationSource,
3950+
}
3951+
3952+
impl Delegation {
3953+
pub fn last_segment_span(&self) -> Span {
3954+
self.path.segments.last().unwrap().ident.span
3955+
}
39223956
}
39233957

39243958
#[derive(Clone, Encodable, Decodable, Debug, Walkable)]

compiler/rustc_ast_lowering/src/asm.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ use rustc_session::errors::feature_err;
99
use rustc_span::{Span, sym};
1010
use rustc_target::asm;
1111

12-
use super::LoweringContext;
13-
use super::errors::{
12+
use crate::diagnostics::{
1413
AbiSpecifiedMultipleTimes, AttSyntaxOnlyX86, ClobberAbiNotSupported,
1514
InlineAsmUnsupportedTarget, InvalidAbiClobberAbi, InvalidAsmTemplateModifierConst,
1615
InvalidAsmTemplateModifierLabel, InvalidAsmTemplateModifierRegClass,
1716
InvalidAsmTemplateModifierRegClassSub, InvalidAsmTemplateModifierSym, InvalidRegister,
1817
InvalidRegisterClass, RegisterClassOnlyClobber, RegisterClassOnlyClobberStable,
1918
RegisterConflict,
2019
};
21-
use crate::{AllowReturnTypeNotation, ImplTraitContext, ImplTraitPosition, ParamMode};
20+
use crate::{
21+
AllowReturnTypeNotation, ImplTraitContext, ImplTraitPosition, LoweringContext, ParamMode,
22+
};
2223

2324
impl<'hir> LoweringContext<'_, 'hir> {
2425
pub(crate) fn lower_inline_asm(

0 commit comments

Comments
 (0)